![]() |
|
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 virtual ~Item(); 00076 00080 Item &operator=(const Item &item); 00081 00085 String key() const; 00086 00090 ByteVector value() const; 00091 00095 int size() const; 00096 00101 String toString() const; 00102 00106 StringList toStringList() const; 00107 00111 ByteVector render() const; 00112 00116 void parse(const ByteVector& data); 00117 00121 void setReadOnly(bool readOnly); 00122 00126 bool isReadOnly() const; 00127 00133 void setType(ItemTypes type); 00134 00138 ItemTypes type() const; 00139 00143 bool isEmpty() const; 00144 00145 private: 00146 class ItemPrivate; 00147 ItemPrivate *d; 00148 }; 00149 } 00150 00151 } 00152 00153 #endif 00154 00155