#include <util/options/GetLongOpt.h>
Public Types | |
| enum | OptType { NoValue, OptionalValue, MandatoryValue } |
| Used by the enroll member to specify whether or not a value is expected or optional. More... | |
Public Member Functions | |
| GetLongOpt (const char optmark= '-') | |
| Initialize the object. | |
| int | parse (int argc, char *const *argv) |
| Parse command line options. | |
| int | parse (char *const str, char *const p) |
| Parse options in a string. | |
| int | enroll (const char *const opt, const OptType t, const char *const desc, const char *const val) |
| Enroll an option. | |
| const char * | retrieve (const char *const opt) const |
| Retrieve an option. | |
| void | usage (std::ostream &outfile=std::cout) const |
| Print usage information. | |
| void | usage (const char *str) |
| Initialize usage synopsis. | |
Classes | |
| struct | Cell |
Used by the enroll member to specify whether or not a value is expected or optional.
| sc::GetLongOpt::GetLongOpt | ( | const char | optmark = '-' |
) |
Initialize the object.
| optmark | the option flag marker (default is -). |
| int sc::GetLongOpt::parse | ( | int | argc, | |
| char *const * | argv | |||
| ) |
Parse command line options.
| argc | the number of arguments, as passed to main | |
| argv | the arguments, as passed to main |
| int sc::GetLongOpt::parse | ( | char *const | str, | |
| char *const | p | |||
| ) |
Parse options in a string.
| str | the string to be parsed | |
| p | a prefix that will be prefixed to error messages |
| int sc::GetLongOpt::enroll | ( | const char *const | opt, | |
| const OptType | t, | |||
| const char *const | desc, | |||
| const char *const | val | |||
| ) |
Enroll an option.
| opt | the option name | |
| t | whether or not a value is expected | |
| desc | a description of the option | |
| val | a default value for the option with an optional value |
| const char* sc::GetLongOpt::retrieve | ( | const char *const | opt | ) | const |
Retrieve an option.
| opt | the name of the option |
| void sc::GetLongOpt::usage | ( | std::ostream & | outfile = std::cout |
) | const |
Print usage information.
| outfile | stream to use for printing (default: std::cout) |
| void sc::GetLongOpt::usage | ( | const char * | str | ) | [inline] |
Initialize usage synopsis.
| str | the usage synopsis |