| TagLib 1.13 |  |

tlist.h
Go to the documentation of this file.
1/***************************************************************************
2 copyright : (C) 2002 - 2008 by Scott Wheeler
3 email : wheeler@kde.org
4 ***************************************************************************/
5
6/***************************************************************************
7 * This library is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU Lesser General Public License version *
9 * 2.1 as published by the Free Software Foundation. *
10 * *
11 * This library is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14 * Lesser General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with this library; if not, write to the Free Software *
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
19 * 02110-1301 USA *
20 * *
21 * Alternatively, this file is available under the Mozilla Public *
22 * License Version 1.1. You may obtain a copy of the License at *
23 * http://www.mozilla.org/MPL/ *
24 ***************************************************************************/
25
26#ifndef TAGLIB_LIST_H
27#define TAGLIB_LIST_H
28
29#include "taglib.h"
30
31#include <list>
32
33 namespace TagLib {
34
36
53 template <class T> class List
54 {
55 public:
56#ifndef DO_NOT_DOCUMENT
57 typedef typename std::list<T>::iterator Iterator;
58 typedef typename std::list<T>::const_iterator ConstIterator;
59#endif
60
64 List();
65
71 List(const List<T> &l);
72
77 virtual ~List();
78
83 Iterator begin();
84
89 ConstIterator begin() const;
90
95 Iterator end();
96
101 ConstIterator end() const;
102
106 Iterator insert(Iterator it, const T &value);
107
113 List<T> &sortedInsert(const T &value, bool unique = false);
114
119 List<T> &append(const T &item);
120
125 List<T> &append(const List<T> &l);
126
131 List<T> &prepend(const T &item);
132
137 List<T> &prepend(const List<T> &l);
138
145 List<T> &clear();
146
152 unsigned int size() const;
153
159 bool isEmpty() const;
160
164 Iterator find(const T &value);
165
169 ConstIterator find(const T &value) const;
170
174 bool contains(const T &value) const;
175
179 Iterator erase(Iterator it);
180
184 const T &front() const;
185
189 T &front();
190
194 const T &back() const;
195
199 T &back();
200
209 void setAutoDelete(bool autoDelete);
210
216 T &operator[](unsigned int i);
217
223 const T &operator[](unsigned int i) const;
224
230 List<T> &operator=(const List<T> &l);
231
235 void swap(List<T> &l);
236
241 bool operator==(const List<T> &l) const;
242
246 bool operator!=(const List<T> &l) const;
247
248 protected:
249 /*
250 * If this List is being shared via implicit sharing, do a deep copy of the
251 * data and separate from the shared members. This should be called by all
252 * non-const subclass members.
253 */
254 void detach();
255
256 private:
257#ifndef DO_NOT_DOCUMENT
258 template <class TP> class ListPrivate;
259 ListPrivate<T> *d;
260#endif
261 };
262
263}
264
265// Since GCC doesn't support the "export" keyword, we have to include the
266// implementation.
267
268#include "tlist.tcc"
269
270#endif
TagLib::List
A generic, implicitly shared list.
Definition: tlist.h:54
TagLib::List::operator[]
T & operator[](unsigned int i)
TagLib::List::operator=
List< T > & operator=(const List< T > &l)
TagLib::List::List
List(const List< T > &l)
TagLib::List::sortedInsert
List< T > & sortedInsert(const T &value, bool unique=false)
TagLib::List::erase
Iterator erase(Iterator it)
TagLib::List::append
List< T > & append(const T &item)
TagLib::List::~List
virtual ~List()
TagLib::List::front
const T & front() const
TagLib::List::begin
Iterator begin()
TagLib::List::find
ConstIterator find(const T &value) const
TagLib::List::clear
List< T > & clear()
TagLib::List::setAutoDelete
void setAutoDelete(bool autoDelete)
TagLib::List::detach
void detach()
TagLib::List::find
Iterator find(const T &value)
TagLib::List::List
List()
TagLib::List::operator[]
const T & operator[](unsigned int i) const
TagLib::List::insert
Iterator insert(Iterator it, const T &value)
TagLib::List::prepend
List< T > & prepend(const T &item)
TagLib::List::front
T & front()
TagLib::List::append
List< T > & append(const List< T > &l)
TagLib::List::begin
ConstIterator begin() const
TagLib::List::prepend
List< T > & prepend(const List< T > &l)
TagLib::List::size
unsigned int size() const
TagLib::List::operator==
bool operator==(const List< T > &l) const
TagLib::List::back
T & back()
TagLib::List::back
const T & back() const
TagLib::List::end
ConstIterator end() const
TagLib::List::swap
void swap(List< T > &l)
TagLib::List::contains
bool contains(const T &value) const
TagLib::List::end
Iterator end()
TagLib::List::isEmpty
bool isEmpty() const
TagLib::List::operator!=
bool operator!=(const List< T > &l) const
TagLib
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
taglib.h