#include "boxes.h" Boxes::Boxes(int size, int style, int color, bool newline) { size_ = size; style_ = style; color_ = color; newline_ = newline; } std::string Boxes::top(void) { std::string line; box_style &bs = boxes[style_]; const char *clr = colors[color_]; line.append(clr); line.append(bs.top_left); for (int x = 0; x < size_; ++x) line.append(bs.top); line.append(bs.top_right); line.append(reset); if (newline_) line.append(nl); return line; } std::string Boxes::middle(void) { std::string line; box_style &bs = boxes[style_]; const char *clr = colors[color_]; line.append(clr); line.append(bs.middle_left); for (int x = 0; x < size_; ++x) line.append(bs.top); line.append(bs.middle_right); line.append(reset); if (newline_) line.append(nl); return line; } std::string Boxes::row(std::string &text) { std::string line; box_style &bs = boxes[style_]; const char *clr = colors[color_]; line.append(clr); line.append(bs.side); line.append(reset); line.append(text); line.append(clr); line.append(bs.side); line.append(reset); if (newline_) line.append(nl); return line; } std::string Boxes::bottom(void) { std::string line; box_style &bs = boxes[style_]; const char *clr = colors[color_]; line.append(clr); line.append(bs.bottom_left); for (int x = 0; x < size_; ++x) line.append(bs.top); line.append(bs.bottom_right); line.append(reset); if (newline_) line.append(nl); return line; } /* std::tuple Boxes::alert(std::string message, int size, int color, int style = 1) {} */