VAPOR3 3.9.4
|
#include <OptionParser.h>
Classes | |
struct | _DPOption |
struct | _EnvOpt |
struct | _OptDescRec |
An option description record (odr) More... | |
struct | _OptRec |
struct | Dimension2D_ |
struct | Dimension3D_ |
struct | IntRange_ |
Public Types | |
typedef struct Wasp::OptionParser::_OptDescRec | OptDescRec_T |
An option description record (odr) | |
typedef struct Wasp::OptionParser::_DPOption | Option_T |
typedef struct Wasp::OptionParser::_EnvOpt | EnvOpt_T |
typedef int | Boolean_T |
typedef struct Wasp::OptionParser::Dimension2D_ | Dimension2D_T |
typedef struct Wasp::OptionParser::Dimension3D_ | Dimension3D_T |
typedef struct Wasp::OptionParser::IntRange_ | IntRange_T |
typedef struct Wasp::OptionParser::_OptRec | _OptRec_T |
Public Types inherited from Wasp::MyBase | |
typedef void(* | ErrMsgCB_T) (const char *msg, int err_code) |
typedef void(* | DiagMsgCB_T) (const char *msg) |
Public Member Functions | |
OptionParser () | |
~OptionParser () | |
int | AppendOptions (const OptDescRec_T *odr) |
Append a list of option descriptions. | |
int | ParseOptions (int *argc, char **argv, Option_T *opts) |
Parse a command line argument vector. | |
int | ParseOptions (const EnvOpt_T *envv, Option_T *opts) |
void | RemoveOptions (std::vector< string > options) |
void | PrintOptionHelp (FILE *fp, int linelimit=80, bool docopyright=true) |
Public Member Functions inherited from Wasp::MyBase | |
MyBase () | |
const string & | getClassName () const |
Friends | |
bool | opt_cmp (OptionParser::_OptRec_T *a, OptionParser::_OptRec_T *b) |
Additional Inherited Members | |
Static Public Member Functions inherited from Wasp::MyBase | |
static void | SetErrMsg (const char *format,...) |
Record a formatted error message. | |
static void | SetErrMsg (int errcode, const char *format,...) |
Record a formatted error message and an error code. | |
static const char * | GetErrMsg () |
static void | SetErrCode (int err_code) |
Record an error code. | |
static int | GetErrCode () |
Retrieve the current error code. | |
static void | SetErrMsgCB (ErrMsgCB_T cb) |
static ErrMsgCB_T | GetErrMsgCB () |
static void | SetErrMsgFilePtr (FILE *fp) |
static const FILE * | SetErrMsgFilePtr () |
static void | SetDiagMsg (const char *format,...) |
Record a formatted diagnostic message. | |
static const char * | GetDiagMsg () |
static void | SetDiagMsgCB (DiagMsgCB_T cb) |
static DiagMsgCB_T | GetDiagMsgCB () |
static void | SetDiagMsgFilePtr (FILE *fp) |
static bool | EnableErrMsg (bool enable) |
static bool | GetEnableErrMsg () |
Static Public Attributes inherited from Wasp::MyBase | |
static char * | ErrMsg |
static int | ErrCode |
static int | ErrMsgSize |
static FILE * | ErrMsgFilePtr |
static ErrMsgCB_T | ErrMsgCB |
static char * | DiagMsg |
static int | DiagMsgSize |
static FILE * | DiagMsgFilePtr |
static DiagMsgCB_T | DiagMsgCB |
static bool | Enabled |
Protected Member Functions inherited from Wasp::MyBase | |
void | SetClassName (const string &name) |
Definition at line 47 of file OptionParser.h.
typedef struct Wasp::OptionParser::_OptRec Wasp::OptionParser::_OptRec_T |
typedef int Wasp::OptionParser::Boolean_T |
Definition at line 84 of file OptionParser.h.
typedef struct Wasp::OptionParser::_EnvOpt Wasp::OptionParser::EnvOpt_T |
typedef struct Wasp::OptionParser::IntRange_ Wasp::OptionParser::IntRange_T |
typedef struct Wasp::OptionParser::_OptDescRec Wasp::OptionParser::OptDescRec_T |
An option description record (odr)
A structure for descriping an option
option | The name of the option |
arg_count | Number of arguments expected by the option |
value | Option's default value |
help | A C string containing a help message for the option |
typedef struct Wasp::OptionParser::_DPOption Wasp::OptionParser::Option_T |
Wasp::OptionParser::OptionParser | ( | ) |
Wasp::OptionParser::~OptionParser | ( | ) |
int Wasp::OptionParser::AppendOptions | ( | const OptDescRec_T * | odr | ) |
Append a list of option descriptions.
Append a list of option descriptions. The input option descriptor records are appended to the current list of option description records.
[in] | odr | A null-terminated option descriptor record. |
int Wasp::OptionParser::ParseOptions | ( | int * | argc, |
char ** | argv, | ||
Option_T * | opts | ||
) |
Parse a command line argument vector.
Destrutively parse a command line argument vector against the option descriptor records (odr) supplied by previous invocations of AppendOptions(). Command line arguments that match option names in the odr and the input option table are
[in,out] | argc | A pointer to a count of the number of elements in argv |
[in,out] | argv | A null-terminated vector of command line arguments |
[in,out] | opts | A null-terminated option table |
void Wasp::OptionParser::PrintOptionHelp | ( | FILE * | fp, |
int | linelimit = 80 , |
||
bool | docopyright = true |
||
) |
void Wasp::OptionParser::RemoveOptions | ( | std::vector< string > | options | ) |
|
friend |