Tag Parser  8.2.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
id3v1tag.h
Go to the documentation of this file.
1 #ifndef TAG_PARSER_ID3V1TAG_H
2 #define TAG_PARSER_ID3V1TAG_H
3 
4 #include "../tag.h"
5 
6 namespace TagParser {
7 
8 class Diagnostics;
9 
10 class TAG_PARSER_EXPORT Id3v1Tag : public Tag {
11 public:
12  Id3v1Tag();
13 
14  static constexpr TagType tagType = TagType::Id3v1Tag;
15  static constexpr const char *tagName = "ID3v1 tag";
16  TagType type() const override;
17  const char *typeName() const override;
18  bool canEncodingBeUsed(TagTextEncoding encoding) const override;
19  const TagValue &value(KnownField value) const override;
20  bool setValue(KnownField field, const TagValue &value) override;
21  bool setValueConsideringTypeInfo(KnownField field, const TagValue &value, const std::string &typeInfo);
22  bool hasField(KnownField field) const override;
23  void removeAllFields() override;
24  unsigned int fieldCount() const override;
25  bool supportsField(KnownField field) const override;
26  void ensureTextValuesAreProperlyEncoded() override;
27 
28  void parse(std::istream &sourceStream, Diagnostics &diag);
29  void make(std::ostream &targetStream, Diagnostics &diag);
30 
31 private:
32  void readValue(TagValue &value, size_t maxLength, const char *buffer);
33  void writeValue(const TagValue &value, size_t length, char *buffer, std::ostream &targetStream, Diagnostics &diag);
34 
35  TagValue m_title;
36  TagValue m_artist;
37  TagValue m_album;
38  TagValue m_year;
39  TagValue m_comment;
40  TagValue m_trackPos;
41  TagValue m_genre;
42 };
43 
44 } // namespace TagParser
45 
46 #endif // TAG_PARSER_ID3V1TAG_H
The Tag class is used to store, read and write tag information.
Definition: tag.h:98
KnownField
Specifies the field.
Definition: tag.h:42
Implementation of TagParser::Tag for ID3v1 tags.
Definition: id3v1tag.h:10
The TagValue class wraps values of different types.
Definition: tagvalue.h:65
TagType
Specifies the tag type.
Definition: tag.h:20
TagTextEncoding
Specifies the text encoding.
Definition: tagvalue.h:24
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:9
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
The Diagnostics class is a container for DiagMessage.
Definition: diagnostics.h:156