VAPoR
0.1
|
#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 VetsUtil::OptionParser::_OptDescRec | OptDescRec_T |
An option description record (odr) More... | |
typedef struct VetsUtil::OptionParser::_DPOption | Option_T |
typedef struct VetsUtil::OptionParser::_EnvOpt | EnvOpt_T |
typedef int | Boolean_T |
typedef struct VetsUtil::OptionParser::Dimension2D_ | Dimension2D_T |
typedef struct VetsUtil::OptionParser::Dimension3D_ | Dimension3D_T |
typedef struct VetsUtil::OptionParser::IntRange_ | IntRange_T |
typedef struct VetsUtil::OptionParser::_OptRec | _OptRec_T |
Public Types inherited from VetsUtil::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. More... | |
int | ParseOptions (int *argc, char **argv, Option_T *opts) |
Parse a command line argument vector. More... | |
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 VetsUtil::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 VetsUtil::MyBase | |
static void | SetErrMsg (const char *format,...) |
Record a formatted error message. More... | |
static void | SetErrMsg (int errcode, const char *format,...) |
Record a formatted error message and an error code. More... | |
static const char * | GetErrMsg () |
static void | SetErrCode (int err_code) |
Record an error code. More... | |
static int | GetErrCode () |
Retrieve the current error code. More... | |
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. More... | |
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 Public Attributes inherited from VetsUtil::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 VetsUtil::MyBase | |
void | SetClassName (const string &name) |
Definition at line 47 of file OptionParser.h.
typedef struct VetsUtil::OptionParser::_OptRec VetsUtil::OptionParser::_OptRec_T |
typedef int VetsUtil::OptionParser::Boolean_T |
Definition at line 85 of file OptionParser.h.
typedef struct VetsUtil::OptionParser::_EnvOpt VetsUtil::OptionParser::EnvOpt_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 |
VetsUtil::OptionParser::OptionParser | ( | ) |
VetsUtil::OptionParser::~OptionParser | ( | ) |
int VetsUtil::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 VetsUtil::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 VetsUtil::OptionParser::PrintOptionHelp | ( | FILE * | fp, |
int | linelimit = 80 , |
||
bool | docopyright = true |
||
) |
void VetsUtil::OptionParser::RemoveOptions | ( | std::vector< string > | options | ) |
|
friend |