lua binder improvments

This commit is contained in:
Eduardo Bart
2012-01-06 01:29:26 -02:00
parent b9e5a4e463
commit 0cb5facd7a
10 changed files with 132 additions and 68 deletions

View File

@@ -54,3 +54,25 @@ bool ConfigManager::save()
}
return doc->save(m_fileName);
}
bool ConfigManager::exists(const std::string& key)
{
return m_confsMap.find(key) != m_confsMap.end();
}
void ConfigManager::set(const std::string& key, const std::string& value)
{
m_confsMap[key] = value;
}
std::string ConfigManager::get(const std::string& key)
{
return m_confsMap[key];
}
void ConfigManager::remove(const std::string& key)
{
auto it = m_confsMap.find(key);
if(it != m_confsMap.end())
m_confsMap.erase(it);
}

View File

@@ -31,9 +31,10 @@ public:
bool load(const std::string& file);
bool save();
bool exists(const std::string& key) { return m_confsMap.find(key) != m_confsMap.end(); }
void set(const std::string& key, const std::string& value) { m_confsMap[key] = value; }
std::string get(const std::string& key) { return m_confsMap[key]; }
bool exists(const std::string& key);
void set(const std::string& key, const std::string& value);
std::string get(const std::string& key);
void remove(const std::string& key);
private:
std::string m_fileName;