Tag Parser
9.3.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
|
The VorbisCommentField class is used by VorbisComment to store the fields. More...
#include <vorbiscommentfield.h>
Public Member Functions | |
VorbisCommentField () | |
Constructs a new Vorbis comment field. More... | |
VorbisCommentField (const IdentifierType &id, const TagValue &value) | |
Constructs a new Vorbis comment with the specified id and value. More... | |
void | parse (OggIterator &iterator, Diagnostics &diag) |
Parses a field using the specified iterator. More... | |
void | parse (OggIterator &iterator, std::uint64_t &maxSize, Diagnostics &diag) |
Parses a field using the specified iterator. More... | |
void | parse (std::istream &stream, std::uint64_t &maxSize, Diagnostics &diag) |
Parses a field from the specified stream. More... | |
bool | make (CppUtilities::BinaryWriter &writer, VorbisCommentFlags flags, Diagnostics &diag) |
Writes the field to a stream using the specified writer. More... | |
bool | isAdditionalTypeInfoUsed () const |
Returns whether the additional type info is used. More... | |
bool | supportsNestedFields () const |
Returns whether nested fields are supported. More... | |
![]() | |
TagField () | |
Constructs an empty TagField. More... | |
TagField (const IdentifierType &id, const TagValue &value) | |
Constructs a new TagField with the specified id and value. More... | |
~TagField () | |
Destroys the TagField. More... | |
const IdentifierType & | id () const |
Returns the id of the current TagField. More... | |
std::string | idToString () const |
void | setId (const IdentifierType &id) |
Sets the id of the current Tag Field. More... | |
void | clearId () |
Clears the id of the current TagField. More... | |
TagValue & | value () |
Returns the value of the current TagField. More... | |
const TagValue & | value () const |
Returns the value of the current TagField. More... | |
void | setValue (const TagValue &value) |
Sets the value of the current TagField. More... | |
void | clearValue () |
Clears the value of the current TagField. More... | |
const TypeInfoType & | typeInfo () const |
Returns the type info of the current TagField. More... | |
void | setTypeInfo (const TypeInfoType &typeInfo) |
Sets the type info of the current TagField. More... | |
void | removeTypeInfo () |
Removes the type info from the current TagField. More... | |
bool | isTypeInfoAssigned () const |
Returns an indication whether a type info is assigned. More... | |
bool | isDefault () const |
Returns an indication whether the field is labeled as default. More... | |
void | setDefault (bool isDefault) |
Sets whether the field is labeled as default. More... | |
void | clear () |
Clears id, value, type info, sets default flag to false and resets further implementation specific values. More... | |
bool | isAdditionalTypeInfoUsed () const |
Returns an indication whether the additional type info is used. More... | |
const std::vector< VorbisCommentField > & | nestedFields () const |
Returns the nested fields. More... | |
std::vector< VorbisCommentField > & | nestedFields () |
Returns the nested fields. More... | |
bool | supportsNestedFields () const |
Returns whether nested fields are supported by the implementation. More... | |
Static Public Member Functions | |
static std::string | fieldIdFromString (const char *idString, std::size_t idStringSize=std::string::npos) |
Converts the specified ID string representation to an actual ID. More... | |
static std::string | fieldIdToString (const std::string &id) |
Returns the string representation for the specified id. More... | |
Friends | |
class | TagField< VorbisCommentField > |
Additional Inherited Members | |
![]() | |
using | IdentifierType = typename TagFieldTraits< VorbisCommentField >::IdentifierType |
using | TypeInfoType = typename TagFieldTraits< VorbisCommentField >::TypeInfoType |
The VorbisCommentField class is used by VorbisComment to store the fields.
Definition at line 47 of file vorbiscommentfield.h.
TagParser::VorbisCommentField::VorbisCommentField | ( | ) |
Constructs a new Vorbis comment field.
Definition at line 35 of file vorbiscommentfield.cpp.
TagParser::VorbisCommentField::VorbisCommentField | ( | const IdentifierType & | id, |
const TagValue & | value | ||
) |
Constructs a new Vorbis comment with the specified id and value.
Definition at line 42 of file vorbiscommentfield.cpp.
|
inlinestatic |
Converts the specified ID string representation to an actual ID.
Definition at line 89 of file vorbiscommentfield.h.
|
inlinestatic |
Returns the string representation for the specified id.
Definition at line 98 of file vorbiscommentfield.h.
|
inline |
Returns whether the additional type info is used.
Definition at line 72 of file vorbiscommentfield.h.
bool TagParser::VorbisCommentField::make | ( | CppUtilities::BinaryWriter & | writer, |
VorbisCommentFlags | flags, | ||
Diagnostics & | diag | ||
) |
Writes the field to a stream using the specified writer.
Throws | std::ios_base::failure when an IO error occurs. |
Throws | TagParser::Failure or a derived exception when a making error occurs. |
Definition at line 163 of file vorbiscommentfield.cpp.
void TagParser::VorbisCommentField::parse | ( | OggIterator & | iterator, |
Diagnostics & | diag | ||
) |
Parses a field using the specified iterator.
The currentCharacterOffset() of the iterator is expected to be at the beginning of the field to be parsed.
Throws | std::ios_base::failure when an IO error occurs. |
Throws | TagParser::Failure or a derived exception when a parsing error occurs. |
Definition at line 118 of file vorbiscommentfield.cpp.
void TagParser::VorbisCommentField::parse | ( | OggIterator & | iterator, |
std::uint64_t & | maxSize, | ||
Diagnostics & | diag | ||
) |
Parses a field using the specified iterator.
The currentCharacterOffset() of the iterator is expected to be at the beginning of the field to be parsed.
Throws | std::ios_base::failure when an IO error occurs. |
Throws | TagParser::Failure or a derived exception when a parsing error occurs. |
Definition at line 134 of file vorbiscommentfield.cpp.
void TagParser::VorbisCommentField::parse | ( | std::istream & | stream, |
std::uint64_t & | maxSize, | ||
Diagnostics & | diag | ||
) |
Parses a field from the specified stream.
The position of the current character in the input stream is expected to be at the beginning of the field to be parsed.
Throws | std::ios_base::failure when an IO error occurs. |
Throws | TagParser::Failure or a derived exception when a parsing error occurs. |
Definition at line 149 of file vorbiscommentfield.cpp.
|
inline |
Returns whether nested fields are supported.
Definition at line 80 of file vorbiscommentfield.h.
|
friend |
Definition at line 106 of file vorbiscommentfield.h.