Added ability to save to ConfigFile

This commit is contained in:
2015-10-15 14:07:42 +02:00
parent e719a342f2
commit 2ddb1847c5
2 changed files with 31 additions and 9 deletions
+12 -2
View File
@@ -3,5 +3,15 @@
dd::ConfigFile::ConfigFile(std::string path)
{
boost::property_tree::ini_parser::read_ini(path, m_ptree);
}
m_Path = path;
try {
boost::property_tree::ini_parser::read_ini(path, m_Ptree);
} catch (boost::property_tree::ptree_error& e) {
LOG_ERROR("Failed to load %s", path.c_str());
}
}
void dd::ConfigFile::SaveToDisk()
{
boost::property_tree::ini_parser::write_ini(m_Path, m_Ptree);
}