tagparser/id3/id3v1tag.h

47 lines
1.5 KiB
C
Raw Permalink Normal View History

#ifndef TAG_PARSER_ID3V1TAG_H
#define TAG_PARSER_ID3V1TAG_H
2015-04-22 19:22:01 +02:00
2015-09-06 19:57:33 +02:00
#include "../tag.h"
2015-04-22 19:22:01 +02:00
2018-03-07 01:17:50 +01:00
namespace TagParser {
2015-04-22 19:22:01 +02:00
class Diagnostics;
class TAG_PARSER_EXPORT Id3v1Tag final : public Tag {
2015-04-22 19:22:01 +02:00
public:
Id3v1Tag();
static constexpr TagType tagType = TagType::Id3v1Tag;
static constexpr std::string_view tagName = "ID3v1 tag";
2018-03-07 01:11:42 +01:00
TagType type() const override;
std::string_view typeName() const override;
2018-03-07 01:11:42 +01:00
bool canEncodingBeUsed(TagTextEncoding encoding) const override;
const TagValue &value(KnownField value) const override;
bool setValue(KnownField field, const TagValue &value) override;
2016-08-05 01:46:31 +02:00
bool setValueConsideringTypeInfo(KnownField field, const TagValue &value, const std::string &typeInfo);
2018-03-07 01:11:42 +01:00
bool hasField(KnownField field) const override;
void removeAllFields() override;
2021-03-20 21:26:25 +01:00
std::size_t fieldCount() const override;
2018-03-07 01:11:42 +01:00
bool supportsField(KnownField field) const override;
void ensureTextValuesAreProperlyEncoded() override;
2015-04-22 19:22:01 +02:00
void parse(std::istream &sourceStream, Diagnostics &diag);
void make(std::ostream &targetStream, Diagnostics &diag);
2015-04-22 19:22:01 +02:00
private:
2020-11-25 17:54:30 +01:00
void readValue(TagValue &value, std::size_t maxLength, const char *buffer);
void writeValue(const TagValue &value, std::size_t length, char *buffer, std::ostream &targetStream, Diagnostics &diag);
2015-04-22 19:22:01 +02:00
TagValue m_title;
TagValue m_artist;
TagValue m_album;
TagValue m_year;
TagValue m_comment;
TagValue m_trackPos;
TagValue m_genre;
};
2018-03-07 01:17:50 +01:00
} // namespace TagParser
2015-04-22 19:22:01 +02:00
#endif // TAG_PARSER_ID3V1TAG_H