#include <eoParser.h>
Inheritance diagram for eoParser:

Public Member Functions | |
| eoParser (unsigned _argc, char **_argv, std::string _programDescription="", std::string _lFileParamName="param-file", char _shortHand= 'p') | |
| Constructor a complete constructor that reads the command line an optionally reads a configuration file. | |
| void | processParam (eoParam ¶m, std::string section="") |
| Processes the parameter and puts it in the appropriate section for readability. | |
| void | readFrom (std::istream &is) |
| Read object. | |
| void | printOn (std::ostream &os) const |
| Write object. | |
| std::string | className (void) const |
| className for readibility | |
| bool | userNeedsHelp (void) |
| true if the user made an error or asked for help | |
| void | printHelp (std::ostream &os) |
| Prints an automatic help in the specified output using the information provided by parameters. | |
| std::string | ProgramName () |
| virtual bool | isItThere (eoParam &_param) const |
| Has param been entered by user? | |
| eoParam * | getParamWithLongName (const std::string &_name) const |
| get a handle on a param from its longName | |
| template<class ValueType> | |
| eoValueParam< ValueType > & | getORcreateParam (ValueType _defaultValue, std::string _longName, std::string _description, char _shortHand=0, std::string _section="", bool _required=false) |
| Get or create parameter. | |
| template<class ValueType> | |
| eoValueParam< ValueType > & | setORcreateParam (ValueType _defaultValue, std::string _longName, std::string _description, char _shortHand=0, std::string _section="", bool _required=false) |
| Set parameter value or create parameter. | |
| void | setStopOnUnknownParam (bool _b) |
| accessors to the stopOnUnknownParam value | |
| bool | getStopOnUnknownParam () |
| void | setPrefix (const std::string &_prefix) |
| Prefix handling. | |
| void | resetPrefix () |
| std::string | getPrefix () |
Private Types | |
|
typedef std::multimap< std::string, eoParam * > | MultiMapType |
| typedef std::map< char, std::string > | ShortNameMapType |
|
typedef std::map< std::string, std::string > | LongNameMapType |
Private Member Functions | |
| void | doRegisterParam (eoParam ¶m) const |
| std::pair< bool, std::string > | getValue (eoParam &_param) const |
| void | updateParameters () const |
Private Attributes | |
| MultiMapType | params |
| std::string | programName |
| std::string | programDescription |
| ShortNameMapType | shortNameMap |
| LongNameMapType | longNameMap |
| eoValueParam< bool > | needHelp |
| eoValueParam< bool > | stopOnUnknownParam |
| std::vector< std::string > | messages |
| std::string | prefix |
Definition at line 100 of file eoParser.h.
|
||||||||||||||||||||||||
|
Constructor a complete constructor that reads the command line an optionally reads a configuration file. myEo --param-file=param.rc will then load using the parameter file param.rc
|
|
|
Read object.
Implements eoPersistent. |
|
|
Write object. It's called printOn since it prints the object on a stream.
Implements eoPrintable. |
|
|
Has param been entered by user? Checks if _param has been actually entered by the user Implements eoParameterLoader. Definition at line 148 of file eoParser.h. Referenced by setORcreateParam(). |
|
|
get a handle on a param from its longName if not found, returns 0 (null pointer :-) Not very clean (requires hard-coding of the long name twice!) but very useful in many occasions... Referenced by getORcreateParam(). |
|
||||||||||||||||||||||||||||||||
|
Get or create parameter. It seems finally that the easiest use of the above method is through the following, whose interface is similar to that of the widely-used createParam. For some (probably very stupid) reason, I failed to put it in the .cpp. Any hint??? Definition at line 173 of file eoParser.h. References eoParameterLoader::createParam(), and getParamWithLongName(). |
|
||||||||||||||||||||||||||||||||
|
Set parameter value or create parameter. This makes sure that the specified parameter has the given value. If the parameter does not exist yet, it is created. This requires that operator<< is defined for ValueType.
Definition at line 211 of file eoParser.h. References eoParameterLoader::createParam(), isItThere(), and eoValueParam< ValueType >::setValue(). |
1.3.9.1