- added config-file only options

This commit is contained in:
gimmedonutnow 2006-08-17 21:21:00 +00:00
parent c985215391
commit 349c47d122
2 changed files with 27 additions and 0 deletions

View File

@ -129,6 +129,31 @@ Config::addOption(char shortArg,
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.

View File

@ -39,6 +39,8 @@ public:
const std::string &, const std::string &);
int addOption(char, const std::string &,
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.