1 #ifndef TAG_PARSER_MP4TAGATOM_H 2 #define TAG_PARSER_MP4TAGATOM_H 4 #include "../generictagfield.h" 6 #include <c++utilities/conversion/stringconversion.h> 7 #include <c++utilities/io/binarywriter.h> 17 namespace RawDataType {
66 void make(std::ostream &stream);
68 uint64 requiredSize()
const;
74 std::stringstream m_convertedData;
75 IoUtilities::BinaryWriter m_writer;
107 void make(std::ostream &stream,
Diagnostics &diag);
109 bool isAdditionalTypeInfoUsed()
const;
110 const std::string &name()
const;
111 void setName(
const std::string &name);
112 const std::string &mean()
const;
113 void setMean(
const std::string &mean);
114 uint32 parsedRawDataType()
const;
115 uint16 countryIndicator()
const;
116 uint16 languageIndicator()
const;
117 bool supportsNestedFields()
const;
118 std::vector<uint32> expectedRawDataTypes()
const;
119 uint32 appropriateRawDataType()
const;
121 static IdentifierType fieldIdFromString(
const char *idString, std::size_t idStringSize = std::string::npos);
122 static std::string fieldIdToString(IdentifierType
id);
128 uint32 m_parsedRawDataType;
129 uint16 m_countryIndicator;
130 uint16 m_langIndicator;
178 return m_parsedRawDataType;
186 return m_countryIndicator;
194 return m_langIndicator;
212 const auto latin1 = ConversionUtilities::convertUtf8ToLatin1(idString, idStringSize != std::string::npos ? idStringSize : std::strlen(idString));
213 switch (latin1.second) {
215 return ConversionUtilities::BE::toUInt32(latin1.first.get());
217 throw ConversionUtilities::ConversionException(
"MP4 ID must be exactly 4 chars");
228 const auto utf8 = ConversionUtilities::convertLatin1ToUtf8(ConversionUtilities::interpretIntegerAsString<uint32>(
id).data(), 4);
229 return std::string(utf8.first.get(), utf8.second);
234 #endif // TAG_PARSER_MP4TAGATOM_H
bool supportsNestedFields() const
Returns whether nested fields are supported.
const std::string & name() const
Returns the "name" for "extended" fields.
uint32 parsedRawDataType() const
Returns the raw data type which has been determined when parsing.
uint16 languageIndicator() const
Returns the language indicator.
The Mp4TagField class is used by Mp4Tag to store the fields.
Defines traits for the specified ImplementationType.
const Mp4TagField & field() const
Returns the associated field.
static std::string fieldIdToString(IdentifierType id)
Returns the string representation for the specified id.
uint16 countryIndicator() const
Returns the country indicator.
The Mp4TagFieldMaker class helps making tag fields.
The Mp4Atom class helps to parse MP4 files.
uint64 requiredSize() const
Returns number of bytes which will be written when making the field.
void setMean(const std::string &mean)
Sets the "mean" for the "extended" field.
The TagField class is used by FieldMapBasedTag to store the fields.
typename TagFieldTraits< Mp4TagField >::IdentifierType IdentifierType
static IdentifierType fieldIdFromString(const char *idString, std::size_t idStringSize=std::string::npos)
Converts the specified ID string representation to an actual ID.
void setName(const std::string &name)
Sets the "name" for the "extended" field.
bool isAdditionalTypeInfoUsed() const
Returns whether the additional type info is used.
The TagValue class wraps values of different types.
Contains all classes and functions of the TagInfo library.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
The Diagnostics class is a container for DiagMessage.
const std::string & mean() const
Returns the "mean" for "extended" fields.