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::MatroskaTagField Class Reference

The MatroskaTagField class is used by MatroskaTag to store the fields. More...

#include <matroskatagfield.h>

Inheritance diagram for TagParser::MatroskaTagField:
[legend]
Collaboration diagram for TagParser::MatroskaTagField:
[legend]

Public Member Functions

 MatroskaTagField ()
 Constructs a new MatroskaTagField.
 
 MatroskaTagField (const std::string &id, const TagValue &value)
 Constructs a new MatroskaTagField with the specified id and value.
 
void reparse (EbmlElement &simpleTagElement, Diagnostics &diag, bool parseNestedFields=true)
 Parses field information from the specified EbmlElement.
 
MatroskaTagFieldMaker prepareMaking (Diagnostics &diag)
 Prepares making.
 
void make (std::ostream &stream, Diagnostics &diag)
 Saves the field to the specified stream (makes a "SimpleTag" element).
 
bool isAdditionalTypeInfoUsed () const
 Returns whether the additional type info is used.
 
bool supportsNestedFields () const
 Returns whether nested fields are supported.
 
- Public Member Functions inherited from TagParser::TagField< MatroskaTagField >
 TagField ()
 Constructs an empty TagField.
 
 TagField (const IdentifierType &id, const TagValue &value)
 Constructs a new TagField with the specified id and value.
 
 ~TagField ()
 Destroys the TagField.
 
IdentifierTypeid ()
 Returns the id of the current TagField.
 
const IdentifierTypeid () const
 Returns the id of the current TagField.
 
std::string idToString () const
 Returns the id of the current TagField as string.
 
void setId (const IdentifierType &id)
 Sets the id of the current Tag Field.
 
void clearId ()
 Clears the id of the current TagField.
 
TagValuevalue ()
 Returns the value of the current TagField.
 
const TagValuevalue () const
 Returns the value of the current TagField.
 
void setValue (const TagValue &value)
 Sets the value of the current TagField.
 
void clearValue ()
 Clears the value of the current TagField.
 
const TypeInfoTypetypeInfo () const
 Returns the type info of the current TagField.
 
void setTypeInfo (const TypeInfoType &typeInfo)
 Sets the type info of the current TagField.
 
void removeTypeInfo ()
 Removes the type info from the current TagField.
 
bool isTypeInfoAssigned () const
 Returns an indication whether a type info is assigned.
 
bool isDefault () const
 Returns an indication whether the field is labeled as default.
 
void setDefault (bool isDefault)
 Sets whether the field is labeled as default.
 
void clear ()
 Clears id, value, type info, sets default flag to false and resets further implementation specific values.
 
bool isAdditionalTypeInfoUsed () const
 Returns an indication whether the additional type info is used.
 
const std::vector< MatroskaTagField > & nestedFields () const
 Returns the nested fields.
 
std::vector< MatroskaTagField > & nestedFields ()
 Returns the nested fields.
 
bool supportsNestedFields () const
 Returns whether nested fields are supported by the implementation.
 

Static Public Member Functions

static std::string fieldIdFromString (std::string_view idString)
 Converts the specified ID string representation to an actual ID.
 
static std::string fieldIdToString (const std::string &id)
 Returns the string representation for the specified id.
 
static void normalizeId (std::string &id)
 Ensures the specified id is upper-case as recommended by the Matroska spec.
 

Friends

class TagField< MatroskaTagField >
 

Additional Inherited Members

- Public Types inherited from TagParser::TagField< MatroskaTagField >
using IdentifierType
 
using TypeInfoType
 
- Protected Member Functions inherited from TagParser::TagField< MatroskaTagField >
void internallyClearValue ()
 Clears the assigned value; called via clearValue() and clear().
 
void internallyClearFurtherData ()
 Clears further data; called via clear().
 

Detailed Description

The MatroskaTagField class is used by MatroskaTag to store the fields.

Constructor & Destructor Documentation

◆ MatroskaTagField() [1/2]

TagParser::MatroskaTagField::MatroskaTagField ( )

Constructs a new MatroskaTagField.

Definition at line 25 of file matroskatagfield.cpp.

◆ MatroskaTagField() [2/2]

TagParser::MatroskaTagField::MatroskaTagField ( const std::string & id,
const TagValue & value )

Constructs a new MatroskaTagField with the specified id and value.

Definition at line 32 of file matroskatagfield.cpp.

Member Function Documentation

◆ fieldIdFromString()

std::string TagParser::MatroskaTagField::fieldIdFromString ( std::string_view idString)
inlinestatic

Converts the specified ID string representation to an actual ID.

Remarks
As Matroska field IDs are text strings the string is just passed.

Definition at line 105 of file matroskatagfield.h.

◆ fieldIdToString()

std::string TagParser::MatroskaTagField::fieldIdToString ( const std::string & id)
inlinestatic

Returns the string representation for the specified id.

Remarks
As Matroska field IDs are text strings the string is just passed.

Definition at line 114 of file matroskatagfield.h.

◆ isAdditionalTypeInfoUsed()

bool TagParser::MatroskaTagField::isAdditionalTypeInfoUsed ( ) const
inline

Returns whether the additional type info is used.

Definition at line 88 of file matroskatagfield.h.

◆ make()

void TagParser::MatroskaTagField::make ( std::ostream & stream,
Diagnostics & diag )

Saves the field to the specified stream (makes a "SimpleTag" element).

  • Exceptions
    Throwsstd::ios_base::failure when an IO error occurs.
    ThrowsTagParser::Failure or a derived exception when a making error occurs.

Definition at line 184 of file matroskatagfield.cpp.

◆ normalizeId()

void TagParser::MatroskaTagField::normalizeId ( std::string & id)
static

Ensures the specified id is upper-case as recommended by the Matroska spec.

See also
https://matroska.org/technical/tagging.html#tag-formatting

Definition at line 193 of file matroskatagfield.cpp.

◆ prepareMaking()

MatroskaTagFieldMaker TagParser::MatroskaTagField::prepareMaking ( Diagnostics & diag)

Prepares making.

Returns
Returns a MatroskaTagFieldMaker object which can be used to actually make the field.
Remarks
The field must NOT be mutated after making is prepared when it is intended to actually make the field using the make method of the returned object.
Exceptions
ThrowsTagParser::Failure or a derived exception when a making error occurs.

This method might be useful when it is necessary to know the size of the field before making it.

Definition at line 162 of file matroskatagfield.cpp.

◆ reparse()

void TagParser::MatroskaTagField::reparse ( EbmlElement & simpleTagElement,
Diagnostics & diag,
bool parseNestedFields = true )

Parses field information from the specified EbmlElement.

The specified atom should be a simple tag element. These elements represents the fields of a MatroskaTag.

Exceptions
Throwsstd::ios_base::failure when an IO error occurs.
ThrowsTagParser::Failure or a derived exception when a parsing error occurs.

Definition at line 47 of file matroskatagfield.cpp.

◆ supportsNestedFields()

bool TagParser::MatroskaTagField::supportsNestedFields ( ) const
inline

Returns whether nested fields are supported.

Definition at line 96 of file matroskatagfield.h.

Friends And Related Symbol Documentation

◆ TagField< MatroskaTagField >

friend class TagField< MatroskaTagField >
friend

Definition at line 48 of file matroskatagfield.h.


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