Tag Parser  6.4.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
Media::VorbisCommentField Class Reference

The VorbisCommentField class is used by VorbisComment to store the fields. More...

#include <vorbiscommentfield.h>

Inheritance diagram for Media::VorbisCommentField:
[legend]
Collaboration diagram for Media::VorbisCommentField:
[legend]

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)
 Parses a field using the specified iterator. More...
 
void parse (OggIterator &iterator, uint64 &maxSize)
 Parses a field using the specified iterator. More...
 
void parse (std::istream &stream, uint64 &maxSize)
 Parses a field from the specified stream. More...
 
bool make (IoUtilities::BinaryWriter &writer, VorbisCommentFlags flags=VorbisCommentFlags::None)
 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...
 
- Public Member Functions inherited from Media::TagField< VorbisCommentField >
 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< 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...
 
- Public Member Functions inherited from Media::StatusProvider
const NotificationListnotifications () const
 Returns notifications for the current object. More...
 
bool hasNotifications () const
 Returns an indication whether there are notifications for the current object. More...
 
bool hasCriticalNotifications () const
 Returns an indication whether there are critical notifications for the current object. More...
 
NotificationType worstNotificationType () const
 Returns the worst notification type. More...
 
const std::string & currentStatus () const
 Returns a status information for the current object. More...
 
double currentPercentage () const
 Returns the progress percentage of the current object. More...
 
size_t registerCallback (CallbackFunction callback)
 Registers a callback function. More...
 
void unregisterCallback (size_t id)
 Unregisters a previously registered callback function whith the specified id. More...
 
void unregisterAllCallbacks ()
 Unregisters all callback functions. More...
 
void forwardStatusUpdateCalls (StatusProvider *other=nullptr)
 Forwards all status updates calls to the specified statusProvider. More...
 
StatusProviderusedProvider ()
 Returns the provider which callback functions will be called when the status or the percentage is updated. More...
 
void tryToAbort ()
 Commands the object to abort the current operation. More...
 
bool isAborted () const
 Returns an indication whether the current operation should be aborted. More...
 
void invalidateStatus ()
 Invalidates the current status. More...
 
void invalidateNotifications ()
 Invalidates the object's notifications. More...
 
void updateStatus (const std::string &status)
 This method is meant to be called by the derived class to report updated status information. More...
 
void updateStatus (const std::string &status, double percentage)
 This method is meant to be called by the derived class to report updated status information. More...
 
void updatePercentage (double percentage)
 This method is meant to be called by the derived class to report updated progress percentage only. More...
 
void addNotification (const Notification &notification)
 This method is meant to be called by the derived class to add a notification. More...
 
void addNotification (NotificationType type, const std::string &message, const std::string &context)
 This method is meant to be called by the derived class to add a notification of the specified type, message and context. More...
 
void addNotifications (const StatusProvider &from)
 This method is meant to be called by the derived class to add all notifications from another StatusProvider instance. More...
 
void addNotifications (const std::string &higherContext, const StatusProvider &from)
 This method is meant to be called by the derived class to add all notifications from another StatusProvider instance. More...
 
void addNotifications (const NotificationList &notifications)
 This method is meant to be called by the derived class to add the specified notifications. 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...
 

Protected Member Functions

void cleared ()
 Ensures the field is cleared. More...
 
- Protected Member Functions inherited from Media::StatusProvider
 StatusProvider ()
 Constructs a new StatusProvider. More...
 

Friends

class TagField< VorbisCommentField >
 

Additional Inherited Members

- Public Types inherited from Media::TagField< VorbisCommentField >
typedef TagFieldTraits< VorbisCommentField >::implementationType implementationType
 
typedef TagFieldTraits< VorbisCommentField >::identifierType identifierType
 
typedef TagFieldTraits< VorbisCommentField >::typeInfoType typeInfoType
 
- Public Types inherited from Media::StatusProvider
typedef std::function< void(StatusProvider &sender)> CallbackFunction
 
typedef std::vector< CallbackFunctionCallbackVector
 
typedef std::pair< int, CallbackFunctionCallbackPair
 

Detailed Description

The VorbisCommentField class is used by VorbisComment to store the fields.

Definition at line 60 of file vorbiscommentfield.h.

Constructor & Destructor Documentation

◆ VorbisCommentField() [1/2]

Media::VorbisCommentField::VorbisCommentField ( )

Constructs a new Vorbis comment field.

Definition at line 35 of file vorbiscommentfield.cpp.

◆ VorbisCommentField() [2/2]

Media::VorbisCommentField::VorbisCommentField ( const identifierType id,
const TagValue value 
)

Constructs a new Vorbis comment with the specified id and value.

Definition at line 41 of file vorbiscommentfield.cpp.

Member Function Documentation

◆ cleared()

void Media::VorbisCommentField::cleared ( )
inlineprotected

Ensures the field is cleared.

Definition at line 123 of file vorbiscommentfield.h.

◆ fieldIdFromString()

std::string Media::VorbisCommentField::fieldIdFromString ( const char *  idString,
std::size_t  idStringSize = std::string::npos 
)
inlinestatic

Converts the specified ID string representation to an actual ID.

Remarks
As Vorbis field IDs are plain text the string is just passed.

Definition at line 106 of file vorbiscommentfield.h.

◆ fieldIdToString()

std::string Media::VorbisCommentField::fieldIdToString ( const std::string &  id)
inlinestatic

Returns the string representation for the specified id.

Remarks
As Vorbis field IDs are plain text the string is just passed.

Definition at line 115 of file vorbiscommentfield.h.

◆ isAdditionalTypeInfoUsed()

bool Media::VorbisCommentField::isAdditionalTypeInfoUsed ( ) const
inline

Returns whether the additional type info is used.

Definition at line 89 of file vorbiscommentfield.h.

◆ make()

bool Media::VorbisCommentField::make ( IoUtilities::BinaryWriter &  writer,
VorbisCommentFlags  flags = VorbisCommentFlags::None 
)

Writes the field to a stream using the specified writer.

Exceptions
Throwsstd::ios_base::failure when an IO error occurs.
ThrowsMedia::Failure or a derived exception when a making error occurs.
Returns
Returns whether the field has been written. (Some fields might be skipped when specific flags are set.)

Definition at line 161 of file vorbiscommentfield.cpp.

◆ parse() [1/3]

void Media::VorbisCommentField::parse ( OggIterator iterator)

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.

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

Definition at line 116 of file vorbiscommentfield.cpp.

◆ parse() [2/3]

void Media::VorbisCommentField::parse ( OggIterator iterator,
uint64 &  maxSize 
)

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.

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

Definition at line 132 of file vorbiscommentfield.cpp.

◆ parse() [3/3]

void Media::VorbisCommentField::parse ( std::istream &  stream,
uint64 &  maxSize 
)

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.

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

Definition at line 147 of file vorbiscommentfield.cpp.

◆ supportsNestedFields()

bool Media::VorbisCommentField::supportsNestedFields ( ) const
inline

Returns whether nested fields are supported.

Definition at line 97 of file vorbiscommentfield.h.

Friends And Related Function Documentation

◆ TagField< VorbisCommentField >

friend class TagField< VorbisCommentField >
friend

Definition at line 62 of file vorbiscommentfield.h.


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