KatePlainTextSearch

Search for usage in LXR

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.

Constructor & Destructor Documentation

◆ KatePlainTextSearch()

KatePlainTextSearch::KatePlainTextSearch ( const KTextEditor::Document * document,
Qt::CaseSensitivity caseSensitivity,
bool wholeWords )
explicit

Definition at line 22 of file kateplaintextsearch.cpp.

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
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 31 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-2024 The KDE developers.
Generated on Fri Oct 4 2024 12:03:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.