|
BigBlueBox
An Inventory Management System for a NYLT Course or other Boy Scout Programs
|
Output File Stream Handler : Singleton. More...
#include <_filewriter.h>

Public Types | |
| enum | ReportType { Full, Low, Critical, Expirable, DbDump } |
| This enum discribes the various reports to be printed. More... | |
Public Member Functions | |
| ~_FileWriter () | |
| Default non-args de-constructor. More... | |
| void | makeTxtInvReport (QVector< Item > inventory, ReportType type=Full) |
| Writes a Inventory Report to txt file. More... | |
| void | makeXmlInvReport (QVector< Item > inventory, ReportType type=Full) |
| Writes Inventory Report to xml file. More... | |
Static Public Member Functions | |
| static _FileWriter * | getInstance () |
| Singleton pointer return function. More... | |
| static void | writeDbFileLoc (QString path) |
| static void | writeReportsDir (QString path) |
Private Member Functions | |
| _FileWriter () | |
| Default no-args constructor. More... | |
| QString | getReportsPath () |
| Gets the path to desktop. More... | |
Static Private Attributes | |
| static _FileWriter * | instance = nullptr |
| Singleton Pointer. More... | |
Output File Stream Handler : Singleton.
Handles all writing to files. This is mainly for creating reports. It can output in .txt format or in .csv format.
This enum discribes the various reports to be printed.
| Constant | Value | Discription |
|---|---|---|
| ReportType::Full | 0 | The full report. |
| ReportType::Low | 1 | Only prints items if their quantity is within 35% of the target. |
| ReportType::Critical | 2 | Only prints items if their quantity is within 10% of target. |
| ReportType::Expirable | 3 | Only prints items if they are expirable. |
| ReportType::DbDump | 4 | Prints all data in database. (only for xml) |
| Enumerator | |
|---|---|
| Full | |
| Low | |
| Critical | |
| Expirable | |
| DbDump | |
|
private |
Default no-args constructor.
Private: No objects can be instantiated.

| _FileWriter::~_FileWriter | ( | ) |
Default non-args de-constructor.
Resets instance to nullptr.
|
static |
Singleton pointer return function.
Returns pointer to singleton object.

|
private |
Gets the path to desktop.


| void _FileWriter::makeTxtInvReport | ( | QVector< Item > | inventory, |
| ReportType | type = Full |
||
| ) |
Writes a Inventory Report to txt file.
Takes in Vector<Item> then formats and writes it to a .txt file.


| void _FileWriter::makeXmlInvReport | ( | QVector< Item > | inventory, |
| ReportType | type = Full |
||
| ) |
Writes Inventory Report to xml file.
Takes in Vector<Item> then formats and writes it to a .xml file.

|
static |


|
static |


|
staticprivate |
Singleton Pointer.
1.8.6