Tag Parser: TagParser::VorbisCommentField Class Reference

Tag Parser 12.5.3 C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
TagParser::VorbisCommentField Class Reference

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

`#include <vorbiscommentfield.h>`

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

## Public Member Functions
| VorbisCommentField ()
| Constructs a new Vorbis comment field.
| VorbisCommentField (const IdentifierType &id, const TagValue &value)
| Constructs a new Vorbis comment with the specified id and value.
void | parse (OggIterator &iterator, Diagnostics &diag)
| Parses a field using the specified iterator.
void | parse (OggIterator &iterator, std::uint64_t &maxSize, Diagnostics &diag)
| Parses a field using the specified iterator.
void | parse (std::istream &stream, std::uint64_t &maxSize, Diagnostics &diag)
| Parses a field from the specified stream.
bool | make (CppUtilities::BinaryWriter &writer, VorbisCommentFlags flags, Diagnostics &diag)
| Writes the field to a stream using the specified writer.
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< VorbisCommentField >
| TagField ()
| Constructs an empty TagField.
| ~TagField ()
| Destroys the TagField.
IdentifierType & | id ()
| 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.
TagValue & | value ()
| 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 TypeInfoType & | typeInfo () 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< VorbisCommentField > & | nestedFields () const
| 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.

## Friends
class | TagField< VorbisCommentField >

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

## Detailed Description

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

Definition at line 46 of file vorbiscommentfield.h.

## Constructor & Destructor Documentation

## ◆ VorbisCommentField() [1/2]

TagParser::VorbisCommentField::VorbisCommentField | ( |  | ) |

Constructs a new Vorbis comment field.

Definition at line 33 of file vorbiscommentfield.cpp.

## ◆ VorbisCommentField() [2/2]

TagParser::VorbisCommentField::VorbisCommentField | ( | const IdentifierType & | id,
|  | const TagValue & | value )

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

Definition at line 40 of file vorbiscommentfield.cpp.

## Member Function Documentation

## ◆ fieldIdFromString()

std::string TagParser::VorbisCommentField::fieldIdFromString | ( | std::string_view | idString | ) |
| 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 87 of file vorbiscommentfield.h.

## ◆ fieldIdToString()

std::string TagParser::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 96 of file vorbiscommentfield.h.

## ◆ isAdditionalTypeInfoUsed()

bool TagParser::VorbisCommentField::isAdditionalTypeInfoUsed | ( |  | ) | const
| inline

Returns whether the additional type info is used.

Definition at line 70 of file vorbiscommentfield.h.

## ◆ make()

bool TagParser::VorbisCommentField::make | ( | CppUtilities::BinaryWriter & | writer,
|  | VorbisCommentFlags | flags,
|  | Diagnostics & | diag )

Writes the field to a stream using the specified writer.

Exceptions

  Throws | std::ios_base::failure when an IO error occurs.
  Throws | TagParser::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 178 of file vorbiscommentfield.cpp.

## ◆ parse() [1/3]

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.

Exceptions

  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 133 of file vorbiscommentfield.cpp.

## ◆ parse() [2/3]

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.

Exceptions

  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.

## ◆ parse() [3/3]

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.

Exceptions

  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 164 of file vorbiscommentfield.cpp.

## ◆ supportsNestedFields()

bool TagParser::VorbisCommentField::supportsNestedFields | ( |  | ) | const
| inline

Returns whether nested fields are supported.

Definition at line 78 of file vorbiscommentfield.h.

## Friends And Related Symbol Documentation

## ◆ TagField< VorbisCommentField >

friend class TagField< VorbisCommentField >
| friend

Definition at line 96 of file vorbiscommentfield.h.

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

- vorbis/vorbiscommentfield.h
- vorbis/vorbiscommentfield.cpp