Gizmo3D

gzArgumentParser Class Reference

Parse arguments from main() or from a given string. More...

#include <gzLex.h>

List of all members.

Public Member Functions

 gzArgumentParser (int argc, char *argv[], const gzString &optionPrefix="-")
 Used to create the gzArgumentParser from the parameters given in main(argc,argv).
 gzArgumentParser (const gzString &argString, const gzString &optionPrefix="-")
 Used to create the gzArgumentParser from a given generic string.
virtual ~gzArgumentParser ()
 Destructor.
gzVoid setArgumentString (const gzString &argString, const gzString &optionPrefix="-")
 Used to parse a new given string.
gzULong getOptionCount () const
 Get number of options.
gzBool hasOption (const gzString &option, gzBool caseSensitive=FALSE, gzULong *argument=NULL, gzULong *maxArgument=NULL) const
 Check if option is present.
gzBool getOptionValue (const gzString &option, const gzBool &defaultValue, gzULong argument=0, gzBool useDefault=TRUE, gzBool caseSensitive=FALSE) const
gzByte getOptionValue (const gzString &option, const gzByte &defaultValue, gzULong argument=0, gzBool useDefault=TRUE, gzBool caseSensitive=FALSE) const
gzUShort getOptionValue (const gzString &option, const gzUShort &defaultValue, gzULong argument=0, gzBool useDefault=TRUE, gzBool caseSensitive=FALSE) const
gzShort getOptionValue (const gzString &option, const gzShort &defaultValue, gzULong argument=0, gzBool useDefault=TRUE, gzBool caseSensitive=FALSE) const
gzUInt getOptionValue (const gzString &option, const gzUInt &defaultValue, gzULong argument=0, gzBool useDefault=TRUE, gzBool caseSensitive=FALSE) const
gzInt getOptionValue (const gzString &option, const gzInt &defaultValue, gzULong argument=0, gzBool useDefault=TRUE, gzBool caseSensitive=FALSE) const
gzULong getOptionValue (const gzString &option, const gzULong &defaultValue, gzULong argument=0, gzBool useDefault=TRUE, gzBool caseSensitive=FALSE) const
gzLong getOptionValue (const gzString &option, const gzLong &defaultValue, gzULong argument=0, gzBool useDefault=TRUE, gzBool caseSensitive=FALSE) const
gzLongLong getOptionValue (const gzString &option, const gzLongLong &defaultValue, gzULong argument=0, gzBool useDefault=TRUE, gzBool caseSensitive=FALSE) const
gzULongLong getOptionValue (const gzString &option, const gzULongLong &defaultValue, gzULong argument=0, gzBool useDefault=TRUE, gzBool caseSensitive=FALSE) const
gzDouble getOptionValue (const gzString &option, const gzDouble &defaultValue, gzULong argument=0, gzBool useDefault=TRUE, gzBool caseSensitive=FALSE) const
gzString getOptionValue (const gzString &option, const gzString &defaultValue, gzULong argument=0, gzBool useDefault=TRUE, gzBool caseSensitive=FALSE) const
gzString getOptionString (const gzString &option, gzBool caseSensitive=FALSE) const
gzULong getArgumentCount (gzBool notUsedForOption=TRUE) const
gzString getArgument (gzULong argpos, gzBool notUsedForOption=TRUE) const
gzBool getArgumentValue (gzULong argpos, const gzBool &defaultValue) const
gzByte getArgumentValue (gzULong argpos, const gzByte &defaultValue) const
gzUShort getArgumentValue (gzULong argpos, const gzUShort &defaultValue) const
gzShort getArgumentValue (gzULong argpos, const gzShort &defaultValue) const
gzUInt getArgumentValue (gzULong argpos, const gzUInt &defaultValue) const
gzInt getArgumentValue (gzULong argpos, const gzInt &defaultValue) const
gzULong getArgumentValue (gzULong argpos, const gzULong &defaultValue) const
gzLong getArgumentValue (gzULong argpos, const gzLong &defaultValue) const
gzLongLong getArgumentValue (gzULong argpos, const gzLongLong &defaultValue) const
gzULongLong getArgumentValue (gzULong argpos, const gzULongLong &defaultValue) const
gzDouble getArgumentValue (gzULong argpos, const gzDouble &defaultValue) const
gzString getArgumentValue (gzULong argpos, const gzString &defaultValue) const
gzVoid exitOnError (gzBool on=TRUE)
gzBool hasError () const
gzString getError () const
gzVoid setSyntaxString (const gzString &syntax)
gzVoid checkArgumentCount (gzULong required)

Classes

class  gzArgArgument
class  gzArgOption


Detailed Description

Parse arguments from main() or from a given string.
Examples:

billboard.cpp, and dbviewer.cpp.

Definition at line 283 of file gzLex.h.


Constructor & Destructor Documentation

gzArgumentParser::gzArgumentParser int  argc,
char *  argv[],
const gzString optionPrefix = "-"
 

Used to create the gzArgumentParser from the parameters given in main(argc,argv).

gzArgumentParser::gzArgumentParser const gzString argString,
const gzString optionPrefix = "-"
 

Used to create the gzArgumentParser from a given generic string.

virtual gzArgumentParser::~gzArgumentParser  )  [virtual]
 

Destructor.


Member Function Documentation

gzVoid gzArgumentParser::checkArgumentCount gzULong  required  ) 
 

gzVoid gzArgumentParser::exitOnError gzBool  on = TRUE  ) 
 

gzString gzArgumentParser::getArgument gzULong  argpos,
gzBool  notUsedForOption = TRUE
const
 

gzULong gzArgumentParser::getArgumentCount gzBool  notUsedForOption = TRUE  )  const
 

gzString gzArgumentParser::getArgumentValue gzULong  argpos,
const gzString defaultValue
const
 

gzDouble gzArgumentParser::getArgumentValue gzULong  argpos,
const gzDouble defaultValue
const
 

gzULongLong gzArgumentParser::getArgumentValue gzULong  argpos,
const gzULongLong defaultValue
const
 

gzLongLong gzArgumentParser::getArgumentValue gzULong  argpos,
const gzLongLong defaultValue
const
 

gzLong gzArgumentParser::getArgumentValue gzULong  argpos,
const gzLong defaultValue
const
 

gzULong gzArgumentParser::getArgumentValue gzULong  argpos,
const gzULong defaultValue
const
 

gzInt gzArgumentParser::getArgumentValue gzULong  argpos,
const gzInt defaultValue
const
 

gzUInt gzArgumentParser::getArgumentValue gzULong  argpos,
const gzUInt defaultValue
const
 

gzShort gzArgumentParser::getArgumentValue gzULong  argpos,
const gzShort defaultValue
const
 

gzUShort gzArgumentParser::getArgumentValue gzULong  argpos,
const gzUShort defaultValue
const
 

gzByte gzArgumentParser::getArgumentValue gzULong  argpos,
const gzByte defaultValue
const
 

gzBool gzArgumentParser::getArgumentValue gzULong  argpos,
const gzBool defaultValue
const
 

gzString gzArgumentParser::getError  )  const
 

gzULong gzArgumentParser::getOptionCount  )  const
 

Get number of options.

Returns:
the number of given options. An option is a string preceeded by the optionPrefix normally set to -

gzString gzArgumentParser::getOptionString const gzString option,
gzBool  caseSensitive = FALSE
const
 

gzString gzArgumentParser::getOptionValue const gzString option,
const gzString defaultValue,
gzULong  argument = 0,
gzBool  useDefault = TRUE,
gzBool  caseSensitive = FALSE
const
 

gzDouble gzArgumentParser::getOptionValue const gzString option,
const gzDouble defaultValue,
gzULong  argument = 0,
gzBool  useDefault = TRUE,
gzBool  caseSensitive = FALSE
const
 

gzULongLong gzArgumentParser::getOptionValue const gzString option,
const gzULongLong defaultValue,
gzULong  argument = 0,
gzBool  useDefault = TRUE,
gzBool  caseSensitive = FALSE
const
 

gzLongLong gzArgumentParser::getOptionValue const gzString option,
const gzLongLong defaultValue,
gzULong  argument = 0,
gzBool  useDefault = TRUE,
gzBool  caseSensitive = FALSE
const
 

gzLong gzArgumentParser::getOptionValue const gzString option,
const gzLong defaultValue,
gzULong  argument = 0,
gzBool  useDefault = TRUE,
gzBool  caseSensitive = FALSE
const
 

gzULong gzArgumentParser::getOptionValue const gzString option,
const gzULong defaultValue,
gzULong  argument = 0,
gzBool  useDefault = TRUE,
gzBool  caseSensitive = FALSE
const
 

gzInt gzArgumentParser::getOptionValue const gzString option,
const gzInt defaultValue,
gzULong  argument = 0,
gzBool  useDefault = TRUE,
gzBool  caseSensitive = FALSE
const
 

gzUInt gzArgumentParser::getOptionValue const gzString option,
const gzUInt defaultValue,
gzULong  argument = 0,
gzBool  useDefault = TRUE,
gzBool  caseSensitive = FALSE
const
 

gzShort gzArgumentParser::getOptionValue const gzString option,
const gzShort defaultValue,
gzULong  argument = 0,
gzBool  useDefault = TRUE,
gzBool  caseSensitive = FALSE
const
 

gzUShort gzArgumentParser::getOptionValue const gzString option,
const gzUShort defaultValue,
gzULong  argument = 0,
gzBool  useDefault = TRUE,
gzBool  caseSensitive = FALSE
const
 

gzByte gzArgumentParser::getOptionValue const gzString option,
const gzByte defaultValue,
gzULong  argument = 0,
gzBool  useDefault = TRUE,
gzBool  caseSensitive = FALSE
const
 

gzBool gzArgumentParser::getOptionValue const gzString option,
const gzBool defaultValue,
gzULong  argument = 0,
gzBool  useDefault = TRUE,
gzBool  caseSensitive = FALSE
const
 

gzBool gzArgumentParser::hasError  )  const
 

gzBool gzArgumentParser::hasOption const gzString option,
gzBool  caseSensitive = FALSE,
gzULong argument = NULL,
gzULong maxArgument = NULL
const
 

Check if option is present.

Returns:
TRUE if the option is present

gzVoid gzArgumentParser::setArgumentString const gzString argString,
const gzString optionPrefix = "-"
 

Used to parse a new given string.

gzVoid gzArgumentParser::setSyntaxString const gzString syntax  ) 
 


The documentation for this class was generated from the following file:
Documentation for Gizmo3D generated at Wed Feb 20 11:54:14 2008 by   Saab Training Systems AB, ¸ (c) 2003-and beyond