• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

Kate

Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

KatePrefixStore Class Reference

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

#include <prefixstore.h>

List of all members.

Public Types

typedef QPair< bool, bool > BooleanPair

Public Member Functions

 KatePrefixStore ()
virtual ~KatePrefixStore ()
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,
CharToOccurrenceStateHash > 
TransitionFunction

Protected Member Functions

int computeLongestPrefixLength ()
unsigned long long nextFreeState ()

Protected Attributes

QSet< unsigned long long > m_acceptingStates
unsigned long long m_lastAssignedState
int m_longestPrefixLength
QSet< QString > m_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 Typedef Documentation

typedef QPair<bool, bool> KatePrefixStore::BooleanPair

Definition at line 43 of file prefixstore.h.

typedef QHash<unsigned short, QPair<unsigned int, unsigned long long> > KatePrefixStore::CharToOccurrenceStateHash [protected]

Definition at line 74 of file prefixstore.h.

typedef QHash<unsigned long long, CharToOccurrenceStateHash> KatePrefixStore::TransitionFunction [protected]

Definition at line 75 of file prefixstore.h.


Constructor & Destructor Documentation

KatePrefixStore::KatePrefixStore ( )

Definition at line 27 of file prefixstore.cpp.

KatePrefixStore::~KatePrefixStore ( ) [virtual]

Definition at line 33 of file prefixstore.cpp.


Member Function Documentation

void KatePrefixStore::addPrefix ( const QString &  prefix)

Definition at line 37 of file prefixstore.cpp.

void KatePrefixStore::clear ( )

Definition at line 163 of file prefixstore.cpp.

int KatePrefixStore::computeLongestPrefixLength ( ) [protected]

Definition at line 173 of file prefixstore.cpp.

void KatePrefixStore::dump ( )

Definition at line 109 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 139 of file prefixstore.cpp.

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 120 of file prefixstore.cpp.

int KatePrefixStore::longestPrefixLength ( ) const

Definition at line 158 of file prefixstore.cpp.

unsigned long long KatePrefixStore::nextFreeState ( ) [protected]

Definition at line 184 of file prefixstore.cpp.

void KatePrefixStore::removePrefix ( const QString &  prefix)

Definition at line 70 of file prefixstore.cpp.


Member Data Documentation

QSet<unsigned long long> KatePrefixStore::m_acceptingStates [protected]

Definition at line 77 of file prefixstore.h.

unsigned long long KatePrefixStore::m_lastAssignedState [protected]

Definition at line 79 of file prefixstore.h.

int KatePrefixStore::m_longestPrefixLength [protected]

Definition at line 70 of file prefixstore.h.

QSet<QString> KatePrefixStore::m_prefixSet [protected]

Definition at line 71 of file prefixstore.h.

QList<unsigned long long> KatePrefixStore::m_stateFreeList [protected]

Definition at line 78 of file prefixstore.h.

TransitionFunction KatePrefixStore::m_transitionFunction [protected]

Definition at line 76 of file prefixstore.h.


The documentation for this class was generated from the following files:
  • prefixstore.h
  • prefixstore.cpp

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal