diff --git a/eo/src/eoFunctorStore.cpp b/eo/src/eoFunctorStore.cpp index cb8d1a57..43cd778c 100644 --- a/eo/src/eoFunctorStore.cpp +++ b/eo/src/eoFunctorStore.cpp @@ -3,6 +3,8 @@ #pragma warning(disable:4786) #endif +#include + #include #include @@ -10,7 +12,7 @@ /// clears the memory eoFunctorStore::~eoFunctorStore() { - for(size_t i = 0; i < vec.size(); ++i) { + for( std::size_t i = 0; i < vec.size(); ++i) { delete vec[i]; } } diff --git a/eo/src/utils/eoParser.cpp b/eo/src/utils/eoParser.cpp index 97c4b3d5..e97a2a2e 100644 --- a/eo/src/utils/eoParser.cpp +++ b/eo/src/utils/eoParser.cpp @@ -35,16 +35,11 @@ #include #include - #include +#include using namespace std; -void eoWarning(std::string str) -{ - cout << str << '\n'; -} - std::ostream& printSectionHeader(std::ostream& os, std::string section) { if (section == "") @@ -117,6 +112,11 @@ eoParser::eoParser ( unsigned _argc, char **_argv , string _programDescription, } +std::string eoParser::get( const std::string & name) const +{ + return getParamWithLongName( name )->getValue(); +} + eoParam * eoParser::getParamWithLongName(const std::string& _name) const { @@ -130,7 +130,6 @@ eoParam * eoParser::getParamWithLongName(const std::string& _name) const } - void eoParser::processParam(eoParam& param, std::string section) { // this param enters the parser: add the prefix to the long name @@ -214,7 +213,7 @@ void eoParser::readFrom(istream& is) { if (str.size() < 2) { - eoWarning("Missing parameter"); + eo::log << eo::warnings << "Missing parameter" << std::endl; needHelp.value() = true; return; } diff --git a/eo/src/utils/eoParser.h b/eo/src/utils/eoParser.h index 0088ff4f..e65f7566 100644 --- a/eo/src/utils/eoParser.h +++ b/eo/src/utils/eoParser.h @@ -97,6 +97,11 @@ private : This class is persistent, so it can be stored and reloaded to restore parameter settings. + Parameters can be read from argv, strings or streams, and must be specified + using the following convention: --name=value or -n=value + + You should not use space as a separator between the parameter and its value. + @ingroup Parameters */ class eoParser : public eoParameterLoader, public eoObject, public eoPersistent @@ -156,6 +161,10 @@ public: virtual bool isItThere(eoParam& _param) const { return getValue(_param).first; } + + std::string get( const std::string & name) const; + + /** * get a handle on a param from its longName *