Merge branch 'master' of ssh://eodev.git.sourceforge.net/gitroot/eodev/eodev
This commit is contained in:
commit
cde052e784
3 changed files with 19 additions and 9 deletions
|
|
@ -3,6 +3,8 @@
|
||||||
#pragma warning(disable:4786)
|
#pragma warning(disable:4786)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
#include <eoFunctorStore.h>
|
#include <eoFunctorStore.h>
|
||||||
#include <eoFunctor.h>
|
#include <eoFunctor.h>
|
||||||
|
|
||||||
|
|
@ -10,7 +12,7 @@
|
||||||
/// clears the memory
|
/// clears the memory
|
||||||
eoFunctorStore::~eoFunctorStore()
|
eoFunctorStore::~eoFunctorStore()
|
||||||
{
|
{
|
||||||
for(size_t i = 0; i < vec.size(); ++i) {
|
for( std::size_t i = 0; i < vec.size(); ++i) {
|
||||||
delete vec[i];
|
delete vec[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,16 +35,11 @@
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
|
||||||
#include <utils/compatibility.h>
|
#include <utils/compatibility.h>
|
||||||
|
|
||||||
#include <utils/eoParser.h>
|
#include <utils/eoParser.h>
|
||||||
|
#include <utils/eoLogger.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
void eoWarning(std::string str)
|
|
||||||
{
|
|
||||||
cout << str << '\n';
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ostream& printSectionHeader(std::ostream& os, std::string section)
|
std::ostream& printSectionHeader(std::ostream& os, std::string section)
|
||||||
{
|
{
|
||||||
if (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
|
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)
|
void eoParser::processParam(eoParam& param, std::string section)
|
||||||
{
|
{
|
||||||
// this param enters the parser: add the prefix to the long name
|
// 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)
|
if (str.size() < 2)
|
||||||
{
|
{
|
||||||
eoWarning("Missing parameter");
|
eo::log << eo::warnings << "Missing parameter" << std::endl;
|
||||||
needHelp.value() = true;
|
needHelp.value() = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,11 @@ private :
|
||||||
This class is persistent, so it can be stored and reloaded to restore
|
This class is persistent, so it can be stored and reloaded to restore
|
||||||
parameter settings.
|
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
|
@ingroup Parameters
|
||||||
*/
|
*/
|
||||||
class eoParser : public eoParameterLoader, public eoObject, public eoPersistent
|
class eoParser : public eoParameterLoader, public eoObject, public eoPersistent
|
||||||
|
|
@ -156,6 +161,10 @@ public:
|
||||||
virtual bool isItThere(eoParam& _param) const
|
virtual bool isItThere(eoParam& _param) const
|
||||||
{ return getValue(_param).first; }
|
{ return getValue(_param).first; }
|
||||||
|
|
||||||
|
|
||||||
|
std::string get( const std::string & name) const;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get a handle on a param from its longName
|
* get a handle on a param from its longName
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Reference in a new issue