libcsdbg  1.28
C++ exception (and generic) stack trace debug library
csdbg::style::style ( const i8 nm,
color_t  fg = WHITE,
color_t  bg = CLEAR,
attrset_t  set = 0 
)

Object constructor.

Parameters
[in]nmthe style name
[in]fgthe foreground color
[in]bgthe background color
[in]setthe text formatting attributes
Exceptions
std::bad_alloc
csdbg::exception

Definition at line 25 of file style.cpp.

References m_name, and unlikely.

Referenced by clone().

25  :
26 m_name(NULL),
27 m_fgcolor(fg),
28 m_bgcolor(bg),
29 m_attributes(set)
30 {
31  if ( unlikely(nm == NULL) )
32  throw exception("invalid argument: nm (=%p)", nm);
33 
34  m_name = new i8[strlen(nm) + 1];
35  strcpy(m_name, nm);
36 }
char i8
8-bit signed integer
Definition: config.hpp:72
attrset_t m_attributes
Text formatting attribute bitmask.
Definition: style.hpp:32
color_t m_bgcolor
Background color.
Definition: style.hpp:30
color_t m_fgcolor
Foreground (text) color.
Definition: style.hpp:28
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349
i8 * m_name
Style name.
Definition: style.hpp:26

+ Here is the caller graph for this function: