Tag Parser
9.1.2
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
|
Go to the documentation of this file. 1 #ifndef TAG_PARSER_TAG_H
2 #define TAG_PARSER_TAG_H
7 #include <c++utilities/io/binaryreader.h>
11 #include <type_traits>
43 Invalid = std::numeric_limits<unsigned int>::max(),
103 virtual const char *typeName()
const;
104 std::string toString()
const;
108 virtual std::vector<const TagValue *> values(
KnownField field)
const;
110 virtual bool setValues(
KnownField field,
const std::vector<TagValue> &values);
111 virtual bool hasField(
KnownField field)
const = 0;
112 virtual void removeAllFields() = 0;
113 const std::string &
version()
const;
114 std::uint32_t size()
const;
115 virtual bool supportsTarget()
const;
119 const char *targetLevelName()
const;
121 std::string targetString()
const;
122 virtual unsigned int fieldCount()
const = 0;
123 virtual bool supportsField(
KnownField field)
const = 0;
125 virtual bool supportsDescription(
KnownField field)
const;
126 virtual bool supportsMimeType(
KnownField field)
const;
127 virtual bool supportsMultipleValues(
KnownField field)
const;
128 virtual unsigned int insertValues(
const Tag &from,
bool overwrite);
129 virtual void ensureTextValuesAreProperlyEncoded() = 0;
146 return "unspecified";
246 #endif // TAG_PARSER_TAG_H
const char * targetLevelName() const
Returns the name of the current target level.
constexpr KnownField nextKnownField(KnownField field)
Returns the next known field.
virtual TagTargetLevel targetLevel() const
Returns the name of the current tag target level.
TagTextEncoding
Specifies the text encoding.
void setTarget(const TagTarget &target)
Sets the target of tag.
const std::string & version() const
Returns the version of the tag as std::string. The version denotation depends on the tag type.
virtual TagDataType proposedDataType(KnownField field) const
Returns the proposed data type for the specified field as TagDataType.
virtual bool supportsDescription(KnownField field) const
Returns an indications whether the specified field supports descriptions.
The Tag class is used to store, read and write tag information.
constexpr KnownField lastKnownField
The last valid entry in the TagParser::KnownField enum.
std::uint32_t size() const
Returns the size of the tag in bytes. The tag needs to be parsed before.
std::string toString(const std::function< TagTargetLevel(std::uint64_t)> &tagTargetMapping) const
Returns the string representation of the current instance.
TagTargetLevel
The TagTargetLevel enum specifies tag target levels.
Contains all classes and functions of the TagInfo library.
TagDataType
Specifies the data type.
const TagTarget & target() const
Returns the target of tag.
virtual bool supportsMultipleValues(KnownField field) const
Returns an indications whether the specified field supports multiple values.
virtual TagTextEncoding proposedTextEncoding() const
Returns the proposed text encoding.
constexpr unsigned int knownFieldArraySize
The number of valid entries in the TagParser::KnownField enum.
const TAG_PARSER_EXPORT char * tagTargetLevelName(TagTargetLevel tagTargetLevel)
Returns a string representation for the specified tagTargetLevel.
virtual bool canEncodingBeUsed(TagTextEncoding encoding) const
Returns an indication whether the specified encoding can be used to provide string values for the tag...
bool isTargetingLevel(TagTargetLevel tagTargetLevel) const
Returns whether the tag is targeting the specified tagTargetLevel.
Implementation of TagParser::Tag for ID3v2 tags.
KnownField
Specifies the field.
Implementation of TagParser::Tag for ID3v1 tags.
virtual bool supportsMimeType(KnownField field) const
Returns an indications whether the specified field supports mime types.
virtual const char * typeName() const
Returns the type name of the tag as C-style string.
virtual bool supportsTarget() const
Returns an indication whether a target is supported by the tag.
The TagTarget class specifies the target of a tag.
std::string targetString() const
Returns the string representation for the assigned tag target.
The TagValue class wraps values of different types. It is meant to be assigned to a tag field.
Implementation of TagParser::Tag for the Matroska container.
Implementation of TagParser::Tag for the MP4 container.
virtual TagType type() const
Returns the type of the tag as TagParser::TagType.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
constexpr KnownField firstKnownField
The first valid entry in the TagParser::KnownField enum.
TagType
Specifies the tag type.