1 #ifndef TAG_PARSER_TAG_H 2 #define TAG_PARSER_TAG_H 7 #include <c++utilities/conversion/types.h> 8 #include <c++utilities/io/binaryreader.h> 11 #include <type_traits> 41 Invalid = std::numeric_limits<unsigned int>::max(),
100 virtual const char *typeName()
const;
101 std::string toString()
const;
105 virtual std::vector<const TagValue *> values(
KnownField field)
const;
107 virtual bool setValues(
KnownField field,
const std::vector<TagValue> &values);
108 virtual bool hasField(
KnownField field)
const = 0;
109 virtual void removeAllFields() = 0;
110 const std::string &
version()
const;
112 virtual bool supportsTarget()
const;
116 const char *targetLevelName()
const;
118 std::string targetString()
const;
119 virtual unsigned int fieldCount()
const = 0;
120 virtual bool supportsField(
KnownField field)
const = 0;
122 virtual bool supportsDescription(
KnownField field)
const;
123 virtual bool supportsMimeType(
KnownField field)
const;
124 virtual unsigned int insertValues(
const Tag &from,
bool overwrite);
125 virtual void ensureTextValuesAreProperlyEncoded() = 0;
154 return "unspecified";
354 #endif // TAG_PARSER_TAG_H virtual TagDataType proposedDataType(KnownField field) const
Returns the proposed data type for the specified field as TagDataType.
virtual TagTextEncoding proposedTextEncoding() const
Returns the proposed text encoding.
std::string toString(const std::function< TagTargetLevel(uint64)> &tagTargetMapping) const
Returns the string representation of the current instance.
std::string targetString() const
Returns the string representation for the assigned tag target.
TagTargetLevel
The TagTargetLevel enum specifies tag target levels.
virtual bool supportsTarget() const
Returns an indication whether a target is supported by the tag.
const char * targetLevelName() const
Returns the name of the current target level.
TagDataType
Specifies the data type.
KnownField
Specifies the field.
constexpr KnownField firstKnownField
The first valid entry in the Media::KnownField enum.
const TagTarget & target() const
Returns the target of tag.
virtual bool canEncodingBeUsed(TagTextEncoding encoding) const
Returns an indication whether the specified encoding can be used to provide string values for the tag...
TAG_PARSER_EXPORT const char * tagTargetLevelName(TagTargetLevel tagTargetLevel)
Returns a string representation for the specified tagTargetLevel.
const std::string & version() const
Returns the version of the tag as std::string.
bool isTargetingLevel(TagTargetLevel tagTargetLevel) const
Returns whether the tag is targeting the specified tagTargetLevel.
virtual bool supportsMimeType(KnownField field) const
Returns an indications whether the specified field supports mime types.
uint32 size() const
Returns the size of the tag in bytes.
constexpr KnownField lastKnownField
The last valid entry in the Media::KnownField enum.
constexpr unsigned int knownFieldArraySize
The number of valid entries in the Media::KnownField enum.
virtual TagType type() const
Returns the type of the tag as Media::TagType.
virtual bool supportsDescription(KnownField field) const
Returns an indications whether the specified field supports descriptions.
constexpr KnownField nextKnownField(KnownField field)
Returns the next known field.
void setTarget(const TagTarget &target)
Sets the target of tag.
virtual TagTargetLevel targetLevel() const
Returns the name of the current tag target level.
TagType
Specifies the tag type.
TagTextEncoding
Specifies the text encoding.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
virtual const char * typeName() const
Returns the type name of the tag as C-style string.