Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Generic / ConsoleInterface / Toolbox.cpp
diff options
context:
space:
mode:
Commit291ecb302cc7281c254542543a065aec3ba13bb9 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-29 08:44:02 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-29 08:44:02 +0300
Filese6a5c1abcc71e3fd9c67d4714368840101b50cf7 /src/Generic/ConsoleInterface/Toolbox.cpp
FMI-OOP-P2_Tables-291ecb302cc7281c254542543a065aec3ba13bb9.tar
FMI-OOP-P2_Tables-291ecb302cc7281c254542543a065aec3ba13bb9.tar.gz
FMI-OOP-P2_Tables-291ecb302cc7281c254542543a065aec3ba13bb9.zip
Parent2d77f9881df1e2e93cd367e9a2be320de0215fcf (diff)
Autocommit at 29.05.2022 @ 08:44
1 files changed, 3 insertions, 3 deletions
-rw-r--r--src/Generic/ConsoleInterface/Toolbox.cpp6
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())