summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PayloadParsers/RawXMLPayloadParser.cpp')
-rw-r--r--Swiften/Parser/PayloadParsers/RawXMLPayloadParser.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.cpp b/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.cpp
new file mode 100644
index 0000000..c49af3e
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.cpp
@@ -0,0 +1,26 @@
+#include "Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h"
+#include "Swiften/Parser/SerializingParser.h"
+
+namespace Swift {
+
+RawXMLPayloadParser::RawXMLPayloadParser() : level_(0) {
+}
+
+void RawXMLPayloadParser::handleStartElement(const String& element, const String& ns, const AttributeMap& attributes) {
+ ++level_;
+ serializingParser_.handleStartElement(element, ns, attributes);
+}
+
+void RawXMLPayloadParser::handleEndElement(const String& element, const String& ns) {
+ serializingParser_.handleEndElement(element, ns);
+ --level_;
+ if (level_ == 0) {
+ getPayloadInternal()->setRawXML(serializingParser_.getResult());
+ }
+}
+
+void RawXMLPayloadParser::handleCharacterData(const String& data) {
+ serializingParser_.handleCharacterData(data);
+}
+
+}