1
/***************************************************************************
2
copyright : (C) 2004 by Allan Sandfeld Jensen
3
email : kde@carewolf.org
4
***************************************************************************/
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. *
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. *
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
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
***************************************************************************/
26
#ifndef TAGLIB_APEFOOTER_H
27
#define TAGLIB_APEFOOTER_H
29
#include "tbytevector.h"
30
#include "taglib_export.h"
36
//! An implementation of APE footers
39
* This class implements APE footers (and headers). It attempts to follow, both
40
* semantically and programatically, the structure specified in
41
* the APE v2.0 standard. The API is based on the properties of APE footer and
42
* headers specified there.
45
class TAGLIB_EXPORT Footer
49
* Constructs an empty APE footer.
54
* Constructs an APE footer based on \a data. parse() is called
57
Footer(const ByteVector &data);
60
* Destroys the footer.
65
* Returns the version number. (Note: This is the 1000 or 2000.)
70
* Returns true if a header is present in the tag.
72
bool headerPresent() const;
75
* Returns true if a footer is present in the tag.
77
bool footerPresent() const;
80
* Returns true this is actually the header.
82
bool isHeader() const;
85
* Sets whether the header should be rendered or not
87
void setHeaderPresent(bool b) const;
90
* Returns the number of items in the tag.
92
uint itemCount() const;
95
* Set the item count to \a s.
98
void setItemCount(uint s);
101
* Returns the tag size in bytes. This is the size of the frame content and footer.
102
* The size of the \e entire tag will be this plus the header size, if present.
104
* \see completeTagSize()
106
uint tagSize() const;
109
* Returns the tag size, including if present, the header
114
uint completeTagSize() const;
117
* Set the tag size to \a s.
120
void setTagSize(uint s);
123
* Returns the size of the footer. Presently this is always 32 bytes.
128
* Returns the string used to identify an APE tag inside of a file.
129
* Presently this is always "APETAGEX".
131
static ByteVector fileIdentifier();
134
* Sets the data that will be used as the footer. 32 bytes,
135
* starting from \a data will be used.
137
void setData(const ByteVector &data);
140
* Renders the footer back to binary format.
142
ByteVector renderFooter() const;
145
* Renders the header corresponding to the footer. If headerPresent is
146
* set to false, it returns an empty ByteVector.
148
ByteVector renderHeader() const;
152
* Called by setData() to parse the footer data. It makes this information
153
* available through the public API.
155
void parse(const ByteVector &data);
158
* Called by renderFooter and renderHeader
160
ByteVector render(bool isHeader) const;
163
Footer(const Footer &);
164
Footer &operator=(const Footer &);