LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
ANSI stream manipulations

Functions

std::string lbann::strip_ansi_csis (std::string const &input)
 Remove ANSI CSIs from the string. More...
 
std::ostream & lbann::black (std::ostream &)
 Turn the ANSI foreground color output black. More...
 
std::ostream & lbann::red (std::ostream &)
 Turn the ANSI foreground color output red. More...
 
std::ostream & lbann::green (std::ostream &)
 Turn the ANSI foreground color output green. More...
 
std::ostream & lbann::yellow (std::ostream &)
 Turn the ANSI foreground color output yellow. More...
 
std::ostream & lbann::blue (std::ostream &)
 Turn the ANSI foreground color output blue. More...
 
std::ostream & lbann::magenta (std::ostream &)
 Turn the ANSI foreground color output magenta. More...
 
std::ostream & lbann::cyan (std::ostream &)
 Turn the ANSI foreground color output cyan. More...
 
std::ostream & lbann::white (std::ostream &)
 Turn the ANSI foreground color output white. More...
 
std::ostream & lbann::bgblack (std::ostream &)
 Turn the ANSI background color output black. More...
 
std::ostream & lbann::bgred (std::ostream &)
 Turn the ANSI background color output red. More...
 
std::ostream & lbann::bggreen (std::ostream &)
 Turn the ANSI background color output green. More...
 
std::ostream & lbann::bgyellow (std::ostream &)
 Turn the ANSI background color output yellow. More...
 
std::ostream & lbann::bgblue (std::ostream &)
 Turn the ANSI background color output blue. More...
 
std::ostream & lbann::bgmagenta (std::ostream &)
 Turn the ANSI background color output magenta. More...
 
std::ostream & lbann::bgcyan (std::ostream &)
 Turn the ANSI background color output cyan. More...
 
std::ostream & lbann::bgwhite (std::ostream &)
 Turn the ANSI background color output white. More...
 
std::ostream & lbann::nocolor (std::ostream &)
 Reset the ANSI color to the default. More...
 
std::ostream & lbann::clearline (std::ostream &)
 Clear remaining characters in the line. More...
 

Detailed Description

These utilities manipulate streams using ANSI CSIs to "modify streams". Note that these just inject the CSI characters into the stream; nothing about the stream itself has actually changed.

Also note that these are supposed to be stupid and simple. It is the user's responsibility to make sure the stream in question will process the ANSI CSIs correctly; otherwise, weird character sequences will appear in the stream output. That is, these should not be used to write to files, and they should not be used for terminal outputs if the terminal does not support color.

Function Documentation

◆ bgblack()

std::ostream& lbann::bgblack ( std::ostream &  )

Turn the ANSI background color output black.

◆ bgblue()

std::ostream& lbann::bgblue ( std::ostream &  )

Turn the ANSI background color output blue.

◆ bgcyan()

std::ostream& lbann::bgcyan ( std::ostream &  )

Turn the ANSI background color output cyan.

◆ bggreen()

std::ostream& lbann::bggreen ( std::ostream &  )

Turn the ANSI background color output green.

◆ bgmagenta()

std::ostream& lbann::bgmagenta ( std::ostream &  )

Turn the ANSI background color output magenta.

◆ bgred()

std::ostream& lbann::bgred ( std::ostream &  )

Turn the ANSI background color output red.

◆ bgwhite()

std::ostream& lbann::bgwhite ( std::ostream &  )

Turn the ANSI background color output white.

◆ bgyellow()

std::ostream& lbann::bgyellow ( std::ostream &  )

Turn the ANSI background color output yellow.

◆ black()

std::ostream& lbann::black ( std::ostream &  )

Turn the ANSI foreground color output black.

◆ blue()

std::ostream& lbann::blue ( std::ostream &  )

Turn the ANSI foreground color output blue.

◆ clearline()

std::ostream& lbann::clearline ( std::ostream &  )

Clear remaining characters in the line.

◆ cyan()

std::ostream& lbann::cyan ( std::ostream &  )

Turn the ANSI foreground color output cyan.

◆ green()

std::ostream& lbann::green ( std::ostream &  )

Turn the ANSI foreground color output green.

◆ magenta()

std::ostream& lbann::magenta ( std::ostream &  )

Turn the ANSI foreground color output magenta.

◆ nocolor()

std::ostream& lbann::nocolor ( std::ostream &  )

Reset the ANSI color to the default.

◆ red()

std::ostream& lbann::red ( std::ostream &  )

Turn the ANSI foreground color output red.

◆ strip_ansi_csis()

std::string lbann::strip_ansi_csis ( std::string const &  input)

Remove ANSI CSIs from the string.

◆ white()

std::ostream& lbann::white ( std::ostream &  )

Turn the ANSI foreground color output white.

◆ yellow()

std::ostream& lbann::yellow ( std::ostream &  )

Turn the ANSI foreground color output yellow.