#include <tlist.h>
Public Member Functions | |
List () | |
List (const List< T > &l) | |
virtual | ~List () |
Iterator | begin () |
ConstIterator | begin () const |
Iterator | end () |
ConstIterator | end () const |
void | insert (Iterator it, const T &value) |
void | sortedInsert (const T &value, bool unique=false) |
void | append (const T &item) |
void | append (const List< T > &l) |
void | clear () |
uint | size () const |
bool | isEmpty () const |
Iterator | find (const T &value) |
ConstIterator | find (const T &value) const |
bool | contains (const T &value) const |
void | erase (Iterator it) |
const T & | front () const |
T & | front () |
const T & | back () const |
T & | back () |
void | setAutoDelete (bool autoDelete) |
T & | operator[] (uint i) |
const T & | operator[] (uint i) const |
List< T > & | operator= (const List< T > &l) |
bool | operator== (const List< T > &l) const |
Protected Member Functions | |
void | detach () |
This is basic generic list that's somewhere between a std::list and a QValueList. This class is implicitly shared. For example:
TagLib::List<int> l = someOtherIntList;
The above example is very cheap. This also makes lists suitable for the return types of functions. The above example will just copy a pointer rather than copying the data in the list. When your shared list's data changes, only then will the data be copied.
|
Constructs an empty list. |
|
Make a shallow, implicitly shared, copy of l. Because this is implicitly shared, this method is lightweight and suitable for pass-by-value usage. |
|
Destroys this List instance. If auto deletion is enabled and this list contains a pointer type all of the memebers are also deleted. |
|
Appends all of the values in l to the end of the list. |
|
Appends item to the end of the list. |
|
Returns a reference to the last item in the list. |
|
Returns a reference to the last item in the list. |
|
Returns an STL style constant iterator to the beginning of the list. See std::list::iterator for the semantics. |
|
Returns an STL style iterator to the beginning of the list. See std::list::const_iterator for the semantics. |
|
Clears the list. If auto deletion is enabled and this list contains a pointer type the members are also deleted.
|
|
Returns true if the list contains value. |
|
|
|
Returns an STL style constant iterator to the end of the list. See std::list::const_iterator for the semantics. |
|
Returns an STL style iterator to the end of the list. See std::list::iterator for the semantics. |
|
Erase the item at it from the list. |
|
Find the first occurance of value. |
|
Find the first occurance of value. |
|
Returns a reference to the first item in the list. |
|
Returns a reference to the first item in the list. |
|
Inserts a copy of value before it. |
|
|
|
Make a shallow, implicitly shared, copy of l. Because this is implicitly shared, this method is lightweight and suitable for pass-by-value usage. |
|
Compares this list with l and returns true if all of the elements are the same. |
|
Returns a const reference to item i in the list.
|
|
Returns a reference to item i in the list.
|
|
Auto delete the members of the list when the last reference to the list passes out of scope. This will have no effect on lists which do not contain a pointer type.
|
|
Returns the number of elements in the list. |
|
Inserts the value into the list. This assumes that the list is currently sorted. If unique is true then the value will not be inserted if it is already in the list. |