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, const 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 41 of file kateplaintextsearch.h.

Member Function Documentation

KTextEditor::Range KatePlainTextSearch::search ( const QString text,
const 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
texttext to search for
inputRangeRange to search in
backwardsif true, the search will be backwards
Returns
The valid range of the matched text if text was found. If the text was not found, the returned range is not valid (see Range::isValid()).
See also
KTextEditor::Range

Definition at line 53 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-2020 The KDE developers.
Generated on Sun Jul 12 2020 22:58:02 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.