Skip to content
Snippets Groups Projects
Commit 610b4030 authored by Carsten Gräser's avatar Carsten Gräser
Browse files

added methods to query all keys in order of appearance

[[Imported from SVN: r4753]]
parent ce4b6492
No related tags found
No related merge requests found
......@@ -169,11 +169,17 @@ string& ConfigParser::operator[] (const string& key)
if (dot != string::npos)
{
if (not (hasSub(key.substr(0,dot))))
subKeys.push_back(key.substr(0,dot));
ConfigParser& s = sub(key.substr(0,dot));
return s[key.substr(dot+1)];
}
else
{
if (not (hasKey(key)))
valueKeys.push_back(key);
return values[key];
}
}
string ConfigParser::get(const string& key, string defaultValue)
......@@ -238,3 +244,13 @@ string ConfigParser::trim(string s)
s.erase(i);
return s;
}
const ConfigParser::KeyVector& ConfigParser::getValueKeys() const
{
return valueKeys;
}
const ConfigParser::KeyVector& ConfigParser::getSubKeys() const
{
return subKeys;
}
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