KatePrefixStore

#include <prefixstore.h>

Public Types

typedef QPair< bool, bool > BooleanPair
 

Public Member Functions

void addPrefix (const QString &prefix)
 
void clear ()
 
void dump ()
 
QString findPrefix (const QString &s, int start=0) const
 
QString findPrefix (const Kate::TextLine &line, int start=0) const
 
int longestPrefixLength () const
 
void removePrefix (const QString &prefix)
 

Protected Types

typedef QHash< unsigned short, QPair< unsigned int, unsigned long long > > CharToOccurrenceStateHash
 
typedef QHash< unsigned long long, CharToOccurrenceStateHashTransitionFunction
 

Protected Member Functions

int computeLongestPrefixLength ()
 
unsigned long long nextFreeState ()
 

Protected Attributes

QSet< unsigned long long > m_acceptingStates
 
unsigned long long m_lastAssignedState = 0
 
int m_longestPrefixLength = 0
 
QSet< QStringm_prefixSet
 
QList< unsigned long long > m_stateFreeList
 
TransitionFunction m_transitionFunction
 

Detailed Description

This class can be used to efficiently search for occurrences of strings in a given string.

Theoretically speaking, a finite deterministic automaton is constructed which exactly accepts the strings that are to be recognized. In order to check whether a given string contains one of the strings that are being searched for the constructed automaton has to applied on each position in the given string.

Definition at line 41 of file prefixstore.h.

Member Function Documentation

QString KatePrefixStore::findPrefix ( const QString s,
int  start = 0 
) const

Returns the shortest prefix of the given string that is contained in this prefix store starting at position 'start'.

Definition at line 117 of file prefixstore.cpp.

QString KatePrefixStore::findPrefix ( const Kate::TextLine line,
int  start = 0 
) const

Returns the shortest prefix of the given string that is contained in this prefix store starting at position 'start'.

Definition at line 136 of file prefixstore.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 Tue Jul 14 2020 22:57:47 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.