Cheetah Software  1.0
Utilities_print.cpp File Reference
+ Include dependency graph for Utilities_print.cpp:

Go to the source code of this file.

Functions

void printf_color (PrintColor color, const char *fmt,...)
 
void fprintf_color (PrintColor color, FILE *stream, const char *fmt,...)
 

Function Documentation

void fprintf_color ( PrintColor  color,
FILE *  stream,
const char *  fmt,
  ... 
)

Definition at line 13 of file Utilities_print.cpp.

13  {
14  auto color_id = (uint32_t)color;
15  if (color_id) fprintf(stream, "\033[1;%dm", (uint32_t)color + 30);
16  va_list args;
17  va_start(args, fmt);
18  vfprintf(stream, fmt, args);
19  va_end(args);
20  fprintf(stream, "\033[0m");
21 }

+ Here is the caller graph for this function:

void printf_color ( PrintColor  color,
const char *  fmt,
  ... 
)

Definition at line 3 of file Utilities_print.cpp.

3  {
4  auto color_id = (uint32_t)color;
5  if (color_id) printf("\033[1;%dm", (uint32_t)color + 30);
6  va_list args;
7  va_start(args, fmt);
8  vprintf(fmt, args);
9  va_end(args);
10  printf("\033[0m");
11 }

+ Here is the caller graph for this function: