diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-02-09 14:29:21 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-03-20 08:19:25 +0000 |
commit | 5a4787dca01c302dd462a76222dfbf28c8951a8d (patch) | |
tree | 897b7caea659526d740e98c06b11c15970d35a7b /src/corelib/tools/qstringlist.h | |
parent | dd74f5d347d0a5a21527142f85114374e2d90646 (diff) |
Modernize the "regularexpression" feature
Use QT_CONFIG(regularexpression), disentangle it from QT_BOOTSTRAPPED,
switch it off in the bootstrap build, remove the #ifdefs from
qregularexpression.{h|cpp}, and add QT_REQUIRE_CONFIG(regularexpression)
to the header.
qregularexpression.{h|cpp} are already correctly excluded in tools.pri
if !qtConfig(regularexpression).
Change-Id: I21de154a6a118b76f99003d3acb72ac1e220d302
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/corelib/tools/qstringlist.h')
-rw-r--r-- | src/corelib/tools/qstringlist.h | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h index b11856d9be..e58445b8c0 100644 --- a/src/corelib/tools/qstringlist.h +++ b/src/corelib/tools/qstringlist.h @@ -84,12 +84,10 @@ public: inline QStringList &replaceInStrings(const QRegExp &rx, const QString &after); #endif -#ifndef QT_BOOTSTRAPPED -#ifndef QT_NO_REGULAREXPRESSION +#if QT_CONFIG(regularexpression) inline QStringList filter(const QRegularExpression &re) const; inline QStringList &replaceInStrings(const QRegularExpression &re, const QString &after); -#endif // QT_NO_REGULAREXPRESSION -#endif // QT_BOOTSTRAPPED +#endif // QT_CONFIG(regularexpression) #ifndef Q_QDOC private: @@ -138,12 +136,10 @@ public: inline int lastIndexOf(QRegExp &rx, int from = -1) const; #endif -#ifndef QT_BOOTSTRAPPED -#ifndef QT_NO_REGULAREXPRESSION +#if QT_CONFIG(regularexpression) inline int indexOf(const QRegularExpression &re, int from = 0) const; inline int lastIndexOf(const QRegularExpression &re, int from = -1) const; -#endif // QT_NO_REGULAREXPRESSION -#endif // QT_BOOTSTRAPPED +#endif // QT_CONFIG(regularexpression) using QList<QString>::indexOf; using QList<QString>::lastIndexOf; @@ -179,14 +175,12 @@ namespace QtPrivate { int Q_CORE_EXPORT QStringList_lastIndexOf(const QStringList *that, QRegExp &rx, int from); #endif -#ifndef QT_BOOTSTRAPPED -#ifndef QT_NO_REGULAREXPRESSION +#if QT_CONFIG(regularexpression) void Q_CORE_EXPORT QStringList_replaceInStrings(QStringList *that, const QRegularExpression &rx, const QString &after); QStringList Q_CORE_EXPORT QStringList_filter(const QStringList *that, const QRegularExpression &re); int Q_CORE_EXPORT QStringList_indexOf(const QStringList *that, const QRegularExpression &re, int from); int Q_CORE_EXPORT QStringList_lastIndexOf(const QStringList *that, const QRegularExpression &re, int from); -#endif // QT_NO_REGULAREXPRESSION -#endif // QT_BOOTSTRAPPED +#endif // QT_CONFIG(regularexpression) } inline void QListSpecialMethods<QString>::sort(Qt::CaseSensitivity cs) @@ -275,8 +269,7 @@ inline int QStringList::lastIndexOf(QRegExp &rx, int from) const } #endif -#ifndef QT_BOOTSTRAPPED -#ifndef QT_NO_REGULAREXPRESSION +#if QT_CONFIG(regularexpression) inline QStringList &QListSpecialMethods<QString>::replaceInStrings(const QRegularExpression &rx, const QString &after) { QtPrivate::QStringList_replaceInStrings(self(), rx, after); @@ -297,8 +290,7 @@ inline int QStringList::lastIndexOf(const QRegularExpression &rx, int from) cons { return QtPrivate::QStringList_lastIndexOf(this, rx, from); } -#endif // QT_NO_REGULAREXPRESSION -#endif // QT_BOOTSTRAPPED +#endif // QT_CONFIG(regularexpression) #endif // Q_QDOC QT_END_NAMESPACE |