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

The TagTarget class specifies the target of a tag. More...

#include <tagtarget.h>

Public Types

using IdType = std::uint64_t
 
using IdContainerType = std::vector<IdType>
 

Public Member Functions

 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.
 
std::uint64_t level () const
 Returns the level.
 
void setLevel (std::uint64_t level)
 Sets the level.
 
const std::string & levelName () const
 Returns the level name.
 
void setLevelName (const std::string &levelName)
 Sets the level name.
 
const IdContainerTypetracks () const
 Returns the tracks.
 
IdContainerTypetracks ()
 Returns the tracks.
 
const IdContainerTypechapters () const
 Returns the chapters.
 
IdContainerTypechapters ()
 Returns the chapters.
 
const IdContainerTypeeditions () const
 Returns the editions.
 
IdContainerTypeeditions ()
 Returns the editions.
 
const IdContainerTypeattachments () const
 Returns the attachments.
 
IdContainerTypeattachments ()
 Returns the attachments.
 
bool isEmpty () const
 Returns an indication whether the target is empty.
 
void clear ()
 Clears the TagTarget.
 
std::string toString (const std::function< TagTargetLevel(std::uint64_t)> &tagTargetMapping) const
 Returns the string representation of the current instance.
 
std::string toString (TagTargetLevel tagTargetLevel) const
 Returns the string representation of the current instance.
 
bool operator== (const TagTarget &other) const
 Returns whether the tag targets are equal.
 
bool matches (const TagTarget &other) const
 Returns whether the current instance matches other.
 

Detailed Description

The TagTarget class specifies the target of a tag.

Tags might only target a specific track, chapter, ...

Specifying a target is currently only fully supported by Matroska.

Since Ogg saves tags at stream level, the stream can be specified by passing a TagTarget instance to OggContainer::createTag(). However, only the first track in the tracks() array is considered and any other values are just ignored.

In any other tag formats, the specified target is (currently) completely ignored.

Member Typedef Documentation

◆ IdContainerType

Definition at line 23 of file tagtarget.h.

◆ IdType

using TagParser::TagTarget::IdType = std::uint64_t

Definition at line 22 of file tagtarget.h.

Constructor & Destructor Documentation

◆ TagTarget()

TagParser::TagTarget::TagTarget ( std::uint64_t level = 0,
IdContainerType tracks = IdContainerType(),
IdContainerType chapters = IdContainerType(),
IdContainerType editions = IdContainerType(),
IdContainerType attachments = IdContainerType() )
inlineexplicit

Constructs a new TagTarget with the specified level, track, chapter, edition and attachment.

Definition at line 60 of file tagtarget.h.

Member Function Documentation

◆ attachments() [1/2]

TagTarget::IdContainerType & TagParser::TagTarget::attachments ( )
inline

Returns the attachments.

Definition at line 161 of file tagtarget.h.

◆ attachments() [2/2]

const TagTarget::IdContainerType & TagParser::TagTarget::attachments ( ) const
inline

Returns the attachments.

Definition at line 153 of file tagtarget.h.

◆ chapters() [1/2]

TagTarget::IdContainerType & TagParser::TagTarget::chapters ( )
inline

Returns the chapters.

Definition at line 129 of file tagtarget.h.

◆ chapters() [2/2]

const TagTarget::IdContainerType & TagParser::TagTarget::chapters ( ) const
inline

Returns the chapters.

Definition at line 121 of file tagtarget.h.

◆ clear()

void TagParser::TagTarget::clear ( )
inline

Clears the TagTarget.

Definition at line 177 of file tagtarget.h.

◆ editions() [1/2]

TagTarget::IdContainerType & TagParser::TagTarget::editions ( )
inline

Returns the editions.

Definition at line 145 of file tagtarget.h.

◆ editions() [2/2]

const TagTarget::IdContainerType & TagParser::TagTarget::editions ( ) const
inline

Returns the editions.

Definition at line 137 of file tagtarget.h.

◆ isEmpty()

bool TagParser::TagTarget::isEmpty ( ) const
inline

Returns an indication whether the target is empty.

Definition at line 169 of file tagtarget.h.

◆ level()

std::uint64_t TagParser::TagTarget::level ( ) const
inline

Returns the level.

Definition at line 73 of file tagtarget.h.

◆ levelName()

const std::string & TagParser::TagTarget::levelName ( ) const
inline

Returns the level name.

Definition at line 89 of file tagtarget.h.

◆ matches()

bool TagParser::TagTarget::matches ( const TagTarget & other) const
inline

Returns whether the current instance matches other.

Returns
Returns whether all non-empty/non-null specifications of the current instance (besides the level name) are equal to the corresponding specification in other.

Definition at line 205 of file tagtarget.h.

◆ operator==()

bool TagParser::TagTarget::operator== ( const TagTarget & other) const
inline

Returns whether the tag targets are equal.

Returns
Returns whether all specifications of the current instance (besides the level name) are equal to the corresponding specification in other.

Definition at line 193 of file tagtarget.h.

◆ setLevel()

void TagParser::TagTarget::setLevel ( std::uint64_t level)
inline

Sets the level.

Definition at line 81 of file tagtarget.h.

◆ setLevelName()

void TagParser::TagTarget::setLevelName ( const std::string & levelName)
inline

Sets the level name.

Definition at line 97 of file tagtarget.h.

◆ toString() [1/2]

std::string TagParser::TagTarget::toString ( const std::function< TagTargetLevel(std::uint64_t)> & tagTargetMapping) const
inline

Returns the string representation of the current instance.

Remarks
Uses the specified tagTargetMapping function to map the assigned level() to a TagTargetLevel if no levelName() is assigned.

Definition at line 217 of file tagtarget.h.

◆ toString() [2/2]

std::string TagParser::TagTarget::toString ( TagTargetLevel tagTargetLevel) const

Returns the string representation of the current instance.

Remarks
Uses the specified tagTargetLevel if no levelName() is assigned.

Definition at line 60 of file tagtarget.cpp.

◆ tracks() [1/2]

TagTarget::IdContainerType & TagParser::TagTarget::tracks ( )
inline

Returns the tracks.

Definition at line 113 of file tagtarget.h.

◆ tracks() [2/2]

const TagTarget::IdContainerType & TagParser::TagTarget::tracks ( ) const
inline

Returns the tracks.

Definition at line 105 of file tagtarget.h.


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