-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconsole.h
More file actions
39 lines (33 loc) · 1.08 KB
/
Copy pathconsole.h
File metadata and controls
39 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#ifndef CONSOLE_H_
#define CONSOLE_H_
typedef std::ostream&(*color_t)(std::ostream&);
// using color_t = std::ostream&(*)(std::ostream&);
class Console
{
public:
static void info(const char* message);
static void error(const char* message);
static void debug(const char* message);
static void print(const char* message);
static void print(const char* message, color_t color);
static void println(const char* message);
static void println(const char* message, color_t color);
private:
static void reset();
};
class ConsoleColor
{
public:
static std::ostream& normal(std::ostream& stream);
static std::ostream& grey(std::ostream& stream);
static std::ostream& red(std::ostream& stream);
static std::ostream& green(std::ostream& stream);
static std::ostream& yellow(std::ostream& stream);
static std::ostream& blue(std::ostream& stream);
static std::ostream& magenta(std::ostream& stream);
static std::ostream& cyan(std::ostream& stream);
static std::ostream& white(std::ostream& stream);
};
#else
#endif //CONSOLE_H_