diff options
author | Anton Kudryavtsev <anton.kudryavtsev@corp.mail.ru> | 2019-03-12 02:40:01 -0700 |
---|---|---|
committer | Anton Kudryavtsev <antkudr@mail.ru> | 2019-03-14 04:48:06 +0000 |
commit | b35eec360d4d88d094094fb54c101fad6cee5768 (patch) | |
tree | 2e08d4a937c4b1988ee587b470b9c45d7fb5442d /src/corelib/tools/qstringmatcher.h | |
parent | 29a70348d4ed4f5acca82bfb9f73a1acf06c3aa8 (diff) |
QStringMatcher: add QStringView support
While touching the code, deduplicate some methods.
Change-Id: I28f469f0e9ae000a34466b0ecc604b5f3bd09e63
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qstringmatcher.h')
-rw-r--r-- | src/corelib/tools/qstringmatcher.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/tools/qstringmatcher.h b/src/corelib/tools/qstringmatcher.h index 549bff9f29..6de4353930 100644 --- a/src/corelib/tools/qstringmatcher.h +++ b/src/corelib/tools/qstringmatcher.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2019 Mail.ru Group. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -41,6 +42,7 @@ #define QSTRINGMATCHER_H #include <QtCore/qstring.h> +#include <QtCore/qstringview.h> QT_BEGIN_NAMESPACE @@ -55,6 +57,8 @@ public: Qt::CaseSensitivity cs = Qt::CaseSensitive); QStringMatcher(const QChar *uc, int len, Qt::CaseSensitivity cs = Qt::CaseSensitive); + QStringMatcher(QStringView pattern, + Qt::CaseSensitivity cs = Qt::CaseSensitive); QStringMatcher(const QStringMatcher &other); ~QStringMatcher(); @@ -65,6 +69,7 @@ public: int indexIn(const QString &str, int from = 0) const; int indexIn(const QChar *str, int length, int from = 0) const; + qsizetype indexIn(QStringView str, qsizetype from = 0) const; QString pattern() const; inline Qt::CaseSensitivity caseSensitivity() const { return q_cs; } |