2015-11-19 09:27:56 +00:00
|
|
|
struct Settings : Markup::Node {
|
2015-08-21 11:29:53 +00:00
|
|
|
Settings();
|
2017-10-02 08:04:28 +00:00
|
|
|
auto save() -> void;
|
2015-08-21 11:29:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Settings::Settings() {
|
2016-01-30 06:40:35 +00:00
|
|
|
Markup::Node::operator=(BML::unserialize(string::read(locate("settings.bml"))));
|
2015-11-19 09:27:56 +00:00
|
|
|
|
|
|
|
auto set = [&](const string& name, const string& value) {
|
|
|
|
//create node and set to default value only if it does not already exist
|
|
|
|
if(!operator[](name)) operator()(name).setValue(value);
|
|
|
|
};
|
2015-08-21 11:29:53 +00:00
|
|
|
|
2016-05-16 09:51:12 +00:00
|
|
|
set("Library/Location", {Path::user(), "Emulation/"});
|
2015-08-21 11:29:53 +00:00
|
|
|
|
2016-05-16 09:51:12 +00:00
|
|
|
set("icarus/Path", Path::user());
|
2015-11-19 09:27:56 +00:00
|
|
|
set("icarus/CreateManifests", false);
|
|
|
|
set("icarus/UseDatabase", true);
|
|
|
|
set("icarus/UseHeuristics", true);
|
2015-08-21 11:29:53 +00:00
|
|
|
}
|
|
|
|
|
2017-10-02 08:04:28 +00:00
|
|
|
auto Settings::save() -> void {
|
2016-01-30 06:40:35 +00:00
|
|
|
file::write(locate("settings.bml"), BML::serialize(*this));
|
2015-08-21 11:29:53 +00:00
|
|
|
}
|