Tag Parser 12.5.0
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,
22 NoCovers = 0x4,
24};
25
26} // namespace TagParser
27
29
30namespace TagParser {
31
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:
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.
Definition oggiterator.h:11
Defines traits for the specified ImplementationType.
typename TagFieldTraits< VorbisCommentField >::IdentifierType IdentifierType
The TagValue class wraps values of different types.
Definition tagvalue.h:147
The VorbisCommentField class is used by VorbisComment to store the fields.
bool supportsNestedFields() const
Returns whether nested fields are supported.
void parse(OggIterator &iterator, Diagnostics &diag)
Parses a field using the specified iterator.
VorbisCommentField()
Constructs a new Vorbis comment field.
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.
bool make(CppUtilities::BinaryWriter &writer, VorbisCommentFlags flags, Diagnostics &diag)
Writes the field to a stream using the specified writer.
#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)