summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qregexp.cpp
diff options
context:
space:
mode:
authorMarius Storm-Olsen <marius.storm-olsen@nokia.com>2009-11-05 14:18:35 (GMT)
committerMarius Storm-Olsen <marius.storm-olsen@nokia.com>2009-11-06 14:43:16 (GMT)
commit98e0b95581f46b94773a55195e0e67a466c333ed (patch)
tree062707bdf2ef4ed19ed0124a77b7abf7099f2b22 /src/corelib/tools/qregexp.cpp
parent863369deceeb254ea71724a247953fd0760ae30b (diff)
downloadQt-98e0b95581f46b94773a55195e0e67a466c333ed.zip
Qt-98e0b95581f46b94773a55195e0e67a466c333ed.tar.gz
Qt-98e0b95581f46b94773a55195e0e67a466c333ed.tar.bz2
API review: QRegExp::numCaptures() -> QRegExp::captureCount()
QRegExp::numCaptures() is marked as obsolete. Replaced all usage in Qt and test-cases. Reviewed-by: Andreas Aardal Hanssen
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();
}
/*!