apefooter.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2004 by Allan Sandfeld Jensen
00003     email                : kde@carewolf.org
00004  ***************************************************************************/
00005 
00006 /***************************************************************************
00007  *   This library is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU Lesser General Public License version   *
00009  *   2.1 as published by the Free Software Foundation.                     *
00010  *                                                                         *
00011  *   This library is distributed in the hope that it will be useful, but   *
00012  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014  *   Lesser General Public License for more details.                       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with this library; if not, write to the Free Software   *
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
00019  *   USA                                                                   *
00020  *                                                                         *
00021  *   Alternatively, this file is available under the Mozilla Public        *
00022  *   License Version 1.1.  You may obtain a copy of the License at         *
00023  *   http://www.mozilla.org/MPL/                                           *
00024  ***************************************************************************/
00025 
00026 #ifndef TAGLIB_APEFOOTER_H
00027 #define TAGLIB_APEFOOTER_H
00028 
00029 #include "tbytevector.h"
00030 #include "taglib_export.h"
00031 
00032 namespace TagLib {
00033 
00034   namespace APE {
00035 
00037 
00045     class TAGLIB_EXPORT Footer
00046     {
00047     public:
00051       Footer();
00052 
00057       Footer(const ByteVector &data);
00058 
00062       virtual ~Footer();
00063 
00067       uint version() const;
00068 
00072       bool headerPresent() const;
00073 
00077       bool footerPresent() const;
00078 
00082       bool isHeader() const;
00083 
00087       void setHeaderPresent(bool b) const;
00088 
00092       uint itemCount() const;
00093 
00098       void setItemCount(uint s);
00099 
00106       uint tagSize() const;
00107 
00114       uint completeTagSize() const;
00115 
00120       void setTagSize(uint s);
00121 
00125       static uint size();
00126 
00131       static ByteVector fileIdentifier();
00132 
00137       void setData(const ByteVector &data);
00138 
00142       ByteVector renderFooter() const;
00143 
00148       ByteVector renderHeader() const;
00149 
00150     protected:
00155       void parse(const ByteVector &data);
00156 
00160       ByteVector render(bool isHeader) const;
00161 
00162     private:
00163       Footer(const Footer &);
00164       Footer &operator=(const Footer &);
00165 
00166       class FooterPrivate;
00167       FooterPrivate *d;
00168     };
00169 
00170   }
00171 }
00172 
00173 #endif