#include <optparse.h>
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) |
int Parser::parse | ( | int | p_argc, | |
TCHAR ** | p_argv, | |||
Options & | p_opts | |||
) |
Parse command line arguments given in the classical form of (argc, argv).
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 |
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.
p_cmdLine | Commandline string | |
p_opts | Options class containing the expected options |
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