From 743cb4ae91cb62425cbf7c6562613d722e559ffd Mon Sep 17 00:00:00 2001 From: Brett Date: Sun, 3 Dec 2023 17:01:51 -0500 Subject: [PATCH] sexy columns --- include/blt/std/format.h | 5 +++++ tests/src/utility_test.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/include/blt/std/format.h b/include/blt/std/format.h index 69942f3..279b6ea 100755 --- a/include/blt/std/format.h +++ b/include/blt/std/format.h @@ -281,6 +281,11 @@ namespace blt::string columns.push_back(column); } + inline void addColumn(std::string column) + { + columns.emplace_back(std::move(column)); + } + inline void addRow(TableRow row) { if (row.rowValues.size() > columns.size()) diff --git a/tests/src/utility_test.cpp b/tests/src/utility_test.cpp index 2232abc..e8a1ebd 100644 --- a/tests/src/utility_test.cpp +++ b/tests/src/utility_test.cpp @@ -71,5 +71,9 @@ void blt::test::utility::run() ->with(nullptr, new string::BinaryTreeFormatter::Node("Child1"))); printLines(treeFormatter.construct()); + blt::string::TableFormatter tableQ2i1("Iteration 1"); + tableQ2i1.addColumn({"Statement"}); + tableQ2i1.addColumn({"Statement"}); + }