diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h new file mode 100644 index 0000000..a7d04f1 --- /dev/null +++ b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2012 Mateusz Piękos + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#pragma once + +#include <Swiften/Elements/WhiteboardPayload.h> +#include <Swiften/Serializer/GenericPayloadSerializer.h> + +namespace Swift { + class WhiteboardSerializer : public GenericPayloadSerializer<WhiteboardPayload> { + public: + std::string serializePayload(boost::shared_ptr<WhiteboardPayload> payload) const { + XMLElement element("wb"); + element.addNode(XMLTextNode::ref(new XMLTextNode(payload->getData()))); + return element.serialize(); + } + }; +} |