34 #ifndef PTLIB_ARGLIST_H
35 #define PTLIB_ARGLIST_H
63 const char * theArgPtr = NULL,
64 const char * argumentSpecPtr = NULL,
70 const char * argumentSpecPtr = NULL,
76 const PString & argumentSpecStr,
83 const char * argumentSpecPtr = NULL,
90 const PString & argumentSpecStr,
151 const char * theArgumentSpec,
156 const PString & theArgumentStr,
173 const char * optionStr
190 const char * optionStr
207 const char * dflt = NULL
211 const char * optionStr,
212 const char * dflt = NULL
217 const char * dflt = NULL
235 PINDEX last = P_MAX_INDEX
322 PBoolean ParseOption(PINDEX idx, PINDEX offset, PINDEX & arg,
const PIntArray & canHaveOptionString);
323 PINDEX GetOptionCountByIndex(PINDEX idx)
const;
324 PString GetOptionStringByIndex(PINDEX idx,
const char * dflt)
const;
357 const char * optionStr
374 const char * dflt = NULL
379 const char * optionStr,
380 const char * dflt = NULL
386 const char * dflt = NULL
433 #endif // P_CONFIG_FILE
436 #endif // PTLIB_ARGLIST_H
PIntArray parameterIndex
The index of each .
Definition: args.h:317
void SetArgs(const PString &theArgStr)
Set the internal copy of the program arguments.
virtual void UnknownOption(const PString &option) const
This function is called when an unknown option was specified on the command line. ...
PString operator[](PINDEX num) const
Get the parameter that was parsed in the argument list.
PStringArray optionString
The array of associated strings to options.
Definition: args.h:315
int shift
Shift count for the parameters in the argument list.
Definition: args.h:319
virtual PINDEX GetOptionCount(char optionChar) const
Get the count of the number of times the option was specified on the command line.
PStringArray GetParameters(PINDEX first=0, PINDEX last=P_MAX_INDEX) const
Get the parameters that were parsed in the argument list.
PArgList(const char *theArgPtr=NULL, const char *argumentSpecPtr=NULL, PBoolean optionsBeforeParams=true)
Create an argument list.
PArgList & operator>>(int sh)
Shift the parameters by the specified amount.
PConfigArgs(const PArgList &args)
A class representing a configuration for the application.
Definition: config.h:67
PString GetParameter(PINDEX num) const
Get the parameter that was parsed in the argument list.
PString negationPrefix
Definition: args.h:430
PArgList & operator<<(int sh)
Shift the parameters by the specified amount.
void Save(const PString &optionName)
Save the current options to the PConfig.
This is an array collection class of PString objects.
Definition: pstring.h:2024
const PString & GetNegationPrefix() const
Get the prefix for option negation.
Definition: args.h:422
void SetSectionName(const PString §ion)
Set the PConfig section name for options.
Definition: args.h:404
BOOL PBoolean
Definition: object.h:102
PBoolean HasOption(char optionChar) const
Get if option present.
PString CharToString(char ch) const
void SetNegationPrefix(const PString &prefix)
Set the prefix for option negation.
Definition: args.h:415
PString optionLetters
The specification letters for options.
Definition: args.h:309
PStringArray optionNames
The specification strings for options.
Definition: args.h:311
virtual PBoolean Parse(const char *theArgumentSpec, PBoolean optionsBeforeParams=true)
Parse the arguments.
virtual PString GetOptionString(char optionChar, const char *dflt=NULL) const
Get option string.
This class parse command line arguments with the ability to override them from a PConfig file/registr...
Definition: args.h:334
virtual void ReadFrom(istream &strm)
Input the string from the specified stream.
The character string class.
Definition: pstring.h:108
virtual PINDEX GetOptionCount(char optionChar) const
Get the count of the number of times the option was specified on the command line.
This class allows the parsing of a set of program arguments.
Definition: args.h:45
PIntArray optionCount
The count of the number of times an option appeared in the command line.
Definition: args.h:313
PStringArray argumentArray
The original program arguments.
Definition: args.h:307
virtual void PrintOn(ostream &strm) const
Output the string to the specified stream.
const PString & GetSectionName() const
Get the PConfig section name for options.
Definition: args.h:410
PConfig config
Definition: args.h:428
virtual void IllegalArgumentIndex(PINDEX idx) const
This function is called when access to illegal parameter index is made in the GetParameter function...
PString sectionName
Definition: args.h:429
PINDEX GetCount() const
Get the argument count.
Array of integers.
Definition: array.h:616
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
virtual void MissingArgument(const PString &option) const
This function is called when an option that requires an associated string was specified on the comman...
virtual PString GetOptionString(char optionChar, const char *dflt=NULL) const
Get option string.
void Shift(int sh)
Shift the parameters by the specified amount.