Tag Parser
8.2.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
|
Implementation of TagParser::Tag for ID3v1 tags. More...
#include <id3v1tag.h>
Public Member Functions | |
Id3v1Tag () | |
Constructs a new tag. More... | |
TagType | type () const override |
Returns the type of the tag as TagParser::TagType. More... | |
const char * | typeName () const override |
Returns the type name of the tag as C-style string. More... | |
bool | canEncodingBeUsed (TagTextEncoding encoding) const override |
Returns an indication whether the specified encoding can be used to provide string values for the tag. More... | |
const TagValue & | value (KnownField value) const override |
Returns the value of the specified field. More... | |
bool | setValue (KnownField field, const TagValue &value) override |
Assigns the given value to the specified field. More... | |
bool | setValueConsideringTypeInfo (KnownField field, const TagValue &value, const std::string &typeInfo) |
bool | hasField (KnownField field) const override |
Returns an indication whether the specified field is present. More... | |
void | removeAllFields () override |
Removes all fields from the tag. More... | |
unsigned int | fieldCount () const override |
Returns the number of present fields. More... | |
bool | supportsField (KnownField field) const override |
Returns an indication whether the specified field is supported by the tag. More... | |
void | ensureTextValuesAreProperlyEncoded () override |
Ensures the encoding of all assigned text values is supported by the tag by converting the character set if neccessary. More... | |
void | parse (std::istream &sourceStream, Diagnostics &diag) |
Parses tag information from the specified stream. More... | |
void | make (std::ostream &targetStream, Diagnostics &diag) |
Writes tag information to the specified stream. More... | |
![]() | |
virtual | ~Tag () |
Destroys the Tag. More... | |
std::string | toString () const |
Returns a string representation of the tag. More... | |
virtual TagTextEncoding | proposedTextEncoding () const |
Returns the proposed text encoding. More... | |
virtual std::vector< const TagValue * > | values (KnownField field) const |
Returns the values of the specified field. More... | |
virtual bool | setValues (KnownField field, const std::vector< TagValue > &values) |
Assigns the given values to the specified field. More... | |
const std::string & | version () const |
Returns the version of the tag as std::string. More... | |
uint32 | size () const |
Returns the size of the tag in bytes. More... | |
virtual bool | supportsTarget () const |
Returns an indication whether a target is supported by the tag. More... | |
const TagTarget & | target () const |
Returns the target of tag. More... | |
void | setTarget (const TagTarget &target) |
Sets the target of tag. More... | |
virtual TagTargetLevel | targetLevel () const |
Returns the name of the current tag target level. More... | |
const char * | targetLevelName () const |
Returns the name of the current target level. More... | |
bool | isTargetingLevel (TagTargetLevel tagTargetLevel) const |
Returns whether the tag is targeting the specified tagTargetLevel. More... | |
std::string | targetString () const |
Returns the string representation for the assigned tag target. More... | |
virtual TagDataType | proposedDataType (KnownField field) const |
Returns the proposed data type for the specified field as TagDataType. More... | |
virtual bool | supportsDescription (KnownField field) const |
Returns an indications whether the specified field supports descriptions. More... | |
virtual bool | supportsMimeType (KnownField field) const |
Returns an indications whether the specified field supports mime types. More... | |
virtual bool | supportsMultipleValues (KnownField field) const |
Returns an indications whether the specified field supports multiple values. More... | |
virtual unsigned int | insertValues (const Tag &from, bool overwrite) |
Inserts all compatible values from another Tag. More... | |
Static Public Attributes | |
static constexpr TagType | tagType = TagType::Id3v1Tag |
static constexpr const char * | tagName = "ID3v1 tag" |
Additional Inherited Members | |
![]() | |
Tag () | |
Constructs a new Tag. More... | |
![]() | |
std::string | m_version |
uint32 | m_size |
TagTarget | m_target |
Implementation of TagParser::Tag for ID3v1 tags.
Definition at line 10 of file id3v1tag.h.
TagParser::Id3v1Tag::Id3v1Tag | ( | ) |
Constructs a new tag.
Definition at line 24 of file id3v1tag.cpp.
|
overridevirtual |
Returns an indication whether the specified encoding can be used to provide string values for the tag.
Only the proposedTextEncoding() is accepted by default. This might be overwritten when subclassing.
The tag class and its subclasses do not perform any conversions. You have to provide all string values using an encoding which is appropriate for the specific tag type. This method is meant to determine if a particular encoding can be used.
Reimplemented from TagParser::Tag.
Definition at line 38 of file id3v1tag.cpp.
|
overridevirtual |
Ensures the encoding of all assigned text values is supported by the tag by converting the character set if neccessary.
Implements TagParser::Tag.
Definition at line 251 of file id3v1tag.cpp.
|
overridevirtual |
Returns the number of present fields.
Implements TagParser::Tag.
Definition at line 224 of file id3v1tag.cpp.
|
overridevirtual |
Returns an indication whether the specified field is present.
Implements TagParser::Tag.
Definition at line 191 of file id3v1tag.cpp.
void TagParser::Id3v1Tag::make | ( | std::ostream & | targetStream, |
Diagnostics & | diag | ||
) |
Writes tag information to the specified stream.
Throws | std::ios_base::failure when an IO error occurs. |
Throws | TagParser::Failure or a derived exception when a making error occurs. |
Definition at line 83 of file id3v1tag.cpp.
void TagParser::Id3v1Tag::parse | ( | std::istream & | stream, |
Diagnostics & | diag | ||
) |
Parses tag information from the specified stream.
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 49 of file id3v1tag.cpp.
|
overridevirtual |
Removes all fields from the tag.
Implements TagParser::Tag.
Definition at line 213 of file id3v1tag.cpp.
|
overridevirtual |
Assigns the given value to the specified field.
Implements TagParser::Tag.
Definition at line 156 of file id3v1tag.cpp.
bool TagParser::Id3v1Tag::setValueConsideringTypeInfo | ( | KnownField | field, |
const TagValue & | value, | ||
const std::string & | typeInfo | ||
) |
Definition at line 186 of file id3v1tag.cpp.
|
overridevirtual |
Returns an indication whether the specified field is supported by the tag.
Implements TagParser::Tag.
Definition at line 235 of file id3v1tag.cpp.
|
overridevirtual |
Returns the type of the tag as TagParser::TagType.
This is TagType::Unspecified by default and might be overwritten when subclassing.
Reimplemented from TagParser::Tag.
Definition at line 28 of file id3v1tag.cpp.
|
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::Tag.
Definition at line 33 of file id3v1tag.cpp.
|
overridevirtual |
Returns the value of the specified field.
Implements TagParser::Tag.
Definition at line 134 of file id3v1tag.cpp.
|
static |
Definition at line 15 of file id3v1tag.h.
|
static |
Definition at line 14 of file id3v1tag.h.