FACT++  1.0
string WindowLog::GetAnsiAttr ( int  m)
staticprivate
Returns
the ANSI code corresponding to the attributes

Definition at line 301 of file WindowLog.cc.

References kBlink, kBlue, kBold, kCyan, kDefault, kDim, kGreen, kMagenta, kRed, kReset, kUnderline, kWhite, and kYellow.

302 {
303  if (m==kReset || m==kDefault)
304  return "\033[0m";
305 
306  string rc;
307 
308  if ((m&COLOR_PAIR(kRed) )==COLOR_PAIR(kRed) ) rc += "\033[31m";
309  if ((m&COLOR_PAIR(kGreen) )==COLOR_PAIR(kGreen) ) rc += "\033[32m";
310  if ((m&COLOR_PAIR(kYellow) )==COLOR_PAIR(kYellow) ) rc += "\033[33m";
311  if ((m&COLOR_PAIR(kBlue) )==COLOR_PAIR(kBlue) ) rc += "\033[34m";
312  if ((m&COLOR_PAIR(kMagenta))==COLOR_PAIR(kMagenta)) rc += "\033[35m";
313  if ((m&COLOR_PAIR(kCyan) )==COLOR_PAIR(kCyan) ) rc += "\033[36m";
314  if ((m&COLOR_PAIR(kWhite) )==COLOR_PAIR(kWhite) ) rc += "\033[0m\033[1m";
315 
316  if ((m&kBold )==kBold ) rc += "\033[1m";
317  if ((m&kDim )==kDim ) rc += "\033[2m";
318  if ((m&kUnderline)==kUnderline) rc += "\033[4m";
319  if ((m&kBlink )==kBlink ) rc += "\033[5m";
320 
321  return rc;
322 }
Set color Cyan.
Definition: WindowLog.h:22
Set color White.
Definition: WindowLog.h:23
Set color Green.
Definition: WindowLog.h:18
Set color Yellow.
Definition: WindowLog.h:19
Set attribute Blink.
Definition: WindowLog.h:34
Set color Red.
Definition: WindowLog.h:17
Set default colors.
Definition: WindowLog.h:16
Set attribute Underline.
Definition: WindowLog.h:32
Set color Magenta.
Definition: WindowLog.h:21
Set color Blue.
Definition: WindowLog.h:20
Set attribute Dim.
Definition: WindowLog.h:35
Reset all attributes.
Definition: WindowLog.h:29
Set attribute Bold.
Definition: WindowLog.h:36