- added config-file only options
This commit is contained in:
parent
c985215391
commit
349c47d122
|
@ -129,6 +129,31 @@ Config::addOption(char shortArg,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
Config::addOption(const std::string &name,
|
||||||
|
const std::string &defaultValue)
|
||||||
|
{
|
||||||
|
if(_strOptMap.find(name) != _strOptMap.end()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// add the option
|
||||||
|
_strOptMap[name] = defaultValue;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
Config::addOption(const std::string &name,
|
||||||
|
int defaultValue)
|
||||||
|
{
|
||||||
|
if(_intOptMap.find(name) != _intOptMap.end()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// add the option
|
||||||
|
_intOptMap[name] = defaultValue;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the specified option to the given integer value.
|
* Sets the specified option to the given integer value.
|
||||||
|
|
|
@ -39,6 +39,8 @@ public:
|
||||||
const std::string &, const std::string &);
|
const std::string &, const std::string &);
|
||||||
int addOption(char, const std::string &,
|
int addOption(char, const std::string &,
|
||||||
const std::string &, void (*)(void));
|
const std::string &, void (*)(void));
|
||||||
|
int addOption(const std::string &, const std::string &);
|
||||||
|
int addOption(const std::string &, int);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a configuration option. Can be called at any time.
|
* Sets a configuration option. Can be called at any time.
|
||||||
|
|
Loading…
Reference in New Issue