BigBlueBox
An Inventory Management System for a NYLT Course or other Boy Scout Programs
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
bbb::_FileWriter Class Reference

Output File Stream Handler : Singleton. More...

#include <_filewriter.h>

Collaboration diagram for bbb::_FileWriter:
Collaboration graph
[legend]

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 _FileWritergetInstance ()
 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 _FileWriterinstance = nullptr
 Singleton Pointer. More...
 

Detailed Description

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.

Author
Bob Baker

Member Enumeration Documentation

This enum discribes the various reports to be printed.

ConstantValueDiscription
ReportType::Full0The full report.
ReportType::Low1Only prints items if their quantity is within 35% of the target.
ReportType::Critical2Only prints items if their quantity is within 10% of target.
ReportType::Expirable3Only prints items if they are expirable.
ReportType::DbDump4Prints all data in database. (only for xml)
Author
Bob Baker
Enumerator
Full 
Low 
Critical 
Expirable 
DbDump 

Constructor & Destructor Documentation

_FileWriter::_FileWriter ( )
private

Default no-args constructor.

Private: No objects can be instantiated.

Here is the caller graph for this function:

_FileWriter::~_FileWriter ( )

Default non-args de-constructor.

Resets instance to nullptr.

Author
Bob Baker

Member Function Documentation

_FileWriter * _FileWriter::getInstance ( )
static

Singleton pointer return function.

Returns pointer to singleton object.

Returns
_FileWriter*

Here is the call graph for this function:

QString _FileWriter::getReportsPath ( )
private

Gets the path to desktop.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Author
Bob Baker

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Author
Bob Baker

Here is the call graph for this function:

void _FileWriter::writeDbFileLoc ( QString  path)
static

Here is the call graph for this function:

Here is the caller graph for this function:

void _FileWriter::writeReportsDir ( QString  path)
static

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

_FileWriter * _FileWriter::instance = nullptr
staticprivate

Singleton Pointer.


The documentation for this class was generated from the following files: