Tag Parser 12.1.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Friends | List of all members
TagParser::OggVorbisComment Class Referencefinal

Specialization of TagParser::VorbisComment for Vorbis comments inside an OGG stream. More...

#include <oggcontainer.h>

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

Public Member Functions

 OggVorbisComment ()
 Constructs a new OGG Vorbis comment.
 
TagType type () const override
 Returns the type of the tag as TagParser::TagType.
 
std::string_view typeName () const override
 Returns the type name of the tag as C-style string.
 
bool supportsTarget () const override
 Returns true; the target is used to specify the stream.
 
OggParameteroggParams ()
 Returns the OGG parameter for the comment.
 
const OggParameteroggParams () const
 Returns the OGG parameter for the comment.
 
- Public Member Functions inherited from TagParser::VorbisComment
 VorbisComment ()
 Constructs a new Vorbis comment.
 
bool canEncodingBeUsed (TagTextEncoding encoding) const override
 Returns an indication whether the specified encoding can be used to provide string values for the tag.
 
const TagValuevalue (KnownField field) const override
 Returns the value of the specified field.
 
bool setValue (KnownField field, const TagValue &value) override
 Assigns the given value to the specified field.
 
void parse (OggIterator &iterator, VorbisCommentFlags flags, Diagnostics &diag)
 Parses tag information using the specified OGG iterator.
 
void parse (std::istream &stream, std::uint64_t maxSize, VorbisCommentFlags flags, Diagnostics &diag)
 Parses tag information using the specified OGG iterator.
 
void make (std::ostream &stream, VorbisCommentFlags flags, Diagnostics &diag)
 Writes tag information to the specified stream.
 
const TagValuevendor () const
 Returns the vendor.
 
void setVendor (const TagValue &vendor)
 Sets the vendor.
 
bool supportsMultipleValues (KnownField) const override
 Allows multiple values for all fields.
 
- Public Member Functions inherited from TagParser::FieldMapBasedTag< VorbisComment >
 FieldMapBasedTag ()
 Constructs a new FieldMapBasedTag.
 
TagTextEncoding proposedTextEncoding () const
 Returns the proposed text encoding.
 
const TagValuevalue (const IdentifierType &id) const
 Returns the value of the field with the specified id.
 
std::vector< const TagValue * > values (const IdentifierType &id) const
 Returns the values of the field with the specified id.
 
std::vector< const TagValue * > values (KnownField field) const
 Returns the values of the specified field.
 
bool setValue (const IdentifierType &id, const TagValue &value)
 Assigns the given value to the field with the specified id.
 
bool setValues (const IdentifierType &id, const std::vector< TagValue > &values)
 Assigns the given values to the field with the specified id.
 
bool setValues (KnownField field, const std::vector< TagValue > &values)
 Assigns the given values to the field with the specified id.
 
bool hasField (KnownField field) const
 Returns an indication whether the specified field is present.
 
bool hasField (const IdentifierType &id) const
 Returns an indication whether the field with the specified id is present.
 
void removeAllFields ()
 Removes all fields from the tag.
 
const std::multimap< IdentifierType, FieldType, Compare > & fields () const
 Returns the fields of the tag by providing direct access to the field map of the tag.
 
std::multimap< IdentifierType, FieldType, Compare > & fields ()
 Returns the fields of the tag by providing direct access to the field map of the tag.
 
std::size_t fieldCount () const
 Returns the number of present fields.
 
IdentifierType fieldId (KnownField value) const
 Returns the ID for the specified field.
 
KnownField knownField (const IdentifierType &id) const
 Returns the field for the specified ID.
 
bool supportsField (KnownField field) const
 Returns an indication whether the specified field is supported by the tag.
 
TagDataType proposedDataType (const IdentifierType &id) const
 Returns the proposed data type for the field with the specified id.
 
virtual TagDataType proposedDataType (KnownField field) const
 Returns the proposed data type for the specified field as TagDataType.
 
std::size_t insertFields (const FieldMapBasedTag< VorbisComment > &from, bool overwrite)
 Inserts all fields from another tag of the same field type and compare function.
 
std::size_t insertValues (const Tag &from, bool overwrite)
 Inserts all compatible values from another Tag.
 
void ensureTextValuesAreProperlyEncoded ()
 Ensures the encoding of all assigned text values is supported by the tag by converting the character set if necessary.
 
- Public Member Functions inherited from TagParser::Tag
virtual ~Tag ()
 Destroys the Tag.
 
std::string toString () const
 Returns a string representation of the tag.
 
const std::string & version () const
 Returns the version of the tag as std::string.
 
std::uint64_t size () const
 Returns the size the tag within the file it is parsed from in bytes.
 
const TagTargettarget () const
 
TagTargettarget ()
 Returns the target of tag.
 
void setTarget (const TagTarget &target)
 Sets the target of tag.
 
virtual TagTargetLevel targetLevel () const
 Returns the name of the current tag target level.
 
std::string_view targetLevelName () const
 Returns the name of the current target level.
 
bool isTargetingLevel (TagTargetLevel tagTargetLevel) const
 Returns whether the tag is targeting the specified tagTargetLevel.
 
std::string targetString () const
 Returns the string representation for the assigned tag target.
 
virtual bool supportsDescription (KnownField field) const
 Returns an indications whether the specified field supports descriptions.
 
virtual bool supportsMimeType (KnownField field) const
 Returns an indications whether the specified field supports mime types.
 

Static Public Attributes

static constexpr TagType tagType = TagType::OggVorbisComment
 
static constexpr std::string_view tagName = "OGG Vorbis comment"
 
- Static Public Attributes inherited from TagParser::VorbisComment
static constexpr TagType tagType = TagType::VorbisComment
 
static constexpr std::string_view tagName = "Vorbis comment"
 
static constexpr TagTextEncoding defaultTextEncoding = TagTextEncoding::Utf8
 

Friends

class OggContainer
 

Additional Inherited Members

- Public Types inherited from TagParser::FieldMapBasedTag< VorbisComment >
using FieldType = typename FieldMapBasedTagTraits< VorbisComment >::FieldType
 
using IdentifierType = typename FieldMapBasedTagTraits< VorbisComment >::FieldType::IdentifierType
 
using Compare = typename FieldMapBasedTagTraits< VorbisComment >::Compare
 
- Protected Types inherited from TagParser::FieldMapBasedTag< VorbisComment >
using CRTPBase = FieldMapBasedTag< VorbisComment >
 
- Protected Member Functions inherited from TagParser::VorbisComment
IdentifierType internallyGetFieldId (KnownField field) const
 
KnownField internallyGetKnownField (const IdentifierType &id) const
 
- Protected Member Functions inherited from TagParser::FieldMapBasedTag< VorbisComment >
const TagValueinternallyGetValue (const IdentifierType &id) const
 Default implementation for value().
 
void internallyGetValuesFromField (const FieldType &field, std::vector< const TagValue * > &values) const
 Default way to gather values from a field in internallyGetValues().
 
std::vector< const TagValue * > internallyGetValues (const IdentifierType &id) const
 Default implementation for values().
 
bool internallySetValue (const IdentifierType &id, const TagValue &value)
 Default implementation for setValue().
 
bool internallySetValues (const IdentifierType &id, const std::vector< TagValue > &values)
 Default implementation for setValues().
 
bool internallyHasField (const IdentifierType &id) const
 Default implementation for hasField().
 
TagDataType internallyGetProposedDataType (const IdentifierType &id) const
 Default implementation for proposedDataType().
 
- Protected Member Functions inherited from TagParser::Tag
 Tag ()
 Constructs a new Tag.
 
- Protected Attributes inherited from TagParser::Tag
std::string m_version
 
std::uint64_t m_size
 
std::unique_ptr< TagPrivatem_p
 
TagTarget m_target
 

Detailed Description

Specialization of TagParser::VorbisComment for Vorbis comments inside an OGG stream.

Definition at line 69 of file oggcontainer.h.

Constructor & Destructor Documentation

◆ OggVorbisComment()

TagParser::OggVorbisComment::OggVorbisComment ( )
inline

Constructs a new OGG Vorbis comment.

Definition at line 91 of file oggcontainer.h.

Member Function Documentation

◆ oggParams() [1/2]

OggParameter & TagParser::OggVorbisComment::oggParams ( )
inline

Returns the OGG parameter for the comment.

Consists of first page index, first segment index, last page index, last segment index and tag index (in this order). These values are used and managed by the OggContainer class and do not affect the behavior of the VorbisComment instance.

Definition at line 118 of file oggcontainer.h.

◆ oggParams() [2/2]

const OggParameter & TagParser::OggVorbisComment::oggParams ( ) const
inline

Returns the OGG parameter for the comment.

Consists of first page index, first segment index, last page index, last segment index and tag index (in this order). These values are used and managed by the OggContainer class and do not affect the behavior of the VorbisComment instance.

Definition at line 129 of file oggcontainer.h.

◆ supportsTarget()

bool TagParser::OggVorbisComment::supportsTarget ( ) const
inlineoverridevirtual

Returns true; the target is used to specify the stream.

Remarks
At this point, one cannot move a tag from one stream to another by changing the target. So the target is only evaluated when invoking createTag() and added to parsed tags for informative purposes.
See also
OggContainer::createTag(), TagTarget

Reimplemented from TagParser::Tag.

Definition at line 107 of file oggcontainer.h.

◆ type()

TagType TagParser::OggVorbisComment::type ( ) const
inlineoverridevirtual

Returns the type of the tag as TagParser::TagType.

This is TagType::Unspecified by default and might be overwritten when subclassing.

Reimplemented from TagParser::FieldMapBasedTag< VorbisComment >.

Definition at line 95 of file oggcontainer.h.

◆ typeName()

std::string_view TagParser::OggVorbisComment::typeName ( ) const
overridevirtual

Returns the type name of the tag as C-style string.

This is "unspecified" by default and might be overwritten when subclassing.

Reimplemented from TagParser::FieldMapBasedTag< VorbisComment >.

Definition at line 25 of file oggcontainer.cpp.

Friends And Related Symbol Documentation

◆ OggContainer

friend class OggContainer
friend

Definition at line 70 of file oggcontainer.h.

Member Data Documentation

◆ tagName

constexpr std::string_view TagParser::OggVorbisComment::tagName = "OGG Vorbis comment"
staticconstexpr

Definition at line 76 of file oggcontainer.h.

◆ tagType

constexpr TagType TagParser::OggVorbisComment::tagType = TagType::OggVorbisComment
staticconstexpr

Definition at line 75 of file oggcontainer.h.


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