Skip to content
Snippets Groups Projects
Commit 6703920c authored by Oliver Sander's avatar Oliver Sander
Browse files

I am putting the method get() with a char* back in. It served a purpose after

all (which is explained now in the documentation).  That purpose is a pretty
hacky type resolution issue, but I don't see a better way right now.

[[Imported from SVN: r4983]]
parent 2e7d782b
No related branches found
No related tags found
No related merge requests found
......@@ -190,6 +190,14 @@ string ConfigParser::get(const string& key, const string& defaultValue)
return defaultValue;
}
string ConfigParser::get(const string& key, char* defaultValue)
{
if (hasKey(key))
return (*this)[key];
else
return defaultValue;
}
int ConfigParser::get(const string& key, int defaultValue)
{
......
......@@ -147,6 +147,18 @@ namespace Dune {
*/
std::string get(const std::string& key, const std::string& defaultValue);
/** \brief get value as string
*
* Returns pure string value for given key.
*
* \todo This is a hack so get("my_key", "xyz") compiles
* (without this method "xyz" resolves to bool instead of std::string)
* \param key key name
* \param defaultValue default if key does not exist
* \return value as string
*/
std::string get(const std::string& key, char* defaultValue);
/** \brief get value as int
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment