72 void Add(ValueType t,
const char* pLabel,
void *pAddress,
const char* pDocMsg = NULL);
76 void Print(ValueType type,
void* pAddress);
80 void Parse(
const char *plabel,
const char *pvalue);
90 int Parse(
int argc,
char **argv);
100 int Parse(
const char *optfile);
bool m_bMustCommand
setting 'true' means that, report error when no option input.
Array< char * > m_allocedBufs
if read from file, we may need to allocate memory for string.
const char * pDocMsg
value usage docment
void Parse(const char *plabel, const char *pvalue)
parse a single option, "pvalue" can be NULL
void PrintValue()
output values
a definition of a class Log, which can output to the cmd window and the log file simultaneously. In wb-log.cpp, there are a Log variable "lout", which can be directly used just like "cout". For example:
Provide the toolkits for cmd window of window platform.
string m_strOtherHelp
extra help information, which will be output in PrintUsage
void PrintUsage()
output usage
bool m_bOutputValues
if output value after get options from the command line or file
const char * pLabel
label content. Donot stroe the flag "-"
void Add(ValueType t, const char *pLabel, void *pAddress, const char *pDocMsg=NULL)
Add a option.
Array< Opt_Struct > m_opts
all the options
void Print(ValueType type, void *pAddress)
output a value
ValueType
define the value type
define all the code written by Bin Wang.
Get the option from command line or command files.
void * pAddress
value memory address
Defination of simple dynamic array/stack/queue and so on.