summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-11 15:51:42 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-11 15:56:10 (GMT)
commit1d6d6588e3affc9a736b29062107ca82ad6a5644 (patch)
tree54a96dd3f652df321ed5017148811d241baa1dd8 /Swiften/Serializer/PayloadSerializers
parente1a2d258479cd915e8c30c5c996b58da3da3e55d (diff)
downloadswift-1d6d6588e3affc9a736b29062107ca82ad6a5644.zip
swift-1d6d6588e3affc9a736b29062107ca82ad6a5644.tar.bz2
Added Raw XML payload parser & serializer.
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers')
-rw-r--r--Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h15
2 files changed, 17 insertions, 0 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp b/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp
index 0f66b35..6a24008 100644
--- a/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp
+++ b/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp
@@ -17,6 +17,7 @@
#include "Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h"
#include "Swiften/Serializer/PayloadSerializers/VCardSerializer.h"
#include "Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h"
+#include "Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h"
namespace Swift {
@@ -37,6 +38,7 @@ FullPayloadSerializerCollection::FullPayloadSerializerCollection() {
serializers_.push_back(new SecurityLabelsCatalogSerializer());
serializers_.push_back(new VCardSerializer());
serializers_.push_back(new VCardUpdateSerializer());
+ serializers_.push_back(new RawXMLPayloadSerializer());
foreach(PayloadSerializer* serializer, serializers_) {
addSerializer(serializer);
}
diff --git a/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h
new file mode 100644
index 0000000..f980174
--- /dev/null
+++ b/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h
@@ -0,0 +1,15 @@
+#pragma once
+
+#include "Swiften/Serializer/GenericPayloadSerializer.h"
+#include "Swiften/Elements/RawXMLPayload.h"
+
+namespace Swift {
+ class RawXMLPayloadSerializer : public GenericPayloadSerializer<RawXMLPayload> {
+ public:
+ RawXMLPayloadSerializer() : GenericPayloadSerializer<RawXMLPayload>() {}
+
+ virtual String serializePayload(boost::shared_ptr<RawXMLPayload> p) const {
+ return p->getRawXML();
+ }
+ };
+}