Website Summary Files Commits Branches @commit @diff @stats
path: root / src / ConsoleInterface / Toolbox.cpp
diff options
context:
space:
mode:
Commit45172556e64edac54a85f17d13a8bc6cb4f4f9d1 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-06 10:36:33 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-06 10:36:33 +0300
Files6f52417b0bb8a5d3a0f6c23d01a0bda7dfafe2ab /src/ConsoleInterface/Toolbox.cpp
FMI-OOP-P1_TicketSystem-45172556e64edac54a85f17d13a8bc6cb4f4f9d1.tar
FMI-OOP-P1_TicketSystem-45172556e64edac54a85f17d13a8bc6cb4f4f9d1.tar.gz
FMI-OOP-P1_TicketSystem-45172556e64edac54a85f17d13a8bc6cb4f4f9d1.zip
Parente3e26c2e27d4fbd0c1af683ea2248b8e61e6663e (diff)
Autocommit at 06.05.2022 @ 10:36
1 files changed, 5 insertions, 5 deletions
-rw-r--r--src/ConsoleInterface/Toolbox.cpp10
diff --git a/src/ConsoleInterface/Toolbox.cpp b/src/ConsoleInterface/Toolbox.cpp
index a47d004..5331be9 100644
--- a/src/ConsoleInterface/Toolbox.cpp
+++ b/src/ConsoleInterface/Toolbox.cpp
@@ -48,9 +48,9 @@ void __printTableColumnHeader(unsigned start, unsigned count) {
}
void __printTableLine(unsigned columns) {
- std::cout << ":---";
+ std::cout << ":===";
for (unsigned i = 0; i < columns; i++)
- std::cout << "----";
+ std::cout << "+---";
std::cout << ":" << std::endl;
}
@@ -58,14 +58,14 @@ void table(unsigned startNumber, unsigned columns, const char* items) {
__printTableColumnHeader(startNumber, columns);
__printTableHeaderNumber(startNumber);
- for (unsigned i = 0, colInd = 1, rowInd = 0; items[i] != '\0'; i++, (++colInd) %= columns) {
- if (colInd == 0) {
+ for (unsigned i = 0, colInd = 0, rowInd = 0; items[i] != '\0'; i++, (++colInd) %= columns) {
+ if (colInd == 0 && i != 0) {
std::cout << ":" << std::endl;
__printTableLine(columns);
__printTableHeaderNumber((++rowInd) + startNumber);
}
- std::cout << ((colInd == 0) ? ": " : "| ") << items[rowInd * columns + colInd] << " ";
+ std::cout << "| " << items[rowInd * columns + colInd] << " ";
}
}