| TagLib 1.13 |  |

tableofcontentsframe.h
Go to the documentation of this file.
1/***************************************************************************
2 copyright : (C) 2013 by Lukas Krejci
3 email : krejclu6@fel.cvut.cz
4 ***************************************************************************/
5
6/***************************************************************************
7 * This library is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU Lesser General Public License version *
9 * 2.1 as published by the Free Software Foundation. *
10 * *
11 * This library is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14 * Lesser General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with this library; if not, write to the Free Software *
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
19 * 02110-1301 USA *
20 * *
21 * Alternatively, this file is available under the Mozilla Public *
22 * License Version 1.1. You may obtain a copy of the License at *
23 * http://www.mozilla.org/MPL/ *
24 ***************************************************************************/
25
26#ifndef TAGLIB_TABLEOFCONTENTSFRAME
27#define TAGLIB_TABLEOFCONTENTSFRAME
28
29#include "id3v2tag.h"
30#include "id3v2frame.h"
31
32#include "tbytevectorlist.h"
33
34 namespace TagLib {
35
36 namespace ID3v2 {
37
44
45 class TAGLIB_EXPORT TableOfContentsFrame : public ID3v2::Frame
46 {
47 friend class FrameFactory;
48
49 public:
54 TableOfContentsFrame(const ID3v2::Header *tagHeader, const ByteVector &data);
55
61 TableOfContentsFrame(const ByteVector &elementID,
62 const ByteVectorList &children = ByteVectorList(),
63 const FrameList &embeddedFrames = FrameList());
64
68 ~TableOfContentsFrame();
69
76 ByteVector elementID() const;
77
84 bool isTopLevel() const;
85
92 bool isOrdered() const;
93
100 unsigned int entryCount() const;
101
107 ByteVectorList childElements() const;
108
115 void setElementID(const ByteVector &eID);
116
123 void setIsTopLevel(const bool &t);
124
131 void setIsOrdered(const bool &o);
132
138 void setChildElements(const ByteVectorList &l);
139
145 void addChildElement(const ByteVector &cE);
146
152 void removeChildElement(const ByteVector &cE);
153
168 const FrameListMap &embeddedFrameListMap() const;
169
181 const FrameList &embeddedFrameList() const;
182
194 const FrameList &embeddedFrameList(const ByteVector &frameID) const;
195
203 void addEmbeddedFrame(Frame *frame);
204
212 void removeEmbeddedFrame(Frame *frame, bool del = true);
213
221 void removeEmbeddedFrames(const ByteVector &id);
222
223 virtual String toString() const;
224
225 PropertyMap asProperties() const;
226
234 static TableOfContentsFrame *findByElementID(const Tag *tag, const ByteVector &eID);
235
243 static TableOfContentsFrame *findTopLevel(const Tag *tag);
244
245 protected:
246 virtual void parseFields(const ByteVector &data);
247 virtual ByteVector renderFields() const;
248
249 private:
250 TableOfContentsFrame(const ID3v2::Header *tagHeader, const ByteVector &data, Header *h);
251 TableOfContentsFrame(const TableOfContentsFrame &);
252 TableOfContentsFrame &operator=(const TableOfContentsFrame &);
253
254 class TableOfContentsFramePrivate;
255 TableOfContentsFramePrivate *d;
256 };
257 }
258}
259
260#endif
TagLib::ByteVectorList
A list of ByteVectors.
Definition: tbytevectorlist.h:42
TagLib::ByteVector
A byte vector.
Definition: tbytevector.h:46
TagLib::ID3v2::FrameFactory
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:66
TagLib::ID3v2::Frame
ID3v2 frame implementation.
Definition: id3v2frame.h:55
TagLib::ID3v2::Header
An implementation of ID3v2 headers.
Definition: id3v2header.h:49
TagLib::ID3v2::TableOfContentsFrame
An implementation of ID3v2 table of contents frames.
Definition: tableofcontentsframe.h:46
TagLib::ID3v2::TableOfContentsFrame::embeddedFrameList
const FrameList & embeddedFrameList(const ByteVector &frameID) const
TagLib::ID3v2::TableOfContentsFrame::removeChildElement
void removeChildElement(const ByteVector &cE)
TagLib::ID3v2::TableOfContentsFrame::asProperties
PropertyMap asProperties() const
TagLib::ID3v2::TableOfContentsFrame::findByElementID
static TableOfContentsFrame * findByElementID(const Tag *tag, const ByteVector &eID)
TagLib::ID3v2::TableOfContentsFrame::setElementID
void setElementID(const ByteVector &eID)
TagLib::ID3v2::TableOfContentsFrame::setIsOrdered
void setIsOrdered(const bool &o)
TagLib::ID3v2::TableOfContentsFrame::renderFields
virtual ByteVector renderFields() const
TagLib::ID3v2::TableOfContentsFrame::toString
virtual String toString() const
TagLib::ID3v2::TableOfContentsFrame::addEmbeddedFrame
void addEmbeddedFrame(Frame *frame)
TagLib::ID3v2::TableOfContentsFrame::TableOfContentsFrame
TableOfContentsFrame(const ID3v2::Header *tagHeader, const ByteVector &data)
TagLib::ID3v2::TableOfContentsFrame::parseFields
virtual void parseFields(const ByteVector &data)
TagLib::ID3v2::TableOfContentsFrame::~TableOfContentsFrame
~TableOfContentsFrame()
TagLib::ID3v2::TableOfContentsFrame::addChildElement
void addChildElement(const ByteVector &cE)
TagLib::ID3v2::TableOfContentsFrame::entryCount
unsigned int entryCount() const
TagLib::ID3v2::TableOfContentsFrame::setIsTopLevel
void setIsTopLevel(const bool &t)
TagLib::ID3v2::TableOfContentsFrame::embeddedFrameListMap
const FrameListMap & embeddedFrameListMap() const
TagLib::ID3v2::TableOfContentsFrame::isOrdered
bool isOrdered() const
TagLib::ID3v2::TableOfContentsFrame::childElements
ByteVectorList childElements() const
TagLib::ID3v2::TableOfContentsFrame::embeddedFrameList
const FrameList & embeddedFrameList() const
TagLib::ID3v2::TableOfContentsFrame::isTopLevel
bool isTopLevel() const
TagLib::ID3v2::TableOfContentsFrame::TableOfContentsFrame
TableOfContentsFrame(const ByteVector &elementID, const ByteVectorList &children=ByteVectorList(), const FrameList &embeddedFrames=FrameList())
TagLib::ID3v2::TableOfContentsFrame::removeEmbeddedFrames
void removeEmbeddedFrames(const ByteVector &id)
TagLib::ID3v2::TableOfContentsFrame::elementID
ByteVector elementID() const
TagLib::ID3v2::TableOfContentsFrame::removeEmbeddedFrame
void removeEmbeddedFrame(Frame *frame, bool del=true)
TagLib::ID3v2::TableOfContentsFrame::setChildElements
void setChildElements(const ByteVectorList &l)
TagLib::ID3v2::TableOfContentsFrame::findTopLevel
static TableOfContentsFrame * findTopLevel(const Tag *tag)
TagLib::ID3v2::Tag
The main class in the ID3v2 implementation.
Definition: id3v2tag.h:128
TagLib::List
A generic, implicitly shared list.
Definition: tlist.h:54
TagLib::Map
A generic, implicitly shared map.
Definition: tmap.h:44
TagLib::PropertyMap
A map for format-independent <key,valuelist> tag representations.
Definition: tpropertymap.h:119
TagLib::String
A wide string class suitable for unicode.
Definition: tstring.h:85
id3v2frame.h
id3v2tag.h
TagLib::ID3v2::FrameList
List< Frame * > FrameList
Definition: id3v2tag.h:47
TagLib
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
tbytevectorlist.h