Imported Upstream version 1.8.15
[platform/upstream/doxygen.git] / qtools / qcstringlist.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 1997-2018 by Dimitri van Heesch.
4 **
5 ** Permission to use, copy, modify, and distribute this software and its
6 ** documentation under the terms of the GNU General Public License is hereby
7 ** granted. No representations are made about the suitability of this software
8 ** for any purpose. It is provided "as is" without express or implied warranty.
9 ** See the GNU General Public License for more details.
10 **
11 ** Note: this is a variant of the qstringlist.h but for QCString's
12 **
13 **********************************************************************/
14 #ifndef QCSTRINGLIST_H
15 #define QCSTRINGLIST_H
16
17 #include "qvaluelist.h"
18 #include "qcstring.h"
19 #include "qregexp.h"
20
21 class QStrList;
22 class QDataStream;
23
24 class QCStringList : public QValueList<QCString>
25 {
26 public:
27     QCStringList() { }
28     QCStringList( const QCStringList& l ) : QValueList<QCString>(l) { }
29     QCStringList( const QValueList<QCString>& l ) : QValueList<QCString>(l) { }
30     QCStringList( const QCString& i ) { append(i); }
31     QCStringList( const char* i ) { append(i); }
32
33     static QCStringList fromStrList(const QStrList&);
34
35     static QCStringList split( const QCString &sep, const QCString &str, bool allowEmptyEntries = FALSE );
36     static QCStringList split( char sep,            const QCString &str, bool allowEmptyEntries = FALSE );
37     static QCStringList split( const QRegExp &sep,  const QCString &str, bool allowEmptyEntries = FALSE );
38     QCString join( const QCString &sep ) const;
39
40     QCStringList grep( const QCString &str, bool cs = TRUE ) const;
41     QCStringList grep( const QRegExp &expr ) const;
42 };
43
44 extern Q_EXPORT QDataStream &operator>>( QDataStream &, QCStringList& );
45 extern Q_EXPORT QDataStream &operator<<( QDataStream &, const QCStringList& );
46
47 #endif // QCSTRINGLIST_H