Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Generic / ConsoleInterface
diff options
context:
space:
mode:
Commite2a51e497a2c1313722eb13f37aa682160021c2f (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-12 19:27:08 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-12 19:27:08 +0300
Filescdd6133905a017445f9c9a14bf110f607977f6d0 /src/Generic/ConsoleInterface
FMI-OOP-P1_TicketSystem-e2a51e497a2c1313722eb13f37aa682160021c2f.tar
FMI-OOP-P1_TicketSystem-e2a51e497a2c1313722eb13f37aa682160021c2f.tar.gz
FMI-OOP-P1_TicketSystem-e2a51e497a2c1313722eb13f37aa682160021c2f.zip
Parent7dd2affe0e85ce08b47b73da4ce717bbba918f02 (diff)
Improved documentation on Toolbox's clear function
2 files changed, 6 insertions, 4 deletions
-rw-r--r--src/Generic/ConsoleInterface/Toolbox.cpp8
-rw-r--r--src/Generic/ConsoleInterface/Toolbox.hpp2
diff --git a/src/Generic/ConsoleInterface/Toolbox.cpp b/src/Generic/ConsoleInterface/Toolbox.cpp
index 0ede126..ca83b3b 100644
--- a/src/Generic/ConsoleInterface/Toolbox.cpp
+++ b/src/Generic/ConsoleInterface/Toolbox.cpp
@@ -1,11 +1,13 @@
#include "Toolbox.hpp"
/*!
- * Prints an ANSI escape sequence to clear the console.
+ * Erases display and moves cursor to top left corner via ANSI escape sequences: \c ESC[2J \c ESC[1;1H
+ *
+ * \warning Not all terminals support any or all ANSI escape sequences
+ *
+ * \note Source: https://stackoverflow.com/a/52895729/12036073
*/
void clear() {
- // Clears console on Linux
- // Source: https://stackoverflow.com/a/52895729/12036073
std::cout << u8"\033[2J\033[1;1H";
}
diff --git a/src/Generic/ConsoleInterface/Toolbox.hpp b/src/Generic/ConsoleInterface/Toolbox.hpp
index 2686554..91306cb 100644
--- a/src/Generic/ConsoleInterface/Toolbox.hpp
+++ b/src/Generic/ConsoleInterface/Toolbox.hpp
@@ -13,7 +13,7 @@
#define MAX_LINE_WIDTH 1024
-//! Clears the console screen (Linux-only)
+//! Clears the console screen
void clear();
//! Prints a title box
void titleBox(const char* title);