qstringlist.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 **
4 ** Definition of QStringList class
5 **
6 ** Created : 990406
7 **
8 ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9 **
10 ** This file is part of the tools module of the Qt GUI Toolkit.
11 **
12 ** This file may be distributed under the terms of the Q Public License
13 ** as defined by Trolltech AS of Norway and appearing in the file
14 ** LICENSE.QPL included in the packaging of this file.
15 **
16 ** This file may be distributed and/or modified under the terms of the
17 ** GNU General Public License version 2 as published by the Free Software
18 ** Foundation and appearing in the file LICENSE.GPL included in the
19 ** packaging of this file.
20 **
21 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22 ** licenses may use this file in accordance with the Qt Commercial License
23 ** Agreement provided with the Software.
24 **
25 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27 **
28 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29 ** information about Qt Commercial License Agreements.
30 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
31 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
32 **
33 ** Contact info@trolltech.com if any conditions of this licensing are
34 ** not clear to you.
35 **
36 **********************************************************************/
37 
38 #ifndef QSTRINGLIST_H
39 #define QSTRINGLIST_H
40 
41 #ifndef QT_H
42 #include "qvaluelist.h"
43 #include "qstring.h"
44 #include "qregexp.h"
45 #endif // QT_H
46 
47 #ifndef QT_NO_STRINGLIST
48 
49 class QStrList;
50 
51 class Q_EXPORT QStringList : public QValueList<QString>
52 {
53 public:
57  QStringList( const QString& i ) { append(i); }
58 #ifndef QT_NO_CAST_ASCII
59  QStringList( const char* i ) { append(i); }
60 #endif
61 
62  static QStringList fromStrList(const QStrList&);
63 
64  void sort();
65 
66  static QStringList split( const QString &sep, const QString &str, bool allowEmptyEntries = FALSE );
67  static QStringList split( const QCString &sep, const QCString &str, bool allowEmptyEntries = FALSE );
68  static QStringList split( const QChar &sep, const QString &str, bool allowEmptyEntries = FALSE );
69  static QStringList split( const QRegExp &sep, const QString &str, bool allowEmptyEntries = FALSE );
70  QString join( const QString &sep ) const;
71 
72  QStringList grep( const QString &str, bool cs = TRUE ) const;
73  QStringList grep( const QRegExp &expr ) const;
74 };
75 
76 #ifndef QT_NO_DATASTREAM
77 class QDataStream;
80 #endif
81 #endif // QT_NO_STRINGLIST
82 #endif // QSTRINGLIST_H
Iterator append(const T &x)
Definition: qvaluelist.h:372
The QRegExp class provides pattern matching using regular expressions or wildcards.
Definition: qregexp.h:46
const bool FALSE
Definition: qglobal.h:370
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
QStringList(const QStringList &l)
Definition: qstringlist.h:55
The QChar class provides a light-weight Unicode character.
Definition: qstring.h:56
static QStrList * l
Definition: config.cpp:1044
QStringList(const QString &i)
Definition: qstringlist.h:57
QStringList(const QValueList< QString > &l)
Definition: qstringlist.h:56
QStringList(const char *i)
Definition: qstringlist.h:59
A list of strings.
Definition: qstringlist.h:51
QValueList< T > & operator<<(const T &x)
Definition: qvaluelist.h:404
Q_EXPORT QDataStream & operator>>(QDataStream &, QStringList &)
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:47
void split(std::string const &s, char c, OutIter dest)
Definition: split.h:35
const char * cs
#define Q_EXPORT
Definition: qglobal.h:468
const bool TRUE
Definition: qglobal.h:371
static QCString str