diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/BlockSerializer.h')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/BlockSerializer.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/BlockSerializer.h b/Swiften/Serializer/PayloadSerializers/BlockSerializer.h index 48c8004..f034c46 100644 --- a/Swiften/Serializer/PayloadSerializers/BlockSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/BlockSerializer.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <boost/smart_ptr/make_shared.hpp> +#include <memory> #include <Swiften/Base/API.h> #include <Swiften/JID/JID.h> @@ -14,24 +14,24 @@ #include <Swiften/Serializer/XML/XMLElement.h> namespace Swift { - template<typename BLOCK_ELEMENT> - class SWIFTEN_API BlockSerializer : public GenericPayloadSerializer<BLOCK_ELEMENT> { - public: - BlockSerializer(std::string tag) : GenericPayloadSerializer<BLOCK_ELEMENT>(), tag(tag) { - } + template<typename BLOCK_ELEMENT> + class SWIFTEN_API BlockSerializer : public GenericPayloadSerializer<BLOCK_ELEMENT> { + public: + BlockSerializer(std::string tag) : GenericPayloadSerializer<BLOCK_ELEMENT>(), tag(tag) { + } - virtual std::string serializePayload(boost::shared_ptr<BLOCK_ELEMENT> payload) const { - XMLElement element(tag, "urn:xmpp:blocking"); - const std::vector<JID>& items = payload->getItems(); - for (std::vector<JID>::const_iterator i = items.begin(); i != items.end(); ++i) { - boost::shared_ptr<XMLElement> item = boost::make_shared<XMLElement>("item"); - item->setAttribute("jid", *i); - element.addNode(item); - } - return element.serialize(); - } + virtual std::string serializePayload(std::shared_ptr<BLOCK_ELEMENT> payload) const { + XMLElement element(tag, "urn:xmpp:blocking"); + const std::vector<JID>& items = payload->getItems(); + for (const auto& i : items) { + std::shared_ptr<XMLElement> item = std::make_shared<XMLElement>("item"); + item->setAttribute("jid", i); + element.addNode(item); + } + return element.serialize(); + } - private: - std::string tag; - }; + private: + std::string tag; + }; } |