|
@@ -0,0 +1,56 @@
|
|
|
+#ifndef BOXES_H
|
|
|
+#define BOXES_H
|
|
|
+
|
|
|
+#include <string>
|
|
|
+#include <tuple>
|
|
|
+
|
|
|
+enum { NORMAL = 0, BRIGHT = 1 } ATTR;
|
|
|
+
|
|
|
+enum {
|
|
|
+
|
|
|
+} FORE;
|
|
|
+
|
|
|
+enum {
|
|
|
+
|
|
|
+} BACK;
|
|
|
+
|
|
|
+class Boxes {
|
|
|
+ struct box_style {
|
|
|
+ const char *top_left;
|
|
|
+ const char *top_right;
|
|
|
+ const char *top;
|
|
|
+ const char *side;
|
|
|
+ const char *bottom_left;
|
|
|
+ const char *bottom_right;
|
|
|
+ const char *middle_left;
|
|
|
+ const char *middle_right;
|
|
|
+ } boxes[4] = {
|
|
|
+ {"\xda", "\xbf", "\xc4", "\xb3", "\xc0", "\xd9", "\xc3", "\xb4"},
|
|
|
+ {"\xc9", "\xbb", "\xcd", "\xba", "\xc8", "\xbc", "\xcc", "\xb9"},
|
|
|
+ {"\xd6", "\xb8", "\xcd", "\xb3", "\xd4", "\xbe", "\xc6", "\xb5"},
|
|
|
+ {"\xd6", "\xb7", "\xc4", "\xba", "\xd3", "\xbd", "\xc7", "\xb6"}};
|
|
|
+ int style_;
|
|
|
+ int color_;
|
|
|
+ int size_;
|
|
|
+ bool newline_;
|
|
|
+ const char *nl = "\n\r";
|
|
|
+ const char *reset = "\x1b[0m";
|
|
|
+ // Black Red Green Yellow Blue Magenta Cyan White
|
|
|
+ const char *colors[8] = {"\x1b[1;33;40m", "\1b[1;33;41m", "\x1b[1;33;42m",
|
|
|
+ "\x1b[1;33;43m", "\x1b[1;33;44m", "\x1b[1;33;45m",
|
|
|
+ "\x1b[1;33;46m", "\x1b[1;33;47m"};
|
|
|
+
|
|
|
+public:
|
|
|
+ Boxes(int size, int style = 1, int color = 1, bool newline = true);
|
|
|
+ std::string top(void);
|
|
|
+ std::string middle(void);
|
|
|
+ std::string row(std::string &line);
|
|
|
+ std::string bottom(void);
|
|
|
+
|
|
|
+ /*
|
|
|
+ std::tuple<std::string, std::string, std::string>
|
|
|
+ alert(std::string message, int size, int color, int style = 1);
|
|
|
+ */
|
|
|
+};
|
|
|
+
|
|
|
+#endif
|