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,            *
00019  *   MA  02110-1301  USA                                                   *
00020  ***************************************************************************/
00021 
00022 #ifndef PROPERTYMAP_H_
00023 #define PROPERTYMAP_H_
00024 
00025 #include "tmap.h"
00026 #include "tstringlist.h"
00027 
00028 namespace TagLib {
00029 
00030   typedef Map<String,StringList> SimplePropertyMap;
00031 
00033 
00045   class TAGLIB_EXPORT PropertyMap: public SimplePropertyMap
00046   {
00047   public:
00048 
00049     typedef SimplePropertyMap::Iterator Iterator;
00050     typedef SimplePropertyMap::ConstIterator ConstIterator;
00051 
00052     PropertyMap();
00053 
00054     PropertyMap(const PropertyMap &m);
00055 
00061     PropertyMap(const SimplePropertyMap &m);
00062 
00063     virtual ~PropertyMap();
00064 
00071     bool insert(const String &key, const StringList &values);
00072 
00079     bool replace(const String &key, const StringList &values);
00080 
00084     Iterator find(const String &key);
00085 
00089     ConstIterator find(const String &key) const;
00090 
00094     bool contains(const String &key) const;
00095 
00101     bool contains(const PropertyMap &other) const;
00102 
00106     PropertyMap &erase(const String &key);
00107 
00111     PropertyMap &erase(const PropertyMap &other);
00112 
00119     PropertyMap &merge(const PropertyMap &other);
00120 
00127     const StringList &operator[](const String &key) const;
00128 
00136     StringList &operator[](const String &key);
00137 
00141     bool operator==(const PropertyMap &other) const;
00142 
00146     bool operator!=(const PropertyMap &other) const;
00147 
00157     StringList &unsupportedData();
00158     const StringList &unsupportedData() const;
00159 
00163     void removeEmpty();
00164 
00165     String toString() const;
00166 
00167   private:
00168 
00169 
00170     StringList unsupported;
00171   };
00172 
00173 }
00174 #endif /* PROPERTYMAP_H_ */