|
InfoLog | infoLog |
|
WarningLog | warningLog |
|
ErrorLog | errorLog |
|
std::map< std::string, std::string > | options |
|
std::map< std::string, std::string > | results |
|
Definition at line 41 of file CommandLineParser.h.
CommandLineParser::CommandLineParser |
( |
| ) |
|
|
inline |
virtual CommandLineParser::~CommandLineParser |
( |
| ) |
|
|
inlinevirtual |
bool CommandLineParser::addOption |
( |
const std::string & |
option, |
|
|
const std::string & |
id |
|
) |
| |
|
inline |
Adds an option with a specific retrival id. For example, addOption("-f","filename") would add the option "-f" which can be retrived using the "filename" id.
- Parameters
-
const | std::string &option: the command line option you want to store when the command line is parsed |
const | std::string &id: the id that will be used to retrieve the data associated with the option |
- Returns
- returns true if the option was added succesfully, false otherwise
Definition at line 60 of file CommandLineParser.h.
template<class T >
bool CommandLineParser::get |
( |
const std::string & |
id, |
|
|
T & |
value, |
|
|
T |
defaultValue = T() |
|
) |
| |
|
inline |
Retrives the value associated with the relevant id and stores it in value. If the id is invalid or the type can not be parsed, then the function will return false.
- Parameters
-
const | std::string &id: the search id |
T | &value: stores the return value |
T | defaultValue = T(): sets the default return value if the id is not found |
- Returns
- returns true if the value associated with the id was found succesfully, false otherwise
Definition at line 106 of file CommandLineParser.h.
bool CommandLineParser::parse |
( |
const int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
|
inline |
Parses the command line arguments, storing any relevant results in the results buffer. The can then be accessed using the get(...) function.
- Parameters
-
const | int argc: the number of command line arguments |
char | * argv[]: an array of arguments |
- Returns
- returns true if the command line was parsed succesfully, false otherwise
Definition at line 80 of file CommandLineParser.h.
bool CommandLineParser::setErrorLoggingEnabled |
( |
const bool |
loggingEnabled | ) |
|
|
inline |
Sets if error logging is enabled/disabled for this specific instance. If you want to enable/disable error logging globally, then you should use the ErrorLog::enableLogging( bool ) function.
- Returns
- returns true if the parameter was updated, false otherwise
Definition at line 181 of file CommandLineParser.h.
bool CommandLineParser::setInfoLoggingEnabled |
( |
const bool |
loggingEnabled | ) |
|
|
inline |
Sets if info logging is enabled/disabled for this specific instance. If you want to enable/disable info logging globally, then you should use the InfoLog::enableLogging( bool ) function.
- Returns
- returns true if the parameter was updated, false otherwise
Definition at line 159 of file CommandLineParser.h.
bool CommandLineParser::setWarningLoggingEnabled |
( |
const bool |
loggingEnabled | ) |
|
|
inline |
Sets if warning logging is enabled/disabled for this specific instance. If you want to enable/disable warning logging globally, then you should use the WarningLog::enableLogging( bool ) function.
- Returns
- returns true if the parameter was updated, false otherwise
Definition at line 170 of file CommandLineParser.h.
bool CommandLineParser::validate |
( |
const std::string & |
id | ) |
|
|
inline |
Validates if id was succesfully parsed from the command line. If the id is invalid or was not parsed, then the function will return false.
- Parameters
-
const | std::string &id: the search id |
- Returns
- returns true if the value associated with the id was parsed succesfully, false otherwise
Definition at line 138 of file CommandLineParser.h.
The documentation for this class was generated from the following file: