1 #ifndef POSITIONINSET_H 2 #define POSITIONINSET_H 6 #include <c++utilities/conversion/stringconversion.h> 24 template <
typename StringType = std::
string>
27 constexpr int32 position()
const;
28 constexpr int32 total()
const;
29 constexpr
bool isNull()
const;
30 constexpr
bool operator==(
const PositionInSet &other)
const;
32 template <
typename StringType = std::
string>
33 StringType toString()
const;
46 template <
typename StringType>
51 size_t separator = numericString.find(
'/');
52 if(separator == StringType::npos || separator == numericString.length() - 1) {
53 m_position = ConversionUtilities::stringToNumber<int32, StringType>(numericString);
54 }
else if(separator == 0) {
55 m_total = ConversionUtilities::stringToNumber<int32, StringType>(numericString.substr(1));
57 m_position = ConversionUtilities::stringToNumber<int32, StringType>(numericString.substr(0, separator));
58 m_total = ConversionUtilities::stringToNumber<int32, StringType>(numericString.substr(separator + 1));
93 return m_position == 0 && m_total == 0;
101 return m_position == other.m_position && m_total == other.m_total;
107 template <
typename StringType>
110 std::basic_stringstream<typename StringType::value_type> ss;
115 ss <<
'/' << m_total;
122 #endif // POSITIONINSET_H
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.