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::TagField< ImplementationType > Class Template Reference

The TagField class is used by FieldMapBasedTag to store the fields. More...

#include <generictagfield.h>

Public Types

using IdentifierType = typename TagFieldTraits<ImplementationType>::IdentifierType
 
using TypeInfoType = typename TagFieldTraits<ImplementationType>::TypeInfoType
 

Public Member Functions

 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< ImplementationType > & nestedFields () const
 Returns the nested fields.
 
std::vector< ImplementationType > & nestedFields ()
 Returns the nested fields.
 
bool supportsNestedFields () const
 Returns whether nested fields are supported by the implementation.
 

Protected Member Functions

void internallyClearValue ()
 Clears the assigned value; called via clearValue() and clear().
 
void internallyClearFurtherData ()
 Clears further data; called via clear().
 

Friends

class TagFieldTraits< ImplementationType >
 

Detailed Description

template<class ImplementationType>
class TagParser::TagField< ImplementationType >

The TagField class is used by FieldMapBasedTag to store the fields.

A TagField consists of an identifier and a value. An additional type info might be assigned as well. The usage of the type info depends on the particular tag implementation.

Template Parameters
ImplementationTypeSpecifies the type of the actual implementation.
Remarks
This template class is intended to be subclassed using with the "Curiously recurring template pattern".

Definition at line 29 of file generictagfield.h.

Member Typedef Documentation

◆ IdentifierType

template<class ImplementationType >
using TagParser::TagField< ImplementationType >::IdentifierType = typename TagFieldTraits<ImplementationType>::IdentifierType

Definition at line 33 of file generictagfield.h.

◆ TypeInfoType

template<class ImplementationType >
using TagParser::TagField< ImplementationType >::TypeInfoType = typename TagFieldTraits<ImplementationType>::TypeInfoType

Definition at line 34 of file generictagfield.h.

Constructor & Destructor Documentation

◆ TagField() [1/2]

template<class ImplementationType >
TagParser::TagField< ImplementationType >::TagField ( )

Constructs an empty TagField.

Definition at line 84 of file generictagfield.h.

◆ TagField() [2/2]

template<class ImplementationType >
TagParser::TagField< ImplementationType >::TagField ( const IdentifierType & id,
const TagValue & value )

Constructs a new TagField with the specified id and value.

Definition at line 97 of file generictagfield.h.

◆ ~TagField()

template<class ImplementationType >
TagParser::TagField< ImplementationType >::~TagField ( )

Destroys the TagField.

Definition at line 109 of file generictagfield.h.

Member Function Documentation

◆ clear()

template<class ImplementationType >
void TagParser::TagField< ImplementationType >::clear ( )

Clears id, value, type info, sets default flag to false and resets further implementation specific values.

Definition at line 238 of file generictagfield.h.

◆ clearId()

template<class ImplementationType >
void TagParser::TagField< ImplementationType >::clearId ( )
inline

Clears the id of the current TagField.

Definition at line 148 of file generictagfield.h.

◆ clearValue()

template<class ImplementationType >
void TagParser::TagField< ImplementationType >::clearValue ( )
inline

Clears the value of the current TagField.

Definition at line 180 of file generictagfield.h.

◆ id() [1/2]

template<class ImplementationType >
TagField< ImplementationType >::IdentifierType & TagParser::TagField< ImplementationType >::id ( )
inline

Returns the id of the current TagField.

Definition at line 116 of file generictagfield.h.

◆ id() [2/2]

template<class ImplementationType >
const TagField< ImplementationType >::IdentifierType & TagParser::TagField< ImplementationType >::id ( ) const
inline

Returns the id of the current TagField.

Definition at line 124 of file generictagfield.h.

◆ idToString()

template<class ImplementationType >
std::string TagParser::TagField< ImplementationType >::idToString ( ) const
inline

Returns the id of the current TagField as string.

Definition at line 132 of file generictagfield.h.

◆ internallyClearFurtherData()

template<class ImplementationType >
void TagParser::TagField< ImplementationType >::internallyClearFurtherData ( )
protected

Clears further data; called via clear().

Remarks
Shadow when subclassing to clear further data the subclass has.

Definition at line 298 of file generictagfield.h.

◆ internallyClearValue()

template<class ImplementationType >
void TagParser::TagField< ImplementationType >::internallyClearValue ( )
protected

Clears the assigned value; called via clearValue() and clear().

Remarks
Shadow when subclassing to customize clearning a value.

Definition at line 289 of file generictagfield.h.

◆ isAdditionalTypeInfoUsed()

template<class ImplementationType >
bool TagParser::TagField< ImplementationType >::isAdditionalTypeInfoUsed ( ) const
inline

Returns an indication whether the additional type info is used.

The default implementation always returns false. The method might be reimplemented when subclassing.

Definition at line 254 of file generictagfield.h.

◆ isDefault()

template<class ImplementationType >
bool TagParser::TagField< ImplementationType >::isDefault ( ) const
inline

Returns an indication whether the field is labeled as default.

Definition at line 222 of file generictagfield.h.

◆ isTypeInfoAssigned()

template<class ImplementationType >
bool TagParser::TagField< ImplementationType >::isTypeInfoAssigned ( ) const
inline

Returns an indication whether a type info is assigned.

Definition at line 214 of file generictagfield.h.

◆ nestedFields() [1/2]

template<class ImplementationType >
std::vector< ImplementationType > & TagParser::TagField< ImplementationType >::nestedFields ( )
inline

Returns the nested fields.

Remarks
Might be modified. Not all implementations support nested fields.
See also
supportsNestedFields()

Definition at line 272 of file generictagfield.h.

◆ nestedFields() [2/2]

template<class ImplementationType >
const std::vector< ImplementationType > & TagParser::TagField< ImplementationType >::nestedFields ( ) const

Returns the nested fields.

Definition at line 262 of file generictagfield.h.

◆ removeTypeInfo()

template<class ImplementationType >
void TagParser::TagField< ImplementationType >::removeTypeInfo ( )
inline

Removes the type info from the current TagField.

Definition at line 205 of file generictagfield.h.

◆ setDefault()

template<class ImplementationType >
void TagParser::TagField< ImplementationType >::setDefault ( bool isDefault)
inline

Sets whether the field is labeled as default.

Definition at line 230 of file generictagfield.h.

◆ setId()

template<class ImplementationType >
void TagParser::TagField< ImplementationType >::setId ( const IdentifierType & id)
inline

Sets the id of the current Tag Field.

Definition at line 140 of file generictagfield.h.

◆ setTypeInfo()

template<class ImplementationType >
void TagParser::TagField< ImplementationType >::setTypeInfo ( const TypeInfoType & typeInfo)
inline

Sets the type info of the current TagField.

Definition at line 196 of file generictagfield.h.

◆ setValue()

template<class ImplementationType >
void TagParser::TagField< ImplementationType >::setValue ( const TagValue & value)
inline

Sets the value of the current TagField.

Definition at line 172 of file generictagfield.h.

◆ supportsNestedFields()

template<class ImplementationType >
bool TagParser::TagField< ImplementationType >::supportsNestedFields ( ) const
inline

Returns whether nested fields are supported by the implementation.

Definition at line 280 of file generictagfield.h.

◆ typeInfo()

template<class ImplementationType >
const TagField< ImplementationType >::TypeInfoType & TagParser::TagField< ImplementationType >::typeInfo ( ) const
inline

Returns the type info of the current TagField.

Definition at line 188 of file generictagfield.h.

◆ value() [1/2]

template<class ImplementationType >
TagValue & TagParser::TagField< ImplementationType >::value ( )
inline

Returns the value of the current TagField.

Definition at line 156 of file generictagfield.h.

◆ value() [2/2]

template<class ImplementationType >
const TagValue & TagParser::TagField< ImplementationType >::value ( ) const
inline

Returns the value of the current TagField.

Definition at line 164 of file generictagfield.h.

Friends And Related Symbol Documentation

◆ TagFieldTraits< ImplementationType >

template<class ImplementationType >
friend class TagFieldTraits< ImplementationType >
friend

Definition at line 298 of file generictagfield.h.


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