summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/SubjectSerializer.h')
-rw-r--r--Swiften/Serializer/PayloadSerializers/SubjectSerializer.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h b/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h
new file mode 100644
index 0000000..fcd82a5
--- /dev/null
+++ b/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2010 Kevin Smith
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include "Swiften/Serializer/GenericPayloadSerializer.h"
+#include "Swiften/Serializer/XML/XMLTextNode.h"
+#include "Swiften/Elements/Subject.h"
+
+namespace Swift {
+ class SubjectSerializer : public GenericPayloadSerializer<Subject> {
+ public:
+ SubjectSerializer() : GenericPayloadSerializer<Subject>() {}
+
+ virtual String serializePayload(boost::shared_ptr<Subject> subject) const {
+ XMLTextNode textNode(subject->getText());
+ return "<subject>" + textNode.serialize() + "</subject>";
+ }
+ };
+}