#include <parsers.hpp>
Public Member Functions | |
const options_t & | options () const |
Options given, in the order of occurence. | |
const std::vector< std::string > & | arguments () const |
Arguments given, in the order of occurence. | |
const std::string & | operator[] (const std::string &name) const |
Returns the result of calling 'get_value'. | |
const std::string & | get_value (const std::string &name) const |
Returns value of option or empty string if the option is not present. | |
const std::vector< std::string > & | get_values (const std::string &name) const |
Returns all values of the specified option. | |
const std::vector< std::vector< std::string > > & | get_all_values (const std::string &name) const |
Returns all values of all occurences of the specified option. | |
unsigned | count (const std::string &name) const |
Checks if option is present. | |
void | add_option (const std::string &name, const std::vector< std::string > &value) |
Adds new option occurence. | |
void | add_argument (const std::string &argument) |
Adds new argument. | |
void | merge_occurences (const std::string &name) |
If there are several occurences of option 'name', merges values in all of them together. |
The option naming depends on the entity which created the class instances, but the usual convention is the same as for cmdline::option_name.
|
Options given, in the order of occurence. First element is the name stored according to name conventions above. Second element is the value specified for the option. Note that none of parse* function below perform any calls to validator or to notify routine. Side effect is that it's always possible to tell is an value was specified, since "--foobar=" syntax is not allowed. |
|
Arguments given, in the order of occurence.
|
|
Returns the result of calling 'get_value'.
|
|
Returns value of option or empty string if the option is not present. Returning empty string if option not found is for convenience; note that the function is const. This function recognizes option names as given in data source.
|
|
Returns all values of the specified option. If option is not present, returns an empty vector.
|
|
Returns all values of all occurences of the specified option. If the option is not present, returns an empty vector. |
|
Checks if option is present.
|
|
Adds new option occurence.
|
|
Adds new argument.
|
|
If there are several occurences of option 'name', merges values in all of them together. Otherwise, has no effect. |