Website Summary Files Commits Branches @commit @diff @stats
path: root / src / ConsoleInterface
diff options
context:
space:
mode:
Commit0802d9d40c70e960def1fb70f650b26b75c39049 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 13:38:27 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 13:38:27 +0300
Files633f66a41f839e6cce280dd7d7d823c25ba0e382 /src/ConsoleInterface
FMI-OOP-P1_TicketSystem-0802d9d40c70e960def1fb70f650b26b75c39049.tar
FMI-OOP-P1_TicketSystem-0802d9d40c70e960def1fb70f650b26b75c39049.tar.gz
FMI-OOP-P1_TicketSystem-0802d9d40c70e960def1fb70f650b26b75c39049.zip
Parent45f11f684101c1683251f591a135fe292268b8f7 (diff)
Autocommit at 05.05.2022 @ 13:38
1 files changed, 11 insertions, 5 deletions
-rw-r--r--src/ConsoleInterface/Toolbox.hpp16
diff --git a/src/ConsoleInterface/Toolbox.hpp b/src/ConsoleInterface/Toolbox.hpp
index b9f57b6..a198684 100644
--- a/src/ConsoleInterface/Toolbox.hpp
+++ b/src/ConsoleInterface/Toolbox.hpp
@@ -4,6 +4,8 @@
#include "../String/String.h"
#include <iostream>
+#define MAX_LINE_WIDTH 1024
+
template <class T>
void read(T* storage) {
std::cin >> storage;
@@ -46,15 +48,19 @@ void resetOrderedList(int starter = 1) {
orderedListIndex = starter;
}
-template <typename T>
-void inputBox(T* output, const char* label) {
+void inputBoxLabel(const char* label) {
std::cout << "+ " << label;
+}
+
+template <typename T>
+void inputBox(const char* label, T* output) {
+ inputBoxLabel(label);
std::cin >> output;
}
-void inputStrBox(char* output, unsigned maxLength, const char* label) {
- std::cout << "+ " << label;
- std::cin.getline(output, maxLength);
+void inputLineBox(const char* label, char* output, unsigned maxWidth) {
+ inputBoxLabel(label);
+ std::cin.getline(output, maxWidth);
}
#endif