38 #ifndef BLOCXX_CMD_LINE_PARSER_HPP_INCLUDE_GUARD_ 39 #define BLOCXX_CMD_LINE_PARSER_HPP_INCLUDE_GUARD_ 40 #include "blocxx/BLOCXX_config.h" 90 E_NON_OPTION_ARGS_INVALID
112 String getOptionValue(
int id,
const char* defaultValue =
"")
const;
125 String mustGetOptionValue(
int id,
const char* exceptionMessage =
"")
const;
144 StringArray mustGetOptionValueList(
int id,
const char* exceptionMessage =
"")
const;
149 bool isSet(
int id)
const;
154 size_t getNonOptionCount ()
const;
160 String getNonOptionArg(
size_t n)
const;
185 static String getUsage(
const Option* options,
unsigned int maxColumns = 80);
191 #pragma warning (push) 192 #pragma warning (disable: 4251) 201 #pragma warning (pop)
char shortopt
short option char. Set to '\0' for none.
const char * longopt
long option string. Set to 0 for none.
int id
unique option id, used to retrieve option values
optionsMap_t m_parsedOptions
This String class is an abstract data type that represents as NULL terminated string of characters...
an option for which argtype == E_REQUIRED_ARG did not have an argument
a non-option argument was specified, but they are not allowed
StringArray m_nonOptionArgs
Non-option arguments are allowed.
an unknown option was specified
the option does not take an argument
SortedVectorMap< int, StringArray > optionsMap_t
const char * description
description used by getUsage(). May be 0.
#define BLOCXX_DECLARE_APIEXCEPTION(NAME, LINKAGE_SPEC)
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typical...
const char * defaultValue
if argtype == E_OPTIONAL_ARG and no argument is specified, this value will be returned. Set to 0 for none.
EArgumentTypeFlag argtype
specifies constraints for the option's argument
the option requires an argument