apeitem.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 
00022 #ifndef TAGLIB_APEITEM_H
00023 #define TAGLIB_APEITEM_H
00024 
00025 #include <tbytevector.h>
00026 #include <tstring.h>
00027 #include <tstringlist.h>
00028 
00029 namespace TagLib {
00030 
00031   namespace APE {
00032 
00034 
00038     class Item
00039     {
00040     public:
00044       enum ItemTypes {
00046         Text = 0,
00048         Binary = 1,
00050         Locator = 2
00051       };
00055       Item();
00056 
00060       Item(const String &key, const String &value);
00061 
00065       Item(const String &key, const StringList &values);
00066 
00070       Item(const Item &item);
00071 
00075       Item &operator=(const Item &item);
00076 
00080       String key() const;
00081 
00085       ByteVector value() const;
00086 
00090       int size() const;
00091 
00096       String toString() const;
00097 
00101       StringList toStringList() const;
00102 
00106       ByteVector render() const;
00107 
00111       void parse(const ByteVector& data);
00112 
00116       void setReadOnly(bool readOnly);
00117 
00121       bool isReadOnly() const;
00122 
00128       void setType(ItemTypes type);
00129 
00133       ItemTypes type() const;
00134 
00138       bool isEmpty() const;
00139 
00140     private:
00141       class ItemPrivate;
00142       ItemPrivate *d;
00143     };
00144   }
00145 
00146 }
00147 
00148 #endif
00149 
00150