Parser Class Reference

Parser class. More...

#include <optparse.h>

List of all members.

Public Member Functions

int parse (int p_argc, TCHAR **p_argv, Options &p_opts)
int parse (const TCHAR *p_cmdLine, Options &p_opts)
void setFlags (int p_flags)


Detailed Description

Parser class.


Member Function Documentation

int Parser::parse ( int  p_argc,
TCHAR **  p_argv,
Options p_opts 
)

Parse command line arguments given in the classical form of (argc, argv).

Parameters:
p_argc Number of arguments including program name (argv[0])
p_argv Array of TCHAR* containing the arguments
p_opts Options class containing the expected options
Warning:
Can return bitmasked answer!
Returns:
E_OK if the parsing was successfull and all required options and args were ok

E_OPT_UNKNOWN if the given option was not known

E_ERROR if the option was empty or invalid somehow (e.g. "--=asd" or argument given if not expected)

E_ARG_EXPECTED if the option needs an argument and none given (e.g --start instead of --start=now)

E_ARG_INVALID if one of the options with argument validators wasn't validated :)

int Parser::parse ( const TCHAR *  p_cmdLine,
Options p_opts 
)

Parse command line arguments given in the windows GetCommandLine() form.

Parameters:
p_cmdLine Commandline string
p_opts Options class containing the expected options
Warning:
Can return bitmasked answer!
Returns:
E_OK if the parsing was successfull and all required options and args were ok

E_OPT_UNKNOWN if the given option was not known

E_ERROR if the option was empty or invalid somehow (e.g. "--=asd" or argument given if not expected)

E_ARG_EXPECTED if the option needs an argument and none given (e.g --start instead of --start=now)

E_ARG_INVALID if one of the options with argument validators wasn't validated :)

void Parser::setFlags ( int  p_flags  ) 

Sets flags for the parser


The documentation for this class was generated from the following files:
Generated on Mon Feb 19 21:12:26 2007 for OptParse by  doxygen 1.5.1-p1