libcsdbg  1.28
C++ exception (and generic) stack trace debug library
csdbg::dictionary Class Reference

A named collection of words (for syntax highlighters) More...

#include <dictionary.hpp>

+ Inheritance diagram for csdbg::dictionary:
+ Collaboration diagram for csdbg::dictionary:

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 dictionaryclone () const
 Object virtual copy constructor. More...
 
virtual const i8name () const
 Get the dictionary name. More...
 
virtual bool mode () const
 Get the lookup mode. More...
 
virtual dictionaryset_name (const i8 *)
 Set the name. More...
 
virtual dictionaryset_mode (bool)
 Set the lookup mode. More...
 
virtual dictionaryoperator= (const dictionary &)
 Assignment operator. More...
 
virtual dictionaryload_file (const i8 *)
 Load words from a dictionary file. More...
 
virtual const stringlookup (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 chainoperator= (const chain &)
 
virtual stringoperator[] (u32) const
 
virtual chainadd (string *)
 
virtual chainremove (u32)
 
virtual chainclear ()
 
virtual stringat (u32) const
 
virtual stringdetach (u32)
 
virtual chainforeach (void(*)(u32, string *)) const
 
- Public Member Functions inherited from csdbg::object
virtual ~object ()=0
 To be implemented. More...
 
virtual const i8class_name () const
 Query the class name of an object descending from csdbg::object. More...
 

Protected Attributes

i8m_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)
 

Detailed Description

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

See Also
csdbg::parser
5.7 Using the stack trace parser (syntax highlighter)

Definition at line 32 of file dictionary.hpp.


The documentation for this class was generated from the following files: