-
Notifications
You must be signed in to change notification settings - Fork 0
/
BigBeautifulTestFrame.hpp
74 lines (68 loc) · 2.67 KB
/
BigBeautifulTestFrame.hpp
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* BigBeautifulTestFrame.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hdoo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/25 14:31:23 by hdoo #+# #+# */
/* Updated: 2023/01/13 19:25:55 by hdoo ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include <sstream>
#include <string>
#define BLACK "\x1b[38;2;255;255;255m"
#define PUPLE "\x1b[38;2;172;146;235m"
#define RED "\x1b[38;2;236;86;101m"
#define BLUE "\x1b[38;2;114;191;228m"
#define ORANGE "\x1b[38;2;248;145;76m"
#define YELLOW "\x1b[38;2;254;206;83m"
#define GREEN "\x1b[38;2;172;210;118m"
#define NOCOLOR "\x1b[0;0m"
#ifdef VERBOSE
#include <sys/_types/_size_t.h>
class BigBeautifulTestFrame
{
private:
typedef struct s_color
{
std::string strColor;
std::string frameColor;
} t_color;
char verticalFrameSeg_;
char leftVertax_;
char rightVertax_;
char wall_;
size_t width_;
size_t field_;
size_t padding_;
std::string message_;
t_color color_;
void printVerticalFrame();
void printEmptyLine();
void printVerticalFrameReversed();
void printMessageLine();
void printColoredRawMessage();
void printColoredRawWall();
public:
BigBeautifulTestFrame& print(std::string message);
BigBeautifulTestFrame& setField(size_t n);
BigBeautifulTestFrame& setPadding(size_t n);
BigBeautifulTestFrame& setVerticalFrameSeg(char c);
BigBeautifulTestFrame& setLeftVertax(char c);
BigBeautifulTestFrame& setRightVertax(char c);
BigBeautifulTestFrame& setWall(char c);
BigBeautifulTestFrame& setVertax(char c);
BigBeautifulTestFrame& setStrColor(std::string color);
BigBeautifulTestFrame& setBackGroundColor(std::string color);
BigBeautifulTestFrame();
BigBeautifulTestFrame(size_t width);
~BigBeautifulTestFrame();
};
typedef BigBeautifulTestFrame btf;
#endif
void printVerbose(const std::string& str, const std::string& color = NOCOLOR);
void printVerboseTitle(const std::string& str, const std::string& color = NOCOLOR, size_t padding = 1);
void printVerboseTitleEnter(const std::string& str = "TEST", const std::string& color = NOCOLOR, size_t padding = 1);
std::string itoaStream(int n);