1 /****************************************************************************
4 ** Definition of QStringList class
8 ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
10 ** This file is part of the tools module of the Qt GUI Toolkit.
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.
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.
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.
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.
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.
33 ** Contact info@trolltech.com if any conditions of this licensing are
36 **********************************************************************/
42 #include "qvaluelist.h"
47 #ifndef QT_NO_STRINGLIST
51 class Q_EXPORT QStringList : public QValueList<QString>
55 QStringList( const QStringList& l ) : QValueList<QString>(l) { }
56 QStringList( const QValueList<QString>& l ) : QValueList<QString>(l) { }
57 QStringList( const QString& i ) { append(i); }
58 #ifndef QT_NO_CAST_ASCII
59 QStringList( const char* i ) { append(i); }
62 static QStringList fromStrList(const QStrList&);
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;
72 QStringList grep( const QString &str, bool cs = TRUE ) const;
73 QStringList grep( const QRegExp &expr ) const;
76 #ifndef QT_NO_DATASTREAM
78 extern Q_EXPORT QDataStream &operator>>( QDataStream &, QStringList& );
79 extern Q_EXPORT QDataStream &operator<<( QDataStream &, const QStringList& );
81 #endif // QT_NO_STRINGLIST
82 #endif // QSTRINGLIST_H