diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp')
m--------- | Swiften | 0 | ||||
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp | 36 |
2 files changed, 0 insertions, 36 deletions
diff --git a/Swiften b/Swiften new file mode 160000 +Subproject 8213ba16d0043d2461f4b031c881d61dda5a38c diff --git a/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp b/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp deleted file mode 100644 index 4268381..0000000 --- a/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "Swiften/Serializer/PayloadSerializers/StorageSerializer.h" - -#include <boost/shared_ptr.hpp> - -#include "Swiften/Base/foreach.h" -#include "Swiften/Serializer/XML/XMLElement.h" -#include "Swiften/Serializer/XML/XMLTextNode.h" - -namespace Swift { - -StorageSerializer::StorageSerializer() : GenericPayloadSerializer<Storage>() { -} - -String StorageSerializer::serializePayload(boost::shared_ptr<Storage> storage) const { - XMLElement storageElement("storage", "storage:bookmarks"); - foreach(const Storage::Conference& conference, storage->getConferences()) { - boost::shared_ptr<XMLElement> conferenceElement(new XMLElement("conference")); - conferenceElement->setAttribute("name", conference.name); - conferenceElement->setAttribute("jid", conference.jid); - conferenceElement->setAttribute("autojoin", conference.autoJoin ? "1" : "0"); - if (!conference.nick.isEmpty()) { - boost::shared_ptr<XMLElement> nickElement(new XMLElement("nick")); - nickElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(conference.nick))); - conferenceElement->addNode(nickElement); - } - if (!conference.password.isEmpty()) { - boost::shared_ptr<XMLElement> passwordElement(new XMLElement("password")); - passwordElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(conference.password))); - conferenceElement->addNode(passwordElement); - } - storageElement.addNode(conferenceElement); - } - return storageElement.serialize(); -} - -} |