libcsdbg  1.28
C++ exception (and generic) stack trace debug library
csdbg::dictionary::dictionary ( const i8 nm,
const i8 path = NULL,
bool  mode = false 
)

Object constructor.

Parameters
[in]nmthe dictionary name
[in]paththe path of the data file
[in]modethe lookup mode (true for regular expression lookup)
Exceptions
std::bad_alloc
csdbg::exception

Definition at line 24 of file dictionary.cpp.

References likely, load_file(), m_name, and unlikely.

Referenced by clone().

25  :
26 chain<string>(),
27 m_name(NULL),
28 m_mode(mode)
29 {
30  if ( unlikely(nm == NULL) )
31  throw exception("invalid argument: nm (=%p)", nm);
32 
33  if ( likely(path != NULL) )
34  load_file(path);
35 
36  m_name = new i8[strlen(nm) + 1];
37  strcpy(m_name, nm);
38 }
39 
40 catch (...) {
41  clear();
42 }
virtual chain & clear()
bool m_mode
Lookup mode.
Definition: dictionary.hpp:40
virtual bool mode() const
Get the lookup mode.
Definition: dictionary.cpp:107
char i8
8-bit signed integer
Definition: config.hpp:72
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
Definition: config.hpp:344
i8 * m_name
Dictionary name.
Definition: dictionary.hpp:38
virtual dictionary & load_file(const i8 *)
Load words from a dictionary file.
Definition: dictionary.cpp:193
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349

+ Here is the call graph for this function:

+ Here is the caller graph for this function: