QuickCppLib 0.10
Eliminate all the tedious hassle when making state-of-the-art C++ 14 - 23 libraries!
Loading...
Searching...
No Matches
quickcpplib::_xxx::console_colours::detail Namespace Reference

Functions

std::ostream & color_if_term (std::ostream &s, const char seq[])
 

Variables

constexpr const char red [] = {0x1b, '[', '3', '1', 'm', 0}
 
constexpr const char green [] = {0x1b, '[', '3', '2', 'm', 0}
 
constexpr const char blue [] = {0x1b, '[', '3', '4', 'm', 0}
 
constexpr const char yellow [] = {0x1b, '[', '3', '3', 'm', 0}
 
constexpr const char magenta [] = {0x1b, '[', '3', '5', 'm', 0}
 
constexpr const char cyan [] = {0x1b, '[', '3', '6', 'm', 0}
 
constexpr const char white [] = {0x1b, '[', '3', '7', 'm', 0}
 
constexpr const char bold [] = {0x1b, '[', '1', 'm', 0}
 
constexpr const char normal [] = {0x1b, '[', '0', 'm', 0}
 

Function Documentation

◆ color_if_term()

std::ostream & quickcpplib::_xxx::console_colours::detail::color_if_term ( std::ostream &  s,
const char  seq[] 
)
inline
123 {
124 if((&s == &std::cout && isatty(1 /*STDOUT_FILENO*/)) || (&s == &std::cerr && isatty(2 /*STDERR_FILENO*/)))
125 s << seq;
126 return s;
127 }

Variable Documentation

◆ red

constexpr const char quickcpplib::_xxx::console_colours::detail::red[] = {0x1b, '[', '3', '1', 'm', 0}
constexpr
128{0x1b, '[', '3', '1', 'm', 0};

◆ green

constexpr const char quickcpplib::_xxx::console_colours::detail::green[] = {0x1b, '[', '3', '2', 'm', 0}
constexpr
129{0x1b, '[', '3', '2', 'm', 0};

◆ blue

constexpr const char quickcpplib::_xxx::console_colours::detail::blue[] = {0x1b, '[', '3', '4', 'm', 0}
constexpr
130{0x1b, '[', '3', '4', 'm', 0};

◆ yellow

constexpr const char quickcpplib::_xxx::console_colours::detail::yellow[] = {0x1b, '[', '3', '3', 'm', 0}
constexpr
131{0x1b, '[', '3', '3', 'm', 0};

◆ magenta

constexpr const char quickcpplib::_xxx::console_colours::detail::magenta[] = {0x1b, '[', '3', '5', 'm', 0}
constexpr
132{0x1b, '[', '3', '5', 'm', 0};

◆ cyan

constexpr const char quickcpplib::_xxx::console_colours::detail::cyan[] = {0x1b, '[', '3', '6', 'm', 0}
constexpr
133{0x1b, '[', '3', '6', 'm', 0};

◆ white

constexpr const char quickcpplib::_xxx::console_colours::detail::white[] = {0x1b, '[', '3', '7', 'm', 0}
constexpr
134{0x1b, '[', '3', '7', 'm', 0};

◆ bold

constexpr const char quickcpplib::_xxx::console_colours::detail::bold[] = {0x1b, '[', '1', 'm', 0}
constexpr
135{0x1b, '[', '1', 'm', 0};

◆ normal

constexpr const char quickcpplib::_xxx::console_colours::detail::normal[] = {0x1b, '[', '0', 'm', 0}
constexpr
136{0x1b, '[', '0', 'm', 0};