From 189c8857e59b03124602a22782f16ef7dbc03337 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 29 May 2022 08:59:08 +0300 Subject: Autocommit at 29.05.2022 @ 08:59 --- src/Generic/ConsoleInterface/Toolbox.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Generic/ConsoleInterface/Toolbox.cpp') diff --git a/src/Generic/ConsoleInterface/Toolbox.cpp b/src/Generic/ConsoleInterface/Toolbox.cpp index 33f71b3..1723c58 100644 --- a/src/Generic/ConsoleInterface/Toolbox.cpp +++ b/src/Generic/ConsoleInterface/Toolbox.cpp @@ -46,6 +46,7 @@ void __printTableLine(unsigned columns) { } void __printPadded(const String& str, unsigned width) { + std::cout << width << " " << str.get_length(); while (width - str.get_length() > 0) { width--; print(" "); @@ -64,8 +65,6 @@ 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; @@ -74,7 +73,6 @@ void printTable(const List& items, unsigned columns) { if (colWidths[i % columns] < items[i].get_length()) colWidths[i % columns] = items[i].get_length(); } - std::cout << colWidths[0] << std::endl; // __printTableColumnHeader(columns); @@ -85,6 +83,7 @@ void printTable(const List& items, unsigned columns) { else if (i % columns > 0 && i % columns < columns - 1) print("|"); } + printLine(""); delete[] colWidths; } -- cgit v1.3.1-23-gd82d