From 0802d9d40c70e960def1fb70f650b26b75c39049 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 5 May 2022 13:38:27 +0300 Subject: Autocommit at 05.05.2022 @ 13:38 --- src/ConsoleInterface/Toolbox.hpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/ConsoleInterface') 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 +#define MAX_LINE_WIDTH 1024 + template void read(T* storage) { std::cin >> storage; @@ -46,15 +48,19 @@ void resetOrderedList(int starter = 1) { orderedListIndex = starter; } -template -void inputBox(T* output, const char* label) { +void inputBoxLabel(const char* label) { std::cout << "+ " << label; +} + +template +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 -- cgit v1.3.1-24-gd84d