gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
OptionParser Class Reference

#include <OptionParser.H>

Public Member Functions

template<typename TYPE >
int getArg (string key, int argc, char *argv[], TYPE &ret, int i)
 
template<typename TYPE >
void convertArg (const char *arg, TYPE &ret)
 
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
Examples:
IIOMMapTest.C, IIOQueueTest.C, IIOTest.C, OptionParserTest.C, and ORBTest.C.

Definition at line 31 of file OptionParser.H.

Member Function Documentation

◆ convertArg()

template<typename TYPE >
void OptionParser::convertArg ( const char *  arg,
TYPE &  ret 
)
inline

Get the integer matching key from argc/argv

Parameters
argThe argument to convert
ret[out] The value of the arg typecase to TYPE
Template Parameters
TYPEThe type of the output argument

Definition at line 58 of file OptionParser.H.

Here is the caller graph for this function:

◆ getArg()

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 matching 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
Examples:
IIOMMapTest.C, IIOQueueTest.C, IIOTest.C, OptionParserTest.C, and ORBTest.C.

Definition at line 43 of file OptionParser.H.

Here is the caller graph for this function:

◆ getArgString()

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 72 of file OptionParser.H.


The documentation for this class was generated from the following file:
gtkIOStream: OptionParser Class Reference
GTK+ IOStream  Beta