summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PayloadParsers/WhiteboardParser.cpp')
-rw-r--r--Swiften/Parser/PayloadParsers/WhiteboardParser.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp b/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp
new file mode 100644
index 0000000..77e5c2c
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2012 Mateusz Piękos
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#include <Swiften/Parser/PayloadParsers/WhiteboardParser.h>
+
+namespace Swift {
+ WhiteboardParser::WhiteboardParser() : level_(0) {
+ }
+ void WhiteboardParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes) {
+ ++level_;
+ }
+
+ void WhiteboardParser::handleEndElement(const std::string& element, const std::string&) {
+ --level_;
+ if(level_ == 0) {
+ getPayloadInternal()->setData(data_);
+ }
+ }
+
+ void WhiteboardParser::handleCharacterData(const std::string& data) {
+ data_ += data;
+ }
+}