infotag.h
Go to the documentation of this file.
/***************************************************************************
copyright : (C) 2012 by Tsuda Kageyu
email : tsuda.kageyu@gmail.com
***************************************************************************/
/***************************************************************************
* 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_INFOTAG_H
#define TAGLIB_INFOTAG_H
#include "tmap.h"
#include "tstring.h"
#include "tbytevector.h"
#include "taglib_export.h"
#include "tag.h"
namespace TagLib {
class File;
namespace RIFF {
namespace Info {
using FieldListMap = Map<ByteVector, String>;
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(const ByteVector &data);
~Tag() override;
Tag(const Tag &) = delete;
Tag &operator=(const Tag &) = delete;
// 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;
bool isEmpty() const override;
PropertyMap properties() const override;
void removeUnsupportedProperties(const StringList &props) override;
PropertyMap setProperties(const PropertyMap &props) override;
FieldListMap fieldListMap() const;
String fieldText(const ByteVector &id) const;
void setFieldText(const ByteVector &id, const String &s);
void removeField(const ByteVector &id);
ByteVector render() const;
static void setStringHandler(const StringHandler *handler);
protected:
void parse(const ByteVector &data);
private:
class TagPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TagPrivate> d;
};
} // namespace Info
} // namespace RIFF
} // 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::Map
A generic, implicitly shared map.
Definition tmap.h:45
TagLib::PropertyMap
A map for format-independent <key,values> tag representations.
Definition tpropertymap.h:123
TagLib::RIFF::Info::StringHandler
An abstraction for the string to data encoding in Info tags.
Definition infotag.h:60
TagLib::RIFF::Info::StringHandler::parse
virtual String parse(const ByteVector &data) const
TagLib::RIFF::Info::StringHandler::~StringHandler
virtual ~StringHandler()
TagLib::RIFF::Info::StringHandler::StringHandler
StringHandler(const StringHandler &)=delete
TagLib::RIFF::Info::StringHandler::render
virtual ByteVector render(const String &s) const
TagLib::RIFF::Info::StringHandler::operator=
StringHandler & operator=(const StringHandler &)=delete
TagLib::RIFF::Info::StringHandler::StringHandler
StringHandler()
TagLib::RIFF::Info::Tag::render
ByteVector render() const
TagLib::RIFF::Info::Tag::removeUnsupportedProperties
void removeUnsupportedProperties(const StringList &props) override
TagLib::RIFF::Info::Tag::setTitle
void setTitle(const String &s) override
TagLib::RIFF::Info::Tag::isEmpty
bool isEmpty() const override
TagLib::RIFF::Info::Tag::setTrack
void setTrack(unsigned int i) override
TagLib::RIFF::Info::Tag::fieldListMap
FieldListMap fieldListMap() const
TagLib::RIFF::Info::Tag::album
String album() const override
TagLib::RIFF::Info::Tag::year
unsigned int year() const override
TagLib::RIFF::Info::Tag::removeField
void removeField(const ByteVector &id)
TagLib::RIFF::Info::Tag::artist
String artist() const override
TagLib::RIFF::Info::Tag::title
String title() const override
TagLib::RIFF::Info::Tag::setComment
void setComment(const String &s) override
TagLib::RIFF::Info::Tag::fieldText
String fieldText(const ByteVector &id) const
TagLib::RIFF::Info::Tag::properties
PropertyMap properties() const override
TagLib::RIFF::Info::Tag::operator=
Tag & operator=(const Tag &)=delete
TagLib::RIFF::Info::Tag::Tag
Tag(const Tag &)=delete
TagLib::RIFF::Info::Tag::setAlbum
void setAlbum(const String &s) override
TagLib::RIFF::Info::Tag::setFieldText
void setFieldText(const ByteVector &id, const String &s)
TagLib::RIFF::Info::Tag::parse
void parse(const ByteVector &data)
TagLib::RIFF::Info::Tag::setStringHandler
static void setStringHandler(const StringHandler *handler)
TagLib::RIFF::Info::Tag::~Tag
~Tag() override
TagLib::RIFF::Info::Tag::comment
String comment() const override
TagLib::RIFF::Info::Tag::setYear
void setYear(unsigned int i) override
TagLib::RIFF::Info::Tag::setProperties
PropertyMap setProperties(const PropertyMap &props) override
TagLib::RIFF::Info::Tag::genre
String genre() const override
TagLib::RIFF::Info::Tag::Tag
Tag()
TagLib::RIFF::Info::Tag::setGenre
void setGenre(const String &s) override
TagLib::RIFF::Info::Tag::setArtist
void setArtist(const String &s) override
TagLib::RIFF::Info::Tag::track
unsigned int track() const override
TagLib::RIFF::Info::Tag::Tag
Tag(const ByteVector &data)
TagLib::StringList
A list of strings.
Definition tstringlist.h:44
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::RIFF::Info
A RIFF INFO tag implementation.
Definition infotag.h:41
TagLib::RIFF::Info::FieldListMap
Map< ByteVector, String > FieldListMap
Definition infotag.h:43
TagLib::RIFF
An implementation of TagLib::File with RIFF specific methods.
Definition aifffile.h:35
TagLib
A namespace for all TagLib related classes and functions.
Definition apefile.h:41
tag.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
tmap.h
tstring.h