00001 /**************************************************************************** 00002 ** $Id: qstringlist.h,v 1.2 2003/07/10 02:40:11 llornkcor Exp $ 00003 ** 00004 ** Definition of QStringList class 00005 ** 00006 ** Created : 990406 00007 ** 00008 ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 00009 ** 00010 ** This file is part of the tools module of the Qt GUI Toolkit. 00011 ** 00012 ** This file may be distributed under the terms of the Q Public License 00013 ** as defined by Trolltech AS of Norway and appearing in the file 00014 ** LICENSE.QPL included in the packaging of this file. 00015 ** 00016 ** This file may be distributed and/or modified under the terms of the 00017 ** GNU General Public License version 2 as published by the Free Software 00018 ** Foundation and appearing in the file LICENSE.GPL included in the 00019 ** packaging of this file. 00020 ** 00021 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 00022 ** licenses may use this file in accordance with the Qt Commercial License 00023 ** Agreement provided with the Software. 00024 ** 00025 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00026 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00027 ** 00028 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 00029 ** information about Qt Commercial License Agreements. 00030 ** See http://www.trolltech.com/qpl/ for QPL licensing information. 00031 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00032 ** 00033 ** Contact info@trolltech.com if any conditions of this licensing are 00034 ** not clear to you. 00035 ** 00036 **********************************************************************/ 00037 00038 #ifndef QSTRINGLIST_H 00039 #define QSTRINGLIST_H 00040 00041 #ifndef QT_H 00042 #include "qvaluelist.h" 00043 #include "qstring.h" 00044 #include "qstrlist.h" 00045 #endif // QT_H 00046 00047 #ifndef QT_NO_STRINGLIST 00048 00049 class QRegExp; 00050 00051 class Q_EXPORT QStringList : public QValueList<QString> 00052 { 00053 public: 00054 QStringList() { } 00055 QStringList( const QStringList& l ) : QValueList<QString>(l) { } 00056 QStringList( const QValueList<QString>& l ) : QValueList<QString>(l) { } 00057 QStringList( const QString& i ) { append(i); } 00058 #ifndef QT_NO_CAST_ASCII 00059 QStringList( const char* i ) { append(i); } 00060 #endif 00061 00062 static QStringList fromStrList(const QStrList&); 00063 00064 void sort(); 00065 00066 static QStringList split( const QString &sep, const QString &str, bool allowEmptyEntries = FALSE ); 00067 static QStringList split( const QChar &sep, const QString &str, bool allowEmptyEntries = FALSE ); 00068 #ifndef QT_NO_REGEXP 00069 static QStringList split( const QRegExp &sep, const QString &str, bool allowEmptyEntries = FALSE ); 00070 #endif 00071 QString join( const QString &sep ) const; 00072 00073 QStringList grep( const QString &str, bool cs = TRUE ) const; 00074 #ifndef QT_NO_REGEXP 00075 QStringList grep( const QRegExp &expr ) const; 00076 #endif 00077 }; 00078 00079 #ifndef QT_NO_DATASTREAM 00080 class QDataStream; 00081 extern Q_EXPORT QDataStream &operator>>( QDataStream &, QStringList& ); 00082 extern Q_EXPORT QDataStream &operator<<( QDataStream &, const QStringList& ); 00083 #endif 00084 00085 #endif // QT_NO_STRINGLIST 00086 #endif // QSTRINGLIST_H
1.4.2