RSC
0.17.1
|
A source for options from the command line using a -D java properties-like syntax. More...
#include <CommandLinePropertySource.h>
Public Member Functions | |
CommandLinePropertySource (int argc, const char **argv, bool reportSyntaxErrors=false, char option= 'D') | |
Creates a new source. More... | |
virtual | ~CommandLinePropertySource () |
void | provideOptions (OptionHandler &handler) |
Implementations should pass all configuration options to handler. More... | |
Public Member Functions inherited from rsc::config::ConfigSource | |
virtual | ~ConfigSource () |
Private Attributes | |
logging::LoggerPtr | logger |
int | argc |
const char ** | argv |
bool | reportSyntaxErrors |
char | option |
Additional Inherited Members | |
Protected Member Functions inherited from rsc::config::ConfigSource | |
void | splitKeyAtDots (const std::string &input, std::vector< std::string > &output) |
Creates a key vector structure used in the options backend from a dot-separated string. More... | |
A source for options from the command line using a -D java properties-like syntax.
The option key can be specified and in the default configuration unknown or ill-formatted options are ignored so that it is safe to use this source in conjunction with other command line handling routines.
Definition at line 44 of file CommandLinePropertySource.h.
rsc::config::CommandLinePropertySource::CommandLinePropertySource | ( | int | argc, |
const char ** | argv, | ||
bool | reportSyntaxErrors = false , |
||
char | option = 'D' |
||
) |
Creates a new source.
argc | Number of arguments given to the program |
argv | Argument vector given to the program |
reportSyntaxErrors | if true , syntax errors in the options will raise exceptions in provideOptions, otherwise they will be ignored. Default: false |
option | the command line option key used to parse the properties, defaults to 'D'. |
Definition at line 37 of file CommandLinePropertySource.cpp.
|
virtual |
Definition at line 46 of file CommandLinePropertySource.cpp.
|
virtual |
Implementations should pass all configuration options to handler.
handler | The handler to which all option should be passed. |
std::invalid_argument | may be thrown when the options this source uses in the background are not well-formated |
Implements rsc::config::ConfigSource.
Definition at line 49 of file CommandLinePropertySource.cpp.
References argc, argv, rsc::config::OptionHandler::handleOption(), logger, option, reportSyntaxErrors, RSCTRACE, RSCWARN, and rsc::config::ConfigSource::splitKeyAtDots().
Referenced by rsc::config::configure().
|
private |
Definition at line 69 of file CommandLinePropertySource.h.
Referenced by provideOptions().
|
private |
Definition at line 70 of file CommandLinePropertySource.h.
Referenced by provideOptions().
|
private |
Definition at line 67 of file CommandLinePropertySource.h.
Referenced by provideOptions().
|
private |
Definition at line 72 of file CommandLinePropertySource.h.
Referenced by provideOptions().
|
private |
Definition at line 71 of file CommandLinePropertySource.h.
Referenced by provideOptions().