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/PayloadParsers/StorageParser.h
parent811f6857563401636ba5ea39fc63892eacf007cd (diff)
downloadswift-contrib-234b140b5675c737859ed2457dcb07ad75a900ab.zip
swift-contrib-234b140b5675c737859ed2457dcb07ad75a900ab.tar.bz2
Added bookmark storage payload & parser.
Diffstat (limited to 'Swiften/Parser/PayloadParsers/StorageParser.h')
-rw-r--r--Swiften/Parser/PayloadParsers/StorageParser.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/Swiften/Parser/PayloadParsers/StorageParser.h b/Swiften/Parser/PayloadParsers/StorageParser.h
new file mode 100644
index 0000000..ad0ab4d
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/StorageParser.h
@@ -0,0 +1,27 @@
+#pragma once
+
+#include <boost/optional.hpp>
+
+#include "Swiften/Elements/Storage.h"
+#include "Swiften/Parser/GenericPayloadParser.h"
+
+namespace Swift {
+ class StorageParser : public GenericPayloadParser<Storage> {
+ public:
+ StorageParser();
+
+ virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes);
+ virtual void handleEndElement(const String& element, const String&);
+ virtual void handleCharacterData(const String& data);
+
+ private:
+ enum Level {
+ TopLevel = 0,
+ BookmarkLevel = 1,
+ DetailLevel = 2
+ };
+ int level;
+ String currentText;
+ boost::optional<Storage::Conference> conference;
+ };
+}