diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp | 4 | ||||
-rw-r--r-- | Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoPayloadSerializer.h | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp index b1a1c37..e1d5528 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp @@ -6,9 +6,9 @@ //... #include <iostream> +#include <memory> #include <boost/bind.hpp> -#include <boost/smart_ptr/make_shared.hpp> #include <Swiften/Swiften.h> @@ -91,7 +91,7 @@ class EchoBot { message->setFrom(JID()); //... if (!message->getPayload<EchoPayload>()) { - boost::shared_ptr<EchoPayload> echoPayload = boost::make_shared<EchoPayload>(); + std::shared_ptr<EchoPayload> echoPayload = std::make_shared<EchoPayload>(); echoPayload->setMessage("This is an echoed message"); message->addPayload(echoPayload); client->sendMessage(message); diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoPayloadSerializer.h b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoPayloadSerializer.h index 91440d0..faf1080 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoPayloadSerializer.h +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoPayloadSerializer.h @@ -1,17 +1,18 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <Swiften/Swiften.h> #include "EchoPayload.h" +#include <Swiften/Swiften.h> + class EchoPayloadSerializer : public Swift::GenericPayloadSerializer<EchoPayload> { public: - std::string serializePayload(boost::shared_ptr<EchoPayload> payload) const { + std::string serializePayload(std::shared_ptr<EchoPayload> payload) const { XMLElement element("echo", "http://swift.im/protocol/echo"); element.addNode(XMLTextNode::ref(new XMLTextNode(payload->getMessage()))); return element.serialize(); |