Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ost_commandoptionparse(3) [debian man page]

ost::CommandOptionParse(3)				     Library Functions Manual					ost::CommandOptionParse(3)

NAME
ost::CommandOptionParse - This is the CommandOptionParse interface class. SYNOPSIS
#include <cmdoptns.h> Public Member Functions virtual ~CommandOptionParse ()=0 Virtual destructor needed so that the object may be correctly deleted. virtual bool argsHaveError ()=0 Get the value of the error flag set if the parser encountered errors. virtual const char * printErrors ()=0 Return a string of text describing the list of errors encountered. virtual const char * printUsage ()=0 Return a string that contains the usage description of this list of paramaters. virtual void registerError (const char *errMsg)=0 Register an error with this parser. virtual void performTask ()=0 The method should be invoked by the main code once it has determined that the application should be started. Detailed Description This is the CommandOptionParse interface class. To implement this object you can call makeCommandOptionParse(); This will instantiate a dynamically allocated version of this class and parse the command line for the list of command options that are passed in. Author: Gianni Mariani gianni@mariani.ws Examples: cmdlineopt.cpp. Constructor &; Destructor Documentation virtual ost::CommandOptionParse::~CommandOptionParse () [pure virtual] Virtual destructor needed so that the object may be correctly deleted. Member Function Documentation virtual bool ost::CommandOptionParse::argsHaveError () [pure virtual] Get the value of the error flag set if the parser encountered errors. Examples: cmdlineopt.cpp. virtual void ost::CommandOptionParse::performTask () [pure virtual] The method should be invoked by the main code once it has determined that the application should be started. Examples: cmdlineopt.cpp. virtual const char* ost::CommandOptionParse::printErrors () [pure virtual] Return a string of text describing the list of errors encountered. Examples: cmdlineopt.cpp. virtual const char* ost::CommandOptionParse::printUsage () [pure virtual] Return a string that contains the usage description of this list of paramaters. Examples: cmdlineopt.cpp. virtual void ost::CommandOptionParse::registerError (const char *errMsg) [pure virtual] Register an error with this parser. This string will be appended to the errors already buffered in this object. Examples: cmdlineopt.cpp. Author Generated automatically by Doxygen for GNU CommonC++ from the source code. GNU CommonC++ Sat Jun 23 2012 ost::CommandOptionParse(3)

Check Out this Related Man Page

ost::CommandOption(3)					     Library Functions Manual					     ost::CommandOption(3)

NAME
ost::CommandOption - CommandOption is the base class for all command line options. SYNOPSIS
#include <cmdoptns.h> Inherited by ost::CommandOptionNoArg, and ost::CommandOptionWithArg. Public Types 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. Public Member Functions virtual ~CommandOption () A virtual destructor just in case. CommandOption (const char *inOptionName, const char *inOptionLetter, const char *inDescription, OptionType inOptionType, bool inRequired=false, CommandOption **ppNext=&defaultCommandOptionList) CommandOption contructor. virtual void foundOption (CommandOptionParse *cop, const char *value=0) foundOption is called by the CommandOptionParse object during the parsing of the command line options. virtual void foundOption (CommandOptionParse *cop, const char **value, int num) foundOption is called by the CommandOptionParse object during the parsing of the command line options. virtual void parseDone (CommandOptionParse *cop) Once parsing of command line options is complete, this method is called. virtual void performTask (CommandOptionParse *cop) Once CommandOption objects have completed parsing and there are no errors they may have some specific tasks to perform. virtual bool hasValue () For fields with the required flag set, this method is used to determine if the Option has satisfied it's required status. Public Attributes const char * optionName Long option name, these will be preceded with '--' on the command line. const char * optionLetter option letter, these will be preceded with '-' on the command line. const char * description A short description of the option for Usage messages. OptionType optionType This command option's OptionType. bool required True if this parameter is required. CommandOption * next This next CommandOption in this list of options or nil if no more options exist. Detailed Description CommandOption is the base class for all command line options. Command line options can be defined statically and used when constructing a command line parser onject using makeCommandOptionParse. This serves only as a base class to CommandOptionWithArg, CommandOptionRest or CommandOptionNoArg which can also be used to derive more complex classes or even entire applications. Author: Gianni Mariani gianni@mariani.ws Examples: cmdlineopt.cpp. Member Enumeration Documentation enum ost::CommandOption::OptionType OptionType is for denoting what type of option this is, with an arg, without an arg or the trailing args. Option type Enumerator: hasArg This option is associated with a value. noArg This option is a flag only. trailing Remaining of the command line arguments. collect Collect values that are not a value to an option. Constructor &; Destructor Documentation virtual ost::CommandOption::~CommandOption () [virtual] A virtual destructor just in case. ost::CommandOption::CommandOption (const char *inOptionName, const char *inOptionLetter, const char *inDescription, OptionTypeinOptionType, boolinRequired = false, CommandOption **ppNext = &defaultCommandOptionList) CommandOption contructor. Note the default values for required and ppNext. Parameters: inOptionName long option name inOptionLetter short letter name inDescription short description of the option inOptionType the type of this option inRequired true if option is required ppNext the linked list header Member Function Documentation virtual void ost::CommandOption::foundOption (CommandOptionParse *cop, const char *value = 0) [virtual] foundOption is called by the CommandOptionParse object during the parsing of the command line options. Parameters: cop pointer to the command option parser value the value of this option Reimplemented in ost::CommandOptionNoArg, and ost::CommandOptionWithArg. virtual void ost::CommandOption::foundOption (CommandOptionParse *cop, const char **value, intnum) [virtual] foundOption is called by the CommandOptionParse object during the parsing of the command line options. Parameters: cop pointer to the command option parser value an array of values of this option num number of values in the array Reimplemented in ost::CommandOptionWithArg. virtual bool ost::CommandOption::hasValue () [virtual] For fields with the required flag set, this method is used to determine if the Option has satisfied it's required status. The default methods simply returns true if any values have been found. This could be specialized to return true based on some other criteria. Reimplemented in ost::CommandOptionWithArg. virtual void ost::CommandOption::parseDone (CommandOptionParse *cop) [virtual] Once parsing of command line options is complete, this method is called. This can be used to perform last minute checks on the options collected. Parameters: cop pointer to the command option parser virtual void ost::CommandOption::performTask (CommandOptionParse *cop) [virtual] Once CommandOption objects have completed parsing and there are no errors they may have some specific tasks to perform. PerformTask must return. Parameters: cop pointer to the command option parser Member Data Documentation const char* ost::CommandOption::description A short description of the option for Usage messages. e.g. Usage: mycommand : blah -f, --file <DESCRIPTION here> CommandOption* ost::CommandOption::next This next CommandOption in this list of options or nil if no more options exist. const char* ost::CommandOption::optionLetter option letter, these will be preceded with '-' on the command line. e.g. -f foo.x const char* ost::CommandOption::optionName Long option name, these will be preceded with '--' on the command line. e.g. --file foo.x OptionType ost::CommandOption::optionType This command option's OptionType. bool ost::CommandOption::required True if this parameter is required. If the parameter is not supplied and required is true, an error will be flagged in the option processor. Author Generated automatically by Doxygen for GNU CommonC++ from the source code. GNU CommonC++ Sat Jun 23 2012 ost::CommandOption(3)
Man Page