summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qregularexpression.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2012-12-16 20:47:47 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-14 10:25:39 +0100
commit65fba49d639fe2499d66374486f16269e669daf0 (patch)
tree3bf758c70ece378bf93c8ae82f5e167aaeb6179b /src/corelib/tools/qregularexpression.cpp
parent0ae529c911fa5dadfa8d8cb666597483c966187e (diff)
Introduce default ctors for QRegularExpressionMatch(Iterator)
This allows to put them in containers, and to enable subsequent features for QString. Change-Id: I3b3fe695ffe6930331ed9f670738376722e0fc36 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qregularexpression.cpp')
-rw-r--r--src/corelib/tools/qregularexpression.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp
index 06c696e1e2..e3f39a2662 100644
--- a/src/corelib/tools/qregularexpression.cpp
+++ b/src/corelib/tools/qregularexpression.cpp
@@ -1658,6 +1658,26 @@ QString QRegularExpression::escape(const QString &str)
}
/*!
+ \since 5.1
+
+ Constructs a valid, empty QRegularExpressionMatch object. The regular
+ expression is set to a default-constructed one; the match type to
+ QRegularExpression::NoMatch and the match options to
+ QRegularExpression::NoMatchOption.
+
+ The object will report no match through the hasMatch() and the
+ hasPartialMatch() member functions.
+*/
+QRegularExpressionMatch::QRegularExpressionMatch()
+ : d(new QRegularExpressionMatchPrivate(QRegularExpression(),
+ QString(),
+ QRegularExpression::NoMatch,
+ QRegularExpression::NoMatchOption))
+{
+ d->isValid = true;
+}
+
+/*!
Destroys the match result.
*/
QRegularExpressionMatch::~QRegularExpressionMatch()
@@ -2001,6 +2021,26 @@ QRegularExpressionMatchIterator::QRegularExpressionMatchIterator(QRegularExpress
}
/*!
+ \since 5.1
+
+ Constructs an empty, valid QRegularExpressionMatchIterator object. The
+ regular expression is set to a default-constructed one; the match type to
+ QRegularExpression::NoMatch and the match options to
+ QRegularExpression::NoMatchOption.
+
+ Invoking the hasNext() member function on the constructed object will
+ return false, as the iterator is not iterating on a valid sequence of
+ matches.
+*/
+QRegularExpressionMatchIterator::QRegularExpressionMatchIterator()
+ : d(new QRegularExpressionMatchIteratorPrivate(QRegularExpression(),
+ QRegularExpression::NoMatch,
+ QRegularExpression::NoMatchOption,
+ QRegularExpressionMatch()))
+{
+}
+
+/*!
Destroys the QRegularExpressionMatchIterator object.
*/
QRegularExpressionMatchIterator::~QRegularExpressionMatchIterator()