libcsdbg
1.28
C++ exception (and generic) stack trace debug library
|
A named collection of words (for syntax highlighters) More...
#include <dictionary.hpp>
Public Member Functions | |
dictionary (const i8 *, const i8 *=NULL, bool=false) | |
Object constructor. More... | |
dictionary (const dictionary &) | |
Object copy constructor. More... | |
virtual | ~dictionary () |
Object destructor. More... | |
virtual dictionary * | clone () const |
Object virtual copy constructor. More... | |
virtual const i8 * | name () const |
Get the dictionary name. More... | |
virtual bool | mode () const |
Get the lookup mode. More... | |
virtual dictionary & | set_name (const i8 *) |
Set the name. More... | |
virtual dictionary & | set_mode (bool) |
Set the lookup mode. More... | |
virtual dictionary & | operator= (const dictionary &) |
Assignment operator. More... | |
virtual dictionary & | load_file (const i8 *) |
Load words from a dictionary file. More... | |
virtual const string * | lookup (const string &, bool=false) const |
Dictionary lookup. More... | |
Public Member Functions inherited from csdbg::chain< string > | |
chain () | |
chain (const chain &) | |
virtual | ~chain () |
virtual u32 | size () const |
virtual chain & | operator= (const chain &) |
virtual string * | operator[] (u32) const |
virtual chain & | add (string *) |
virtual chain & | remove (u32) |
virtual chain & | clear () |
virtual string * | at (u32) const |
virtual string * | detach (u32) |
virtual chain & | foreach (void(*)(u32, string *)) const |
Public Member Functions inherited from csdbg::object | |
virtual | ~object ()=0 |
To be implemented. More... | |
virtual const i8 * | class_name () const |
Query the class name of an object descending from csdbg::object. More... | |
Protected Attributes | |
i8 * | m_name |
Dictionary name. More... | |
bool | m_mode |
Lookup mode. More... | |
Protected Attributes inherited from csdbg::chain< string > | |
node< string > * | m_head |
Chain head. More... | |
node< string > * | m_tail |
Chain tail. More... | |
u32 | m_size |
Node count. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from csdbg::chain< string > | |
virtual node< string > * | node_at (u32) const |
virtual node< string > * | node_with (const string *) const |
virtual node< string > * | detach_node (u32) |
A named collection of words (for syntax highlighters)
A dictionary object is used to create a collection of tokens, under a common name. Dictionary data can be loaded from regular text files (.dict extension). Each non-empty line in the source file is translated as a single token. A line with only whitespace characters is considered an empty line. The tokens are trimmed to remove leading and trailing whitespace characters. If the source file is empty no tokens are loaded, but the dictionary object remains valid. The dictionary class inherits from csdbg::chain (T = csdbg::string) all its methods for item management. A dictionary can be looked up for literal strings or for POSIX extended regular expressions (with or without case sensitivity). If a word appears more than once, its first occurence is used. A dictionary is not thread safe, users must implement thread synchronization
Definition at line 32 of file dictionary.hpp.