GNU CommonC++
Public Member Functions | Public Attributes | List of all members
ost::CommandOptionWithArg Class Reference

Derived class of CommandOption for options that have a value associated with them. More...

#include <cmdoptns.h>

Inheritance diagram for ost::CommandOptionWithArg:
ost::CommandOption ost::CommandOptionArg ost::CommandOptionCollect ost::CommandOptionRest

Public Member Functions

 CommandOptionWithArg (const char *inOptionName, const char *inOptionLetter, const char *inDescription, OptionType inOptionType, bool inRequired=false, CommandOption **ppNext=&defaultCommandOptionList)
 CommandOptionWithArg contructor. More...
 
virtual ~CommandOptionWithArg ()
 
virtual void foundOption (CommandOptionParse *cop, const char *value=0)
 
virtual void foundOption (CommandOptionParse *cop, const char **value, int num)
 
virtual bool hasValue ()
 
- Public Member Functions inherited from ost::CommandOption
virtual ~CommandOption ()
 A virtual destructor just in case. More...
 
 CommandOption (const char *inOptionName, const char *inOptionLetter, const char *inDescription, OptionType inOptionType, bool inRequired=false, CommandOption **ppNext=&defaultCommandOptionList)
 CommandOption contructor. More...
 
virtual void parseDone (CommandOptionParse *cop)
 Once parsing of command line options is complete, this method is called. More...
 
virtual void performTask (CommandOptionParse *cop)
 Once CommandOption objects have completed parsing and there are no errors they may have some specific tasks to perform. More...
 

Public Attributes

const char ** values
 Array of list of values collected for this option. More...
 
int numValue
 Number of values in the values array. More...
 
- Public Attributes inherited from ost::CommandOption
const char * optionName
 Long option name, these will be preceded with "--" on the command line. More...
 
const char * optionLetter
 option letter, these will be preceded with "-" on the command line. More...
 
const char * description
 A short description of the option for Usage messages. More...
 
OptionType optionType
 This command option's OptionType. More...
 
bool required
 True if this parameter is required. More...
 
CommandOptionnext
 This next CommandOption in this list of options or nil if no more options exist. More...
 

Additional Inherited Members

- Public Types inherited from ost::CommandOption
enum  OptionType { hasArg, noArg, trailing, collect }
 OptionType is for denoting what type of option this is, with an arg, without an arg or the trailing args. More...
 

Detailed Description

Derived class of CommandOption for options that have a value associated with them.

Classes CommandOptionRest and CommandOptionArg derive from this class.

Constructor & Destructor Documentation

◆ CommandOptionWithArg()

ost::CommandOptionWithArg::CommandOptionWithArg ( const char *  inOptionName,
const char *  inOptionLetter,
const char *  inDescription,
OptionType  inOptionType,
bool  inRequired = false,
CommandOption **  ppNext = &defaultCommandOptionList 
)

CommandOptionWithArg contructor.

Note the default values for required and ppNext.

Parameters
inOptionNamelong option name
inOptionLettershort letter name
inDescriptionshort description of the option
inOptionTypethe type of this option
inRequiredtrue if option is required
ppNextthe linked list header

◆ ~CommandOptionWithArg()

virtual ost::CommandOptionWithArg::~CommandOptionWithArg ( )
virtual

Member Function Documentation

◆ foundOption() [1/2]

virtual void ost::CommandOptionWithArg::foundOption ( CommandOptionParse cop,
const char **  value,
int  num 
)
virtual

Reimplemented from ost::CommandOption.

◆ foundOption() [2/2]

virtual void ost::CommandOptionWithArg::foundOption ( CommandOptionParse cop,
const char *  value = 0 
)
virtual

Reimplemented from ost::CommandOption.

◆ hasValue()

virtual bool ost::CommandOptionWithArg::hasValue ( )
virtual

Reimplemented from ost::CommandOption.

Member Data Documentation

◆ numValue

int ost::CommandOptionWithArg::numValue

Number of values in the values array.

Examples
cmdlineopt.cpp.

◆ values

const char** ost::CommandOptionWithArg::values

Array of list of values collected for this option.

Examples
cmdlineopt.cpp.

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