diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-09-11 20:08:45 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-09-14 10:42:17 (GMT) |
commit | 234b140b5675c737859ed2457dcb07ad75a900ab (patch) | |
tree | 9078086da49cbbf9e2c45048f69e75d736030311 /Swiften/Parser/AttributeMap.h | |
parent | 811f6857563401636ba5ea39fc63892eacf007cd (diff) | |
download | swift-contrib-234b140b5675c737859ed2457dcb07ad75a900ab.zip swift-contrib-234b140b5675c737859ed2457dcb07ad75a900ab.tar.bz2 |
Added bookmark storage payload & parser.
Diffstat (limited to 'Swiften/Parser/AttributeMap.h')
-rw-r--r-- | Swiften/Parser/AttributeMap.h | 10 |
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"; + } + } }; } |