-
Notifications
You must be signed in to change notification settings - Fork 0
/
Formatting.h
97 lines (78 loc) · 1.42 KB
/
Formatting.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include <iostream>
// If your terminal isn't displaying the reults properly, just set the condition to 0 on the line below
#define COLORFUL_FORMATTING 1
#if COLORFUL_FORMATTING
std::ostream& boldOn(std::ostream& os)
{
return os << "\033[1m";
}
std::ostream& underlineOn(std::ostream& os)
{
return os << "\033[4m";
}
std::ostream& redOn(std::ostream& os)
{
return os << "\033[31m";
}
std::ostream& greenOn(std::ostream& os)
{
return os << "\033[32m";
}
std::ostream& yellowOn(std::ostream& os)
{
return os << "\033[33m";
}
std::ostream& blueOn(std::ostream& os)
{
return os << "\033[34m";
}
std::ostream& cyanOn(std::ostream& os)
{
return os << "\033[36m";
}
std::ostream& whiteOn(std::ostream& os)
{
return os << "\033[37m";
}
std::ostream& resetFormats(std::ostream& os)
{
return os << "\033[0m";
}
#else
std::ostream& boldOn(std::ostream& os)
{
return os << "";
}
std::ostream& underlineOn(std::ostream& os)
{
return os << "";
}
std::ostream& redOn(std::ostream& os)
{
return os << "";
}
std::ostream& greenOn(std::ostream& os)
{
return os << "";
}
std::ostream& yellowOn(std::ostream& os)
{
return os << "";
}
std::ostream& blueOn(std::ostream& os)
{
return os << "";
}
std::ostream& cyanOn(std::ostream& os)
{
return os << "";
}
std::ostream& whiteOn(std::ostream& os)
{
return os << "";
}
std::ostream& resetFormats(std::ostream& os)
{
return os << "";
}
#endif