diff --git a/eo/src/utils/eoParser.cpp b/eo/src/utils/eoParser.cpp index 10a2bea4..d7a138d3 100644 --- a/eo/src/utils/eoParser.cpp +++ b/eo/src/utils/eoParser.cpp @@ -79,6 +79,26 @@ eoParser::eoParser ( unsigned _argc, char **_argv , string _programDescription, processParam(needHelp); } +/** + * 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... + */ +eoParam* eoParser::getParamWithLongName(std::string _name) +{ + typedef std::multimap MultiMapType; + typedef MultiMapType::const_iterator It; + for (It p = params.begin(); p != params.end(); ++p) + { + if (p->second->longName() == _name) + return p->second; + } + return 0; +} + void eoParser::processParam(eoParam& param, std::string section) { doRegisterParam(param); // plainly register it diff --git a/eo/src/utils/eoParser.h b/eo/src/utils/eoParser.h index f95956de..52ef152b 100644 --- a/eo/src/utils/eoParser.h +++ b/eo/src/utils/eoParser.h @@ -24,7 +24,7 @@ */ //----------------------------------------------------------------------------- /** -CVS Info: $Date: 2001-04-10 15:08:09 $ $Version$ $Author: evomarc $ +CVS Info: $Date: 2001-11-05 16:38:51 $ $Version$ $Author: evomarc $ */ #ifndef eoParser_h #define eoParser_h @@ -149,6 +149,16 @@ public: virtual bool isItThere(eoParam& _param) const { return getValue(_param).first; } +/** + * 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... + */ + eoParam* getParamWithLongName(std::string _name); + private: void doRegisterParam(eoParam& param) const;