diff options
author | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2009-11-09 12:03:20 (GMT) |
---|---|---|
committer | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2009-11-09 12:03:20 (GMT) |
commit | cf417f787454f131f35248bb0c1294dadd777b45 (patch) | |
tree | e5ad2f54887aa695c6f66ae2c305ab75ccabdac0 /src/corelib/tools/qregexp.cpp | |
parent | a7577f8c3ae3a025384d8d19fdf3575ef141a70b (diff) | |
parent | e07878a9bcccbf063650272329c0aca14290b8e3 (diff) | |
download | Qt-cf417f787454f131f35248bb0c1294dadd777b45.zip Qt-cf417f787454f131f35248bb0c1294dadd777b45.tar.gz Qt-cf417f787454f131f35248bb0c1294dadd777b45.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/corelib/tools/qregexp.cpp')
-rw-r--r-- | src/corelib/tools/qregexp.cpp | 18 |
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(); } /*! |