Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

tlist.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2002 by Scott Wheeler
00003     email                : wheeler@kde.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_LIST_H
00023 #define TAGLIB_LIST_H
00024 
00025 #include "taglib.h"
00026 
00027 #include <list>
00028 
00029 namespace TagLib {
00030 
00032 
00049   template <class T> class List
00050   {
00051   public:
00052 #ifndef DO_NOT_DOCUMENT
00053     typedef typename std::list<T>::iterator Iterator;
00054     typedef typename std::list<T>::const_iterator ConstIterator;
00055 #endif
00056 
00060     List();
00061 
00067     List(const List<T> &l);
00068 
00073     virtual ~List();
00074 
00079     Iterator begin();
00080 
00085     ConstIterator begin() const;
00086 
00091     Iterator end();
00092 
00097     ConstIterator end() const;
00098 
00102     void insert(Iterator it, const T &value);
00103 
00109     void sortedInsert(const T &value, bool unique = false);
00110 
00114     void append(const T &item);
00115 
00119     void append(const List<T> &l);
00120 
00127     void clear();
00128 
00132     uint size() const;
00133     bool isEmpty() const;
00134 
00138     Iterator find(const T &value);
00139 
00143     ConstIterator find(const T &value) const;
00144 
00148     bool contains(const T &value) const;
00149 
00153     void erase(Iterator it);
00154 
00158     const T &front() const;
00159 
00163     T &front();
00164 
00168     const T &back() const;
00169 
00173     T &back();
00174 
00183     void setAutoDelete(bool autoDelete);
00184 
00190     T &operator[](uint i);
00191 
00197     const T &operator[](uint i) const;
00198 
00204     List<T> &operator=(const List<T> &l);
00205 
00210     bool operator==(const List<T> &l) const;
00211 
00212   protected:
00213     /*
00214      * If this List is being shared via implicit sharing, do a deep copy of the
00215      * data and separate from the shared members.  This should be called by all
00216      * non-const subclass members.
00217      */
00218     void detach();
00219 
00220   private:
00221 #ifndef DO_NOT_DOCUMENT
00222     template <class TP> class ListPrivate;
00223     ListPrivate<T> *d;
00224 #endif
00225   };
00226 
00227 }
00228 
00229 // Since GCC doesn't support the "export" keyword, we have to include the
00230 // implementation.
00231 
00232 #include "tlist.tcc"
00233 
00234 #endif

Generated on Mon Jun 7 12:51:48 2004 for TagLib by doxygen 1.3.4