| 63 | } |
| 64 | |
| 65 | void Settings::loadFile() |
| 66 | { |
| 67 | const std::string path = getHomePath() + "/.emulationstation/es_settings.cfg"; |
| 68 | |
| 69 | if(!boost::filesystem::exists(path)) |
| 70 | return; |
| 71 | |
| 72 | pugi::xml_document doc; |
| 73 | pugi::xml_parse_result result = doc.load_file(path.c_str()); |
| 74 | if(!result) |
| 75 | { |
| 76 | LOG(LogError) << "Could not parse Settings file!\n " << result.description(); |
| 77 | return; |
| 78 | } |
| 79 | |
| 80 | for(pugi::xml_node node = doc.child("bool"); node; node = node.next_sibling()) |
| 81 | setBool(node.attribute("name").as_string(), node.attribute("value").as_bool()); |
| 82 | for(pugi::xml_node node = doc.child("int"); node; node = node.next_sibling()) |
| 83 | setInt(node.attribute("name").as_string(), node.attribute("value").as_int()); |
| 84 | for(pugi::xml_node node = doc.child("float"); node; node = node.next_sibling()) |
| 85 | setFloat(node.attribute("name").as_string(), node.attribute("value").as_float()); |
| 86 | } |
| 87 | |
| 88 | //Print a warning message if the setting we're trying to get doesn't already exist in the map, then return the value in the map. |
| 89 | #define SETTINGS_GETSET(type, mapName, getMethodName, setMethodName) type Settings::getMethodName(const std::string& name) \ |
nothing calls this directly
no test coverage detected