Compare commits

..

2 Commits

Author SHA1 Message Date
Brett de84f9573b Merge remote-tracking branch 'refs/remotes/tpgc/main' + explict fixes 2023-12-03 17:02:50 -05:00
Brett 743cb4ae91 sexy columns 2023-12-03 17:01:51 -05:00
2 changed files with 12 additions and 1 deletions

View File

@ -240,7 +240,7 @@ namespace blt::string
std::string columnName; std::string columnName;
size_t maxColumnLength = 0; size_t maxColumnLength = 0;
TableColumn(std::string columnName): columnName(std::move(columnName)) explicit TableColumn(std::string columnName): columnName(std::move(columnName))
{} {}
}; };
@ -281,6 +281,11 @@ namespace blt::string
columns.push_back(column); columns.push_back(column);
} }
inline void addColumn(std::string column)
{
columns.emplace_back(std::move(column));
}
inline void addRow(TableRow row) inline void addRow(TableRow row)
{ {
if (row.rowValues.size() > columns.size()) if (row.rowValues.size() > columns.size())

View File

@ -84,4 +84,10 @@ void blt::test::utility::run()
(new string::BinaryTreeFormatter::Node("total -= total * 0.05"))) (new string::BinaryTreeFormatter::Node("total -= total * 0.05")))
); );
printLines(assign1.construct()); printLines(assign1.construct());
blt::string::TableFormatter tableQ2i1("Iteration 1");
tableQ2i1.addColumn("Statement");
tableQ2i1.addColumn("Statement");
printLines(tableQ2i1.createTable(true, true));
} }