summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-09-11 20:08:45 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-09-14 10:42:17 (GMT)
commit234b140b5675c737859ed2457dcb07ad75a900ab (patch)
tree9078086da49cbbf9e2c45048f69e75d736030311 /Swiften/Parser/AttributeMap.h
parent811f6857563401636ba5ea39fc63892eacf007cd (diff)
downloadswift-234b140b5675c737859ed2457dcb07ad75a900ab.zip
swift-234b140b5675c737859ed2457dcb07ad75a900ab.tar.bz2
Added bookmark storage payload & parser.
Diffstat (limited to 'Swiften/Parser/AttributeMap.h')
-rw-r--r--Swiften/Parser/AttributeMap.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Swiften/Parser/AttributeMap.h b/Swiften/Parser/AttributeMap.h
index 6662b98..82c839a 100644
--- a/Swiften/Parser/AttributeMap.h
+++ b/Swiften/Parser/AttributeMap.h
@@ -19,6 +19,16 @@ namespace Swift {
return i->second;
}
}
+
+ bool getBoolAttribute(const String& attribute, bool defaultValue = false) const {
+ AttributeMap::const_iterator i = find(attribute);
+ if (i == end()) {
+ return defaultValue;
+ }
+ else {
+ return i->second == "true" || i->second == "1";
+ }
+ }
};
}