Consider the user (part 1)
That could easily be done by turning those styles into an enum and creating a std::array of the actual style strings. For example, we might define the enum like this:
enum class Style{BasicStyle, LineStyle, DoubleLineStyle, InvisibleStyle};
Create the styles like this:
const std::array<ConsoleTable::TableStyle, 4> ConsoleTable::st = {{
{"-", "|", {"+", "+", "+"}, {"+", "+", "+"}, {"+", "+", "+"}},
{"━", "┃", {"┏", "┳", "┓"}, {"┣", "╋", "┫"}, {"┗", "┻", "┛"}},
{"═", "║", {"╔", "╦", "╗"}, {"╠", "╬", "╣"}, {"╚", "╩", "╝"}},
{" ", " ", {" ", " ", " "}, {" ", " ", " "}, {" ", " ", " "}},
}};
And now we can use them like this:
void ConsoleTable::setStyle(Style n) {
style = static_cast<int>(n);
}
Naturally, the corresponding changes would need to be made wherever style was used.