GTK+ IOStream  Beta
<< GTK+ >> add C++ IOStream operators to GTK+. Now with extra abilities ... like network serialisation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
OptionParser Class Reference

#include <OptionParser.H>

Public Member Functions

template<typename TYPE >
int getArg (string key, int argc, char *argv[], TYPE &ret, int i)
 
int getArgString (string key, int argc, char *argv[], string &ret, int i)
 

Detailed Description

Class to parse options from the command line.

Example option forms on the command line are :

binaryFile --opt=val -opt val

Definition at line 31 of file OptionParser.H.

Member Function Documentation

template<typename TYPE >
int OptionParser::getArg ( string  key,
int  argc,
char *  argv[],
TYPE ret,
int  i 
)
inline
Get the integer matching key from argc/argv
Parameters
keyThe option key to search for
argcThe option count
argvThe option array of c strings
ret[out] The value of the option matchin key, if found, then it is set to that value, otherwise left the same
ithe arg number to start from
Returns
the location of the argument, if == i then not found
Template Parameters
TYPEThe type of the output argument

Definition at line 43 of file OptionParser.H.

Here is the caller graph for this function:

int OptionParser::getArgString ( string  key,
int  argc,
char *  argv[],
string &  ret,
int  i 
)
inline
Get the string matching key from argc/argv
Parameters
keyThe option key to search for
argcThe option count
argvThe option array of c strings
ret[out] The integer value of the option matchin key, if found, then it is set to that value, otherwise left the same
ithe arg number to start from
Returns
The location of the new argument, if == i then not found

Definition at line 60 of file OptionParser.H.


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