128 double lower,
double upper,
double dflt = 0.0,
136 int lower,
int upper,
int dflt = 0,
154 std::string firstValue,
int dflt,
bool display =
true) ;
165 std::string dflt,
bool display =
true) ;
201 int kwdIndex(std::string kwd)
const ;
206 std::string
kwdVal()
const ;
222 void setKwdVal(
const std::string value ) ;
236 std::string
strVal()
const ;
259 inline void setShortHelp(
const std::string help) { shortHelp_ = help ; }
263 inline std::string
shortHelp()
const {
return (shortHelp_) ; }
270 inline void setLongHelp(
const std::string help) { longHelp_ = help ; }
274 inline std::string
longHelp()
const {
return (longHelp_) ; }
293 inline CoinParamType
type()
const {
return (type_) ; }
301 inline std::string
name()
const {
return (name_) ; }
314 int matches (std::string input)
const ;
334 inline bool display()
const {
return (display_) ; }
366 CoinParamType type_ ;
378 size_t lengthMatch_ ;
381 double lowerDblValue_ ;
384 double upperDblValue_ ;
399 std::string strValue_ ;
402 std::vector<std::string> definedKwds_ ;
415 std::string shortHelp_ ;
418 std::string longHelp_ ;
472 std::string
getStringField(
int argc,
const char *argv[],
int *valid) ;
481 int getIntField(
int argc,
const char *argv[],
int *valid) ;
505 int &matchNdx,
int &shortCnt) ;
537 std::string
getCommand(
int argc,
const char *argv[],
538 const std::string prompt, std::string *pfx = 0) ;
578 int *matchCnt = 0,
int *shortCnt = 0,
int *queryCnt = 0) ;
587 void printIt(
const char *msg) ;
605 name,
int numQuery) ;
616 std::string name,
int numQuery) ;
int intVal() const
Get the value of a integer parameter.
CoinParam & operator=(const CoinParam &rhs)
Assignment.
CoinParamFunc pushFunc()
Get push function.
int(* CoinParamFunc)(CoinParam *param)
Type declaration for push and pull functions.
std::string shortHelp() const
Retrieve the short help string.
void shortOrHelpOne(CoinParamVec ¶mVec, int matchNdx, std::string name, int numQuery)
Utility routine to print help given a short match or explicit request for help.
void setDblVal(double value)
Set the value of a double parameter.
void printIt(const char *msg)
Utility to print a long message as filled lines of text.
void setIntVal(int value)
Set the value of a integer parameter.
double getDoubleField(int argc, const char *argv[], int *valid)
Attempt to read a real (double) from the input.
CoinParam()
Default constructor.
int kwdIndex(std::string kwd) const
Return the integer associated with the specified value-keyword.
void printLongHelp() const
Print long help.
A base class for `keyword value' command line parameters.
void printKwds() const
Prints the set of value-keywords defined for this keyword parameter.
std::string getStringField(int argc, const char *argv[], int *valid)
Attempt to read a string from the input.
void setLongHelp(const std::string help)
Add a long help message to a parameter.
void setPushFunc(CoinParamFunc func)
Set push function.
std::string name() const
Return the parameter keyword (name) string.
double dblVal() const
Get the value of a double parameter.
virtual CoinParam * clone()
Clone.
void setName(std::string name)
Set the parameter keyword (name) string.
Utility functions for processing CoinParam parameters.
std::string matchName() const
Return the parameter keyword (name) string formatted to show the minimum match length.
virtual ~CoinParam()
Destructor.
bool isInteractive()
Returns true if parameters are being obtained from stdin.
bool display() const
Get visibility of parameter.
CoinParamType
Enumeration for the types of parameters supported by CoinParam.
void setShortHelp(const std::string help)
Add a short help string to a parameter.
void printHelp(CoinParamVec ¶mVec, int firstParam, int lastParam, std::string prefix, bool shortHelp, bool longHelp, bool hidden)
Utility routine to print help messages for one or more parameters.
CoinParamFunc pullFunc()
Get pull function.
std::vector< CoinParam * > CoinParamVec
A type for a parameter vector.
CoinParamType type() const
Return the type of the parameter.
int getIntField(int argc, const char *argv[], int *valid)
Attempt to read an integer from the input.
void printGenericHelp()
Print a generic `how to use the command interface' help message.
std::string strVal() const
Get the value of a string parameter.
void setType(CoinParamType type)
Set the type of the parameter.
int lookupParam(std::string name, CoinParamVec ¶mVec, int *matchCnt=0, int *shortCnt=0, int *queryCnt=0)
Look up the command keyword (name) in the parameter vector. Print help if requested.
int matches(std::string input) const
Check if the specified string matches the parameter keyword (name) string.
int matchParam(const CoinParamVec ¶mVec, std::string name, int &matchNdx, int &shortCnt)
Scan a parameter vector for parameters whose keyword (name) string matches name using minimal match r...
void shortOrHelpMany(CoinParamVec ¶mVec, std::string name, int numQuery)
Utility routine to print help given multiple matches.
void setKwdVal(int value, bool printIt=false)
Set the value of the keyword parameter using the integer associated with a value-keyword.
void appendKwd(std::string kwd)
Add an additional value-keyword to a keyword parameter.
void setPullFunc(CoinParamFunc func)
Set pull function.
void setInputSrc(FILE *src)
Take command input from the file specified by src.
std::ostream & operator<<(std::ostream &s, const CoinParam ¶m)
A stream output function for a CoinParam object.
bool isCommandLine()
Returns true if command line parameters are being processed.
void setStrVal(std::string value)
Set the value of a string parameter.
std::string kwdVal() const
Return the value-keyword that is the current value of the keyword parameter.
std::string longHelp() const
Retrieve the long help message.
std::string getCommand(int argc, const char *argv[], const std::string prompt, std::string *pfx=0)
Get the next command keyword (name)
void setDisplay(bool display)
Set visibility of parameter.