diff options
Autocommit at 29.05.2022 @ 08:44
2 files changed, 4 insertions, 4 deletions
| -rw-r--r-- | src/Generic/ConsoleInterface/Toolbox.cpp | 6 | ||||
| -rw-r--r-- | src/Generic/ConsoleInterface/Toolbox.hpp | 2 |
diff --git a/src/Generic/ConsoleInterface/Toolbox.cpp b/src/Generic/ConsoleInterface/Toolbox.cpp index dd88762..af336fe 100644 --- a/src/Generic/ConsoleInterface/Toolbox.cpp +++ b/src/Generic/ConsoleInterface/Toolbox.cpp @@ -46,11 +46,11 @@ void __printTableLine(unsigned columns) { } void __printPadded(const String& str, unsigned width) { - while (str.get_length() - width > 0) { + while (width - str.get_length() > 0) { width--; print(" "); } - print(str.get_cstr()); + std::cout << str.get_cstr(); } /*! \param startNumber The number by which column and row enumeration begins @@ -63,7 +63,7 @@ void __printPadded(const String& str, unsigned width) { * Table is printed until a terminating zero is encountered. * The rows are "calculated" from the columns count and the items length. */ -void table(const List<String>& items, unsigned columns) { +void printTable(const List<String>& items, unsigned columns) { unsigned *colWidths = new unsigned[columns]; for (unsigned i = 0; i < items.get_count(); i++) { if (colWidths[i % columns] < items[i].get_length()) diff --git a/src/Generic/ConsoleInterface/Toolbox.hpp b/src/Generic/ConsoleInterface/Toolbox.hpp index 66d414b..4b59626 100644 --- a/src/Generic/ConsoleInterface/Toolbox.hpp +++ b/src/Generic/ConsoleInterface/Toolbox.hpp @@ -19,7 +19,7 @@ void inputLineBox(char* output, unsigned maxWidth, bool ignore = true); //! Prints a string list as a table -void table(const List<String>& items, unsigned columns); +void printTable(const List<String>& items, unsigned columns); //! Reads user input and stores it template <typename T> |
