VAPOR3 3.9.4
Classes | Public Types | Public Member Functions | Friends | List of all members
Wasp::OptionParser Class Reference

#include <OptionParser.h>

Inheritance diagram for Wasp::OptionParser:
Wasp::MyBase

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)
 

Detailed Description

Definition at line 47 of file OptionParser.h.

Member Typedef Documentation

◆ _OptRec_T

◆ Boolean_T

Definition at line 84 of file OptionParser.h.

◆ Dimension2D_T

◆ Dimension3D_T

◆ EnvOpt_T

◆ IntRange_T

◆ OptDescRec_T

An option description record (odr)

A structure for descriping an option

Parameters
optionThe name of the option
arg_countNumber of arguments expected by the option
valueOption's default value
helpA C string containing a help message for the option

◆ Option_T

Constructor & Destructor Documentation

◆ OptionParser()

Wasp::OptionParser::OptionParser ( )

◆ ~OptionParser()

Wasp::OptionParser::~OptionParser ( )

Member Function Documentation

◆ AppendOptions()

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.

Parameters
[in]odrA null-terminated option descriptor record.
See also
ParseOptions(), RemoveOptions()

◆ ParseOptions() [1/2]

int Wasp::OptionParser::ParseOptions ( const EnvOpt_T envv,
Option_T opts 
)

◆ ParseOptions() [2/2]

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

Parameters
[in,out]argcA pointer to a count of the number of elements in argv
[in,out]argvA null-terminated vector of command line arguments
[in,out]optsA null-terminated option table
See also
ParseOptions(), RemoveOptions()

◆ PrintOptionHelp()

void Wasp::OptionParser::PrintOptionHelp ( FILE *  fp,
int  linelimit = 80,
bool  docopyright = true 
)

◆ RemoveOptions()

void Wasp::OptionParser::RemoveOptions ( std::vector< string >  options)

Friends And Related Function Documentation

◆ opt_cmp

bool opt_cmp ( OptionParser::_OptRec_T a,
OptionParser::_OptRec_T b 
)
friend

The documentation for this class was generated from the following file: