123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #ifndef BOXES_H
- #define BOXES_H
- #include <string>
- #include <array>
- /*
- I'm not sure if I want to try to store the color information in this or not.
- It might be easier to let this do boxes, and let something else do colors.
- */
- 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 width_;
- bool newline_;
- const char *nl = "\n\r";
- const char *reset = "\x1b[0m";
- public:
- std::string boxcolor;
- std::string textcolor;
- Boxes(int width, int style = 1, bool newline = true);
- std::string top(void);
- std::string middle(void);
- std::string row(std::string &line);
- std::string bottom(void);
- static std::array<std::string, 3>
- alert(std::string message, std::string bcolor, std::string tcolor, int width, int style=1, bool newline=true);
-
- };
- #endif
|