Cypress  1.0
C++ Spiking Neural Network Simulation Framework
terminal.hpp
Go to the documentation of this file.
1 /*
2  * Cypress -- C++ Spiking Neural Network Simulation Framework
3  * Copyright (C) 2016 Andreas Stöckel
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef CYPRESS_TERMINAL_HPP
20 #define CYPRESS_TERMINAL_HPP
21 
22 #include <cstdint>
23 #include <string>
24 
25 namespace cypress {
26 
27 class Terminal {
28 private:
29  bool m_use_color;
30 
31 public:
35  static const int BLACK = 30;
36 
40  static const int RED = 31;
41 
45  static const int GREEN = 32;
46 
50  static const int YELLOW = 33;
51 
55  static const int BLUE = 34;
56 
60  static const int MAGENTA = 35;
61 
65  static const int CYAN = 36;
66 
70  static const int WHITE = 37;
71 
77  Terminal(bool use_color) : m_use_color(use_color) {}
78 
87  std::string color(int color, bool bright = true) const;
88 
95  std::string background(int color) const;
96 
100  std::string rgb(uint8_t r, uint8_t g, uint8_t b, bool background) const;
101 
107  std::string bright() const;
108 
114  std::string italic() const;
115 
121  std::string underline() const;
122 
128  std::string reset() const;
129 };
130 
131 }
132 #endif /* CYPRESS_TERMINAL_HPP */
133 
static const int YELLOW
Definition: terminal.hpp:50
static const int GREEN
Definition: terminal.hpp:45
static const int CYAN
Definition: terminal.hpp:65
std::string underline() const
static const int BLACK
Definition: terminal.hpp:35
Definition: terminal.hpp:27
static const int RED
Definition: terminal.hpp:40
static const int WHITE
Definition: terminal.hpp:70
Terminal(bool use_color)
Definition: terminal.hpp:77
std::string color(int color, bool bright=true) const
static const int BLUE
Definition: terminal.hpp:55
std::string italic() const
std::string rgb(uint8_t r, uint8_t g, uint8_t b, bool background) const
std::string bright() const
Definition: brainscales_lib.hpp:39
static const int MAGENTA
Definition: terminal.hpp:60
std::string reset() const
std::string background(int color) const