diff options
author | Samuel Gaist <samuel.gaist@idiap.ch> | 2018-08-01 00:07:11 +0200 |
---|---|---|
committer | Samuel Gaist <samuel.gaist@idiap.ch> | 2018-08-16 16:30:14 +0000 |
commit | 30b0701c9b50ec718ec858d7777a01c66e333a9c (patch) | |
tree | 21f5eb38257aaa50ab18b4ae9d1e644170f8efbe /src/corelib/tools/qregularexpression.h | |
parent | 0f6b941ca54f9714627b8d5a94be163dc02126c1 (diff) |
Refactor wildcard support in QRegularExpression
The API originally proposed was flawed in the sense that the setter
function would use a modified version of the parameter given which would
have make it a black box for the user. This patch fixes that by removing
that setter and providing a static method that will return the pattern
suitably modified to be used by QRegularExpression the same way the
escape method does.
[ChangeLog][Core][QRegularExpression] Implemented support for wildcard
patterns through a static method.
Change-Id: I0054bcaffd7525dac569f54fa81f73b7e4544b2e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qregularexpression.h')
-rw-r--r-- | src/corelib/tools/qregularexpression.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qregularexpression.h b/src/corelib/tools/qregularexpression.h index d0f90b90b3..388aa7a8ca 100644 --- a/src/corelib/tools/qregularexpression.h +++ b/src/corelib/tools/qregularexpression.h @@ -96,7 +96,6 @@ public: QString pattern() const; void setPattern(const QString &pattern); - void setWildcardPattern(const QString &pattern); bool isValid() const; int patternErrorOffset() const; @@ -142,6 +141,7 @@ public: void optimize() const; static QString escape(const QString &str); + static QString wildcardToRegularExpression(const QString &str); bool operator==(const QRegularExpression &re) const; inline bool operator!=(const QRegularExpression &re) const { return !operator==(re); } |