KatePlainTextSearch
KatePlainTextSearch Class Reference
#include <kateplaintextsearch.h>
Public Member Functions | |
KatePlainTextSearch (const KTextEditor::Document *document, Qt::CaseSensitivity caseSensitivity, bool wholeWords) | |
KTextEditor::Range | search (const QString &text, KTextEditor::Range inputRange, bool backwards=false) |
Detailed Description
Object to help to search for plain text.
This should be NO QObject, it is created too often! I measured that, if you create it 20k times to replace for example " " in a document, that takes seconds on a modern machine!
Definition at line 27 of file kateplaintextsearch.h.
Member Function Documentation
◆ search()
KTextEditor::Range KatePlainTextSearch::search | ( | const QString & | text, |
KTextEditor::Range | inputRange, | ||
bool | backwards = false |
||
) |
Search for the given text
inside the range inputRange
taking into account whether to search casesensitive
and backwards
.
- Parameters
-
text text to search for inputRange Range to search in backwards if true, the search will be backwards
- Returns
- The valid range of the matched text if
text
was found. If thetext
was not found, the returned range is not valid (see Range::isValid()).
- See also
- KTextEditor::Range
Definition at line 33 of file kateplaintextsearch.cpp.
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Jun 26 2022 03:49:55 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Jun 26 2022 03:49:55 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.