From 35831ff8dc30c9884a7c3340414f005a0d4ada10 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 12 May 2022 20:21:09 +0300 Subject: Completely reworked documentation --- docs/html/Toolbox_8hpp_source.html | 182 +++++++++++++++++++++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 docs/html/Toolbox_8hpp_source.html (limited to 'docs/html/Toolbox_8hpp_source.html') diff --git a/docs/html/Toolbox_8hpp_source.html b/docs/html/Toolbox_8hpp_source.html new file mode 100644 index 0000000..6d1f211 --- /dev/null +++ b/docs/html/Toolbox_8hpp_source.html @@ -0,0 +1,182 @@ + + + + + + + +FMI Ticket System: src/Generic/ConsoleInterface/Toolbox.hpp Source File + + + + + + + + + +
+
+ + + + + + +
+
FMI Ticket System +
+
| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 1 | Project Topic 4 |
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
Toolbox.hpp
+
+
+Go to the documentation of this file.
1#ifndef HEADER_CONSOLEINTERFACE_TOOLBOX
+
2#define HEADER_CONSOLEINTERFACE_TOOLBOX
+
3
+
4#include <iostream>
+
5
+
14#define MAX_LINE_WIDTH 1024
+
15
+
17void clear();
+
19void titleBox(const char* title);
+
21void subTitleBox(const char* title);
+
22
+
24void successBox(const char* message);
+
26void successSubBox(const char* message);
+
28void warningBox(const char* message);
+
30void warningSubBox(const char* message);
+
32void errorBox(const char* message);
+
34void errorSubBox(const char* message);
+
35
+
37void inputLineBox(const char* label, char* output, unsigned maxWidth, bool ignore = true);
+
39void inputLineSubBox(const char* label, char* output, unsigned maxWidth, bool ignore = true);
+
41void pressEnterToContinue(bool ignore = true);
+
42
+
44void resetOrderedList(int starter = 1);
+
45
+
47void table(unsigned startNumber, unsigned columns, const char* items);
+
48
+ +
52void _printInputBoxLabel(const char* label);
+ +
55
+
57template <typename T>
+
58void read(T* storage) {
+
59 std::cin >> storage;
+
60}
+
61
+
63template <typename T>
+
64void read(T& storage) {
+
65 std::cin >> storage;
+
66}
+
67
+
69template <typename T>
+
70void print(const T* item) {
+
71 std::cout << item;
+
72}
+
73
+
75template <typename T>
+
76void print(const T& item) {
+
77 std::cout << item;
+
78}
+
79
+
81template <typename T>
+
82void printLine(const T* item) {
+
83 std::cout << item << std::endl;
+
84}
+
85
+
87template <typename T>
+
88void printLine(const T& item) {
+
89 std::cout << item << std::endl;
+
90}
+
91
+
93template <typename T>
+
94void printOrderedListElem(const T& elem) {
+ +
96 printLine(elem);
+
97}
+
98
+
100template <typename T>
+
101void inputBox(const char* label, T* output) {
+
102 _printInputBoxLabel(label);
+
103 std::cin >> *output;
+
104}
+
105
+
108template <typename T>
+
109void inputSubBox(const char* label, T* output) {
+ +
111 _printInputBoxLabel(label);
+
112 std::cin >> *output;
+
113}
+
114
+
115#endif
+
void printLine(const T *item)
Prints given item and an endline character.
Definition: Toolbox.hpp:82
+
void warningSubBox(const char *message)
Prints a warning box as a sub box.
Definition: Toolbox.cpp:74
+
void titleBox(const char *title)
Prints a title box.
Definition: Toolbox.cpp:27
+
void _printOrderedListBeginning()
Semi-internal function that prints the latest ordered list index.
Definition: Toolbox.cpp:162
+
void read(T *storage)
Reads user input and stores it.
Definition: Toolbox.hpp:58
+
void resetOrderedList(int starter=1)
Resets the ordered list starting number.
Definition: Toolbox.cpp:170
+
void warningBox(const char *message)
Prints a warning box.
Definition: Toolbox.cpp:66
+
void print(const T *item)
Prints given item.
Definition: Toolbox.hpp:70
+
void successBox(const char *message)
Prints a success box.
Definition: Toolbox.cpp:47
+
void table(unsigned startNumber, unsigned columns, const char *items)
Prints a string as a table.
Definition: Toolbox.cpp:208
+
void inputSubBox(const char *label, T *output)
Definition: Toolbox.hpp:109
+
void errorBox(const char *message)
Prints an error box.
Definition: Toolbox.cpp:85
+
void inputLineBox(const char *label, char *output, unsigned maxWidth, bool ignore=true)
Prints label, gets a whole line of input and stores it to output.
Definition: Toolbox.cpp:125
+
void successSubBox(const char *message)
Prints a success box as a sub box.
Definition: Toolbox.cpp:55
+
void _printInputBoxLabel(const char *label)
Semi-internal function that prints the label of an input box.
Definition: Toolbox.cpp:107
+
void inputBox(const char *label, T *output)
Prints a label and then reads user input and stores it.
Definition: Toolbox.hpp:101
+
void printOrderedListElem(const T &elem)
Prints the element as the latest list item.
Definition: Toolbox.hpp:94
+
void _printSubBoxSpacing()
Semi-internal function that prints the spacing for sub boxes.
Definition: Toolbox.cpp:17
+
void pressEnterToContinue(bool ignore=true)
Waits for user to press enter.
Definition: Toolbox.cpp:145
+
void clear()
Clears the console screen.
Definition: Toolbox.cpp:10
+
void inputLineSubBox(const char *label, char *output, unsigned maxWidth, bool ignore=true)
Prints label as a sub box, gets a whole line of input and stores it to output.
Definition: Toolbox.cpp:134
+
void subTitleBox(const char *title)
Prints a title sub box.
Definition: Toolbox.cpp:35
+
void errorSubBox(const char *message)
Prints an error box as a sub box.
Definition: Toolbox.cpp:93
+
+ + + + -- cgit v1.3.1-26-gb76a