|
ISLEman
|
A list of strings. More...
#include <qstringlist.h>
Public Member Functions | |
| QStringList () | |
| QStringList (const QStringList &l) | |
| QStringList (const QValueList< QString > &l) | |
| QStringList (const QString &i) | |
| QStringList (const char *i) | |
| void | sort () |
| QString | join (const QString &sep) const |
| QStringList | grep (const QString &str, bool cs=TRUE) const |
| QStringList | grep (const QRegExp &expr) const |
Public Member Functions inherited from QValueList< QString > | |
| QValueList () | |
| API. | |
| QValueList (const QValueList< QString > &l) | |
| QValueList< QString > & | operator= (const QValueList< QString > &l) |
| QValueList< QString > | operator+ (const QValueList< QString > &l) const |
| QValueList< QString > & | operator+= (const QValueList< QString > &l) |
| QValueList< QString > & | operator+= (const QString &x) |
| bool | operator== (const QValueList< QString > &l) const |
| bool | operator!= (const QValueList< QString > &l) const |
| Iterator | begin () |
| ConstIterator | begin () const |
| Iterator | end () |
| ConstIterator | end () const |
| Iterator | fromLast () |
| ConstIterator | fromLast () const |
| bool | isEmpty () const |
| Iterator | insert (Iterator it, const QString &x) |
| Iterator | append (const QString &x) |
| Iterator | prepend (const QString &x) |
| Iterator | remove (Iterator it) |
| void | remove (const QString &x) |
| QString & | first () |
| const QString & | first () const |
| QString & | last () |
| const QString & | last () const |
| QString & | operator[] (uint i) |
| const QString & | operator[] (uint i) const |
| Iterator | at (uint i) |
| ConstIterator | at (uint i) const |
| Iterator | find (const QString &x) |
| ConstIterator | find (const QString &x) const |
| Iterator | find (Iterator it, const QString &x) |
| ConstIterator | find (ConstIterator it, const QString &x) const |
| int | findIndex (const QString &x) const |
| uint | contains (const QString &x) const |
| uint | count () const |
| void | clear () |
| QValueList< QString > & | operator<< (const QString &x) |
Static Public Member Functions | |
| static QStringList | fromStrList (const QStrList &) |
| static QStringList | split (const QString &sep, const QString &str, bool allowEmptyEntries=FALSE) |
| static QStringList | split (const QCString &sep, const QCString &str, bool allowEmptyEntries=FALSE) |
| static QStringList | split (const QChar &sep, const QString &str, bool allowEmptyEntries=FALSE) |
| static QStringList | split (const QRegExp &sep, const QString &str, bool allowEmptyEntries=FALSE) |
Additional Inherited Members | |
Public Types inherited from QValueList< QString > | |
| typedef QValueListIterator< QString > | Iterator |
| Typedefs. | |
| typedef QValueListConstIterator< QString > | ConstIterator |
| typedef QString | ValueType |
Protected Member Functions inherited from QValueList< QString > | |
| void | detach () |
| Helpers. | |
Protected Attributes inherited from QValueList< QString > | |
| QValueListPrivate< QString > * | sh |
| Variables. | |
A list of strings.
QStringList is basically a QValueList of QString objects. As opposed to QStrList, that stores pointers to characters, QStringList deals with real QString objects. It is the class of choice whenever you work with unicode strings.
Like QString itself, QStringList objects are implicit shared. Passing them around as value-parameters is both fast and safe.
Convenience methods such as sort(), split(), join() and grep() make working with QStringList easy.
|
inline |
Creates an empty list.
|
inline |
Creates a copy of the list. This function is very fast since QStringList is implicit shared. However, for the programmer this is the same as a deep copy. If this list or the original one or some other list referencing the same shared data is modified, then the modifying list makes a copy first.
|
inline |
Constructs a new string list that is a copy of l.
|
inline |
Constructs a string list consisting of the single string i. To make longer lists easily, use:
|
inline |
Constructs a string list consisting of the single latin-1 string i.
|
static |
Converts from a QStrList (ASCII) to a QStringList (Unicode).
| QStringList QStringList::grep | ( | const QString & | str, |
| bool | cs = TRUE |
||
| ) | const |
Returns a list of all strings containing the substring str.
If cs is TRUE, the grep is done case sensitively, else not.
| QStringList QStringList::grep | ( | const QRegExp & | expr | ) | const |
Returns a list of all strings containing a substring that matches the regular expression expr.
Joins the stringlist into a single string with each element separated by sep.
| void QStringList::sort | ( | ) |
Sorts the list of strings in ascending order.
Sorting is very fast. It uses the Qt Template Library's efficient HeapSort implementation that operates in O(n*log n).
|
static |
Splits the string str using sep as separator. Returns the list of strings. If allowEmptyEntries is TRUE, also empty entries are inserted into the list, else not. So if you have a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e' would be returned if allowEmptyEntries is FALSE, but a list containing 'abc', '', 'd', 'e' and '' would be returned if allowEmptyEntries is TRUE. If str doesn't contain sep, a stringlist with one item, which is the same as str, is returned.
|
static |
Splits the string str using sep as separator. Returns the list of strings. If allowEmptyEntries is TRUE, also empty entries are inserted into the list, else not. So if you have a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e' would be returned if allowEmptyEntries is FALSE, but a list containing 'abc', '', 'd', 'e' and '' would be returned if allowEmptyEntries is TRUE. If str doesn't contain sep, a stringlist with one item, which is the same as str, is returned.
|
static |
Splits the string str using the regular expression sep as separator. Returns the list of strings. If allowEmptyEntries is TRUE, also empty entries are inserted into the list, else not. So if you have a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e' would be returned if allowEmptyEntries is FALSE, but a list containing 'abc', '', 'd', 'e' and '' would be returned if allowEmptyEntries is TRUE. If str doesn't contain sep, a stringlist with one item, which is the same as str, is returned.
1.8.12