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  *   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_APEITEM_H
00027 #define TAGLIB_APEITEM_H
00028 
00029 #include "tbytevector.h"
00030 #include "tstring.h"
00031 #include "tstringlist.h"
00032 
00033 namespace TagLib {
00034 
00035   namespace APE {
00036 
00038 
00042     class TAGLIB_EXPORT Item
00043     {
00044     public:
00048       enum ItemTypes {
00050         Text = 0,
00052         Binary = 1,
00054         Locator = 2
00055       };
00059       Item();
00060 
00064       // BIC: Remove this, StringList has a constructor from a single string
00065       Item(const String &key, const String &value);
00066 
00070       Item(const String &key, const StringList &values);
00071 
00075       Item(const Item &item);
00076 
00080       virtual ~Item();
00081 
00085       Item &operator=(const Item &item);
00086 
00090       String key() const;
00091 
00099       ByteVector value() const;
00100 
00104       void setKey(const String &key);
00105 
00111       void setValue(const String &value);
00112 
00119       void setValues(const StringList &values);
00120 
00126       void appendValue(const String &value);
00127 
00133       void appendValues(const StringList &values);
00134 
00138       int size() const;
00139 
00144       String toString() const;
00145 
00150       StringList toStringList() const;
00151 
00155       StringList values() const;
00156 
00160       ByteVector render() const;
00161 
00165       void parse(const ByteVector& data);
00166 
00170       void setReadOnly(bool readOnly);
00171 
00175       bool isReadOnly() const;
00176 
00182       void setType(ItemTypes type);
00183 
00187       ItemTypes type() const;
00188 
00192       bool isEmpty() const;
00193 
00194     private:
00195       class ItemPrivate;
00196       ItemPrivate *d;
00197     };
00198   }
00199 
00200 }
00201 
00202 #endif
00203 
00204