KTextEditor

kateregexpsearch.h
1 /*
2  SPDX-FileCopyrightText: 2010 Bernhard Beschow <[email protected]>
3  SPDX-FileCopyrightText: 2007 Sebastian Pipping <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef _KATE_REGEXPSEARCH_H_
9 #define _KATE_REGEXPSEARCH_H_
10 
11 #include <QObject>
12 #include <QRegularExpression>
13 
14 #include <ktexteditor/range.h>
15 
16 #include <ktexteditor_export.h>
17 
18 namespace KTextEditor
19 {
20 class Document;
21 }
22 
28 class KTEXTEDITOR_EXPORT KateRegExpSearch
29 {
30 public:
31  explicit KateRegExpSearch(const KTextEditor::Document *document);
33 
34  //
35  // KTextEditor::SearchInterface stuff
36  //
37 public:
55  QVector<KTextEditor::Range> search(const QString &pattern, const KTextEditor::Range &inputRange, bool backwards = false, QRegularExpression::PatternOptions options = QRegularExpression::NoPatternOption);
56 
63  static QString escapePlaintext(const QString &text);
64 
76  static QString buildReplacement(const QString &text, const QStringList &capturedTexts, int replacementCounter);
77 
78 private:
88  static QString buildReplacement(const QString &text, const QStringList &capturedTexts, int replacementCounter, bool replacementGoodies);
89 
104  QString repairPattern(const QString &pattern, bool &stillMultiLine);
105 
106 private:
107  const KTextEditor::Document *const m_document;
108  class ReplacementStream;
109 };
110 
111 #endif
Object to help to search for regexp.
A KParts derived class representing a text document.
Definition: document.h:185
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
An object representing a section of text, from one Cursor to another.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Dec 3 2020 22:58:40 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.