Cypress  1.0
C++ Spiking Neural Network Simulation Framework
Public Member Functions | Static Public Attributes | List of all members
cypress::Terminal Class Reference

#include <terminal.hpp>

Public Member Functions

 Terminal (bool use_color)
 
std::string color (int color, bool bright=true) const
 
std::string background (int color) const
 
std::string rgb (uint8_t r, uint8_t g, uint8_t b, bool background) const
 
std::string bright () const
 
std::string italic () const
 
std::string underline () const
 
std::string reset () const
 

Static Public Attributes

static const int BLACK = 30
 
static const int RED = 31
 
static const int GREEN = 32
 
static const int YELLOW = 33
 
static const int BLUE = 34
 
static const int MAGENTA = 35
 
static const int CYAN = 36
 
static const int WHITE = 37
 

Constructor & Destructor Documentation

cypress::Terminal::Terminal ( bool  use_color)
inline

Creates a new instance of the Terminal class.

Parameters
use_colorspecifies whether color codes should be generated.

Member Function Documentation

std::string cypress::Terminal::background ( int  color) const

Returns a control string for switching the background to the given color.

Parameters
coloris the background color the terminal should switch to.
Returns
a control string to be included in the output stream.
std::string cypress::Terminal::bright ( ) const

Returns a control string for switching to the bright mode.

Returns
a control string to be included in the output stream.
std::string cypress::Terminal::color ( int  color,
bool  bright = true 
) const

Returns a control string for switching to the given color.

Parameters
coloris the color the terminal should switch to.
brightspecifies whether the terminal should switch to the bright mode.
Returns
a control string to be included in the output stream.
std::string cypress::Terminal::italic ( ) const

Makes the text italic.

Returns
a control string to be included in the output stream.
std::string cypress::Terminal::reset ( ) const

Returns a control string for switching to the default mode.

Returns
a control string to be included in the output stream.
std::string cypress::Terminal::rgb ( uint8_t  r,
uint8_t  g,
uint8_t  b,
bool  background 
) const

Sets an RGB color.

std::string cypress::Terminal::underline ( ) const

Underlines the text.

Returns
a control string to be included in the output stream.

Member Data Documentation

const int cypress::Terminal::BLACK = 30
static

ANSI color code for black.

const int cypress::Terminal::BLUE = 34
static

ANSI color code for blue.

const int cypress::Terminal::CYAN = 36
static

ANSI color code for cyan.

const int cypress::Terminal::GREEN = 32
static

ANSI color code for green.

const int cypress::Terminal::MAGENTA = 35
static

ANSI color code for magenta.

const int cypress::Terminal::RED = 31
static

ANSI color code for red.

const int cypress::Terminal::WHITE = 37
static

ANSI color code for white.

const int cypress::Terminal::YELLOW = 33
static

ANSI color code for yellow.


The documentation for this class was generated from the following file: