-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint.hpp
More file actions
49 lines (38 loc) · 965 Bytes
/
print.hpp
File metadata and controls
49 lines (38 loc) · 965 Bytes
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
#ifndef PRINT_H
#define PRINT_H
#include "lib/termcolor.hpp"
using namespace std;
namespace Print {
string current_progress = "";
void progress(string message) {
cout << message;
int length_diff = current_progress.length() - message.length();
for (int i = 0; i < length_diff; i++) {
cout << " ";
}
cout << "\r";
current_progress = message;
}
void erase_progress() {
cout << "\r";
for (size_t i = 0; i < current_progress.length(); i++) {
cout << " ";
}
}
void dimmed(string message) {
cout << termcolor::dark << message << termcolor::reset;
}
void bold(string message) {
cout << termcolor::bold << message << termcolor::reset;
}
void green(string message) {
cout << termcolor::green << message << termcolor::reset;
}
void red(string message) {
cout << termcolor::red << message << termcolor::reset;
}
void basic(string message) {
cout << message;
}
}
#endif