From bc007452c38bed6ab4f1cf3286990a9a3d6e100c Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 29 May 2022 08:49:04 +0300 Subject: Autocommit at 29.05.2022 @ 08:49 --- src/Generic/ConsoleInterface/Toolbox.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Generic/ConsoleInterface/Toolbox.cpp') diff --git a/src/Generic/ConsoleInterface/Toolbox.cpp b/src/Generic/ConsoleInterface/Toolbox.cpp index af336fe..33f71b3 100644 --- a/src/Generic/ConsoleInterface/Toolbox.cpp +++ b/src/Generic/ConsoleInterface/Toolbox.cpp @@ -50,7 +50,7 @@ void __printPadded(const String& str, unsigned width) { width--; print(" "); } - std::cout << str.get_cstr(); + print(str.get_cstr()); } /*! \param startNumber The number by which column and row enumeration begins @@ -64,11 +64,17 @@ void __printPadded(const String& str, unsigned width) { * The rows are "calculated" from the columns count and the items length. */ void printTable(const List& items, unsigned columns) { + printLine(""); + unsigned *colWidths = new unsigned[columns]; + for (unsigned i = 0; i < columns; i++) + colWidths[i] = 0; + for (unsigned i = 0; i < items.get_count(); i++) { if (colWidths[i % columns] < items[i].get_length()) colWidths[i % columns] = items[i].get_length(); } + std::cout << colWidths[0] << std::endl; // __printTableColumnHeader(columns); -- cgit v1.3.1-23-gd82d