Tag Parser  6.4.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Public Types | Public Member Functions | Friends | List of all members
Media::TagField< ImplementationType > Class Template Reference

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

#include <generictagfield.h>

Public Types

typedef TagFieldTraits< ImplementationType >::implementationType implementationType
 
typedef TagFieldTraits< ImplementationType >::identifierType identifierType
 
typedef TagFieldTraits< ImplementationType >::typeInfoType typeInfoType
 

Public Member Functions

 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 identifierTypeid () 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...
 
TagValuevalue ()
 Returns the value of the current TagField. More...
 
const TagValuevalue () 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 typeInfoTypetypeInfo () 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 and sets default flag to false. More...
 
bool isAdditionalTypeInfoUsed () const
 Returns an indication whether the additional type info is used. More...
 
const std::vector< ImplementationType > & nestedFields () const
 Returns the nested fields. More...
 
std::vector< ImplementationType > & nestedFields ()
 Returns the nested fields. More...
 
bool supportsNestedFields () const
 Returns whether nested fields are supported by the implementation. More...
 

Friends

class TagFieldTraits< ImplementationType >
 

Detailed Description

template<class ImplementationType>
class Media::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.

Remarks
This template class is intended to be used with the "Curiously recurring template pattern".

Definition at line 9 of file generictagfield.h.

Member Typedef Documentation

◆ identifierType

template<class ImplementationType>
typedef TagFieldTraits<ImplementationType>::identifierType Media::TagField< ImplementationType >::identifierType

Definition at line 37 of file generictagfield.h.

◆ implementationType

template<class ImplementationType>
typedef TagFieldTraits<ImplementationType>::implementationType Media::TagField< ImplementationType >::implementationType

Definition at line 36 of file generictagfield.h.

◆ typeInfoType

template<class ImplementationType>
typedef TagFieldTraits<ImplementationType>::typeInfoType Media::TagField< ImplementationType >::typeInfoType

Definition at line 38 of file generictagfield.h.

Constructor & Destructor Documentation

◆ TagField() [1/2]

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

Constructs an empty TagField.

Definition at line 86 of file generictagfield.h.

◆ TagField() [2/2]

template<class ImplementationType >
Media::TagField< ImplementationType >::TagField ( const identifierType id,
const TagValue value 
)

Constructs a new TagField with the specified id and value.

Definition at line 98 of file generictagfield.h.

◆ ~TagField()

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

Destroys the TagField.

Definition at line 110 of file generictagfield.h.

Member Function Documentation

◆ clear()

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

Clears id, value, type info and sets default flag to false.

Definition at line 242 of file generictagfield.h.

◆ clearId()

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

Clears the id of the current TagField.

Definition at line 141 of file generictagfield.h.

◆ clearValue()

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

Clears the value of the current TagField.

Definition at line 177 of file generictagfield.h.

◆ id()

template<class ImplementationType >
const TagField< ImplementationType >::identifierType & Media::TagField< ImplementationType >::id ( ) const
inline

Returns the id of the current TagField.

Definition at line 117 of file generictagfield.h.

◆ idToString()

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

Definition at line 123 of file generictagfield.h.

◆ isAdditionalTypeInfoUsed()

template<class ImplementationType >
bool Media::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 259 of file generictagfield.h.

◆ isDefault()

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

Returns an indication whether the field is labeled as default.

Definition at line 224 of file generictagfield.h.

◆ isTypeInfoAssigned()

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

Returns an indication whether a type info is assigned.

Definition at line 215 of file generictagfield.h.

◆ nestedFields() [1/2]

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

Returns the nested fields.

Definition at line 268 of file generictagfield.h.

◆ nestedFields() [2/2]

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

Returns the nested fields.

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

Definition at line 279 of file generictagfield.h.

◆ removeTypeInfo()

template<class ImplementationType >
void Media::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 Media::TagField< ImplementationType >::setDefault ( bool  isDefault)
inline

Sets whether the field is labeled as default.

Definition at line 233 of file generictagfield.h.

◆ setId()

template<class ImplementationType >
void Media::TagField< ImplementationType >::setId ( const identifierType id)
inline

Sets the id of the current Tag Field.

Definition at line 132 of file generictagfield.h.

◆ setTypeInfo()

template<class ImplementationType >
void Media::TagField< ImplementationType >::setTypeInfo ( const typeInfoType typeInfo)
inline

Sets the type info of the current TagField.

Definition at line 195 of file generictagfield.h.

◆ setValue()

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

Sets the value of the current TagField.

Definition at line 168 of file generictagfield.h.

◆ supportsNestedFields()

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

Returns whether nested fields are supported by the implementation.

Definition at line 288 of file generictagfield.h.

◆ typeInfo()

template<class ImplementationType >
const TagField< ImplementationType >::typeInfoType & Media::TagField< ImplementationType >::typeInfo ( ) const
inline

Returns the type info of the current TagField.

Definition at line 186 of file generictagfield.h.

◆ value() [1/2]

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

Returns the value of the current TagField.

Definition at line 150 of file generictagfield.h.

◆ value() [2/2]

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

Returns the value of the current TagField.

Definition at line 159 of file generictagfield.h.

Friends And Related Function Documentation

◆ TagFieldTraits< ImplementationType >

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

Definition at line 35 of file generictagfield.h.


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