This class parse command line arguments with the ability to override them from a PConfig file/registry.
More...
|
|
| PConfigArgs (const PArgList &args) |
|
| ~PConfigArgs () |
|
|
virtual PINDEX | GetOptionCount (char optionChar) const |
| Get the count of the number of times the option was specified on the command line. More...
|
|
virtual PINDEX | GetOptionCount (const char *optionStr) const |
| Get the count of option. More...
|
|
virtual PINDEX | GetOptionCount (const PString &optionName) const |
| Get the count of option. More...
|
|
virtual PString | GetOptionString (char optionChar, const char *dflt=NULL) const |
| Get option string. More...
|
|
virtual PString | GetOptionString (const char *optionStr, const char *dflt=NULL) const |
| Get option string. More...
|
|
virtual PString | GetOptionString (const PString &optionName, const char *dflt=NULL) const |
| Get option string. More...
|
|
void | Save (const PString &optionName) |
| Save the current options to the PConfig. More...
|
|
void | SetSectionName (const PString §ion) |
| Set the PConfig section name for options. More...
|
|
const PString & | GetSectionName () const |
| Get the PConfig section name for options. More...
|
|
void | SetNegationPrefix (const PString &prefix) |
| Set the prefix for option negation. More...
|
|
const PString & | GetNegationPrefix () const |
| Get the prefix for option negation. More...
|
|
| PArgList (const char *theArgPtr=NULL, const char *argumentSpecPtr=NULL, PBoolean optionsBeforeParams=true) |
| Create an argument list. More...
|
|
| PArgList (const PString &theArgStr, const char *argumentSpecPtr=NULL, PBoolean optionsBeforeParams=true) |
| Create an argument list. More...
|
|
| PArgList (const PString &theArgStr, const PString &argumentSpecStr, PBoolean optionsBeforeParams=true) |
| Create an argument list. More...
|
|
| PArgList (int theArgc, char **theArgv, const char *argumentSpecPtr=NULL, PBoolean optionsBeforeParams=true) |
| Create an argument list. More...
|
|
| PArgList (int theArgc, char **theArgv, const PString &argumentSpecStr, PBoolean optionsBeforeParams=true) |
| Create an argument list. More...
|
|
virtual void | PrintOn (ostream &strm) const |
| Output the string to the specified stream. More...
|
|
virtual void | ReadFrom (istream &strm) |
| Input the string from the specified stream. More...
|
|
void | SetArgs (const PString &theArgStr) |
| Set the internal copy of the program arguments. More...
|
|
void | SetArgs (const char *theArgStr) |
|
void | SetArgs (int theArgc, char **theArgv) |
| Set the internal copy of the program arguments. More...
|
|
void | SetArgs (const PStringArray &theArgs) |
| Set the internal copy of the program arguments. More...
|
|
void | SetCommandName (const PString &name) |
| Set the comand name. More...
|
|
const PString & | GetCommandName () const |
| Get the command name. More...
|
|
virtual bool | Parse (const char *theArgumentSpec=NULL, PBoolean optionsBeforeParams=true) |
| Parse the arguments. More...
|
|
virtual bool | Parse (const PString &theArgumentStr, PBoolean optionsBeforeParams=true) |
| Parse the arguments. More...
|
|
bool | IsParsed () const |
| Determine if already parsed at least once. More...
|
|
const PString & | GetParseError () const |
| Return error message after a call to Parse(). More...
|
|
ostream & | Usage (ostream &strm, const char *usage=NULL, const char *prefix="Usage: ") const |
| Output usage text for parsed arguments. More...
|
|
PString | Usage (const char *usage=NULL, const char *prefix="Usage: ") const |
|
PBoolean | HasOption (char optionChar) const |
| Get if option present. More...
|
|
PBoolean | HasOption (const char *optionStr) const |
| Get if option present. More...
|
|
PBoolean | HasOption (const PString &optionName) const |
| Get if option present. More...
|
|
template<typename ValueType , typename OptionType > |
ValueType | GetOptionAs (OptionType option, ValueType value=0) const |
| Get option as specicied type. More...
|
|
PINDEX | GetCount () const |
| Get the argument count. More...
|
|
PStringArray | GetParameters (PINDEX first=0, PINDEX last=P_MAX_INDEX) const |
| Get the parameters that were parsed in the argument list. More...
|
|
PString | GetParameter (PINDEX num) const |
| Get the parameter that was parsed in the argument list. More...
|
|
PString | operator[] (PINDEX num) const |
| Get the parameter that was parsed in the argument list. More...
|
|
void | Shift (int sh) |
| Shift the parameters by the specified amount. More...
|
|
PArgList & | operator<< (int sh) |
| Shift the parameters by the specified amount. More...
|
|
PArgList & | operator>> (int sh) |
| Shift the parameters by the specified amount. More...
|
|
unsigned | GetTraceContextIdentifier () const |
| Get PTRACE context identifier. More...
|
|
void | SetTraceContextIdentifier (unsigned id) |
|
void | GetTraceContextIdentifier (PObject &obj) |
|
void | GetTraceContextIdentifier (PObject *obj) |
|
void | SetTraceContextIdentifier (const PObject &obj) |
|
void | SetTraceContextIdentifier (const PObject *obj) |
|
virtual | ~PObject () |
|
virtual PObject * | Clone () const |
| Create a copy of the class on the heap. More...
|
|
template<class CLS > |
CLS * | CloneAs () const |
| As for Clone() but converts to specified type. More...
|
|
virtual PINDEX | HashFunction () const |
| This function yields a hash value required by the PDictionary class. More...
|
|
virtual Comparison | Compare (const PObject &obj) const |
| Compare the two objects and return their relative rank. More...
|
|
virtual Comparison | CompareObjectMemoryDirect (const PObject &obj) const |
| Determine the byte wise comparison of two objects. More...
|
|
bool | operator== (const PObject &obj) const |
| Compare the two objects. More...
|
|
bool | operator!= (const PObject &obj) const |
| Compare the two objects. More...
|
|
bool | operator< (const PObject &obj) const |
| Compare the two objects. More...
|
|
bool | operator> (const PObject &obj) const |
| Compare the two objects. More...
|
|
bool | operator<= (const PObject &obj) const |
| Compare the two objects. More...
|
|
bool | operator>= (const PObject &obj) const |
| Compare the two objects. More...
|
|
virtual const char * | GetClass (unsigned ancestor=0) const |
| Get the current dynamic type of the object instance. More...
|
|
PBoolean | IsClass (const char *cls) const |
|
virtual PBoolean | InternalIsDescendant (const char *clsName) const |
| Determine if the dynamic type of the current instance is a descendent of the specified class. More...
|
|
__inline const PObject * | PTraceObjectInstance () const |
|
virtual void | PrintOn (ostream &strm) const |
| Output the contents of the object to the stream. More...
|
|
virtual void | ReadFrom (istream &strm) |
| Input the contents of the object from the stream. More...
|
|
This class parse command line arguments with the ability to override them from a PConfig file/registry.