#include <ParseOptionsArguments.h>
Public Types | |
| typedef std::string | String |
| The string type. | |
Public Member Functions | |
Constructors etc. | |
| ParseOptionsArguments () | |
| Default constructor. | |
| ParseOptionsArguments (const int argc, char *argv[], const char optionPrefix= '-') | |
| Construct from the command line arguments. | |
| ~ParseOptionsArguments () | |
| Trivial destructor. | |
Accessors. | |
| const String & | getProgramName () const |
| Get the program name. | |
| char | getOptionPrefix () const |
| Get the option prefix character. | |
| int | getNumberOfOptions () const |
| Get the number of options (with and without values) remaining. | |
| bool | areOptionsEmpty () const |
| Return true if there are no more options (with and without values) remaining. | |
| int | getNumberOfArguments () const |
| Get the number of arguments remaining. | |
| bool | areArgumentsEmpty () const |
| Return true if there are no more arguments remaining. | |
Manipulators. | |
| void | parse (int argc, char *argv[]) |
| Parse the options and arguments. | |
| void | setOptionPrefix (const char optionPrefix) |
| Set the option prefix character. | |
| bool | getOption (const String &key) |
| Return true if the option was given. Erase the option. | |
| bool | getOption (const char key) |
| Return true if the option was given. Erase the option. | |
| template<typename T> | |
| bool | getOption (const String &key, T *value) |
| Return true if the option was given. Set the option value and erase the option. | |
| template<typename T> | |
| bool | getOption (const char key, T *value) |
| Return true if the option was given. Set the option value and erase the option. | |
| bool | getOption (const String &key, String *value) |
| Return true if the option was given. Set the option value as a string and erase the option. | |
| String | getArgument () |
| Get the current argument and erase it. | |
| template<typename T> | |
| bool | getArgument (T *x) |
| Get the current argument and erase it. | |
File I/O. | |
| void | printOptions (std::ostream &out) const |
| Print any remaining options (with and without values). | |
| void | printArguments (std::ostream &out) const |
| Print any remaining arguments. | |
| bool ads::ParseOptionsArguments::getArgument | ( | T * | x | ) | [inline] |
Get the current argument and erase it.
operator>>().
| String ads::ParseOptionsArguments::getArgument | ( | ) | [inline] |
Get the current argument and erase it.
| bool ads::ParseOptionsArguments::getOption | ( | const char | key, | |
| T * | value | |||
| ) | [inline] |
Return true if the option was given. Set the option value and erase the option.
This is a convenience function for single character option keys.
| bool ads::ParseOptionsArguments::getOption | ( | const char | key | ) | [inline] |
Return true if the option was given. Erase the option.
This is a convenience function for single character option keys.
1.4.7