Website Summary Files Commits Branches @commit @diff @stats
path: root / src / ConsoleInterface / Toolbox.cpp
diff options
context:
space:
mode:
Commitdf4ec6c4e432626a964a73588d441e863e570057 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-06 10:21:27 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-06 10:21:27 +0300
Files5e0c45ecb5036449e9de754a18bf5ba727e5e0e2 /src/ConsoleInterface/Toolbox.cpp
FMI-OOP-P1_TicketSystem-df4ec6c4e432626a964a73588d441e863e570057.tar
FMI-OOP-P1_TicketSystem-df4ec6c4e432626a964a73588d441e863e570057.tar.gz
FMI-OOP-P1_TicketSystem-df4ec6c4e432626a964a73588d441e863e570057.zip
Parent29e5832f4cd81163fde9848eccaa72b211c08f95 (diff)
Autocommit at 06.05.2022 @ 10:21
1 files changed, 9 insertions, 9 deletions
-rw-r--r--src/ConsoleInterface/Toolbox.cpp18
diff --git a/src/ConsoleInterface/Toolbox.cpp b/src/ConsoleInterface/Toolbox.cpp
index c74332b..9d33783 100644
--- a/src/ConsoleInterface/Toolbox.cpp
+++ b/src/ConsoleInterface/Toolbox.cpp
@@ -33,21 +33,23 @@ void errorBox(const char* message) {
}
void __printTableHeaderNumber(unsigned number) {
- std::cout << ((number < 100) ? " " : "") << number << ((number < 10) ? " " : "");
+ std::cout << ":" << ((number < 100) ? " " : "") << number << ((number < 10) ? " " : "");
}
void __printTableColumnHeader(unsigned start, unsigned count) {
std::cout << ": ";
- for (unsigned i = 0; i < count; i++) {
- std::cout << ":";
+ for (unsigned i = 0; i < count; i++)
__printTableHeaderNumber(start++);
- }
std::cout << ":" << std::endl;
+
+ for (unsigned i = 0; i < count; i++)
+ std::cout << "....";
+ std::cout << "." << std::endl;
}
void __printTableLine(unsigned columns) {
- std::cout << "...+";
- for (unsigned i = 1; i < columns; i++)
+ std::cout << ":...:";
+ for (unsigned i = 0; i < columns; i++)
std::cout << "----";
std::cout << "-" << std::endl;
}
@@ -55,10 +57,8 @@ void __printTableLine(unsigned columns) {
void table(unsigned startNumber, unsigned columns, const char* items) {
__printTableColumnHeader(startNumber, columns);
-
- __printTableLine(columns);
__printTableHeaderNumber(startNumber);
- for (unsigned i = 0, colInd = 1, rowInd = 0; items[i] != '\0'; i++, (++colInd) %= columns) {
+ for (unsigned i = 0, colInd = 1, rowInd = 0; items[i] != '\0'; i++, (++colInd) %= (columns + 1)) {
if (colInd == 0) {
std::cout << "|" << std::endl;
__printTableLine(columns);