1#ifndef TAG_PARSER_TAGTARGET_H
2#define TAG_PARSER_TAGTARGET_H
28 std::uint64_t level()
const;
29 void setLevel(std::uint64_t level);
30 const std::string &levelName()
const;
31 void setLevelName(
const std::string &levelName);
42 std::string toString(
const std::function<
TagTargetLevel(std::uint64_t)> &tagTargetMapping)
const;
45 bool matches(
const TagTarget &other)
const;
48 std::uint64_t m_level;
49 std::string m_levelName;
64 , m_chapters(chapters)
65 , m_editions(editions)
66 , m_attachments(attachments)
75 return m_level ? m_level : 50;
155 return m_attachments;
163 return m_attachments;
171 return m_level == 0 && m_levelName.empty() && m_tracks.empty() && m_chapters.empty() && m_editions.empty() && m_attachments.empty();
184 m_attachments.clear();
195 return level() == other.
level() && m_tracks == other.m_tracks && m_chapters == other.m_chapters && m_editions == other.m_editions
196 && m_attachments == other.m_attachments;
207 return (!m_level ||
level() == other.
level()) && (m_tracks.empty() || m_tracks == other.m_tracks)
208 && (m_chapters.empty() || m_chapters == other.m_chapters) && (m_editions.empty() || m_editions == other.m_editions)
209 && (m_attachments.empty() || m_attachments == other.m_attachments);
The TagTarget class specifies the target of a tag.
const IdContainerType & tracks() const
Returns the tracks.
std::vector< IdType > IdContainerType
bool matches(const TagTarget &other) const
Returns whether the current instance matches other.
const IdContainerType & chapters() const
Returns the chapters.
std::uint64_t level() const
Returns the level.
std::string toString(const std::function< TagTargetLevel(std::uint64_t)> &tagTargetMapping) const
Returns the string representation of the current instance.
TagTarget(std::uint64_t level=0, IdContainerType tracks=IdContainerType(), IdContainerType chapters=IdContainerType(), IdContainerType editions=IdContainerType(), IdContainerType attachments=IdContainerType())
Constructs a new TagTarget with the specified level, track, chapter, edition and attachment.
const std::string & levelName() const
Returns the level name.
bool isEmpty() const
Returns an indication whether the target is empty.
bool operator==(const TagTarget &other) const
Returns whether the tag targets are equal.
const IdContainerType & editions() const
Returns the editions.
void clear()
Clears the TagTarget.
const IdContainerType & attachments() const
Returns the attachments.
void setLevel(std::uint64_t level)
Sets the level.
void setLevelName(const std::string &levelName)
Sets the level name.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Contains all classes and functions of the TagInfo library.
TAG_PARSER_EXPORT std::string_view tagTargetLevelName(TagTargetLevel tagTargetLevel)
Returns a string representation for the specified tagTargetLevel.
TagTargetLevel
The TagTargetLevel enum specifies tag target levels.
constexpr bool operator==(std::uint8_t lhs, FlacMetaDataBlockType type)