2015-08-21 11:29:53 +00:00
|
|
|
struct Settings : Configuration::Document {
|
|
|
|
Settings();
|
|
|
|
~Settings();
|
|
|
|
|
|
|
|
Configuration::Node root;
|
|
|
|
string activePath;
|
|
|
|
string libraryPath;
|
|
|
|
bool createManifests = false;
|
2015-09-28 11:56:46 +00:00
|
|
|
bool useDatabase = true;
|
|
|
|
bool useHeuristics = true;
|
2015-08-21 11:29:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Settings::Settings() {
|
|
|
|
root.append(activePath, "ActivePath");
|
|
|
|
root.append(libraryPath, "LibraryPath");
|
|
|
|
root.append(createManifests, "CreateManifests");
|
2015-09-28 11:56:46 +00:00
|
|
|
root.append(useDatabase, "UseDatabase");
|
|
|
|
root.append(useHeuristics, "UseHeuristics");
|
2015-08-21 11:29:53 +00:00
|
|
|
append(root, "Settings");
|
|
|
|
|
|
|
|
directory::create({configpath(), "icarus/"});
|
|
|
|
load({configpath(), "icarus/settings.bml"});
|
|
|
|
save({configpath(), "icarus/settings.bml"});
|
|
|
|
|
|
|
|
if(!activePath) activePath = userpath();
|
|
|
|
if(!libraryPath) libraryPath = {userpath(), "Emulation/"};
|
|
|
|
}
|
|
|
|
|
|
|
|
Settings::~Settings() {
|
|
|
|
save({configpath(), "icarus/settings.bml"});
|
|
|
|
}
|