/usr/include/taglib/tmap.h is in libtag1-dev 1.7-1ubuntu5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | /***************************************************************************
copyright : (C) 2002 - 2008 by Scott Wheeler
email : wheeler@kde.org
***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 2.1 as published by the Free Software Foundation. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#ifndef TAGLIB_MAP_H
#define TAGLIB_MAP_H
#include <map>
using namespace std;
#include "taglib.h"
namespace TagLib {
//! A generic, implicitly shared map.
/*!
* This implements a standard map container that associates a key with a value
* and has fast key-based lookups. This map is also implicitly shared making
* it suitable for pass-by-value usage.
*/
template <class Key, class T> class Map
{
public:
#ifndef DO_NOT_DOCUMENT
#ifdef WANT_CLASS_INSTANTIATION_OF_MAP
// Some STL implementations get snippy over the use of the
// class keyword to distinguish different templates; Sun Studio
// in particular finds multiple specializations in certain rare
// cases and complains about that. GCC doesn't seem to mind,
// and uses the typedefs further below without the class keyword.
// Not all the specializations of Map can use the class keyword
// (when T is not actually a class type), so don't apply this
// generally.
typedef typename std::map<class Key, class T>::iterator Iterator;
typedef typename std::map<class Key, class T>::const_iterator ConstIterator;
#else
typedef typename std::map<Key, T>::iterator Iterator;
typedef typename std::map<Key, T>::const_iterator ConstIterator;
#endif
#endif
/*!
* Constructs an empty Map.
*/
Map();
/*!
* Make a shallow, implicitly shared, copy of \a m. Because this is
* implicitly shared, this method is lightweight and suitable for
* pass-by-value usage.
*/
Map(const Map<Key, T> &m);
/*!
* Destroys this instance of the Map.
*/
virtual ~Map();
/*!
* Returns an STL style iterator to the beginning of the map. See
* std::map::iterator for the semantics.
*/
Iterator begin();
/*!
* Returns an STL style iterator to the beginning of the map. See
* std::map::const_iterator for the semantics.
*/
ConstIterator begin() const;
/*!
* Returns an STL style iterator to the end of the map. See
* std::map::iterator for the semantics.
*/
Iterator end();
/*!
* Returns an STL style iterator to the end of the map. See
* std::map::const_iterator for the semantics.
*/
ConstIterator end() const;
/*!
* Inserts \a value under \a key in the map. If a value for \a key already
* exists it will be overwritten.
*/
Map<Key, T> &insert(const Key &key, const T &value);
/*!
* Removes all of the elements from elements from the map. This however
* will not delete pointers if the mapped type is a pointer type.
*/
Map<Key, T> &clear();
/*!
* The number of elements in the map.
*
* \see isEmpty()
*/
uint size() const;
/*!
* Returns true if the map is empty.
*
* \see size()
*/
bool isEmpty() const;
/*!
* Find the first occurrence of \a key.
*/
Iterator find(const Key &key);
/*!
* Find the first occurrence of \a key.
*/
ConstIterator find(const Key &key) const;
/*!
* Returns true if the map contains an instance of \a key.
*/
bool contains(const Key &key) const;
/*!
* Erase the item at \a it from the list.
*/
Map<Key, T> &erase(Iterator it);
/*!
* Erase the item with \a key from the list.
*/
Map<Key, T> &erase(const Key &key);
/*!
* Returns a reference to the value associated with \a key.
*
* \note This has undefined behavior if the key is not present in the map.
*/
const T &operator[](const Key &key) const;
/*!
* Returns a reference to the value associated with \a key.
*
* \note This has undefined behavior if the key is not present in the map.
*/
T &operator[](const Key &key);
/*!
* Make a shallow, implicitly shared, copy of \a m. Because this is
* implicitly shared, this method is lightweight and suitable for
* pass-by-value usage.
*/
Map<Key, T> &operator=(const Map<Key, T> &m);
protected:
/*
* If this List is being shared via implicit sharing, do a deep copy of the
* data and separate from the shared members. This should be called by all
* non-const subclass members.
*/
void detach();
private:
#ifndef DO_NOT_DOCUMENT
template <class KeyP, class TP> class MapPrivate;
MapPrivate<Key, T> *d;
#endif
};
}
// Since GCC doesn't support the "export" keyword, we have to include the
// implementation.
#include "tmap.tcc"
#endif
|