id3v1tag.h
Go to the documentation of this file.
/***************************************************************************
copyright : (C) 2002 - 2008 by Scott Wheeler
email : wheeler@kde.org
***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 2.1 as published by the Free Software Foundation. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#ifndef TAGLIB_ID3V1TAG_H
#define TAGLIB_ID3V1TAG_H
#include "tbytevector.h"
#include "taglib.h"
#include "taglib_export.h"
#include "tag.h"
namespace TagLib {
class File;
namespace ID3v1 {
class TAGLIB_EXPORT StringHandler
{
public:
StringHandler();
virtual ~StringHandler();
StringHandler(const StringHandler &) = delete;
StringHandler &operator=(const StringHandler &) = delete;
virtual String parse(const ByteVector &data) const;
virtual ByteVector render(const String &s) const;
private:
class StringHandlerPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<StringHandlerPrivate> d;
};
class TAGLIB_EXPORT Tag : public TagLib::Tag
{
public:
Tag();
Tag(File *file, offset_t tagOffset);
~Tag() override;
Tag(const Tag &) = delete;
Tag &operator=(const Tag &) = delete;
ByteVector render() const;
static ByteVector fileIdentifier();
// Reimplementations.
String title() const override;
String artist() const override;
String album() const override;
String comment() const override;
String genre() const override;
unsigned int year() const override;
unsigned int track() const override;
void setTitle(const String &s) override;
void setArtist(const String &s) override;
void setAlbum(const String &s) override;
void setComment(const String &s) override;
void setGenre(const String &s) override;
void setYear(unsigned int i) override;
void setTrack(unsigned int i) override;
unsigned int genreNumber() const;
void setGenreNumber(unsigned int i);
static void setStringHandler(const StringHandler *handler);
protected:
void read();
void parse(const ByteVector &data);
private:
class TagPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TagPrivate> d;
};
} // namespace ID3v1
} // namespace TagLib
#endif
TagLib::ByteVector
A byte vector.
Definition tbytevector.h:46
TagLib::File
A file class with some useful methods for tag manipulation.
Definition tfile.h:51
TagLib::ID3v1::StringHandler
An abstraction for the string to data encoding in ID3v1 tags.
Definition id3v1tag.h:62
TagLib::ID3v1::StringHandler::render
virtual ByteVector render(const String &s) const
TagLib::ID3v1::StringHandler::parse
virtual String parse(const ByteVector &data) const
TagLib::ID3v1::StringHandler::operator=
StringHandler & operator=(const StringHandler &)=delete
TagLib::ID3v1::StringHandler::StringHandler
StringHandler()
TagLib::ID3v1::StringHandler::StringHandler
StringHandler(const StringHandler &)=delete
TagLib::ID3v1::StringHandler::~StringHandler
virtual ~StringHandler()
TagLib::ID3v1::Tag::Tag
Tag()
TagLib::ID3v1::Tag::setGenreNumber
void setGenreNumber(unsigned int i)
TagLib::ID3v1::Tag::Tag
Tag(const Tag &)=delete
TagLib::ID3v1::Tag::genreNumber
unsigned int genreNumber() const
TagLib::ID3v1::Tag::parse
void parse(const ByteVector &data)
TagLib::ID3v1::Tag::track
unsigned int track() const override
TagLib::ID3v1::Tag::setComment
void setComment(const String &s) override
TagLib::ID3v1::Tag::comment
String comment() const override
TagLib::ID3v1::Tag::read
void read()
TagLib::ID3v1::Tag::setTrack
void setTrack(unsigned int i) override
TagLib::ID3v1::Tag::year
unsigned int year() const override
TagLib::ID3v1::Tag::Tag
Tag(File *file, offset_t tagOffset)
TagLib::ID3v1::Tag::artist
String artist() const override
TagLib::ID3v1::Tag::setArtist
void setArtist(const String &s) override
TagLib::ID3v1::Tag::setAlbum
void setAlbum(const String &s) override
TagLib::ID3v1::Tag::setStringHandler
static void setStringHandler(const StringHandler *handler)
TagLib::ID3v1::Tag::genre
String genre() const override
TagLib::ID3v1::Tag::setTitle
void setTitle(const String &s) override
TagLib::ID3v1::Tag::~Tag
~Tag() override
TagLib::ID3v1::Tag::fileIdentifier
static ByteVector fileIdentifier()
TagLib::ID3v1::Tag::album
String album() const override
TagLib::ID3v1::Tag::operator=
Tag & operator=(const Tag &)=delete
TagLib::ID3v1::Tag::setYear
void setYear(unsigned int i) override
TagLib::ID3v1::Tag::render
ByteVector render() const
TagLib::ID3v1::Tag::title
String title() const override
TagLib::ID3v1::Tag::setGenre
void setGenre(const String &s) override
TagLib::String
A wide string class suitable for unicode.
Definition tstring.h:83
TagLib::Tag
A simple, generic interface to common audio metadata fields.
Definition tag.h:49
TagLib::ID3v1
An ID3v1 implementation.
Definition apefile.h:45
TagLib
A namespace for all TagLib related classes and functions.
Definition apefile.h:41
TagLib::offset_t
off_t offset_t
Definition taglib.h:64
tag.h
taglib.h
taglib_export.h
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition taglib_export.h:40
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition taglib_export.h:55
tbytevector.h