source: trunk/include/qstringlist.h@ 138

Last change on this file since 138 was 2, checked in by dmik, 20 years ago

Imported xplatform parts of the official release 3.3.1 from Trolltech

  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1/****************************************************************************
2** $Id: qstringlist.h 2 2005-11-16 15:49:26Z dmik $
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 "qstrlist.h"
45#endif // QT_H
46
47#ifndef QT_NO_STRINGLIST
48
49class QRegExp;
50template <class T> class QDeepCopy;
51
52#if defined(Q_TEMPLATEDLL)
53// MOC_SKIP_BEGIN
54//Q_TEMPLATE_EXTERN template class Q_EXPORT QValueList<QString>;
55// MOC_SKIP_END
56#endif
57
58class Q_EXPORT QStringList : public QValueList<QString>
59{
60public:
61 QStringList() { }
62 QStringList( const QStringList& l ) : QValueList<QString>(l) { }
63 QStringList( const QValueList<QString>& l ) : QValueList<QString>(l) { }
64 QStringList( const QString& i ) { append(i); }
65#ifndef QT_NO_CAST_ASCII
66 QStringList( const char* i ) { append(i); }
67#endif
68
69 static QStringList fromStrList(const QStrList&);
70
71 void sort();
72
73 static QStringList split( const QString &sep, const QString &str, bool allowEmptyEntries = FALSE );
74 static QStringList split( const QChar &sep, const QString &str, bool allowEmptyEntries = FALSE );
75#ifndef QT_NO_REGEXP
76 static QStringList split( const QRegExp &sep, const QString &str, bool allowEmptyEntries = FALSE );
77#endif
78 QString join( const QString &sep ) const;
79
80 QStringList grep( const QString &str, bool cs = TRUE ) const;
81#ifndef QT_NO_REGEXP
82 QStringList grep( const QRegExp &expr ) const;
83#endif
84
85 QStringList& gres( const QString &before, const QString &after,
86 bool cs = TRUE );
87#ifndef QT_NO_REGEXP_CAPTURE
88 QStringList& gres( const QRegExp &expr, const QString &after );
89#endif
90
91protected:
92 void detach() { QValueList<QString>::detach(); }
93 friend class QDeepCopy< QStringList >;
94};
95
96#ifndef QT_NO_DATASTREAM
97class QDataStream;
98extern Q_EXPORT QDataStream &operator>>( QDataStream &, QStringList& );
99extern Q_EXPORT QDataStream &operator<<( QDataStream &, const QStringList& );
100#endif
101
102#endif // QT_NO_STRINGLIST
103#endif // QSTRINGLIST_H
Note: See TracBrowser for help on using the repository browser.