allow setting/getting nodes in g_configs

This commit is contained in:
Eduardo Bart
2012-02-01 21:37:40 -02:00
parent 289efe34cf
commit 98ef0e4574
6 changed files with 39 additions and 17 deletions

View File

@@ -112,3 +112,21 @@ void ConfigManager::remove(const std::string& key)
if(child)
m_confsDoc->removeChild(child);
}
void ConfigManager::setNode(const std::string& key, const OTMLNodePtr& node)
{
remove(key);
addNode(key, node);
}
void ConfigManager::addNode(const std::string& key, const OTMLNodePtr& node)
{
OTMLNodePtr clone = node->clone();
node->setTag(key);
m_confsDoc->addChild(node);
}
OTMLNodePtr ConfigManager::getNode(const std::string& key)
{
return m_confsDoc->get(key);
}