summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2012-10-14 16:29:39 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-07 16:11:19 +0100
commit59eb393cf57015a4dfea94617c863aafb096afa7 (patch)
tree3cb977b8a857940f909ee52db05a3de92779dbca /src/corelib/tools
parent79f0a29abf3b2947da7848c8501061fdf7e91b76 (diff)
Rename QRegularExpression-related feature defs to QT_NO_REGULAREXPRESSION
QRegExp and QRegularExpression are totally independent, therefore using two different defines is the right thing to do. Also, document the new define in qfeatures.{txt,h}. Change-Id: Ice4826ea543f4b22f1cc27bf31ed6e043d0c43b0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qregularexpression.h4
-rw-r--r--src/corelib/tools/qstring.cpp26
-rw-r--r--src/corelib/tools/qstring.h8
-rw-r--r--src/corelib/tools/qstringlist.cpp12
-rw-r--r--src/corelib/tools/qstringlist.h12
5 files changed, 34 insertions, 28 deletions
diff --git a/src/corelib/tools/qregularexpression.h b/src/corelib/tools/qregularexpression.h
index 4c95a5b3a0..e312b10ff1 100644
--- a/src/corelib/tools/qregularexpression.h
+++ b/src/corelib/tools/qregularexpression.h
@@ -42,7 +42,7 @@
#ifndef QREGULAREXPRESSION_H
#define QREGULAREXPRESSION_H
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_REGULAREXPRESSION
#include <QtCore/qstring.h>
#include <QtCore/qshareddata.h>
@@ -241,6 +241,6 @@ QT_END_NAMESPACE
QT_END_HEADER
-#endif // QT_NO_REGEXP
+#endif // QT_NO_REGULAREXPRESSION
#endif // QREGULAREXPRESSION_H
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 6db4fed0f8..10ef6b34dd 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -2762,13 +2762,17 @@ int QString::lastIndexOf(const QStringRef &str, int from, Qt::CaseSensitivity cs
str.size(), cs);
}
-#ifndef QT_NO_REGEXP
+
+#if !(defined(QT_NO_REGEXP) && defined(QT_NO_REGULAREXPRESSION))
struct QStringCapture
{
int pos;
int len;
int no;
};
+#endif
+
+#ifndef QT_NO_REGEXP
/*!
\overload replace()
@@ -2925,7 +2929,7 @@ QString& QString::replace(const QRegExp &rx, const QString &after)
}
#endif
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_REGULAREXPRESSION
#ifndef QT_BOOTSTRAPPED
/*!
\overload replace()
@@ -3055,7 +3059,7 @@ QString &QString::replace(const QRegularExpression &re, const QString &after)
return *this;
}
#endif // QT_BOOTSTRAPPED
-#endif // QT_NO_REGEXP
+#endif // QT_NO_REGULAREXPRESSION
/*!
Returns the number of (potentially overlapping) occurrences of
@@ -3256,7 +3260,7 @@ int QString::count(const QRegExp& rx) const
}
#endif // QT_NO_REGEXP
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_REGULAREXPRESSION
#ifndef QT_BOOTSTRAPPED
/*!
\overload indexOf()
@@ -3366,7 +3370,7 @@ int QString::count(const QRegularExpression &re) const
return count;
}
#endif // QT_BOOTSTRAPPED
-#endif // QT_NO_REGEXP
+#endif // QT_NO_REGULAREXPRESSION
/*! \fn int QString::count() const
@@ -3487,7 +3491,7 @@ QString QString::section(const QString &sep, int start, int end, SectionFlags fl
return ret;
}
-#ifndef QT_NO_REGEXP
+#if !(defined(QT_NO_REGEXP) && defined(QT_NO_REGULAREXPRESSION))
class qt_section_chunk {
public:
qt_section_chunk(int l, QString s) { length = l; string = s; }
@@ -3537,7 +3541,9 @@ static QString extractSections(const QList<qt_section_chunk> &sections,
return ret;
}
+#endif
+#ifndef QT_NO_REGEXP
/*!
\overload section()
@@ -3575,7 +3581,7 @@ QString QString::section(const QRegExp &reg, int start, int end, SectionFlags fl
}
#endif
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_REGULAREXPRESSION
#ifndef QT_BOOTSTRAPPED
/*!
\overload section()
@@ -3621,7 +3627,7 @@ QString QString::section(const QRegularExpression &re, int start, int end, Secti
return extractSections(sections, start, end, flags);
}
#endif // QT_BOOTSTRAPPED
-#endif // QT_NO_REGEXP
+#endif // QT_NO_REGULAREXPRESSION
/*!
Returns a substring that contains the \a n leftmost characters
@@ -6416,7 +6422,7 @@ QStringList QString::split(const QRegExp &rx, SplitBehavior behavior) const
}
#endif
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_REGULAREXPRESSION
#ifndef QT_BOOTSTRAPPED
/*!
\overload
@@ -6470,7 +6476,7 @@ QStringList QString::split(const QRegularExpression &re, SplitBehavior behavior)
return list;
}
#endif // QT_BOOTSTRAPPED
-#endif // QT_NO_REGEXP
+#endif // QT_NO_REGULAREXPRESSION
/*!
\enum QString::NormalizationForm
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index b679f0f990..574285fa1e 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -335,7 +335,7 @@ public:
inline bool contains(QRegExp &rx) const { return indexOf(rx) != -1; }
#endif
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_REGULAREXPRESSION
int indexOf(const QRegularExpression &re, int from = 0) const;
int lastIndexOf(const QRegularExpression &re, int from = -1) const;
bool contains(const QRegularExpression &re) const;
@@ -356,7 +356,7 @@ public:
#ifndef QT_NO_REGEXP
QString section(const QRegExp &reg, int start, int end = -1, SectionFlags flags = SectionDefault) const;
#endif
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_REGULAREXPRESSION
QString section(const QRegularExpression &re, int start, int end = -1, SectionFlags flags = SectionDefault) const;
#endif
QString left(int n) const Q_REQUIRED_RESULT;
@@ -432,7 +432,7 @@ public:
inline QString &remove(const QRegExp &rx)
{ return replace(rx, QString()); }
#endif
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_REGULAREXPRESSION
QString &replace(const QRegularExpression &re, const QString &after);
inline QString &remove(const QRegularExpression &re)
{ return replace(re, QString()); }
@@ -447,7 +447,7 @@ public:
#ifndef QT_NO_REGEXP
QStringList split(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const Q_REQUIRED_RESULT;
#endif
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_REGULAREXPRESSION
QStringList split(const QRegularExpression &sep, SplitBehavior behavior = KeepEmptyParts) const Q_REQUIRED_RESULT;
#endif
enum NormalizationForm {
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index d56f531e52..35ff2d3d84 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -320,7 +320,7 @@ QStringList QtPrivate::QStringList_filter(const QStringList *that, const QRegExp
#endif
#ifndef QT_BOOTSTRAPPED
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_REGULAREXPRESSION
/*!
\fn QStringList QStringList::filter(const QRegularExpression &re) const
\overload
@@ -338,7 +338,7 @@ QStringList QtPrivate::QStringList_filter(const QStringList *that, const QRegula
}
return res;
}
-#endif // QT_NO_REGEXP
+#endif // QT_NO_REGULAREXPRESSION
#endif // QT_BOOTSTRAPPED
/*!
@@ -395,7 +395,7 @@ void QtPrivate::QStringList_replaceInStrings(QStringList *that, const QRegExp &r
#endif
#ifndef QT_BOOTSTRAPPED
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_REGULAREXPRESSION
/*!
\fn QStringList &QStringList::replaceInStrings(const QRegularExpression &re, const QString &after)
\overload
@@ -424,7 +424,7 @@ void QtPrivate::QStringList_replaceInStrings(QStringList *that, const QRegularEx
for (int i = 0; i < that->size(); ++i)
(*that)[i].replace(re, after);
}
-#endif // QT_NO_REGEXP
+#endif // QT_NO_REGULAREXPRESSION
#endif // QT_BOOTSTRAPPED
/*!
@@ -619,7 +619,7 @@ int QtPrivate::QStringList_lastIndexOf(const QStringList *that, QRegExp &rx, int
#endif
#ifndef QT_BOOTSTRAPPED
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_REGULAREXPRESSION
/*!
\fn int QStringList::indexOf(const QRegularExpression &re, int from) const
\overload
@@ -676,7 +676,7 @@ int QtPrivate::QStringList_lastIndexOf(const QStringList *that, const QRegularEx
}
return -1;
}
-#endif // QT_NO_REGEXP
+#endif // QT_NO_REGULAREXPRESSION
#endif // QT_BOOTSTRAPPED
/*!
diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h
index 2448081004..9f7e41d800 100644
--- a/src/corelib/tools/qstringlist.h
+++ b/src/corelib/tools/qstringlist.h
@@ -99,12 +99,12 @@ public:
#endif
#ifndef QT_BOOTSTRAPPED
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_REGULAREXPRESSION
inline QStringList filter(const QRegularExpression &re) const;
inline QStringList &replaceInStrings(const QRegularExpression &re, const QString &after);
inline int indexOf(const QRegularExpression &re, int from = 0) const;
inline int lastIndexOf(const QRegularExpression &re, int from = -1) const;
-#endif // QT_NO_REGEXP
+#endif // QT_NO_REGULAREXPRESSION
#endif // QT_BOOTSTRAPPED
#if !defined(Q_NO_USING_KEYWORD)
@@ -141,12 +141,12 @@ namespace QtPrivate {
#endif
#ifndef QT_BOOTSTRAPPED
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_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_REGEXP
+#endif // QT_NO_REGULAREXPRESSION
#endif // QT_BOOTSTRAPPED
}
@@ -220,7 +220,7 @@ inline int QStringList::lastIndexOf(QRegExp &rx, int from) const
#endif
#ifndef QT_BOOTSTRAPPED
-#ifndef QT_NO_REGEXP
+#ifndef QT_NO_REGULAREXPRESSION
inline QStringList &QStringList::replaceInStrings(const QRegularExpression &rx, const QString &after)
{
QtPrivate::QStringList_replaceInStrings(this, rx, after);
@@ -241,7 +241,7 @@ inline int QStringList::lastIndexOf(const QRegularExpression &rx, int from) cons
{
return QtPrivate::QStringList_lastIndexOf(this, rx, from);
}
-#endif // QT_NO_REGEXP
+#endif // QT_NO_REGULAREXPRESSION
#endif // QT_BOOTSTRAPPED
#ifndef QT_NO_DATASTREAM