MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / loadFile

Method loadFile

src/Settings.cpp:65–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void 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) \

Callers

nothing calls this directly

Calls 10

getHomePathFunction · 0.85
load_fileMethod · 0.80
descriptionMethod · 0.80
childMethod · 0.80
next_siblingMethod · 0.80
as_stringMethod · 0.80
attributeMethod · 0.80
as_boolMethod · 0.80
as_intMethod · 0.80
as_floatMethod · 0.80

Tested by

no test coverage detected