libcsdbg  1.28
C++ exception (and generic) stack trace debug library
style & csdbg::style::apply ( string dst) const
virtual

Apply the style to some text.

Parameters
[in]dstthe target text
Returns
*this
Exceptions
std::bad_alloc
csdbg::exception

Definition at line 304 of file style.cpp.

References csdbg::string::append(), csdbg::string::insert(), and to_string().

Referenced by csdbg::parser::highlight().

305 {
306  string esc;
307  to_string(esc);
308  dst.insert(0, esc).append("\e[0m");
309  return const_cast<style&> (*this);
310 }
virtual style & to_string(string &) const
Set a string with all the style escape sequences.
Definition: style.cpp:260
style(const i8 *, color_t=WHITE, color_t=CLEAR, attrset_t=0)
Object constructor.
Definition: style.cpp:25

+ Here is the call graph for this function:

+ Here is the caller graph for this function: