From c5431e4d321dbf0152e6826841c1ef5c1291ba5b Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 14 Jun 2022 15:38:50 +0300 Subject: Added files from project 2 (mirror) --- .../Project 2/docs/html/Toolbox_8hpp.html | 227 +++++++++++++++++++++ 1 file changed, 227 insertions(+) create mode 100644 Year 1/Object-oriented Programming/Project 2/docs/html/Toolbox_8hpp.html (limited to 'Year 1/Object-oriented Programming/Project 2/docs/html/Toolbox_8hpp.html') diff --git a/Year 1/Object-oriented Programming/Project 2/docs/html/Toolbox_8hpp.html b/Year 1/Object-oriented Programming/Project 2/docs/html/Toolbox_8hpp.html new file mode 100644 index 0000000..b48ff34 --- /dev/null +++ b/Year 1/Object-oriented Programming/Project 2/docs/html/Toolbox_8hpp.html @@ -0,0 +1,227 @@ + + + + + + + +FMI Table: src/Generic/ConsoleInterface/Toolbox.hpp File Reference + + + + + + + + + +
+
+ + + + + + +
+
FMI Table +
+
| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 2 | Project Topic 7 |
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
Toolbox.hpp File Reference
+
+
+ +

Stores a wide range of functions for simpler/more automated printing. +More...

+
#include <iostream>
+#include "../List/List.hpp"
+#include "../String/String.h"
+
+

Go to the source code of this file.

+ + + + +

+Macros

+#define MAX_LINE_WIDTH   1024
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

void inputLineBox (char *output, unsigned maxWidth, bool ignore=true)
 Prints label, gets a whole line of input and stores it to output. More...
 
void printTable (const List< String > &items, unsigned columns)
 Prints a string list as a table. More...
 
+template<typename T >
void read (T *storage)
 Reads user input and stores it.
 
+template<typename T >
void read (T &storage)
 Reads user input and stores it.
 
+template<typename T >
void print (const T *item)
 Prints given item.
 
+template<typename T >
void print (const T &item)
 Prints given item.
 
+template<typename T >
void printLine (const T *item)
 Prints given item and an endline character.
 
+template<typename T >
void printLine (const T &item)
 Prints given item and an endline character.
 
+

Detailed Description

+

Stores a wide range of functions for simpler/more automated printing.

+

Adds a lot of functions for printing.

+
Remarks
iostream is included by necessity (templated functions), you should only use the provided functions, if you can.
+

Function Documentation

+ +

◆ inputLineBox()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void inputLineBox (char * output,
unsigned maxWidth,
bool ignore 
)
+
+ +

Prints label, gets a whole line of input and stores it to output.

+
Parameters
+ + + + + +
labelC-style string, there are no size check so it could wrap
outputPointer to a char array
maxWidthMaximum count of characters to read from user input. output MUST be able to hold that many characters!
ignoreWhether or not to ignore the first new-line delimiter. true by default, should be set to false only when an inputLineBox/SubBox has been issued directly prior or when it's the very first issued box command.
+
+
+

Prints "(+)" before the label.

+ +
+
+ +

◆ printTable()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void printTable (const List< String > & items,
unsigned columns 
)
+
+ +

Prints a string list as a table.

+
Parameters
+ + + + +
startNumberThe number by which column and row enumeration begins
columnsHow many columns the table should have
itemsC-style string, each cell is a single character from the string
+
+
+

Prints a string as a grid/table of characters from top to bottom, left to right. The first character is on the top left, the last one is on the bottom right.

+

Table is printed until a terminating zero is encountered. The rows are "calculated" from the columns count and the items length.

+ +
+
+
+ + + + -- cgit v1.3.1-23-gd82d