Tag Parser 12.4.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Loading...
Searching...
No Matches
TagParser::PositionInSet Class Reference

The PositionInSet class describes the position of an element in a set which consists of a certain number of elements. More...

#include <positioninset.h>

Public Member Functions

constexpr PositionInSet (std::int32_t position=0, std::int32_t total=0)
 Constructs a new Position in set of the specified element position and total element count.
 
template<typename StringType = std::string, CppUtilities::Traits::EnableIfAny< CppUtilities::Traits::IsSpecializationOf< StringType, std::basic_string > > * = nullptr>
 PositionInSet (const StringType &numericString)
 Constructs a new Position in set from the specified numeric string.
 
constexpr std::int32_t position () const
 Returns the element position of the current instance.
 
void setPosition (std::int32_t position)
 Sets the element position of the current instance.
 
constexpr std::int32_t total () const
 Returns the total element count of the current instance.
 
void setTotal (std::int32_t total)
 Sets the total element count of the current instance.
 
constexpr bool isNull () const
 Returns an indication whether both the element position and total element count is 0.
 
constexpr bool operator== (const PositionInSet &other) const
 Returns whether this instance equals other.
 
template<typename StringType = std::string, CppUtilities::Traits::EnableIfAny< CppUtilities::Traits::IsSpecializationOf< StringType, std::basic_string > > * = nullptr>
StringType toString () const
 Returns the string representation of the current PositionInSet.
 

Detailed Description

The PositionInSet class describes the position of an element in a set which consists of a certain number of elements.

This class is used to parse and store values like "9/11" which are used by some tag formats to denote track positions.

Constructor & Destructor Documentation

◆ PositionInSet() [1/2]

TagParser::PositionInSet::PositionInSet ( std::int32_t position = 0,
std::int32_t total = 0 )
inlineexplicitconstexpr

Constructs a new Position in set of the specified element position and total element count.

Parameters
position
total

Definition at line 71 of file positioninset.h.

◆ PositionInSet() [2/2]

template<typename StringType , CppUtilities::Traits::EnableIfAny< CppUtilities::Traits::IsSpecializationOf< StringType, std::basic_string > > * >
TagParser::PositionInSet::PositionInSet ( const StringType & numericString)

Constructs a new Position in set from the specified numeric string.

Template Parameters
StringTypeThe type of the string (should be an instantiation of the basic_string class template).
Parameters
numericStringSpecifies the string containing the position and possibly the total element count (separated by "/").

Definition at line 51 of file positioninset.h.

Member Function Documentation

◆ isNull()

bool TagParser::PositionInSet::isNull ( ) const
inlineconstexpr

Returns an indication whether both the element position and total element count is 0.

Definition at line 112 of file positioninset.h.

◆ operator==()

bool TagParser::PositionInSet::operator== ( const PositionInSet & other) const
inlineconstexpr

Returns whether this instance equals other.

Definition at line 120 of file positioninset.h.

◆ position()

std::int32_t TagParser::PositionInSet::position ( ) const
inlineconstexpr

Returns the element position of the current instance.

Definition at line 80 of file positioninset.h.

◆ setPosition()

void TagParser::PositionInSet::setPosition ( std::int32_t position)
inline

Sets the element position of the current instance.

Definition at line 88 of file positioninset.h.

◆ setTotal()

void TagParser::PositionInSet::setTotal ( std::int32_t total)
inline

Sets the total element count of the current instance.

Definition at line 104 of file positioninset.h.

◆ toString()

template<typename StringType , CppUtilities::Traits::EnableIfAny< CppUtilities::Traits::IsSpecializationOf< StringType, std::basic_string > > * >
StringType TagParser::PositionInSet::toString ( ) const

Returns the string representation of the current PositionInSet.

Definition at line 129 of file positioninset.h.

◆ total()

std::int32_t TagParser::PositionInSet::total ( ) const
inlineconstexpr

Returns the total element count of the current instance.

Definition at line 96 of file positioninset.h.


The documentation for this class was generated from the following file: