|
FMI Table
| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 2 | Project Topic 7 |
|
Stores a wide range of functions for simpler/more automated printing. More...
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. | |
Stores a wide range of functions for simpler/more automated printing.
Adds a lot of functions for printing.
| void inputLineBox | ( | char * | output, |
| unsigned | maxWidth, | ||
| bool | ignore | ||
| ) |
Prints label, gets a whole line of input and stores it to output.
| label | C-style string, there are no size check so it could wrap |
| output | Pointer to a char array |
| maxWidth | Maximum count of characters to read from user input. output MUST be able to hold that many characters! |
| ignore | Whether 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.
Prints a string list as a table.
| startNumber | The number by which column and row enumeration begins |
| columns | How many columns the table should have |
| items | C-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.