Tag Parser  6.1.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
matroskatagfield.h
Go to the documentation of this file.
1 #ifndef MEDIA_MATROSKATAGFIELD_H
2 #define MEDIA_MATROSKATAGFIELD_H
3 
4 #include "../generictagfield.h"
5 #include "../statusprovider.h"
6 
7 namespace Media {
8 
9 class EbmlElement;
10 class MatroskaTagField;
11 
15 template <>
17 {
18 public:
22  typedef std::string identifierType;
23 
27  typedef std::string typeInfoType;
28 
33 
34  static bool supportsNestedFields();
35 };
36 
41 {
42  return true;
43 }
44 
46 {
47  friend class MatroskaTagField;
48 
49 public:
50  void make(std::ostream &stream) const;
51  const MatroskaTagField &field() const;
52  uint64 requiredSize() const;
53 
54 private:
56 
57  MatroskaTagField &m_field;
58  bool m_isBinary;
59  std::string m_stringValue;
60  uint64 m_simpleTagSize;
61  uint64 m_totalSize;
62  std::vector<MatroskaTagFieldMaker> m_nestedMaker;
63 };
64 
69 {
70  return m_field;
71 }
72 
77 {
78  return m_totalSize;
79 }
80 
81 
82 
83 class TAG_PARSER_EXPORT MatroskaTagField : public TagField<MatroskaTagField>, public StatusProvider
84 {
85  friend class TagField<MatroskaTagField>;
86 
87 public:
89  MatroskaTagField(const std::string &id, const TagValue &value);
90 
91  void reparse(EbmlElement &simpleTagElement, bool parseNestedFields = true);
92  MatroskaTagFieldMaker prepareMaking();
93  void make(std::ostream &stream);
94  bool isAdditionalTypeInfoUsed() const;
95  bool supportsNestedFields() const;
96 
97 protected:
98  void cleared();
99 };
100 
105 {
106  return false;
107 }
108 
113 {
114  return true;
115 }
116 
121 {}
122 
123 }
124 
125 #endif // MEDIA_MATROSKATAGFIELD_H
The MatroskaTagFieldMaker class helps making tag fields.
The TagValue class wraps values of different types.
Definition: tagvalue.h:64
The EbmlElement class helps to parse EBML files such as Matroska files.
Definition: ebmlelement.h:50
bool supportsNestedFields() const
Returns whether nested fields are supported.
Defines traits for the specified ImplementationType.
bool isAdditionalTypeInfoUsed() const
Returns whether the additional type info is used.
MatroskaTagField implementationType
The implementation type is EbmlElement.
const MatroskaTagField & field() const
Returns the associated field.
The TagField class is used by FieldMapBasedTag to store the fields.
The MatroskaTagField class is used by MatroskaTag to store the fields.
uint64 requiredSize() const
Returns number of bytes which will be written when making the field.
std::string typeInfoType
The type info is stored using strings.
std::string identifierType
Fields in a Matroska tag are identified by strings.
void cleared()
Ensures the field is cleared.
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9
The StatusProvider class acts as a base class for objects providing status information.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.