summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swift/Controllers/Settings/XMLSettingsProvider.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Swift/Controllers/Settings/XMLSettingsProvider.cpp b/Swift/Controllers/Settings/XMLSettingsProvider.cpp
index 6ad3170..3710072 100644
--- a/Swift/Controllers/Settings/XMLSettingsProvider.cpp
+++ b/Swift/Controllers/Settings/XMLSettingsProvider.cpp
@@ -45,70 +45,71 @@ std::string XMLSettingsProvider::getSetting(const Setting<std::string>& setting)
}
void XMLSettingsProvider::storeSetting(const Setting<std::string>& /*settingPath*/, const std::string& /*settingValue*/) {
assert(false);
}
bool XMLSettingsProvider::getSetting(const Setting<bool>& setting) {
if (values_.find(setting.getKey()) != values_.end()) {
std::string value = values_[setting.getKey()];
return boost::iequals(value, "true") || value == "1";
}
return setting.getDefaultValue();
}
void XMLSettingsProvider::storeSetting(const Setting<bool>& /*settingPath*/, const bool& /*settingValue*/) {
assert(false);
}
int XMLSettingsProvider::getSetting(const Setting<int>& setting) {
if (values_.find(setting.getKey()) != values_.end()) {
std::string value = values_[setting.getKey()];
try {
return value.empty() ? setting.getDefaultValue() : boost::lexical_cast<int>(value);;
}
catch(boost::bad_lexical_cast &) {}
}
return setting.getDefaultValue();
}
void XMLSettingsProvider::storeSetting(const Setting<int>& /*settingPath*/, const int& /*settingValue*/) {
assert(false);
}
std::vector<std::string> XMLSettingsProvider::getAvailableProfiles() {
assert(false);
+ return std::vector<std::string>();
}
void XMLSettingsProvider::createProfile(const std::string& /*profile*/) {
assert(false);
}
void XMLSettingsProvider::removeProfile(const std::string& /*profile*/) {
assert(false);
}
bool XMLSettingsProvider::getIsSettingFinal(const std::string& settingPath) {
return finals_.count(settingPath);
}
void XMLSettingsProvider::handleStartElement(const std::string& element, const std::string& /*ns*/, const AttributeMap& attributes) {
level_++;
if (level_ == SettingLevel) {
if (attributes.getBoolAttribute("final", false)) {
finals_.insert(element);
}
currentElement_ = element;
currentText_ = "";
}
}
void XMLSettingsProvider::handleEndElement(const std::string& /*element*/, const std::string& /*ns*/) {
if (level_ == SettingLevel) {
values_[currentElement_] = currentText_;
SWIFT_LOG(debug) << "Setting value of " << currentElement_ << " to " << currentText_ << std::endl;
}
level_--;
}
void XMLSettingsProvider::handleCharacterData(const std::string& data) {
if (level_ >= SettingLevel) {