summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-02-22 08:17:05 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-02-22 08:17:59 (GMT)
commit64fc103d0d5d1d523d00dcc5b231715160475f7e (patch)
tree07d9623a3a712f72cc5c980b15f5a6506e0d5e94
parent6f06e137304793cc0db1d85cabe8a6edaac0ca67 (diff)
downloadswift-contrib-64fc103d0d5d1d523d00dcc5b231715160475f7e.zip
swift-contrib-64fc103d0d5d1d523d00dcc5b231715160475f7e.tar.bz2
Compile on Windows
-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) {