Tag Parser 12.3.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Loading...
Searching...
No Matches
vorbiscommentfield.h
Go to the documentation of this file.
1#ifndef TAG_PARSER_VORBISCOMMENTFIELD_H
2#define TAG_PARSER_VORBISCOMMENTFIELD_H
3
5
6#include <c++utilities/misc/flagenumclass.h>
7
8namespace CppUtilities {
9class BinaryReader;
10class BinaryWriter;
11} // namespace CppUtilities
12
13namespace TagParser {
14
18enum class VorbisCommentFlags : std::uint8_t {
19 None = 0x0,
20 NoSignature = 0x1,
21 NoFramingByte = 0x2,
22 NoCovers = 0x4,
23 ConvertTotalFields = 0x8,
24};
25
26} // namespace TagParser
27
29
30namespace TagParser {
31
32class VorbisCommentField;
33class Diagnostics;
34
39public:
40 using IdentifierType = std::string;
41 using TypeInfoType = std::uint32_t;
42};
43
44class OggIterator;
45
46class TAG_PARSER_EXPORT VorbisCommentField : public TagField<VorbisCommentField> {
47 friend class TagField<VorbisCommentField>;
48
49public:
51 VorbisCommentField(const IdentifierType &id, const TagValue &value);
52
53 void parse(OggIterator &iterator, Diagnostics &diag);
54 void parse(OggIterator &iterator, std::uint64_t &maxSize, Diagnostics &diag);
55 void parse(std::istream &stream, std::uint64_t &maxSize, Diagnostics &diag);
56 bool make(CppUtilities::BinaryWriter &writer, VorbisCommentFlags flags, Diagnostics &diag);
57 bool isAdditionalTypeInfoUsed() const;
58 bool supportsNestedFields() const;
59
60 static typename std::string fieldIdFromString(std::string_view idString);
61 static std::string fieldIdToString(const std::string &id);
62
63private:
64 template <class StreamType> void internalParse(StreamType &stream, std::uint64_t &maxSize, Diagnostics &diag);
65};
66
71{
72 return false;
73}
74
79{
80 return false;
81}
82
87inline std::string VorbisCommentField::fieldIdFromString(std::string_view idString)
88{
89 return std::string(idString);
90}
91
96inline std::string VorbisCommentField::fieldIdToString(const std::string &id)
97{
98 return id;
99}
100
101} // namespace TagParser
102
103#endif // TAG_PARSER_VORBISCOMMENTFIELD_H
The Diagnostics class is a container for DiagMessage.
The OggIterator class helps iterating through all segments of an Ogg bitstream.
Defines traits for the specified ImplementationType.
The TagField class is used by FieldMapBasedTag to store the fields.
The TagValue class wraps values of different types.
The VorbisCommentField class is used by VorbisComment to store the fields.
bool supportsNestedFields() const
Returns whether nested fields are supported.
static std::string fieldIdFromString(std::string_view idString)
Converts the specified ID string representation to an actual ID.
static std::string fieldIdToString(const std::string &id)
Returns the string representation for the specified id.
bool isAdditionalTypeInfoUsed() const
Returns whether the additional type info is used.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Definition global.h:14
Contains all classes and functions of the TagInfo library.
Definition aaccodebook.h:10
VorbisCommentFlags
The VorbisCommentFlags enum specifies flags which controls parsing and making of Vorbis comments.
CPP_UTILITIES_MARK_FLAG_ENUM_CLASS(TagParser, TagParser::TagCreationFlags)