diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2017-10-30 20:50:11 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2017-11-02 21:35:03 +0000 |
commit | e9b4d3a48a654702c4b7317ebd12a0b5bda6cc5f (patch) | |
tree | 4ac5b213216c3ce2f37b8549a4ae908317f2ed26 /src/libs/utils/fuzzymatcher.h | |
parent | fc2bb852fdc370257ad646443fe2cf1171efeaff (diff) |
Rename CamelHumpMatcher -> FuzzyMatcher
Change-Id: Ia8a2eeb985bcdd500b4faf9605e5092a52dad372
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Diffstat (limited to 'src/libs/utils/fuzzymatcher.h')
-rw-r--r-- | src/libs/utils/fuzzymatcher.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/libs/utils/fuzzymatcher.h b/src/libs/utils/fuzzymatcher.h new file mode 100644 index 00000000000..753742ac227 --- /dev/null +++ b/src/libs/utils/fuzzymatcher.h @@ -0,0 +1,58 @@ +/************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2017 BlackBerry Limited <qt@blackberry.com> +** Copyright (C) 2017 Andre Hartmann <aha_1980@gmx.de> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#pragma once + +#include "utils_global.h" + +#include <QVector> + +QT_BEGIN_NAMESPACE +class QRegularExpression; +class QRegularExpressionMatch; +class QString; +QT_END_NAMESPACE + +class QTCREATOR_UTILS_EXPORT FuzzyMatcher +{ +public: + enum class CaseSensitivity { + CaseInsensitive, + CaseSensitive, + FirstLetterCaseSensitive + }; + + class HighlightingPositions { + public: + QVector<int> starts; + QVector<int> lengths; + }; + + static QRegularExpression createRegExp(const QString &pattern, + CaseSensitivity caseSensitivity = CaseSensitivity::CaseInsensitive); + static HighlightingPositions highlightingPositions(const QRegularExpressionMatch &match); +}; |