Public Types |
typedef list<std::string> | ArgList |
| arg list type.
|
typedef list<std::string>::iterator | ArgListIt |
| arg list type iterator.
|
typedef std::list<Option> | OptionList |
| Option list type.
|
typedef OptionList::iterator | OptionListIt |
| Option list iterator.
|
Public Methods |
| LeoArg ( int argc, char **argv, std::string long_option_switch = "--", std::string short_option_switch = "-" ) |
| LeoArg ( Setting& setting ) |
| initialize with a filled setting structure.
|
void | short_option_string ( bool short_os ) |
| enable/disable the short option string.
|
bool | short_option_string () const |
| returns true if short option string parsing is enabled.
|
Setting | get_setting () const |
| returns the current setting.
|
bool | has_parameters () const |
| true if any optin or parameter is set.
|
bool | get_option ( Option& option ) |
| returns a specific option.
|
bool | get_first ( std::string& ret_value ) const |
| eg.: "./cmd hello --file a_file another_file" the function will return "hello".
|
bool | get_first ( ArgList& arglist ) const |
| eg.: "./cmd hello world --file a_file another_file" the function will fill the ArgList with "hello" and "world".
|
bool | get_last ( std::string & ret_value ) const |
| eg.: "./cmd --file a_file another_file" the function will return "another_file".
|
bool | get_last ( ArgList& arglist ) const |
| eg.: "./cmd --file a_file another_file" the function will fill the ArgList with "a_file" and "another_file".
|
std::string | get_prog_name () const |
void | clear_cache () |
| clear the cache.
|
Private Methods |
bool | parse_option ( Option& option ) const |
void | correct_option ( Option& option ) const |
void | correct_setting () |
bool | find_option ( Option& option ) const |
| function searches in cache for the specific option.
|
bool | is_in_sos ( const Option& option ) const |
| checks if an option is in the short option string.
|
int | has_sos () const |
| finds a short option string. More...
|
Private Attributes |
Setting | setting |
| the setting.
|