1#ifndef TAG_PARSER_TAG_H
2#define TAG_PARSER_TAG_H
8#include <c++utilities/io/binaryreader.h>
38 Invalid = std::numeric_limits<unsigned int>::max(),
164 CPP_UTILITIES_UNUSED(field)
183 virtual TagType type()
const;
184 virtual std::string_view typeName()
const;
185 std::string toString()
const;
186 virtual TagTextEncoding proposedTextEncoding()
const;
187 virtual bool canEncodingBeUsed(TagTextEncoding encoding)
const;
189 virtual std::vector<const TagValue *> values(
KnownField field)
const;
191 virtual bool setValues(
KnownField field,
const std::vector<TagValue> &values);
194 const std::string &version()
const;
195 std::uint64_t size()
const;
196 virtual bool supportsTarget()
const;
201 std::string_view targetLevelName()
const;
203 std::string targetString()
const;
207 virtual bool supportsDescription(
KnownField field)
const;
208 virtual bool supportsMimeType(
KnownField field)
const;
209 virtual bool supportsMultipleValues(
KnownField field)
const;
210 virtual std::size_t insertValues(
const Tag &from,
bool overwrite);
218 std::unique_ptr<TagPrivate>
m_p;
229 return "unspecified";
The TagTarget class specifies the target of a tag.
std::string toString(const std::function< TagTargetLevel(std::uint64_t)> &tagTargetMapping) const
Returns the string representation of the current instance.
The TagValue class wraps values of different types.
The Tag class is used to store, read and write tag information.
virtual TagTargetLevel targetLevel() const
Returns the name of the current tag target level.
virtual bool setValue(KnownField field, const TagValue &value)=0
Assigns the given value to the specified field.
virtual void ensureTextValuesAreProperlyEncoded()=0
Ensures the encoding of all assigned text values is supported by the tag by converting the character ...
std::uint64_t size() const
Returns the size the tag within the file it is parsed from in bytes.
void setTarget(const TagTarget &target)
Sets the target of tag.
std::unique_ptr< TagPrivate > m_p
virtual bool canEncodingBeUsed(TagTextEncoding encoding) const
Returns an indication whether the specified encoding can be used to provide string values for the tag...
virtual bool supportsTarget() const
Returns an indication whether a target is supported by the tag.
std::string_view targetLevelName() const
Returns the name of the current target level.
virtual TagTextEncoding proposedTextEncoding() const
Returns the proposed text encoding.
virtual std::string_view typeName() const
Returns the type name of the tag as C-style string.
virtual TagType type() const
Returns the type of the tag as TagParser::TagType.
const TagTarget & target() const
virtual bool supportsField(KnownField field) const =0
Returns an indication whether the specified field is supported by the tag.
virtual TagDataType proposedDataType(KnownField field) const
Returns the proposed data type for the specified field as TagDataType.
virtual bool supportsMultipleValues(KnownField field) const
Returns an indications whether the specified field supports multiple values.
virtual void removeAllFields()=0
Removes all fields from the tag.
bool isTargetingLevel(TagTargetLevel tagTargetLevel) const
Returns whether the tag is targeting the specified tagTargetLevel.
const std::string & version() const
Returns the version of the tag as std::string.
virtual bool hasField(KnownField field) const =0
Returns an indication whether the specified field is present.
virtual bool supportsMimeType(KnownField field) const
Returns an indications whether the specified field supports mime types.
virtual bool supportsDescription(KnownField field) const
Returns an indications whether the specified field supports descriptions.
virtual const TagValue & value(KnownField field) const =0
Returns the value of the specified field.
virtual std::size_t fieldCount() const =0
Returns the number of present fields.
std::string targetString() const
Returns the string representation for the assigned tag target.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Contains all classes and functions of the TagInfo library.
KnownField
Specifies the field.
TAG_PARSER_EXPORT std::string_view tagTargetLevelName(TagTargetLevel tagTargetLevel)
Returns a string representation for the specified tagTargetLevel.
constexpr unsigned int knownFieldArraySize
The number of valid entries in the TagParser::KnownField enum.
TagTargetLevel
The TagTargetLevel enum specifies tag target levels.
constexpr KnownField nextKnownField(KnownField field)
Returns the next known field skipping any deprecated fields.
TagTextEncoding
Specifies the text encoding.
constexpr KnownField lastKnownField
The last valid entry in the TagParser::KnownField enum.
TagType
Specifies the tag type.
constexpr KnownField firstKnownField
The first valid entry in the TagParser::KnownField enum.
constexpr bool isKnownFieldDeprecated(KnownField field)
Returns whether the specified field is deprecated and should not be used anymore.
MediaType
The MediaType enum specifies the type of media data (audio, video, text, ...).
TagDataType
Specifies the data type.