A singleton class containing the parsed command line parameters. More...
#include <options.hpp>
Static Public Member Functions | |
static const toptions & | parse (int argc, char *argv[]) |
Parses the command line. More... | |
static const toptions & | options () |
Returns the cached parsed command line parameters. More... | |
Public Attributes | |
std::string | input_filename |
The filename of the input file. More... | |
std::string | output_filename |
The filename of the output file. More... | |
std::vector< std::string > | filters |
The filters to apply to the input file. More... | |
bool | time |
Display the time that applying the filters took. More... | |
int | count |
The number of times the filter has to be applied. More... | |
Private Member Functions | |
toptions () | |
Static Private Member Functions | |
static toptions & | singleton (const bool is_initialized) |
Helper which contains the single instance of this class. More... | |
A singleton class containing the parsed command line parameters.
Definition at line 29 of file options.hpp.
|
private |
Definition at line 25 of file options.cpp.
|
static |
Returns the cached parsed command line parameters.
This function shall only be called after toptions::parse has been called.
Definition at line 255 of file options.cpp.
References singleton().
Parses the command line.
This function shall be called once at the beginning of the program.
Definition at line 157 of file options.cpp.
References count, filters, i, input_filename, output_filename, print_help(), singleton(), time, and VALIDATE_NOT_PAST_END.
Referenced by main().
|
staticprivate |
Helper which contains the single instance of this class.
is_initialized | Helper variable to track whether toptions::parse is only called once and whether toptions::options isn't called before toptions::parse. |
Definition at line 261 of file options.cpp.
References initialized.
int toptions::count |
The number of times the filter has to be applied.
This feature is for performance testing only.
Definition at line 79 of file options.hpp.
std::vector<std::string> toptions::filters |
The filters to apply to the input file.
Definition at line 69 of file options.hpp.
std::string toptions::input_filename |
The filename of the input file.
Definition at line 63 of file options.hpp.
std::string toptions::output_filename |
The filename of the output file.
Definition at line 66 of file options.hpp.
bool toptions::time |
Display the time that applying the filters took.
Definition at line 72 of file options.hpp.