Tag Parser
9.1.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
vorbis
vorbiscomment.h
Go to the documentation of this file.
1
#ifndef TAG_PARSER_VORBISCOMMENT_H
2
#define TAG_PARSER_VORBISCOMMENT_H
3
4
#include "
./vorbiscommentfield.h
"
5
6
#include "../caseinsensitivecomparer.h"
7
#include "../fieldbasedtag.h"
8
#include "../mediaformat.h"
9
10
namespace
TagParser
{
11
12
class
OggIterator;
13
class
VorbisComment
;
14
class
Diagnostics;
15
19
template
<>
class
TAG_PARSER_EXPORT
FieldMapBasedTagTraits
<
VorbisComment
> {
20
public
:
21
using
FieldType
=
VorbisCommentField
;
22
using
Compare
=
CaseInsensitiveStringComparer
;
23
};
24
25
class
TAG_PARSER_EXPORT
VorbisComment
:
public
FieldMapBasedTag
<VorbisComment> {
26
friend
class
FieldMapBasedTag
<
VorbisComment
>;
27
28
public
:
29
VorbisComment
();
30
31
static
constexpr
TagType
tagType =
TagType::VorbisComment
;
32
static
constexpr
const
char
*tagName =
"Vorbis comment"
;
33
static
constexpr
TagTextEncoding
defaultTextEncoding =
TagTextEncoding::Utf8
;
34
bool
canEncodingBeUsed(
TagTextEncoding
encoding)
const override
;
35
36
using
FieldMapBasedTag<VorbisComment>::value
;
37
const
TagValue
&value(
KnownField
field)
const override
;
38
using
FieldMapBasedTag<VorbisComment>::setValue
;
39
bool
setValue(
KnownField
field,
const
TagValue
&value)
override
;
40
41
void
parse(
OggIterator
&iterator,
VorbisCommentFlags
flags,
Diagnostics
&diag);
42
void
parse(std::istream &stream, std::uint64_t maxSize,
VorbisCommentFlags
flags,
Diagnostics
&diag);
43
void
make(std::ostream &stream,
VorbisCommentFlags
flags,
Diagnostics
&diag);
44
45
const
TagValue
&vendor()
const
;
46
void
setVendor(
const
TagValue
&vendor);
47
bool
supportsMultipleValues(
KnownField
)
const override
;
48
49
protected
:
50
IdentifierType internallyGetFieldId(
KnownField
field)
const
;
51
KnownField
internallyGetKnownField(
const
IdentifierType &
id
)
const
;
52
53
private
:
54
template
<
class
StreamType>
void
internalParse(StreamType &stream, std::uint64_t maxSize,
VorbisCommentFlags
flags,
Diagnostics
&diag);
55
56
private
:
57
TagValue
m_vendor;
58
};
59
63
inline
VorbisComment::VorbisComment
()
64
{
65
}
66
67
inline
bool
VorbisComment::canEncodingBeUsed
(
TagTextEncoding
encoding)
const
68
{
69
return
encoding ==
TagTextEncoding::Utf8
;
70
}
71
76
inline
const
TagValue
&
VorbisComment::vendor
()
const
77
{
78
return
m_vendor;
79
}
80
85
inline
void
VorbisComment::setVendor
(
const
TagValue
&vendor)
86
{
87
m_vendor =
vendor
;
88
}
89
94
inline
bool
VorbisComment::supportsMultipleValues
(
KnownField
)
const
95
{
96
return
true
;
97
}
98
99
}
// namespace TagParser
100
101
#endif // TAG_PARSER_VORBISCOMMENT_H
TagParser::TagTextEncoding::Utf8
TagParser::VorbisCommentFlags
VorbisCommentFlags
The VorbisCommentFlags enum specifies flags which controls parsing and making of Vorbis comments.
Definition:
vorbiscommentfield.h:16
TagParser::OggIterator
The OggIterator class helps iterating through all segments of an OGG bitstream.
Definition:
oggiterator.h:11
TagParser::TagTextEncoding
TagTextEncoding
Specifies the text encoding.
Definition:
tagvalue.h:25
TagParser::TagType::VorbisComment
TagParser::Diagnostics
The Diagnostics class is a container for DiagMessage.
Definition:
diagnostics.h:156
vorbiscommentfield.h
TagParser::VorbisComment::setVendor
void setVendor(const TagValue &vendor)
Sets the vendor.
Definition:
vorbiscomment.h:85
TagParser
Contains all classes and functions of the TagInfo library.
Definition:
aaccodebook.h:10
TagParser::VorbisComment::vendor
const TagValue & vendor() const
Returns the vendor.
Definition:
vorbiscomment.h:76
TagParser::FlacMetaDataBlockType::VorbisComment
TagParser::VorbisComment::supportsMultipleValues
bool supportsMultipleValues(KnownField) const override
Allows multiple values for all fields.
Definition:
vorbiscomment.h:94
TagParser::VorbisComment::canEncodingBeUsed
bool canEncodingBeUsed(TagTextEncoding encoding) const override
Returns an indication whether the specified encoding can be used to provide string values for the tag...
Definition:
vorbiscomment.h:67
TagParser::CaseInsensitiveStringComparer
The CaseInsensitiveStringComparer struct defines a method for case-insensivive string comparsion (les...
Definition:
caseinsensitivecomparer.h:30
TagParser::KnownField
KnownField
Specifies the field.
Definition:
tag.h:42
TagParser::VorbisComment::VorbisComment
VorbisComment()
Constructs a new Vorbis comment.
Definition:
vorbiscomment.h:63
TagParser::FieldMapBasedTag
The FieldMapBasedTag provides a generic implementation of Tag which stores the tag fields using std::...
Definition:
fieldbasedtag.h:31
TagParser::TagValue
The TagValue class wraps values of different types. It is meant to be assigned to a tag field.
Definition:
tagvalue.h:75
TagParser::VorbisCommentField
The VorbisCommentField class is used by VorbisComment to store the fields.
Definition:
vorbiscommentfield.h:47
TAG_PARSER_EXPORT
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
TagParser::FieldMapBasedTagTraits
Defines traits for the specified ImplementationType.
Definition:
fieldbasedtag.h:17
TagParser::VorbisComment
Implementation of TagParser::Tag for Vorbis comments.
Definition:
vorbiscomment.h:25
TagParser::TagType
TagType
Specifies the tag type.
Definition:
tag.h:20
Generated on Wed Oct 2 2019 16:52:26 for Tag Parser by
1.8.16