Classes | |
struct | Foreground |
struct | Background |
Typedefs | |
template<typename T > | |
using | enableStd = typename std::enable_if< std::is_same< T, sofa::helper::console::Style >::value||std::is_same< T, sofa::helper::console::Foreground::Normal >::value||std::is_same< T, sofa::helper::console::Foreground::Bright >::value||std::is_same< T, sofa::helper::console::Background::Normal >::value||std::is_same< T, sofa::helper::console::Background::Bright >::value, std::ostream & >::type |
Enumerations | |
enum class | Status { Auto = 0 , On = 1 , Off = 2 } |
enum class | Style { Reset = 0 , Bold = 1 , Dim = 2 , Italic = 3 , Underline = 4 , Blink = 5 , Rblink = 6 , Reversed = 7 , Conceal = 8 , Crossed = 9 } |
Functions | |
void | setStatus (Status status) noexcept |
Status | getStatus () noexcept |
size_t | getColumnCount () |
template<typename T > | |
enableStd< T > | operator<< (std::ostream &os, const T &value) |
to use stream operator with a styled output on any system More... | |
Utility that manages the output style of a stream into a terminal. It is based heavily on the work of https://github.com/agauniyal/rang
using sofa::helper::console::enableStd = typedef typename std::enable_if< std::is_same<T, sofa::helper::console::Style>::value || std::is_same<T, sofa::helper::console::Foreground::Normal>::value || std::is_same<T, sofa::helper::console::Foreground::Bright>::value || std::is_same<T, sofa::helper::console::Background::Normal>::value || std::is_same<T, sofa::helper::console::Background::Bright>::value, std::ostream &>::type |
|
strong |
|
strong |
SOFA_HELPER_API size_t sofa::helper::console::getColumnCount | ( | ) |
|
noexcept |
|
inline |
to use stream operator with a styled output on any system
|
noexcept |
Enable or disable colors in stdout / stderr.
This controls whether using styled values in streams will actually do anything. Passing Auto means that styled output will be used for the stream only if it hasn't been redirected (on Unix only). By default, colors are enabled if supported (auto).