summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qregexp.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-11-09 18:32:04 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-11-09 18:32:04 (GMT)
commit81f3b28f2f82b15f9d255ec38abdc5f749b8809c (patch)
tree7e41a16587d903498fbb1ca71cd286a9ba156241 /src/corelib/tools/qregexp.cpp
parentf656909791819b3f033f9ec1bd0de524b92919e2 (diff)
parentb770abdd564f28a8d9dde816f72f73e6b15984af (diff)
downloadQt-81f3b28f2f82b15f9d255ec38abdc5f749b8809c.zip
Qt-81f3b28f2f82b15f9d255ec38abdc5f749b8809c.tar.gz
Qt-81f3b28f2f82b15f9d255ec38abdc5f749b8809c.tar.bz2
Merge remote branch 'origin/4.6' into 4.6-platform
Diffstat (limited to 'src/corelib/tools/qregexp.cpp')
-rw-r--r--src/corelib/tools/qregexp.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index 1f23211..3ca8ab9 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -1083,7 +1083,7 @@ public:
bool isValid() const { return valid; }
const QString &errorString() const { return yyError; }
- int numCaptures() const { return officialncap; }
+ int captureCount() const { return officialncap; }
int createState(QChar ch);
int createState(const QRegExpCharClass &cc);
@@ -1378,7 +1378,7 @@ void QRegExpMatchState::prepareForMatch(QRegExpEngine *eng)
#else
int newSlideTabSize = 0;
#endif
- int numCaptures = eng->numCaptures();
+ int numCaptures = eng->captureCount();
int newCapturedSize = 2 + 2 * numCaptures;
bigArray = q_check_ptr((int *)realloc(bigArray, ((3 + 4 * ncap) * ns + 4 * ncap + newSlideTabSize + newCapturedSize)*sizeof(int)));
@@ -4168,12 +4168,24 @@ int QRegExp::matchedLength() const
#ifndef QT_NO_REGEXP_CAPTURE
/*!
+ \obsolete
Returns the number of captures contained in the regular expression.
+
+ \sa captureCount()
*/
int QRegExp::numCaptures() const
{
+ return captureCount();
+}
+
+/*!
+ \since 4.6
+ Returns the number of captures contained in the regular expression.
+ */
+int QRegExp::captureCount() const
+{
prepareEngine(priv);
- return priv->eng->numCaptures();
+ return priv->eng->captureCount();
}
/*!