yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.2
Formatting.h File Reference
#include <iostream>
#include <iomanip>
#include <unistd.h>

Go to the source code of this file.

Macros

#define MSG_(msg)   do { std::cout << msg; } while (0)
 
#define MSG(msg)   MSG_(msg << std::endl)
 
#define PAD(n)   std::setw(n) << std::left
 
#define COLOR_(msg, code)    (isatty(1) ? code : "") << msg << (isatty(1) ? "\033[0m" : "")
 
#define RED(msg)   COLOR_(msg, "\033[0;31m")
 
#define MSG_RED_(x)   MSG_(RED(x))
 
#define MSG_RED(x)   MSG(RED(x))
 
#define GREEN(msg)   COLOR_(msg, "\033[0;32m")
 
#define MSG_GREEN_(x)   MSG_(GREEN(x))
 
#define MSG_GREEN(x)   MSG(GREEN(x))
 
#define YELLOW(msg)   COLOR_(msg, "\033[0;33m")
 
#define MSG_YELLOW_(x)   MSG_(YELLOW(x))
 
#define MSG_YELLOW(x)   MSG(YELLOW(x))
 
#define BLUE(msg)   COLOR_(msg, "\033[0;34m")
 
#define MSG_BLUE_(x)   MSG_(BLUE(x))
 
#define MSG_BLUE(x)   MSG(BLUE(x))
 

Macro Definition Documentation

◆ BLUE

#define BLUE (   msg)    COLOR_(msg, "\033[0;34m")

Definition at line 35 of file Formatting.h.

◆ COLOR_

#define COLOR_ (   msg,
  code 
)     (isatty(1) ? code : "") << msg << (isatty(1) ? "\033[0m" : "")

Definition at line 19 of file Formatting.h.

20 : "") << msg << (isatty(1) ? "\033[0m" : "")

◆ GREEN

#define GREEN (   msg)    COLOR_(msg, "\033[0;32m")

Definition at line 27 of file Formatting.h.

◆ MSG

#define MSG (   msg)    MSG_(msg << std::endl)

Definition at line 15 of file Formatting.h.

◆ MSG_

#define MSG_ (   msg)    do { std::cout << msg; } while (0)

Definition at line 13 of file Formatting.h.

◆ MSG_BLUE

#define MSG_BLUE (   x)    MSG(BLUE(x))

Definition at line 37 of file Formatting.h.

◆ MSG_BLUE_

#define MSG_BLUE_ (   x)    MSG_(BLUE(x))

Definition at line 36 of file Formatting.h.

◆ MSG_GREEN

#define MSG_GREEN (   x)    MSG(GREEN(x))

Definition at line 29 of file Formatting.h.

◆ MSG_GREEN_

#define MSG_GREEN_ (   x)    MSG_(GREEN(x))

Definition at line 28 of file Formatting.h.

◆ MSG_RED

#define MSG_RED (   x)    MSG(RED(x))

Definition at line 25 of file Formatting.h.

◆ MSG_RED_

#define MSG_RED_ (   x)    MSG_(RED(x))

Definition at line 24 of file Formatting.h.

◆ MSG_YELLOW

#define MSG_YELLOW (   x)    MSG(YELLOW(x))

Definition at line 33 of file Formatting.h.

◆ MSG_YELLOW_

#define MSG_YELLOW_ (   x)    MSG_(YELLOW(x))

Definition at line 32 of file Formatting.h.

◆ PAD

#define PAD (   n)    std::setw(n) << std::left

Definition at line 17 of file Formatting.h.

◆ RED

#define RED (   msg)    COLOR_(msg, "\033[0;31m")

Definition at line 23 of file Formatting.h.

◆ YELLOW

#define YELLOW (   msg)    COLOR_(msg, "\033[0;33m")

Definition at line 31 of file Formatting.h.