tpropertymap.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright           : (C) 2012 by Michael Helmling
00003     email               : helmling@mathematik.uni-kl.de
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., 51 Franklin Street, Fifth Floor, Boston, MA         *
00019  *   02110-1301  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_PROPERTYMAP_H_
00027 #define TAGLIB_PROPERTYMAP_H_
00028 
00029 #include "tmap.h"
00030 #include "tstringlist.h"
00031 
00032 namespace TagLib {
00033 
00034   typedef Map<String,StringList> SimplePropertyMap;
00035 
00037 
00108   class TAGLIB_EXPORT PropertyMap: public SimplePropertyMap
00109   {
00110   public:
00111 
00112     typedef SimplePropertyMap::Iterator Iterator;
00113     typedef SimplePropertyMap::ConstIterator ConstIterator;
00114 
00115     PropertyMap();
00116 
00117     PropertyMap(const PropertyMap &m);
00118 
00124     PropertyMap(const SimplePropertyMap &m);
00125 
00126     virtual ~PropertyMap();
00127 
00134     bool insert(const String &key, const StringList &values);
00135 
00142     bool replace(const String &key, const StringList &values);
00143 
00147     Iterator find(const String &key);
00148 
00152     ConstIterator find(const String &key) const;
00153 
00157     bool contains(const String &key) const;
00158 
00164     bool contains(const PropertyMap &other) const;
00165 
00169     PropertyMap &erase(const String &key);
00170 
00174     PropertyMap &erase(const PropertyMap &other);
00175 
00182     PropertyMap &merge(const PropertyMap &other);
00183 
00190     const StringList &operator[](const String &key) const;
00191 
00199     StringList &operator[](const String &key);
00200 
00204     bool operator==(const PropertyMap &other) const;
00205 
00209     bool operator!=(const PropertyMap &other) const;
00210 
00220     StringList &unsupportedData();
00221     const StringList &unsupportedData() const;
00222 
00226     void removeEmpty();
00227 
00228     String toString() const;
00229 
00230   private:
00231 
00232 
00233     StringList unsupported;
00234   };
00235 
00236 }
00237 #endif /* TAGLIB_PROPERTYMAP_H_ */