From 741c45b74d5f634622eb5f757c49323274fb8937 Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Fri, 1 Apr 2016 19:23:49 +0200 Subject: Modernize code to use C++11 shared_ptr instead of Boost's This change was done by applying the following 'gsed' replacement calls to all source files: 's/\#include /\#include /g' 's/\#include /\#include /g' 's/\#include /\#include /g' 's/\#include /\#include /g' 's/\#include /\#include /g' 's/boost::make_shared/std::make_shared/g' 's/boost::dynamic_pointer_cast/std::dynamic_pointer_cast/g' 's/boost::shared_ptr/std::shared_ptr/g' 's/boost::weak_ptr/std::weak_ptr/g' 's/boost::enable_shared_from_this/std::enable_shared_from_this/g' The remaining issues have been fixed manually. Test-Information: Code builds on OS X 10.11.4 and unit tests pass. Change-Id: Ia7ae34eab869fb9ad6387a1348426b71ae4acd5f 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 +#include #include -#include #include @@ -91,7 +91,7 @@ class EchoBot { message->setFrom(JID()); //... if (!message->getPayload()) { - boost::shared_ptr echoPayload = boost::make_shared(); + std::shared_ptr echoPayload = std::make_shared(); 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 #include "EchoPayload.h" +#include + class EchoPayloadSerializer : public Swift::GenericPayloadSerializer { public: - std::string serializePayload(boost::shared_ptr payload) const { + std::string serializePayload(std::shared_ptr payload) const { XMLElement element("echo", "http://swift.im/protocol/echo"); element.addNode(XMLTextNode::ref(new XMLTextNode(payload->getMessage()))); return element.serialize(); diff --git a/Limber/Server/ServerFromClientSession.cpp b/Limber/Server/ServerFromClientSession.cpp index e8d0769..f2a3659 100644 --- a/Limber/Server/ServerFromClientSession.cpp +++ b/Limber/Server/ServerFromClientSession.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -27,7 +28,7 @@ namespace Swift { ServerFromClientSession::ServerFromClientSession( const std::string& id, - boost::shared_ptr connection, + std::shared_ptr connection, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers, XMLParserFactory* xmlParserFactory, @@ -41,7 +42,7 @@ ServerFromClientSession::ServerFromClientSession( } -void ServerFromClientSession::handleElement(boost::shared_ptr element) { +void ServerFromClientSession::handleElement(std::shared_ptr element) { if (isInitialized()) { onElementReceived(element); } @@ -49,33 +50,33 @@ void ServerFromClientSession::handleElement(boost::shared_ptr e if (AuthRequest* authRequest = dynamic_cast(element.get())) { if (authRequest->getMechanism() == "PLAIN" || (allowSASLEXTERNAL && authRequest->getMechanism() == "EXTERNAL")) { if (authRequest->getMechanism() == "EXTERNAL") { - getXMPPLayer()->writeElement(boost::make_shared()); + getXMPPLayer()->writeElement(std::make_shared()); authenticated_ = true; getXMPPLayer()->resetParser(); } else { PLAINMessage plainMessage(authRequest->getMessage() ? *authRequest->getMessage() : createSafeByteArray("")); if (userRegistry_->isValidUserPassword(JID(plainMessage.getAuthenticationID(), getLocalJID().getDomain()), plainMessage.getPassword())) { - getXMPPLayer()->writeElement(boost::make_shared()); + getXMPPLayer()->writeElement(std::make_shared()); user_ = plainMessage.getAuthenticationID(); authenticated_ = true; getXMPPLayer()->resetParser(); } else { - getXMPPLayer()->writeElement(boost::shared_ptr(new AuthFailure)); + getXMPPLayer()->writeElement(std::shared_ptr(new AuthFailure)); finishSession(AuthenticationFailedError); } } } else { - getXMPPLayer()->writeElement(boost::shared_ptr(new AuthFailure)); + getXMPPLayer()->writeElement(std::shared_ptr(new AuthFailure)); finishSession(NoSupportedAuthMechanismsError); } } else if (IQ* iq = dynamic_cast(element.get())) { - if (boost::shared_ptr resourceBind = iq->getPayload()) { + if (std::shared_ptr resourceBind = iq->getPayload()) { setRemoteJID(JID(user_, getLocalJID().getDomain(), resourceBind->getResource())); - boost::shared_ptr resultResourceBind(new ResourceBind()); + std::shared_ptr resultResourceBind(new ResourceBind()); resultResourceBind->setJID(getRemoteJID()); getXMPPLayer()->writeElement(IQ::createResult(JID(), iq->getID(), resultResourceBind)); } @@ -94,7 +95,7 @@ void ServerFromClientSession::handleStreamStart(const ProtocolHeader& incomingHe header.setID(id_); getXMPPLayer()->writeHeader(header); - boost::shared_ptr features(new StreamFeatures()); + std::shared_ptr features(new StreamFeatures()); if (!authenticated_) { features->addAuthenticationMechanism("PLAIN"); if (allowSASLEXTERNAL) { diff --git a/Limber/Server/ServerFromClientSession.h b/Limber/Server/ServerFromClientSession.h index 34d4f18..feba96a 100644 --- a/Limber/Server/ServerFromClientSession.h +++ b/Limber/Server/ServerFromClientSession.h @@ -6,11 +6,9 @@ #pragma once +#include #include -#include -#include - #include #include #include @@ -34,7 +32,7 @@ namespace Swift { public: ServerFromClientSession( const std::string& id, - boost::shared_ptr connection, + std::shared_ptr connection, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers, XMLParserFactory* xmlParserFactory, @@ -44,7 +42,7 @@ namespace Swift { void setAllowSASLEXTERNAL(); private: - void handleElement(boost::shared_ptr); + void handleElement(std::shared_ptr); void handleStreamStart(const ProtocolHeader& header); void setInitialized(); diff --git a/Limber/Server/ServerSession.h b/Limber/Server/ServerSession.h index 9b784ac..0b39d7c 100644 --- a/Limber/Server/ServerSession.h +++ b/Limber/Server/ServerSession.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include @@ -18,6 +18,6 @@ namespace Swift { virtual const JID& getJID() const = 0; virtual int getPriority() const = 0; - virtual void sendStanza(boost::shared_ptr) = 0; + virtual void sendStanza(std::shared_ptr) = 0; }; } diff --git a/Limber/Server/ServerStanzaRouter.cpp b/Limber/Server/ServerStanzaRouter.cpp index 3ab88e1..b7ccca8 100644 --- a/Limber/Server/ServerStanzaRouter.cpp +++ b/Limber/Server/ServerStanzaRouter.cpp @@ -34,7 +34,7 @@ namespace { ServerStanzaRouter::ServerStanzaRouter() { } -bool ServerStanzaRouter::routeStanza(boost::shared_ptr stanza) { +bool ServerStanzaRouter::routeStanza(std::shared_ptr stanza) { JID to = stanza->getTo(); assert(to.isValid()); diff --git a/Limber/Server/ServerStanzaRouter.h b/Limber/Server/ServerStanzaRouter.h index 174f509..04192ba 100644 --- a/Limber/Server/ServerStanzaRouter.h +++ b/Limber/Server/ServerStanzaRouter.h @@ -7,8 +7,7 @@ #pragma once #include - -#include +#include #include #include @@ -20,7 +19,7 @@ namespace Swift { public: ServerStanzaRouter(); - bool routeStanza(boost::shared_ptr); + bool routeStanza(std::shared_ptr); void addClientSession(ServerSession*); void removeClientSession(ServerSession*); diff --git a/Limber/Server/UnitTest/ServerStanzaRouterTest.cpp b/Limber/Server/UnitTest/ServerStanzaRouterTest.cpp index a234038..5f34d92 100644 --- a/Limber/Server/UnitTest/ServerStanzaRouterTest.cpp +++ b/Limber/Server/UnitTest/ServerStanzaRouterTest.cpp @@ -125,8 +125,8 @@ class ServerStanzaRouterTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createMessageTo(const std::string& recipient) { - boost::shared_ptr message(new Message()); + std::shared_ptr createMessageTo(const std::string& recipient) { + std::shared_ptr message(new Message()); message->setTo(JID(recipient)); return message; } @@ -138,13 +138,13 @@ class ServerStanzaRouterTest : public CppUnit::TestFixture { virtual const JID& getJID() const { return jid; } virtual int getPriority() const { return priority; } - virtual void sendStanza(boost::shared_ptr stanza) { + virtual void sendStanza(std::shared_ptr stanza) { sentStanzas.push_back(stanza); } JID jid; int priority; - std::vector< boost::shared_ptr > sentStanzas; + std::vector< std::shared_ptr > sentStanzas; }; }; diff --git a/Limber/main.cpp b/Limber/main.cpp index 52f9347..26cb8d6 100644 --- a/Limber/main.cpp +++ b/Limber/main.cpp @@ -4,10 +4,10 @@ * See the COPYING file for more information. */ +#include #include #include -#include #include #include @@ -39,20 +39,20 @@ class Server { } private: - void handleNewConnection(boost::shared_ptr c) { - boost::shared_ptr session(new ServerFromClientSession(idGenerator_.generateID(), c, &payloadParserFactories_, &payloadSerializers_, &xmlParserFactory, userRegistry_)); + void handleNewConnection(std::shared_ptr c) { + std::shared_ptr session(new ServerFromClientSession(idGenerator_.generateID(), c, &payloadParserFactories_, &payloadSerializers_, &xmlParserFactory, userRegistry_)); serverFromClientSessions_.push_back(session); session->onElementReceived.connect(boost::bind(&Server::handleElementReceived, this, _1, session)); session->onSessionFinished.connect(boost::bind(&Server::handleSessionFinished, this, session)); session->startSession(); } - void handleSessionFinished(boost::shared_ptr session) { + void handleSessionFinished(std::shared_ptr session) { serverFromClientSessions_.erase(std::remove(serverFromClientSessions_.begin(), serverFromClientSessions_.end(), session), serverFromClientSessions_.end()); } - void handleElementReceived(boost::shared_ptr element, boost::shared_ptr session) { - boost::shared_ptr stanza(boost::dynamic_pointer_cast(element)); + void handleElementReceived(std::shared_ptr element, std::shared_ptr session) { + std::shared_ptr stanza(std::dynamic_pointer_cast(element)); if (!stanza) { return; } @@ -61,13 +61,13 @@ class Server { stanza->setTo(JID(session->getLocalJID())); } if (!stanza->getTo().isValid() || stanza->getTo() == session->getLocalJID() || stanza->getTo() == session->getRemoteJID().toBare()) { - if (boost::shared_ptr iq = boost::dynamic_pointer_cast(stanza)) { + if (std::shared_ptr iq = std::dynamic_pointer_cast(stanza)) { if (iq->getPayload()) { - session->sendElement(IQ::createResult(iq->getFrom(), iq->getID(), boost::make_shared())); + session->sendElement(IQ::createResult(iq->getFrom(), iq->getID(), std::make_shared())); } if (iq->getPayload()) { if (iq->getType() == IQ::Get) { - boost::shared_ptr vcard(new VCard()); + std::shared_ptr vcard(new VCard()); vcard->setNickname(iq->getFrom().getNode()); session->sendElement(IQ::createResult(iq->getFrom(), iq->getID(), vcard)); } @@ -87,8 +87,8 @@ class Server { PlatformXMLParserFactory xmlParserFactory; UserRegistry* userRegistry_; BoostIOServiceThread boostIOServiceThread_; - boost::shared_ptr serverFromClientConnectionServer_; - std::vector< boost::shared_ptr > serverFromClientSessions_; + std::shared_ptr serverFromClientConnectionServer_; + std::vector< std::shared_ptr > serverFromClientSessions_; FullPayloadParserFactoryCollection payloadParserFactories_; FullPayloadSerializerCollection payloadSerializers_; }; diff --git a/Slimber/FileVCardCollection.cpp b/Slimber/FileVCardCollection.cpp index af8d57d..ff2edc4 100644 --- a/Slimber/FileVCardCollection.cpp +++ b/Slimber/FileVCardCollection.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -20,7 +21,7 @@ namespace Swift { FileVCardCollection::FileVCardCollection(boost::filesystem::path dir) : vcardsPath(dir) { } -boost::shared_ptr FileVCardCollection::getOwnVCard() const { +std::shared_ptr FileVCardCollection::getOwnVCard() const { if (boost::filesystem::exists(vcardsPath / std::string("vcard.xml"))) { ByteArray data; readByteArrayFromFile(data, boost::filesystem::path(vcardsPath / std::string("vcard.xml")).string()); @@ -28,14 +29,14 @@ boost::shared_ptr FileVCardCollection::getOwnVCard() const { VCardParser parser; PayloadParserTester tester(&parser); tester.parse(byteArrayToString(data)); - return boost::dynamic_pointer_cast(parser.getPayload()); + return std::dynamic_pointer_cast(parser.getPayload()); } else { - return boost::make_shared(); + return std::make_shared(); } } -void FileVCardCollection::setOwnVCard(boost::shared_ptr v) { +void FileVCardCollection::setOwnVCard(std::shared_ptr v) { boost::filesystem::ofstream file(vcardsPath / std::string("vcard.xml")); file << VCardSerializer().serializePayload(v); file.close(); diff --git a/Slimber/FileVCardCollection.h b/Slimber/FileVCardCollection.h index c05c4f4..ff4a91b 100644 --- a/Slimber/FileVCardCollection.h +++ b/Slimber/FileVCardCollection.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include @@ -16,8 +17,8 @@ namespace Swift { public: FileVCardCollection(boost::filesystem::path dir); - boost::shared_ptr getOwnVCard() const; - void setOwnVCard(boost::shared_ptr vcard); + std::shared_ptr getOwnVCard() const; + void setOwnVCard(std::shared_ptr vcard); private: boost::filesystem::path vcardsPath; diff --git a/Slimber/LinkLocalPresenceManager.cpp b/Slimber/LinkLocalPresenceManager.cpp index 200e98f..f166b38 100644 --- a/Slimber/LinkLocalPresenceManager.cpp +++ b/Slimber/LinkLocalPresenceManager.cpp @@ -34,7 +34,7 @@ boost::optional LinkLocalPresenceManager::getServiceForJID(con } void LinkLocalPresenceManager::handleServiceAdded(const LinkLocalService& service) { - boost::shared_ptr roster(new RosterPayload()); + std::shared_ptr roster(new RosterPayload()); roster->addItem(getRosterItem(service)); onRosterChanged(roster); onPresenceChanged(getPresence(service)); @@ -45,21 +45,21 @@ void LinkLocalPresenceManager::handleServiceChanged(const LinkLocalService& serv } void LinkLocalPresenceManager::handleServiceRemoved(const LinkLocalService& service) { - boost::shared_ptr roster(new RosterPayload()); + std::shared_ptr roster(new RosterPayload()); roster->addItem(RosterItemPayload(service.getJID(), "", RosterItemPayload::Remove)); onRosterChanged(roster); } -boost::shared_ptr LinkLocalPresenceManager::getRoster() const { - boost::shared_ptr roster(new RosterPayload()); +std::shared_ptr LinkLocalPresenceManager::getRoster() const { + std::shared_ptr roster(new RosterPayload()); foreach(const LinkLocalService& service, browser->getServices()) { roster->addItem(getRosterItem(service)); } return roster; } -std::vector > LinkLocalPresenceManager::getAllPresence() const { - std::vector > result; +std::vector > LinkLocalPresenceManager::getAllPresence() const { + std::vector > result; foreach(const LinkLocalService& service, browser->getServices()) { result.push_back(getPresence(service)); } @@ -88,8 +88,8 @@ std::string LinkLocalPresenceManager::getRosterName(const LinkLocalService& serv return ""; } -boost::shared_ptr LinkLocalPresenceManager::getPresence(const LinkLocalService& service) const { - boost::shared_ptr presence(new Presence()); +std::shared_ptr LinkLocalPresenceManager::getPresence(const LinkLocalService& service) const { + std::shared_ptr presence(new Presence()); presence->setFrom(service.getJID()); switch (service.getInfo().getStatus()) { case LinkLocalServiceInfo::Available: diff --git a/Slimber/LinkLocalPresenceManager.h b/Slimber/LinkLocalPresenceManager.h index 83df624..6858c70 100644 --- a/Slimber/LinkLocalPresenceManager.h +++ b/Slimber/LinkLocalPresenceManager.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -24,13 +23,13 @@ namespace Swift { public: LinkLocalPresenceManager(LinkLocalServiceBrowser*); - boost::shared_ptr getRoster() const; - std::vector > getAllPresence() const; + std::shared_ptr getRoster() const; + std::vector > getAllPresence() const; boost::optional getServiceForJID(const JID&) const; - boost::signal)> onRosterChanged; - boost::signal)> onPresenceChanged; + boost::signal)> onRosterChanged; + boost::signal)> onPresenceChanged; private: void handleServiceAdded(const LinkLocalService&); @@ -39,7 +38,7 @@ namespace Swift { RosterItemPayload getRosterItem(const LinkLocalService& service) const; std::string getRosterName(const LinkLocalService& service) const; - boost::shared_ptr getPresence(const LinkLocalService& service) const; + std::shared_ptr getPresence(const LinkLocalService& service) const; private: LinkLocalServiceBrowser* browser; diff --git a/Slimber/MainController.h b/Slimber/MainController.h index 8f4e981..9989b4d 100644 --- a/Slimber/MainController.h +++ b/Slimber/MainController.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include @@ -37,7 +38,7 @@ class MainController { void stop(); private: - boost::shared_ptr dnsSDQuerier; + std::shared_ptr dnsSDQuerier; Swift::LinkLocalServiceBrowser* linkLocalServiceBrowser; Swift::VCardCollection* vCardCollection; Swift::Server* server; diff --git a/Slimber/Server.cpp b/Slimber/Server.cpp index d1afc23..a06fda2 100644 --- a/Slimber/Server.cpp +++ b/Slimber/Server.cpp @@ -111,11 +111,11 @@ void Server::stop(boost::optional e) { serverFromClientSession->finishSession(); } serverFromClientSession.reset(); - foreach(boost::shared_ptr session, linkLocalSessions) { + foreach(std::shared_ptr session, linkLocalSessions) { session->finishSession(); } linkLocalSessions.clear(); - foreach(boost::shared_ptr connector, connectors) { + foreach(std::shared_ptr connector, connectors) { connector->cancel(); } connectors.clear(); @@ -142,11 +142,11 @@ void Server::stop(boost::optional e) { onStopped(e); } -void Server::handleNewClientConnection(boost::shared_ptr connection) { +void Server::handleNewClientConnection(std::shared_ptr connection) { if (serverFromClientSession) { connection->disconnect(); } - serverFromClientSession = boost::shared_ptr( + serverFromClientSession = std::shared_ptr( new ServerFromClientSession(idGenerator.generateID(), connection, &payloadParserFactories, &payloadSerializers, &xmlParserFactory, &userRegistry)); serverFromClientSession->setAllowSASLEXTERNAL(); @@ -158,7 +158,7 @@ void Server::handleNewClientConnection(boost::shared_ptr connection) serverFromClientSession->onSessionFinished.connect( boost::bind(&Server::handleSessionFinished, this, serverFromClientSession)); - //tracers.push_back(boost::shared_ptr( + //tracers.push_back(std::shared_ptr( // new SessionTracer(serverFromClientSession))); serverFromClientSession->startSession(); } @@ -167,7 +167,7 @@ void Server::handleSessionStarted() { onSelfConnected(true); } -void Server::handleSessionFinished(boost::shared_ptr) { +void Server::handleSessionFinished(std::shared_ptr) { serverFromClientSession.reset(); unregisterService(); selfJID = JID(); @@ -183,8 +183,8 @@ void Server::unregisterService() { } } -void Server::handleElementReceived(boost::shared_ptr element, boost::shared_ptr session) { - boost::shared_ptr stanza = boost::dynamic_pointer_cast(element); +void Server::handleElementReceived(std::shared_ptr element, std::shared_ptr session) { + std::shared_ptr stanza = std::dynamic_pointer_cast(element); if (!stanza) { return; } @@ -194,7 +194,7 @@ void Server::handleElementReceived(boost::shared_ptr element, b stanza->setTo(session->getLocalJID()); } - if (boost::shared_ptr presence = boost::dynamic_pointer_cast(stanza)) { + if (std::shared_ptr presence = std::dynamic_pointer_cast(stanza)) { if (presence->getType() == Presence::Available) { if (!linkLocalServiceRegistered) { linkLocalServiceRegistered = true; @@ -213,12 +213,12 @@ void Server::handleElementReceived(boost::shared_ptr element, b } } else if (!stanza->getTo().isValid() || stanza->getTo() == session->getLocalJID() || stanza->getTo() == session->getRemoteJID().toBare()) { - if (boost::shared_ptr iq = boost::dynamic_pointer_cast(stanza)) { + if (std::shared_ptr iq = std::dynamic_pointer_cast(stanza)) { if (iq->getPayload()) { if (iq->getType() == IQ::Get) { session->sendElement(IQ::createResult(iq->getFrom(), iq->getID(), presenceManager->getRoster())); rosterRequested = true; - foreach(const boost::shared_ptr presence, presenceManager->getAllPresence()) { + foreach(const std::shared_ptr presence, presenceManager->getAllPresence()) { session->sendElement(presence); } } @@ -226,7 +226,7 @@ void Server::handleElementReceived(boost::shared_ptr element, b session->sendElement(IQ::createError(iq->getFrom(), iq->getID(), ErrorPayload::Forbidden, ErrorPayload::Cancel)); } } - if (boost::shared_ptr vcard = iq->getPayload()) { + if (std::shared_ptr vcard = iq->getPayload()) { if (iq->getType() == IQ::Get) { session->sendElement(IQ::createResult(iq->getFrom(), iq->getID(), vCardCollection->getOwnVCard())); } @@ -245,7 +245,7 @@ void Server::handleElementReceived(boost::shared_ptr element, b } else { JID toJID = stanza->getTo(); - boost::shared_ptr outgoingSession = + std::shared_ptr outgoingSession = getLinkLocalSessionForJID(toJID); if (outgoingSession) { outgoingSession->sendElement(stanza); @@ -254,10 +254,10 @@ void Server::handleElementReceived(boost::shared_ptr element, b boost::optional service = presenceManager->getServiceForJID(toJID); if (service) { - boost::shared_ptr connector = + std::shared_ptr connector = getLinkLocalConnectorForJID(toJID); if (!connector) { - connector = boost::shared_ptr( + connector = std::shared_ptr( new LinkLocalConnector( *service, linkLocalServiceBrowser->getQuerier(), @@ -278,23 +278,23 @@ void Server::handleElementReceived(boost::shared_ptr element, b } } -void Server::handleNewLinkLocalConnection(boost::shared_ptr connection) { - boost::shared_ptr session( +void Server::handleNewLinkLocalConnection(std::shared_ptr connection) { + std::shared_ptr session( new IncomingLinkLocalSession( selfJID, connection, &payloadParserFactories, &payloadSerializers, &xmlParserFactory)); registerLinkLocalSession(session); } -void Server::handleLinkLocalSessionFinished(boost::shared_ptr session) { +void Server::handleLinkLocalSessionFinished(std::shared_ptr session) { //std::cout << "Link local session from " << session->getRemoteJID() << " ended" << std::endl; linkLocalSessions.erase( std::remove(linkLocalSessions.begin(), linkLocalSessions.end(), session), linkLocalSessions.end()); } -void Server::handleLinkLocalElementReceived(boost::shared_ptr element, boost::shared_ptr session) { - if (boost::shared_ptr stanza = boost::dynamic_pointer_cast(element)) { +void Server::handleLinkLocalElementReceived(std::shared_ptr element, std::shared_ptr session) { + if (std::shared_ptr stanza = std::dynamic_pointer_cast(element)) { JID fromJID = session->getRemoteJID(); if (!presenceManager->getServiceForJID(fromJID.toBare())) { return; // TODO: Send error back @@ -304,17 +304,17 @@ void Server::handleLinkLocalElementReceived(boost::shared_ptr e } } -void Server::handleConnectFinished(boost::shared_ptr connector, bool error) { +void Server::handleConnectFinished(std::shared_ptr connector, bool error) { if (error) { std::cerr << "Error connecting" << std::endl; // TODO: Send back queued stanzas } else { - boost::shared_ptr outgoingSession( + std::shared_ptr outgoingSession( new OutgoingLinkLocalSession( selfJID, connector->getService().getJID(), connector->getConnection(), &payloadParserFactories, &payloadSerializers, &xmlParserFactory)); - foreach(const boost::shared_ptr element, connector->getQueuedElements()) { + foreach(const std::shared_ptr element, connector->getQueuedElements()) { outgoingSession->queueElement(element); } registerLinkLocalSession(outgoingSession); @@ -322,42 +322,42 @@ void Server::handleConnectFinished(boost::shared_ptr connect connectors.erase(std::remove(connectors.begin(), connectors.end(), connector), connectors.end()); } -void Server::registerLinkLocalSession(boost::shared_ptr session) { +void Server::registerLinkLocalSession(std::shared_ptr session) { session->onSessionFinished.connect( boost::bind(&Server::handleLinkLocalSessionFinished, this, session)); session->onElementReceived.connect( boost::bind(&Server::handleLinkLocalElementReceived, this, _1, session)); linkLocalSessions.push_back(session); - //tracers.push_back(boost::make_shared(session)); + //tracers.push_back(std::make_shared(session)); session->startSession(); } -boost::shared_ptr Server::getLinkLocalSessionForJID(const JID& jid) { - foreach(const boost::shared_ptr session, linkLocalSessions) { +std::shared_ptr Server::getLinkLocalSessionForJID(const JID& jid) { + foreach(const std::shared_ptr session, linkLocalSessions) { if (session->getRemoteJID() == jid) { return session; } } - return boost::shared_ptr(); + return std::shared_ptr(); } -boost::shared_ptr Server::getLinkLocalConnectorForJID(const JID& jid) { - foreach(const boost::shared_ptr connector, connectors) { +std::shared_ptr Server::getLinkLocalConnectorForJID(const JID& jid) { + foreach(const std::shared_ptr connector, connectors) { if (connector->getService().getJID() == jid) { return connector; } } - return boost::shared_ptr(); + return std::shared_ptr(); } void Server::handleServiceRegistered(const DNSSDServiceID& service) { selfJID = JID(service.getName()); } -void Server::handleRosterChanged(boost::shared_ptr roster) { +void Server::handleRosterChanged(std::shared_ptr roster) { if (rosterRequested) { assert(serverFromClientSession); - boost::shared_ptr iq = IQ::createRequest( + std::shared_ptr iq = IQ::createRequest( IQ::Set, serverFromClientSession->getRemoteJID(), idGenerator.generateID(), roster); iq->setFrom(serverFromClientSession->getRemoteJID().toBare()); @@ -365,7 +365,7 @@ void Server::handleRosterChanged(boost::shared_ptr roster) { } } -void Server::handlePresenceChanged(boost::shared_ptr presence) { +void Server::handlePresenceChanged(std::shared_ptr presence) { if (rosterRequested) { serverFromClientSession->sendElement(presence); } @@ -399,9 +399,9 @@ void Server::handleLinkLocalConnectionServerStopped(boost::optional presence) { +LinkLocalServiceInfo Server::getLinkLocalServiceInfo(std::shared_ptr presence) { LinkLocalServiceInfo info; - boost::shared_ptr vcard = vCardCollection->getOwnVCard(); + std::shared_ptr vcard = vCardCollection->getOwnVCard(); if (!vcard->getFamilyName().empty() || !vcard->getGivenName().empty()) { info.setFirstName(vcard->getGivenName()); info.setLastName(vcard->getFamilyName()); diff --git a/Slimber/Server.h b/Slimber/Server.h index 7037cdb..725ad05 100644 --- a/Slimber/Server.h +++ b/Slimber/Server.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -65,26 +65,26 @@ namespace Swift { private: void stop(boost::optional); - void handleNewClientConnection(boost::shared_ptr c); + void handleNewClientConnection(std::shared_ptr c); void handleSessionStarted(); - void handleSessionFinished(boost::shared_ptr); - void handleElementReceived(boost::shared_ptr element, boost::shared_ptr session); - void handleRosterChanged(boost::shared_ptr roster); - void handlePresenceChanged(boost::shared_ptr presence); + void handleSessionFinished(std::shared_ptr); + void handleElementReceived(std::shared_ptr element, std::shared_ptr session); + void handleRosterChanged(std::shared_ptr roster); + void handlePresenceChanged(std::shared_ptr presence); void handleServiceRegistered(const DNSSDServiceID& service); - void handleNewLinkLocalConnection(boost::shared_ptr connection); - void handleLinkLocalSessionFinished(boost::shared_ptr session); - void handleLinkLocalElementReceived(boost::shared_ptr element, boost::shared_ptr session); - void handleConnectFinished(boost::shared_ptr connector, bool error); + void handleNewLinkLocalConnection(std::shared_ptr connection); + void handleLinkLocalSessionFinished(std::shared_ptr session); + void handleLinkLocalElementReceived(std::shared_ptr element, std::shared_ptr session); + void handleConnectFinished(std::shared_ptr connector, bool error); void handleClientConnectionServerStopped( boost::optional); void handleLinkLocalConnectionServerStopped( boost::optional); - boost::shared_ptr getLinkLocalSessionForJID(const JID& jid); - boost::shared_ptr getLinkLocalConnectorForJID(const JID& jid); - void registerLinkLocalSession(boost::shared_ptr session); + std::shared_ptr getLinkLocalSessionForJID(const JID& jid); + std::shared_ptr getLinkLocalConnectorForJID(const JID& jid); + void registerLinkLocalSession(std::shared_ptr session); void unregisterService(); - LinkLocalServiceInfo getLinkLocalServiceInfo(boost::shared_ptr presence); + LinkLocalServiceInfo getLinkLocalServiceInfo(std::shared_ptr presence); private: class DummyUserRegistry : public UserRegistry { @@ -112,15 +112,15 @@ namespace Swift { EventLoop* eventLoop; LinkLocalPresenceManager* presenceManager; bool stopping; - boost::shared_ptr serverFromClientConnectionServer; + std::shared_ptr serverFromClientConnectionServer; std::vector serverFromClientConnectionServerSignalConnections; - boost::shared_ptr serverFromClientSession; - boost::shared_ptr lastPresence; + std::shared_ptr serverFromClientSession; + std::shared_ptr lastPresence; JID selfJID; - boost::shared_ptr serverFromNetworkConnectionServer; + std::shared_ptr serverFromNetworkConnectionServer; std::vector serverFromNetworkConnectionServerSignalConnections; - std::vector< boost::shared_ptr > linkLocalSessions; - std::vector< boost::shared_ptr > connectors; - std::vector< boost::shared_ptr > tracers; + std::vector< std::shared_ptr > linkLocalSessions; + std::vector< std::shared_ptr > connectors; + std::vector< std::shared_ptr > tracers; }; } diff --git a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp index 45bc2aa..c8e7700 100644 --- a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp +++ b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp @@ -45,7 +45,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { public: void setUp() { eventLoop = new DummyEventLoop(); - querier = boost::make_shared("wonderland.lit", eventLoop); + querier = std::make_shared("wonderland.lit", eventLoop); browser = new LinkLocalServiceBrowser(querier); browser->start(); } @@ -59,14 +59,14 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { void testConstructor() { addService("alice@wonderland"); addService("rabbit@teaparty"); - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); CPPUNIT_ASSERT_EQUAL(2, static_cast(testling->getRoster()->getItems().size())); CPPUNIT_ASSERT_EQUAL(2, static_cast(testling->getAllPresence().size())); } void testServiceAdded() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); addService("alice@wonderland", "Alice"); @@ -82,7 +82,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { } void testServiceRemoved() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); addService("alice@wonderland"); removeService("alice@wonderland"); @@ -95,7 +95,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { } void testServiceChanged() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); addService("alice@wonderland"); updateServicePresence("alice@wonderland", LinkLocalServiceInfo::Away, "I'm Away"); @@ -108,13 +108,13 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { } void testGetAllPresence() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); addService("alice@wonderland"); addService("rabbit@teaparty"); updateServicePresence("rabbit@teaparty", LinkLocalServiceInfo::Away, "Partying"); - std::vector > presences = testling->getAllPresence(); + std::vector > presences = testling->getAllPresence(); CPPUNIT_ASSERT_EQUAL(2, static_cast(presences.size())); // The order doesn't matter CPPUNIT_ASSERT(JID("rabbit@teaparty") == presences[0]->getFrom()); @@ -124,12 +124,12 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { } void testGetRoster() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); addService("alice@wonderland", "Alice"); addService("rabbit@teaparty", "Rabbit"); - boost::shared_ptr roster = testling->getRoster(); + std::shared_ptr roster = testling->getRoster(); CPPUNIT_ASSERT_EQUAL(2, static_cast(roster->getItems().size())); boost::optional item; item = roster->getItem(JID("alice@wonderland")); @@ -143,7 +143,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { } void testGetRoster_InfoWithNick() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); addService("alice@wonderland", "Alice", "Alice In", "Wonderland"); @@ -152,7 +152,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { } void testGetRoster_InfoWithFirstName() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); addService("alice@wonderland", "", "Alice In", ""); @@ -161,7 +161,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { } void testGetRoster_InfoWithLastName() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); addService("alice@wonderland", "", "", "Wonderland"); @@ -170,7 +170,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { } void testGetRoster_InfoWithFirstAndLastName() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); addService("alice@wonderland", "", "Alice In", "Wonderland"); @@ -179,7 +179,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { } void testGetRoster_NoInfo() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); addService("alice@wonderland"); @@ -188,7 +188,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { } void testGetServiceForJID() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); addService("alice@wonderland"); addService("rabbit@teaparty"); @@ -200,7 +200,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { } void testGetServiceForJID_NoMatch() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); addService("alice@wonderland"); addService("queen@garden"); @@ -209,8 +209,8 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createTestling() { - boost::shared_ptr testling( + std::shared_ptr createTestling() { + std::shared_ptr testling( new LinkLocalPresenceManager(browser)); testling->onRosterChanged.connect(boost::bind( &LinkLocalPresenceManagerTest::handleRosterChanged, this, _1)); @@ -245,20 +245,20 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { eventLoop->processEvents(); } - void handleRosterChanged(boost::shared_ptr payload) { + void handleRosterChanged(std::shared_ptr payload) { rosterChanges.push_back(payload); } - void handlePresenceChanged(boost::shared_ptr presence) { + void handlePresenceChanged(std::shared_ptr presence) { presenceChanges.push_back(presence); } private: DummyEventLoop* eventLoop; - boost::shared_ptr querier; + std::shared_ptr querier; LinkLocalServiceBrowser* browser; - std::vector< boost::shared_ptr > rosterChanges; - std::vector< boost::shared_ptr > presenceChanges; + std::vector< std::shared_ptr > rosterChanges; + std::vector< std::shared_ptr > presenceChanges; }; CPPUNIT_TEST_SUITE_REGISTRATION(LinkLocalPresenceManagerTest); diff --git a/Slimber/VCardCollection.h b/Slimber/VCardCollection.h index 3295039..50147ec 100644 --- a/Slimber/VCardCollection.h +++ b/Slimber/VCardCollection.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include @@ -15,7 +15,7 @@ namespace Swift { public: virtual ~VCardCollection(); - virtual boost::shared_ptr getOwnVCard() const = 0; - virtual void setOwnVCard(boost::shared_ptr vcard) = 0; + virtual std::shared_ptr getOwnVCard() const = 0; + virtual void setOwnVCard(std::shared_ptr vcard) = 0; }; } diff --git a/Sluift/ElementConvertors/BodyConvertor.cpp b/Sluift/ElementConvertors/BodyConvertor.cpp index 4593f01..f6797b0 100644 --- a/Sluift/ElementConvertors/BodyConvertor.cpp +++ b/Sluift/ElementConvertors/BodyConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -20,15 +20,15 @@ BodyConvertor::BodyConvertor() : GenericLuaElementConvertor("body") { BodyConvertor::~BodyConvertor() { } -boost::shared_ptr BodyConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr BodyConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); if (boost::optional value = Lua::getStringField(L, -1, "text")) { result->setText(*value); } return result; } -void BodyConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void BodyConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (!payload->getText().empty()) { lua_pushstring(L, payload->getText().c_str()); diff --git a/Sluift/ElementConvertors/BodyConvertor.h b/Sluift/ElementConvertors/BodyConvertor.h index 75d23e7..64ff4d0 100644 --- a/Sluift/ElementConvertors/BodyConvertor.h +++ b/Sluift/ElementConvertors/BodyConvertor.h @@ -19,7 +19,7 @@ namespace Swift { BodyConvertor(); virtual ~BodyConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/CommandConvertor.cpp b/Sluift/ElementConvertors/CommandConvertor.cpp index 272e5d1..5bc3801 100644 --- a/Sluift/ElementConvertors/CommandConvertor.cpp +++ b/Sluift/ElementConvertors/CommandConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -49,8 +50,8 @@ CommandConvertor::CommandConvertor(LuaElementConvertors* convertors) : CommandConvertor::~CommandConvertor() { } -boost::shared_ptr CommandConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr CommandConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (!lua_isnil(L, -1)) { @@ -129,7 +130,7 @@ boost::shared_ptr CommandConvertor::doConvertFromLua(lua_State* L) { lua_getfield(L, -1, "form"); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr
form = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "form"))) { + if (std::shared_ptr form = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "form"))) { result->setForm(form); } } @@ -138,7 +139,7 @@ boost::shared_ptr CommandConvertor::doConvertFromLua(lua_State* L) { return result; } -void CommandConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void CommandConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { Lua::Table result; if (!payload->getNode().empty()) { result["node"] = Lua::valueRef(payload->getNode()); diff --git a/Sluift/ElementConvertors/CommandConvertor.h b/Sluift/ElementConvertors/CommandConvertor.h index 97b3f2f..1b0d481 100644 --- a/Sluift/ElementConvertors/CommandConvertor.h +++ b/Sluift/ElementConvertors/CommandConvertor.h @@ -19,8 +19,8 @@ namespace Swift { CommandConvertor(LuaElementConvertors* convertors); virtual ~CommandConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; private: LuaElementConvertors* convertors; diff --git a/Sluift/ElementConvertors/DOMElementConvertor.cpp b/Sluift/ElementConvertors/DOMElementConvertor.cpp index 85b505d..1e0e1bb 100644 --- a/Sluift/ElementConvertors/DOMElementConvertor.cpp +++ b/Sluift/ElementConvertors/DOMElementConvertor.cpp @@ -7,8 +7,7 @@ #include #include - -#include +#include #include @@ -145,10 +144,10 @@ namespace { int index = Lua::absoluteOffset(L, -1); for (lua_pushnil(L); lua_next(L, index) != 0; ) { if (lua_isstring(L, -1)) { - element.addNode(boost::make_shared(lua_tostring(L, -1))); + element.addNode(std::make_shared(lua_tostring(L, -1))); } else if (lua_istable(L, -1)) { - element.addNode(boost::make_shared(serializeElement(L))); + element.addNode(std::make_shared(serializeElement(L))); } lua_pop(L, 1); // value } @@ -165,17 +164,17 @@ DOMElementConvertor::DOMElementConvertor() { DOMElementConvertor::~DOMElementConvertor() { } -boost::shared_ptr DOMElementConvertor::convertFromLua(lua_State* L, int index, const std::string& type) { +std::shared_ptr DOMElementConvertor::convertFromLua(lua_State* L, int index, const std::string& type) { if (!lua_istable(L, index) || type != "dom") { - return boost::shared_ptr(); + return std::shared_ptr(); } - return boost::make_shared(serializeElement(L).c_str()); + return std::make_shared(serializeElement(L).c_str()); } boost::optional DOMElementConvertor::convertToLua( - lua_State* L, boost::shared_ptr element) { + lua_State* L, std::shared_ptr element) { // Serialize payload to XML - boost::shared_ptr payload = boost::dynamic_pointer_cast(element); + std::shared_ptr payload = std::dynamic_pointer_cast(element); if (!payload) { return boost::optional(); } @@ -188,7 +187,7 @@ boost::optional DOMElementConvertor::convertToLua( // Parse the payload again ParserClient parserClient(L); - boost::shared_ptr parser(parsers.createXMLParser(&parserClient)); + std::shared_ptr parser(parsers.createXMLParser(&parserClient)); bool result = parser->parse(serializedPayload); assert(result); diff --git a/Sluift/ElementConvertors/DOMElementConvertor.h b/Sluift/ElementConvertors/DOMElementConvertor.h index 0d20251..7b1ba58 100644 --- a/Sluift/ElementConvertors/DOMElementConvertor.h +++ b/Sluift/ElementConvertors/DOMElementConvertor.h @@ -18,8 +18,8 @@ namespace Swift { DOMElementConvertor(); virtual ~DOMElementConvertor(); - virtual boost::shared_ptr convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE; - virtual boost::optional convertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE; + virtual boost::optional convertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; private: PlatformXMLParserFactory parsers; diff --git a/Sluift/ElementConvertors/DefaultElementConvertor.cpp b/Sluift/ElementConvertors/DefaultElementConvertor.cpp index 8353207..f422139 100644 --- a/Sluift/ElementConvertors/DefaultElementConvertor.cpp +++ b/Sluift/ElementConvertors/DefaultElementConvertor.cpp @@ -18,12 +18,12 @@ DefaultElementConvertor::DefaultElementConvertor() { DefaultElementConvertor::~DefaultElementConvertor() { } -boost::shared_ptr DefaultElementConvertor::convertFromLua(lua_State*, int, const std::string& type) { +std::shared_ptr DefaultElementConvertor::convertFromLua(lua_State*, int, const std::string& type) { std::cerr << "Warning: Unable to convert type '" << type << "'" << std::endl; - return boost::shared_ptr(); + return std::shared_ptr(); } -boost::optional DefaultElementConvertor::convertToLua(lua_State*, boost::shared_ptr) { +boost::optional DefaultElementConvertor::convertToLua(lua_State*, std::shared_ptr) { // Should have been handled by the raw XML convertor assert(false); return NO_RESULT; diff --git a/Sluift/ElementConvertors/DefaultElementConvertor.h b/Sluift/ElementConvertors/DefaultElementConvertor.h index 8f57e4f..4aec300 100644 --- a/Sluift/ElementConvertors/DefaultElementConvertor.h +++ b/Sluift/ElementConvertors/DefaultElementConvertor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -16,7 +16,7 @@ namespace Swift { DefaultElementConvertor(); virtual ~DefaultElementConvertor(); - virtual boost::shared_ptr convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE; - virtual boost::optional convertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE; + virtual boost::optional convertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/DelayConvertor.cpp b/Sluift/ElementConvertors/DelayConvertor.cpp index b59744b..f23e137 100644 --- a/Sluift/ElementConvertors/DelayConvertor.cpp +++ b/Sluift/ElementConvertors/DelayConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -23,8 +24,8 @@ DelayConvertor::DelayConvertor() : GenericLuaElementConvertor("delay") { DelayConvertor::~DelayConvertor() { } -boost::shared_ptr DelayConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr DelayConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "stamp"); if (lua_isstring(L, -1)) { result->setStamp(stringToDateTime(lua_tostring(L, -1))); @@ -39,7 +40,7 @@ boost::shared_ptr DelayConvertor::doConvertFromLua(lua_State* L) { return result; } -void DelayConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void DelayConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getFrom()) { lua_pushstring(L, (*payload->getFrom()).toString().c_str()); diff --git a/Sluift/ElementConvertors/DelayConvertor.h b/Sluift/ElementConvertors/DelayConvertor.h index 064406c..b9f72f2 100644 --- a/Sluift/ElementConvertors/DelayConvertor.h +++ b/Sluift/ElementConvertors/DelayConvertor.h @@ -17,7 +17,7 @@ namespace Swift { DelayConvertor(); virtual ~DelayConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/DiscoInfoConvertor.cpp b/Sluift/ElementConvertors/DiscoInfoConvertor.cpp index fc48e6c..2aa4a77 100644 --- a/Sluift/ElementConvertors/DiscoInfoConvertor.cpp +++ b/Sluift/ElementConvertors/DiscoInfoConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -21,8 +22,8 @@ DiscoInfoConvertor::DiscoInfoConvertor() : GenericLuaElementConvertor DiscoInfoConvertor::~DiscoInfoConvertor() { } -boost::shared_ptr DiscoInfoConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr DiscoInfoConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); if (boost::optional value = Lua::getStringField(L, -1, "node")) { result->setNode(*value); } @@ -56,7 +57,7 @@ boost::shared_ptr DiscoInfoConvertor::doConvertFromLua(lua_State* L) return result; } -void DiscoInfoConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void DiscoInfoConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_newtable(L); if (!payload->getNode().empty()) { lua_pushstring(L, payload->getNode().c_str()); diff --git a/Sluift/ElementConvertors/DiscoInfoConvertor.h b/Sluift/ElementConvertors/DiscoInfoConvertor.h index 9e8d36d..34f8237 100644 --- a/Sluift/ElementConvertors/DiscoInfoConvertor.h +++ b/Sluift/ElementConvertors/DiscoInfoConvertor.h @@ -17,8 +17,8 @@ namespace Swift { DiscoInfoConvertor(); virtual ~DiscoInfoConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/DiscoItemsConvertor.cpp b/Sluift/ElementConvertors/DiscoItemsConvertor.cpp index 32cbb6e..c15a0f8 100644 --- a/Sluift/ElementConvertors/DiscoItemsConvertor.cpp +++ b/Sluift/ElementConvertors/DiscoItemsConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -21,8 +22,8 @@ DiscoItemsConvertor::DiscoItemsConvertor() : GenericLuaElementConvertor DiscoItemsConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr DiscoItemsConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); if (boost::optional value = Lua::getStringField(L, -1, "node")) { result->setNode(*value); } @@ -40,7 +41,7 @@ boost::shared_ptr DiscoItemsConvertor::doConvertFromLua(lua_State* L return result; } -void DiscoItemsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void DiscoItemsConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_newtable(L); if (!payload->getNode().empty()) { lua_pushstring(L, payload->getNode().c_str()); diff --git a/Sluift/ElementConvertors/DiscoItemsConvertor.h b/Sluift/ElementConvertors/DiscoItemsConvertor.h index aa1f1e5..a77b948 100644 --- a/Sluift/ElementConvertors/DiscoItemsConvertor.h +++ b/Sluift/ElementConvertors/DiscoItemsConvertor.h @@ -17,7 +17,7 @@ namespace Swift { DiscoItemsConvertor(); virtual ~DiscoItemsConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/ElementConvertors.ipp b/Sluift/ElementConvertors/ElementConvertors.ipp index 64e7540..a81c9cf 100644 --- a/Sluift/ElementConvertors/ElementConvertors.ipp +++ b/Sluift/ElementConvertors/ElementConvertors.ipp @@ -45,43 +45,43 @@ #include void LuaElementConvertors::registerConvertors() { - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared(this)); } diff --git a/Sluift/ElementConvertors/FormConvertor.cpp b/Sluift/ElementConvertors/FormConvertor.cpp index 5b6f664..a0e3dfe 100644 --- a/Sluift/ElementConvertors/FormConvertor.cpp +++ b/Sluift/ElementConvertors/FormConvertor.cpp @@ -6,11 +6,11 @@ #include +#include #include #include #include -#include #include @@ -66,7 +66,7 @@ namespace { return 0; } - Lua::Table convertFieldToLua(boost::shared_ptr field) { + Lua::Table convertFieldToLua(std::shared_ptr field) { Lua::Table luaField = boost::assign::map_list_of("name", Lua::valueRef(field->getName())); std::string type; switch (field->getType()) { @@ -116,17 +116,17 @@ namespace { return luaField; } - Lua::Array convertFieldListToLua(const std::vector< boost::shared_ptr >& fieldList) { + Lua::Array convertFieldListToLua(const std::vector< std::shared_ptr >& fieldList) { Lua::Array fields; - foreach(boost::shared_ptr field, fieldList) { + foreach(std::shared_ptr field, fieldList) { fields.push_back(convertFieldToLua(field)); } return fields; } - boost::shared_ptr convertFieldFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); + std::shared_ptr convertFieldFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); FormField::Type fieldType = FormField::UnknownType; boost::optional type = Lua::getStringField(L, -1, "type"); if (type) { @@ -212,8 +212,8 @@ namespace { return result; } - std::vector< boost::shared_ptr > convertFieldListFromLua(lua_State* L) { - std::vector< boost::shared_ptr > result; + std::vector< std::shared_ptr > convertFieldListFromLua(lua_State* L) { + std::vector< std::shared_ptr > result; for (lua_pushnil(L); lua_next(L, -2);) { result.push_back(convertFieldFromLua(L)); lua_pop(L, 1); @@ -221,8 +221,8 @@ namespace { return result; } - boost::shared_ptr convertFormFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); + std::shared_ptr convertFormFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); if (boost::optional title = Lua::getStringField(L, -1, "title")) { result->setTitle(*title); } @@ -245,7 +245,7 @@ namespace { lua_getfield(L, -1, "fields"); if (lua_istable(L, -1)) { - foreach (boost::shared_ptr formField, convertFieldListFromLua(L)) { + foreach (std::shared_ptr formField, convertFieldListFromLua(L)) { result->addField(formField); } } @@ -253,7 +253,7 @@ namespace { lua_getfield(L, -1, "reported_fields"); if (lua_istable(L, -1)) { - foreach (boost::shared_ptr formField, convertFieldListFromLua(L)) { + foreach (std::shared_ptr formField, convertFieldListFromLua(L)) { result->addReportedField(formField); } } @@ -271,7 +271,7 @@ namespace { return result; } - void convertFormToLua(lua_State* L, boost::shared_ptr payload) { + void convertFormToLua(lua_State* L, std::shared_ptr payload) { std::string type; switch (payload->getType()) { case Form::FormType: type = "form"; break; @@ -315,16 +315,16 @@ namespace { } int createSubmission(lua_State* L) { - boost::shared_ptr form = convertFormFromLua(L); + std::shared_ptr form = convertFormFromLua(L); // Remove all redundant elements form->setInstructions(""); form->setTitle(""); form->clearItems(); form->clearReportedFields(); - std::vector< boost::shared_ptr > fields(form->getFields()); + std::vector< std::shared_ptr > fields(form->getFields()); form->clearFields(); - foreach (boost::shared_ptr field, fields) { + foreach (std::shared_ptr field, fields) { if (field->getType() == FormField::FixedType) { continue; } @@ -350,11 +350,11 @@ FormConvertor::FormConvertor() : GenericLuaElementConvertor("form") { FormConvertor::~FormConvertor() { } -boost::shared_ptr FormConvertor::doConvertFromLua(lua_State* L) { +std::shared_ptr FormConvertor::doConvertFromLua(lua_State* L) { return convertFormFromLua(L); } -void FormConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void FormConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { convertFormToLua(L, payload); lua_pushstring(L, "create_submission"); diff --git a/Sluift/ElementConvertors/FormConvertor.h b/Sluift/ElementConvertors/FormConvertor.h index 05ca57f..b32a940 100644 --- a/Sluift/ElementConvertors/FormConvertor.h +++ b/Sluift/ElementConvertors/FormConvertor.h @@ -17,7 +17,7 @@ namespace Swift { FormConvertor(); virtual ~FormConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/ForwardedConvertor.cpp b/Sluift/ElementConvertors/ForwardedConvertor.cpp index 82539bb..8474252 100644 --- a/Sluift/ElementConvertors/ForwardedConvertor.cpp +++ b/Sluift/ElementConvertors/ForwardedConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -29,11 +30,11 @@ ForwardedConvertor::ForwardedConvertor(LuaElementConvertors* convertors) : ForwardedConvertor::~ForwardedConvertor() { } -boost::shared_ptr ForwardedConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr ForwardedConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "delay"); if (!lua_isnil(L, -1)) { - boost::shared_ptr delay = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "delay")); + std::shared_ptr delay = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "delay")); if (!!delay) { result->setDelay(delay); } @@ -41,7 +42,7 @@ boost::shared_ptr ForwardedConvertor::doConvertFromLua(lua_State* L) lua_pop(L, 1); lua_getfield(L, -1, "stanza"); if (!lua_isnil(L, -1)) { - boost::shared_ptr stanza = boost::dynamic_pointer_cast(convertors->convertFromLua(L, -1)); + std::shared_ptr stanza = std::dynamic_pointer_cast(convertors->convertFromLua(L, -1)); if (!!stanza) { result->setStanza(stanza); } @@ -51,12 +52,12 @@ boost::shared_ptr ForwardedConvertor::doConvertFromLua(lua_State* L) return result; } -void ForwardedConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void ForwardedConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (convertors->convertToLuaUntyped(L, payload->getDelay()) > 0) { lua_setfield(L, -2, "delay"); } - boost::shared_ptr stanza = payload->getStanza(); + std::shared_ptr stanza = payload->getStanza(); if (!!stanza) { if (convertors->convertToLua(L, stanza) > 0) { lua_setfield(L, -2, "stanza"); diff --git a/Sluift/ElementConvertors/ForwardedConvertor.h b/Sluift/ElementConvertors/ForwardedConvertor.h index ee022fa..a83b5f4 100644 --- a/Sluift/ElementConvertors/ForwardedConvertor.h +++ b/Sluift/ElementConvertors/ForwardedConvertor.h @@ -19,8 +19,8 @@ namespace Swift { ForwardedConvertor(LuaElementConvertors* convertors); virtual ~ForwardedConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/IQConvertor.cpp b/Sluift/ElementConvertors/IQConvertor.cpp index 7e2cb7e..67a4a2a 100644 --- a/Sluift/ElementConvertors/IQConvertor.cpp +++ b/Sluift/ElementConvertors/IQConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,8 +22,8 @@ IQConvertor::IQConvertor(LuaElementConvertors* convertors) : IQConvertor::~IQConvertor() { } -boost::shared_ptr IQConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = getStanza(L, convertors); +std::shared_ptr IQConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = getStanza(L, convertors); lua_getfield(L, -1, "type"); if (lua_isstring(L, -1)) { result->setType(IQConvertor::convertIQTypeFromString(lua_tostring(L, -1))); @@ -32,7 +32,7 @@ boost::shared_ptr IQConvertor::doConvertFromLua(lua_State* L) { return result; } -void IQConvertor::doConvertToLua(lua_State* L, boost::shared_ptr stanza) { +void IQConvertor::doConvertToLua(lua_State* L, std::shared_ptr stanza) { pushStanza(L, stanza, convertors); const std::string type = IQConvertor::convertIQTypeToString(stanza->getType()); lua_pushstring(L, type.c_str()); diff --git a/Sluift/ElementConvertors/IQConvertor.h b/Sluift/ElementConvertors/IQConvertor.h index 49896e7..859900a 100644 --- a/Sluift/ElementConvertors/IQConvertor.h +++ b/Sluift/ElementConvertors/IQConvertor.h @@ -19,8 +19,8 @@ namespace Swift { IQConvertor(LuaElementConvertors* convertors); virtual ~IQConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; diff --git a/Sluift/ElementConvertors/IsodeIQDelegationConvertor.cpp b/Sluift/ElementConvertors/IsodeIQDelegationConvertor.cpp index e256dc7..56b4a80 100644 --- a/Sluift/ElementConvertors/IsodeIQDelegationConvertor.cpp +++ b/Sluift/ElementConvertors/IsodeIQDelegationConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,11 +22,11 @@ IsodeIQDelegationConvertor::IsodeIQDelegationConvertor(LuaElementConvertors* con IsodeIQDelegationConvertor::~IsodeIQDelegationConvertor() { } -boost::shared_ptr IsodeIQDelegationConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr IsodeIQDelegationConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "forward"); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "forwarded"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "forwarded"))) { result->setForward(payload); } } @@ -34,7 +34,7 @@ boost::shared_ptr IsodeIQDelegationConvertor::doConvertFromLu return result; } -void IsodeIQDelegationConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void IsodeIQDelegationConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (convertors->convertToLuaUntyped(L, payload->getForward()) > 0) { lua_setfield(L, -2, "forward"); diff --git a/Sluift/ElementConvertors/IsodeIQDelegationConvertor.h b/Sluift/ElementConvertors/IsodeIQDelegationConvertor.h index 9fa005b..f8b8c4a 100644 --- a/Sluift/ElementConvertors/IsodeIQDelegationConvertor.h +++ b/Sluift/ElementConvertors/IsodeIQDelegationConvertor.h @@ -19,8 +19,8 @@ namespace Swift { IsodeIQDelegationConvertor(LuaElementConvertors* convertors); virtual ~IsodeIQDelegationConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/MAMFinConvertor.cpp b/Sluift/ElementConvertors/MAMFinConvertor.cpp index 1bb6c05..4fb8201 100644 --- a/Sluift/ElementConvertors/MAMFinConvertor.cpp +++ b/Sluift/ElementConvertors/MAMFinConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -25,8 +26,8 @@ MAMFinConvertor::MAMFinConvertor(LuaElementConvertors* convertors) : MAMFinConvertor::~MAMFinConvertor() { } -boost::shared_ptr MAMFinConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr MAMFinConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "query_id"); if (lua_isstring(L, -1)) { result->setQueryID(std::string(lua_tostring(L, -1))); @@ -44,7 +45,7 @@ boost::shared_ptr MAMFinConvertor::doConvertFromLua(lua_State* L) { lua_pop(L, 1); lua_getfield(L, -1, "result_set"); if (!lua_isnil(L, -1)) { - boost::shared_ptr resultSet = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "result_set")); + std::shared_ptr resultSet = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "result_set")); if (!!resultSet) { result->setResultSet(resultSet); } @@ -53,7 +54,7 @@ boost::shared_ptr MAMFinConvertor::doConvertFromLua(lua_State* L) { return result; } -void MAMFinConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void MAMFinConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getQueryID()) { lua_pushstring(L, (*payload->getQueryID()).c_str()); diff --git a/Sluift/ElementConvertors/MAMFinConvertor.h b/Sluift/ElementConvertors/MAMFinConvertor.h index 9345aeb..371076a 100644 --- a/Sluift/ElementConvertors/MAMFinConvertor.h +++ b/Sluift/ElementConvertors/MAMFinConvertor.h @@ -19,8 +19,8 @@ namespace Swift { MAMFinConvertor(LuaElementConvertors* convertors); virtual ~MAMFinConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/MAMQueryConvertor.cpp b/Sluift/ElementConvertors/MAMQueryConvertor.cpp index a52abd9..52337ce 100644 --- a/Sluift/ElementConvertors/MAMQueryConvertor.cpp +++ b/Sluift/ElementConvertors/MAMQueryConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -26,8 +27,8 @@ MAMQueryConvertor::MAMQueryConvertor(LuaElementConvertors* convertors) : MAMQueryConvertor::~MAMQueryConvertor() { } -boost::shared_ptr MAMQueryConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr MAMQueryConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "query_id"); if (lua_isstring(L, -1)) { result->setQueryID(std::string(lua_tostring(L, -1))); @@ -40,7 +41,7 @@ boost::shared_ptr MAMQueryConvertor::doConvertFromLua(lua_State* L) { lua_pop(L, 1); lua_getfield(L, -1, "form"); if (!lua_isnil(L, -1)) { - boost::shared_ptr form = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "form")); + std::shared_ptr form = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "form")); if (!!form) { result->setForm(form); } @@ -48,7 +49,7 @@ boost::shared_ptr MAMQueryConvertor::doConvertFromLua(lua_State* L) { lua_pop(L, 1); lua_getfield(L, -1, "result_set"); if (!lua_isnil(L, -1)) { - boost::shared_ptr resultSet = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "result_set")); + std::shared_ptr resultSet = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "result_set")); if (!!resultSet) { result->setResultSet(resultSet); } @@ -57,7 +58,7 @@ boost::shared_ptr MAMQueryConvertor::doConvertFromLua(lua_State* L) { return result; } -void MAMQueryConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void MAMQueryConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getQueryID()) { lua_pushstring(L, (*payload->getQueryID()).c_str()); diff --git a/Sluift/ElementConvertors/MAMQueryConvertor.h b/Sluift/ElementConvertors/MAMQueryConvertor.h index 54a99e0..4ee119e 100644 --- a/Sluift/ElementConvertors/MAMQueryConvertor.h +++ b/Sluift/ElementConvertors/MAMQueryConvertor.h @@ -19,8 +19,8 @@ namespace Swift { MAMQueryConvertor(LuaElementConvertors* convertors); virtual ~MAMQueryConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/MAMResultConvertor.cpp b/Sluift/ElementConvertors/MAMResultConvertor.cpp index 2260eb1..25b4c39 100644 --- a/Sluift/ElementConvertors/MAMResultConvertor.cpp +++ b/Sluift/ElementConvertors/MAMResultConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -25,11 +26,11 @@ MAMResultConvertor::MAMResultConvertor(LuaElementConvertors* convertors) : MAMResultConvertor::~MAMResultConvertor() { } -boost::shared_ptr MAMResultConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr MAMResultConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "payload"); if (!lua_isnil(L, -1)) { - boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "payload")); + std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "payload")); if (!!payload) { result->setPayload(payload); } @@ -48,7 +49,7 @@ boost::shared_ptr MAMResultConvertor::doConvertFromLua(lua_State* L) return result; } -void MAMResultConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void MAMResultConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (convertors->convertToLuaUntyped(L, payload->getPayload()) > 0) { lua_setfield(L, -2, "payload"); diff --git a/Sluift/ElementConvertors/MAMResultConvertor.h b/Sluift/ElementConvertors/MAMResultConvertor.h index c1ddf31..a1b2564 100644 --- a/Sluift/ElementConvertors/MAMResultConvertor.h +++ b/Sluift/ElementConvertors/MAMResultConvertor.h @@ -19,8 +19,8 @@ namespace Swift { MAMResultConvertor(LuaElementConvertors* convertors); virtual ~MAMResultConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/MessageConvertor.cpp b/Sluift/ElementConvertors/MessageConvertor.cpp index c9285ef..b7bf286 100644 --- a/Sluift/ElementConvertors/MessageConvertor.cpp +++ b/Sluift/ElementConvertors/MessageConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,8 +22,8 @@ MessageConvertor::MessageConvertor(LuaElementConvertors* convertors) : MessageConvertor::~MessageConvertor() { } -boost::shared_ptr MessageConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = getStanza(L, convertors); +std::shared_ptr MessageConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = getStanza(L, convertors); lua_getfield(L, -1, "type"); if (lua_isstring(L, -1)) { result->setType(convertMessageTypeFromString(lua_tostring(L, -1))); @@ -32,7 +32,7 @@ boost::shared_ptr MessageConvertor::doConvertFromLua(lua_State* L) { return result; } -void MessageConvertor::doConvertToLua(lua_State* L, boost::shared_ptr stanza) { +void MessageConvertor::doConvertToLua(lua_State* L, std::shared_ptr stanza) { pushStanza(L, stanza, convertors); const std::string type = convertMessageTypeToString(stanza->getType()); lua_pushstring(L, type.c_str()); diff --git a/Sluift/ElementConvertors/MessageConvertor.h b/Sluift/ElementConvertors/MessageConvertor.h index e05e00e..2031552 100644 --- a/Sluift/ElementConvertors/MessageConvertor.h +++ b/Sluift/ElementConvertors/MessageConvertor.h @@ -19,8 +19,8 @@ namespace Swift { MessageConvertor(LuaElementConvertors* convertors); virtual ~MessageConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; diff --git a/Sluift/ElementConvertors/PresenceConvertor.cpp b/Sluift/ElementConvertors/PresenceConvertor.cpp index 1b423cc..abfac77 100644 --- a/Sluift/ElementConvertors/PresenceConvertor.cpp +++ b/Sluift/ElementConvertors/PresenceConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,8 +22,8 @@ PresenceConvertor::PresenceConvertor(LuaElementConvertors* convertors) : PresenceConvertor::~PresenceConvertor() { } -boost::shared_ptr PresenceConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = getStanza(L, convertors); +std::shared_ptr PresenceConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = getStanza(L, convertors); lua_getfield(L, -1, "type"); if (lua_isstring(L, -1)) { result->setType(convertPresenceTypeFromString(lua_tostring(L, -1))); @@ -32,7 +32,7 @@ boost::shared_ptr PresenceConvertor::doConvertFromLua(lua_State* L) { return result; } -void PresenceConvertor::doConvertToLua(lua_State* L, boost::shared_ptr stanza) { +void PresenceConvertor::doConvertToLua(lua_State* L, std::shared_ptr stanza) { pushStanza(L, stanza, convertors); const std::string type = convertPresenceTypeToString(stanza->getType()); lua_pushstring(L, type.c_str()); diff --git a/Sluift/ElementConvertors/PresenceConvertor.h b/Sluift/ElementConvertors/PresenceConvertor.h index ae2e78a..11ec547 100644 --- a/Sluift/ElementConvertors/PresenceConvertor.h +++ b/Sluift/ElementConvertors/PresenceConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PresenceConvertor(LuaElementConvertors* convertors); virtual ~PresenceConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; diff --git a/Sluift/ElementConvertors/PubSubAffiliationConvertor.cpp b/Sluift/ElementConvertors/PubSubAffiliationConvertor.cpp index 84d8f55..62a2b60 100644 --- a/Sluift/ElementConvertors/PubSubAffiliationConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubAffiliationConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -19,8 +19,8 @@ PubSubAffiliationConvertor::PubSubAffiliationConvertor() : PubSubAffiliationConvertor::~PubSubAffiliationConvertor() { } -boost::shared_ptr PubSubAffiliationConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubAffiliationConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -51,7 +51,7 @@ boost::shared_ptr PubSubAffiliationConvertor::doConvertFromLu return result; } -void PubSubAffiliationConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubAffiliationConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); diff --git a/Sluift/ElementConvertors/PubSubAffiliationConvertor.h b/Sluift/ElementConvertors/PubSubAffiliationConvertor.h index e91342c..456ef4e 100644 --- a/Sluift/ElementConvertors/PubSubAffiliationConvertor.h +++ b/Sluift/ElementConvertors/PubSubAffiliationConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubAffiliationConvertor(); virtual ~PubSubAffiliationConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/PubSubAffiliationsConvertor.cpp b/Sluift/ElementConvertors/PubSubAffiliationsConvertor.cpp index f5eab7a..8eae795 100644 --- a/Sluift/ElementConvertors/PubSubAffiliationsConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubAffiliationsConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -25,20 +26,20 @@ PubSubAffiliationsConvertor::PubSubAffiliationsConvertor(LuaElementConvertors* c PubSubAffiliationsConvertor::~PubSubAffiliationsConvertor() { } -boost::shared_ptr PubSubAffiliationsConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubAffiliationsConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); } lua_pop(L, 1); if (lua_type(L, -1) == LUA_TTABLE) { - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; for(size_t i = 0; i < lua_objlen(L, -1); ++i) { lua_pushnumber(L, i + 1); lua_gettable(L, -2); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_affiliation"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_affiliation"))) { items.push_back(payload); } } @@ -50,7 +51,7 @@ boost::shared_ptr PubSubAffiliationsConvertor::doConvertFrom return result; } -void PubSubAffiliationsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubAffiliationsConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getNode()) { lua_pushstring(L, (*payload->getNode()).c_str()); @@ -59,7 +60,7 @@ void PubSubAffiliationsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr if (!payload->getAffiliations().empty()) { { int i = 0; - foreach(boost::shared_ptr item, payload->getAffiliations()) { + foreach(std::shared_ptr item, payload->getAffiliations()) { if (convertors->convertToLuaUntyped(L, item) > 0) { lua_rawseti(L, -2, boost::numeric_cast(i+1)); ++i; diff --git a/Sluift/ElementConvertors/PubSubAffiliationsConvertor.h b/Sluift/ElementConvertors/PubSubAffiliationsConvertor.h index 965fb2a..8ad38b2 100644 --- a/Sluift/ElementConvertors/PubSubAffiliationsConvertor.h +++ b/Sluift/ElementConvertors/PubSubAffiliationsConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubAffiliationsConvertor(LuaElementConvertors* convertors); virtual ~PubSubAffiliationsConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubConfigureConvertor.cpp b/Sluift/ElementConvertors/PubSubConfigureConvertor.cpp index 13ffb7b..d8bf05d 100644 --- a/Sluift/ElementConvertors/PubSubConfigureConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubConfigureConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,11 +22,11 @@ PubSubConfigureConvertor::PubSubConfigureConvertor(LuaElementConvertors* convert PubSubConfigureConvertor::~PubSubConfigureConvertor() { } -boost::shared_ptr PubSubConfigureConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubConfigureConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "data"); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "form"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "form"))) { result->setData(payload); } } @@ -34,7 +34,7 @@ boost::shared_ptr PubSubConfigureConvertor::doConvertFromLua(lu return result; } -void PubSubConfigureConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubConfigureConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (convertors->convertToLuaUntyped(L, payload->getData()) > 0) { lua_setfield(L, -2, "data"); diff --git a/Sluift/ElementConvertors/PubSubConfigureConvertor.h b/Sluift/ElementConvertors/PubSubConfigureConvertor.h index 865d30a..e41bb68 100644 --- a/Sluift/ElementConvertors/PubSubConfigureConvertor.h +++ b/Sluift/ElementConvertors/PubSubConfigureConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubConfigureConvertor(LuaElementConvertors* convertors); virtual ~PubSubConfigureConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubCreateConvertor.cpp b/Sluift/ElementConvertors/PubSubCreateConvertor.cpp index 8a4086b..80553d5 100644 --- a/Sluift/ElementConvertors/PubSubCreateConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubCreateConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,8 +22,8 @@ PubSubCreateConvertor::PubSubCreateConvertor(LuaElementConvertors* convertors) : PubSubCreateConvertor::~PubSubCreateConvertor() { } -boost::shared_ptr PubSubCreateConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubCreateConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -31,7 +31,7 @@ boost::shared_ptr PubSubCreateConvertor::doConvertFromLua(lua_Stat lua_pop(L, 1); lua_getfield(L, -1, "configure"); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_configure"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_configure"))) { result->setConfigure(payload); } } @@ -39,7 +39,7 @@ boost::shared_ptr PubSubCreateConvertor::doConvertFromLua(lua_Stat return result; } -void PubSubCreateConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubCreateConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); diff --git a/Sluift/ElementConvertors/PubSubCreateConvertor.h b/Sluift/ElementConvertors/PubSubCreateConvertor.h index 189da27..12c47da 100644 --- a/Sluift/ElementConvertors/PubSubCreateConvertor.h +++ b/Sluift/ElementConvertors/PubSubCreateConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubCreateConvertor(LuaElementConvertors* convertors); virtual ~PubSubCreateConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubDefaultConvertor.cpp b/Sluift/ElementConvertors/PubSubDefaultConvertor.cpp index 5f8fe24..8406913 100644 --- a/Sluift/ElementConvertors/PubSubDefaultConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubDefaultConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -19,8 +19,8 @@ PubSubDefaultConvertor::PubSubDefaultConvertor() : PubSubDefaultConvertor::~PubSubDefaultConvertor() { } -boost::shared_ptr PubSubDefaultConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubDefaultConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -42,7 +42,7 @@ boost::shared_ptr PubSubDefaultConvertor::doConvertFromLua(lua_St return result; } -void PubSubDefaultConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubDefaultConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getNode()) { lua_pushstring(L, (*payload->getNode()).c_str()); diff --git a/Sluift/ElementConvertors/PubSubDefaultConvertor.h b/Sluift/ElementConvertors/PubSubDefaultConvertor.h index 968e03e..fbdbf95 100644 --- a/Sluift/ElementConvertors/PubSubDefaultConvertor.h +++ b/Sluift/ElementConvertors/PubSubDefaultConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubDefaultConvertor(); virtual ~PubSubDefaultConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/PubSubEventAssociateConvertor.cpp b/Sluift/ElementConvertors/PubSubEventAssociateConvertor.cpp index bc43b93..eb025a5 100644 --- a/Sluift/ElementConvertors/PubSubEventAssociateConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubEventAssociateConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -19,8 +19,8 @@ PubSubEventAssociateConvertor::PubSubEventAssociateConvertor() : PubSubEventAssociateConvertor::~PubSubEventAssociateConvertor() { } -boost::shared_ptr PubSubEventAssociateConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubEventAssociateConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -29,7 +29,7 @@ boost::shared_ptr PubSubEventAssociateConvertor::doConvert return result; } -void PubSubEventAssociateConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubEventAssociateConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); diff --git a/Sluift/ElementConvertors/PubSubEventAssociateConvertor.h b/Sluift/ElementConvertors/PubSubEventAssociateConvertor.h index 2ba3b40..975aa60 100644 --- a/Sluift/ElementConvertors/PubSubEventAssociateConvertor.h +++ b/Sluift/ElementConvertors/PubSubEventAssociateConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubEventAssociateConvertor(); virtual ~PubSubEventAssociateConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/PubSubEventCollectionConvertor.cpp b/Sluift/ElementConvertors/PubSubEventCollectionConvertor.cpp index 88c7419..721b1b4 100644 --- a/Sluift/ElementConvertors/PubSubEventCollectionConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubEventCollectionConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,8 +22,8 @@ PubSubEventCollectionConvertor::PubSubEventCollectionConvertor(LuaElementConvert PubSubEventCollectionConvertor::~PubSubEventCollectionConvertor() { } -boost::shared_ptr PubSubEventCollectionConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubEventCollectionConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -31,14 +31,14 @@ boost::shared_ptr PubSubEventCollectionConvertor::doConve lua_pop(L, 1); lua_getfield(L, -1, "disassociate"); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_disassociate"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_disassociate"))) { result->setDisassociate(payload); } } lua_pop(L, 1); lua_getfield(L, -1, "associate"); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_associate"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_associate"))) { result->setAssociate(payload); } } @@ -46,7 +46,7 @@ boost::shared_ptr PubSubEventCollectionConvertor::doConve return result; } -void PubSubEventCollectionConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubEventCollectionConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getNode()) { lua_pushstring(L, (*payload->getNode()).c_str()); diff --git a/Sluift/ElementConvertors/PubSubEventCollectionConvertor.h b/Sluift/ElementConvertors/PubSubEventCollectionConvertor.h index 7c11178..e8feada 100644 --- a/Sluift/ElementConvertors/PubSubEventCollectionConvertor.h +++ b/Sluift/ElementConvertors/PubSubEventCollectionConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubEventCollectionConvertor(LuaElementConvertors* convertors); virtual ~PubSubEventCollectionConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubEventConfigurationConvertor.cpp b/Sluift/ElementConvertors/PubSubEventConfigurationConvertor.cpp index 2c149fa..828a010 100644 --- a/Sluift/ElementConvertors/PubSubEventConfigurationConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubEventConfigurationConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,8 +22,8 @@ PubSubEventConfigurationConvertor::PubSubEventConfigurationConvertor(LuaElementC PubSubEventConfigurationConvertor::~PubSubEventConfigurationConvertor() { } -boost::shared_ptr PubSubEventConfigurationConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubEventConfigurationConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -31,7 +31,7 @@ boost::shared_ptr PubSubEventConfigurationConvertor::d lua_pop(L, 1); lua_getfield(L, -1, "data"); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "form"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "form"))) { result->setData(payload); } } @@ -39,7 +39,7 @@ boost::shared_ptr PubSubEventConfigurationConvertor::d return result; } -void PubSubEventConfigurationConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubEventConfigurationConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); diff --git a/Sluift/ElementConvertors/PubSubEventConfigurationConvertor.h b/Sluift/ElementConvertors/PubSubEventConfigurationConvertor.h index e8a17e7..dd327d4 100644 --- a/Sluift/ElementConvertors/PubSubEventConfigurationConvertor.h +++ b/Sluift/ElementConvertors/PubSubEventConfigurationConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubEventConfigurationConvertor(LuaElementConvertors* convertors); virtual ~PubSubEventConfigurationConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubEventConvertor.cpp b/Sluift/ElementConvertors/PubSubEventConvertor.cpp index 2330bcc..da7c849 100644 --- a/Sluift/ElementConvertors/PubSubEventConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubEventConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,14 +22,14 @@ PubSubEventConvertor::PubSubEventConvertor(LuaElementConvertors* convertors) : PubSubEventConvertor::~PubSubEventConvertor() { } -boost::shared_ptr PubSubEventConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLua(L, -1))) { +std::shared_ptr PubSubEventConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLua(L, -1))) { result->setPayload(payload); } return result; } -void PubSubEventConvertor::doConvertToLua(lua_State* L, boost::shared_ptr event) { +void PubSubEventConvertor::doConvertToLua(lua_State* L, std::shared_ptr event) { convertors->convertToLua(L, event->getPayload()); } diff --git a/Sluift/ElementConvertors/PubSubEventConvertor.h b/Sluift/ElementConvertors/PubSubEventConvertor.h index 2797b88..8b0cbec 100644 --- a/Sluift/ElementConvertors/PubSubEventConvertor.h +++ b/Sluift/ElementConvertors/PubSubEventConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubEventConvertor(LuaElementConvertors* convertors); virtual ~PubSubEventConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; private: LuaElementConvertors* convertors; diff --git a/Sluift/ElementConvertors/PubSubEventDeleteConvertor.cpp b/Sluift/ElementConvertors/PubSubEventDeleteConvertor.cpp index aa77319..06fb3a2 100644 --- a/Sluift/ElementConvertors/PubSubEventDeleteConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubEventDeleteConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,8 +22,8 @@ PubSubEventDeleteConvertor::PubSubEventDeleteConvertor(LuaElementConvertors* con PubSubEventDeleteConvertor::~PubSubEventDeleteConvertor() { } -boost::shared_ptr PubSubEventDeleteConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubEventDeleteConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -31,7 +31,7 @@ boost::shared_ptr PubSubEventDeleteConvertor::doConvertFromLu lua_pop(L, 1); lua_getfield(L, -1, "redirects"); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_redirect"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_redirect"))) { result->setRedirects(payload); } } @@ -39,7 +39,7 @@ boost::shared_ptr PubSubEventDeleteConvertor::doConvertFromLu return result; } -void PubSubEventDeleteConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubEventDeleteConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); diff --git a/Sluift/ElementConvertors/PubSubEventDeleteConvertor.h b/Sluift/ElementConvertors/PubSubEventDeleteConvertor.h index b53c3d7..ba2b0b8 100644 --- a/Sluift/ElementConvertors/PubSubEventDeleteConvertor.h +++ b/Sluift/ElementConvertors/PubSubEventDeleteConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubEventDeleteConvertor(LuaElementConvertors* convertors); virtual ~PubSubEventDeleteConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubEventDisassociateConvertor.cpp b/Sluift/ElementConvertors/PubSubEventDisassociateConvertor.cpp index 1d417ac..0ada5ce 100644 --- a/Sluift/ElementConvertors/PubSubEventDisassociateConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubEventDisassociateConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -19,8 +19,8 @@ PubSubEventDisassociateConvertor::PubSubEventDisassociateConvertor() : PubSubEventDisassociateConvertor::~PubSubEventDisassociateConvertor() { } -boost::shared_ptr PubSubEventDisassociateConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubEventDisassociateConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -29,7 +29,7 @@ boost::shared_ptr PubSubEventDisassociateConvertor::doC return result; } -void PubSubEventDisassociateConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubEventDisassociateConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); diff --git a/Sluift/ElementConvertors/PubSubEventDisassociateConvertor.h b/Sluift/ElementConvertors/PubSubEventDisassociateConvertor.h index 9a34ac3..0a1d678 100644 --- a/Sluift/ElementConvertors/PubSubEventDisassociateConvertor.h +++ b/Sluift/ElementConvertors/PubSubEventDisassociateConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubEventDisassociateConvertor(); virtual ~PubSubEventDisassociateConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/PubSubEventItemConvertor.cpp b/Sluift/ElementConvertors/PubSubEventItemConvertor.cpp index c8373f5..e8ba5b5 100644 --- a/Sluift/ElementConvertors/PubSubEventItemConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubEventItemConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -25,8 +26,8 @@ PubSubEventItemConvertor::PubSubEventItemConvertor(LuaElementConvertors* convert PubSubEventItemConvertor::~PubSubEventItemConvertor() { } -boost::shared_ptr PubSubEventItemConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubEventItemConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -39,12 +40,12 @@ boost::shared_ptr PubSubEventItemConvertor::doConvertFromLua(lu lua_pop(L, 1); lua_getfield(L, -1, "data"); if (lua_type(L, -1) == LUA_TTABLE) { - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; for(size_t i = 0; i < lua_objlen(L, -1); ++i) { lua_pushnumber(L, i + 1); lua_gettable(L, -2); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLua(L, -1))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLua(L, -1))) { items.push_back(payload); } } @@ -62,7 +63,7 @@ boost::shared_ptr PubSubEventItemConvertor::doConvertFromLua(lu return result; } -void PubSubEventItemConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubEventItemConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getNode()) { lua_pushstring(L, (*payload->getNode()).c_str()); @@ -76,7 +77,7 @@ void PubSubEventItemConvertor::doConvertToLua(lua_State* L, boost::shared_ptr(payload->getData().size()), 0); { int i = 0; - foreach(boost::shared_ptr item, payload->getData()) { + foreach(std::shared_ptr item, payload->getData()) { if (convertors->convertToLua(L, item) > 0) { lua_rawseti(L, -2, boost::numeric_cast(i+1)); ++i; diff --git a/Sluift/ElementConvertors/PubSubEventItemConvertor.h b/Sluift/ElementConvertors/PubSubEventItemConvertor.h index 1f67b9f..6239b14 100644 --- a/Sluift/ElementConvertors/PubSubEventItemConvertor.h +++ b/Sluift/ElementConvertors/PubSubEventItemConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubEventItemConvertor(LuaElementConvertors* convertors); virtual ~PubSubEventItemConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubEventItemsConvertor.cpp b/Sluift/ElementConvertors/PubSubEventItemsConvertor.cpp index 0c2035f..c89c4a6 100644 --- a/Sluift/ElementConvertors/PubSubEventItemsConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubEventItemsConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -25,8 +26,8 @@ PubSubEventItemsConvertor::PubSubEventItemsConvertor(LuaElementConvertors* conve PubSubEventItemsConvertor::~PubSubEventItemsConvertor() { } -boost::shared_ptr PubSubEventItemsConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubEventItemsConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -34,12 +35,12 @@ boost::shared_ptr PubSubEventItemsConvertor::doConvertFromLua( lua_pop(L, 1); lua_getfield(L, -1, "items"); if (lua_type(L, -1) == LUA_TTABLE) { - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; for(size_t i = 0; i < lua_objlen(L, -1); ++i) { lua_pushnumber(L, i + 1); lua_gettable(L, -2); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_item"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_item"))) { items.push_back(payload); } } @@ -51,12 +52,12 @@ boost::shared_ptr PubSubEventItemsConvertor::doConvertFromLua( lua_pop(L, 1); lua_getfield(L, -1, "retracts"); if (lua_type(L, -1) == LUA_TTABLE) { - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; for(size_t i = 0; i < lua_objlen(L, -1); ++i) { lua_pushnumber(L, i + 1); lua_gettable(L, -2); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_retract"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_retract"))) { items.push_back(payload); } } @@ -69,7 +70,7 @@ boost::shared_ptr PubSubEventItemsConvertor::doConvertFromLua( return result; } -void PubSubEventItemsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubEventItemsConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); @@ -77,7 +78,7 @@ void PubSubEventItemsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr

(payload->getItems().size()), 0); { int i = 0; - foreach(boost::shared_ptr item, payload->getItems()) { + foreach(std::shared_ptr item, payload->getItems()) { if (convertors->convertToLuaUntyped(L, item) > 0) { lua_rawseti(L, -2, boost::numeric_cast(i+1)); ++i; @@ -90,7 +91,7 @@ void PubSubEventItemsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr

(payload->getRetracts().size()), 0); { int i = 0; - foreach(boost::shared_ptr item, payload->getRetracts()) { + foreach(std::shared_ptr item, payload->getRetracts()) { if (convertors->convertToLuaUntyped(L, item) > 0) { lua_rawseti(L, -2, boost::numeric_cast(i+1)); ++i; diff --git a/Sluift/ElementConvertors/PubSubEventItemsConvertor.h b/Sluift/ElementConvertors/PubSubEventItemsConvertor.h index b644e7a..ea8942b 100644 --- a/Sluift/ElementConvertors/PubSubEventItemsConvertor.h +++ b/Sluift/ElementConvertors/PubSubEventItemsConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubEventItemsConvertor(LuaElementConvertors* convertors); virtual ~PubSubEventItemsConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubEventPurgeConvertor.cpp b/Sluift/ElementConvertors/PubSubEventPurgeConvertor.cpp index 3b67704..223eedd 100644 --- a/Sluift/ElementConvertors/PubSubEventPurgeConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubEventPurgeConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -19,8 +19,8 @@ PubSubEventPurgeConvertor::PubSubEventPurgeConvertor() : PubSubEventPurgeConvertor::~PubSubEventPurgeConvertor() { } -boost::shared_ptr PubSubEventPurgeConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubEventPurgeConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -29,7 +29,7 @@ boost::shared_ptr PubSubEventPurgeConvertor::doConvertFromLua( return result; } -void PubSubEventPurgeConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubEventPurgeConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); diff --git a/Sluift/ElementConvertors/PubSubEventPurgeConvertor.h b/Sluift/ElementConvertors/PubSubEventPurgeConvertor.h index b149426..e3321b1 100644 --- a/Sluift/ElementConvertors/PubSubEventPurgeConvertor.h +++ b/Sluift/ElementConvertors/PubSubEventPurgeConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubEventPurgeConvertor(); virtual ~PubSubEventPurgeConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/PubSubEventRedirectConvertor.cpp b/Sluift/ElementConvertors/PubSubEventRedirectConvertor.cpp index ac40d31..673b320 100644 --- a/Sluift/ElementConvertors/PubSubEventRedirectConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubEventRedirectConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -19,8 +19,8 @@ PubSubEventRedirectConvertor::PubSubEventRedirectConvertor() : PubSubEventRedirectConvertor::~PubSubEventRedirectConvertor() { } -boost::shared_ptr PubSubEventRedirectConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubEventRedirectConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "uri"); if (lua_isstring(L, -1)) { result->setURI(std::string(lua_tostring(L, -1))); @@ -29,7 +29,7 @@ boost::shared_ptr PubSubEventRedirectConvertor::doConvertFr return result; } -void PubSubEventRedirectConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubEventRedirectConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getURI().c_str()); lua_setfield(L, -2, "uri"); diff --git a/Sluift/ElementConvertors/PubSubEventRedirectConvertor.h b/Sluift/ElementConvertors/PubSubEventRedirectConvertor.h index bdf7951..b1f33d2 100644 --- a/Sluift/ElementConvertors/PubSubEventRedirectConvertor.h +++ b/Sluift/ElementConvertors/PubSubEventRedirectConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubEventRedirectConvertor(); virtual ~PubSubEventRedirectConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/PubSubEventRetractConvertor.cpp b/Sluift/ElementConvertors/PubSubEventRetractConvertor.cpp index 15eec91..5981922 100644 --- a/Sluift/ElementConvertors/PubSubEventRetractConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubEventRetractConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -19,8 +19,8 @@ PubSubEventRetractConvertor::PubSubEventRetractConvertor() : PubSubEventRetractConvertor::~PubSubEventRetractConvertor() { } -boost::shared_ptr PubSubEventRetractConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubEventRetractConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "id"); if (lua_isstring(L, -1)) { result->setID(std::string(lua_tostring(L, -1))); @@ -29,7 +29,7 @@ boost::shared_ptr PubSubEventRetractConvertor::doConvertFrom return result; } -void PubSubEventRetractConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubEventRetractConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getID().c_str()); lua_setfield(L, -2, "id"); diff --git a/Sluift/ElementConvertors/PubSubEventRetractConvertor.h b/Sluift/ElementConvertors/PubSubEventRetractConvertor.h index 38208b0..65aac36 100644 --- a/Sluift/ElementConvertors/PubSubEventRetractConvertor.h +++ b/Sluift/ElementConvertors/PubSubEventRetractConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubEventRetractConvertor(); virtual ~PubSubEventRetractConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.cpp b/Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.cpp index 57be1c4..cab78d4 100644 --- a/Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -21,8 +21,8 @@ PubSubEventSubscriptionConvertor::PubSubEventSubscriptionConvertor() : PubSubEventSubscriptionConvertor::~PubSubEventSubscriptionConvertor() { } -boost::shared_ptr PubSubEventSubscriptionConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubEventSubscriptionConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -62,7 +62,7 @@ boost::shared_ptr PubSubEventSubscriptionConvertor::doC return result; } -void PubSubEventSubscriptionConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubEventSubscriptionConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); diff --git a/Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.h b/Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.h index 8ee9da5..0b3181b 100644 --- a/Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.h +++ b/Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubEventSubscriptionConvertor(); virtual ~PubSubEventSubscriptionConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/PubSubItemConvertor.cpp b/Sluift/ElementConvertors/PubSubItemConvertor.cpp index b88f989..99802bf 100644 --- a/Sluift/ElementConvertors/PubSubItemConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubItemConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -25,16 +26,16 @@ PubSubItemConvertor::PubSubItemConvertor(LuaElementConvertors* convertors) : PubSubItemConvertor::~PubSubItemConvertor() { } -boost::shared_ptr PubSubItemConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubItemConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "data"); if (lua_type(L, -1) == LUA_TTABLE) { - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; for(size_t i = 0; i < lua_objlen(L, -1); ++i) { lua_pushnumber(L, i + 1); lua_gettable(L, -2); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLua(L, -1))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLua(L, -1))) { items.push_back(payload); } } @@ -52,13 +53,13 @@ boost::shared_ptr PubSubItemConvertor::doConvertFromLua(lua_State* L return result; } -void PubSubItemConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubItemConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (!payload->getData().empty()) { lua_createtable(L, boost::numeric_cast(payload->getData().size()), 0); { int i = 0; - foreach(boost::shared_ptr item, payload->getData()) { + foreach(std::shared_ptr item, payload->getData()) { if (convertors->convertToLua(L, item) > 0) { lua_rawseti(L, -2, boost::numeric_cast(i+1)); ++i; diff --git a/Sluift/ElementConvertors/PubSubItemConvertor.h b/Sluift/ElementConvertors/PubSubItemConvertor.h index 1bc2467..2772932 100644 --- a/Sluift/ElementConvertors/PubSubItemConvertor.h +++ b/Sluift/ElementConvertors/PubSubItemConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubItemConvertor(LuaElementConvertors* convertors); virtual ~PubSubItemConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubItemsConvertor.cpp b/Sluift/ElementConvertors/PubSubItemsConvertor.cpp index 571bc46..8e1f08d 100644 --- a/Sluift/ElementConvertors/PubSubItemsConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubItemsConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -25,20 +26,20 @@ PubSubItemsConvertor::PubSubItemsConvertor(LuaElementConvertors* convertors) : PubSubItemsConvertor::~PubSubItemsConvertor() { } -boost::shared_ptr PubSubItemsConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubItemsConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); } lua_pop(L, 1); if (lua_type(L, -1) == LUA_TTABLE) { - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; for(size_t i = 0; i < lua_objlen(L, -1); ++i) { lua_pushnumber(L, i + 1); lua_gettable(L, -2); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) { items.push_back(payload); } } @@ -60,14 +61,14 @@ boost::shared_ptr PubSubItemsConvertor::doConvertFromLua(lua_State* return result; } -void PubSubItemsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubItemsConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); if (!payload->getItems().empty()) { { int i = 0; - foreach(boost::shared_ptr item, payload->getItems()) { + foreach(std::shared_ptr item, payload->getItems()) { if (convertors->convertToLuaUntyped(L, item) > 0) { lua_rawseti(L, -2, boost::numeric_cast(i+1)); ++i; diff --git a/Sluift/ElementConvertors/PubSubItemsConvertor.h b/Sluift/ElementConvertors/PubSubItemsConvertor.h index e40d545..56348b0 100644 --- a/Sluift/ElementConvertors/PubSubItemsConvertor.h +++ b/Sluift/ElementConvertors/PubSubItemsConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubItemsConvertor(LuaElementConvertors* convertors); virtual ~PubSubItemsConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubOptionsConvertor.cpp b/Sluift/ElementConvertors/PubSubOptionsConvertor.cpp index 52976ea..3582c63 100644 --- a/Sluift/ElementConvertors/PubSubOptionsConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubOptionsConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,8 +22,8 @@ PubSubOptionsConvertor::PubSubOptionsConvertor(LuaElementConvertors* convertors) PubSubOptionsConvertor::~PubSubOptionsConvertor() { } -boost::shared_ptr PubSubOptionsConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubOptionsConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -36,7 +36,7 @@ boost::shared_ptr PubSubOptionsConvertor::doConvertFromLua(lua_St lua_pop(L, 1); lua_getfield(L, -1, "data"); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "form"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "form"))) { result->setData(payload); } } @@ -49,7 +49,7 @@ boost::shared_ptr PubSubOptionsConvertor::doConvertFromLua(lua_St return result; } -void PubSubOptionsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubOptionsConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); diff --git a/Sluift/ElementConvertors/PubSubOptionsConvertor.h b/Sluift/ElementConvertors/PubSubOptionsConvertor.h index 88fafd3..60d11cc 100644 --- a/Sluift/ElementConvertors/PubSubOptionsConvertor.h +++ b/Sluift/ElementConvertors/PubSubOptionsConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubOptionsConvertor(LuaElementConvertors* convertors); virtual ~PubSubOptionsConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.cpp b/Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.cpp index da835af..15a800b 100644 --- a/Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -19,8 +19,8 @@ PubSubOwnerAffiliationConvertor::PubSubOwnerAffiliationConvertor() : PubSubOwnerAffiliationConvertor::~PubSubOwnerAffiliationConvertor() { } -boost::shared_ptr PubSubOwnerAffiliationConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubOwnerAffiliationConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "jid"); if (lua_isstring(L, -1)) { result->setJID(JID(std::string(lua_tostring(L, -1)))); @@ -51,7 +51,7 @@ boost::shared_ptr PubSubOwnerAffiliationConvertor::doCon return result; } -void PubSubOwnerAffiliationConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubOwnerAffiliationConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getJID().toString().c_str()); lua_setfield(L, -2, "jid"); diff --git a/Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.h b/Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.h index 965e708..9020482 100644 --- a/Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.h +++ b/Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubOwnerAffiliationConvertor(); virtual ~PubSubOwnerAffiliationConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.cpp b/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.cpp index 01a4503..b66443f 100644 --- a/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -25,20 +26,20 @@ PubSubOwnerAffiliationsConvertor::PubSubOwnerAffiliationsConvertor(LuaElementCon PubSubOwnerAffiliationsConvertor::~PubSubOwnerAffiliationsConvertor() { } -boost::shared_ptr PubSubOwnerAffiliationsConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubOwnerAffiliationsConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); } lua_pop(L, 1); if (lua_type(L, -1) == LUA_TTABLE) { - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; for(size_t i = 0; i < lua_objlen(L, -1); ++i) { lua_pushnumber(L, i + 1); lua_gettable(L, -2); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_owner_affiliation"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_owner_affiliation"))) { items.push_back(payload); } } @@ -50,14 +51,14 @@ boost::shared_ptr PubSubOwnerAffiliationsConvertor::doC return result; } -void PubSubOwnerAffiliationsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubOwnerAffiliationsConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); if (!payload->getAffiliations().empty()) { { int i = 0; - foreach(boost::shared_ptr item, payload->getAffiliations()) { + foreach(std::shared_ptr item, payload->getAffiliations()) { if (convertors->convertToLuaUntyped(L, item) > 0) { lua_rawseti(L, -2, boost::numeric_cast(i+1)); ++i; diff --git a/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.h b/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.h index 3644cd8..3026e2c 100644 --- a/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.h +++ b/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubOwnerAffiliationsConvertor(LuaElementConvertors* convertors); virtual ~PubSubOwnerAffiliationsConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.cpp b/Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.cpp index 0d0d49a..d179152 100644 --- a/Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,8 +22,8 @@ PubSubOwnerConfigureConvertor::PubSubOwnerConfigureConvertor(LuaElementConvertor PubSubOwnerConfigureConvertor::~PubSubOwnerConfigureConvertor() { } -boost::shared_ptr PubSubOwnerConfigureConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubOwnerConfigureConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -31,7 +31,7 @@ boost::shared_ptr PubSubOwnerConfigureConvertor::doConvert lua_pop(L, 1); lua_getfield(L, -1, "data"); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "form"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "form"))) { result->setData(payload); } } @@ -39,7 +39,7 @@ boost::shared_ptr PubSubOwnerConfigureConvertor::doConvert return result; } -void PubSubOwnerConfigureConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubOwnerConfigureConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getNode()) { lua_pushstring(L, (*payload->getNode()).c_str()); diff --git a/Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.h b/Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.h index d2fb229..4b39fdf 100644 --- a/Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.h +++ b/Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubOwnerConfigureConvertor(LuaElementConvertors* convertors); virtual ~PubSubOwnerConfigureConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.cpp b/Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.cpp index 9147900..b2ff3de 100644 --- a/Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,11 +22,11 @@ PubSubOwnerDefaultConvertor::PubSubOwnerDefaultConvertor(LuaElementConvertors* c PubSubOwnerDefaultConvertor::~PubSubOwnerDefaultConvertor() { } -boost::shared_ptr PubSubOwnerDefaultConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubOwnerDefaultConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "data"); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "form"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "form"))) { result->setData(payload); } } @@ -34,7 +34,7 @@ boost::shared_ptr PubSubOwnerDefaultConvertor::doConvertFrom return result; } -void PubSubOwnerDefaultConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubOwnerDefaultConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (convertors->convertToLuaUntyped(L, payload->getData()) > 0) { lua_setfield(L, -2, "data"); diff --git a/Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.h b/Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.h index 274cb12..ae0f018 100644 --- a/Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.h +++ b/Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubOwnerDefaultConvertor(LuaElementConvertors* convertors); virtual ~PubSubOwnerDefaultConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.cpp b/Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.cpp index 63579b6..3733d74 100644 --- a/Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,8 +22,8 @@ PubSubOwnerDeleteConvertor::PubSubOwnerDeleteConvertor(LuaElementConvertors* con PubSubOwnerDeleteConvertor::~PubSubOwnerDeleteConvertor() { } -boost::shared_ptr PubSubOwnerDeleteConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubOwnerDeleteConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -31,7 +31,7 @@ boost::shared_ptr PubSubOwnerDeleteConvertor::doConvertFromLu lua_pop(L, 1); lua_getfield(L, -1, "redirect"); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_owner_redirect"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_owner_redirect"))) { result->setRedirect(payload); } } @@ -39,7 +39,7 @@ boost::shared_ptr PubSubOwnerDeleteConvertor::doConvertFromLu return result; } -void PubSubOwnerDeleteConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubOwnerDeleteConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); diff --git a/Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.h b/Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.h index 548fb79..54a2cf9 100644 --- a/Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.h +++ b/Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubOwnerDeleteConvertor(LuaElementConvertors* convertors); virtual ~PubSubOwnerDeleteConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.cpp b/Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.cpp index f7d5c50..98c6355 100644 --- a/Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -19,8 +19,8 @@ PubSubOwnerPurgeConvertor::PubSubOwnerPurgeConvertor() : PubSubOwnerPurgeConvertor::~PubSubOwnerPurgeConvertor() { } -boost::shared_ptr PubSubOwnerPurgeConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubOwnerPurgeConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -29,7 +29,7 @@ boost::shared_ptr PubSubOwnerPurgeConvertor::doConvertFromLua( return result; } -void PubSubOwnerPurgeConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubOwnerPurgeConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); diff --git a/Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.h b/Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.h index fc627c6..4696f45 100644 --- a/Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.h +++ b/Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubOwnerPurgeConvertor(); virtual ~PubSubOwnerPurgeConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.cpp b/Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.cpp index 86c26ac..8fc20d2 100644 --- a/Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -19,8 +19,8 @@ PubSubOwnerRedirectConvertor::PubSubOwnerRedirectConvertor() : PubSubOwnerRedirectConvertor::~PubSubOwnerRedirectConvertor() { } -boost::shared_ptr PubSubOwnerRedirectConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubOwnerRedirectConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "uri"); if (lua_isstring(L, -1)) { result->setURI(std::string(lua_tostring(L, -1))); @@ -29,7 +29,7 @@ boost::shared_ptr PubSubOwnerRedirectConvertor::doConvertFr return result; } -void PubSubOwnerRedirectConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubOwnerRedirectConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getURI().c_str()); lua_setfield(L, -2, "uri"); diff --git a/Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.h b/Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.h index 528e9e5..3517a49 100644 --- a/Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.h +++ b/Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubOwnerRedirectConvertor(); virtual ~PubSubOwnerRedirectConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.cpp b/Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.cpp index 2e5aff3..e0b3687 100644 --- a/Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -19,8 +19,8 @@ PubSubOwnerSubscriptionConvertor::PubSubOwnerSubscriptionConvertor() : PubSubOwnerSubscriptionConvertor::~PubSubOwnerSubscriptionConvertor() { } -boost::shared_ptr PubSubOwnerSubscriptionConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubOwnerSubscriptionConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "jid"); if (lua_isstring(L, -1)) { result->setJID(JID(std::string(lua_tostring(L, -1)))); @@ -45,7 +45,7 @@ boost::shared_ptr PubSubOwnerSubscriptionConvertor::doC return result; } -void PubSubOwnerSubscriptionConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubOwnerSubscriptionConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getJID().toString().c_str()); lua_setfield(L, -2, "jid"); diff --git a/Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.h b/Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.h index 0924c35..2908654 100644 --- a/Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.h +++ b/Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubOwnerSubscriptionConvertor(); virtual ~PubSubOwnerSubscriptionConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.cpp b/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.cpp index b6f49ad..50cfb9b 100644 --- a/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -25,20 +26,20 @@ PubSubOwnerSubscriptionsConvertor::PubSubOwnerSubscriptionsConvertor(LuaElementC PubSubOwnerSubscriptionsConvertor::~PubSubOwnerSubscriptionsConvertor() { } -boost::shared_ptr PubSubOwnerSubscriptionsConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubOwnerSubscriptionsConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); } lua_pop(L, 1); if (lua_type(L, -1) == LUA_TTABLE) { - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; for(size_t i = 0; i < lua_objlen(L, -1); ++i) { lua_pushnumber(L, i + 1); lua_gettable(L, -2); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_owner_subscription"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_owner_subscription"))) { items.push_back(payload); } } @@ -50,14 +51,14 @@ boost::shared_ptr PubSubOwnerSubscriptionsConvertor::d return result; } -void PubSubOwnerSubscriptionsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubOwnerSubscriptionsConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); if (!payload->getSubscriptions().empty()) { { int i = 0; - foreach(boost::shared_ptr item, payload->getSubscriptions()) { + foreach(std::shared_ptr item, payload->getSubscriptions()) { if (convertors->convertToLuaUntyped(L, item) > 0) { lua_rawseti(L, -2, boost::numeric_cast(i+1)); ++i; diff --git a/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.h b/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.h index 1511d20..c89b814 100644 --- a/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.h +++ b/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubOwnerSubscriptionsConvertor(LuaElementConvertors* convertors); virtual ~PubSubOwnerSubscriptionsConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubPublishConvertor.cpp b/Sluift/ElementConvertors/PubSubPublishConvertor.cpp index 68045fb..38aca0a 100644 --- a/Sluift/ElementConvertors/PubSubPublishConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubPublishConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -25,8 +26,8 @@ PubSubPublishConvertor::PubSubPublishConvertor(LuaElementConvertors* convertors) PubSubPublishConvertor::~PubSubPublishConvertor() { } -boost::shared_ptr PubSubPublishConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubPublishConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -34,12 +35,12 @@ boost::shared_ptr PubSubPublishConvertor::doConvertFromLua(lua_St lua_pop(L, 1); lua_getfield(L, -1, "items"); if (lua_type(L, -1) == LUA_TTABLE) { - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; for(size_t i = 0; i < lua_objlen(L, -1); ++i) { lua_pushnumber(L, i + 1); lua_gettable(L, -2); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) { items.push_back(payload); } } @@ -52,7 +53,7 @@ boost::shared_ptr PubSubPublishConvertor::doConvertFromLua(lua_St return result; } -void PubSubPublishConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubPublishConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); @@ -60,7 +61,7 @@ void PubSubPublishConvertor::doConvertToLua(lua_State* L, boost::shared_ptr(payload->getItems().size()), 0); { int i = 0; - foreach(boost::shared_ptr item, payload->getItems()) { + foreach(std::shared_ptr item, payload->getItems()) { if (convertors->convertToLuaUntyped(L, item) > 0) { lua_rawseti(L, -2, boost::numeric_cast(i+1)); ++i; diff --git a/Sluift/ElementConvertors/PubSubPublishConvertor.h b/Sluift/ElementConvertors/PubSubPublishConvertor.h index 1372c55..1765caf 100644 --- a/Sluift/ElementConvertors/PubSubPublishConvertor.h +++ b/Sluift/ElementConvertors/PubSubPublishConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubPublishConvertor(LuaElementConvertors* convertors); virtual ~PubSubPublishConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubRetractConvertor.cpp b/Sluift/ElementConvertors/PubSubRetractConvertor.cpp index bc0e3d0..6597f0b 100644 --- a/Sluift/ElementConvertors/PubSubRetractConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubRetractConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -25,8 +26,8 @@ PubSubRetractConvertor::PubSubRetractConvertor(LuaElementConvertors* convertors) PubSubRetractConvertor::~PubSubRetractConvertor() { } -boost::shared_ptr PubSubRetractConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubRetractConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -34,12 +35,12 @@ boost::shared_ptr PubSubRetractConvertor::doConvertFromLua(lua_St lua_pop(L, 1); lua_getfield(L, -1, "items"); if (lua_type(L, -1) == LUA_TTABLE) { - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; for(size_t i = 0; i < lua_objlen(L, -1); ++i) { lua_pushnumber(L, i + 1); lua_gettable(L, -2); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) { items.push_back(payload); } } @@ -57,7 +58,7 @@ boost::shared_ptr PubSubRetractConvertor::doConvertFromLua(lua_St return result; } -void PubSubRetractConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubRetractConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getNode().c_str()); lua_setfield(L, -2, "node"); @@ -65,7 +66,7 @@ void PubSubRetractConvertor::doConvertToLua(lua_State* L, boost::shared_ptr(payload->getItems().size()), 0); { int i = 0; - foreach(boost::shared_ptr item, payload->getItems()) { + foreach(std::shared_ptr item, payload->getItems()) { if (convertors->convertToLuaUntyped(L, item) > 0) { lua_rawseti(L, -2, boost::numeric_cast(i+1)); ++i; diff --git a/Sluift/ElementConvertors/PubSubRetractConvertor.h b/Sluift/ElementConvertors/PubSubRetractConvertor.h index c1f8bd6..13f7d0d 100644 --- a/Sluift/ElementConvertors/PubSubRetractConvertor.h +++ b/Sluift/ElementConvertors/PubSubRetractConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubRetractConvertor(LuaElementConvertors* convertors); virtual ~PubSubRetractConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubSubscribeConvertor.cpp b/Sluift/ElementConvertors/PubSubSubscribeConvertor.cpp index bb3dcb4..bb5eb61 100644 --- a/Sluift/ElementConvertors/PubSubSubscribeConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubSubscribeConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,8 +22,8 @@ PubSubSubscribeConvertor::PubSubSubscribeConvertor(LuaElementConvertors* convert PubSubSubscribeConvertor::~PubSubSubscribeConvertor() { } -boost::shared_ptr PubSubSubscribeConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubSubscribeConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -36,7 +36,7 @@ boost::shared_ptr PubSubSubscribeConvertor::doConvertFromLua(lu lua_pop(L, 1); lua_getfield(L, -1, "options"); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_options"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_options"))) { result->setOptions(payload); } } @@ -44,7 +44,7 @@ boost::shared_ptr PubSubSubscribeConvertor::doConvertFromLua(lu return result; } -void PubSubSubscribeConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubSubscribeConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getNode()) { lua_pushstring(L, (*payload->getNode()).c_str()); diff --git a/Sluift/ElementConvertors/PubSubSubscribeConvertor.h b/Sluift/ElementConvertors/PubSubSubscribeConvertor.h index 592b5aa..238f677 100644 --- a/Sluift/ElementConvertors/PubSubSubscribeConvertor.h +++ b/Sluift/ElementConvertors/PubSubSubscribeConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubSubscribeConvertor(LuaElementConvertors* convertors); virtual ~PubSubSubscribeConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.cpp b/Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.cpp index 70c5b4f..01da15f 100644 --- a/Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -19,8 +19,8 @@ PubSubSubscribeOptionsConvertor::PubSubSubscribeOptionsConvertor() : PubSubSubscribeOptionsConvertor::~PubSubSubscribeOptionsConvertor() { } -boost::shared_ptr PubSubSubscribeOptionsConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubSubscribeOptionsConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "required"); if (lua_isboolean(L, -1)) { result->setRequired(lua_toboolean(L, -1)); @@ -29,7 +29,7 @@ boost::shared_ptr PubSubSubscribeOptionsConvertor::doCon return result; } -void PubSubSubscribeOptionsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubSubscribeOptionsConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushboolean(L, payload->isRequired()); lua_setfield(L, -2, "required"); diff --git a/Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.h b/Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.h index 3214dcf..fed8779 100644 --- a/Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.h +++ b/Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubSubscribeOptionsConvertor(); virtual ~PubSubSubscribeOptionsConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/PubSubSubscriptionConvertor.cpp b/Sluift/ElementConvertors/PubSubSubscriptionConvertor.cpp index 79c188c..65c6474 100644 --- a/Sluift/ElementConvertors/PubSubSubscriptionConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubSubscriptionConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -22,8 +22,8 @@ PubSubSubscriptionConvertor::PubSubSubscriptionConvertor(LuaElementConvertors* c PubSubSubscriptionConvertor::~PubSubSubscriptionConvertor() { } -boost::shared_ptr PubSubSubscriptionConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubSubscriptionConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -41,7 +41,7 @@ boost::shared_ptr PubSubSubscriptionConvertor::doConvertFrom lua_pop(L, 1); lua_getfield(L, -1, "options"); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_subscribe_options"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_subscribe_options"))) { result->setOptions(payload); } } @@ -65,7 +65,7 @@ boost::shared_ptr PubSubSubscriptionConvertor::doConvertFrom return result; } -void PubSubSubscriptionConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubSubscriptionConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getNode()) { lua_pushstring(L, (*payload->getNode()).c_str()); diff --git a/Sluift/ElementConvertors/PubSubSubscriptionConvertor.h b/Sluift/ElementConvertors/PubSubSubscriptionConvertor.h index 84aa275..5635181 100644 --- a/Sluift/ElementConvertors/PubSubSubscriptionConvertor.h +++ b/Sluift/ElementConvertors/PubSubSubscriptionConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubSubscriptionConvertor(LuaElementConvertors* convertors); virtual ~PubSubSubscriptionConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.cpp b/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.cpp index a81817e..4cc5686 100644 --- a/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -25,20 +26,20 @@ PubSubSubscriptionsConvertor::PubSubSubscriptionsConvertor(LuaElementConvertors* PubSubSubscriptionsConvertor::~PubSubSubscriptionsConvertor() { } -boost::shared_ptr PubSubSubscriptionsConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubSubscriptionsConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); } lua_pop(L, 1); if (lua_type(L, -1) == LUA_TTABLE) { - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; for(size_t i = 0; i < lua_objlen(L, -1); ++i) { lua_pushnumber(L, i + 1); lua_gettable(L, -2); if (!lua_isnil(L, -1)) { - if (boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_subscription"))) { + if (std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLuaUntyped(L, -1, "pubsub_subscription"))) { items.push_back(payload); } } @@ -50,7 +51,7 @@ boost::shared_ptr PubSubSubscriptionsConvertor::doConvertFr return result; } -void PubSubSubscriptionsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubSubscriptionsConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getNode()) { lua_pushstring(L, (*payload->getNode()).c_str()); @@ -59,7 +60,7 @@ void PubSubSubscriptionsConvertor::doConvertToLua(lua_State* L, boost::shared_pt if (!payload->getSubscriptions().empty()) { { int i = 0; - foreach(boost::shared_ptr item, payload->getSubscriptions()) { + foreach(std::shared_ptr item, payload->getSubscriptions()) { if (convertors->convertToLuaUntyped(L, item) > 0) { lua_rawseti(L, -2, boost::numeric_cast(i+1)); ++i; diff --git a/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.h b/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.h index 82fa1f7..2c941e6 100644 --- a/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.h +++ b/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubSubscriptionsConvertor(LuaElementConvertors* convertors); virtual ~PubSubSubscriptionsConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; private: diff --git a/Sluift/ElementConvertors/PubSubUnsubscribeConvertor.cpp b/Sluift/ElementConvertors/PubSubUnsubscribeConvertor.cpp index 3e83a97..056c84c 100644 --- a/Sluift/ElementConvertors/PubSubUnsubscribeConvertor.cpp +++ b/Sluift/ElementConvertors/PubSubUnsubscribeConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -19,8 +19,8 @@ PubSubUnsubscribeConvertor::PubSubUnsubscribeConvertor() : PubSubUnsubscribeConvertor::~PubSubUnsubscribeConvertor() { } -boost::shared_ptr PubSubUnsubscribeConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr PubSubUnsubscribeConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "node"); if (lua_isstring(L, -1)) { result->setNode(std::string(lua_tostring(L, -1))); @@ -39,7 +39,7 @@ boost::shared_ptr PubSubUnsubscribeConvertor::doConvertFromLu return result; } -void PubSubUnsubscribeConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void PubSubUnsubscribeConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getNode()) { lua_pushstring(L, (*payload->getNode()).c_str()); diff --git a/Sluift/ElementConvertors/PubSubUnsubscribeConvertor.h b/Sluift/ElementConvertors/PubSubUnsubscribeConvertor.h index c6c3d06..7270917 100644 --- a/Sluift/ElementConvertors/PubSubUnsubscribeConvertor.h +++ b/Sluift/ElementConvertors/PubSubUnsubscribeConvertor.h @@ -19,8 +19,8 @@ namespace Swift { PubSubUnsubscribeConvertor(); virtual ~PubSubUnsubscribeConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/RawXMLElementConvertor.cpp b/Sluift/ElementConvertors/RawXMLElementConvertor.cpp index 07ca021..a8ccb91 100644 --- a/Sluift/ElementConvertors/RawXMLElementConvertor.cpp +++ b/Sluift/ElementConvertors/RawXMLElementConvertor.cpp @@ -7,8 +7,7 @@ #include #include - -#include +#include #include @@ -25,15 +24,15 @@ RawXMLElementConvertor::RawXMLElementConvertor() { RawXMLElementConvertor::~RawXMLElementConvertor() { } -boost::shared_ptr RawXMLElementConvertor::convertFromLua(lua_State* L, int index, const std::string& type) { +std::shared_ptr RawXMLElementConvertor::convertFromLua(lua_State* L, int index, const std::string& type) { if (type == "xml") { - return boost::make_shared(std::string(Lua::checkString(L, index))); + return std::make_shared(std::string(Lua::checkString(L, index))); } - return boost::shared_ptr(); + return std::shared_ptr(); } -boost::optional RawXMLElementConvertor::convertToLua(lua_State* L, boost::shared_ptr element) { - boost::shared_ptr payload = boost::dynamic_pointer_cast(element); +boost::optional RawXMLElementConvertor::convertToLua(lua_State* L, std::shared_ptr element) { + std::shared_ptr payload = std::dynamic_pointer_cast(element); if (!payload) { return boost::optional(); } diff --git a/Sluift/ElementConvertors/RawXMLElementConvertor.h b/Sluift/ElementConvertors/RawXMLElementConvertor.h index 22323ec..79f648f 100644 --- a/Sluift/ElementConvertors/RawXMLElementConvertor.h +++ b/Sluift/ElementConvertors/RawXMLElementConvertor.h @@ -17,8 +17,8 @@ namespace Swift { RawXMLElementConvertor(); virtual ~RawXMLElementConvertor(); - virtual boost::shared_ptr convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE; - virtual boost::optional convertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE; + virtual boost::optional convertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; private: FullPayloadSerializerCollection serializers; diff --git a/Sluift/ElementConvertors/ResultSetConvertor.cpp b/Sluift/ElementConvertors/ResultSetConvertor.cpp index aa84aac..7762a79 100644 --- a/Sluift/ElementConvertors/ResultSetConvertor.cpp +++ b/Sluift/ElementConvertors/ResultSetConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -20,8 +21,8 @@ ResultSetConvertor::ResultSetConvertor() : ResultSetConvertor::~ResultSetConvertor() { } -boost::shared_ptr ResultSetConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr ResultSetConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "max_items"); if (lua_isstring(L, -1)) { result->setMaxItems(boost::numeric_cast(lua_tonumber(L, -1))); @@ -65,7 +66,7 @@ boost::shared_ptr ResultSetConvertor::doConvertFromLua(lua_State* L) return result; } -void ResultSetConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void ResultSetConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getMaxItems()) { lua_pushnumber(L, *payload->getMaxItems()); diff --git a/Sluift/ElementConvertors/ResultSetConvertor.h b/Sluift/ElementConvertors/ResultSetConvertor.h index 5df9c3e..e1b826c 100644 --- a/Sluift/ElementConvertors/ResultSetConvertor.h +++ b/Sluift/ElementConvertors/ResultSetConvertor.h @@ -19,8 +19,8 @@ namespace Swift { ResultSetConvertor(); virtual ~ResultSetConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/SecurityLabelConvertor.cpp b/Sluift/ElementConvertors/SecurityLabelConvertor.cpp index a5cae40..133b123 100644 --- a/Sluift/ElementConvertors/SecurityLabelConvertor.cpp +++ b/Sluift/ElementConvertors/SecurityLabelConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -22,8 +23,8 @@ SecurityLabelConvertor::SecurityLabelConvertor() : SecurityLabelConvertor::~SecurityLabelConvertor() { } -boost::shared_ptr SecurityLabelConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr SecurityLabelConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "equivalent_labels"); if (lua_type(L, -1) == LUA_TTABLE) { std::vector< std::string > items; @@ -62,7 +63,7 @@ boost::shared_ptr SecurityLabelConvertor::doConvertFromLua(lua_St return result; } -void SecurityLabelConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void SecurityLabelConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (!payload->getEquivalentLabels().empty()) { lua_createtable(L, boost::numeric_cast(payload->getEquivalentLabels().size()), 0); diff --git a/Sluift/ElementConvertors/SecurityLabelConvertor.h b/Sluift/ElementConvertors/SecurityLabelConvertor.h index eff455c..a0e7fea 100644 --- a/Sluift/ElementConvertors/SecurityLabelConvertor.h +++ b/Sluift/ElementConvertors/SecurityLabelConvertor.h @@ -19,8 +19,8 @@ namespace Swift { SecurityLabelConvertor(); virtual ~SecurityLabelConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/SoftwareVersionConvertor.cpp b/Sluift/ElementConvertors/SoftwareVersionConvertor.cpp index 4f372c2..f997a45 100644 --- a/Sluift/ElementConvertors/SoftwareVersionConvertor.cpp +++ b/Sluift/ElementConvertors/SoftwareVersionConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -21,8 +22,8 @@ SoftwareVersionConvertor::SoftwareVersionConvertor() : GenericLuaElementConverto SoftwareVersionConvertor::~SoftwareVersionConvertor() { } -boost::shared_ptr SoftwareVersionConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr SoftwareVersionConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "name"); if (!lua_isnil(L, -1)) { result->setName(std::string(Lua::checkString(L, -1))); @@ -41,7 +42,7 @@ boost::shared_ptr SoftwareVersionConvertor::doConvertFromLua(lu return result; } -void SoftwareVersionConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void SoftwareVersionConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getName().c_str()); lua_setfield(L, -2, "name"); diff --git a/Sluift/ElementConvertors/SoftwareVersionConvertor.h b/Sluift/ElementConvertors/SoftwareVersionConvertor.h index 4df23c0..29b1483 100644 --- a/Sluift/ElementConvertors/SoftwareVersionConvertor.h +++ b/Sluift/ElementConvertors/SoftwareVersionConvertor.h @@ -17,7 +17,7 @@ namespace Swift { SoftwareVersionConvertor(); virtual ~SoftwareVersionConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/StanzaConvertor.h b/Sluift/ElementConvertors/StanzaConvertor.h index 309121e..e1d0cb3 100644 --- a/Sluift/ElementConvertors/StanzaConvertor.h +++ b/Sluift/ElementConvertors/StanzaConvertor.h @@ -28,8 +28,8 @@ namespace Swift { virtual ~StanzaConvertor() { } - boost::shared_ptr getStanza(lua_State* L, LuaElementConvertors* convertors) { - boost::shared_ptr result = boost::make_shared(); + std::shared_ptr getStanza(lua_State* L, LuaElementConvertors* convertors) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "id"); if (lua_isstring(L, -1)) { result->setID(lua_tostring(L, -1)); @@ -51,7 +51,7 @@ namespace Swift { lua_pushnumber(L, i + 1); lua_gettable(L, -2); if (!lua_isnil(L, -1)) { - boost::shared_ptr payload = boost::dynamic_pointer_cast(convertors->convertFromLua(L, -1)); + std::shared_ptr payload = std::dynamic_pointer_cast(convertors->convertFromLua(L, -1)); if (!!payload) { result->addPayload(payload); } @@ -63,7 +63,7 @@ namespace Swift { return result; } - void pushStanza(lua_State* L, const boost::shared_ptr stanza, LuaElementConvertors* convertors) { + void pushStanza(lua_State* L, const std::shared_ptr stanza, LuaElementConvertors* convertors) { lua_createtable(L, 0, 0); lua_pushstring(L, stanza->getID().c_str()); lua_setfield(L, -2, "id"); @@ -75,7 +75,7 @@ namespace Swift { lua_createtable(L, boost::numeric_cast(stanza->getPayloads().size()), 0); { int i = 0; - foreach(const boost::shared_ptr &item, stanza->getPayloads()) { + foreach(const std::shared_ptr &item, stanza->getPayloads()) { if (convertors->convertToLua(L, item) > 0) { lua_rawseti(L, -2, boost::numeric_cast(i+1)); ++i; diff --git a/Sluift/ElementConvertors/StatusConvertor.cpp b/Sluift/ElementConvertors/StatusConvertor.cpp index 241a2cc..eed4044 100644 --- a/Sluift/ElementConvertors/StatusConvertor.cpp +++ b/Sluift/ElementConvertors/StatusConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -21,8 +22,8 @@ StatusConvertor::StatusConvertor() : GenericLuaElementConvertor("status" StatusConvertor::~StatusConvertor() { } -boost::shared_ptr StatusConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr StatusConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "text"); if (lua_isstring(L, -1)) { result->setText(lua_tostring(L, -1)); @@ -31,7 +32,7 @@ boost::shared_ptr StatusConvertor::doConvertFromLua(lua_State* L) { return result; } -void StatusConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void StatusConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); lua_pushstring(L, payload->getText().c_str()); lua_setfield(L, -2, "text"); diff --git a/Sluift/ElementConvertors/StatusConvertor.h b/Sluift/ElementConvertors/StatusConvertor.h index 739d319..53da0ad 100644 --- a/Sluift/ElementConvertors/StatusConvertor.h +++ b/Sluift/ElementConvertors/StatusConvertor.h @@ -17,7 +17,7 @@ namespace Swift { StatusConvertor(); virtual ~StatusConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/StatusShowConvertor.cpp b/Sluift/ElementConvertors/StatusShowConvertor.cpp index d1c1e85..6d0a067 100644 --- a/Sluift/ElementConvertors/StatusShowConvertor.cpp +++ b/Sluift/ElementConvertors/StatusShowConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -22,8 +23,8 @@ StatusShowConvertor::StatusShowConvertor() : GenericLuaElementConvertor StatusShowConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr StatusShowConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "type"); if (lua_isstring(L, -1)) { result->setType(convertStatusShowTypeFromString(lua_tostring(L, -1))); @@ -32,7 +33,7 @@ boost::shared_ptr StatusShowConvertor::doConvertFromLua(lua_State* L return result; } -void StatusShowConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void StatusShowConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); const std::string show = convertStatusShowTypeToString(payload->getType()); if (!show.empty()) { diff --git a/Sluift/ElementConvertors/StatusShowConvertor.h b/Sluift/ElementConvertors/StatusShowConvertor.h index 1eef447..1521ca3 100644 --- a/Sluift/ElementConvertors/StatusShowConvertor.h +++ b/Sluift/ElementConvertors/StatusShowConvertor.h @@ -17,8 +17,8 @@ namespace Swift { StatusShowConvertor(); virtual ~StatusShowConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; static std::string convertStatusShowTypeToString(const StatusShow::Type &show); static StatusShow::Type convertStatusShowTypeFromString(const std::string& show); diff --git a/Sluift/ElementConvertors/SubjectConvertor.cpp b/Sluift/ElementConvertors/SubjectConvertor.cpp index ac40744..ae03564 100644 --- a/Sluift/ElementConvertors/SubjectConvertor.cpp +++ b/Sluift/ElementConvertors/SubjectConvertor.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -20,15 +20,15 @@ SubjectConvertor::SubjectConvertor() : GenericLuaElementConvertor("subj SubjectConvertor::~SubjectConvertor() { } -boost::shared_ptr SubjectConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr SubjectConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); if (boost::optional value = Lua::getStringField(L, -1, "text")) { result->setText(*value); } return result; } -void SubjectConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void SubjectConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (!payload->getText().empty()) { lua_pushstring(L, payload->getText().c_str()); diff --git a/Sluift/ElementConvertors/SubjectConvertor.h b/Sluift/ElementConvertors/SubjectConvertor.h index 604ad9c..1520004 100644 --- a/Sluift/ElementConvertors/SubjectConvertor.h +++ b/Sluift/ElementConvertors/SubjectConvertor.h @@ -19,7 +19,7 @@ namespace Swift { SubjectConvertor(); virtual ~SubjectConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/UserLocationConvertor.cpp b/Sluift/ElementConvertors/UserLocationConvertor.cpp index d59382b..16ba41c 100644 --- a/Sluift/ElementConvertors/UserLocationConvertor.cpp +++ b/Sluift/ElementConvertors/UserLocationConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -22,8 +23,8 @@ UserLocationConvertor::UserLocationConvertor() : UserLocationConvertor::~UserLocationConvertor() { } -boost::shared_ptr UserLocationConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr UserLocationConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "area"); if (lua_isstring(L, -1)) { result->setArea(std::string(lua_tostring(L, -1))); @@ -137,7 +138,7 @@ boost::shared_ptr UserLocationConvertor::doConvertFromLua(lua_Stat return result; } -void UserLocationConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void UserLocationConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getArea()) { lua_pushstring(L, (*payload->getArea()).c_str()); diff --git a/Sluift/ElementConvertors/UserLocationConvertor.h b/Sluift/ElementConvertors/UserLocationConvertor.h index d8f7e55..36e3a0b 100644 --- a/Sluift/ElementConvertors/UserLocationConvertor.h +++ b/Sluift/ElementConvertors/UserLocationConvertor.h @@ -19,8 +19,8 @@ namespace Swift { UserLocationConvertor(); virtual ~UserLocationConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/UserTuneConvertor.cpp b/Sluift/ElementConvertors/UserTuneConvertor.cpp index 09bf9bf..a9e1bee 100644 --- a/Sluift/ElementConvertors/UserTuneConvertor.cpp +++ b/Sluift/ElementConvertors/UserTuneConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -20,8 +21,8 @@ UserTuneConvertor::UserTuneConvertor() : UserTuneConvertor::~UserTuneConvertor() { } -boost::shared_ptr UserTuneConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr UserTuneConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "rating"); if (lua_isnumber(L, -1)) { result->setRating(boost::numeric_cast(lua_tonumber(L, -1))); @@ -60,7 +61,7 @@ boost::shared_ptr UserTuneConvertor::doConvertFromLua(lua_State* L) { return result; } -void UserTuneConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void UserTuneConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_createtable(L, 0, 0); if (payload->getRating()) { lua_pushnumber(L, (*payload->getRating())); diff --git a/Sluift/ElementConvertors/UserTuneConvertor.h b/Sluift/ElementConvertors/UserTuneConvertor.h index 9fb03ed..ba57747 100644 --- a/Sluift/ElementConvertors/UserTuneConvertor.h +++ b/Sluift/ElementConvertors/UserTuneConvertor.h @@ -19,8 +19,8 @@ namespace Swift { UserTuneConvertor(); virtual ~UserTuneConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; virtual boost::optional getDocumentation() const SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/VCardConvertor.cpp b/Sluift/ElementConvertors/VCardConvertor.cpp index 108d233..ad521b3 100644 --- a/Sluift/ElementConvertors/VCardConvertor.cpp +++ b/Sluift/ElementConvertors/VCardConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -24,8 +25,8 @@ VCardConvertor::VCardConvertor() : GenericLuaElementConvertor("vcard") { VCardConvertor::~VCardConvertor() { } -boost::shared_ptr VCardConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr VCardConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); lua_getfield(L, -1, "fullname"); if (lua_isstring(L, -1)) { result->setFullName(std::string(lua_tostring(L, -1))); @@ -304,7 +305,7 @@ boost::shared_ptr VCardConvertor::doConvertFromLua(lua_State* L) { return result; } -void VCardConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void VCardConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_newtable(L); if (!payload->getFullName().empty()) { lua_pushstring(L, payload->getFullName().c_str()); diff --git a/Sluift/ElementConvertors/VCardConvertor.h b/Sluift/ElementConvertors/VCardConvertor.h index 95da590..d63ef10 100644 --- a/Sluift/ElementConvertors/VCardConvertor.h +++ b/Sluift/ElementConvertors/VCardConvertor.h @@ -17,7 +17,7 @@ namespace Swift { VCardConvertor(); virtual ~VCardConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/ElementConvertors/VCardUpdateConvertor.cpp b/Sluift/ElementConvertors/VCardUpdateConvertor.cpp index f3da05a..21c3d68 100644 --- a/Sluift/ElementConvertors/VCardUpdateConvertor.cpp +++ b/Sluift/ElementConvertors/VCardUpdateConvertor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include @@ -21,15 +22,15 @@ VCardUpdateConvertor::VCardUpdateConvertor() : GenericLuaElementConvertor VCardUpdateConvertor::doConvertFromLua(lua_State* L) { - boost::shared_ptr result = boost::make_shared(); +std::shared_ptr VCardUpdateConvertor::doConvertFromLua(lua_State* L) { + std::shared_ptr result = std::make_shared(); if (boost::optional value = Lua::getStringField(L, -1, "photo_hash")) { result->setPhotoHash(*value); } return result; } -void VCardUpdateConvertor::doConvertToLua(lua_State* L, boost::shared_ptr payload) { +void VCardUpdateConvertor::doConvertToLua(lua_State* L, std::shared_ptr payload) { lua_newtable(L); if (!payload->getPhotoHash().empty()) { lua_pushstring(L, payload->getPhotoHash().c_str()); diff --git a/Sluift/ElementConvertors/VCardUpdateConvertor.h b/Sluift/ElementConvertors/VCardUpdateConvertor.h index b4a3882..851f3b1 100644 --- a/Sluift/ElementConvertors/VCardUpdateConvertor.h +++ b/Sluift/ElementConvertors/VCardUpdateConvertor.h @@ -17,7 +17,7 @@ namespace Swift { VCardUpdateConvertor(); virtual ~VCardUpdateConvertor(); - virtual boost::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE; + virtual void doConvertToLua(lua_State*, std::shared_ptr) SWIFTEN_OVERRIDE; }; } diff --git a/Sluift/GenericLuaElementConvertor.h b/Sluift/GenericLuaElementConvertor.h index dd11c2b..d94a324 100644 --- a/Sluift/GenericLuaElementConvertor.h +++ b/Sluift/GenericLuaElementConvertor.h @@ -25,20 +25,20 @@ namespace Swift { virtual ~GenericLuaElementConvertor() {} - virtual boost::shared_ptr convertFromLua(lua_State* L, int index, const std::string& payloadType) SWIFTEN_OVERRIDE { + virtual std::shared_ptr convertFromLua(lua_State* L, int index, const std::string& payloadType) SWIFTEN_OVERRIDE { if (payloadType == type) { Lua::checkType(L, index, LUA_TTABLE); lua_pushvalue(L, index); - boost::shared_ptr result = doConvertFromLua(L); + std::shared_ptr result = doConvertFromLua(L); lua_pop(L, 1); return result; } - return boost::shared_ptr(); + return std::shared_ptr(); } virtual boost::optional convertToLua( - lua_State* L, boost::shared_ptr payload) SWIFTEN_OVERRIDE { - if (boost::shared_ptr actualPayload = boost::dynamic_pointer_cast(payload)) { + lua_State* L, std::shared_ptr payload) SWIFTEN_OVERRIDE { + if (std::shared_ptr actualPayload = std::dynamic_pointer_cast(payload)) { doConvertToLua(L, actualPayload); assert(lua_type(L, -1) == LUA_TTABLE); return type; @@ -47,8 +47,8 @@ namespace Swift { } protected: - virtual boost::shared_ptr doConvertFromLua(lua_State*) = 0; - virtual void doConvertToLua(lua_State*, boost::shared_ptr) = 0; + virtual std::shared_ptr doConvertFromLua(lua_State*) = 0; + virtual void doConvertToLua(lua_State*, std::shared_ptr) = 0; private: std::string type; diff --git a/Sluift/ITunesInterface.h b/Sluift/ITunesInterface.h index 075ab35..a2cd06a 100644 --- a/Sluift/ITunesInterface.h +++ b/Sluift/ITunesInterface.h @@ -6,8 +6,10 @@ #pragma once +#include +#include + #include -#include #include @@ -33,6 +35,6 @@ namespace Swift { private: struct Private; - boost::shared_ptr p; + std::shared_ptr p; }; } diff --git a/Sluift/ITunesInterface.mm b/Sluift/ITunesInterface.mm index a5ada5b..7493d10 100644 --- a/Sluift/ITunesInterface.mm +++ b/Sluift/ITunesInterface.mm @@ -12,7 +12,7 @@ #pragma clang diagnostic pop #include -#include +#include #include #include @@ -25,7 +25,7 @@ struct ITunesInterface::Private { iTunesApplication* iTunes; }; -ITunesInterface::ITunesInterface() : p(boost::make_shared()) { +ITunesInterface::ITunesInterface() : p(std::make_shared()) { } ITunesInterface::~ITunesInterface() { diff --git a/Sluift/Lua/Value.cpp b/Sluift/Lua/Value.cpp index dd61d59..ed776c1 100644 --- a/Sluift/Lua/Value.cpp +++ b/Sluift/Lua/Value.cpp @@ -47,9 +47,9 @@ namespace { } } - void operator()(const std::map >& table) const { + void operator()(const std::map >& table) const { lua_createtable(state, 0, boost::numeric_cast(table.size())); - for(std::map >::const_iterator i = table.begin(); i != table.end(); ++i) { + for(std::map >::const_iterator i = table.begin(); i != table.end(); ++i) { boost::apply_visitor(PushVisitor(state), *i->second); lua_setfield(state, -2, i->first.c_str()); } diff --git a/Sluift/Lua/Value.h b/Sluift/Lua/Value.h index f525fb8..13c4a0c 100644 --- a/Sluift/Lua/Value.h +++ b/Sluift/Lua/Value.h @@ -7,11 +7,10 @@ #pragma once #include +#include #include #include -#include -#include #include struct lua_State; @@ -26,34 +25,34 @@ namespace Swift { int, std::string, std::vector< boost::recursive_variant_ >, - std::map > + std::map > >::type Value; - typedef std::map > Table; + typedef std::map > Table; typedef std::vector Array; - inline boost::shared_ptr nilRef() { - return boost::make_shared(Nil()); + inline std::shared_ptr nilRef() { + return std::make_shared(Nil()); } - inline boost::shared_ptr valueRef(const std::string& value) { - return boost::make_shared(value); + inline std::shared_ptr valueRef(const std::string& value) { + return std::make_shared(value); } - inline boost::shared_ptr intRef(int value) { - return boost::make_shared(value); + inline std::shared_ptr intRef(int value) { + return std::make_shared(value); } - inline boost::shared_ptr boolRef(bool value) { - return boost::make_shared(value); + inline std::shared_ptr boolRef(bool value) { + return std::make_shared(value); } - inline boost::shared_ptr valueRef(const Table& table) { - return boost::make_shared(table); + inline std::shared_ptr valueRef(const Table& table) { + return std::make_shared(table); } - inline boost::shared_ptr valueRef(const Array& array) { - return boost::make_shared(array); + inline std::shared_ptr valueRef(const Array& array) { + return std::make_shared(array); } void pushValue(lua_State* state, const Value& value); diff --git a/Sluift/LuaElementConvertor.h b/Sluift/LuaElementConvertor.h index 6c237fd..2cf98e7 100644 --- a/Sluift/LuaElementConvertor.h +++ b/Sluift/LuaElementConvertor.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include @@ -31,8 +31,8 @@ namespace Swift { virtual ~LuaElementConvertor(); - virtual boost::shared_ptr convertFromLua(lua_State*, int index, const std::string& type) = 0; - virtual boost::optional convertToLua(lua_State*, boost::shared_ptr) = 0; + virtual std::shared_ptr convertFromLua(lua_State*, int index, const std::string& type) = 0; + virtual boost::optional convertToLua(lua_State*, std::shared_ptr) = 0; virtual boost::optional getDocumentation() const { return boost::optional(); diff --git a/Sluift/LuaElementConvertors.cpp b/Sluift/LuaElementConvertors.cpp index 67c0545..cfc90d8 100644 --- a/Sluift/LuaElementConvertors.cpp +++ b/Sluift/LuaElementConvertors.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -42,30 +42,30 @@ using namespace Swift; LuaElementConvertors::LuaElementConvertors() { registerConvertors(); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared(this)); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); - convertors.push_back(boost::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared(this)); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); + convertors.push_back(std::make_shared()); } LuaElementConvertors::~LuaElementConvertors() { @@ -73,7 +73,7 @@ LuaElementConvertors::~LuaElementConvertors() { #include -boost::shared_ptr LuaElementConvertors::convertFromLua(lua_State* L, int index) { +std::shared_ptr LuaElementConvertors::convertFromLua(lua_State* L, int index) { if (lua_isstring(L, index)) { return convertFromLuaUntyped(L, index, "xml"); } @@ -89,18 +89,18 @@ boost::shared_ptr LuaElementConvertors::convertFromLua(lua_State* L, in throw Lua::Exception("Unable to determine type"); } -boost::shared_ptr LuaElementConvertors::convertFromLuaUntyped(lua_State* L, int index, const std::string& type) { +std::shared_ptr LuaElementConvertors::convertFromLuaUntyped(lua_State* L, int index, const std::string& type) { index = Lua::absoluteOffset(L, index); - foreach (boost::shared_ptr convertor, convertors) { - if (boost::shared_ptr result = convertor->convertFromLua(L, index, type)) { + foreach (std::shared_ptr convertor, convertors) { + if (std::shared_ptr result = convertor->convertFromLua(L, index, type)) { return result; } } - return boost::shared_ptr(); + return std::shared_ptr(); } -int LuaElementConvertors::convertToLua(lua_State* L, boost::shared_ptr payload) { +int LuaElementConvertors::convertToLua(lua_State* L, std::shared_ptr payload) { if (boost::optional type = doConvertToLuaUntyped(L, payload)) { if (lua_istable(L, -1)) { lua_pushstring(L, type->c_str()); @@ -115,7 +115,7 @@ int LuaElementConvertors::convertToLua(lua_State* L, boost::shared_ptr return 0; } -int LuaElementConvertors::convertToLuaUntyped(lua_State* L, boost::shared_ptr payload) { +int LuaElementConvertors::convertToLuaUntyped(lua_State* L, std::shared_ptr payload) { if (doConvertToLuaUntyped(L, payload)) { return 1; } @@ -123,11 +123,11 @@ int LuaElementConvertors::convertToLuaUntyped(lua_State* L, boost::shared_ptr LuaElementConvertors::doConvertToLuaUntyped( - lua_State* L, boost::shared_ptr payload) { + lua_State* L, std::shared_ptr payload) { if (!payload) { return LuaElementConvertor::NO_RESULT; } - foreach (boost::shared_ptr convertor, convertors) { + foreach (std::shared_ptr convertor, convertors) { if (boost::optional type = convertor->convertToLua(L, payload)) { return *type; } diff --git a/Sluift/LuaElementConvertors.h b/Sluift/LuaElementConvertors.h index 6b3d343..8e1d10b 100644 --- a/Sluift/LuaElementConvertors.h +++ b/Sluift/LuaElementConvertors.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include @@ -24,29 +24,29 @@ namespace Swift { LuaElementConvertors(); virtual ~LuaElementConvertors(); - boost::shared_ptr convertFromLua(lua_State*, int index); - int convertToLua(lua_State*, boost::shared_ptr); + std::shared_ptr convertFromLua(lua_State*, int index); + int convertToLua(lua_State*, std::shared_ptr); /** * Adds a toplevel type+data table with the given type. */ - boost::shared_ptr convertFromLuaUntyped(lua_State*, int index, const std::string& type); + std::shared_ptr convertFromLuaUntyped(lua_State*, int index, const std::string& type); /** * Strips the toplevel type+data table, and only return the * data. */ - int convertToLuaUntyped(lua_State*, boost::shared_ptr); + int convertToLuaUntyped(lua_State*, std::shared_ptr); - const std::vector< boost::shared_ptr >& getConvertors() const { + const std::vector< std::shared_ptr >& getConvertors() const { return convertors; } private: - boost::optional doConvertToLuaUntyped(lua_State*, boost::shared_ptr); + boost::optional doConvertToLuaUntyped(lua_State*, std::shared_ptr); void registerConvertors(); private: - std::vector< boost::shared_ptr > convertors; + std::vector< std::shared_ptr > convertors; }; } diff --git a/Sluift/Response.cpp b/Sluift/Response.cpp index 97a44d0..dd98a25 100644 --- a/Sluift/Response.cpp +++ b/Sluift/Response.cpp @@ -16,7 +16,7 @@ using namespace Swift; using namespace Swift::Sluift; -static std::string getErrorString(boost::shared_ptr error) { +static std::string getErrorString(std::shared_ptr error) { // Copied from ChatControllerBase. // TODO: Share this code; std::string defaultMessage = "Error sending message"; diff --git a/Sluift/Response.h b/Sluift/Response.h index c0bd28a..dc35289 100644 --- a/Sluift/Response.h +++ b/Sluift/Response.h @@ -15,22 +15,22 @@ struct lua_State; namespace Swift { namespace Sluift { struct Response { - Response(boost::shared_ptr result, boost::shared_ptr error) : result(result), error(error) {} + Response(std::shared_ptr result, std::shared_ptr error) : result(result), error(error) {} SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Response) ~Response(); - static Response withResult(boost::shared_ptr response) { - return Response(response, boost::shared_ptr()); + static Response withResult(std::shared_ptr response) { + return Response(response, std::shared_ptr()); } - static Response withError(boost::shared_ptr error) { - return Response(boost::shared_ptr(), error); + static Response withError(std::shared_ptr error) { + return Response(std::shared_ptr(), error); } int convertToLuaResult(lua_State* L); - boost::shared_ptr result; - boost::shared_ptr error; + std::shared_ptr result; + std::shared_ptr error; }; } } diff --git a/Sluift/SluiftClient.cpp b/Sluift/SluiftClient.cpp index 8bbb530..f1c0191 100644 --- a/Sluift/SluiftClient.cpp +++ b/Sluift/SluiftClient.cpp @@ -145,7 +145,7 @@ std::vector SluiftClient::getRoster(int timeout) { return client->getRoster()->getItems(); } -void SluiftClient::handleIncomingMessage(boost::shared_ptr stanza) { +void SluiftClient::handleIncomingMessage(std::shared_ptr stanza) { if (stanza->getPayload()) { // Already handled by pubsub manager return; @@ -153,11 +153,11 @@ void SluiftClient::handleIncomingMessage(boost::shared_ptr stanza) { pendingEvents.push_back(Event(stanza)); } -void SluiftClient::handleIncomingPresence(boost::shared_ptr stanza) { +void SluiftClient::handleIncomingPresence(std::shared_ptr stanza) { pendingEvents.push_back(Event(stanza)); } -void SluiftClient::handleIncomingPubSubEvent(const JID& from, boost::shared_ptr event) { +void SluiftClient::handleIncomingPubSubEvent(const JID& from, std::shared_ptr event) { pendingEvents.push_back(Event(from, event)); } @@ -165,7 +165,7 @@ void SluiftClient::handleInitialRosterPopulated() { rosterReceived = true; } -void SluiftClient::handleRequestResponse(boost::shared_ptr response, boost::shared_ptr error) { +void SluiftClient::handleRequestResponse(std::shared_ptr response, std::shared_ptr error) { requestResponse = response; requestError = error; requestResponseReceived = true; @@ -175,7 +175,7 @@ void SluiftClient::handleDisconnected(const boost::optional& error) disconnectedError = error; } -Sluift::Response SluiftClient::doSendRequest(boost::shared_ptr request, int timeout) { +Sluift::Response SluiftClient::doSendRequest(std::shared_ptr request, int timeout) { requestResponse.reset(); requestError.reset(); requestResponseReceived = false; @@ -186,5 +186,5 @@ Sluift::Response SluiftClient::doSendRequest(boost::shared_ptr request, eventLoop->runUntilEvents(); } return Sluift::Response(requestResponse, watchdog.getTimedOut() ? - boost::make_shared(ErrorPayload::RemoteServerTimeout) : requestError); + std::make_shared(ErrorPayload::RemoteServerTimeout) : requestError); } diff --git a/Sluift/SluiftClient.h b/Sluift/SluiftClient.h index d7c3b32..42a59e9 100644 --- a/Sluift/SluiftClient.h +++ b/Sluift/SluiftClient.h @@ -45,18 +45,18 @@ namespace Swift { PubSubEventType }; - Event(boost::shared_ptr stanza) : type(MessageType), stanza(stanza) {} - Event(boost::shared_ptr stanza) : type(PresenceType), stanza(stanza) {} - Event(const JID& from, boost::shared_ptr payload) : type(PubSubEventType), from(from), pubsubEvent(payload) {} + Event(std::shared_ptr stanza) : type(MessageType), stanza(stanza) {} + Event(std::shared_ptr stanza) : type(PresenceType), stanza(stanza) {} + Event(const JID& from, std::shared_ptr payload) : type(PubSubEventType), from(from), pubsubEvent(payload) {} Type type; // Message & Presence - boost::shared_ptr stanza; + std::shared_ptr stanza; // PubSubEvent JID from; - boost::shared_ptr pubsubEvent; + std::shared_ptr pubsubEvent; }; SluiftClient( @@ -82,7 +82,7 @@ namespace Swift { template Sluift::Response sendPubSubRequest( - IQ::Type type, const JID& jid, boost::shared_ptr payload, int timeout) { + IQ::Type type, const JID& jid, std::shared_ptr payload, int timeout) { return sendRequest(client->getPubSubManager()->createRequest( type, jid, payload), timeout); } @@ -97,7 +97,7 @@ namespace Swift { template Sluift::Response sendVoidRequest(REQUEST_TYPE request, int timeout) { boost::signals::scoped_connection c = request->onResponse.connect( - boost::bind(&SluiftClient::handleRequestResponse, this, boost::shared_ptr(), _1)); + boost::bind(&SluiftClient::handleRequestResponse, this, std::shared_ptr(), _1)); return doSendRequest(request, timeout); } @@ -108,13 +108,13 @@ namespace Swift { std::vector getRoster(int timeout); private: - Sluift::Response doSendRequest(boost::shared_ptr request, int timeout); + Sluift::Response doSendRequest(std::shared_ptr request, int timeout); - void handleIncomingMessage(boost::shared_ptr stanza); - void handleIncomingPresence(boost::shared_ptr stanza); - void handleIncomingPubSubEvent(const JID& from, boost::shared_ptr event); + void handleIncomingMessage(std::shared_ptr stanza); + void handleIncomingPresence(std::shared_ptr stanza); + void handleIncomingPubSubEvent(const JID& from, std::shared_ptr event); void handleInitialRosterPopulated(); - void handleRequestResponse(boost::shared_ptr response, boost::shared_ptr error); + void handleRequestResponse(std::shared_ptr response, std::shared_ptr error); void handleDisconnected(const boost::optional& error); private: @@ -127,7 +127,7 @@ namespace Swift { std::deque pendingEvents; boost::optional disconnectedError; bool requestResponseReceived; - boost::shared_ptr requestResponse; - boost::shared_ptr requestError; + std::shared_ptr requestResponse; + std::shared_ptr requestError; }; } diff --git a/Sluift/SluiftComponent.cpp b/Sluift/SluiftComponent.cpp index 6abe800..e1d1738 100644 --- a/Sluift/SluiftComponent.cpp +++ b/Sluift/SluiftComponent.cpp @@ -113,15 +113,15 @@ boost::optional SluiftComponent::getNextEvent( } } -void SluiftComponent::handleIncomingMessage(boost::shared_ptr stanza) { +void SluiftComponent::handleIncomingMessage(std::shared_ptr stanza) { pendingEvents.push_back(Event(stanza)); } -void SluiftComponent::handleIncomingPresence(boost::shared_ptr stanza) { +void SluiftComponent::handleIncomingPresence(std::shared_ptr stanza) { pendingEvents.push_back(Event(stanza)); } -void SluiftComponent::handleRequestResponse(boost::shared_ptr response, boost::shared_ptr error) { +void SluiftComponent::handleRequestResponse(std::shared_ptr response, std::shared_ptr error) { requestResponse = response; requestError = error; requestResponseReceived = true; @@ -131,7 +131,7 @@ void SluiftComponent::handleError(const boost::optional& error) disconnectedError = error; } -Sluift::Response SluiftComponent::doSendRequest(boost::shared_ptr request, int timeout) { +Sluift::Response SluiftComponent::doSendRequest(std::shared_ptr request, int timeout) { requestResponse.reset(); requestError.reset(); requestResponseReceived = false; @@ -142,5 +142,5 @@ Sluift::Response SluiftComponent::doSendRequest(boost::shared_ptr reque eventLoop->runUntilEvents(); } return Sluift::Response(requestResponse, watchdog.getTimedOut() ? - boost::make_shared(ErrorPayload::RemoteServerTimeout) : requestError); + std::make_shared(ErrorPayload::RemoteServerTimeout) : requestError); } diff --git a/Sluift/SluiftComponent.h b/Sluift/SluiftComponent.h index fd1b97a..83bd52f 100644 --- a/Sluift/SluiftComponent.h +++ b/Sluift/SluiftComponent.h @@ -43,13 +43,13 @@ namespace Swift { PresenceType }; - Event(boost::shared_ptr stanza) : type(MessageType), stanza(stanza) {} - Event(boost::shared_ptr stanza) : type(PresenceType), stanza(stanza) {} + Event(std::shared_ptr stanza) : type(MessageType), stanza(stanza) {} + Event(std::shared_ptr stanza) : type(PresenceType), stanza(stanza) {} Type type; // Message & Presence - boost::shared_ptr stanza; + std::shared_ptr stanza; }; SluiftComponent( @@ -78,7 +78,7 @@ namespace Swift { template Sluift::Response sendVoidRequest(REQUEST_TYPE request, int timeout) { boost::signals::scoped_connection c = request->onResponse.connect( - boost::bind(&SluiftComponent::handleRequestResponse, this, boost::shared_ptr(), _1)); + boost::bind(&SluiftComponent::handleRequestResponse, this, std::shared_ptr(), _1)); return doSendRequest(request, timeout); } @@ -88,11 +88,11 @@ namespace Swift { boost::function condition = 0); private: - Sluift::Response doSendRequest(boost::shared_ptr request, int timeout); + Sluift::Response doSendRequest(std::shared_ptr request, int timeout); - void handleIncomingMessage(boost::shared_ptr stanza); - void handleIncomingPresence(boost::shared_ptr stanza); - void handleRequestResponse(boost::shared_ptr response, boost::shared_ptr error); + void handleIncomingMessage(std::shared_ptr stanza); + void handleIncomingPresence(std::shared_ptr stanza); + void handleRequestResponse(std::shared_ptr response, std::shared_ptr error); void handleError(const boost::optional& error); private: @@ -103,7 +103,7 @@ namespace Swift { std::deque pendingEvents; boost::optional disconnectedError; bool requestResponseReceived; - boost::shared_ptr requestResponse; - boost::shared_ptr requestError; + std::shared_ptr requestResponse; + std::shared_ptr requestError; }; } diff --git a/Sluift/client.cpp b/Sluift/client.cpp index 3f7861c..f82d314 100644 --- a/Sluift/client.cpp +++ b/Sluift/client.cpp @@ -60,7 +60,7 @@ static inline int getGlobalTimeout(lua_State* L) { return result; } -static void addPayloadsToTable(lua_State* L, const std::vector >& payloads) { +static void addPayloadsToTable(lua_State* L, const std::vector >& payloads) { if (!payloads.empty()) { lua_createtable(L, boost::numeric_cast(payloads.size()), 0); for (size_t i = 0; i < payloads.size(); ++i) { @@ -72,25 +72,25 @@ static void addPayloadsToTable(lua_State* L, const std::vector getPayload(lua_State* L, int index) { +static std::shared_ptr getPayload(lua_State* L, int index) { if (lua_type(L, index) == LUA_TTABLE) { - return boost::dynamic_pointer_cast(Sluift::globals.elementConvertor.convertFromLua(L, index)); + return std::dynamic_pointer_cast(Sluift::globals.elementConvertor.convertFromLua(L, index)); } else if (lua_type(L, index) == LUA_TSTRING) { - return boost::make_shared(Lua::checkString(L, index)); + return std::make_shared(Lua::checkString(L, index)); } else { - return boost::shared_ptr(); + return std::shared_ptr(); } } -static std::vector< boost::shared_ptr > getPayloadsFromTable(lua_State* L, int index) { +static std::vector< std::shared_ptr > getPayloadsFromTable(lua_State* L, int index) { index = Lua::absoluteOffset(L, index); - std::vector< boost::shared_ptr > result; + std::vector< std::shared_ptr > result; lua_getfield(L, index, "payloads"); if (lua_istable(L, -1)) { for (lua_pushnil(L); lua_next(L, -2); lua_pop(L, 1)) { - boost::shared_ptr payload = getPayload(L, -1); + std::shared_ptr payload = getPayload(L, -1); if (payload) { result.push_back(payload); } @@ -172,7 +172,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( ) { Sluift::globals.eventLoop.runOnce(); SluiftClient* client = getClient(L); - if (boost::shared_ptr version = boost::dynamic_pointer_cast(Sluift::globals.elementConvertor.convertFromLuaUntyped(L, 2, "software_version"))) { + if (std::shared_ptr version = std::dynamic_pointer_cast(Sluift::globals.elementConvertor.convertFromLuaUntyped(L, 2, "software_version"))) { client->setSoftwareVersion(version->getName(), version->getVersion(), version->getOS()); } return 0; @@ -198,11 +198,11 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( case RosterItemPayload::Remove: subscription = "remove"; break; } Lua::Table itemTable = boost::assign::map_list_of - ("jid", boost::make_shared(item.getJID().toString())) - ("name", boost::make_shared(item.getName())) - ("subscription", boost::make_shared(subscription)) - ("groups", boost::make_shared(std::vector(item.getGroups().begin(), item.getGroups().end()))); - contactsTable[item.getJID().toString()] = boost::make_shared(itemTable); + ("jid", std::make_shared(item.getJID().toString())) + ("name", std::make_shared(item.getName())) + ("subscription", std::make_shared(subscription)) + ("groups", std::make_shared(std::vector(item.getGroups().begin(), item.getGroups().end()))); + contactsTable[item.getJID().toString()] = std::make_shared(itemTable); } pushValue(L, contactsTable); Lua::registerTableToString(L, -1); @@ -226,7 +226,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( JID to; boost::optional body; boost::optional subject; - std::vector > payloads; + std::vector > payloads; int index = 2; Message::Type type = Message::Chat; if (lua_isstring(L, index)) { @@ -263,7 +263,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( if ((!body || body->empty()) && !subject && payloads.empty()) { throw Lua::Exception("Missing any of 'body', 'subject' or 'payloads'"); } - Message::ref message = boost::make_shared(); + Message::ref message = std::make_shared(); message->setTo(to); if (body && !body->empty()) { message->setBody(*body); @@ -292,7 +292,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( "payloads payloads to add to the presence\n" ) { Sluift::globals.eventLoop.runOnce(); - boost::shared_ptr presence = boost::make_shared(); + std::shared_ptr presence = std::make_shared(); int index = 2; if (lua_isstring(L, index)) { @@ -315,7 +315,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( if (boost::optional value = Lua::getStringField(L, index, "show")) { presence->setShow(StatusShowConvertor::convertStatusShowTypeFromString(*value)); } - std::vector< boost::shared_ptr > payloads = getPayloadsFromTable(L, index); + std::vector< std::shared_ptr > payloads = getPayloadsFromTable(L, index); presence->addPayloads(payloads.begin(), payloads.end()); } @@ -337,17 +337,17 @@ static int sendQuery(lua_State* L, IQ::Type type) { timeout = *timeoutInt; } - boost::shared_ptr payload; + std::shared_ptr payload; lua_getfield(L, 2, "query"); payload = getPayload(L, -1); lua_pop(L, 1); return client->sendRequest( - boost::make_shared< GenericRequest >(type, to, payload, client->getClient()->getIQRouter()), timeout).convertToLuaResult(L); + std::make_shared< GenericRequest >(type, to, payload, client->getClient()->getIQRouter()), timeout).convertToLuaResult(L); } #define DISPATCH_PUBSUB_PAYLOAD(payloadType, container, response) \ - else if (boost::shared_ptr p = boost::dynamic_pointer_cast(payload)) { \ + else if (std::shared_ptr p = std::dynamic_pointer_cast(payload)) { \ return client->sendPubSubRequest(type, to, p, timeout).convertToLuaResult(L); \ } @@ -376,7 +376,7 @@ SLUIFT_LUA_FUNCTION(Client, query_pubsub) { if (!lua_istable(L, -1)) { throw Lua::Exception("Missing/incorrect query"); } - boost::shared_ptr payload = getPayload(L, -1); + std::shared_ptr payload = getPayload(L, -1); if (false) { } SWIFTEN_PUBSUB_FOREACH_PUBSUB_PAYLOAD_TYPE(DISPATCH_PUBSUB_PAYLOAD) @@ -470,13 +470,13 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( SluiftClient* client = getClient(L); Lua::Table optionsTable = boost::assign::map_list_of - ("host", boost::make_shared(client->getOptions().manualHostname)) - ("port", boost::make_shared(client->getOptions().manualPort)) - ("ack", boost::make_shared(client->getOptions().useAcks)) - ("compress", boost::make_shared(client->getOptions().useStreamCompression)) - ("tls", boost::make_shared(client->getOptions().useTLS == ClientOptions::NeverUseTLS ? false : true)) - ("bosh_url", boost::make_shared(client->getOptions().boshURL.toString())) - ("allow_plain_without_tls", boost::make_shared(client->getOptions().allowPLAINWithoutTLS)); + ("host", std::make_shared(client->getOptions().manualHostname)) + ("port", std::make_shared(client->getOptions().manualPort)) + ("ack", std::make_shared(client->getOptions().useAcks)) + ("compress", std::make_shared(client->getOptions().useStreamCompression)) + ("tls", std::make_shared(client->getOptions().useTLS == ClientOptions::NeverUseTLS ? false : true)) + ("bosh_url", std::make_shared(client->getOptions().boshURL.toString())) + ("allow_plain_without_tls", std::make_shared(client->getOptions().allowPLAINWithoutTLS)); pushValue(L, optionsTable); Lua::registerTableToString(L, -1); return 1; @@ -485,24 +485,24 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( static void pushEvent(lua_State* L, const SluiftClient::Event& event) { switch (event.type) { case SluiftClient::Event::MessageType: { - Message::ref message = boost::dynamic_pointer_cast(event.stanza); + Message::ref message = std::dynamic_pointer_cast(event.stanza); Lua::Table result = boost::assign::map_list_of - ("type", boost::make_shared(std::string("message"))) - ("from", boost::make_shared(message->getFrom().toString())) - ("body", boost::make_shared(message->getBody().get_value_or(""))) - ("message_type", boost::make_shared(MessageConvertor::convertMessageTypeToString(message->getType()))); + ("type", std::make_shared(std::string("message"))) + ("from", std::make_shared(message->getFrom().toString())) + ("body", std::make_shared(message->getBody().get_value_or(""))) + ("message_type", std::make_shared(MessageConvertor::convertMessageTypeToString(message->getType()))); Lua::pushValue(L, result); addPayloadsToTable(L, message->getPayloads()); Lua::registerTableToString(L, -1); break; } case SluiftClient::Event::PresenceType: { - Presence::ref presence = boost::dynamic_pointer_cast(event.stanza); + Presence::ref presence = std::dynamic_pointer_cast(event.stanza); Lua::Table result = boost::assign::map_list_of - ("type", boost::make_shared(std::string("presence"))) - ("from", boost::make_shared(presence->getFrom().toString())) - ("status", boost::make_shared(presence->getStatus())) - ("presence_type", boost::make_shared(PresenceConvertor::convertPresenceTypeToString(presence->getType()))); + ("type", std::make_shared(std::string("presence"))) + ("from", std::make_shared(presence->getFrom().toString())) + ("status", std::make_shared(presence->getStatus())) + ("presence_type", std::make_shared(PresenceConvertor::convertPresenceTypeToString(presence->getType()))); Lua::pushValue(L, result); addPayloadsToTable(L, presence->getPayloads()); Lua::registerTableToString(L, -1); @@ -640,7 +640,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( client->getRoster(timeout); if (!client->getClient()->getRoster()->containsJID(item.getJID())) { - RosterPayload::ref roster = boost::make_shared(); + RosterPayload::ref roster = std::make_shared(); roster->addItem(item); Sluift::Response response = client->sendVoidRequest( @@ -666,7 +666,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( JID jid(Lua::checkString(L, 2)); int timeout = getGlobalTimeout(L); - RosterPayload::ref roster = boost::make_shared(); + RosterPayload::ref roster = std::make_shared(); roster->addItem(RosterItemPayload(JID(Lua::checkString(L, 2)), "", RosterItemPayload::Remove)); return client->sendVoidRequest( @@ -712,7 +712,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( if (!lua_istable(L, 2)) { throw Lua::Exception("Missing disco info"); } - if (boost::shared_ptr discoInfo = boost::dynamic_pointer_cast(Sluift::globals.elementConvertor.convertFromLuaUntyped(L, 2, "disco_info"))) { + if (std::shared_ptr discoInfo = std::dynamic_pointer_cast(Sluift::globals.elementConvertor.convertFromLuaUntyped(L, 2, "disco_info"))) { client->getClient()->getDiscoManager()->setDiscoInfo(*discoInfo); } else { @@ -756,7 +756,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( if (file.empty()) { getClient(L)->getClient()->setCertificate(CertificateWithKey::ref()); } else { - getClient(L)->getClient()->setCertificate(boost::make_shared(file, createSafeByteArray(pwd))); + getClient(L)->getClient()->setCertificate(std::make_shared(file, createSafeByteArray(pwd))); } return 0; } diff --git a/Sluift/component.cpp b/Sluift/component.cpp index f8184c7..0196a09 100644 --- a/Sluift/component.cpp +++ b/Sluift/component.cpp @@ -58,7 +58,7 @@ static inline int getGlobalTimeout(lua_State* L) { return result; } -static void addPayloadsToTable(lua_State* L, const std::vector >& payloads) { +static void addPayloadsToTable(lua_State* L, const std::vector >& payloads) { if (!payloads.empty()) { lua_createtable(L, boost::numeric_cast(payloads.size()), 0); for (size_t i = 0; i < payloads.size(); ++i) { @@ -70,25 +70,25 @@ static void addPayloadsToTable(lua_State* L, const std::vector getPayload(lua_State* L, int index) { +static std::shared_ptr getPayload(lua_State* L, int index) { if (lua_type(L, index) == LUA_TTABLE) { - return boost::dynamic_pointer_cast(Sluift::globals.elementConvertor.convertFromLua(L, index)); + return std::dynamic_pointer_cast(Sluift::globals.elementConvertor.convertFromLua(L, index)); } else if (lua_type(L, index) == LUA_TSTRING) { - return boost::make_shared(Lua::checkString(L, index)); + return std::make_shared(Lua::checkString(L, index)); } else { - return boost::shared_ptr(); + return std::shared_ptr(); } } -static std::vector< boost::shared_ptr > getPayloadsFromTable(lua_State* L, int index) { +static std::vector< std::shared_ptr > getPayloadsFromTable(lua_State* L, int index) { index = Lua::absoluteOffset(L, index); - std::vector< boost::shared_ptr > result; + std::vector< std::shared_ptr > result; lua_getfield(L, index, "payloads"); if (lua_istable(L, -1)) { for (lua_pushnil(L); lua_next(L, -2); lua_pop(L, 1)) { - boost::shared_ptr payload = getPayload(L, -1); + std::shared_ptr payload = getPayload(L, -1); if (payload) { result.push_back(payload); } @@ -170,7 +170,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( ) { Sluift::globals.eventLoop.runOnce(); SluiftComponent* component = getComponent(L); - if (boost::shared_ptr version = boost::dynamic_pointer_cast(Sluift::globals.elementConvertor.convertFromLuaUntyped(L, 2, "software_version"))) { + if (std::shared_ptr version = std::dynamic_pointer_cast(Sluift::globals.elementConvertor.convertFromLuaUntyped(L, 2, "software_version"))) { component->setSoftwareVersion(version->getName(), version->getVersion(), version->getOS()); } return 0; @@ -194,7 +194,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( boost::optional from; boost::optional body; boost::optional subject; - std::vector > payloads; + std::vector > payloads; int index = 2; Message::Type type = Message::Chat; if (lua_isstring(L, index)) { @@ -235,7 +235,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( if ((!body || body->empty()) && !subject && payloads.empty()) { throw Lua::Exception("Missing any of 'body', 'subject' or 'payloads'"); } - Message::ref message = boost::make_shared(); + Message::ref message = std::make_shared(); message->setTo(to); if (from && !from->empty()) { message->setFrom(*from); @@ -268,7 +268,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( "payloads payloads to add to the presence\n" ) { Sluift::globals.eventLoop.runOnce(); - boost::shared_ptr presence = boost::make_shared(); + std::shared_ptr presence = std::make_shared(); int index = 2; if (lua_isstring(L, index)) { @@ -294,7 +294,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( if (boost::optional value = Lua::getStringField(L, index, "show")) { presence->setShow(StatusShowConvertor::convertStatusShowTypeFromString(*value)); } - std::vector< boost::shared_ptr > payloads = getPayloadsFromTable(L, index); + std::vector< std::shared_ptr > payloads = getPayloadsFromTable(L, index); presence->addPayloads(payloads.begin(), payloads.end()); } @@ -321,13 +321,13 @@ static int sendQuery(lua_State* L, IQ::Type type) { timeout = *timeoutInt; } - boost::shared_ptr payload; + std::shared_ptr payload; lua_getfield(L, 2, "query"); payload = getPayload(L, -1); lua_pop(L, 1); return component->sendRequest( - boost::make_shared< GenericRequest >(type, from, to, payload, component->getComponent()->getIQRouter()), timeout).convertToLuaResult(L); + std::make_shared< GenericRequest >(type, from, to, payload, component->getComponent()->getIQRouter()), timeout).convertToLuaResult(L); } SLUIFT_LUA_FUNCTION(Component, get) { @@ -357,26 +357,26 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( static void pushEvent(lua_State* L, const SluiftComponent::Event& event) { switch (event.type) { case SluiftComponent::Event::MessageType: { - Message::ref message = boost::dynamic_pointer_cast(event.stanza); + Message::ref message = std::dynamic_pointer_cast(event.stanza); Lua::Table result = boost::assign::map_list_of - ("type", boost::make_shared(std::string("message"))) - ("from", boost::make_shared(message->getFrom().toString())) - ("to", boost::make_shared(message->getTo().toString())) - ("body", boost::make_shared(message->getBody().get_value_or(""))) - ("message_type", boost::make_shared(MessageConvertor::convertMessageTypeToString(message->getType()))); + ("type", std::make_shared(std::string("message"))) + ("from", std::make_shared(message->getFrom().toString())) + ("to", std::make_shared(message->getTo().toString())) + ("body", std::make_shared(message->getBody().get_value_or(""))) + ("message_type", std::make_shared(MessageConvertor::convertMessageTypeToString(message->getType()))); Lua::pushValue(L, result); addPayloadsToTable(L, message->getPayloads()); Lua::registerTableToString(L, -1); break; } case SluiftComponent::Event::PresenceType: { - Presence::ref presence = boost::dynamic_pointer_cast(event.stanza); + Presence::ref presence = std::dynamic_pointer_cast(event.stanza); Lua::Table result = boost::assign::map_list_of - ("type", boost::make_shared(std::string("presence"))) - ("from", boost::make_shared(presence->getFrom().toString())) - ("to", boost::make_shared(presence->getTo().toString())) - ("status", boost::make_shared(presence->getStatus())) - ("presence_type", boost::make_shared(PresenceConvertor::convertPresenceTypeToString(presence->getType()))); + ("type", std::make_shared(std::string("presence"))) + ("from", std::make_shared(presence->getFrom().toString())) + ("to", std::make_shared(presence->getTo().toString())) + ("status", std::make_shared(presence->getStatus())) + ("presence_type", std::make_shared(PresenceConvertor::convertPresenceTypeToString(presence->getType()))); Lua::pushValue(L, result); addPayloadsToTable(L, presence->getPayloads()); Lua::registerTableToString(L, -1); diff --git a/Sluift/sluift.cpp b/Sluift/sluift.cpp index 549ae01..d92f0db 100644 --- a/Sluift/sluift.cpp +++ b/Sluift/sluift.cpp @@ -123,7 +123,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( "data the data to hash", "" ) { - static boost::shared_ptr crypto(PlatformCryptoProvider::create()); + static std::shared_ptr crypto(PlatformCryptoProvider::create()); if (!lua_isstring(L, 1)) { throw Lua::Exception("Expected string"); } @@ -178,7 +178,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( "" ) { static FullPayloadSerializerCollection serializers; - boost::shared_ptr payload = boost::dynamic_pointer_cast(Sluift::globals.elementConvertor.convertFromLua(L, 1)); + std::shared_ptr payload = std::dynamic_pointer_cast(Sluift::globals.elementConvertor.convertFromLua(L, 1)); if (!payload) { throw Lua::Exception("Unrecognized XML"); } @@ -488,7 +488,7 @@ SLUIFT_API int luaopen_sluift(lua_State* L) { lua_pop(L, 1); // Register documentation for all elements - foreach (boost::shared_ptr convertor, Sluift::globals.elementConvertor.getConvertors()) { + foreach (std::shared_ptr convertor, Sluift::globals.elementConvertor.getConvertors()) { boost::optional documentation = convertor->getDocumentation(); if (documentation) { Lua::registerClassHelp(L, documentation->className, documentation->description); diff --git a/SwifTools/CrashReporter.cpp b/SwifTools/CrashReporter.cpp index b401e76..15b5cd0 100644 --- a/SwifTools/CrashReporter.cpp +++ b/SwifTools/CrashReporter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 Isode Limited. + * Copyright (c) 2012-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -13,7 +13,7 @@ #pragma GCC diagnostic ignored "-Wold-style-cast" -#include +#include #ifdef SWIFTEN_PLATFORM_MACOSX #include "client/mac/handler/exception_handler.h" @@ -35,7 +35,7 @@ static bool handleDump(const char* /* dir */, const char* /* id*/, void* /* cont namespace Swift { struct CrashReporter::Private { - boost::shared_ptr handler; + std::shared_ptr handler; }; CrashReporter::CrashReporter(const boost::filesystem::path& path) { @@ -49,11 +49,11 @@ CrashReporter::CrashReporter(const boost::filesystem::path& path) { } } - p = boost::make_shared(); + p = std::make_shared(); #if defined(SWIFTEN_PLATFORM_WINDOWS) // FIXME: Need UTF8 conversion from string to wstring std::string pathString = pathToString(path); - p->handler = boost::shared_ptr( + p->handler = std::shared_ptr( // Not using make_shared, because 'handleDump' seems to have problems with VC2010 new google_breakpad::ExceptionHandler( std::wstring(pathString.begin(), pathString.end()), @@ -63,7 +63,7 @@ CrashReporter::CrashReporter(const boost::filesystem::path& path) { google_breakpad::ExceptionHandler::HANDLER_ALL)); // Turning it off for Mac, because it doesn't really help us //#elif defined(SWIFTEN_PLATFORM_MACOSX) -// p->handler = boost::make_shared(pathToString(path), (google_breakpad::ExceptionHandler::FilterCallback) 0, handleDump, (void*) 0, true, (const char*) 0); +// p->handler = std::make_shared(pathToString(path), (google_breakpad::ExceptionHandler::FilterCallback) 0, handleDump, (void*) 0, true, (const char*) 0); #endif } diff --git a/SwifTools/CrashReporter.h b/SwifTools/CrashReporter.h index ee71223..c80b1a2 100644 --- a/SwifTools/CrashReporter.h +++ b/SwifTools/CrashReporter.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include namespace Swift { class CrashReporter { @@ -18,6 +18,6 @@ namespace Swift { private: struct Private; - boost::shared_ptr p; + std::shared_ptr p; }; } diff --git a/SwifTools/Idle/ActualIdleDetector.h b/SwifTools/Idle/ActualIdleDetector.h index 194606f..44a9649 100644 --- a/SwifTools/Idle/ActualIdleDetector.h +++ b/SwifTools/Idle/ActualIdleDetector.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include @@ -25,6 +25,6 @@ namespace Swift { private: IdleQuerier* querier; - boost::shared_ptr timer; + std::shared_ptr timer; }; } diff --git a/SwifTools/Idle/IdleDetector.h b/SwifTools/Idle/IdleDetector.h index 88a1c4c..30276bc 100644 --- a/SwifTools/Idle/IdleDetector.h +++ b/SwifTools/Idle/IdleDetector.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include diff --git a/SwifTools/Idle/UnitTest/ActualIdleDetectorTest.cpp b/SwifTools/Idle/UnitTest/ActualIdleDetectorTest.cpp index 8af66fc..8e4177e 100644 --- a/SwifTools/Idle/UnitTest/ActualIdleDetectorTest.cpp +++ b/SwifTools/Idle/UnitTest/ActualIdleDetectorTest.cpp @@ -150,18 +150,18 @@ class ActualIdleDetectorTest : public CppUnit::TestFixture { MockTimerFactory() {} void updateTime(int milliseconds) { - foreach(boost::shared_ptr timer, timers) { + foreach(std::shared_ptr timer, timers) { timer->updateTime(milliseconds); } } - boost::shared_ptr createTimer(int milliseconds) { - boost::shared_ptr timer(new MockTimer(milliseconds)); + std::shared_ptr createTimer(int milliseconds) { + std::shared_ptr timer(new MockTimer(milliseconds)); timers.push_back(timer); return timer; } - std::vector > timers; + std::vector > timers; }; MockIdleQuerier* querier; diff --git a/SwifTools/Notifier/GrowlNotifier.h b/SwifTools/Notifier/GrowlNotifier.h index b4c4eba..cbfe3e9 100644 --- a/SwifTools/Notifier/GrowlNotifier.h +++ b/SwifTools/Notifier/GrowlNotifier.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -36,6 +36,6 @@ namespace Swift { private: class Private; - boost::shared_ptr p; + std::shared_ptr p; }; } diff --git a/SwifTools/Notifier/GrowlNotifier.mm b/SwifTools/Notifier/GrowlNotifier.mm index e9ffff7..1356805 100644 --- a/SwifTools/Notifier/GrowlNotifier.mm +++ b/SwifTools/Notifier/GrowlNotifier.mm @@ -6,7 +6,7 @@ #include -#include +#include #include #include @@ -33,7 +33,7 @@ class GrowlNotifier::Private { }; GrowlNotifier::GrowlNotifier(const std::string& name) { - p = boost::make_shared(); + p = std::make_shared(); p->delegate = boost::intrusive_ptr([[GrowlNotifierDelegate alloc] init], false); p->delegate.get().notifier = this; p->delegate.get().name = std2NSString(name); diff --git a/SwifTools/Notifier/NotificationCenterNotifier.h b/SwifTools/Notifier/NotificationCenterNotifier.h index 75b4df7..19eb944 100644 --- a/SwifTools/Notifier/NotificationCenterNotifier.h +++ b/SwifTools/Notifier/NotificationCenterNotifier.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -32,7 +32,7 @@ public: private: class Private; - boost::shared_ptr p; + std::shared_ptr p; }; } diff --git a/SwifTools/Notifier/NotificationCenterNotifier.mm b/SwifTools/Notifier/NotificationCenterNotifier.mm index 57b9a4b..35c740a 100644 --- a/SwifTools/Notifier/NotificationCenterNotifier.mm +++ b/SwifTools/Notifier/NotificationCenterNotifier.mm @@ -9,7 +9,7 @@ #include #include -#include +#include #include @@ -35,12 +35,12 @@ namespace Swift { class NotificationCenterNotifier::Private { public: - std::map > callbacksForNotifications; + std::map > callbacksForNotifications; boost::intrusive_ptr delegate; }; NotificationCenterNotifier::NotificationCenterNotifier() { - p = boost::make_shared(); + p = std::make_shared(); p->delegate = boost::intrusive_ptr([[NotificationCenterNotifierDelegate alloc] init], false); [p->delegate.get() setNotifier: this]; @@ -73,7 +73,7 @@ void NotificationCenterNotifier::showMessage(Type type, const std::string& subje /// \todo Currently the elements are only removed on application exit. Ideally the notifications not required anymore /// are removed from the map; e.g. when visiting a chat view, all notifications from that view can be removed from /// the map and the NSUserNotificationCenter. - p->callbacksForNotifications[ns2StdString(notification.identifier)] = boost::make_shared(callback); + p->callbacksForNotifications[ns2StdString(notification.identifier)] = std::make_shared(callback); [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; [notification release]; } diff --git a/Swift/Controllers/AdHocController.cpp b/Swift/Controllers/AdHocController.cpp index 4b93f2b..5e10beb 100644 --- a/Swift/Controllers/AdHocController.cpp +++ b/Swift/Controllers/AdHocController.cpp @@ -12,7 +12,7 @@ namespace Swift { -AdHocController::AdHocController(AdHocCommandWindowFactory* factory, boost::shared_ptr command) { +AdHocController::AdHocController(AdHocCommandWindowFactory* factory, std::shared_ptr command) { window_ = factory->createAdHocCommandWindow(command); window_->onClosing.connect(boost::bind(&AdHocController::handleWindowClosed, this)); } diff --git a/Swift/Controllers/AdHocController.h b/Swift/Controllers/AdHocController.h index 4694991..33b22f8 100644 --- a/Swift/Controllers/AdHocController.h +++ b/Swift/Controllers/AdHocController.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include @@ -17,7 +17,7 @@ class AdHocCommandWindow; class AdHocController { public: - AdHocController(AdHocCommandWindowFactory* factory, boost::shared_ptr command); + AdHocController(AdHocCommandWindowFactory* factory, std::shared_ptr command); ~AdHocController(); boost::signal onDeleting; void setOnline(bool online); diff --git a/Swift/Controllers/AdHocManager.cpp b/Swift/Controllers/AdHocManager.cpp index 1dcefbd..4212b8a 100644 --- a/Swift/Controllers/AdHocManager.cpp +++ b/Swift/Controllers/AdHocManager.cpp @@ -6,9 +6,9 @@ #include +#include + #include -#include -#include #include #include @@ -38,12 +38,12 @@ AdHocManager::~AdHocManager() { } } -void AdHocManager::removeController(boost::shared_ptr controller) { +void AdHocManager::removeController(std::shared_ptr controller) { controller->onDeleting.disconnect(boost::bind(&AdHocManager::removeController, this, controller)); controllers_.erase(std::find(controllers_.begin(), controllers_.end(), controller)); } -void AdHocManager::setServerDiscoInfo(boost::shared_ptr info) { +void AdHocManager::setServerDiscoInfo(std::shared_ptr info) { if (iqRouter_->isAvailable() && info->hasFeature(DiscoInfo::CommandsFeature)) { if (discoItemsRequest_) { discoItemsRequest_->onResponse.disconnect(boost::bind(&AdHocManager::handleServerDiscoItemsResponse, this, _1, _2)); @@ -58,12 +58,12 @@ void AdHocManager::setServerDiscoInfo(boost::shared_ptr info) { } void AdHocManager::setOnline(bool online) { - foreach (boost::shared_ptr controller, controllers_) { + foreach (std::shared_ptr controller, controllers_) { controller->setOnline(online); } } -void AdHocManager::handleServerDiscoItemsResponse(boost::shared_ptr items, ErrorPayload::ref error) { +void AdHocManager::handleServerDiscoItemsResponse(std::shared_ptr items, ErrorPayload::ref error) { std::vector commands; if (!error) { foreach (DiscoItems::Item item, items->getItems()) { @@ -75,18 +75,18 @@ void AdHocManager::handleServerDiscoItemsResponse(boost::shared_ptr mainWindow_->setAvailableAdHocCommands(commands); } -void AdHocManager::handleUIEvent(boost::shared_ptr event) { - boost::shared_ptr adHocEvent = boost::dynamic_pointer_cast(event); +void AdHocManager::handleUIEvent(std::shared_ptr event) { + std::shared_ptr adHocEvent = std::dynamic_pointer_cast(event); if (adHocEvent) { - boost::shared_ptr command = boost::make_shared(adHocEvent->getCommand().getJID(), adHocEvent->getCommand().getNode(), iqRouter_); - boost::shared_ptr controller = boost::make_shared(factory_, command); + std::shared_ptr command = std::make_shared(adHocEvent->getCommand().getJID(), adHocEvent->getCommand().getNode(), iqRouter_); + std::shared_ptr controller = std::make_shared(factory_, command); controller->onDeleting.connect(boost::bind(&AdHocManager::removeController, this, controller)); controllers_.push_back(controller); } - boost::shared_ptr adHocJIDEvent = boost::dynamic_pointer_cast(event); + std::shared_ptr adHocJIDEvent = std::dynamic_pointer_cast(event); if (!!adHocJIDEvent) { - boost::shared_ptr command = boost::make_shared(adHocJIDEvent->getJID(), adHocJIDEvent->getNode(), iqRouter_); - boost::shared_ptr controller = boost::make_shared(factory_, command); + std::shared_ptr command = std::make_shared(adHocJIDEvent->getJID(), adHocJIDEvent->getNode(), iqRouter_); + std::shared_ptr controller = std::make_shared(factory_, command); controller->onDeleting.connect(boost::bind(&AdHocManager::removeController, this, controller)); controllers_.push_back(controller); } diff --git a/Swift/Controllers/AdHocManager.h b/Swift/Controllers/AdHocManager.h index 73c057c..3a908ec 100644 --- a/Swift/Controllers/AdHocManager.h +++ b/Swift/Controllers/AdHocManager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -25,12 +25,12 @@ class AdHocManager { public: AdHocManager(const JID& jid, AdHocCommandWindowFactory* factory, IQRouter* iqRouter, UIEventStream* uiEventStream, MainWindow* mainWindow); ~AdHocManager(); - void removeController(boost::shared_ptr contoller); - void setServerDiscoInfo(boost::shared_ptr info); + void removeController(std::shared_ptr contoller); + void setServerDiscoInfo(std::shared_ptr info); void setOnline(bool online); private: - void handleServerDiscoItemsResponse(boost::shared_ptr, ErrorPayload::ref error); - void handleUIEvent(boost::shared_ptr event); + void handleServerDiscoItemsResponse(std::shared_ptr, ErrorPayload::ref error); + void handleUIEvent(std::shared_ptr event); boost::signal onControllerComplete; JID jid_; IQRouter* iqRouter_; @@ -38,7 +38,7 @@ private: MainWindow* mainWindow_; AdHocCommandWindowFactory* factory_; GetDiscoItemsRequest::ref discoItemsRequest_; - std::vector > controllers_; + std::vector > controllers_; }; } diff --git a/Swift/Controllers/BlockListController.cpp b/Swift/Controllers/BlockListController.cpp index 9ed98a8..560a3f3 100644 --- a/Swift/Controllers/BlockListController.cpp +++ b/Swift/Controllers/BlockListController.cpp @@ -53,9 +53,9 @@ void BlockListController::blockListDifferences(const std::vector &newBlockL } } -void BlockListController::handleUIEvent(boost::shared_ptr rawEvent) { +void BlockListController::handleUIEvent(std::shared_ptr rawEvent) { // handle UI dialog - boost::shared_ptr requestDialogEvent = boost::dynamic_pointer_cast(rawEvent); + std::shared_ptr requestDialogEvent = std::dynamic_pointer_cast(rawEvent); if (requestDialogEvent != nullptr) { if (blockListEditorWidget_ == nullptr) { blockListEditorWidget_ = blockListEditorWidgetFactory_->createBlockListEditorWidget(); @@ -69,7 +69,7 @@ void BlockListController::handleUIEvent(boost::shared_ptr rawEvent) { } // handle block state change - boost::shared_ptr changeStateEvent = boost::dynamic_pointer_cast(rawEvent); + std::shared_ptr changeStateEvent = std::dynamic_pointer_cast(rawEvent); if (changeStateEvent != nullptr) { if (changeStateEvent->getBlockState() == RequestChangeBlockStateUIEvent::Blocked) { GenericRequest::ref blockRequest = blockListManager_->createBlockJIDRequest(changeStateEvent->getContact()); @@ -84,7 +84,7 @@ void BlockListController::handleUIEvent(boost::shared_ptr rawEvent) { } } -void BlockListController::handleBlockResponse(GenericRequest::ref request, boost::shared_ptr, ErrorPayload::ref error, const std::vector& jids, bool originEditor) { +void BlockListController::handleBlockResponse(GenericRequest::ref request, std::shared_ptr, ErrorPayload::ref error, const std::vector& jids, bool originEditor) { if (error) { std::string errorMessage; // FIXME: Handle reporting of list of JIDs in a translatable way. @@ -97,7 +97,7 @@ void BlockListController::handleBlockResponse(GenericRequest::ref blockListEditorWidget_->setBusy(false); } else { - eventController_->handleIncomingEvent(boost::make_shared(request->getReceiver(), errorMessage)); + eventController_->handleIncomingEvent(std::make_shared(request->getReceiver(), errorMessage)); } } if (originEditor) { @@ -109,7 +109,7 @@ void BlockListController::handleBlockResponse(GenericRequest::ref } } -void BlockListController::handleUnblockResponse(GenericRequest::ref request, boost::shared_ptr, ErrorPayload::ref error, const std::vector& jids, bool originEditor) { +void BlockListController::handleUnblockResponse(GenericRequest::ref request, std::shared_ptr, ErrorPayload::ref error, const std::vector& jids, bool originEditor) { if (error) { std::string errorMessage; // FIXME: Handle reporting of list of JIDs in a translatable way. @@ -122,7 +122,7 @@ void BlockListController::handleUnblockResponse(GenericRequest:: blockListEditorWidget_->setBusy(false); } else { - eventController_->handleIncomingEvent(boost::make_shared(request->getReceiver(), errorMessage)); + eventController_->handleIncomingEvent(std::make_shared(request->getReceiver(), errorMessage)); } } if (originEditor) { diff --git a/Swift/Controllers/BlockListController.h b/Swift/Controllers/BlockListController.h index f9ee5a6..c1f6fee 100644 --- a/Swift/Controllers/BlockListController.h +++ b/Swift/Controllers/BlockListController.h @@ -12,7 +12,7 @@ #pragma once -#include +#include #include @@ -34,10 +34,10 @@ public: private: void blockListDifferences(const std::vector &newBlockList, std::vector& jidsToUnblock, std::vector& jidsToBlock) const; - void handleUIEvent(boost::shared_ptr event); + void handleUIEvent(std::shared_ptr event); - void handleBlockResponse(GenericRequest::ref, boost::shared_ptr, ErrorPayload::ref error, const std::vector& jids, bool originEditor); - void handleUnblockResponse(GenericRequest::ref, boost::shared_ptr, ErrorPayload::ref error, const std::vector& jids, bool originEditor); + void handleBlockResponse(GenericRequest::ref, std::shared_ptr, ErrorPayload::ref error, const std::vector& jids, bool originEditor); + void handleUnblockResponse(GenericRequest::ref, std::shared_ptr, ErrorPayload::ref error, const std::vector& jids, bool originEditor); void handleSetNewBlockList(const std::vector& newBlockList); diff --git a/Swift/Controllers/Chat/ChatController.cpp b/Swift/Controllers/Chat/ChatController.cpp index 5302492..dbc5a79 100644 --- a/Swift/Controllers/Chat/ChatController.cpp +++ b/Swift/Controllers/Chat/ChatController.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -49,7 +50,7 @@ namespace Swift { /** * The controller does not gain ownership of the stanzaChannel, nor the factory. */ -ChatController::ChatController(const JID& self, StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, const JID &contact, NickResolver* nickResolver, PresenceOracle* presenceOracle, AvatarManager* avatarManager, bool isInMUC, bool useDelayForLatency, UIEventStream* eventStream, EventController* eventController, TimerFactory* timerFactory, EntityCapsProvider* entityCapsProvider, bool userWantsReceipts, SettingsProvider* settings, HistoryController* historyController, MUCRegistry* mucRegistry, HighlightManager* highlightManager, ClientBlockListManager* clientBlockListManager, boost::shared_ptr chatMessageParser, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider) +ChatController::ChatController(const JID& self, StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, const JID &contact, NickResolver* nickResolver, PresenceOracle* presenceOracle, AvatarManager* avatarManager, bool isInMUC, bool useDelayForLatency, UIEventStream* eventStream, EventController* eventController, TimerFactory* timerFactory, EntityCapsProvider* entityCapsProvider, bool userWantsReceipts, SettingsProvider* settings, HistoryController* historyController, MUCRegistry* mucRegistry, HighlightManager* highlightManager, ClientBlockListManager* clientBlockListManager, std::shared_ptr chatMessageParser, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider) : ChatControllerBase(self, stanzaChannel, iqRouter, chatWindowFactory, contact, presenceOracle, avatarManager, useDelayForLatency, eventStream, eventController, timerFactory, entityCapsProvider, historyController, mucRegistry, highlightManager, chatMessageParser, autoAcceptMUCInviteDecider), eventStream_(eventStream), userWantsReceipts_(userWantsReceipts), settings_(settings), clientBlockListManager_(clientBlockListManager) { isInMUC_ = isInMUC; lastWasPresence_ = false; @@ -147,10 +148,10 @@ void ChatController::setToJID(const JID& jid) { handleBareJIDCapsChanged(toJID_); } -void ChatController::setAvailableServerFeatures(boost::shared_ptr info) { +void ChatController::setAvailableServerFeatures(std::shared_ptr info) { ChatControllerBase::setAvailableServerFeatures(info); if (iqRouter_->isAvailable() && info->hasFeature(DiscoInfo::BlockingCommandFeature)) { - boost::shared_ptr blockList = clientBlockListManager_->getBlockList(); + std::shared_ptr blockList = clientBlockListManager_->getBlockList(); blockingOnStateChangedConnection_ = blockList->onStateChanged.connect(boost::bind(&ChatController::handleBlockingStateChanged, this)); blockingOnItemAddedConnection_ = blockList->onItemAdded.connect(boost::bind(&ChatController::handleBlockingStateChanged, this)); @@ -160,16 +161,16 @@ void ChatController::setAvailableServerFeatures(boost::shared_ptr inf } } -bool ChatController::isIncomingMessageFromMe(boost::shared_ptr) { +bool ChatController::isIncomingMessageFromMe(std::shared_ptr) { return false; } -void ChatController::preHandleIncomingMessage(boost::shared_ptr messageEvent) { +void ChatController::preHandleIncomingMessage(std::shared_ptr messageEvent) { if (messageEvent->isReadable()) { chatWindow_->flash(); lastWasPresence_ = false; } - boost::shared_ptr message = messageEvent->getStanza(); + std::shared_ptr message = messageEvent->getStanza(); JID from = message->getFrom(); if (!from.equals(toJID_, JID::WithResource)) { if (toJID_.equals(from, JID::WithoutResource) && toJID_.isBare()){ @@ -185,7 +186,7 @@ void ChatController::preHandleIncomingMessage(boost::shared_ptr me // handle XEP-0184 Message Receipts // incomming receipts - if (boost::shared_ptr receipt = message->getPayload()) { + if (std::shared_ptr receipt = message->getPayload()) { SWIFT_LOG(debug) << "received receipt for id: " << receipt->getReceivedID() << std::endl; if (requestedReceipts_.find(receipt->getReceivedID()) != requestedReceipts_.end()) { chatWindow_->setMessageReceiptState(requestedReceipts_[receipt->getReceivedID()], ChatWindow::ReceiptReceived); @@ -200,15 +201,15 @@ void ChatController::preHandleIncomingMessage(boost::shared_ptr me // incoming receipt requests } else if (message->getPayload()) { if (receivingPresenceFromUs_) { - boost::shared_ptr receiptMessage = boost::make_shared(); + std::shared_ptr receiptMessage = std::make_shared(); receiptMessage->setTo(toJID_); - receiptMessage->addPayload(boost::make_shared(message->getID())); + receiptMessage->addPayload(std::make_shared(message->getID())); stanzaChannel_->sendMessage(receiptMessage); } } } -void ChatController::postHandleIncomingMessage(boost::shared_ptr messageEvent, const ChatWindow::ChatMessage& chatMessage) { +void ChatController::postHandleIncomingMessage(std::shared_ptr messageEvent, const ChatWindow::ChatMessage& chatMessage) { eventController_->handleIncomingEvent(messageEvent); if (!messageEvent->getConcluded()) { handleHighlightActions(chatMessage); @@ -216,10 +217,10 @@ void ChatController::postHandleIncomingMessage(boost::shared_ptr m } -void ChatController::preSendMessageRequest(boost::shared_ptr message) { +void ChatController::preSendMessageRequest(std::shared_ptr message) { chatStateNotifier_->addChatStateRequest(message); if (userWantsReceipts_ && (contactSupportsReceipts_ != No) && message) { - message->addPayload(boost::make_shared()); + message->addPayload(std::make_shared()); } } @@ -255,7 +256,7 @@ void ChatController::checkForDisplayingDisplayReceiptsAlert() { } void ChatController::handleBlockingStateChanged() { - boost::shared_ptr blockList = clientBlockListManager_->getBlockList(); + std::shared_ptr blockList = clientBlockListManager_->getBlockList(); if (blockList->getState() == BlockList::Available) { if (isInMUC_ ? blockList->isBlocked(toJID_) : blockList->isBlocked(toJID_.toBare())) { if (!blockedContactAlert_) { @@ -281,22 +282,22 @@ void ChatController::handleBlockingStateChanged() { void ChatController::handleBlockUserRequest() { if (isInMUC_) { - eventStream_->send(boost::make_shared(RequestChangeBlockStateUIEvent::Blocked, toJID_)); + eventStream_->send(std::make_shared(RequestChangeBlockStateUIEvent::Blocked, toJID_)); } else { - eventStream_->send(boost::make_shared(RequestChangeBlockStateUIEvent::Blocked, toJID_.toBare())); + eventStream_->send(std::make_shared(RequestChangeBlockStateUIEvent::Blocked, toJID_.toBare())); } } void ChatController::handleUnblockUserRequest() { if (isInMUC_) { - eventStream_->send(boost::make_shared(RequestChangeBlockStateUIEvent::Unblocked, toJID_)); + eventStream_->send(std::make_shared(RequestChangeBlockStateUIEvent::Unblocked, toJID_)); } else { - eventStream_->send(boost::make_shared(RequestChangeBlockStateUIEvent::Unblocked, toJID_.toBare())); + eventStream_->send(std::make_shared(RequestChangeBlockStateUIEvent::Unblocked, toJID_.toBare())); } } void ChatController::handleInviteToChat(const std::vector& droppedJIDs) { - boost::shared_ptr event(new RequestInviteToMUCUIEvent(toJID_.toBare(), droppedJIDs, RequestInviteToMUCUIEvent::Impromptu)); + std::shared_ptr event(new RequestInviteToMUCUIEvent(toJID_.toBare(), droppedJIDs, RequestInviteToMUCUIEvent::Impromptu)); eventStream_->send(event); } @@ -304,21 +305,21 @@ void ChatController::handleWindowClosed() { onWindowClosed(); } -void ChatController::handleUIEvent(boost::shared_ptr event) { - boost::shared_ptr inviteEvent = boost::dynamic_pointer_cast(event); +void ChatController::handleUIEvent(std::shared_ptr event) { + std::shared_ptr inviteEvent = std::dynamic_pointer_cast(event); if (inviteEvent && inviteEvent->getRoom() == toJID_.toBare()) { onConvertToMUC(detachChatWindow(), inviteEvent->getInvites(), inviteEvent->getReason()); } } -void ChatController::postSendMessage(const std::string& body, boost::shared_ptr sentStanza) { - boost::shared_ptr replace = sentStanza->getPayload(); +void ChatController::postSendMessage(const std::string& body, std::shared_ptr sentStanza) { + std::shared_ptr replace = sentStanza->getPayload(); if (replace) { - eraseIf(unackedStanzas_, PairSecondEquals, std::string>(myLastMessageUIID_)); + eraseIf(unackedStanzas_, PairSecondEquals, std::string>(myLastMessageUIID_)); replaceMessage(chatMessageParser_->parseMessageBody(body, "", true), myLastMessageUIID_, boost::posix_time::microsec_clock::universal_time()); } else { - myLastMessageUIID_ = addMessage(chatMessageParser_->parseMessageBody(body, "", true), QT_TRANSLATE_NOOP("", "me"), true, labelsEnabled_ ? chatWindow_->getSelectedSecurityLabel().getLabel() : boost::shared_ptr(), avatarManager_->getAvatarPath(selfJID_), boost::posix_time::microsec_clock::universal_time()); + myLastMessageUIID_ = addMessage(chatMessageParser_->parseMessageBody(body, "", true), QT_TRANSLATE_NOOP("", "me"), true, labelsEnabled_ ? chatWindow_->getSelectedSecurityLabel().getLabel() : std::shared_ptr(), avatarManager_->getAvatarPath(selfJID_), boost::posix_time::microsec_clock::universal_time()); } if (stanzaChannel_->getStreamManagementEnabled() && !myLastMessageUIID_.empty() ) { @@ -335,8 +336,8 @@ void ChatController::postSendMessage(const std::string& body, boost::shared_ptr< chatStateNotifier_->userSentMessage(); } -void ChatController::handleStanzaAcked(boost::shared_ptr stanza) { - std::map, std::string>::iterator unackedStanza = unackedStanzas_.find(stanza); +void ChatController::handleStanzaAcked(std::shared_ptr stanza) { + std::map, std::string>::iterator unackedStanza = unackedStanzas_.find(stanza); if (unackedStanza != unackedStanzas_.end()) { chatWindow_->setAckState(unackedStanza->second, ChatWindow::Received); unackedStanzas_.erase(unackedStanza); @@ -345,7 +346,7 @@ void ChatController::handleStanzaAcked(boost::shared_ptr stanza) { void ChatController::setOnline(bool online) { if (!online) { - std::map, std::string>::iterator it = unackedStanzas_.begin(); + std::map, std::string>::iterator it = unackedStanzas_.begin(); for ( ; it != unackedStanzas_.end(); ++it) { chatWindow_->setAckState(it->second, ChatWindow::Failed); } @@ -403,19 +404,19 @@ void ChatController::handleFileTransferAccept(std::string id, std::string filena void ChatController::handleSendFileRequest(std::string filename) { SWIFT_LOG(debug) << "ChatController::handleSendFileRequest(" << filename << ")" << std::endl; - eventStream_->send(boost::make_shared(getToJID(), filename)); + eventStream_->send(std::make_shared(getToJID(), filename)); } void ChatController::handleWhiteboardSessionAccept() { - eventStream_->send(boost::make_shared(toJID_)); + eventStream_->send(std::make_shared(toJID_)); } void ChatController::handleWhiteboardSessionCancel() { - eventStream_->send(boost::make_shared(toJID_)); + eventStream_->send(std::make_shared(toJID_)); } void ChatController::handleWhiteboardWindowShow() { - eventStream_->send(boost::make_shared(toJID_)); + eventStream_->send(std::make_shared(toJID_)); } std::string ChatController::senderHighlightNameFromMessage(const JID& from) { @@ -431,7 +432,7 @@ std::string ChatController::senderDisplayNameFromMessage(const JID& from) { return nickResolver_->jidToNick(from); } -std::string ChatController::getStatusChangeString(boost::shared_ptr presence) { +std::string ChatController::getStatusChangeString(std::shared_ptr presence) { std::string nick = senderDisplayNameFromMessage(presence->getFrom()); std::string response; if (!presence || presence->getType() == Presence::Unavailable || presence->getType() == Presence::Error) { @@ -461,7 +462,7 @@ std::string ChatController::getStatusChangeString(boost::shared_ptr pr return response + "."; } -void ChatController::handlePresenceChange(boost::shared_ptr newPresence) { +void ChatController::handlePresenceChange(std::shared_ptr newPresence) { bool relevantPresence = false; if (isInMUC_) { @@ -487,7 +488,7 @@ void ChatController::handlePresenceChange(boost::shared_ptr newPresenc } if (!newPresence) { - newPresence = boost::make_shared(); + newPresence = std::make_shared(); newPresence->setType(Presence::Unavailable); } lastShownStatus_ = newPresence->getShow(); @@ -506,7 +507,7 @@ void ChatController::handlePresenceChange(boost::shared_ptr newPresenc } } -boost::optional ChatController::getMessageTimestamp(boost::shared_ptr message) const { +boost::optional ChatController::getMessageTimestamp(std::shared_ptr message) const { return message->getTimestamp(); } diff --git a/Swift/Controllers/Chat/ChatController.h b/Swift/Controllers/Chat/ChatController.h index aa2b203..d5553bc 100644 --- a/Swift/Controllers/Chat/ChatController.h +++ b/Swift/Controllers/Chat/ChatController.h @@ -30,10 +30,10 @@ namespace Swift { class ChatController : public ChatControllerBase { public: - ChatController(const JID& self, StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, const JID &contact, NickResolver* nickResolver, PresenceOracle* presenceOracle, AvatarManager* avatarManager, bool isInMUC, bool useDelayForLatency, UIEventStream* eventStream, EventController* eventController, TimerFactory* timerFactory, EntityCapsProvider* entityCapsProvider, bool userWantsReceipts, SettingsProvider* settings, HistoryController* historyController, MUCRegistry* mucRegistry, HighlightManager* highlightManager, ClientBlockListManager* clientBlockListManager, boost::shared_ptr chatMessageParser, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider); + ChatController(const JID& self, StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, const JID &contact, NickResolver* nickResolver, PresenceOracle* presenceOracle, AvatarManager* avatarManager, bool isInMUC, bool useDelayForLatency, UIEventStream* eventStream, EventController* eventController, TimerFactory* timerFactory, EntityCapsProvider* entityCapsProvider, bool userWantsReceipts, SettingsProvider* settings, HistoryController* historyController, MUCRegistry* mucRegistry, HighlightManager* highlightManager, ClientBlockListManager* clientBlockListManager, std::shared_ptr chatMessageParser, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider); virtual ~ChatController(); virtual void setToJID(const JID& jid) SWIFTEN_OVERRIDE; - virtual void setAvailableServerFeatures(boost::shared_ptr info) SWIFTEN_OVERRIDE; + virtual void setAvailableServerFeatures(std::shared_ptr info) SWIFTEN_OVERRIDE; virtual void setOnline(bool online) SWIFTEN_OVERRIDE; virtual void handleNewFileTransferController(FileTransferController* ftc); virtual void handleWhiteboardSessionRequest(bool senderIsSelf); @@ -47,17 +47,17 @@ namespace Swift { virtual void logMessage(const std::string& message, const JID& fromJID, const JID& toJID, const boost::posix_time::ptime& timeStamp, bool isIncoming) SWIFTEN_OVERRIDE; private: - void handlePresenceChange(boost::shared_ptr newPresence); - std::string getStatusChangeString(boost::shared_ptr presence); - virtual bool isIncomingMessageFromMe(boost::shared_ptr message) SWIFTEN_OVERRIDE; - virtual void postSendMessage(const std::string &body, boost::shared_ptr sentStanza) SWIFTEN_OVERRIDE; - virtual void preHandleIncomingMessage(boost::shared_ptr messageEvent) SWIFTEN_OVERRIDE; - virtual void postHandleIncomingMessage(boost::shared_ptr messageEvent, const ChatWindow::ChatMessage& chatMessage) SWIFTEN_OVERRIDE; - virtual void preSendMessageRequest(boost::shared_ptr) SWIFTEN_OVERRIDE; + void handlePresenceChange(std::shared_ptr newPresence); + std::string getStatusChangeString(std::shared_ptr presence); + virtual bool isIncomingMessageFromMe(std::shared_ptr message) SWIFTEN_OVERRIDE; + virtual void postSendMessage(const std::string &body, std::shared_ptr sentStanza) SWIFTEN_OVERRIDE; + virtual void preHandleIncomingMessage(std::shared_ptr messageEvent) SWIFTEN_OVERRIDE; + virtual void postHandleIncomingMessage(std::shared_ptr messageEvent, const ChatWindow::ChatMessage& chatMessage) SWIFTEN_OVERRIDE; + virtual void preSendMessageRequest(std::shared_ptr) SWIFTEN_OVERRIDE; virtual std::string senderHighlightNameFromMessage(const JID& from) SWIFTEN_OVERRIDE; virtual std::string senderDisplayNameFromMessage(const JID& from) SWIFTEN_OVERRIDE; - virtual boost::optional getMessageTimestamp(boost::shared_ptr) const SWIFTEN_OVERRIDE; - void handleStanzaAcked(boost::shared_ptr stanza); + virtual boost::optional getMessageTimestamp(std::shared_ptr) const SWIFTEN_OVERRIDE; + void handleStanzaAcked(std::shared_ptr stanza); virtual void dayTicked() SWIFTEN_OVERRIDE { lastWasPresence_ = false; } void handleContactNickChanged(const JID& jid, const std::string& /*oldNick*/); virtual void handleBareJIDCapsChanged(const JID& jid) SWIFTEN_OVERRIDE; @@ -82,7 +82,7 @@ namespace Swift { void handleWindowClosed(); - void handleUIEvent(boost::shared_ptr event); + void handleUIEvent(std::shared_ptr event); private: NickResolver* nickResolver_; @@ -92,7 +92,7 @@ namespace Swift { bool isInMUC_; bool lastWasPresence_; std::string lastStatusChangeString_; - std::map, std::string> unackedStanzas_; + std::map, std::string> unackedStanzas_; std::map requestedReceipts_; StatusShow::Type lastShownStatus_; UIEventStream* eventStream_; diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp index 7a3db1e..5b0bbd9 100644 --- a/Swift/Controllers/Chat/ChatControllerBase.cpp +++ b/Swift/Controllers/Chat/ChatControllerBase.cpp @@ -7,14 +7,13 @@ #include #include +#include #include #include #include #include #include -#include -#include #include #include @@ -42,7 +41,7 @@ namespace Swift { -ChatControllerBase::ChatControllerBase(const JID& self, StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, const JID &toJID, PresenceOracle* presenceOracle, AvatarManager* avatarManager, bool useDelayForLatency, UIEventStream* eventStream, EventController* eventController, TimerFactory* timerFactory, EntityCapsProvider* entityCapsProvider, HistoryController* historyController, MUCRegistry* mucRegistry, HighlightManager* highlightManager, boost::shared_ptr chatMessageParser, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider) : selfJID_(self), stanzaChannel_(stanzaChannel), iqRouter_(iqRouter), chatWindowFactory_(chatWindowFactory), toJID_(toJID), labelsEnabled_(false), presenceOracle_(presenceOracle), avatarManager_(avatarManager), useDelayForLatency_(useDelayForLatency), eventController_(eventController), timerFactory_(timerFactory), entityCapsProvider_(entityCapsProvider), historyController_(historyController), mucRegistry_(mucRegistry), chatMessageParser_(chatMessageParser), autoAcceptMUCInviteDecider_(autoAcceptMUCInviteDecider), eventStream_(eventStream) { +ChatControllerBase::ChatControllerBase(const JID& self, StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, const JID &toJID, PresenceOracle* presenceOracle, AvatarManager* avatarManager, bool useDelayForLatency, UIEventStream* eventStream, EventController* eventController, TimerFactory* timerFactory, EntityCapsProvider* entityCapsProvider, HistoryController* historyController, MUCRegistry* mucRegistry, HighlightManager* highlightManager, std::shared_ptr chatMessageParser, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider) : selfJID_(self), stanzaChannel_(stanzaChannel), iqRouter_(iqRouter), chatWindowFactory_(chatWindowFactory), toJID_(toJID), labelsEnabled_(false), presenceOracle_(presenceOracle), avatarManager_(avatarManager), useDelayForLatency_(useDelayForLatency), eventController_(eventController), timerFactory_(timerFactory), entityCapsProvider_(entityCapsProvider), historyController_(historyController), mucRegistry_(mucRegistry), chatMessageParser_(chatMessageParser), autoAcceptMUCInviteDecider_(autoAcceptMUCInviteDecider), eventStream_(eventStream) { chatWindow_ = chatWindowFactory_->createChatWindow(toJID, eventStream); chatWindow_->onAllMessagesRead.connect(boost::bind(&ChatControllerBase::handleAllMessagesRead, this)); chatWindow_->onSendMessageRequest.connect(boost::bind(&ChatControllerBase::handleSendMessageRequest, this, _1, _2)); @@ -117,7 +116,7 @@ JID ChatControllerBase::getBaseJID() { return JID(toJID_.toBare()); } -void ChatControllerBase::setAvailableServerFeatures(boost::shared_ptr info) { +void ChatControllerBase::setAvailableServerFeatures(std::shared_ptr info) { if (iqRouter_->isAvailable() && info->hasFeature(DiscoInfo::SecurityLabelsCatalogFeature)) { GetSecurityLabelsCatalogRequest::ref request = GetSecurityLabelsCatalogRequest::create(getBaseJID(), iqRouter_); request->onResponse.connect(boost::bind(&ChatControllerBase::handleSecurityLabelsCatalogResponse, this, _1, _2)); @@ -131,7 +130,7 @@ void ChatControllerBase::setAvailableServerFeatures(boost::shared_ptr void ChatControllerBase::handleAllMessagesRead() { if (!unreadMessages_.empty()) { targetedUnreadMessages_.clear(); - foreach (boost::shared_ptr stanzaEvent, unreadMessages_) { + foreach (std::shared_ptr stanzaEvent, unreadMessages_) { stanzaEvent->conclude(); } unreadMessages_.clear(); @@ -148,7 +147,7 @@ void ChatControllerBase::handleSendMessageRequest(const std::string &body, bool if (!stanzaChannel_->isAvailable() || body.empty()) { return; } - boost::shared_ptr message(new Message()); + std::shared_ptr message(new Message()); message->setTo(toJID_); message->setType(Swift::Message::Chat); message->setBody(body); @@ -165,14 +164,14 @@ void ChatControllerBase::handleSendMessageRequest(const std::string &body, bool boost::posix_time::ptime now = boost::posix_time::microsec_clock::universal_time(); if (useDelayForLatency_) { - message->addPayload(boost::make_shared(now, selfJID_)); + message->addPayload(std::make_shared(now, selfJID_)); } if (isCorrectionMessage) { - message->addPayload(boost::shared_ptr (new Replace(lastSentMessageStanzaID_))); + message->addPayload(std::shared_ptr (new Replace(lastSentMessageStanzaID_))); } message->setID(lastSentMessageStanzaID_ = idGenerator_.generateID()); stanzaChannel_->sendMessage(message); - postSendMessage(message->getBody().get(), boost::dynamic_pointer_cast(message)); + postSendMessage(message->getBody().get(), std::dynamic_pointer_cast(message)); onActivity(message->getBody().get()); #ifdef SWIFT_EXPERIMENTAL_HISTORY @@ -180,7 +179,7 @@ void ChatControllerBase::handleSendMessageRequest(const std::string &body, bool #endif } -void ChatControllerBase::handleSecurityLabelsCatalogResponse(boost::shared_ptr catalog, ErrorPayload::ref error) { +void ChatControllerBase::handleSecurityLabelsCatalogResponse(std::shared_ptr catalog, ErrorPayload::ref error) { if (catalog && !error) { if (catalog->getItems().size() == 0) { chatWindow_->setSecurityLabelsEnabled(false); @@ -226,8 +225,8 @@ void ChatControllerBase::handleHighlightActions(const ChatWindow::ChatMessage& c highlighter_->handleHighlightAction(chatMessage.getFullMessageHighlightAction()); playedSounds.insert(chatMessage.getFullMessageHighlightAction().getSoundFile()); } - foreach(boost::shared_ptr part, chatMessage.getParts()) { - boost::shared_ptr highlightMessage = boost::dynamic_pointer_cast(part); + foreach(std::shared_ptr part, chatMessage.getParts()) { + std::shared_ptr highlightMessage = std::dynamic_pointer_cast(part); if (highlightMessage && highlightMessage->action.playSound()) { if (playedSounds.find(highlightMessage->action.getSoundFile()) == playedSounds.end()) { highlighter_->handleHighlightAction(highlightMessage->action); @@ -237,7 +236,7 @@ void ChatControllerBase::handleHighlightActions(const ChatWindow::ChatMessage& c } } -std::string ChatControllerBase::addMessage(const ChatWindow::ChatMessage& chatMessage, const std::string& senderName, bool senderIsSelf, const boost::shared_ptr label, const boost::filesystem::path& avatarPath, const boost::posix_time::ptime& time) { +std::string ChatControllerBase::addMessage(const ChatWindow::ChatMessage& chatMessage, const std::string& senderName, bool senderIsSelf, const std::shared_ptr label, const boost::filesystem::path& avatarPath, const boost::posix_time::ptime& time) { if (chatMessage.isMeCommand()) { return chatWindow_->addAction(chatMessage, senderName, senderIsSelf, label, pathToString(avatarPath), time); } @@ -259,7 +258,7 @@ bool ChatControllerBase::isFromContact(const JID& from) { return from.toBare() == toJID_.toBare(); } -void ChatControllerBase::handleIncomingMessage(boost::shared_ptr messageEvent) { +void ChatControllerBase::handleIncomingMessage(std::shared_ptr messageEvent) { preHandleIncomingMessage(messageEvent); if (messageEvent->isReadable() && !messageEvent->getConcluded()) { unreadMessages_.push_back(messageEvent); @@ -268,7 +267,7 @@ void ChatControllerBase::handleIncomingMessage(boost::shared_ptr m } } - boost::shared_ptr message = messageEvent->getStanza(); + std::shared_ptr message = messageEvent->getStanza(); ChatWindow::ChatMessage chatMessage; boost::optional optionalBody = message->getBody(); std::string body = optionalBody.get_value_or(""); @@ -292,7 +291,7 @@ void ChatControllerBase::handleIncomingMessage(boost::shared_ptr m } showChatWindow(); JID from = message->getFrom(); - std::vector > delayPayloads = message->getPayloads(); + std::vector > delayPayloads = message->getPayloads(); for (size_t i = 0; useDelayForLatency_ && i < delayPayloads.size(); i++) { if (!delayPayloads[i]->getFrom()) { continue; @@ -302,7 +301,7 @@ void ChatControllerBase::handleIncomingMessage(boost::shared_ptr m s << "The following message took " << (now - delayPayloads[i]->getStamp()).total_milliseconds() / 1000.0 << " seconds to be delivered from " << delayPayloads[i]->getFrom()->toString() << "."; chatWindow_->addSystemMessage(chatMessageParser_->parseMessageBody(std::string(s.str())), ChatWindow::DefaultDirection); } - boost::shared_ptr label = message->getPayload(); + std::shared_ptr label = message->getPayload(); // Determine the timestamp boost::posix_time::ptime timeStamp = boost::posix_time::microsec_clock::universal_time(); @@ -318,7 +317,7 @@ void ChatControllerBase::handleIncomingMessage(boost::shared_ptr m fullMessageHighlight = highlighter_->findFirstFullMessageMatchAction(body, senderHighlightNameFromMessage(from)); } - boost::shared_ptr replace = message->getPayload(); + std::shared_ptr replace = message->getPayload(); bool senderIsSelf = isIncomingMessageFromMe(message); if (replace) { // Should check if the user has a previous message @@ -342,11 +341,11 @@ void ChatControllerBase::handleIncomingMessage(boost::shared_ptr m postHandleIncomingMessage(messageEvent, chatMessage); } -void ChatControllerBase::addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, boost::shared_ptr label, const boost::posix_time::ptime& timeStamp) { +void ChatControllerBase::addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, std::shared_ptr label, const boost::posix_time::ptime& timeStamp) { lastMessagesUIID_[from] = addMessage(message, senderDisplayNameFromMessage(from), senderIsSelf, label, avatarManager_->getAvatarPath(from), timeStamp); } -std::string ChatControllerBase::getErrorMessage(boost::shared_ptr error) { +std::string ChatControllerBase::getErrorMessage(std::shared_ptr error) { std::string defaultMessage = QT_TRANSLATE_NOOP("", "Error sending message"); if (!error->getText().empty()) { return error->getText(); @@ -394,9 +393,9 @@ void ChatControllerBase::handleMUCInvitation(Message::ref message) { MUCInvitationPayload::ref invite = message->getPayload(); if (autoAcceptMUCInviteDecider_->isAutoAcceptedInvite(message->getFrom(), invite)) { - eventStream_->send(boost::make_shared(invite->getJID(), boost::optional(), boost::optional(), false, false, true)); + eventStream_->send(std::make_shared(invite->getJID(), boost::optional(), boost::optional(), false, false, true)); } else { - MUCInviteEvent::ref inviteEvent = boost::make_shared(toJID_, invite->getJID(), invite->getReason(), invite->getPassword(), true, invite->getIsImpromptu()); + MUCInviteEvent::ref inviteEvent = std::make_shared(toJID_, invite->getJID(), invite->getReason(), invite->getPassword(), true, invite->getIsImpromptu()); handleGeneralMUCInvitation(inviteEvent); } } @@ -413,7 +412,7 @@ void ChatControllerBase::handleMediatedMUCInvitation(Message::ref message) { password = *message->getPayload()->getPassword(); } - MUCInviteEvent::ref inviteEvent = boost::make_shared(invite.from, from, reason, password, false, false); + MUCInviteEvent::ref inviteEvent = std::make_shared(invite.from, from, reason, password, false, false); handleGeneralMUCInvitation(inviteEvent); } diff --git a/Swift/Controllers/Chat/ChatControllerBase.h b/Swift/Controllers/Chat/ChatControllerBase.h index bd8ba0f..2bdfe93 100644 --- a/Swift/Controllers/Chat/ChatControllerBase.h +++ b/Swift/Controllers/Chat/ChatControllerBase.h @@ -7,13 +7,13 @@ #pragma once #include +#include #include #include #include #include #include -#include #include #include @@ -53,9 +53,9 @@ namespace Swift { void showChatWindow(); void activateChatWindow(); bool hasOpenWindow() const; - virtual void setAvailableServerFeatures(boost::shared_ptr info); - void handleIncomingMessage(boost::shared_ptr message); - std::string addMessage(const ChatWindow::ChatMessage& chatMessage, const std::string& senderName, bool senderIsSelf, boost::shared_ptr label, const boost::filesystem::path& avatarPath, const boost::posix_time::ptime& time); + virtual void setAvailableServerFeatures(std::shared_ptr info); + void handleIncomingMessage(std::shared_ptr message); + std::string addMessage(const ChatWindow::ChatMessage& chatMessage, const std::string& senderName, bool senderIsSelf, std::shared_ptr label, const boost::filesystem::path& avatarPath, const boost::posix_time::ptime& time); void replaceMessage(const ChatWindow::ChatMessage& chatMessage, const std::string& id, const boost::posix_time::ptime& time); virtual void setOnline(bool online); void setEnabled(bool enabled); @@ -72,24 +72,24 @@ namespace Swift { boost::signal& /*invite people*/, const std::string& /*reason*/)> onConvertToMUC; protected: - ChatControllerBase(const JID& self, StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, const JID &toJID, PresenceOracle* presenceOracle, AvatarManager* avatarManager, bool useDelayForLatency, UIEventStream* eventStream, EventController* eventController, TimerFactory* timerFactory, EntityCapsProvider* entityCapsProvider, HistoryController* historyController, MUCRegistry* mucRegistry, HighlightManager* highlightManager, boost::shared_ptr chatMessageParser, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider); + ChatControllerBase(const JID& self, StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, const JID &toJID, PresenceOracle* presenceOracle, AvatarManager* avatarManager, bool useDelayForLatency, UIEventStream* eventStream, EventController* eventController, TimerFactory* timerFactory, EntityCapsProvider* entityCapsProvider, HistoryController* historyController, MUCRegistry* mucRegistry, HighlightManager* highlightManager, std::shared_ptr chatMessageParser, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider); /** * Pass the Message appended, and the stanza used to send it. */ - virtual void postSendMessage(const std::string&, boost::shared_ptr) {} + virtual void postSendMessage(const std::string&, std::shared_ptr) {} virtual std::string senderDisplayNameFromMessage(const JID& from) = 0; virtual std::string senderHighlightNameFromMessage(const JID& from) = 0; - virtual bool isIncomingMessageFromMe(boost::shared_ptr) = 0; - virtual void preHandleIncomingMessage(boost::shared_ptr) {} - virtual void addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, boost::shared_ptr label, const boost::posix_time::ptime& time); - virtual void postHandleIncomingMessage(boost::shared_ptr, const ChatWindow::ChatMessage&) {} - virtual void preSendMessageRequest(boost::shared_ptr) {} + virtual bool isIncomingMessageFromMe(std::shared_ptr) = 0; + virtual void preHandleIncomingMessage(std::shared_ptr) {} + virtual void addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, std::shared_ptr label, const boost::posix_time::ptime& time); + virtual void postHandleIncomingMessage(std::shared_ptr, const ChatWindow::ChatMessage&) {} + virtual void preSendMessageRequest(std::shared_ptr) {} virtual bool isFromContact(const JID& from); - virtual boost::optional getMessageTimestamp(boost::shared_ptr) const = 0; + virtual boost::optional getMessageTimestamp(std::shared_ptr) const = 0; virtual void dayTicked() {} virtual void handleBareJIDCapsChanged(const JID& jid) = 0; - std::string getErrorMessage(boost::shared_ptr); + std::string getErrorMessage(std::shared_ptr); virtual void setContactIsReceivingPresence(bool /* isReceivingPresence */) {} virtual void cancelReplaces() = 0; /** JID any iq for account should go to - bare except for PMs */ @@ -105,7 +105,7 @@ namespace Swift { void handleSendMessageRequest(const std::string &body, bool isCorrectionMessage); void handleAllMessagesRead(); - void handleSecurityLabelsCatalogResponse(boost::shared_ptr, ErrorPayload::ref error); + void handleSecurityLabelsCatalogResponse(std::shared_ptr, ErrorPayload::ref error); void handleDayChangeTick(); void handleMUCInvitation(Message::ref message); void handleMediatedMUCInvitation(Message::ref message); @@ -114,8 +114,8 @@ namespace Swift { protected: JID selfJID_; - std::vector > unreadMessages_; - std::vector > targetedUnreadMessages_; + std::vector > unreadMessages_; + std::vector > targetedUnreadMessages_; StanzaChannel* stanzaChannel_; IQRouter* iqRouter_; ChatWindowFactory* chatWindowFactory_; @@ -127,14 +127,14 @@ namespace Swift { AvatarManager* avatarManager_; bool useDelayForLatency_; EventController* eventController_; - boost::shared_ptr dateChangeTimer_; + std::shared_ptr dateChangeTimer_; TimerFactory* timerFactory_; EntityCapsProvider* entityCapsProvider_; SecurityLabelsCatalog::Item lastLabel_; HistoryController* historyController_; MUCRegistry* mucRegistry_; Highlighter* highlighter_; - boost::shared_ptr chatMessageParser_; + std::shared_ptr chatMessageParser_; AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider_; UIEventStream* eventStream_; }; diff --git a/Swift/Controllers/Chat/ChatMessageParser.cpp b/Swift/Controllers/Chat/ChatMessageParser.cpp index 08e4fcd..c204371 100644 --- a/Swift/Controllers/Chat/ChatMessageParser.cpp +++ b/Swift/Controllers/Chat/ChatMessageParser.cpp @@ -6,11 +6,11 @@ #include +#include #include #include #include -#include #include #include @@ -42,10 +42,10 @@ namespace Swift { else { if (i == links.second) { found = true; - parsedMessage.append(boost::make_shared(part)); + parsedMessage.append(std::make_shared(part)); } else { - parsedMessage.append(boost::make_shared(part)); + parsedMessage.append(std::make_shared(part)); } } } @@ -85,9 +85,9 @@ namespace Swift { boost::regex emoticonRegex(regexString); ChatWindow::ChatMessage newMessage; - foreach (boost::shared_ptr part, parsedMessage.getParts()) { - boost::shared_ptr textPart; - if ((textPart = boost::dynamic_pointer_cast(part))) { + foreach (std::shared_ptr part, parsedMessage.getParts()) { + std::shared_ptr textPart; + if ((textPart = std::dynamic_pointer_cast(part))) { try { boost::match_results match; const std::string& text = textPart->text; @@ -104,9 +104,9 @@ namespace Swift { std::string::const_iterator matchEnd = match[matchIndex].second; if (start != matchStart) { /* If we're skipping over plain text since the previous emoticon, record it as plain text */ - newMessage.append(boost::make_shared(std::string(start, matchStart))); + newMessage.append(std::make_shared(std::string(start, matchStart))); } - boost::shared_ptr emoticonPart = boost::make_shared(); + std::shared_ptr emoticonPart = std::make_shared(); std::string matchString = match[matchIndex].str(); std::map::const_iterator emoticonIterator = emoticons_.find(matchString); assert (emoticonIterator != emoticons_.end()); @@ -118,7 +118,7 @@ namespace Swift { } if (start != text.end()) { /* If there's plain text after the last emoticon, record it */ - newMessage.append(boost::make_shared(std::string(start, text.end()))); + newMessage.append(std::make_shared(std::string(start, text.end()))); } } @@ -153,9 +153,9 @@ namespace Swift { const std::vector keywordRegex = rule.getKeywordRegex(nick); foreach(const boost::regex& regex, keywordRegex) { ChatWindow::ChatMessage newMessage; - foreach (boost::shared_ptr part, parsedMessage.getParts()) { - boost::shared_ptr textPart; - if ((textPart = boost::dynamic_pointer_cast(part))) { + foreach (std::shared_ptr part, parsedMessage.getParts()) { + std::shared_ptr textPart; + if ((textPart = std::dynamic_pointer_cast(part))) { try { boost::match_results match; const std::string& text = textPart->text; @@ -165,9 +165,9 @@ namespace Swift { std::string::const_iterator matchEnd = match[0].second; if (start != matchStart) { /* If we're skipping over plain text since the previous emoticon, record it as plain text */ - newMessage.append(boost::make_shared(std::string(start, matchStart))); + newMessage.append(std::make_shared(std::string(start, matchStart))); } - boost::shared_ptr highlightPart = boost::make_shared(); + std::shared_ptr highlightPart = std::make_shared(); highlightPart->text = match.str(); highlightPart->action = rule.getAction(); newMessage.append(highlightPart); @@ -175,7 +175,7 @@ namespace Swift { } if (start != text.end()) { /* If there's plain text after the last emoticon, record it */ - newMessage.append(boost::make_shared(std::string(start, text.end()))); + newMessage.append(std::make_shared(std::string(start, text.end()))); } } catch (std::runtime_error) { diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index 7a52d9b..ffca925 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -6,6 +6,8 @@ #include +#include + #include #include #include @@ -15,7 +17,6 @@ #include #include #include -#include #include #include @@ -155,7 +156,7 @@ ChatsManager::ChatsManager( nickResolver_ = nickResolver; presenceOracle_ = presenceOracle; avatarManager_ = nullptr; - serverDiscoInfo_ = boost::make_shared(); + serverDiscoInfo_ = std::make_shared(); presenceSender_ = presenceSender; uiEventStream_ = uiEventStream; mucBookmarkManager_ = nullptr; @@ -544,24 +545,24 @@ void ChatsManager::finalizeImpromptuJoin(MUC::ref muc, const std::vector& j } } -void ChatsManager::handleUIEvent(boost::shared_ptr event) { - boost::shared_ptr chatEvent = boost::dynamic_pointer_cast(event); +void ChatsManager::handleUIEvent(std::shared_ptr event) { + std::shared_ptr chatEvent = std::dynamic_pointer_cast(event); if (chatEvent) { handleChatRequest(chatEvent->getContact()); return; } - boost::shared_ptr removeMUCBookmarkEvent = boost::dynamic_pointer_cast(event); + std::shared_ptr removeMUCBookmarkEvent = std::dynamic_pointer_cast(event); if (removeMUCBookmarkEvent) { mucBookmarkManager_->removeBookmark(removeMUCBookmarkEvent->getBookmark()); return; } - boost::shared_ptr addMUCBookmarkEvent = boost::dynamic_pointer_cast(event); + std::shared_ptr addMUCBookmarkEvent = std::dynamic_pointer_cast(event); if (addMUCBookmarkEvent) { mucBookmarkManager_->addBookmark(addMUCBookmarkEvent->getBookmark()); return; } - boost::shared_ptr createImpromptuMUCEvent = boost::dynamic_pointer_cast(event); + std::shared_ptr createImpromptuMUCEvent = std::dynamic_pointer_cast(event); if (createImpromptuMUCEvent) { assert(!localMUCServiceJID_.toString().empty()); // create new muc @@ -573,15 +574,15 @@ void ChatsManager::handleUIEvent(boost::shared_ptr event) { mucControllers_[roomJID]->activateChatWindow(); } - boost::shared_ptr editMUCBookmarkEvent = boost::dynamic_pointer_cast(event); + std::shared_ptr editMUCBookmarkEvent = std::dynamic_pointer_cast(event); if (editMUCBookmarkEvent) { mucBookmarkManager_->replaceBookmark(editMUCBookmarkEvent->getOldBookmark(), editMUCBookmarkEvent->getNewBookmark()); } - else if (JoinMUCUIEvent::ref joinEvent = boost::dynamic_pointer_cast(event)) { + else if (JoinMUCUIEvent::ref joinEvent = std::dynamic_pointer_cast(event)) { handleJoinMUCRequest(joinEvent->getJID(), joinEvent->getPassword(), joinEvent->getNick(), joinEvent->getShouldJoinAutomatically(), joinEvent->getCreateAsReservedRoomIfNew(), joinEvent->isImpromptu()); mucControllers_[joinEvent->getJID()]->activateChatWindow(); } - else if (boost::shared_ptr joinEvent = boost::dynamic_pointer_cast(event)) { + else if (std::shared_ptr joinEvent = std::dynamic_pointer_cast(event)) { if (!joinMUCWindow_) { joinMUCWindow_ = joinMUCWindowFactory_->createJoinMUCWindow(uiEventStream_); joinMUCWindow_->onSearchMUC.connect(boost::bind(&ChatsManager::handleSearchMUCRequest, this)); @@ -619,7 +620,7 @@ void ChatsManager::handleTransformChatToMUC(ChatController* chatController, Chat /** * If a resource goes offline, release bound chatdialog to that resource. */ -void ChatsManager::handlePresenceChange(boost::shared_ptr newPresence) { +void ChatsManager::handlePresenceChange(std::shared_ptr newPresence) { if (mucRegistry_->isMUC(newPresence->getFrom().toBare())) return; foreach (ChatListWindow::Chat& chat, recentChats_) { @@ -663,7 +664,7 @@ void ChatsManager::handleAvatarChanged(const JID& jid) { } } -void ChatsManager::setServerDiscoInfo(boost::shared_ptr info) { +void ChatsManager::setServerDiscoInfo(std::shared_ptr info) { serverDiscoInfo_ = info; foreach (JIDChatControllerPair pair, chatControllers_) { pair.second->setAvailableServerFeatures(info); @@ -691,7 +692,7 @@ void ChatsManager::setOnline(bool enabled) { } else { setupBookmarks(); localMUCServiceJID_ = JID(); - localMUCServiceFinderWalker_ = boost::make_shared(jid_.getDomain(), iqRouter_); + localMUCServiceFinderWalker_ = std::make_shared(jid_.getDomain(), iqRouter_); localMUCServiceFinderWalker_->onServiceFound.connect(boost::bind(&ChatsManager::handleLocalServiceFound, this, _1, _2)); localMUCServiceFinderWalker_->onWalkAborted.connect(boost::bind(&ChatsManager::handleLocalServiceWalkFinished, this)); localMUCServiceFinderWalker_->onWalkComplete.connect(boost::bind(&ChatsManager::handleLocalServiceWalkFinished, this)); @@ -723,7 +724,7 @@ ChatController* ChatsManager::getChatControllerOrFindAnother(const JID &contact) ChatController* ChatsManager::createNewChatController(const JID& contact) { assert(chatControllers_.find(contact) == chatControllers_.end()); - boost::shared_ptr chatMessageParser = boost::make_shared(emoticons_, highlightManager_->getRules(), false); /* a message parser that knows this is a chat (not a room/MUC) */ + std::shared_ptr chatMessageParser = std::make_shared(emoticons_, highlightManager_->getRules(), false); /* a message parser that knows this is a chat (not a room/MUC) */ ChatController* controller = new ChatController(jid_, stanzaChannel_, iqRouter_, chatWindowFactory_, contact, nickResolver_, presenceOracle_, avatarManager_, mucRegistry_->isMUC(contact.toBare()), useDelayForLatency_, uiEventStream_, eventController_, timerFactory_, entityCapsProvider_, userWantsReceipts_, settings_, historyController_, mucRegistry_, highlightManager_, clientBlockListManager_, chatMessageParser, autoAcceptMUCInviteDecider_); chatControllers_[contact] = controller; controller->setAvailableServerFeatures(serverDiscoInfo_); @@ -812,7 +813,7 @@ MUC::ref ChatsManager::handleJoinMUCRequest(const JID &mucJID, const boost::opti if (reuseChatwindow) { chatWindowFactoryAdapter = new SingleChatWindowFactoryAdapter(reuseChatwindow); } - boost::shared_ptr chatMessageParser = boost::make_shared(emoticons_, highlightManager_->getRules(), true); /* a message parser that knows this is a room/MUC (not a chat) */ + std::shared_ptr chatMessageParser = std::make_shared(emoticons_, highlightManager_->getRules(), true); /* a message parser that knows this is a room/MUC (not a chat) */ controller = new MUCController(jid_, muc, password, nick, stanzaChannel_, iqRouter_, reuseChatwindow ? chatWindowFactoryAdapter : chatWindowFactory_, presenceOracle_, avatarManager_, uiEventStream_, false, timerFactory_, eventController_, entityCapsProvider_, roster_, historyController_, mucRegistry_, highlightManager_, clientBlockListManager_, chatMessageParser, isImpromptu, autoAcceptMUCInviteDecider_, vcardManager_, mucBookmarkManager_); if (chatWindowFactoryAdapter) { /* The adapters are only passed to chat windows, which are deleted in their @@ -866,9 +867,9 @@ void ChatsManager::handleUserNicknameChanged(MUCController* mucController, const } } -void ChatsManager::handleIncomingMessage(boost::shared_ptr message) { +void ChatsManager::handleIncomingMessage(std::shared_ptr message) { JID jid = message->getFrom(); - boost::shared_ptr event(new MessageEvent(message)); + std::shared_ptr event(new MessageEvent(message)); bool isInvite = !!message->getPayload(); bool isMediatedInvite = (message->getPayload() && message->getPayload()->getInvite()); if (isMediatedInvite) { @@ -937,7 +938,7 @@ void ChatsManager::handleMUCSelectedAfterSearch(const JID& muc) { } void ChatsManager::handleMUCBookmarkActivated(const MUCBookmark& mucBookmark) { - uiEventStream_->send(boost::make_shared(mucBookmark.getRoom(), mucBookmark.getPassword(), mucBookmark.getNick())); + uiEventStream_->send(std::make_shared(mucBookmark.getRoom(), mucBookmark.getPassword(), mucBookmark.getNick())); } void ChatsManager::handleNewFileTransferController(FileTransferController* ftc) { @@ -945,7 +946,7 @@ void ChatsManager::handleNewFileTransferController(FileTransferController* ftc) chatController->handleNewFileTransferController(ftc); chatController->activateChatWindow(); if (ftc->isIncoming()) { - eventController_->handleIncomingEvent(boost::make_shared(ftc->getOtherParty())); + eventController_->handleIncomingEvent(std::make_shared(ftc->getOtherParty())); } } @@ -979,18 +980,18 @@ void ChatsManager::handleRecentActivated(const ChatListWindow::Chat& chat) { foreach(StringJIDPair pair, chat.impromptuJIDs) { inviteJIDs.push_back(pair.second); } - uiEventStream_->send(boost::make_shared(inviteJIDs, chat.jid, "")); + uiEventStream_->send(std::make_shared(inviteJIDs, chat.jid, "")); } else if (chat.isMUC) { /* FIXME: This means that recents requiring passwords will just flat-out not work */ - uiEventStream_->send(boost::make_shared(chat.jid, boost::optional(), chat.nick)); + uiEventStream_->send(std::make_shared(chat.jid, boost::optional(), chat.nick)); } else { - uiEventStream_->send(boost::make_shared(chat.jid)); + uiEventStream_->send(std::make_shared(chat.jid)); } } -void ChatsManager::handleLocalServiceFound(const JID& service, boost::shared_ptr info) { +void ChatsManager::handleLocalServiceFound(const JID& service, std::shared_ptr info) { foreach (DiscoInfo::Identity identity, info->getIdentities()) { if ((identity.getCategory() == "directory" && identity.getType() == "chatroom") @@ -1023,7 +1024,7 @@ std::vector Swift::ChatsManager::getContacts(bool withMUCNicks) { std::vector result; foreach (ChatListWindow::Chat chat, recentChats_) { if (!chat.isMUC) { - result.push_back(boost::make_shared(chat.chatName.empty() ? chat.jid.toString() : chat.chatName, chat.jid, chat.statusType, chat.avatarPath)); + result.push_back(std::make_shared(chat.chatName.empty() ? chat.jid.toString() : chat.chatName, chat.jid, chat.statusType, chat.avatarPath)); } } if (withMUCNicks) { @@ -1037,7 +1038,7 @@ std::vector Swift::ChatsManager::getContacts(bool withMUCNicks) { const JID nickJID = JID(mucJID.getNode(), mucJID.getDomain(), participant.first); Presence::ref presence = presenceOracle_->getLastPresence(nickJID); const boost::filesystem::path avatar = avatarManager_->getAvatarPath(nickJID); - result.push_back(boost::make_shared(participant.first, JID(), presence->getShow(), avatar)); + result.push_back(std::make_shared(participant.first, JID(), presence->getShow(), avatar)); } } } diff --git a/Swift/Controllers/Chat/ChatsManager.h b/Swift/Controllers/Chat/ChatsManager.h index fa6ab3a..1b97be8 100644 --- a/Swift/Controllers/Chat/ChatsManager.h +++ b/Swift/Controllers/Chat/ChatsManager.h @@ -7,10 +7,9 @@ #pragma once #include +#include #include -#include - #include #include #include @@ -67,8 +66,8 @@ namespace Swift { virtual ~ChatsManager(); void setAvatarManager(AvatarManager* avatarManager); void setOnline(bool enabled); - void setServerDiscoInfo(boost::shared_ptr info); - void handleIncomingMessage(boost::shared_ptr message); + void setServerDiscoInfo(std::shared_ptr info); + void handleIncomingMessage(std::shared_ptr message); std::vector getRecentChats() const; virtual std::vector getContacts(bool withMUCNicks); @@ -93,8 +92,8 @@ namespace Swift { void handleSearchMUCRequest(); void handleMUCSelectedAfterSearch(const JID&); void rebindControllerJID(const JID& from, const JID& to); - void handlePresenceChange(boost::shared_ptr newPresence); - void handleUIEvent(boost::shared_ptr event); + void handlePresenceChange(std::shared_ptr newPresence); + void handleUIEvent(std::shared_ptr event); void handleMUCBookmarkAdded(const MUCBookmark& bookmark); void handleMUCBookmarkRemoved(const MUCBookmark& bookmark); void handleUserLeftMUC(MUCController* mucController); @@ -126,7 +125,7 @@ namespace Swift { void markAllRecentsOffline(); void handleTransformChatToMUC(ChatController* chatController, ChatWindow* chatWindow, const std::vector& jidsToInvite, const std::string& reason); - void handleLocalServiceFound(const JID& service, boost::shared_ptr info); + void handleLocalServiceFound(const JID& service, std::shared_ptr info); void handleLocalServiceWalkFinished(); void updatePresenceReceivingStateOnChatController(const JID&); @@ -154,7 +153,7 @@ namespace Swift { PresenceSender* presenceSender_; UIEventStream* uiEventStream_; MUCBookmarkManager* mucBookmarkManager_; - boost::shared_ptr serverDiscoInfo_; + std::shared_ptr serverDiscoInfo_; ChatListWindow* chatListWindow_; JoinMUCWindow* joinMUCWindow_; boost::bsignals::scoped_connection uiEventConnection_; @@ -177,7 +176,7 @@ namespace Swift { std::map emoticons_; ClientBlockListManager* clientBlockListManager_; JID localMUCServiceJID_; - boost::shared_ptr localMUCServiceFinderWalker_; + std::shared_ptr localMUCServiceFinderWalker_; AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider_; IDGenerator idGenerator_; VCardManager* vcardManager_; diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp index 66a655c..9ae3845 100644 --- a/Swift/Controllers/Chat/MUCController.cpp +++ b/Swift/Controllers/Chat/MUCController.cpp @@ -91,7 +91,7 @@ MUCController::MUCController ( MUCRegistry* mucRegistry, HighlightManager* highlightManager, ClientBlockListManager* clientBlockListManager, - boost::shared_ptr chatMessageParser, + std::shared_ptr chatMessageParser, bool isImpromptu, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider, VCardManager* vcardManager, @@ -135,7 +135,7 @@ MUCController::MUCController ( highlighter_->setMode(isImpromptu_ ? Highlighter::ChatMode : Highlighter::MUCMode); highlighter_->setNick(nick_); if (timerFactory && stanzaChannel_->isAvailable()) { - loginCheckTimer_ = boost::shared_ptr(timerFactory->createTimer(MUC_JOIN_WARNING_TIMEOUT_MILLISECONDS)); + loginCheckTimer_ = std::shared_ptr(timerFactory->createTimer(MUC_JOIN_WARNING_TIMEOUT_MILLISECONDS)); loginCheckTimer_->onTick.connect(boost::bind(&MUCController::handleJoinTimeoutTick, this)); loginCheckTimer_->start(); } @@ -230,8 +230,8 @@ void MUCController::handleActionRequestedOnOccupant(ChatWindow::OccupantAction a case ChatWindow::MakeModerator: muc_->changeOccupantRole(mucJID, MUCOccupant::Moderator);break; case ChatWindow::MakeParticipant: muc_->changeOccupantRole(mucJID, MUCOccupant::Participant);break; case ChatWindow::MakeVisitor: muc_->changeOccupantRole(mucJID, MUCOccupant::Visitor);break; - case ChatWindow::AddContact: if (occupant.getRealJID()) events_->send(boost::make_shared(realJID, occupant.getNick()));break; - case ChatWindow::ShowProfile: events_->send(boost::make_shared(mucJID));break; + case ChatWindow::AddContact: if (occupant.getRealJID()) events_->send(std::make_shared(realJID, occupant.getNick()));break; + case ChatWindow::ShowProfile: events_->send(std::make_shared(mucJID));break; } } @@ -325,7 +325,7 @@ void MUCController::receivedActivity() { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wswitch-enum" -void MUCController::handleJoinFailed(boost::shared_ptr error) { +void MUCController::handleJoinFailed(std::shared_ptr error) { receivedActivity(); std::string errorMessage = QT_TRANSLATE_NOOP("", "Unable to enter this room"); std::string rejoinNick; @@ -529,18 +529,18 @@ JID MUCController::nickToJID(const std::string& nick) { return muc_->getJID().withResource(nick); } -bool MUCController::messageTargetsMe(boost::shared_ptr message) { +bool MUCController::messageTargetsMe(std::shared_ptr message) { std::string stringRegexp(".*\\b" + boost::to_lower_copy(nick_) + "\\b.*"); boost::regex myRegexp(stringRegexp); return boost::regex_match(boost::to_lower_copy(message->getBody().get_value_or("")), myRegexp); } -void MUCController::preHandleIncomingMessage(boost::shared_ptr messageEvent) { +void MUCController::preHandleIncomingMessage(std::shared_ptr messageEvent) { if (messageEvent->getStanza()->getType() == Message::Groupchat) { lastActivity_ = boost::posix_time::microsec_clock::universal_time(); } clearPresenceQueue(); - boost::shared_ptr message = messageEvent->getStanza(); + std::shared_ptr message = messageEvent->getStanza(); if (joined_ && messageEvent->getStanza()->getFrom().getResource() != nick_ && messageTargetsMe(message) && !message->getPayload() && messageEvent->isReadable()) { chatWindow_->flash(); } @@ -576,7 +576,7 @@ void MUCController::preHandleIncomingMessage(boost::shared_ptr mes } } -void MUCController::addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, boost::shared_ptr label, const boost::posix_time::ptime& time) { +void MUCController::addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, std::shared_ptr label, const boost::posix_time::ptime& time) { if (from.isBare()) { chatWindow_->addSystemMessage(message, ChatWindow::DefaultDirection); } @@ -585,8 +585,8 @@ void MUCController::addMessageHandleIncomingMessage(const JID& from, const ChatW } } -void MUCController::postHandleIncomingMessage(boost::shared_ptr messageEvent, const ChatWindow::ChatMessage& chatMessage) { - boost::shared_ptr message = messageEvent->getStanza(); +void MUCController::postHandleIncomingMessage(std::shared_ptr messageEvent, const ChatWindow::ChatMessage& chatMessage) { + std::shared_ptr message = messageEvent->getStanza(); if (joined_ && messageEvent->getStanza()->getFrom().getResource() != nick_ && !message->getPayload()) { if (messageTargetsMe(message) || isImpromptu_) { eventController_->handleIncomingEvent(messageEvent); @@ -646,7 +646,7 @@ void MUCController::setOnline(bool online) { } else { if (shouldJoinOnReconnect_) { renameCounter_ = 0; - boost::shared_ptr blockList = clientBlockListManager_->getBlockList(); + std::shared_ptr blockList = clientBlockListManager_->getBlockList(); if (blockList && blockList->isBlocked(muc_->getJID())) { handleBlockingStateChanged(); lastJoinMessageUID_ = chatWindow_->addSystemMessage(chatMessageParser_->parseMessageBody(QT_TRANSLATE_NOOP("", "You've blocked this room. To enter the room, first unblock it using the cog menu and try again")), ChatWindow::DefaultDirection); @@ -788,12 +788,12 @@ void MUCController::handleOccupantNicknameChanged(const std::string& oldNickname onUserNicknameChanged(oldNickname, newNickname); } -void MUCController::handleOccupantPresenceChange(boost::shared_ptr presence) { +void MUCController::handleOccupantPresenceChange(std::shared_ptr presence) { receivedActivity(); roster_->applyOnItems(SetPresence(presence, JID::WithResource)); } -bool MUCController::isIncomingMessageFromMe(boost::shared_ptr message) { +bool MUCController::isIncomingMessageFromMe(std::shared_ptr message) { JID from = message->getFrom(); return nick_ == from.getResource(); } @@ -806,11 +806,11 @@ std::string MUCController::senderDisplayNameFromMessage(const JID& from) { return from.getResource(); } -void MUCController::preSendMessageRequest(boost::shared_ptr message) { +void MUCController::preSendMessageRequest(std::shared_ptr message) { message->setType(Swift::Message::Groupchat); } -boost::optional MUCController::getMessageTimestamp(boost::shared_ptr message) const { +boost::optional MUCController::getMessageTimestamp(std::shared_ptr message) const { return message->getTimestampFrom(toJID_); } @@ -994,12 +994,12 @@ void MUCController::handleDestroyRoomRequest() { void MUCController::handleInvitePersonToThisMUCRequest(const std::vector& jidsToInvite) { RequestInviteToMUCUIEvent::ImpromptuMode mode = isImpromptu_ ? RequestInviteToMUCUIEvent::Impromptu : RequestInviteToMUCUIEvent::NotImpromptu; - boost::shared_ptr event(new RequestInviteToMUCUIEvent(muc_->getJID(), jidsToInvite, mode)); + std::shared_ptr event(new RequestInviteToMUCUIEvent(muc_->getJID(), jidsToInvite, mode)); eventStream_->send(event); } -void MUCController::handleUIEvent(boost::shared_ptr event) { - boost::shared_ptr inviteEvent = boost::dynamic_pointer_cast(event); +void MUCController::handleUIEvent(std::shared_ptr event) { + std::shared_ptr inviteEvent = std::dynamic_pointer_cast(event); if (inviteEvent && inviteEvent->getRoom() == muc_->getJID()) { foreach (const JID& jid, inviteEvent->getInvites()) { muc_->invitePerson(jid, inviteEvent->getReason(), isImpromptu_); @@ -1031,11 +1031,11 @@ void MUCController::handleChangeAffiliationsRequest(const std::vectorsend(boost::make_shared(RequestChangeBlockStateUIEvent::Unblocked, muc_->getJID())); + eventStream_->send(std::make_shared(RequestChangeBlockStateUIEvent::Unblocked, muc_->getJID())); } void MUCController::handleBlockingStateChanged() { - boost::shared_ptr blockList = clientBlockListManager_->getBlockList(); + std::shared_ptr blockList = clientBlockListManager_->getBlockList(); if (blockList->getState() == BlockList::Available) { if (blockList->isBlocked(toJID_)) { if (!blockedContactAlert_) { @@ -1074,11 +1074,11 @@ void MUCController::addRecentLogs() { bool senderIsSelf = nick_ == message.getFromJID().getResource(); // the chatWindow uses utc timestamps - addMessage(chatMessageParser_->parseMessageBody(message.getMessage()), senderDisplayNameFromMessage(message.getFromJID()), senderIsSelf, boost::shared_ptr(new SecurityLabel()), avatarManager_->getAvatarPath(message.getFromJID()), message.getTime() - boost::posix_time::hours(message.getOffset())); + addMessage(chatMessageParser_->parseMessageBody(message.getMessage()), senderDisplayNameFromMessage(message.getFromJID()), senderIsSelf, std::make_shared(), avatarManager_->getAvatarPath(message.getFromJID()), message.getTime() - boost::posix_time::hours(message.getOffset())); } } -void MUCController::checkDuplicates(boost::shared_ptr newMessage) { +void MUCController::checkDuplicates(std::shared_ptr newMessage) { std::string body = newMessage->getBody().get_value_or(""); JID jid = newMessage->getFrom(); boost::optional time = newMessage->getTimestamp(); @@ -1109,26 +1109,26 @@ void MUCController::setNick(const std::string& nick) { } Form::ref MUCController::buildImpromptuRoomConfiguration(Form::ref roomConfigurationForm) { - Form::ref result = boost::make_shared(Form::SubmitType); + Form::ref result = std::make_shared(Form::SubmitType); std::string impromptuConfigs[] = { "muc#roomconfig_enablelogging", "muc#roomconfig_persistentroom", "muc#roomconfig_publicroom", "muc#roomconfig_whois"}; std::set impromptuConfigsMissing(impromptuConfigs, impromptuConfigs + 4); - foreach (boost::shared_ptr field, roomConfigurationForm->getFields()) { - boost::shared_ptr resultField; + foreach (std::shared_ptr field, roomConfigurationForm->getFields()) { + std::shared_ptr resultField; if (field->getName() == "muc#roomconfig_enablelogging") { - resultField = boost::make_shared(FormField::BooleanType, "0"); + resultField = std::make_shared(FormField::BooleanType, "0"); } if (field->getName() == "muc#roomconfig_persistentroom") { - resultField = boost::make_shared(FormField::BooleanType, "0"); + resultField = std::make_shared(FormField::BooleanType, "0"); } if (field->getName() == "muc#roomconfig_publicroom") { - resultField = boost::make_shared(FormField::BooleanType, "0"); + resultField = std::make_shared(FormField::BooleanType, "0"); } if (field->getName() == "muc#roomconfig_whois") { - resultField = boost::make_shared(FormField::ListSingleType, "anyone"); + resultField = std::make_shared(FormField::ListSingleType, "anyone"); } if (field->getName() == "FORM_TYPE") { - resultField = boost::make_shared(FormField::HiddenType, "http://jabber.org/protocol/muc#roomconfig"); + resultField = std::make_shared(FormField::HiddenType, "http://jabber.org/protocol/muc#roomconfig"); } if (resultField) { @@ -1177,10 +1177,10 @@ void MUCController::handleRoomUnlocked() { } } -void MUCController::setAvailableServerFeatures(boost::shared_ptr info) { +void MUCController::setAvailableServerFeatures(std::shared_ptr info) { ChatControllerBase::setAvailableServerFeatures(info); if (iqRouter_->isAvailable() && info->hasFeature(DiscoInfo::BlockingCommandFeature)) { - boost::shared_ptr blockList = clientBlockListManager_->getBlockList(); + std::shared_ptr blockList = clientBlockListManager_->getBlockList(); blockingOnStateChangedConnection_ = blockList->onStateChanged.connect(boost::bind(&MUCController::handleBlockingStateChanged, this)); blockingOnItemAddedConnection_ = blockList->onItemAdded.connect(boost::bind(&MUCController::handleBlockingStateChanged, this)); diff --git a/Swift/Controllers/Chat/MUCController.h b/Swift/Controllers/Chat/MUCController.h index 3a61952..b2e2698 100644 --- a/Swift/Controllers/Chat/MUCController.h +++ b/Swift/Controllers/Chat/MUCController.h @@ -7,10 +7,10 @@ #pragma once #include +#include #include #include -#include #include #include @@ -54,14 +54,14 @@ namespace Swift { class MUCController : public ChatControllerBase { public: - MUCController(const JID& self, MUC::ref muc, const boost::optional& password, const std::string &nick, StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, PresenceOracle* presenceOracle, AvatarManager* avatarManager, UIEventStream* events, bool useDelayForLatency, TimerFactory* timerFactory, EventController* eventController, EntityCapsProvider* entityCapsProvider, XMPPRoster* roster, HistoryController* historyController, MUCRegistry* mucRegistry, HighlightManager* highlightManager, ClientBlockListManager* clientBlockListManager, boost::shared_ptr chatMessageParser, bool isImpromptu, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider, VCardManager* vcardManager, MUCBookmarkManager* mucBookmarkManager); + MUCController(const JID& self, MUC::ref muc, const boost::optional& password, const std::string &nick, StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, PresenceOracle* presenceOracle, AvatarManager* avatarManager, UIEventStream* events, bool useDelayForLatency, TimerFactory* timerFactory, EventController* eventController, EntityCapsProvider* entityCapsProvider, XMPPRoster* roster, HistoryController* historyController, MUCRegistry* mucRegistry, HighlightManager* highlightManager, ClientBlockListManager* clientBlockListManager, std::shared_ptr chatMessageParser, bool isImpromptu, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider, VCardManager* vcardManager, MUCBookmarkManager* mucBookmarkManager); virtual ~MUCController(); boost::signal onUserLeft; boost::signal onUserJoined; boost::signal onImpromptuConfigCompleted; boost::signal onUserNicknameChanged; virtual void setOnline(bool online) SWIFTEN_OVERRIDE; - virtual void setAvailableServerFeatures(boost::shared_ptr info) SWIFTEN_OVERRIDE; + virtual void setAvailableServerFeatures(std::shared_ptr info) SWIFTEN_OVERRIDE; void rejoin(); static void appendToJoinParts(std::vector& joinParts, const NickJoinPart& newEvent); static std::string generateJoinPartString(const std::vector& joinParts, bool isImpromptu); @@ -75,14 +75,14 @@ namespace Swift { void sendInvites(const std::vector& jids, const std::string& reason) const; protected: - virtual void preSendMessageRequest(boost::shared_ptr message) SWIFTEN_OVERRIDE; - virtual bool isIncomingMessageFromMe(boost::shared_ptr message) SWIFTEN_OVERRIDE; + virtual void preSendMessageRequest(std::shared_ptr message) SWIFTEN_OVERRIDE; + virtual bool isIncomingMessageFromMe(std::shared_ptr message) SWIFTEN_OVERRIDE; virtual std::string senderHighlightNameFromMessage(const JID& from) SWIFTEN_OVERRIDE; virtual std::string senderDisplayNameFromMessage(const JID& from) SWIFTEN_OVERRIDE; - virtual boost::optional getMessageTimestamp(boost::shared_ptr message) const SWIFTEN_OVERRIDE; - virtual void preHandleIncomingMessage(boost::shared_ptr) SWIFTEN_OVERRIDE; - virtual void addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, boost::shared_ptr label, const boost::posix_time::ptime& time) SWIFTEN_OVERRIDE; - virtual void postHandleIncomingMessage(boost::shared_ptr, const ChatWindow::ChatMessage& chatMessage) SWIFTEN_OVERRIDE; + virtual boost::optional getMessageTimestamp(std::shared_ptr message) const SWIFTEN_OVERRIDE; + virtual void preHandleIncomingMessage(std::shared_ptr) SWIFTEN_OVERRIDE; + virtual void addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, std::shared_ptr label, const boost::posix_time::ptime& time) SWIFTEN_OVERRIDE; + virtual void postHandleIncomingMessage(std::shared_ptr, const ChatWindow::ChatMessage& chatMessage) SWIFTEN_OVERRIDE; virtual void cancelReplaces() SWIFTEN_OVERRIDE; virtual void logMessage(const std::string& message, const JID& fromJID, const JID& toJID, const boost::posix_time::ptime& timeStamp, bool isIncoming) SWIFTEN_OVERRIDE; @@ -97,11 +97,11 @@ namespace Swift { void handleOccupantJoined(const MUCOccupant& occupant); void handleOccupantNicknameChanged(const std::string& oldNickname, const std::string& newNickname); void handleOccupantLeft(const MUCOccupant& occupant, MUC::LeavingType type, const std::string& reason); - void handleOccupantPresenceChange(boost::shared_ptr presence); + void handleOccupantPresenceChange(std::shared_ptr presence); void handleOccupantRoleChanged(const std::string& nick, const MUCOccupant& occupant,const MUCOccupant::Role& oldRole); void handleOccupantAffiliationChanged(const std::string& nick, const MUCOccupant::Affiliation& affiliation,const MUCOccupant::Affiliation& oldAffiliation); void handleJoinComplete(const std::string& nick); - void handleJoinFailed(boost::shared_ptr error); + void handleJoinFailed(std::shared_ptr error); void handleJoinTimeoutTick(); void handleChangeSubjectRequest(const std::string&); void handleBookmarkRequest(); @@ -110,7 +110,7 @@ namespace Swift { JID nickToJID(const std::string& nick); std::string roleToFriendlyName(MUCOccupant::Role role); void receivedActivity(); - bool messageTargetsMe(boost::shared_ptr message); + bool messageTargetsMe(std::shared_ptr message); void updateJoinParts(); bool shouldUpdateJoinParts(); virtual void dayTicked() SWIFTEN_OVERRIDE { clearPresenceQueue(); } @@ -128,9 +128,9 @@ namespace Swift { void handleChangeAffiliationsRequest(const std::vector >& changes); void handleInviteToMUCWindowDismissed(); void handleInviteToMUCWindowCompleted(); - void handleUIEvent(boost::shared_ptr event); + void handleUIEvent(std::shared_ptr event); void addRecentLogs(); - void checkDuplicates(boost::shared_ptr newMessage); + void checkDuplicates(std::shared_ptr newMessage); void setNick(const std::string& nick); void setImpromptuWindowTitle(); void handleRoomUnlocked(); @@ -157,7 +157,7 @@ namespace Swift { bool shouldJoinOnReconnect_; bool doneGettingHistory_; boost::bsignals::scoped_connection avatarChangedConnection_; - boost::shared_ptr loginCheckTimer_; + std::shared_ptr loginCheckTimer_; std::set currentOccupants_; std::vector joinParts_; boost::posix_time::ptime lastActivity_; diff --git a/Swift/Controllers/Chat/MUCSearchController.cpp b/Swift/Controllers/Chat/MUCSearchController.cpp index 4f28058..0893799 100644 --- a/Swift/Controllers/Chat/MUCSearchController.cpp +++ b/Swift/Controllers/Chat/MUCSearchController.cpp @@ -7,9 +7,9 @@ #include #include +#include #include -#include #include #include @@ -101,7 +101,7 @@ void MUCSearchController::handleSearchService(const JID& jid) { walker_->beginWalk(); } -void MUCSearchController::handleDiscoServiceFound(const JID& jid, boost::shared_ptr info) { +void MUCSearchController::handleDiscoServiceFound(const JID& jid, std::shared_ptr info) { bool isMUC = false; std::string name; foreach (DiscoInfo::Identity identity, info->getIdentities()) { @@ -143,7 +143,7 @@ void MUCSearchController::removeService(const JID& jid) { refreshView(); } -void MUCSearchController::handleRoomsItemsResponse(boost::shared_ptr items, ErrorPayload::ref error, const JID& jid) { +void MUCSearchController::handleRoomsItemsResponse(std::shared_ptr items, ErrorPayload::ref error, const JID& jid) { itemsInProgress_--; SWIFT_LOG(debug) << "Items received for " << jid << " (" << itemsInProgress_ << " item requests in progress)" << std::endl; updateInProgressness(); diff --git a/Swift/Controllers/Chat/MUCSearchController.h b/Swift/Controllers/Chat/MUCSearchController.h index 3d2a2ca..99da8d0 100644 --- a/Swift/Controllers/Chat/MUCSearchController.h +++ b/Swift/Controllers/Chat/MUCSearchController.h @@ -7,11 +7,10 @@ #pragma once #include +#include #include #include -#include - #include #include #include @@ -97,9 +96,9 @@ namespace Swift { private: void handleSearchService(const JID& jid); - void handleRoomsItemsResponse(boost::shared_ptr items, ErrorPayload::ref error, const JID& jid); + void handleRoomsItemsResponse(std::shared_ptr items, ErrorPayload::ref error, const JID& jid); void handleDiscoError(const JID& jid, ErrorPayload::ref error); - void handleDiscoServiceFound(const JID&, boost::shared_ptr); + void handleDiscoServiceFound(const JID&, std::shared_ptr); void handleDiscoWalkFinished(); void handleMUCSearchFinished(const boost::optional& result); void removeService(const JID& jid); diff --git a/Swift/Controllers/Chat/UnitTest/ChatMessageParserTest.cpp b/Swift/Controllers/Chat/UnitTest/ChatMessageParserTest.cpp index 9ed8bf4..bc72b33 100644 --- a/Swift/Controllers/Chat/UnitTest/ChatMessageParserTest.cpp +++ b/Swift/Controllers/Chat/UnitTest/ChatMessageParserTest.cpp @@ -38,12 +38,12 @@ public: } void assertText(const ChatWindow::ChatMessage& result, size_t index, const std::string& text) { - boost::shared_ptr part = boost::dynamic_pointer_cast(result.getParts()[index]); + std::shared_ptr part = std::dynamic_pointer_cast(result.getParts()[index]); CPPUNIT_ASSERT_EQUAL(text, part->text); } void assertEmoticon(const ChatWindow::ChatMessage& result, size_t index, const std::string& text, const std::string& path) { - boost::shared_ptr part = boost::dynamic_pointer_cast(result.getParts()[index]); + std::shared_ptr part = std::dynamic_pointer_cast(result.getParts()[index]); CPPUNIT_ASSERT(!!part); CPPUNIT_ASSERT_EQUAL(text, part->alternativeText); CPPUNIT_ASSERT_EQUAL(path, part->imagePath); @@ -51,13 +51,13 @@ public: #define assertHighlight(RESULT, INDEX, TEXT, EXPECTED_HIGHLIGHT) \ { \ - boost::shared_ptr part = boost::dynamic_pointer_cast(RESULT.getParts()[INDEX]); \ + std::shared_ptr part = std::dynamic_pointer_cast(RESULT.getParts()[INDEX]); \ CPPUNIT_ASSERT_EQUAL(std::string(TEXT), part->text); \ CPPUNIT_ASSERT(EXPECTED_HIGHLIGHT == part->action); \ } void assertURL(const ChatWindow::ChatMessage& result, size_t index, const std::string& text) { - boost::shared_ptr part = boost::dynamic_pointer_cast(result.getParts()[index]); + std::shared_ptr part = std::dynamic_pointer_cast(result.getParts()[index]); CPPUNIT_ASSERT_EQUAL(text, part->target); } @@ -76,14 +76,14 @@ public: static const HighlightRulesListPtr ruleListFromKeyword(const std::string& keyword, bool matchCase, bool matchWholeWord) { - boost::shared_ptr list = boost::make_shared(); + std::shared_ptr list = std::make_shared(); list->addRule(ruleFromKeyword(keyword, matchCase, matchWholeWord)); return list; } static const HighlightRulesListPtr ruleListFromKeywords(const HighlightRule &rule1, const HighlightRule &rule2) { - boost::shared_ptr list = boost::make_shared(); + std::shared_ptr list = std::make_shared(); list->addRule(rule1); list->addRule(rule2); return list; @@ -99,14 +99,14 @@ public: if (withHighlightColour) { rule.getAction().setTextBackground("white"); } - boost::shared_ptr list = boost::make_shared(); + std::shared_ptr list = std::make_shared(); list->addRule(rule); return list; } void testFullBody() { const std::string no_special_message = "a message with no special content"; - ChatMessageParser testling(emoticons_, boost::make_shared()); + ChatMessageParser testling(emoticons_, std::make_shared()); ChatWindow::ChatMessage result = testling.parseMessageBody(no_special_message); assertText(result, 0, no_special_message); @@ -221,7 +221,7 @@ public: } void testOneEmoticon() { - ChatMessageParser testling(emoticons_, boost::make_shared()); + ChatMessageParser testling(emoticons_, std::make_shared()); ChatWindow::ChatMessage result = testling.parseMessageBody(" :) "); assertText(result, 0, " "); assertEmoticon(result, 1, smile1_, smile1Path_); @@ -230,26 +230,26 @@ public: void testBareEmoticon() { - ChatMessageParser testling(emoticons_, boost::make_shared()); + ChatMessageParser testling(emoticons_, std::make_shared()); ChatWindow::ChatMessage result = testling.parseMessageBody(":)"); assertEmoticon(result, 0, smile1_, smile1Path_); } void testHiddenEmoticon() { - ChatMessageParser testling(emoticons_, boost::make_shared()); + ChatMessageParser testling(emoticons_, std::make_shared()); ChatWindow::ChatMessage result = testling.parseMessageBody("b:)a"); assertText(result, 0, "b:)a"); } void testEndlineEmoticon() { - ChatMessageParser testling(emoticons_, boost::make_shared()); + ChatMessageParser testling(emoticons_, std::make_shared()); ChatWindow::ChatMessage result = testling.parseMessageBody("Lazy:)"); assertText(result, 0, "Lazy"); assertEmoticon(result, 1, smile1_, smile1Path_); } void testBoundedEmoticons() { - ChatMessageParser testling(emoticons_, boost::make_shared()); + ChatMessageParser testling(emoticons_, std::make_shared()); ChatWindow::ChatMessage result = testling.parseMessageBody(":)Lazy:("); assertEmoticon(result, 0, smile1_, smile1Path_); assertText(result, 1, "Lazy"); @@ -257,7 +257,7 @@ public: } void testEmoticonParenthesis() { - ChatMessageParser testling(emoticons_, boost::make_shared()); + ChatMessageParser testling(emoticons_, std::make_shared()); ChatWindow::ChatMessage result = testling.parseMessageBody("(Like this :))"); assertText(result, 0, "(Like this "); assertEmoticon(result, 1, smile1_, smile1Path_); diff --git a/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp b/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp index 92a8ca0..90600dc 100644 --- a/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp +++ b/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp @@ -97,7 +97,7 @@ public: mucRegistry_ = new MUCRegistry(); nickResolver_ = new NickResolver(jid_.toBare(), xmppRoster_, nullptr, mucRegistry_); presenceOracle_ = new PresenceOracle(stanzaChannel_, xmppRoster_); - serverDiscoInfo_ = boost::make_shared(); + serverDiscoInfo_ = std::make_shared(); presenceSender_ = new StanzaChannelPresenceSender(stanzaChannel_); directedPresenceSender_ = new DirectedPresenceSender(presenceSender_); mucManager_ = new MUCManager(stanzaChannel_, iqRouter_, directedPresenceSender_, mucRegistry_); @@ -167,7 +167,7 @@ public: MockChatWindow* window = new MockChatWindow(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID, uiEventStream_).Return(window); - boost::shared_ptr message(new Message()); + std::shared_ptr message(new Message()); message->setFrom(messageJID); std::string body("This is a legible message. >HEH@)oeueu"); message->setBody(body); @@ -181,7 +181,7 @@ public: MockChatWindow* window1 = new MockChatWindow();//mocks_->InterfaceMock(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID1, uiEventStream_).Return(window1); - boost::shared_ptr message1(new Message()); + std::shared_ptr message1(new Message()); message1->setFrom(messageJID1); std::string body1("This is a legible message. >HEH@)oeueu"); message1->setBody(body1); @@ -193,7 +193,7 @@ public: //MockChatWindow* window2 = new MockChatWindow();//mocks_->InterfaceMock(); //mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID2, uiEventStream_).Return(window2); - boost::shared_ptr message2(new Message()); + std::shared_ptr message2(new Message()); message2->setFrom(messageJID2); std::string body2("This is a legible message. .cmaulm.chul"); message2->setBody(body2); @@ -207,7 +207,7 @@ public: ChatWindow* window = new MockChatWindow();//mocks_->InterfaceMock(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString), uiEventStream_).Return(window); - uiEventStream_->send(boost::shared_ptr(new RequestChatUIEvent(JID(messageJIDString)))); + uiEventStream_->send(std::make_shared(JID(messageJIDString))); } @@ -217,9 +217,9 @@ public: MockChatWindow* window = new MockChatWindow();//mocks_->InterfaceMock(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(bareJIDString), uiEventStream_).Return(window); - uiEventStream_->send(boost::shared_ptr(new RequestChatUIEvent(JID(bareJIDString)))); + uiEventStream_->send(std::make_shared(JID(bareJIDString))); - boost::shared_ptr message(new Message()); + std::shared_ptr message(new Message()); message->setFrom(JID(fullJIDString)); std::string body("This is a legible message. mjuga3089gm8G(*>M)@*("); message->setBody(body); @@ -231,13 +231,13 @@ public: std::string messageJIDString1("testling1@test.com"); ChatWindow* window1 = new MockChatWindow();//mocks_->InterfaceMock(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString1), uiEventStream_).Return(window1); - uiEventStream_->send(boost::shared_ptr(new RequestChatUIEvent(JID(messageJIDString1)))); + uiEventStream_->send(std::make_shared(JID(messageJIDString1))); std::string messageJIDString2("testling2@test.com"); ChatWindow* window2 = new MockChatWindow();//mocks_->InterfaceMock(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString2), uiEventStream_).Return(window2); - uiEventStream_->send(boost::shared_ptr(new RequestChatUIEvent(JID(messageJIDString2)))); + uiEventStream_->send(std::make_shared(JID(messageJIDString2))); } /** Complete cycle. @@ -253,23 +253,23 @@ public: MockChatWindow* window = new MockChatWindow();//mocks_->InterfaceMock(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(bareJIDString), uiEventStream_).Return(window); - uiEventStream_->send(boost::shared_ptr(new RequestChatUIEvent(JID(bareJIDString)))); + uiEventStream_->send(std::make_shared(JID(bareJIDString))); - boost::shared_ptr message1(new Message()); + std::shared_ptr message1(new Message()); message1->setFrom(JID(fullJIDString1)); std::string messageBody1("This is a legible message."); message1->setBody(messageBody1); manager_->handleIncomingMessage(message1); CPPUNIT_ASSERT_EQUAL(messageBody1, window->lastMessageBody_); - boost::shared_ptr jid1Online(new Presence()); + std::shared_ptr jid1Online(new Presence()); jid1Online->setFrom(JID(fullJIDString1)); - boost::shared_ptr jid1Offline(new Presence()); + std::shared_ptr jid1Offline(new Presence()); jid1Offline->setFrom(JID(fullJIDString1)); jid1Offline->setType(Presence::Unavailable); presenceOracle_->onPresenceChange(jid1Offline); - boost::shared_ptr message2(new Message()); + std::shared_ptr message2(new Message()); message2->setFrom(JID(fullJIDString2)); std::string messageBody2("This is another legible message."); message2->setBody(messageBody2); @@ -284,29 +284,29 @@ public: JID muc("testling@test.com"); ChatWindow* mucWindow = new MockChatWindow(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(muc, uiEventStream_).Return(mucWindow); - uiEventStream_->send(boost::make_shared(muc, std::string("nick"))); + uiEventStream_->send(std::make_shared(muc, std::string("nick"))); std::string messageJIDString1("testling@test.com/1"); ChatWindow* window1 = new MockChatWindow();//mocks_->InterfaceMock(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString1), uiEventStream_).Return(window1); - uiEventStream_->send(boost::shared_ptr(new RequestChatUIEvent(JID(messageJIDString1)))); + uiEventStream_->send(std::make_shared(JID(messageJIDString1))); std::string messageJIDString2("testling@test.com/2"); ChatWindow* window2 = new MockChatWindow();//mocks_->InterfaceMock(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString2), uiEventStream_).Return(window2); - uiEventStream_->send(boost::shared_ptr(new RequestChatUIEvent(JID(messageJIDString2)))); + uiEventStream_->send(std::make_shared(JID(messageJIDString2))); std::string messageJIDString3("testling@test.com/3"); ChatWindow* window3 = new MockChatWindow();//mocks_->InterfaceMock(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString3), uiEventStream_).Return(window3); - uiEventStream_->send(boost::shared_ptr(new RequestChatUIEvent(JID(messageJIDString3)))); + uiEventStream_->send(std::make_shared(JID(messageJIDString3))); /* Refetch an earlier window */ /* We do not expect a new window to be created */ - uiEventStream_->send(boost::shared_ptr(new RequestChatUIEvent(JID(messageJIDString1)))); + uiEventStream_->send(std::make_shared(JID(messageJIDString1))); } @@ -325,7 +325,7 @@ public: MockChatWindow* window1 = new MockChatWindow();//mocks_->InterfaceMock(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID1, uiEventStream_).Return(window1); - boost::shared_ptr message1(new Message()); + std::shared_ptr message1(new Message()); message1->setFrom(messageJID1); message1->setBody("This is a legible message1."); manager_->handleIncomingMessage(message1); @@ -335,35 +335,35 @@ public: //MockChatWindow* window2 = new MockChatWindow();//mocks_->InterfaceMock(); //mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID2, uiEventStream_).Return(window2); - boost::shared_ptr message2(new Message()); + std::shared_ptr message2(new Message()); message2->setFrom(messageJID2); message2->setBody("This is a legible message2."); manager_->handleIncomingMessage(message2); - boost::shared_ptr jid1Online(new Presence()); + std::shared_ptr jid1Online(new Presence()); jid1Online->setFrom(JID(messageJID1)); - boost::shared_ptr jid1Offline(new Presence()); + std::shared_ptr jid1Offline(new Presence()); jid1Offline->setFrom(JID(messageJID1)); jid1Offline->setType(Presence::Unavailable); presenceOracle_->onPresenceChange(jid1Offline); - boost::shared_ptr jid2Online(new Presence()); + std::shared_ptr jid2Online(new Presence()); jid2Online->setFrom(JID(messageJID2)); - boost::shared_ptr jid2Offline(new Presence()); + std::shared_ptr jid2Offline(new Presence()); jid2Offline->setFrom(JID(messageJID2)); jid2Offline->setType(Presence::Unavailable); presenceOracle_->onPresenceChange(jid2Offline); JID messageJID3("testling@test.com/resource3"); - boost::shared_ptr message3(new Message()); + std::shared_ptr message3(new Message()); message3->setFrom(messageJID3); std::string body3("This is a legible message3."); message3->setBody(body3); manager_->handleIncomingMessage(message3); CPPUNIT_ASSERT_EQUAL(body3, window1->lastMessageBody_); - boost::shared_ptr message2b(new Message()); + std::shared_ptr message2b(new Message()); message2b->setFrom(messageJID2); std::string body2b("This is a legible message2b."); message2b->setBody(body2b); @@ -382,7 +382,7 @@ public: mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID, uiEventStream_).Return(window); settings_->storeSetting(SettingConstants::REQUEST_DELIVERYRECEIPTS, true); - boost::shared_ptr message = makeDeliveryReceiptTestMessage(messageJID, "1"); + std::shared_ptr message = makeDeliveryReceiptTestMessage(messageJID, "1"); manager_->handleIncomingMessage(message); Stanza::ref stanzaContactOnRoster = stanzaChannel_->getStanzaAtIndex(0); CPPUNIT_ASSERT_EQUAL(st(1), stanzaChannel_->sentStanzas.size()); @@ -405,7 +405,7 @@ public: mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID, uiEventStream_).Return(window); settings_->storeSetting(SettingConstants::REQUEST_DELIVERYRECEIPTS, true); - boost::shared_ptr message = makeDeliveryReceiptTestMessage(messageJID, "1"); + std::shared_ptr message = makeDeliveryReceiptTestMessage(messageJID, "1"); manager_->handleIncomingMessage(message); CPPUNIT_ASSERT_EQUAL(st(0), stanzaChannel_->sentStanzas.size()); @@ -447,16 +447,16 @@ public: MockChatWindow* window = new MockChatWindow(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(sender, uiEventStream_).Return(window); - uiEventStream_->send(boost::make_shared(sender)); + uiEventStream_->send(std::make_shared(sender)); foreach(const JID& senderJID, senderResource) { // The sender supports delivery receipts. - DiscoInfo::ref disco = boost::make_shared(); + DiscoInfo::ref disco = std::make_shared(); disco->addFeature(DiscoInfo::MessageDeliveryReceiptsFeature); entityCapsProvider_->caps[senderJID] = disco; // The sender is online. - Presence::ref senderPresence = boost::make_shared(); + Presence::ref senderPresence = std::make_shared(); senderPresence->setFrom(senderJID); senderPresence->setTo(ownJID); stanzaChannel_->onPresenceReceived(senderPresence); @@ -473,11 +473,11 @@ public: // Two resources respond with message receipts. foreach(const JID& senderJID, senderResource) { - Message::ref receiptReply = boost::make_shared(); + Message::ref receiptReply = std::make_shared(); receiptReply->setFrom(senderJID); receiptReply->setTo(ownJID); - boost::shared_ptr receipt = boost::make_shared(); + std::shared_ptr receipt = std::make_shared(); receipt->setReceivedID(stanzaChannel_->getStanzaAtIndex(0)->getID()); receiptReply->addPayload(receipt); manager_->handleIncomingMessage(receiptReply); @@ -492,18 +492,18 @@ public: // Two resources respond with message receipts. foreach(const JID& senderJID, senderResource) { - Message::ref receiptReply = boost::make_shared(); + Message::ref receiptReply = std::make_shared(); receiptReply->setFrom(senderJID); receiptReply->setTo(ownJID); - boost::shared_ptr receipt = boost::make_shared(); + std::shared_ptr receipt = std::make_shared(); receipt->setReceivedID(stanzaChannel_->getStanzaAtIndex(1)->getID()); receiptReply->addPayload(receipt); manager_->handleIncomingMessage(receiptReply); } // Reply with a message including a body text. - Message::ref reply = boost::make_shared(); + Message::ref reply = std::make_shared(); reply->setFrom(senderResource[0]); reply->setTo(ownJID); reply->setBody("fine."); @@ -517,11 +517,11 @@ public: CPPUNIT_ASSERT(stanzaChannel_->getStanzaAtIndex(2)->getPayload()); // Receive random receipt from second sender resource. - reply = boost::make_shared(); + reply = std::make_shared(); reply->setFrom(senderResource[1]); reply->setTo(ownJID); - boost::shared_ptr receipt = boost::make_shared(); + std::shared_ptr receipt = std::make_shared(); receipt->setReceivedID(stanzaChannel_->getStanzaAtIndex(2)->getID()); reply->addPayload(receipt); manager_->handleIncomingMessage(reply); @@ -534,7 +534,7 @@ public: CPPUNIT_ASSERT(stanzaChannel_->getStanzaAtIndex(3)->getPayload()); // Reply with a message including a body text from second resource. - reply = boost::make_shared(); + reply = std::make_shared(); reply->setFrom(senderResource[1]); reply->setTo(ownJID); reply->setBody("nothing."); @@ -562,16 +562,16 @@ public: MockChatWindow* window = new MockChatWindow(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(sender, uiEventStream_).Return(window); - uiEventStream_->send(boost::make_shared(sender)); + uiEventStream_->send(std::make_shared(sender)); foreach(const JID& senderJID, senderResource) { // The sender supports delivery receipts. - DiscoInfo::ref disco = boost::make_shared(); + DiscoInfo::ref disco = std::make_shared(); disco->addFeature(DiscoInfo::MessageDeliveryReceiptsFeature); entityCapsProvider_->caps[senderJID] = disco; // The sender is online. - Presence::ref senderPresence = boost::make_shared(); + Presence::ref senderPresence = std::make_shared(); senderPresence->setFrom(senderJID); senderPresence->setTo(ownJID); stanzaChannel_->onPresenceReceived(senderPresence); @@ -588,11 +588,11 @@ public: // Two resources respond with message receipts. foreach(const JID& senderJID, senderResource) { - Message::ref reply = boost::make_shared(); + Message::ref reply = std::make_shared(); reply->setFrom(senderJID); reply->setTo(ownJID); - boost::shared_ptr csn = boost::make_shared(); + std::shared_ptr csn = std::make_shared(); csn->setChatState(ChatState::Active); reply->addPayload(csn); manager_->handleIncomingMessage(reply); @@ -607,22 +607,22 @@ public: // Two resources respond with message receipts. foreach(const JID& senderJID, senderResource) { - Message::ref receiptReply = boost::make_shared(); + Message::ref receiptReply = std::make_shared(); receiptReply->setFrom(senderJID); receiptReply->setTo(ownJID); - boost::shared_ptr receipt = boost::make_shared(); + std::shared_ptr receipt = std::make_shared(); receipt->setReceivedID(stanzaChannel_->getStanzaAtIndex(1)->getID()); receiptReply->addPayload(receipt); manager_->handleIncomingMessage(receiptReply); } // Reply with a message including a CSN. - Message::ref reply = boost::make_shared(); + Message::ref reply = std::make_shared(); reply->setFrom(senderResource[0]); reply->setTo(ownJID); - boost::shared_ptr csn = boost::make_shared(); + std::shared_ptr csn = std::make_shared(); csn->setChatState(ChatState::Composing); reply->addPayload(csn); manager_->handleIncomingMessage(reply); @@ -635,11 +635,11 @@ public: CPPUNIT_ASSERT(stanzaChannel_->getStanzaAtIndex(2)->getPayload()); // Reply with a message including a CSN from the other resource. - reply = boost::make_shared(); + reply = std::make_shared(); reply->setFrom(senderResource[1]); reply->setTo(ownJID); - csn = boost::make_shared(); + csn = std::make_shared(); csn->setChatState(ChatState::Composing); reply->addPayload(csn); manager_->handleIncomingMessage(reply); @@ -661,7 +661,7 @@ public: MockChatWindow* window = new MockChatWindow(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(participantA, uiEventStream_).Return(window); - uiEventStream_->send(boost::shared_ptr(new RequestChatUIEvent(JID(participantA)))); + uiEventStream_->send(std::make_shared(JID(participantA))); Presence::ref presence = Presence::create(); presence->setFrom(participantA); @@ -692,17 +692,17 @@ public: MockChatWindow* window = new MockChatWindow(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(sender, uiEventStream_).Return(window); - uiEventStream_->send(boost::make_shared(sender)); + uiEventStream_->send(std::make_shared(sender)); CPPUNIT_ASSERT_EQUAL(false, window->impromptuMUCSupported_); - boost::shared_ptr infoRequest= iqChannel_->iqs_[1]; - boost::shared_ptr infoResponse = IQ::createResult(infoRequest->getFrom(), infoRequest->getTo(), infoRequest->getID()); + std::shared_ptr infoRequest= iqChannel_->iqs_[1]; + std::shared_ptr infoResponse = IQ::createResult(infoRequest->getFrom(), infoRequest->getTo(), infoRequest->getID()); DiscoInfo info; info.addIdentity(DiscoInfo::Identity("Shakespearean Chat Service", "conference", "text")); info.addFeature("http://jabber.org/protocol/muc"); - infoResponse->addPayload(boost::make_shared(info)); + infoResponse->addPayload(std::make_shared(info)); iqChannel_->onIQReceived(infoResponse); CPPUNIT_ASSERT_EQUAL(true, window->impromptuMUCSupported_); @@ -718,7 +718,7 @@ public: mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID, uiEventStream_).Return(window); settings_->storeSetting(SettingConstants::REQUEST_DELIVERYRECEIPTS, true); - boost::shared_ptr message = makeDeliveryReceiptTestMessage(messageJID, "1"); + std::shared_ptr message = makeDeliveryReceiptTestMessage(messageJID, "1"); manager_->handleIncomingMessage(message); CPPUNIT_ASSERT_EQUAL(st(0), stanzaChannel_->sentStanzas.size()); @@ -757,7 +757,7 @@ public: MockChatWindow* window = new MockChatWindow(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID, uiEventStream_).Return(window); - boost::shared_ptr message(new Message()); + std::shared_ptr message(new Message()); message->setFrom(messageJID); std::string body("This message should cause two sounds: Juliet and Romeo."); message->setBody(body); @@ -792,7 +792,7 @@ public: MockChatWindow* window = new MockChatWindow(); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID, uiEventStream_).Return(window); - boost::shared_ptr message(new Message()); + std::shared_ptr message(new Message()); message->setFrom(messageJID); std::string body("This message should cause one sound, because both actions have the same sound: Juliet and Romeo."); message->setBody(body); @@ -804,12 +804,12 @@ public: } private: - boost::shared_ptr makeDeliveryReceiptTestMessage(const JID& from, const std::string& id) { - boost::shared_ptr message = boost::make_shared(); + std::shared_ptr makeDeliveryReceiptTestMessage(const JID& from, const std::string& id) { + std::shared_ptr message = std::make_shared(); message->setFrom(from); message->setID(id); message->setBody("This will cause the window to open"); - message->addPayload(boost::make_shared()); + message->addPayload(std::make_shared()); return message; } @@ -836,7 +836,7 @@ private: NickResolver* nickResolver_; PresenceOracle* presenceOracle_; AvatarManager* avatarManager_; - boost::shared_ptr serverDiscoInfo_; + std::shared_ptr serverDiscoInfo_; XMPPRosterImpl* xmppRoster_; PresenceSender* presenceSender_; MockRepository* mocks_; diff --git a/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp b/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp index 80dbc32..1142c98 100644 --- a/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp +++ b/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp @@ -67,7 +67,7 @@ class MUCControllerTest : public CppUnit::TestFixture { public: void setUp() { - crypto_ = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto_ = std::shared_ptr(PlatformCryptoProvider::create()); self_ = JID("girl@wonderland.lit/rabbithole"); nick_ = "aLiCe"; mucJID_ = JID("teaparty@rooms.wonderland.lit"); @@ -90,9 +90,9 @@ public: entityCapsProvider_ = new DummyEntityCapsProvider(); settings_ = new DummySettingsProvider(); highlightManager_ = new HighlightManager(settings_); - muc_ = boost::make_shared(mucJID_); + muc_ = std::make_shared(mucJID_); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(muc_->getJID(), uiEventStream_).Return(window_); - chatMessageParser_ = boost::make_shared(std::map(), highlightManager_->getRules(), true); + chatMessageParser_ = std::make_shared(std::map(), highlightManager_->getRules(), true); vcardStorage_ = new VCardMemoryStorage(crypto_.get()); vcardManager_ = new VCardManager(self_, iqRouter_, vcardStorage_); clientBlockListManager_ = new ClientBlockListManager(iqRouter_); @@ -204,18 +204,18 @@ public: SecurityLabelsCatalog::Item label; label.setSelector("Bob"); window_->label_ = label; - boost::shared_ptr features = boost::make_shared(); + std::shared_ptr features = std::make_shared(); features->addFeature(DiscoInfo::SecurityLabelsCatalogFeature); controller_->setAvailableServerFeatures(features); IQ::ref iq = iqChannel_->iqs_[iqChannel_->iqs_.size() - 1]; - SecurityLabelsCatalog::ref labelPayload = boost::make_shared(); + SecurityLabelsCatalog::ref labelPayload = std::make_shared(); labelPayload->addItem(label); IQ::ref result = IQ::createResult(self_, iq->getID(), labelPayload); iqChannel_->onIQReceived(result); std::string messageBody("agamemnon"); window_->onSendMessageRequest(messageBody, false); - boost::shared_ptr rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; - Message::ref message = boost::dynamic_pointer_cast(rawStanza); + std::shared_ptr rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; + Message::ref message = std::dynamic_pointer_cast(rawStanza); CPPUNIT_ASSERT_EQUAL(iq->getTo(), result->getFrom()); CPPUNIT_ASSERT(window_->labelsEnabled_); CPPUNIT_ASSERT(stanzaChannel_->isAvailable()); /* Otherwise will prevent sends. */ @@ -225,24 +225,24 @@ public: } void testMessageWithLabelItem() { - boost::shared_ptr label = boost::make_shared(); + std::shared_ptr label = std::make_shared(); label->setLabel("a"); SecurityLabelsCatalog::Item labelItem; labelItem.setSelector("Bob"); labelItem.setLabel(label); window_->label_ = labelItem; - boost::shared_ptr features = boost::make_shared(); + std::shared_ptr features = std::make_shared(); features->addFeature(DiscoInfo::SecurityLabelsCatalogFeature); controller_->setAvailableServerFeatures(features); IQ::ref iq = iqChannel_->iqs_[iqChannel_->iqs_.size() - 1]; - SecurityLabelsCatalog::ref labelPayload = boost::make_shared(); + SecurityLabelsCatalog::ref labelPayload = std::make_shared(); labelPayload->addItem(labelItem); IQ::ref result = IQ::createResult(self_, iq->getID(), labelPayload); iqChannel_->onIQReceived(result); std::string messageBody("agamemnon"); window_->onSendMessageRequest(messageBody, false); - boost::shared_ptr rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; - Message::ref message = boost::dynamic_pointer_cast(rawStanza); + std::shared_ptr rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; + Message::ref message = std::dynamic_pointer_cast(rawStanza); CPPUNIT_ASSERT_EQUAL(iq->getTo(), result->getFrom()); CPPUNIT_ASSERT(window_->labelsEnabled_); CPPUNIT_ASSERT(stanzaChannel_->isAvailable()); /* Otherwise will prevent sends. */ @@ -252,29 +252,29 @@ public: } void testCorrectMessageWithLabelItem() { - boost::shared_ptr label = boost::make_shared(); + std::shared_ptr label = std::make_shared(); label->setLabel("a"); SecurityLabelsCatalog::Item labelItem; labelItem.setSelector("Bob"); labelItem.setLabel(label); - boost::shared_ptr label2 = boost::make_shared(); + std::shared_ptr label2 = std::make_shared(); label->setLabel("b"); SecurityLabelsCatalog::Item labelItem2; labelItem2.setSelector("Charlie"); labelItem2.setLabel(label2); window_->label_ = labelItem; - boost::shared_ptr features = boost::make_shared(); + std::shared_ptr features = std::make_shared(); features->addFeature(DiscoInfo::SecurityLabelsCatalogFeature); controller_->setAvailableServerFeatures(features); IQ::ref iq = iqChannel_->iqs_[iqChannel_->iqs_.size() - 1]; - SecurityLabelsCatalog::ref labelPayload = boost::make_shared(); + SecurityLabelsCatalog::ref labelPayload = std::make_shared(); labelPayload->addItem(labelItem); IQ::ref result = IQ::createResult(self_, iq->getID(), labelPayload); iqChannel_->onIQReceived(result); std::string messageBody("agamemnon"); window_->onSendMessageRequest(messageBody, false); - boost::shared_ptr rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; - Message::ref message = boost::dynamic_pointer_cast(rawStanza); + std::shared_ptr rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; + Message::ref message = std::dynamic_pointer_cast(rawStanza); CPPUNIT_ASSERT_EQUAL(iq->getTo(), result->getFrom()); CPPUNIT_ASSERT(window_->labelsEnabled_); CPPUNIT_ASSERT(stanzaChannel_->isAvailable()); /* Otherwise will prevent sends. */ @@ -284,7 +284,7 @@ public: window_->label_ = labelItem2; window_->onSendMessageRequest(messageBody, true); rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; - message = boost::dynamic_pointer_cast(rawStanza); + message = std::dynamic_pointer_cast(rawStanza); CPPUNIT_ASSERT_EQUAL(messageBody, message->getBody().get()); CPPUNIT_ASSERT_EQUAL(label, message->getPayload()); } @@ -406,22 +406,22 @@ public: void testSubjectChangeCorrect() { std::string messageBody("test message"); window_->onSendMessageRequest(messageBody, false); - boost::shared_ptr rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; - Message::ref message = boost::dynamic_pointer_cast(rawStanza); + std::shared_ptr rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; + Message::ref message = std::dynamic_pointer_cast(rawStanza); CPPUNIT_ASSERT(stanzaChannel_->isAvailable()); /* Otherwise will prevent sends. */ CPPUNIT_ASSERT(message); CPPUNIT_ASSERT_EQUAL(messageBody, message->getBody().get_value_or("")); { - Message::ref message = boost::make_shared(); + Message::ref message = std::make_shared(); message->setType(Message::Groupchat); message->setTo(self_); message->setFrom(mucJID_.withResource("SomeNickname")); message->setID(iqChannel_->getNewIQID()); message->setSubject("New Room Subject"); - controller_->handleIncomingMessage(boost::make_shared(message)); - CPPUNIT_ASSERT_EQUAL(std::string("The room subject is now: New Room Subject"), boost::dynamic_pointer_cast(window_->lastAddedSystemMessage_.getParts()[0])->text); + controller_->handleIncomingMessage(std::make_shared(message)); + CPPUNIT_ASSERT_EQUAL(std::string("The room subject is now: New Room Subject"), std::dynamic_pointer_cast(window_->lastAddedSystemMessage_.getParts()[0])->text); } } @@ -431,14 +431,14 @@ public: void testSubjectChangeIncorrectA() { std::string messageBody("test message"); window_->onSendMessageRequest(messageBody, false); - boost::shared_ptr rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; - Message::ref message = boost::dynamic_pointer_cast(rawStanza); + std::shared_ptr rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; + Message::ref message = std::dynamic_pointer_cast(rawStanza); CPPUNIT_ASSERT(stanzaChannel_->isAvailable()); /* Otherwise will prevent sends. */ CPPUNIT_ASSERT(message); CPPUNIT_ASSERT_EQUAL(messageBody, message->getBody().get_value_or("")); { - Message::ref message = boost::make_shared(); + Message::ref message = std::make_shared(); message->setType(Message::Groupchat); message->setTo(self_); message->setFrom(mucJID_.withResource("SomeNickname")); @@ -446,8 +446,8 @@ public: message->setSubject("New Room Subject"); message->setBody("Some body text that prevents this stanza from being a subject change."); - controller_->handleIncomingMessage(boost::make_shared(message)); - CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), boost::dynamic_pointer_cast(window_->lastAddedSystemMessage_.getParts()[0])->text); + controller_->handleIncomingMessage(std::make_shared(message)); + CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), std::dynamic_pointer_cast(window_->lastAddedSystemMessage_.getParts()[0])->text); } } @@ -457,23 +457,23 @@ public: void testSubjectChangeIncorrectB() { std::string messageBody("test message"); window_->onSendMessageRequest(messageBody, false); - boost::shared_ptr rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; - Message::ref message = boost::dynamic_pointer_cast(rawStanza); + std::shared_ptr rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; + Message::ref message = std::dynamic_pointer_cast(rawStanza); CPPUNIT_ASSERT(stanzaChannel_->isAvailable()); /* Otherwise will prevent sends. */ CPPUNIT_ASSERT(message); CPPUNIT_ASSERT_EQUAL(messageBody, message->getBody().get_value_or("")); { - Message::ref message = boost::make_shared(); + Message::ref message = std::make_shared(); message->setType(Message::Groupchat); message->setTo(self_); message->setFrom(mucJID_.withResource("SomeNickname")); message->setID(iqChannel_->getNewIQID()); message->setSubject("New Room Subject"); - message->addPayload(boost::make_shared("Thread that prevents the subject change.")); + message->addPayload(std::make_shared("Thread that prevents the subject change.")); - controller_->handleIncomingMessage(boost::make_shared(message)); - CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), boost::dynamic_pointer_cast(window_->lastAddedSystemMessage_.getParts()[0])->text); + controller_->handleIncomingMessage(std::make_shared(message)); + CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), std::dynamic_pointer_cast(window_->lastAddedSystemMessage_.getParts()[0])->text); } } @@ -483,14 +483,14 @@ public: void testSubjectChangeIncorrectC() { std::string messageBody("test message"); window_->onSendMessageRequest(messageBody, false); - boost::shared_ptr rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; - Message::ref message = boost::dynamic_pointer_cast(rawStanza); + std::shared_ptr rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1]; + Message::ref message = std::dynamic_pointer_cast(rawStanza); CPPUNIT_ASSERT(stanzaChannel_->isAvailable()); /* Otherwise will prevent sends. */ CPPUNIT_ASSERT(message); CPPUNIT_ASSERT_EQUAL(messageBody, message->getBody().get_value_or("")); { - Message::ref message = boost::make_shared(); + Message::ref message = std::make_shared(); message->setType(Message::Groupchat); message->setTo(self_); message->setFrom(mucJID_.withResource("SomeNickname")); @@ -498,8 +498,8 @@ public: message->setSubject("New Room Subject"); message->setBody(""); - controller_->handleIncomingMessage(boost::make_shared(message)); - CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), boost::dynamic_pointer_cast(window_->lastAddedSystemMessage_.getParts()[0])->text); + controller_->handleIncomingMessage(std::make_shared(message)); + CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), std::dynamic_pointer_cast(window_->lastAddedSystemMessage_.getParts()[0])->text); } } @@ -544,8 +544,8 @@ private: DummyEntityCapsProvider* entityCapsProvider_; DummySettingsProvider* settings_; HighlightManager* highlightManager_; - boost::shared_ptr chatMessageParser_; - boost::shared_ptr crypto_; + std::shared_ptr chatMessageParser_; + std::shared_ptr crypto_; VCardManager* vcardManager_; VCardMemoryStorage* vcardStorage_; ClientBlockListManager* clientBlockListManager_; diff --git a/Swift/Controllers/Chat/UserSearchController.cpp b/Swift/Controllers/Chat/UserSearchController.cpp index c1040f0..305049f 100644 --- a/Swift/Controllers/Chat/UserSearchController.cpp +++ b/Swift/Controllers/Chat/UserSearchController.cpp @@ -6,9 +6,9 @@ #include +#include + #include -#include -#include #include #include @@ -79,23 +79,23 @@ void UserSearchController::setCanInitiateImpromptuMUC(bool supportsImpromptu) { } // Else doesn't support search } -void UserSearchController::handleUIEvent(boost::shared_ptr event) { +void UserSearchController::handleUIEvent(std::shared_ptr event) { bool handle = false; - boost::shared_ptr addUserRequest = boost::shared_ptr(); + std::shared_ptr addUserRequest = std::shared_ptr(); RequestInviteToMUCUIEvent::ref inviteToMUCRequest = RequestInviteToMUCUIEvent::ref(); switch (type_) { case AddContact: - if ((addUserRequest = boost::dynamic_pointer_cast(event))) { + if ((addUserRequest = std::dynamic_pointer_cast(event))) { handle = true; } break; case StartChat: - if (boost::dynamic_pointer_cast(event)) { + if (std::dynamic_pointer_cast(event)) { handle = true; } break; case InviteToChat: - if ((inviteToMUCRequest = boost::dynamic_pointer_cast(event))) { + if ((inviteToMUCRequest = std::dynamic_pointer_cast(event))) { handle = true; } break; @@ -140,7 +140,7 @@ void UserSearchController::endDiscoWalker() { } } -void UserSearchController::handleDiscoServiceFound(const JID& jid, boost::shared_ptr info) { +void UserSearchController::handleDiscoServiceFound(const JID& jid, std::shared_ptr info) { //bool isUserDirectory = false; bool supports55 = false; foreach (DiscoInfo::Identity identity, info->getIdentities()) { @@ -154,13 +154,13 @@ void UserSearchController::handleDiscoServiceFound(const JID& jid, boost::shared if (/*isUserDirectory && */supports55) { //FIXME: once M-Link correctly advertises directoryness. /* Abort further searches.*/ endDiscoWalker(); - boost::shared_ptr > searchRequest(new GenericRequest(IQ::Get, jid, boost::make_shared(), iqRouter_)); + std::shared_ptr > searchRequest(new GenericRequest(IQ::Get, jid, std::make_shared(), iqRouter_)); searchRequest->onResponse.connect(boost::bind(&UserSearchController::handleFormResponse, this, _1, _2)); searchRequest->send(); } } -void UserSearchController::handleFormResponse(boost::shared_ptr fields, ErrorPayload::ref error) { +void UserSearchController::handleFormResponse(std::shared_ptr fields, ErrorPayload::ref error) { if (error || !fields) { window_->setServerSupportsSearch(false); return; @@ -168,14 +168,14 @@ void UserSearchController::handleFormResponse(boost::shared_ptr f window_->setSearchFields(fields); } -void UserSearchController::handleSearch(boost::shared_ptr fields, const JID& jid) { +void UserSearchController::handleSearch(std::shared_ptr fields, const JID& jid) { addToSavedDirectories(jid); - boost::shared_ptr > searchRequest(new GenericRequest(IQ::Set, jid, fields, iqRouter_)); + std::shared_ptr > searchRequest(new GenericRequest(IQ::Set, jid, fields, iqRouter_)); searchRequest->onResponse.connect(boost::bind(&UserSearchController::handleSearchResponse, this, _1, _2)); searchRequest->send(); } -void UserSearchController::handleSearchResponse(boost::shared_ptr resultsPayload, ErrorPayload::ref error) { +void UserSearchController::handleSearchResponse(std::shared_ptr resultsPayload, ErrorPayload::ref error) { if (error || !resultsPayload) { window_->setSearchError(true); return; @@ -290,7 +290,7 @@ void UserSearchController::handleJIDAddRequested(const std::vector& jids) { } Contact::ref UserSearchController::convertJIDtoContact(const JID& jid) { - Contact::ref contact = boost::make_shared(); + Contact::ref contact = std::make_shared(); contact->jid = jid; // name lookup diff --git a/Swift/Controllers/Chat/UserSearchController.h b/Swift/Controllers/Chat/UserSearchController.h index 71b8331..1c2f40a 100644 --- a/Swift/Controllers/Chat/UserSearchController.h +++ b/Swift/Controllers/Chat/UserSearchController.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -7,11 +7,10 @@ #pragma once #include +#include #include #include -#include - #include #include #include @@ -57,13 +56,13 @@ namespace Swift { void setCanInitiateImpromptuMUC(bool supportsImpromptu); private: - void handleUIEvent(boost::shared_ptr event); + void handleUIEvent(std::shared_ptr event); void handleFormRequested(const JID& service); - void handleDiscoServiceFound(const JID& jid, boost::shared_ptr info); + void handleDiscoServiceFound(const JID& jid, std::shared_ptr info); void handleDiscoWalkFinished(); - void handleFormResponse(boost::shared_ptr items, ErrorPayload::ref error); - void handleSearch(boost::shared_ptr fields, const JID& jid); - void handleSearchResponse(boost::shared_ptr results, ErrorPayload::ref error); + void handleFormResponse(std::shared_ptr items, ErrorPayload::ref error); + void handleSearch(std::shared_ptr fields, const JID& jid); + void handleSearchResponse(std::shared_ptr results, ErrorPayload::ref error); void handleNameSuggestionRequest(const JID& jid); void handleContactSuggestionsRequested(std::string text); void handleVCardChanged(const JID& jid, VCard::ref vcard); diff --git a/Swift/Controllers/Contact.h b/Swift/Controllers/Contact.h index 4aa6999..47dda43 100644 --- a/Swift/Controllers/Contact.h +++ b/Swift/Controllers/Contact.h @@ -5,14 +5,15 @@ */ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include + #include #include @@ -20,9 +21,9 @@ namespace Swift { -class Contact : public boost::enable_shared_from_this { +class Contact : public std::enable_shared_from_this { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; Contact(); Contact(const std::string& name, const JID& jid, StatusShow::Type statusType, const boost::filesystem::path& path); diff --git a/Swift/Controllers/ContactEditController.cpp b/Swift/Controllers/ContactEditController.cpp index d3106ed..2ea1f7e 100644 --- a/Swift/Controllers/ContactEditController.cpp +++ b/Swift/Controllers/ContactEditController.cpp @@ -6,9 +6,10 @@ #include +#include + #include #include -#include #include @@ -35,7 +36,7 @@ ContactEditController::~ContactEditController() { } void ContactEditController::handleUIEvent(UIEvent::ref event) { - RequestContactEditorUIEvent::ref editEvent = boost::dynamic_pointer_cast(event); + RequestContactEditorUIEvent::ref editEvent = std::dynamic_pointer_cast(event); if (!editEvent) { return; } @@ -90,7 +91,7 @@ std::vector ContactEditController::nameSuggestionsFromVCard(VCard:: void ContactEditController::handleRemoveContactRequest() { assert(currentContact); - uiEventStream->send(boost::make_shared(currentContact->getJID())); + uiEventStream->send(std::make_shared(currentContact->getJID())); contactEditWindow->hide(); } diff --git a/Swift/Controllers/ContactsFromXMPPRoster.cpp b/Swift/Controllers/ContactsFromXMPPRoster.cpp index 1aa4424..e3c5d97 100644 --- a/Swift/Controllers/ContactsFromXMPPRoster.cpp +++ b/Swift/Controllers/ContactsFromXMPPRoster.cpp @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2014-2015 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -30,7 +30,7 @@ std::vector ContactsFromXMPPRoster::getContacts(bool /*withMUCNick std::vector results; std::vector rosterItems = roster_->getItems(); foreach(const XMPPRosterItem& rosterItem, rosterItems) { - Contact::ref contact = boost::make_shared(rosterItem.getName().empty() ? rosterItem.getJID().toString() : rosterItem.getName(), rosterItem.getJID(), StatusShow::None,""); + Contact::ref contact = std::make_shared(rosterItem.getName().empty() ? rosterItem.getJID().toString() : rosterItem.getName(), rosterItem.getJID(), StatusShow::None,""); contact->statusType = presenceOracle_->getAccountPresence(contact->jid) ? presenceOracle_->getAccountPresence(contact->jid)->getShow() : StatusShow::None; contact->avatarPath = avatarManager_->getAvatarPath(contact->jid); results.push_back(contact); diff --git a/Swift/Controllers/EventNotifier.cpp b/Swift/Controllers/EventNotifier.cpp index f4a9c2f..6ea2ea5 100644 --- a/Swift/Controllers/EventNotifier.cpp +++ b/Swift/Controllers/EventNotifier.cpp @@ -36,11 +36,11 @@ EventNotifier::~EventNotifier() { eventController->onEventQueueEventAdded.disconnect(boost::bind(&EventNotifier::handleEventAdded, this, _1)); } -void EventNotifier::handleEventAdded(boost::shared_ptr event) { +void EventNotifier::handleEventAdded(std::shared_ptr event) { if (event->getConcluded()) { return; } - if (boost::shared_ptr messageEvent = boost::dynamic_pointer_cast(event)) { + if (std::shared_ptr messageEvent = std::dynamic_pointer_cast(event)) { JID jid = messageEvent->getStanza()->getFrom(); std::string title = nickResolver->jidToNick(jid); if (!messageEvent->getStanza()->isError() && !messageEvent->getStanza()->getBody().get_value_or("").empty()) { @@ -55,16 +55,16 @@ void EventNotifier::handleEventAdded(boost::shared_ptr event) { notifier->showMessage(Notifier::IncomingMessage, title, messageText, avatarManager->getAvatarPath(jid), boost::bind(&EventNotifier::handleNotificationActivated, this, activationJID)); } } - else if(boost::shared_ptr subscriptionEvent = boost::dynamic_pointer_cast(event)) { + else if(std::shared_ptr subscriptionEvent = std::dynamic_pointer_cast(event)) { JID jid = subscriptionEvent->getJID(); std::string title = jid; std::string message = str(format(QT_TRANSLATE_NOOP("", "%1% wants to add you to his/her contact list")) % nickResolver->jidToNick(jid)); notifier->showMessage(Notifier::SystemMessage, title, message, boost::filesystem::path(), boost::function()); } - else if(boost::shared_ptr errorEvent = boost::dynamic_pointer_cast(event)) { + else if(std::shared_ptr errorEvent = std::dynamic_pointer_cast(event)) { notifier->showMessage(Notifier::SystemMessage, QT_TRANSLATE_NOOP("", "Error"), errorEvent->getText(), boost::filesystem::path(), boost::function()); } - else if (boost::shared_ptr mucInviteEvent = boost::dynamic_pointer_cast(event)) { + else if (std::shared_ptr mucInviteEvent = std::dynamic_pointer_cast(event)) { std::string title = mucInviteEvent->getInviter(); std::string message = str(format(QT_TRANSLATE_NOOP("", "%1% has invited you to enter the %2% room")) % nickResolver->jidToNick(mucInviteEvent->getInviter()) % mucInviteEvent->getRoomJID()); // FIXME: not show avatar or greyed out avatar for mediated invites diff --git a/Swift/Controllers/EventNotifier.h b/Swift/Controllers/EventNotifier.h index 4661c46..e9c1466 100644 --- a/Swift/Controllers/EventNotifier.h +++ b/Swift/Controllers/EventNotifier.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -32,7 +32,7 @@ namespace Swift { boost::signal onNotificationActivated; private: - void handleEventAdded(boost::shared_ptr); + void handleEventAdded(std::shared_ptr); void handleNotificationActivated(JID jid); private: diff --git a/Swift/Controllers/EventWindowController.cpp b/Swift/Controllers/EventWindowController.cpp index 2739a87..412bb71 100644 --- a/Swift/Controllers/EventWindowController.cpp +++ b/Swift/Controllers/EventWindowController.cpp @@ -26,11 +26,11 @@ EventWindowController::~EventWindowController() { } } -void EventWindowController::handleEventQueueEventAdded(boost::shared_ptr event) { +void EventWindowController::handleEventQueueEventAdded(std::shared_ptr event) { if (event->getConcluded()) { handleEventConcluded(event); } else { - boost::shared_ptr message = boost::dynamic_pointer_cast(event); + std::shared_ptr message = std::dynamic_pointer_cast(event); if (!(message && message->isReadable())) { event->onConclusion.connect(boost::bind(&EventWindowController::handleEventConcluded, this, event)); window_->addEvent(event, true); @@ -38,11 +38,11 @@ void EventWindowController::handleEventQueueEventAdded(boost::shared_ptr event) { +void EventWindowController::handleEventConcluded(std::shared_ptr event) { window_->removeEvent(event); bool includeAsCompleted = true; /* Because subscription requests get duplicated, don't add them back */ - if (boost::dynamic_pointer_cast(event) || boost::dynamic_pointer_cast(event)) { + if (std::dynamic_pointer_cast(event) || std::dynamic_pointer_cast(event)) { includeAsCompleted = false; } if (includeAsCompleted) { diff --git a/Swift/Controllers/EventWindowController.h b/Swift/Controllers/EventWindowController.h index eba07ca..7db7c25 100644 --- a/Swift/Controllers/EventWindowController.h +++ b/Swift/Controllers/EventWindowController.h @@ -17,8 +17,8 @@ namespace Swift { EventWindowController(EventController* eventController, EventWindowFactory* windowFactory); ~EventWindowController(); private: - void handleEventQueueEventAdded(boost::shared_ptr event); - void handleEventConcluded(boost::shared_ptr event); + void handleEventQueueEventAdded(std::shared_ptr event); + void handleEventConcluded(std::shared_ptr event); EventController* eventController_; EventWindowFactory* windowFactory_; diff --git a/Swift/Controllers/FileTransfer/FileTransferController.cpp b/Swift/Controllers/FileTransfer/FileTransferController.cpp index c005705..dd4e95c 100644 --- a/Swift/Controllers/FileTransfer/FileTransferController.cpp +++ b/Swift/Controllers/FileTransfer/FileTransferController.cpp @@ -12,9 +12,10 @@ #include +#include + #include #include -#include #include #include @@ -82,7 +83,7 @@ boost::uintmax_t FileTransferController::getSize() const { void FileTransferController::start(std::string& description) { SWIFT_LOG(debug) << "FileTransferController::start" << std::endl; - fileReadStream = boost::make_shared(boost::filesystem::path(filename)); + fileReadStream = std::make_shared(boost::filesystem::path(filename)); OutgoingFileTransfer::ref outgoingTransfer = ftManager->createOutgoingFileTransfer(otherParty, boost::filesystem::path(filename), description, fileReadStream); if (outgoingTransfer) { ftProgressInfo = new FileTransferProgressInfo(outgoingTransfer->getFileSizeInBytes()); @@ -98,9 +99,9 @@ void FileTransferController::start(std::string& description) { void FileTransferController::accept(std::string& file) { SWIFT_LOG(debug) << "FileTransferController::accept" << std::endl; - IncomingFileTransfer::ref incomingTransfer = boost::dynamic_pointer_cast(transfer); + IncomingFileTransfer::ref incomingTransfer = std::dynamic_pointer_cast(transfer); if (incomingTransfer) { - fileWriteStream = boost::make_shared(boost::filesystem::path(file)); + fileWriteStream = std::make_shared(boost::filesystem::path(file)); ftProgressInfo = new FileTransferProgressInfo(transfer->getFileSizeInBytes()); ftProgressInfo->onProgressPercentage.connect(boost::bind(&FileTransferController::handleProgressPercentageChange, this, _1)); diff --git a/Swift/Controllers/FileTransfer/FileTransferController.h b/Swift/Controllers/FileTransfer/FileTransferController.h index a25abee..01d65e7 100644 --- a/Swift/Controllers/FileTransfer/FileTransferController.h +++ b/Swift/Controllers/FileTransfer/FileTransferController.h @@ -5,17 +5,17 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include #include #include -#include #include #include @@ -68,8 +68,8 @@ private: JID otherParty; std::string filename; FileTransfer::ref transfer; - boost::shared_ptr fileReadStream; - boost::shared_ptr fileWriteStream; + std::shared_ptr fileReadStream; + std::shared_ptr fileWriteStream; FileTransferManager* ftManager; FileTransferProgressInfo* ftProgressInfo; ChatWindow* chatWindow; diff --git a/Swift/Controllers/FileTransferListController.cpp b/Swift/Controllers/FileTransferListController.cpp index 8400e52..4f85b81 100644 --- a/Swift/Controllers/FileTransferListController.cpp +++ b/Swift/Controllers/FileTransferListController.cpp @@ -34,8 +34,8 @@ void FileTransferListController::setFileTransferOverview(FileTransferOverview *o } } -void FileTransferListController::handleUIEvent(boost::shared_ptr rawEvent) { - boost::shared_ptr event = boost::dynamic_pointer_cast(rawEvent); +void FileTransferListController::handleUIEvent(std::shared_ptr rawEvent) { + std::shared_ptr event = std::dynamic_pointer_cast(rawEvent); if (event != nullptr) { if (fileTransferListWidget == nullptr) { fileTransferListWidget = fileTransferListWidgetFactory->createFileTransferListWidget(); diff --git a/Swift/Controllers/FileTransferListController.h b/Swift/Controllers/FileTransferListController.h index df79d1f..832a99c 100644 --- a/Swift/Controllers/FileTransferListController.h +++ b/Swift/Controllers/FileTransferListController.h @@ -12,7 +12,7 @@ #pragma once -#include +#include #include @@ -30,7 +30,7 @@ public: void setFileTransferOverview(FileTransferOverview* overview); private: - void handleUIEvent(boost::shared_ptr event); + void handleUIEvent(std::shared_ptr event); private: FileTransferListWidgetFactory* fileTransferListWidgetFactory; diff --git a/Swift/Controllers/HighlightEditorController.cpp b/Swift/Controllers/HighlightEditorController.cpp index 2c71e1d..1f5f928 100644 --- a/Swift/Controllers/HighlightEditorController.cpp +++ b/Swift/Controllers/HighlightEditorController.cpp @@ -34,9 +34,9 @@ HighlightEditorController::~HighlightEditorController() highlightEditorWindow_ = nullptr; } -void HighlightEditorController::handleUIEvent(boost::shared_ptr rawEvent) +void HighlightEditorController::handleUIEvent(std::shared_ptr rawEvent) { - boost::shared_ptr event = boost::dynamic_pointer_cast(rawEvent); + std::shared_ptr event = std::dynamic_pointer_cast(rawEvent); if (event) { if (!highlightEditorWindow_) { highlightEditorWindow_ = highlightEditorWindowFactory_->createHighlightEditorWindow(); diff --git a/Swift/Controllers/HighlightEditorController.h b/Swift/Controllers/HighlightEditorController.h index 24ad9c2..a699751 100644 --- a/Swift/Controllers/HighlightEditorController.h +++ b/Swift/Controllers/HighlightEditorController.h @@ -5,14 +5,15 @@ */ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include +#include #include @@ -35,7 +36,7 @@ namespace Swift { void setContactSuggester(ContactSuggester *suggester) { contactSuggester_ = suggester; } private: - void handleUIEvent(boost::shared_ptr event); + void handleUIEvent(std::shared_ptr event); void handleContactSuggestionsRequested(const std::string& text); private: diff --git a/Swift/Controllers/HighlightManager.cpp b/Swift/Controllers/HighlightManager.cpp index 45b800a..426afc1 100644 --- a/Swift/Controllers/HighlightManager.cpp +++ b/Swift/Controllers/HighlightManager.cpp @@ -50,7 +50,7 @@ namespace Swift { HighlightManager::HighlightManager(SettingsProvider* settings) : settings_(settings) , storingSettings_(false) { - rules_ = boost::make_shared(); + rules_ = std::make_shared(); loadSettings(); handleSettingChangedConnection_ = settings_->onSettingChanged.connect(boost::bind(&HighlightManager::handleSettingChanged, this, _1)); } diff --git a/Swift/Controllers/HighlightManager.h b/Swift/Controllers/HighlightManager.h index 1d2eb8a..25503a7 100644 --- a/Swift/Controllers/HighlightManager.h +++ b/Swift/Controllers/HighlightManager.h @@ -47,7 +47,7 @@ namespace Swift { Highlighter* createHighlighter(); - boost::shared_ptr getRules() const { return rules_; } + std::shared_ptr getRules() const { return rules_; } bool isDefaultRulesList() const; void resetToDefaultRulesList(); @@ -72,10 +72,10 @@ namespace Swift { SettingsProvider* settings_; bool storingSettings_; - boost::shared_ptr rules_; + std::shared_ptr rules_; boost::bsignals::scoped_connection handleSettingChangedConnection_; }; - typedef boost::shared_ptr HighlightRulesListPtr; + typedef std::shared_ptr HighlightRulesListPtr; } diff --git a/Swift/Controllers/HistoryViewController.cpp b/Swift/Controllers/HistoryViewController.cpp index 827d7d6..d66b2b2 100644 --- a/Swift/Controllers/HistoryViewController.cpp +++ b/Swift/Controllers/HistoryViewController.cpp @@ -70,8 +70,8 @@ HistoryViewController::~HistoryViewController() { delete roster_; } -void HistoryViewController::handleUIEvent(boost::shared_ptr rawEvent) { - boost::shared_ptr event = boost::dynamic_pointer_cast(rawEvent); +void HistoryViewController::handleUIEvent(std::shared_ptr rawEvent) { + std::shared_ptr event = std::dynamic_pointer_cast(rawEvent); if (event != nullptr) { if (historyWindow_ == nullptr) { historyWindow_ = historyWindowFactory_->createHistoryWindow(uiEventStream_); @@ -320,7 +320,7 @@ void HistoryViewController::handlePresenceChanged(Presence::ref presence) { } if (contacts_[HistoryMessage::Groupchat].count(jid.toBare())) { - Presence::ref availablePresence = boost::make_shared(Presence()); + Presence::ref availablePresence = std::make_shared(Presence()); availablePresence->setFrom(jid.toBare()); roster_->applyOnItems(SetPresence(availablePresence, JID::WithResource)); } @@ -342,7 +342,7 @@ Presence::ref HistoryViewController::getPresence(const JID& jid, bool isMUC) { std::vector mucPresence = presenceOracle_->getAllPresence(jid.toBare()); if (isMUC && !mucPresence.empty()) { - Presence::ref presence = boost::make_shared(Presence()); + Presence::ref presence = std::make_shared(Presence()); presence->setFrom(jid); return presence; } diff --git a/Swift/Controllers/HistoryViewController.h b/Swift/Controllers/HistoryViewController.h index 463ee06..0ba681c 100644 --- a/Swift/Controllers/HistoryViewController.h +++ b/Swift/Controllers/HistoryViewController.h @@ -12,10 +12,10 @@ #pragma once +#include #include #include -#include #include #include @@ -40,7 +40,7 @@ namespace Swift { ~HistoryViewController(); private: - void handleUIEvent(boost::shared_ptr event); + void handleUIEvent(std::shared_ptr event); void handleSelectedContactChanged(RosterItem* item); void handleNewMessage(const HistoryMessage& message); void handleReturnPressed(const std::string& keyword); diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index e8cd012..eebac37 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -10,8 +10,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -328,7 +328,7 @@ void MainController::resetPendingReconnects() { void MainController::resetCurrentError() { if (lastDisconnectError_) { lastDisconnectError_->conclude(); - lastDisconnectError_ = boost::shared_ptr(); + lastDisconnectError_ = std::shared_ptr(); } } @@ -447,7 +447,7 @@ void MainController::reconnectAfterError() { } void MainController::handleChangeStatusRequest(StatusShow::Type show, const std::string &statusText) { - boost::shared_ptr presence(new Presence()); + std::shared_ptr presence(new Presence()); if (show == StatusShow::None) { // Note: this is misleading, None doesn't mean unavailable on the wire. presence->setType(Presence::Unavailable); @@ -472,14 +472,14 @@ void MainController::handleChangeStatusRequest(StatusShow::Type show, const std: } } -void MainController::sendPresence(boost::shared_ptr presence) { +void MainController::sendPresence(std::shared_ptr presence) { rosterController_->getWindow()->setMyStatusType(presence->getShow()); rosterController_->getWindow()->setMyStatusText(presence->getStatus()); systemTrayController_->setMyStatusType(presence->getShow()); notifier_->setTemporarilyDisabled(presence->getShow() == StatusShow::DND); // Add information and send - presence->updatePayload(boost::make_shared(vCardPhotoHash_)); + presence->updatePayload(std::make_shared(vCardPhotoHash_)); client_->getPresenceSender()->sendPresence(presence); if (presence->getType() == Presence::Unavailable) { logout(); @@ -533,7 +533,7 @@ void MainController::handleLoginRequest(const std::string &username, const std:: std::string userName; std::string clientName; std::string serverName; - boost::shared_ptr errorCode = getUserNameEx(userName, clientName, serverName); + std::shared_ptr errorCode = getUserNameEx(userName, clientName, serverName); if (!errorCode) { /* Create JID using the Windows logon name and user provided domain name */ @@ -593,7 +593,7 @@ void MainController::performLoginFromCachedCredentials() { certificateStorage_ = certificateStorageFactory_->createCertificateStorage(jid_.toBare()); certificateTrustChecker_ = new CertificateStorageTrustChecker(certificateStorage_); - client_ = boost::make_shared(clientJID, createSafeByteArray(password_.c_str()), networkFactories_, storages_); + client_ = std::make_shared(clientJID, createSafeByteArray(password_.c_str()), networkFactories_, storages_); clientInitialized_ = true; client_->setCertificateTrustChecker(certificateTrustChecker_); client_->onDataRead.connect(boost::bind(&XMLConsoleController::handleDataRead, xmlConsoleController_, _1)); @@ -611,7 +611,7 @@ void MainController::performLoginFromCachedCredentials() { if (certificate_) { client_->setCertificate(certificate_); } - boost::shared_ptr presence(new Presence()); + std::shared_ptr presence(new Presence()); presence->setShow(static_cast(profileSettings_->getIntSetting("lastShow", StatusShow::Online))); presence->setStatus(profileSettings_->getStringSetting("lastStatus")); statusTracker_->setRequestedPresence(presence); @@ -725,7 +725,7 @@ void MainController::handleDisconnected(const boost::optional& erro } else { message = str(format(QT_TRANSLATE_NOOP("", "Disconnected from %1%: %2%.")) % jid_.getDomain() % message); } - lastDisconnectError_ = boost::make_shared(JID(jid_.getDomain()), message); + lastDisconnectError_ = std::make_shared(JID(jid_.getDomain()), message); eventController_->handleIncomingEvent(lastDisconnectError_); } } @@ -794,7 +794,7 @@ void MainController::setManagersOffline() { } } -void MainController::handleServerDiscoInfoResponse(boost::shared_ptr info, ErrorPayload::ref error) { +void MainController::handleServerDiscoInfoResponse(std::shared_ptr info, ErrorPayload::ref error) { if (!error) { chatsManager_->setServerDiscoInfo(info); adHocManager_->setServerDiscoInfo(info); @@ -825,10 +825,10 @@ void MainController::handleNotificationClicked(const JID& jid) { assert(chatsManager_); if (clientInitialized_) { if (client_->getMUCRegistry()->isMUC(jid)) { - uiEventStream_->send(boost::make_shared(jid)); + uiEventStream_->send(std::make_shared(jid)); } else { - uiEventStream_->send(boost::shared_ptr(new RequestChatUIEvent(jid))); + uiEventStream_->send(std::make_shared(jid)); } } } diff --git a/Swift/Controllers/MainController.h b/Swift/Controllers/MainController.h index ed7765a..b5c8d79 100644 --- a/Swift/Controllers/MainController.h +++ b/Swift/Controllers/MainController.h @@ -7,11 +7,10 @@ #pragma once #include +#include #include #include -#include - #include #include #include @@ -109,12 +108,12 @@ namespace Swift { void handleQuitRequest(); void handleChangeStatusRequest(StatusShow::Type show, const std::string &statusText); void handleDisconnected(const boost::optional& error); - void handleServerDiscoInfoResponse(boost::shared_ptr, ErrorPayload::ref); + void handleServerDiscoInfoResponse(std::shared_ptr, ErrorPayload::ref); void handleEventQueueLengthChange(int count); void handleVCardReceived(const JID& j, VCard::ref vCard); void handleSettingChanged(const std::string& settingPath); void handlePurgeSavedLoginRequest(const std::string& username); - void sendPresence(boost::shared_ptr presence); + void sendPresence(std::shared_ptr presence); void handleInputIdleChanged(bool); void handleShowCertificateRequest(); void logout(); @@ -142,7 +141,7 @@ namespace Swift { CertificateStorage* certificateStorage_; CertificateStorageTrustChecker* certificateTrustChecker_; bool clientInitialized_; - boost::shared_ptr client_; + std::shared_ptr client_; SettingsProvider *settings_; ProfileSettingsProvider* profileSettings_; Dock* dock_; @@ -178,7 +177,7 @@ namespace Swift { std::string password_; CertificateWithKey::ref certificate_; ClientOptions clientOptions_; - boost::shared_ptr lastDisconnectError_; + std::shared_ptr lastDisconnectError_; bool useDelayForLatency_; UserSearchController* userSearchControllerChat_; UserSearchController* userSearchControllerAdd_; diff --git a/Swift/Controllers/PresenceNotifier.cpp b/Swift/Controllers/PresenceNotifier.cpp index c000107..91deae6 100644 --- a/Swift/Controllers/PresenceNotifier.cpp +++ b/Swift/Controllers/PresenceNotifier.cpp @@ -38,7 +38,7 @@ PresenceNotifier::~PresenceNotifier() { stanzaChannel->onPresenceReceived.disconnect(boost::bind(&PresenceNotifier::handlePresenceReceived, this, _1)); } -void PresenceNotifier::handlePresenceReceived(boost::shared_ptr presence) { +void PresenceNotifier::handlePresenceReceived(std::shared_ptr presence) { JID from = presence->getFrom(); if (mucRegistry->isMUC(from.toBare())) { diff --git a/Swift/Controllers/PresenceNotifier.h b/Swift/Controllers/PresenceNotifier.h index 3d498bd..defdd2f 100644 --- a/Swift/Controllers/PresenceNotifier.h +++ b/Swift/Controllers/PresenceNotifier.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -35,7 +34,7 @@ namespace Swift { boost::signal onNotificationActivated; private: - void handlePresenceReceived(boost::shared_ptr); + void handlePresenceReceived(std::shared_ptr); void handleStanzaChannelAvailableChanged(bool); void handleNotificationActivated(JID jid); void handleTimerTick(); @@ -53,7 +52,7 @@ namespace Swift { NickResolver* nickResolver; const PresenceOracle* presenceOracle; TimerFactory* timerFactory; - boost::shared_ptr timer; + std::shared_ptr timer; bool justInitialized; bool inQuietPeriod; std::set availableUsers; diff --git a/Swift/Controllers/ProfileController.cpp b/Swift/Controllers/ProfileController.cpp index 48a4c93..d000164 100644 --- a/Swift/Controllers/ProfileController.cpp +++ b/Swift/Controllers/ProfileController.cpp @@ -33,7 +33,7 @@ ProfileController::~ProfileController() { } void ProfileController::handleUIEvent(UIEvent::ref event) { - if (!boost::dynamic_pointer_cast(event)) { + if (!std::dynamic_pointer_cast(event)) { return; } @@ -77,7 +77,7 @@ void ProfileController::handleVCardRetrievalError(const JID& jid, ErrorPayload:: if ((jid == JID()) && profileWindow) { profileWindow->setProcessing(false); profileWindow->setEnabled(false); - profileWindow->setVCard(boost::make_shared()); + profileWindow->setVCard(std::make_shared()); profileWindow->setError(QT_TRANSLATE_NOOP("", "There was an error fetching your current profile data")); } } diff --git a/Swift/Controllers/Roster/ContactRosterItem.cpp b/Swift/Controllers/Roster/ContactRosterItem.cpp index 89053e6..0ad023a 100644 --- a/Swift/Controllers/Roster/ContactRosterItem.cpp +++ b/Swift/Controllers/Roster/ContactRosterItem.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -87,14 +87,14 @@ const JID& ContactRosterItem::getDisplayJID() const { } -typedef std::pair > StringPresencePair; +typedef std::pair > StringPresencePair; void ContactRosterItem::clearPresence() { presence_.reset(); onDataChanged(); } -void ContactRosterItem::applyPresence(boost::shared_ptr presence) { +void ContactRosterItem::applyPresence(std::shared_ptr presence) { presence_ = presence; onDataChanged(); } diff --git a/Swift/Controllers/Roster/ContactRosterItem.h b/Swift/Controllers/Roster/ContactRosterItem.h index d77ba2d..5cc722e 100644 --- a/Swift/Controllers/Roster/ContactRosterItem.h +++ b/Swift/Controllers/Roster/ContactRosterItem.h @@ -1,11 +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 #include #include #include @@ -13,7 +14,6 @@ #include #include #include -#include #include #include @@ -55,7 +55,7 @@ class ContactRosterItem : public RosterItem { const JID& getJID() const; void setDisplayJID(const JID& jid); const JID& getDisplayJID() const; - void applyPresence(boost::shared_ptr presence); + void applyPresence(std::shared_ptr presence); const std::vector& getGroups() const; /** Only used so a contact can know about the groups it's in*/ void addGroup(const std::string& group); @@ -84,7 +84,7 @@ class ContactRosterItem : public RosterItem { JID displayJID_; boost::posix_time::ptime lastAvailableTime_; boost::filesystem::path avatarPath_; - boost::shared_ptr presence_; + std::shared_ptr presence_; std::vector groups_; MUCOccupant::Role mucRole_; MUCOccupant::Affiliation mucAffiliation_; diff --git a/Swift/Controllers/Roster/Roster.h b/Swift/Controllers/Roster/Roster.h index 70e5bab..3bd9ec0 100644 --- a/Swift/Controllers/Roster/Roster.h +++ b/Swift/Controllers/Roster/Roster.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -7,12 +7,11 @@ #pragma once #include +#include #include #include #include -#include - #include #include diff --git a/Swift/Controllers/Roster/RosterController.cpp b/Swift/Controllers/Roster/RosterController.cpp index f863ed7..47c24fc 100644 --- a/Swift/Controllers/Roster/RosterController.cpp +++ b/Swift/Controllers/Roster/RosterController.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -96,7 +97,7 @@ RosterController::RosterController(const JID& jid, XMPPRoster* xmppRoster, Avata handleShowOfflineToggled(settings_->getSetting(SettingConstants::SHOW_OFFLINE)); - ownContact_ = boost::make_shared(myJID_.toBare(), myJID_.toBare(), nickManager_->getOwnNick(), static_cast(nullptr)); + ownContact_ = std::make_shared(myJID_.toBare(), myJID_.toBare(), nickManager_->getOwnNick(), static_cast(nullptr)); ownContact_->setVCard(vcardManager_->getVCard(myJID_.toBare())); ownContact_->setAvatarPath(pathToString(avatarManager_->getAvatarPath(myJID_.toBare()))); mainWindow_->setMyContactRosterItem(ownContact_); @@ -216,39 +217,39 @@ void RosterController::handleBlockingItemRemoved(const JID& jid) { roster_->applyOnItems(SetBlockingState(jid, ContactRosterItem::IsUnblocked)); } -void RosterController::handleUIEvent(boost::shared_ptr event) { - if (boost::shared_ptr addContactEvent = boost::dynamic_pointer_cast(event)) { +void RosterController::handleUIEvent(std::shared_ptr event) { + if (std::shared_ptr addContactEvent = std::dynamic_pointer_cast(event)) { RosterItemPayload item; item.setName(addContactEvent->getName()); item.setJID(addContactEvent->getJID()); item.setGroups(std::vector(addContactEvent->getGroups().begin(), addContactEvent->getGroups().end())); - boost::shared_ptr roster(new RosterPayload()); + std::shared_ptr roster(new RosterPayload()); roster->addItem(item); SetRosterRequest::ref request = SetRosterRequest::create(roster, iqRouter_); request->onResponse.connect(boost::bind(&RosterController::handleRosterSetError, this, _1, roster)); request->send(); subscriptionManager_->requestSubscription(addContactEvent->getJID()); } - else if (boost::shared_ptr removeEvent = boost::dynamic_pointer_cast(event)) { + else if (std::shared_ptr removeEvent = std::dynamic_pointer_cast(event)) { RosterItemPayload item(removeEvent->getJID(), "", RosterItemPayload::Remove); - boost::shared_ptr roster(new RosterPayload()); + std::shared_ptr roster(new RosterPayload()); roster->addItem(item); SetRosterRequest::ref request = SetRosterRequest::create(roster, iqRouter_); request->onResponse.connect(boost::bind(&RosterController::handleRosterSetError, this, _1, roster)); request->send(); } - else if (boost::shared_ptr renameEvent = boost::dynamic_pointer_cast(event)) { + else if (std::shared_ptr renameEvent = std::dynamic_pointer_cast(event)) { JID contact(renameEvent->getJID()); RosterItemPayload item(contact, renameEvent->getNewName(), xmppRoster_->getSubscriptionStateForJID(contact)); item.setGroups(xmppRoster_->getGroupsForJID(contact)); - boost::shared_ptr roster(new RosterPayload()); + std::shared_ptr roster(new RosterPayload()); roster->addItem(item); SetRosterRequest::ref request = SetRosterRequest::create(roster, iqRouter_); request->onResponse.connect(boost::bind(&RosterController::handleRosterSetError, this, _1, roster)); request->send(); } - else if (boost::shared_ptr renameGroupEvent = boost::dynamic_pointer_cast(event)) { + else if (std::shared_ptr renameGroupEvent = std::dynamic_pointer_cast(event)) { std::vector items = xmppRoster_->getItems(); std::string group = renameGroupEvent->getGroup(); // FIXME: We should handle contacts groups specially to avoid clashes @@ -267,7 +268,7 @@ void RosterController::handleUIEvent(boost::shared_ptr event) { } } } - else if (boost::shared_ptr sendFileEvent = boost::dynamic_pointer_cast(event)) { + else if (std::shared_ptr sendFileEvent = std::dynamic_pointer_cast(event)) { //TODO add send file dialog to ChatView of receipient jid ftOverview_->sendFile(sendFileEvent->getJID(), sendFileEvent->getFilename()); } @@ -281,7 +282,7 @@ void RosterController::updateItem(const XMPPRosterItem& item) { RosterItemPayload itemPayload(item.getJID(), item.getName(), item.getSubscription()); itemPayload.setGroups(item.getGroups()); - RosterPayload::ref roster = boost::make_shared(); + RosterPayload::ref roster = std::make_shared(); roster->addItem(itemPayload); SetRosterRequest::ref request = SetRosterRequest::create(roster, iqRouter_); @@ -290,7 +291,7 @@ void RosterController::updateItem(const XMPPRosterItem& item) { } void RosterController::initBlockingCommand() { - boost::shared_ptr blockList = clientBlockListManager_->requestBlockList(); + std::shared_ptr blockList = clientBlockListManager_->requestBlockList(); blockingOnStateChangedConnection_ = blockList->onStateChanged.connect(boost::bind(&RosterController::handleBlockingStateChanged, this)); blockingOnItemAddedConnection_ = blockList->onItemAdded.connect(boost::bind(&RosterController::handleBlockingItemAdded, this, _1)); @@ -303,11 +304,11 @@ void RosterController::initBlockingCommand() { } } -void RosterController::handleRosterItemUpdated(ErrorPayload::ref error, boost::shared_ptr rosterPayload) { +void RosterController::handleRosterItemUpdated(ErrorPayload::ref error, std::shared_ptr rosterPayload) { if (!!error) { handleRosterSetError(error, rosterPayload); } - boost::shared_ptr blockList = clientBlockListManager_->getBlockList(); + std::shared_ptr blockList = clientBlockListManager_->getBlockList(); std::vector items = rosterPayload->getItems(); if (blockList->getState() == BlockList::Available && items.size() > 0) { std::vector jids = blockList->getItems(); @@ -317,7 +318,7 @@ void RosterController::handleRosterItemUpdated(ErrorPayload::ref error, boost::s } } -void RosterController::handleRosterSetError(ErrorPayload::ref error, boost::shared_ptr rosterPayload) { +void RosterController::handleRosterSetError(ErrorPayload::ref error, std::shared_ptr rosterPayload) { if (!error) { return; } @@ -325,7 +326,7 @@ void RosterController::handleRosterSetError(ErrorPayload::ref error, boost::shar if (!error->getText().empty()) { text += ": " + error->getText(); } - boost::shared_ptr errorEvent(new ErrorEvent(JID(myJID_.getDomain()), text)); + std::shared_ptr errorEvent(new ErrorEvent(JID(myJID_.getDomain()), text)); eventController_->handleIncomingEvent(errorEvent); } @@ -350,7 +351,7 @@ void RosterController::handleSubscriptionRequest(const JID& jid, const std::stri SubscriptionRequestEvent* eventPointer = new SubscriptionRequestEvent(jid, message); eventPointer->onAccept.connect(boost::bind(&RosterController::handleSubscriptionRequestAccepted, this, eventPointer)); eventPointer->onDecline.connect(boost::bind(&RosterController::handleSubscriptionRequestDeclined, this, eventPointer)); - boost::shared_ptr event(eventPointer); + std::shared_ptr event(eventPointer); eventController_->handleIncomingEvent(event); } diff --git a/Swift/Controllers/Roster/RosterController.h b/Swift/Controllers/Roster/RosterController.h index f1660a8..333a0a5 100644 --- a/Swift/Controllers/Roster/RosterController.h +++ b/Swift/Controllers/Roster/RosterController.h @@ -1,16 +1,15 @@ /* - * 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 #include #include -#include - #include #include #include @@ -77,13 +76,13 @@ namespace Swift { void handleStartChatRequest(const JID& contact); void handleChangeStatusRequest(StatusShow::Type show, const std::string &statusText); void handleShowOfflineToggled(bool state); - void handleIncomingPresence(boost::shared_ptr newPresence); + void handleIncomingPresence(std::shared_ptr newPresence); void handleSubscriptionRequest(const JID& jid, const std::string& message); void handleSubscriptionRequestAccepted(SubscriptionRequestEvent* event); void handleSubscriptionRequestDeclined(SubscriptionRequestEvent* event); - void handleUIEvent(boost::shared_ptr event); - void handleRosterItemUpdated(ErrorPayload::ref error, boost::shared_ptr rosterPayload); - void handleRosterSetError(ErrorPayload::ref error, boost::shared_ptr rosterPayload); + void handleUIEvent(std::shared_ptr event); + void handleRosterItemUpdated(ErrorPayload::ref error, std::shared_ptr rosterPayload); + void handleRosterSetError(ErrorPayload::ref error, std::shared_ptr rosterPayload); void applyAllPresenceTo(const JID& jid); void handleEditProfileRequest(); void handleOnCapsChanged(const JID& jid); @@ -114,7 +113,7 @@ namespace Swift { FileTransferOverview* ftOverview_; ClientBlockListManager* clientBlockListManager_; RosterVCardProvider* rosterVCardProvider_; - boost::shared_ptr ownContact_; + std::shared_ptr ownContact_; boost::bsignals::scoped_connection blockingOnStateChangedConnection_; boost::bsignals::scoped_connection blockingOnItemAddedConnection_; diff --git a/Swift/Controllers/Roster/RosterItem.h b/Swift/Controllers/Roster/RosterItem.h index e7a3e20..2c51ae9 100644 --- a/Swift/Controllers/Roster/RosterItem.h +++ b/Swift/Controllers/Roster/RosterItem.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include namespace Swift { diff --git a/Swift/Controllers/Roster/TableRoster.h b/Swift/Controllers/Roster/TableRoster.h index 3d336ef..19a4ec6 100644 --- a/Swift/Controllers/Roster/TableRoster.h +++ b/Swift/Controllers/Roster/TableRoster.h @@ -80,6 +80,6 @@ namespace Swift { Roster* model; std::vector

sections; bool updatePending; - boost::shared_ptr updateTimer; + std::shared_ptr updateTimer; }; } diff --git a/Swift/Controllers/Roster/UnitTest/RosterControllerTest.cpp b/Swift/Controllers/Roster/UnitTest/RosterControllerTest.cpp index 91cc764..e01f78a 100644 --- a/Swift/Controllers/Roster/UnitTest/RosterControllerTest.cpp +++ b/Swift/Controllers/Roster/UnitTest/RosterControllerTest.cpp @@ -318,10 +318,10 @@ class RosterControllerTest : public CppUnit::TestFixture { groups.push_back("Enemies"); xmppRoster_->addContact(jid, "Bob", groups, RosterItemPayload::From); CPPUNIT_ASSERT_EQUAL(groups.size(), xmppRoster_->getGroupsForJID(jid).size()); - uiEventStream_->send(boost::shared_ptr(new RenameRosterItemUIEvent(jid, "Robert"))); + uiEventStream_->send(std::make_shared(jid, "Robert")); CPPUNIT_ASSERT_EQUAL(static_cast(1), channel_->iqs_.size()); CPPUNIT_ASSERT_EQUAL(IQ::Set, channel_->iqs_[0]->getType()); - boost::shared_ptr payload = channel_->iqs_[0]->getPayload(); + std::shared_ptr payload = channel_->iqs_[0]->getPayload(); CPPUNIT_ASSERT_EQUAL(static_cast(1), payload->getItems().size()); RosterItemPayload item = payload->getItems()[0]; CPPUNIT_ASSERT_EQUAL(jid, item.getJID()); diff --git a/Swift/Controllers/Roster/UnitTest/RosterTest.cpp b/Swift/Controllers/Roster/UnitTest/RosterTest.cpp index dd22cb7..4687176 100644 --- a/Swift/Controllers/Roster/UnitTest/RosterTest.cpp +++ b/Swift/Controllers/Roster/UnitTest/RosterTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -90,7 +90,7 @@ class RosterTest : public CppUnit::TestFixture { roster_->removeContact(jid4b); roster_->addContact(jid4c, JID(), "Bert", "group1", ""); roster_->addContact(jid4b, JID(), "Ernie", "group1", ""); - boost::shared_ptr presence(new Presence()); + std::shared_ptr presence(new Presence()); presence->setShow(StatusShow::DND); presence->setFrom(jid4a); roster_->applyOnItems(SetPresence(presence, JID::WithResource)); @@ -99,7 +99,7 @@ class RosterTest : public CppUnit::TestFixture { presence->setFrom(jid4c); roster_->applyOnItems(SetPresence(presence, JID::WithResource)); - presence = boost::make_shared(); + presence = std::make_shared(); presence->setFrom(jid4b); presence->setShow(StatusShow::Online); roster_->applyOnItems(SetPresence(presence, JID::WithResource)); @@ -111,7 +111,7 @@ class RosterTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(std::string("Bert"), children[1]->getDisplayName()); CPPUNIT_ASSERT_EQUAL(std::string("Bird"), children[2]->getDisplayName()); - presence = boost::make_shared(); + presence = std::make_shared(); presence->setFrom(jid4c); presence->setType(Presence::Unavailable); roster_->removeContact(jid4c); diff --git a/Swift/Controllers/Roster/UnitTest/TableRosterTest.cpp b/Swift/Controllers/Roster/UnitTest/TableRosterTest.cpp index 086bd6f..e4e8bdb 100644 --- a/Swift/Controllers/Roster/UnitTest/TableRosterTest.cpp +++ b/Swift/Controllers/Roster/UnitTest/TableRosterTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -16,7 +16,7 @@ std::ostream& operator<<(std::ostream& os, const Swift::TableRoster::Index& i) { #include #include -#include +#include #include #include @@ -46,7 +46,7 @@ class TableRosterTest : public CppUnit::TestFixture { void testAddContact_EmptyRoster() { /* - boost::shared_ptr tableRoster(createTestling()); + std::shared_ptr tableRoster(createTestling()); addContact(jid1, "1", "group1"); diff --git a/Swift/Controllers/ShowProfileController.cpp b/Swift/Controllers/ShowProfileController.cpp index bf5eb1e..add6e73 100644 --- a/Swift/Controllers/ShowProfileController.cpp +++ b/Swift/Controllers/ShowProfileController.cpp @@ -41,7 +41,7 @@ ShowProfileController::~ShowProfileController() { } void ShowProfileController::handleUIEvent(UIEvent::ref event) { - ShowProfileForRosterItemUIEvent::ref showProfileEvent = boost::dynamic_pointer_cast(event); + ShowProfileForRosterItemUIEvent::ref showProfileEvent = std::dynamic_pointer_cast(event); if (!showProfileEvent) { return; } diff --git a/Swift/Controllers/SoundEventController.cpp b/Swift/Controllers/SoundEventController.cpp index 433937b..5c7568f 100644 --- a/Swift/Controllers/SoundEventController.cpp +++ b/Swift/Controllers/SoundEventController.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -30,8 +30,8 @@ SoundEventController::SoundEventController(EventController* eventController, Sou playSounds_ = settings->getSetting(SettingConstants::PLAY_SOUNDS); } -void SoundEventController::handleEventQueueEventAdded(boost::shared_ptr event) { - if (playSounds_ && boost::dynamic_pointer_cast(event)) { +void SoundEventController::handleEventQueueEventAdded(std::shared_ptr event) { + if (playSounds_ && std::dynamic_pointer_cast(event)) { soundPlayer_->playSound(SoundPlayer::MessageReceived, ""); } } diff --git a/Swift/Controllers/SoundEventController.h b/Swift/Controllers/SoundEventController.h index 3ea682a..e5b43b4 100644 --- a/Swift/Controllers/SoundEventController.h +++ b/Swift/Controllers/SoundEventController.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -23,7 +23,7 @@ namespace Swift { bool getSoundEnabled() {return playSounds_;} private: void handleSettingChanged(const std::string& settingPath); - void handleEventQueueEventAdded(boost::shared_ptr event); + void handleEventQueueEventAdded(std::shared_ptr event); void handleHighlight(const HighlightAction& action); EventController* eventController_; SoundPlayer* soundPlayer_; diff --git a/Swift/Controllers/StatusTracker.cpp b/Swift/Controllers/StatusTracker.cpp index 51db328..56cd27f 100644 --- a/Swift/Controllers/StatusTracker.cpp +++ b/Swift/Controllers/StatusTracker.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -14,27 +14,27 @@ namespace Swift { StatusTracker::StatusTracker() { isAutoAway_ = false; - queuedPresence_ = boost::make_shared(); + queuedPresence_ = std::make_shared(); } -boost::shared_ptr StatusTracker::getNextPresence() { - boost::shared_ptr presence; +std::shared_ptr StatusTracker::getNextPresence() { + std::shared_ptr presence; if (isAutoAway_) { - presence = boost::make_shared(); + presence = std::make_shared(); presence->setShow(StatusShow::Away); presence->setStatus(queuedPresence_->getStatus()); - presence->addPayload(boost::make_shared(isAutoAwaySince_)); + presence->addPayload(std::make_shared(isAutoAwaySince_)); } else { presence = queuedPresence_; } return presence; } -void StatusTracker::setRequestedPresence(boost::shared_ptr presence) { +void StatusTracker::setRequestedPresence(std::shared_ptr presence) { isAutoAway_ = false; queuedPresence_ = presence; // if (presence->getType() == Presence::Unavailable) { -// queuedPresence_ = boost::make_shared(); +// queuedPresence_ = std::make_shared(); // } } diff --git a/Swift/Controllers/StatusTracker.h b/Swift/Controllers/StatusTracker.h index cf92781..a74ab6e 100644 --- a/Swift/Controllers/StatusTracker.h +++ b/Swift/Controllers/StatusTracker.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include @@ -16,12 +17,12 @@ namespace Swift { class StatusTracker { public: StatusTracker(); - boost::shared_ptr getNextPresence(); - void setRequestedPresence(boost::shared_ptr presence); + std::shared_ptr getNextPresence(); + void setRequestedPresence(std::shared_ptr presence); bool goAutoAway(const int& seconds); bool goAutoUnAway(); private: - boost::shared_ptr queuedPresence_; + std::shared_ptr queuedPresence_; bool isAutoAway_; boost::posix_time::ptime isAutoAwaySince_; }; diff --git a/Swift/Controllers/Storages/RosterFileStorage.cpp b/Swift/Controllers/Storages/RosterFileStorage.cpp index 6cc5c61..1f0a90b 100644 --- a/Swift/Controllers/Storages/RosterFileStorage.cpp +++ b/Swift/Controllers/Storages/RosterFileStorage.cpp @@ -17,10 +17,10 @@ typedef GenericPayloadPersister R RosterFileStorage::RosterFileStorage(const boost::filesystem::path& path) : path(path) { } -boost::shared_ptr RosterFileStorage::getRoster() const { +std::shared_ptr RosterFileStorage::getRoster() const { return RosterPersister().loadPayloadGeneric(path); } -void RosterFileStorage::setRoster(boost::shared_ptr roster) { +void RosterFileStorage::setRoster(std::shared_ptr roster) { RosterPersister().savePayload(roster, path); } diff --git a/Swift/Controllers/Storages/RosterFileStorage.h b/Swift/Controllers/Storages/RosterFileStorage.h index dd1a6c9..38e26c9 100644 --- a/Swift/Controllers/Storages/RosterFileStorage.h +++ b/Swift/Controllers/Storages/RosterFileStorage.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -15,8 +15,8 @@ namespace Swift { public: RosterFileStorage(const boost::filesystem::path& path); - virtual boost::shared_ptr getRoster() const; - virtual void setRoster(boost::shared_ptr); + virtual std::shared_ptr getRoster() const; + virtual void setRoster(std::shared_ptr); private: boost::filesystem::path path; diff --git a/Swift/Controllers/Storages/VCardFileStorage.cpp b/Swift/Controllers/Storages/VCardFileStorage.cpp index 720165a..dbb6799 100644 --- a/Swift/Controllers/Storages/VCardFileStorage.cpp +++ b/Swift/Controllers/Storages/VCardFileStorage.cpp @@ -53,8 +53,8 @@ VCardFileStorage::VCardFileStorage(boost::filesystem::path dir, CryptoProvider* } } -boost::shared_ptr VCardFileStorage::getVCard(const JID& jid) const { - boost::shared_ptr result = VCardPersister().loadPayloadGeneric(getVCardPath(jid)); +std::shared_ptr VCardFileStorage::getVCard(const JID& jid) const { + std::shared_ptr result = VCardPersister().loadPayloadGeneric(getVCardPath(jid)); getAndUpdatePhotoHash(jid, result); return result; } diff --git a/Swift/Controllers/Storages/VCardFileStorage.h b/Swift/Controllers/Storages/VCardFileStorage.h index 971a3f9..a91e914 100644 --- a/Swift/Controllers/Storages/VCardFileStorage.h +++ b/Swift/Controllers/Storages/VCardFileStorage.h @@ -7,10 +7,10 @@ #pragma once #include +#include #include #include -#include #include diff --git a/Swift/Controllers/SystemTrayController.cpp b/Swift/Controllers/SystemTrayController.cpp index 72d3403..28dbf5e 100644 --- a/Swift/Controllers/SystemTrayController.cpp +++ b/Swift/Controllers/SystemTrayController.cpp @@ -23,7 +23,7 @@ void SystemTrayController::handleEventQueueLengthChange(int /*length*/) { EventList events = eventController_->getEvents(); bool found = false; for (EventList::iterator it = events.begin(); it != events.end(); ++it) { - if (boost::dynamic_pointer_cast(*it)) { + if (std::dynamic_pointer_cast(*it)) { found = true; break; } diff --git a/Swift/Controllers/UIEvents/AcceptWhiteboardSessionUIEvent.h b/Swift/Controllers/UIEvents/AcceptWhiteboardSessionUIEvent.h index b46774c..ac76ec4 100644 --- a/Swift/Controllers/UIEvents/AcceptWhiteboardSessionUIEvent.h +++ b/Swift/Controllers/UIEvents/AcceptWhiteboardSessionUIEvent.h @@ -4,9 +4,15 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once -#include +#include #include @@ -14,7 +20,7 @@ namespace Swift { class AcceptWhiteboardSessionUIEvent : public UIEvent { - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: AcceptWhiteboardSessionUIEvent(const JID& jid) : jid_(jid) {} const JID& getContact() const {return jid_;} diff --git a/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h b/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h index 526fc0d..e1d6744 100644 --- a/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h +++ b/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include diff --git a/Swift/Controllers/UIEvents/CancelWhiteboardSessionUIEvent.h b/Swift/Controllers/UIEvents/CancelWhiteboardSessionUIEvent.h index 62751b6..1e9491f 100644 --- a/Swift/Controllers/UIEvents/CancelWhiteboardSessionUIEvent.h +++ b/Swift/Controllers/UIEvents/CancelWhiteboardSessionUIEvent.h @@ -4,9 +4,15 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once -#include +#include #include @@ -14,7 +20,7 @@ namespace Swift { class CancelWhiteboardSessionUIEvent : public UIEvent { - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: CancelWhiteboardSessionUIEvent(const JID& jid) : jid_(jid) {} const JID& getContact() const {return jid_;} diff --git a/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h b/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h index b3d3118..33f38f2 100644 --- a/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h +++ b/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include diff --git a/Swift/Controllers/UIEvents/InviteToMUCUIEvent.h b/Swift/Controllers/UIEvents/InviteToMUCUIEvent.h index e1416de..414582d 100644 --- a/Swift/Controllers/UIEvents/InviteToMUCUIEvent.h +++ b/Swift/Controllers/UIEvents/InviteToMUCUIEvent.h @@ -12,10 +12,9 @@ #pragma once +#include #include -#include - #include #include @@ -23,7 +22,7 @@ namespace Swift { class InviteToMUCUIEvent : public UIEvent { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; InviteToMUCUIEvent(const JID& room, const std::vector& JIDsToInvite, const std::string& reason) : room_(room), invite_(JIDsToInvite), reason_(reason) { } diff --git a/Swift/Controllers/UIEvents/JoinMUCUIEvent.h b/Swift/Controllers/UIEvents/JoinMUCUIEvent.h index 076b5b6..5d6df55 100644 --- a/Swift/Controllers/UIEvents/JoinMUCUIEvent.h +++ b/Swift/Controllers/UIEvents/JoinMUCUIEvent.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include @@ -18,7 +18,7 @@ namespace Swift { class JoinMUCUIEvent : public UIEvent { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; JoinMUCUIEvent(const JID& jid, const boost::optional& password = boost::optional(), const boost::optional& nick = boost::optional(), bool joinAutomaticallyInFuture = false, bool createAsReservedRoomIfNew = false, bool isImpromptu = false, bool isContinuation = false) : jid_(jid), nick_(nick), joinAutomatically_(joinAutomaticallyInFuture), createAsReservedRoomIfNew_(createAsReservedRoomIfNew), password_(password), isImpromptuMUC_(isImpromptu), isContinuation_(isContinuation) {} const boost::optional& getNick() const {return nick_;} const JID& getJID() const {return jid_;} diff --git a/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h b/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h index 2803197..b73eda5 100644 --- a/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h +++ b/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include diff --git a/Swift/Controllers/UIEvents/RenameRosterItemUIEvent.h b/Swift/Controllers/UIEvents/RenameRosterItemUIEvent.h index 7d370e2..1a71cb4 100644 --- a/Swift/Controllers/UIEvents/RenameRosterItemUIEvent.h +++ b/Swift/Controllers/UIEvents/RenameRosterItemUIEvent.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include diff --git a/Swift/Controllers/UIEvents/RequestContactEditorUIEvent.h b/Swift/Controllers/UIEvents/RequestContactEditorUIEvent.h index 5693ab1..25a5e42 100644 --- a/Swift/Controllers/UIEvents/RequestContactEditorUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestContactEditorUIEvent.h @@ -13,7 +13,7 @@ namespace Swift { class RequestContactEditorUIEvent : public UIEvent { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; RequestContactEditorUIEvent(const JID& jid) : jid(jid) { } diff --git a/Swift/Controllers/UIEvents/RequestInviteToMUCUIEvent.h b/Swift/Controllers/UIEvents/RequestInviteToMUCUIEvent.h index 9a1abb1..dac499f 100644 --- a/Swift/Controllers/UIEvents/RequestInviteToMUCUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestInviteToMUCUIEvent.h @@ -12,10 +12,9 @@ #pragma once +#include #include -#include - #include #include @@ -23,7 +22,7 @@ namespace Swift { class RequestInviteToMUCUIEvent : public UIEvent { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum ImpromptuMode { Impromptu, diff --git a/Swift/Controllers/UIEvents/RequestJoinMUCUIEvent.h b/Swift/Controllers/UIEvents/RequestJoinMUCUIEvent.h index a2a4183..5e94290 100644 --- a/Swift/Controllers/UIEvents/RequestJoinMUCUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestJoinMUCUIEvent.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include @@ -17,7 +16,7 @@ namespace Swift { class RequestJoinMUCUIEvent : public UIEvent { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; RequestJoinMUCUIEvent(const JID& room = JID()) : room(room) { } diff --git a/Swift/Controllers/UIEvents/SendFileUIEvent.h b/Swift/Controllers/UIEvents/SendFileUIEvent.h index 72452df..26e4940 100644 --- a/Swift/Controllers/UIEvents/SendFileUIEvent.h +++ b/Swift/Controllers/UIEvents/SendFileUIEvent.h @@ -21,7 +21,7 @@ namespace Swift { class SendFileUIEvent : public UIEvent { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; SendFileUIEvent(const JID& jid, const std::string& filename) : jid(jid), filename(filename) { } diff --git a/Swift/Controllers/UIEvents/ShowProfileForRosterItemUIEvent.h b/Swift/Controllers/UIEvents/ShowProfileForRosterItemUIEvent.h index 88528d7..9b2f60f 100644 --- a/Swift/Controllers/UIEvents/ShowProfileForRosterItemUIEvent.h +++ b/Swift/Controllers/UIEvents/ShowProfileForRosterItemUIEvent.h @@ -20,7 +20,7 @@ namespace Swift { class ShowProfileForRosterItemUIEvent : public UIEvent { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: ShowProfileForRosterItemUIEvent(const JID& jid) : jid_(jid) {} virtual ~ShowProfileForRosterItemUIEvent() {} diff --git a/Swift/Controllers/UIEvents/UIEvent.h b/Swift/Controllers/UIEvents/UIEvent.h index 333582d..5363a49 100644 --- a/Swift/Controllers/UIEvents/UIEvent.h +++ b/Swift/Controllers/UIEvents/UIEvent.h @@ -1,17 +1,17 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include namespace Swift { class UIEvent { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; virtual ~UIEvent(); }; diff --git a/Swift/Controllers/UIEvents/UIEventStream.h b/Swift/Controllers/UIEvents/UIEventStream.h index 7ff1b54..977f1d3 100644 --- a/Swift/Controllers/UIEvents/UIEventStream.h +++ b/Swift/Controllers/UIEvents/UIEventStream.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include @@ -15,9 +15,9 @@ namespace Swift { class UIEventStream { public: - boost::signal)> onUIEvent; + boost::signal)> onUIEvent; - void send(boost::shared_ptr event) { + void send(std::shared_ptr event) { onUIEvent(event); } }; diff --git a/Swift/Controllers/UIInterfaces/AdHocCommandWindowFactory.h b/Swift/Controllers/UIInterfaces/AdHocCommandWindowFactory.h index d3003f7..7b9b6f7 100644 --- a/Swift/Controllers/UIInterfaces/AdHocCommandWindowFactory.h +++ b/Swift/Controllers/UIInterfaces/AdHocCommandWindowFactory.h @@ -15,6 +15,6 @@ class AdHocCommandWindow; class AdHocCommandWindowFactory { public: virtual ~AdHocCommandWindowFactory() {} - virtual AdHocCommandWindow* createAdHocCommandWindow(boost::shared_ptr command) = 0; + virtual AdHocCommandWindow* createAdHocCommandWindow(std::shared_ptr command) = 0; }; } diff --git a/Swift/Controllers/UIInterfaces/ChatListWindow.h b/Swift/Controllers/UIInterfaces/ChatListWindow.h index a94e14e..5d470cc 100644 --- a/Swift/Controllers/UIInterfaces/ChatListWindow.h +++ b/Swift/Controllers/UIInterfaces/ChatListWindow.h @@ -8,10 +8,10 @@ #include #include +#include #include #include -#include #include #include diff --git a/Swift/Controllers/UIInterfaces/ChatWindow.h b/Swift/Controllers/UIInterfaces/ChatWindow.h index 310c967..28bf543 100644 --- a/Swift/Controllers/UIInterfaces/ChatWindow.h +++ b/Swift/Controllers/UIInterfaces/ChatWindow.h @@ -6,14 +6,13 @@ #pragma once +#include #include #include #include #include -#include #include -#include #include #include @@ -47,13 +46,13 @@ namespace Swift { public: ChatMessage() {} ChatMessage(const std::string& text) { - append(boost::make_shared(text)); + append(std::make_shared(text)); } - void append(const boost::shared_ptr& part) { + void append(const std::shared_ptr& part) { parts_.push_back(part); } - const std::vector >& getParts() const { + const std::vector >& getParts() const { return parts_; } @@ -68,7 +67,7 @@ namespace Swift { bool isMeCommand() const { bool isMeCommand = false; if (!parts_.empty()) { - boost::shared_ptr textPart = boost::dynamic_pointer_cast(parts_[0]); + std::shared_ptr textPart = std::dynamic_pointer_cast(parts_[0]); if (textPart) { if (boost::starts_with(textPart->text, "/me ")) { isMeCommand = true; @@ -79,7 +78,7 @@ namespace Swift { } private: - std::vector > parts_; + std::vector > parts_; HighlightAction fullMessageHighlightAction_; }; @@ -134,11 +133,11 @@ namespace Swift { /** Add message to window. * @return id of added message (for acks). */ - virtual std::string addMessage(const ChatMessage& message, const std::string& senderName, bool senderIsSelf, boost::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) = 0; + virtual std::string addMessage(const ChatMessage& message, const std::string& senderName, bool senderIsSelf, std::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) = 0; /** Adds action to window. * @return id of added message (for acks); */ - virtual std::string addAction(const ChatMessage& message, const std::string& senderName, bool senderIsSelf, boost::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) = 0; + virtual std::string addAction(const ChatMessage& message, const std::string& senderName, bool senderIsSelf, std::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) = 0; /** Adds system message to window * @return id of added message (for replacement) diff --git a/Swift/Controllers/UIInterfaces/ContactEditWindow.h b/Swift/Controllers/UIInterfaces/ContactEditWindow.h index 055c0f0..9aa2dcb 100644 --- a/Swift/Controllers/UIInterfaces/ContactEditWindow.h +++ b/Swift/Controllers/UIInterfaces/ContactEditWindow.h @@ -6,12 +6,11 @@ #pragma once +#include #include #include #include -#include - #include namespace Swift { diff --git a/Swift/Controllers/UIInterfaces/EventWindow.h b/Swift/Controllers/UIInterfaces/EventWindow.h index 1d254f4..c05976b 100644 --- a/Swift/Controllers/UIInterfaces/EventWindow.h +++ b/Swift/Controllers/UIInterfaces/EventWindow.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include @@ -20,8 +20,8 @@ namespace Swift { } virtual ~EventWindow() {} - virtual void addEvent(boost::shared_ptr event, bool active) = 0; - virtual void removeEvent(boost::shared_ptr event) = 0; + virtual void addEvent(std::shared_ptr event, bool active) = 0; + virtual void removeEvent(std::shared_ptr event) = 0; private: bool canDelete_; diff --git a/Swift/Controllers/UIInterfaces/LoginWindow.h b/Swift/Controllers/UIInterfaces/LoginWindow.h index cedc549..4518469 100644 --- a/Swift/Controllers/UIInterfaces/LoginWindow.h +++ b/Swift/Controllers/UIInterfaces/LoginWindow.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include diff --git a/Swift/Controllers/UIInterfaces/MainWindow.h b/Swift/Controllers/UIInterfaces/MainWindow.h index d8bcb58..ed225d8 100644 --- a/Swift/Controllers/UIInterfaces/MainWindow.h +++ b/Swift/Controllers/UIInterfaces/MainWindow.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -35,7 +34,7 @@ namespace Swift { virtual void setMyAvatarPath(const std::string& path) = 0; virtual void setMyStatusText(const std::string& status) = 0; virtual void setMyStatusType(StatusShow::Type type) = 0; - virtual void setMyContactRosterItem(boost::shared_ptr contact) = 0; + virtual void setMyContactRosterItem(std::shared_ptr contact) = 0; /** Must be able to cope with NULL to clear the roster */ virtual void setRosterModel(Roster* roster) = 0; virtual void setConnecting() = 0; diff --git a/Swift/Controllers/UIInterfaces/ProfileWindow.h b/Swift/Controllers/UIInterfaces/ProfileWindow.h index 8aa620c..27b0d1a 100644 --- a/Swift/Controllers/UIInterfaces/ProfileWindow.h +++ b/Swift/Controllers/UIInterfaces/ProfileWindow.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include diff --git a/Swift/Controllers/UIInterfaces/UserSearchWindow.h b/Swift/Controllers/UIInterfaces/UserSearchWindow.h index 4ddc29b..55bd117 100644 --- a/Swift/Controllers/UIInterfaces/UserSearchWindow.h +++ b/Swift/Controllers/UIInterfaces/UserSearchWindow.h @@ -29,7 +29,7 @@ namespace Swift { virtual void setSelectedService(const JID& service) = 0; virtual void setServerSupportsSearch(bool support) = 0; virtual void setSearchError(bool support) = 0; - virtual void setSearchFields(boost::shared_ptr fields) = 0; + virtual void setSearchFields(std::shared_ptr fields) = 0; virtual void setNameSuggestions(const std::vector& suggestions) = 0; virtual void prepopulateJIDAndName(const JID& jid, const std::string& name) = 0; virtual void setContactSuggestions(const std::vector& suggestions) = 0; @@ -46,7 +46,7 @@ namespace Swift { virtual void show() = 0; boost::signal onFormRequested; - boost::signal, const JID&)> onSearchRequested; + boost::signal, const JID&)> onSearchRequested; boost::signal onNameSuggestionRequested; boost::signal onContactSuggestionsRequested; boost::signal&)> onJIDUpdateRequested; diff --git a/Swift/Controllers/UIInterfaces/WhiteboardWindow.h b/Swift/Controllers/UIInterfaces/WhiteboardWindow.h index f3b35db..28348df 100644 --- a/Swift/Controllers/UIInterfaces/WhiteboardWindow.h +++ b/Swift/Controllers/UIInterfaces/WhiteboardWindow.h @@ -25,7 +25,7 @@ namespace Swift { virtual ~WhiteboardWindow() {} virtual void show() = 0; - virtual void setSession(boost::shared_ptr session) = 0; + virtual void setSession(std::shared_ptr session) = 0; virtual void activateWindow() = 0; virtual void setName(const std::string& name) = 0; }; diff --git a/Swift/Controllers/UIInterfaces/WhiteboardWindowFactory.h b/Swift/Controllers/UIInterfaces/WhiteboardWindowFactory.h index 163368b..0153a5a 100644 --- a/Swift/Controllers/UIInterfaces/WhiteboardWindowFactory.h +++ b/Swift/Controllers/UIInterfaces/WhiteboardWindowFactory.h @@ -4,6 +4,12 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once namespace Swift { @@ -14,6 +20,6 @@ namespace Swift { public : virtual ~WhiteboardWindowFactory() {} - virtual WhiteboardWindow* createWhiteboardWindow(boost::shared_ptr whiteboardSession) = 0; + virtual WhiteboardWindow* createWhiteboardWindow(std::shared_ptr whiteboardSession) = 0; }; } diff --git a/Swift/Controllers/UnitTest/ContactSuggesterTest.cpp b/Swift/Controllers/UnitTest/ContactSuggesterTest.cpp index 2bfca4b..217a2f0 100644 --- a/Swift/Controllers/UnitTest/ContactSuggesterTest.cpp +++ b/Swift/Controllers/UnitTest/ContactSuggesterTest.cpp @@ -4,9 +4,10 @@ * See the COPYING file for more information. */ +#include + #include #include -#include #include #include @@ -57,7 +58,7 @@ public: foreach (const std::string& name, words) { foreach (const std::string& jid, words) { foreach (const StatusShow::Type& status, statuses) { - contacts.push_back(boost::make_shared(name, jid, status, "")); + contacts.push_back(std::make_shared(name, jid, status, "")); } } } diff --git a/Swift/Controllers/UnitTest/MockChatWindow.h b/Swift/Controllers/UnitTest/MockChatWindow.h index e535eca..9a97994 100644 --- a/Swift/Controllers/UnitTest/MockChatWindow.h +++ b/Swift/Controllers/UnitTest/MockChatWindow.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include @@ -18,12 +18,12 @@ namespace Swift { MockChatWindow() : labelsEnabled_(false), impromptuMUCSupported_(false) {} virtual ~MockChatWindow(); - virtual std::string addMessage(const ChatMessage& message, const std::string& /*senderName*/, bool /*senderIsSelf*/, boost::shared_ptr /*label*/, const std::string& /*avatarPath*/, const boost::posix_time::ptime& /*time*/) { + virtual std::string addMessage(const ChatMessage& message, const std::string& /*senderName*/, bool /*senderIsSelf*/, std::shared_ptr /*label*/, const std::string& /*avatarPath*/, const boost::posix_time::ptime& /*time*/) { lastMessageBody_ = bodyFromMessage(message); return "id"; } - virtual std::string addAction(const ChatMessage& /*message*/, const std::string& /*senderName*/, bool /*senderIsSelf*/, boost::shared_ptr /*label*/, const std::string& /*avatarPath*/, const boost::posix_time::ptime& /*time*/) {return "id";} + virtual std::string addAction(const ChatMessage& /*message*/, const std::string& /*senderName*/, bool /*senderIsSelf*/, std::shared_ptr /*label*/, const std::string& /*avatarPath*/, const boost::posix_time::ptime& /*time*/) {return "id";} virtual std::string addSystemMessage(const ChatMessage& message, Direction /*direction*/) { lastAddedSystemMessage_ = message; @@ -91,9 +91,9 @@ namespace Swift { virtual void setBookmarkState(RoomBookmarkState) {} static std::string bodyFromMessage(const ChatMessage& message) { - boost::shared_ptr text; - foreach (boost::shared_ptr part, message.getParts()) { - if ((text = boost::dynamic_pointer_cast(part))) { + std::shared_ptr text; + foreach (std::shared_ptr part, message.getParts()) { + if ((text = std::dynamic_pointer_cast(part))) { return text->text; } } diff --git a/Swift/Controllers/UnitTest/MockMainWindow.h b/Swift/Controllers/UnitTest/MockMainWindow.h index 43522ce..6ae2aa7 100644 --- a/Swift/Controllers/UnitTest/MockMainWindow.h +++ b/Swift/Controllers/UnitTest/MockMainWindow.h @@ -20,7 +20,7 @@ namespace Swift { virtual void setMyAvatarPath(const std::string& /*path*/) {} virtual void setMyStatusText(const std::string& /*status*/) {} virtual void setMyStatusType(StatusShow::Type /*type*/) {} - virtual void setMyContactRosterItem(boost::shared_ptr /*contact*/) {} + virtual void setMyContactRosterItem(std::shared_ptr /*contact*/) {} virtual void setAvailableAdHocCommands(const std::vector& /*commands*/) {} virtual void setConnecting() {} virtual void setStreamEncryptionStatus(bool /*tlsInPlaceAndValid*/) {} diff --git a/Swift/Controllers/UnitTest/PresenceNotifierTest.cpp b/Swift/Controllers/UnitTest/PresenceNotifierTest.cpp index b3b364f..1375475 100644 --- a/Swift/Controllers/UnitTest/PresenceNotifierTest.cpp +++ b/Swift/Controllers/UnitTest/PresenceNotifierTest.cpp @@ -74,7 +74,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testReceiveFirstPresenceCreatesAvailableNotification() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); sendPresence(user1, StatusShow::Online); @@ -83,7 +83,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testReceiveSecondPresenceCreatesStatusChangeNotification() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); sendPresence(user1, StatusShow::Away); notifier->notifications.clear(); @@ -94,7 +94,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testReceiveUnavailablePresenceAfterAvailablePresenceCreatesUnavailableNotification() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); sendPresence(user1, StatusShow::Away); notifier->notifications.clear(); @@ -105,7 +105,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testReceiveUnavailablePresenceWithoutAvailableDoesNotCreateNotification() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); sendUnavailablePresence(user1); @@ -113,7 +113,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testReceiveAvailablePresenceAfterUnavailableCreatesAvailableNotification() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); sendPresence(user1, StatusShow::Away); sendUnavailablePresence(user1); notifier->notifications.clear(); @@ -125,7 +125,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testReceiveAvailablePresenceAfterReconnectCreatesAvailableNotification() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); sendPresence(user1, StatusShow::Away); stanzaChannel->setAvailable(false); stanzaChannel->setAvailable(true); @@ -138,7 +138,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testReceiveAvailablePresenceFromMUCDoesNotCreateNotification() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); mucRegistry->addMUC(JID("teaparty@wonderland.lit")); sendPresence(JID("teaparty@wonderland.lit/Alice"), StatusShow::Away); @@ -147,7 +147,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testNotificationPicture() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); avatarManager->avatars[user1] = createByteArray("abcdef"); sendPresence(user1, StatusShow::Online); @@ -157,7 +157,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testNotificationActivationEmitsSignal() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); sendPresence(user1, StatusShow::Online); CPPUNIT_ASSERT(notifier->notifications[0].callback); @@ -168,7 +168,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testNotificationSubjectContainsNameForJIDInRoster() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); roster->addContact(user1.toBare(), "User 1", std::vector(), RosterItemPayload::Both); sendPresence(user1, StatusShow::Online); @@ -179,7 +179,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testNotificationSubjectContainsJIDForJIDNotInRoster() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); sendPresence(user1, StatusShow::Online); @@ -189,7 +189,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testNotificationSubjectContainsStatus() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); sendPresence(user1, StatusShow::Away); @@ -199,7 +199,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testNotificationMessageContainsStatusMessage() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); sendPresence(user1, StatusShow::Away); @@ -208,7 +208,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testReceiveFirstPresenceWithQuietPeriodDoesNotNotify() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); testling->setInitialQuietPeriodMS(10); sendPresence(user1, StatusShow::Online); @@ -217,7 +217,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testReceivePresenceDuringQuietPeriodDoesNotNotify() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); testling->setInitialQuietPeriodMS(10); sendPresence(user1, StatusShow::Online); @@ -228,7 +228,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testReceivePresenceDuringQuietPeriodResetsTimer() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); testling->setInitialQuietPeriodMS(10); sendPresence(user1, StatusShow::Online); @@ -241,7 +241,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testReceivePresenceAfterQuietPeriodNotifies() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); testling->setInitialQuietPeriodMS(10); sendPresence(user1, StatusShow::Online); @@ -252,7 +252,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testReceiveFirstPresenceWithQuietPeriodDoesNotCountAsQuietPeriod() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); testling->setInitialQuietPeriodMS(10); timerFactory->setTime(11); @@ -262,7 +262,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void testReceiveFirstPresenceAfterReconnectWithQuietPeriodDoesNotNotify() { - boost::shared_ptr testling = createNotifier(); + std::shared_ptr testling = createNotifier(); testling->setInitialQuietPeriodMS(10); sendPresence(user1, StatusShow::Online); timerFactory->setTime(15); @@ -279,15 +279,15 @@ class PresenceNotifierTest : public CppUnit::TestFixture { private: - boost::shared_ptr createNotifier() { - boost::shared_ptr result(new PresenceNotifier(stanzaChannel, notifier, mucRegistry, avatarManager, nickResolver, presenceOracle, timerFactory)); + std::shared_ptr createNotifier() { + std::shared_ptr result(new PresenceNotifier(stanzaChannel, notifier, mucRegistry, avatarManager, nickResolver, presenceOracle, timerFactory)); result->onNotificationActivated.connect(boost::bind(&PresenceNotifierTest::handleNotificationActivated, this, _1)); result->setInitialQuietPeriodMS(0); return result; } void sendPresence(const JID& jid, StatusShow::Type type) { - boost::shared_ptr presence(new Presence()); + std::shared_ptr presence(new Presence()); presence->setFrom(jid); presence->setShow(type); presence->setStatus("Status Message"); @@ -295,7 +295,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture { } void sendUnavailablePresence(const JID& jid) { - boost::shared_ptr presence(new Presence()); + std::shared_ptr presence(new Presence()); presence->setType(Presence::Unavailable); presence->setFrom(jid); stanzaChannel->onPresenceReceived(presence); diff --git a/Swift/Controllers/WhiteboardManager.cpp b/Swift/Controllers/WhiteboardManager.cpp index 9594be4..fab5380 100644 --- a/Swift/Controllers/WhiteboardManager.cpp +++ b/Swift/Controllers/WhiteboardManager.cpp @@ -55,20 +55,20 @@ namespace Swift { return whiteboardWindows_[contact.toBare()]; } - void WhiteboardManager::handleUIEvent(boost::shared_ptr event) { - boost::shared_ptr requestWhiteboardEvent = boost::dynamic_pointer_cast(event); + void WhiteboardManager::handleUIEvent(std::shared_ptr event) { + std::shared_ptr requestWhiteboardEvent = std::dynamic_pointer_cast(event); if (requestWhiteboardEvent) { requestSession(requestWhiteboardEvent->getContact()); } - boost::shared_ptr sessionAcceptEvent = boost::dynamic_pointer_cast(event); + std::shared_ptr sessionAcceptEvent = std::dynamic_pointer_cast(event); if (sessionAcceptEvent) { acceptSession(sessionAcceptEvent->getContact()); } - boost::shared_ptr sessionCancelEvent = boost::dynamic_pointer_cast(event); + std::shared_ptr sessionCancelEvent = std::dynamic_pointer_cast(event); if (sessionCancelEvent) { cancelSession(sessionCancelEvent->getContact()); } - boost::shared_ptr showWindowEvent = boost::dynamic_pointer_cast(event); + std::shared_ptr showWindowEvent = std::dynamic_pointer_cast(event); if (showWindowEvent) { WhiteboardWindow* window = findWhiteboardWindow(showWindowEvent->getContact()); if (window != nullptr) { @@ -78,7 +78,7 @@ namespace Swift { } void WhiteboardManager::acceptSession(const JID& from) { - IncomingWhiteboardSession::ref session = boost::dynamic_pointer_cast(whiteboardSessionManager_->getSession(from)); + IncomingWhiteboardSession::ref session = std::dynamic_pointer_cast(whiteboardSessionManager_->getSession(from)); WhiteboardWindow* window = findWhiteboardWindow(from); if (session && window) { session->accept(); diff --git a/Swift/Controllers/WhiteboardManager.h b/Swift/Controllers/WhiteboardManager.h index 35ed9bd..a5ca933 100644 --- a/Swift/Controllers/WhiteboardManager.h +++ b/Swift/Controllers/WhiteboardManager.h @@ -14,8 +14,7 @@ #pragma once #include - -#include +#include #include #include @@ -43,7 +42,7 @@ namespace Swift { boost::signal< void (const JID&)> onRequestRejected; private: - void handleUIEvent(boost::shared_ptr event); + void handleUIEvent(std::shared_ptr event); void handleSessionTerminate(const JID& contact); void handleSessionCancel(const JID& contact); void handleSessionAccept(const JID& contact); diff --git a/Swift/Controllers/XMLConsoleController.cpp b/Swift/Controllers/XMLConsoleController.cpp index 2d4ca0a..b72fde3 100644 --- a/Swift/Controllers/XMLConsoleController.cpp +++ b/Swift/Controllers/XMLConsoleController.cpp @@ -19,8 +19,8 @@ XMLConsoleController::~XMLConsoleController() { delete xmlConsoleWidget; } -void XMLConsoleController::handleUIEvent(boost::shared_ptr rawEvent) { - boost::shared_ptr event = boost::dynamic_pointer_cast(rawEvent); +void XMLConsoleController::handleUIEvent(std::shared_ptr rawEvent) { + std::shared_ptr event = std::dynamic_pointer_cast(rawEvent); if (event != nullptr) { if (xmlConsoleWidget == nullptr) { xmlConsoleWidget = xmlConsoleWidgetFactory->createXMLConsoleWidget(); diff --git a/Swift/Controllers/XMLConsoleController.h b/Swift/Controllers/XMLConsoleController.h index eac27d3..16278a3 100644 --- a/Swift/Controllers/XMLConsoleController.h +++ b/Swift/Controllers/XMLConsoleController.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include #include @@ -29,7 +30,7 @@ namespace Swift { void handleDataWritten(const SafeByteArray& data); private: - void handleUIEvent(boost::shared_ptr event); + void handleUIEvent(std::shared_ptr event); private: XMLConsoleWidgetFactory* xmlConsoleWidgetFactory; diff --git a/Swift/Controllers/XMPPEvents/ErrorEvent.h b/Swift/Controllers/XMPPEvents/ErrorEvent.h index 959f210..f3888cb 100644 --- a/Swift/Controllers/XMPPEvents/ErrorEvent.h +++ b/Swift/Controllers/XMPPEvents/ErrorEvent.h @@ -7,10 +7,9 @@ #pragma once #include +#include #include -#include - #include #include diff --git a/Swift/Controllers/XMPPEvents/EventController.cpp b/Swift/Controllers/XMPPEvents/EventController.cpp index 4c6b3bc..f0debb9 100644 --- a/Swift/Controllers/XMPPEvents/EventController.cpp +++ b/Swift/Controllers/XMPPEvents/EventController.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -25,23 +25,23 @@ EventController::EventController() { } EventController::~EventController() { - foreach(boost::shared_ptr event, events_) { + foreach(std::shared_ptr event, events_) { event->onConclusion.disconnect(boost::bind(&EventController::handleEventConcluded, this, event)); } } -void EventController::handleIncomingEvent(boost::shared_ptr sourceEvent) { - boost::shared_ptr messageEvent = boost::dynamic_pointer_cast(sourceEvent); - boost::shared_ptr subscriptionEvent = boost::dynamic_pointer_cast(sourceEvent); - boost::shared_ptr errorEvent = boost::dynamic_pointer_cast(sourceEvent); - boost::shared_ptr mucInviteEvent = boost::dynamic_pointer_cast(sourceEvent); - boost::shared_ptr incomingFileTransferEvent = boost::dynamic_pointer_cast(sourceEvent); +void EventController::handleIncomingEvent(std::shared_ptr sourceEvent) { + std::shared_ptr messageEvent = std::dynamic_pointer_cast(sourceEvent); + std::shared_ptr subscriptionEvent = std::dynamic_pointer_cast(sourceEvent); + std::shared_ptr errorEvent = std::dynamic_pointer_cast(sourceEvent); + std::shared_ptr mucInviteEvent = std::dynamic_pointer_cast(sourceEvent); + std::shared_ptr incomingFileTransferEvent = std::dynamic_pointer_cast(sourceEvent); /* If it's a duplicate subscription request, remove the previous request first */ if (subscriptionEvent) { EventList existingEvents(events_); - foreach(boost::shared_ptr existingEvent, existingEvents) { - boost::shared_ptr existingSubscriptionEvent = boost::dynamic_pointer_cast(existingEvent); + foreach(std::shared_ptr existingEvent, existingEvents) { + std::shared_ptr existingSubscriptionEvent = std::dynamic_pointer_cast(existingEvent); if (existingSubscriptionEvent) { if (existingSubscriptionEvent->getJID() == subscriptionEvent->getJID()) { existingEvent->conclude(); @@ -61,7 +61,7 @@ void EventController::handleIncomingEvent(boost::shared_ptr sourceE } } -void EventController::handleEventConcluded(boost::shared_ptr event) { +void EventController::handleEventConcluded(std::shared_ptr event) { event->onConclusion.disconnect(boost::bind(&EventController::handleEventConcluded, this, event)); events_.erase(std::remove(events_.begin(), events_.end(), event), events_.end()); onEventQueueLengthChange(boost::numeric_cast(events_.size())); diff --git a/Swift/Controllers/XMPPEvents/EventController.h b/Swift/Controllers/XMPPEvents/EventController.h index 3081449..1e198cb 100644 --- a/Swift/Controllers/XMPPEvents/EventController.h +++ b/Swift/Controllers/XMPPEvents/EventController.h @@ -1,36 +1,35 @@ /* - * 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 #include -#include - #include #include #include namespace Swift { - typedef std::vector > EventList; + typedef std::vector > EventList; class EventController { public: EventController(); ~EventController(); - void handleIncomingEvent(boost::shared_ptr sourceEvent); + void handleIncomingEvent(std::shared_ptr sourceEvent); boost::signal onEventQueueLengthChange; - boost::signal)> onEventQueueEventAdded; + boost::signal)> onEventQueueEventAdded; const EventList& getEvents() const {return events_;} void disconnectAll(); void clear(); private: - void handleEventConcluded(boost::shared_ptr event); + void handleEventConcluded(std::shared_ptr event); EventList events_; }; } diff --git a/Swift/Controllers/XMPPEvents/IncomingFileTransferEvent.h b/Swift/Controllers/XMPPEvents/IncomingFileTransferEvent.h index 4c128e8..3d4303d 100644 --- a/Swift/Controllers/XMPPEvents/IncomingFileTransferEvent.h +++ b/Swift/Controllers/XMPPEvents/IncomingFileTransferEvent.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include @@ -15,7 +15,7 @@ namespace Swift { class IncomingFileTransferEvent : public StanzaEvent { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; IncomingFileTransferEvent(const JID& sender) : sender_(sender) {} diff --git a/Swift/Controllers/XMPPEvents/MUCInviteEvent.h b/Swift/Controllers/XMPPEvents/MUCInviteEvent.h index 7d333fb..4cdbbff 100644 --- a/Swift/Controllers/XMPPEvents/MUCInviteEvent.h +++ b/Swift/Controllers/XMPPEvents/MUCInviteEvent.h @@ -5,17 +5,16 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include #include -#include - #include #include @@ -24,7 +23,7 @@ namespace Swift { class MUCInviteEvent : public StanzaEvent { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: MUCInviteEvent(const JID& inviter, const JID& roomJID, const std::string& reason, const std::string& password, bool direct, bool impromptu) : inviter_(inviter), roomJID_(roomJID), reason_(reason), password_(password), direct_(direct), impromptu_(impromptu) {} diff --git a/Swift/Controllers/XMPPEvents/MessageEvent.h b/Swift/Controllers/XMPPEvents/MessageEvent.h index 4ec0406..7af2be6 100644 --- a/Swift/Controllers/XMPPEvents/MessageEvent.h +++ b/Swift/Controllers/XMPPEvents/MessageEvent.h @@ -7,8 +7,7 @@ #pragma once #include - -#include +#include #include @@ -17,11 +16,11 @@ namespace Swift { class MessageEvent : public StanzaEvent { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; - MessageEvent(boost::shared_ptr stanza) : stanza_(stanza), targetsMe_(true) {} + MessageEvent(std::shared_ptr stanza) : stanza_(stanza), targetsMe_(true) {} - boost::shared_ptr getStanza() {return stanza_;} + std::shared_ptr getStanza() {return stanza_;} bool isReadable() { return getStanza()->isError() || !getStanza()->getBody().get_value_or("").empty(); @@ -41,7 +40,7 @@ namespace Swift { } private: - boost::shared_ptr stanza_; + std::shared_ptr stanza_; bool targetsMe_; }; } diff --git a/Swift/Controllers/XMPPEvents/StanzaEvent.h b/Swift/Controllers/XMPPEvents/StanzaEvent.h index fe97e23..0ddcdbe 100644 --- a/Swift/Controllers/XMPPEvents/StanzaEvent.h +++ b/Swift/Controllers/XMPPEvents/StanzaEvent.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include diff --git a/Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h b/Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h index 92922e9..85d3722 100644 --- a/Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h +++ b/Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h @@ -7,10 +7,9 @@ #pragma once #include +#include #include -#include - #include #include diff --git a/Swift/Controllers/XMPPURIController.cpp b/Swift/Controllers/XMPPURIController.cpp index 57c0ca4..aaebd56 100644 --- a/Swift/Controllers/XMPPURIController.cpp +++ b/Swift/Controllers/XMPPURIController.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -30,10 +31,10 @@ void XMPPURIController::handleURI(const std::string& s) { XMPPURI uri = XMPPURI::fromString(s); if (!uri.isNull()) { if (uri.getQueryType() == "join") { - uiEventStream->send(boost::make_shared(uri.getPath())); + uiEventStream->send(std::make_shared(uri.getPath())); } else { - uiEventStream->send(boost::make_shared(uri.getPath())); + uiEventStream->send(std::make_shared(uri.getPath())); } } } diff --git a/Swift/QtUI/ChatList/ChatListMUCItem.h b/Swift/QtUI/ChatList/ChatListMUCItem.h index 4e93600..c77c284 100644 --- a/Swift/QtUI/ChatList/ChatListMUCItem.h +++ b/Swift/QtUI/ChatList/ChatListMUCItem.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include diff --git a/Swift/QtUI/ChatList/ChatListRecentItem.h b/Swift/QtUI/ChatList/ChatListRecentItem.h index 4f0a363..3c9635b 100644 --- a/Swift/QtUI/ChatList/ChatListRecentItem.h +++ b/Swift/QtUI/ChatList/ChatListRecentItem.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include diff --git a/Swift/QtUI/ChatList/ChatListWhiteboardItem.h b/Swift/QtUI/ChatList/ChatListWhiteboardItem.h index 92acb1c..6dbc5f6 100644 --- a/Swift/QtUI/ChatList/ChatListWhiteboardItem.h +++ b/Swift/QtUI/ChatList/ChatListWhiteboardItem.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include diff --git a/Swift/QtUI/ChatList/QtChatListWindow.cpp b/Swift/QtUI/ChatList/QtChatListWindow.cpp index 1a121aa..3fe462a 100644 --- a/Swift/QtUI/ChatList/QtChatListWindow.cpp +++ b/Swift/QtUI/ChatList/QtChatListWindow.cpp @@ -103,7 +103,7 @@ void QtChatListWindow::handleItemActivated(const QModelIndex& index) { } else if (ChatListWhiteboardItem* whiteboardItem = dynamic_cast(item)) { if (!whiteboardItem->getChat().isMUC || bookmarksEnabled_) { - eventStream_->send(boost::make_shared(whiteboardItem->getChat().jid)); + eventStream_->send(std::make_shared(whiteboardItem->getChat().jid)); } } } @@ -143,7 +143,7 @@ void QtChatListWindow::setOnline(bool isOnline) { void QtChatListWindow::handleRemoveBookmark() { const ChatListMUCItem* mucItem = dynamic_cast(contextMenuItem_); if (!mucItem) return; - eventStream_->send(boost::shared_ptr(new RemoveMUCBookmarkUIEvent(mucItem->getBookmark()))); + eventStream_->send(std::make_shared(mucItem->getBookmark())); } void QtChatListWindow::handleAddBookmarkFromRecents() { @@ -153,7 +153,7 @@ void QtChatListWindow::handleAddBookmarkFromRecents() { MUCBookmark bookmark(chat.jid, chat.jid.toBare().toString()); bookmark.setNick(chat.nick); bookmark.setPassword(chat.password); - eventStream_->send(boost::shared_ptr(new AddMUCBookmarkUIEvent(bookmark))); + eventStream_->send(std::make_shared(bookmark)); } } diff --git a/Swift/QtUI/ChatSnippet.cpp b/Swift/QtUI/ChatSnippet.cpp index 14e4674..0369d0a 100644 --- a/Swift/QtUI/ChatSnippet.cpp +++ b/Swift/QtUI/ChatSnippet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -46,10 +46,10 @@ QString ChatSnippet::directionToCSS(Direction direction) { } ChatSnippet::Direction ChatSnippet::getDirection(const ChatWindow::ChatMessage& message) { - boost::shared_ptr textPart; + std::shared_ptr textPart; std::string text = ""; - foreach (boost::shared_ptr part, message.getParts()) { - if ((textPart = boost::dynamic_pointer_cast(part))) { + foreach (std::shared_ptr part, message.getParts()) { + if ((textPart = std::dynamic_pointer_cast(part))) { text = textPart->text; break; } diff --git a/Swift/QtUI/ChatSnippet.h b/Swift/QtUI/ChatSnippet.h index bf2d6d2..f715cbf 100644 --- a/Swift/QtUI/ChatSnippet.h +++ b/Swift/QtUI/ChatSnippet.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -31,7 +31,7 @@ namespace Swift { virtual const QString& getContent() const = 0; virtual QString getContinuationElementID() const { return ""; } - boost::shared_ptr getContinuationFallbackSnippet() const {return continuationFallback_;} + std::shared_ptr getContinuationFallbackSnippet() const {return continuationFallback_;} bool getAppendToPrevious() const { return appendToPrevious_; @@ -61,12 +61,12 @@ namespace Swift { static QString directionToCSS(Direction direction); QString wrapResizable(const QString& text); - void setContinuationFallbackSnippet(boost::shared_ptr continuationFallback) { + void setContinuationFallbackSnippet(std::shared_ptr continuationFallback) { continuationFallback_ = continuationFallback; } private: bool appendToPrevious_; - boost::shared_ptr continuationFallback_; + std::shared_ptr continuationFallback_; }; } diff --git a/Swift/QtUI/CocoaUIHelpers.mm b/Swift/QtUI/CocoaUIHelpers.mm index 06a74aa..c876312 100644 --- a/Swift/QtUI/CocoaUIHelpers.mm +++ b/Swift/QtUI/CocoaUIHelpers.mm @@ -12,7 +12,7 @@ #include "CocoaUIHelpers.h" -#include +#include #include #include @@ -32,8 +32,8 @@ void CocoaUIHelpers::displayCertificateChainAsSheet(QWidget* parent, const std:: foreach(Certificate::ref cert, chain) { // convert chain to SecCertificateRef ByteArray certAsDER = cert->toDER(); - boost::shared_ptr::type> certData(CFDataCreate(nullptr, certAsDER.data(), certAsDER.size()), CFRelease); - boost::shared_ptr macCert(SecCertificateCreateWithData(nullptr, certData.get()), CFRelease); + std::shared_ptr::type> certData(CFDataCreate(nullptr, certAsDER.data(), certAsDER.size()), CFRelease); + std::shared_ptr macCert(SecCertificateCreateWithData(nullptr, certData.get()), CFRelease); // add to NSMutable array [certificates addObject: (id)macCert.get()]; diff --git a/Swift/QtUI/EventViewer/EventDelegate.cpp b/Swift/QtUI/EventViewer/EventDelegate.cpp index eff9a7b..1c3ed7f 100644 --- a/Swift/QtUI/EventViewer/EventDelegate.cpp +++ b/Swift/QtUI/EventViewer/EventDelegate.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -56,24 +56,24 @@ void EventDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, } } -EventType EventDelegate::getEventType(boost::shared_ptr event) const { - boost::shared_ptr messageEvent = boost::dynamic_pointer_cast(event); +EventType EventDelegate::getEventType(std::shared_ptr event) const { + std::shared_ptr messageEvent = std::dynamic_pointer_cast(event); if (messageEvent) { return MessageEventType; } - boost::shared_ptr subscriptionEvent = boost::dynamic_pointer_cast(event); + std::shared_ptr subscriptionEvent = std::dynamic_pointer_cast(event); if (subscriptionEvent) { return SubscriptionEventType; } - boost::shared_ptr errorEvent = boost::dynamic_pointer_cast(event); + std::shared_ptr errorEvent = std::dynamic_pointer_cast(event); if (errorEvent) { return ErrorEventType; } - boost::shared_ptr mucInviteEvent = boost::dynamic_pointer_cast(event); + std::shared_ptr mucInviteEvent = std::dynamic_pointer_cast(event); if (mucInviteEvent) { return MUCInviteEventType; } - boost::shared_ptr incomingFileTransferEvent = boost::dynamic_pointer_cast(event); + std::shared_ptr incomingFileTransferEvent = std::dynamic_pointer_cast(event); if (incomingFileTransferEvent) { return IncomingFileTransferEventType; } diff --git a/Swift/QtUI/EventViewer/EventDelegate.h b/Swift/QtUI/EventViewer/EventDelegate.h index 0804589..79ee8ed 100644 --- a/Swift/QtUI/EventViewer/EventDelegate.h +++ b/Swift/QtUI/EventViewer/EventDelegate.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -20,7 +20,7 @@ namespace Swift { QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const; void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const; private: - EventType getEventType(boost::shared_ptr event) const; + EventType getEventType(std::shared_ptr event) const; DelegateCommons common_; TwoLineDelegate messageDelegate_; TwoLineDelegate subscriptionDelegate_; diff --git a/Swift/QtUI/EventViewer/EventModel.cpp b/Swift/QtUI/EventViewer/EventModel.cpp index d830db9..e242003 100644 --- a/Swift/QtUI/EventViewer/EventModel.cpp +++ b/Swift/QtUI/EventViewer/EventModel.cpp @@ -74,7 +74,7 @@ int EventModel::rowCount(const QModelIndex& parent) const { return count; } -void EventModel::addEvent(boost::shared_ptr event, bool active) { +void EventModel::addEvent(std::shared_ptr event, bool active) { beginResetModel(); if (active) { activeEvents_.push_front(new QtEvent(event, active)); @@ -87,7 +87,7 @@ void EventModel::addEvent(boost::shared_ptr event, bool active) { endResetModel(); } -void EventModel::removeEvent(boost::shared_ptr event) { +void EventModel::removeEvent(std::shared_ptr event) { beginResetModel(); for (int i = inactiveEvents_.size() - 1; i >= 0; i--) { if (event == inactiveEvents_[i]->getEvent()) { diff --git a/Swift/QtUI/EventViewer/EventModel.h b/Swift/QtUI/EventViewer/EventModel.h index 5cd5028..de72c1b 100644 --- a/Swift/QtUI/EventViewer/EventModel.h +++ b/Swift/QtUI/EventViewer/EventModel.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,8 +21,8 @@ class EventModel : public QAbstractListModel { public: EventModel(); virtual ~EventModel(); - void addEvent(boost::shared_ptr event, bool active); - void removeEvent(boost::shared_ptr event); + void addEvent(std::shared_ptr event, bool active); + void removeEvent(std::shared_ptr event); QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; int rowCount(const QModelIndex& parent = QModelIndex()) const; QtEvent* getItem(int row) const; diff --git a/Swift/QtUI/EventViewer/QtEvent.cpp b/Swift/QtUI/EventViewer/QtEvent.cpp index c287c66..5bd0fad 100644 --- a/Swift/QtUI/EventViewer/QtEvent.cpp +++ b/Swift/QtUI/EventViewer/QtEvent.cpp @@ -19,7 +19,7 @@ namespace Swift { -QtEvent::QtEvent(boost::shared_ptr event, bool active) : event_(event) { +QtEvent::QtEvent(std::shared_ptr event, bool active) : event_(event) { active_ = active; } @@ -38,23 +38,23 @@ QVariant QtEvent::data(int role) { } QString QtEvent::sender() { - boost::shared_ptr messageEvent = boost::dynamic_pointer_cast(event_); + std::shared_ptr messageEvent = std::dynamic_pointer_cast(event_); if (messageEvent) { return P2QSTRING(messageEvent->getStanza()->getFrom().toString()); } - boost::shared_ptr subscriptionRequestEvent = boost::dynamic_pointer_cast(event_); + std::shared_ptr subscriptionRequestEvent = std::dynamic_pointer_cast(event_); if (subscriptionRequestEvent) { return P2QSTRING(subscriptionRequestEvent->getJID().toBare().toString()); } - boost::shared_ptr errorEvent = boost::dynamic_pointer_cast(event_); + std::shared_ptr errorEvent = std::dynamic_pointer_cast(event_); if (errorEvent) { return P2QSTRING(errorEvent->getJID().toBare().toString()); } - boost::shared_ptr mucInviteEvent = boost::dynamic_pointer_cast(event_); + std::shared_ptr mucInviteEvent = std::dynamic_pointer_cast(event_); if (mucInviteEvent) { return P2QSTRING(mucInviteEvent->getInviter().toString()); } - boost::shared_ptr incomingFTEvent = boost::dynamic_pointer_cast(event_); + std::shared_ptr incomingFTEvent = std::dynamic_pointer_cast(event_); if (incomingFTEvent) { return P2QSTRING(incomingFTEvent->getSender().toString()); } @@ -62,11 +62,11 @@ QString QtEvent::sender() { } QString QtEvent::text() { - boost::shared_ptr messageEvent = boost::dynamic_pointer_cast(event_); + std::shared_ptr messageEvent = std::dynamic_pointer_cast(event_); if (messageEvent) { return P2QSTRING(messageEvent->getStanza()->getBody().get_value_or("")); } - boost::shared_ptr subscriptionRequestEvent = boost::dynamic_pointer_cast(event_); + std::shared_ptr subscriptionRequestEvent = std::dynamic_pointer_cast(event_); if (subscriptionRequestEvent) { std::string reason = subscriptionRequestEvent->getReason(); QString message; @@ -78,16 +78,16 @@ QString QtEvent::text() { } return message; } - boost::shared_ptr errorEvent = boost::dynamic_pointer_cast(event_); + std::shared_ptr errorEvent = std::dynamic_pointer_cast(event_); if (errorEvent) { return P2QSTRING(errorEvent->getText()); } - boost::shared_ptr mucInviteEvent = boost::dynamic_pointer_cast(event_); + std::shared_ptr mucInviteEvent = std::dynamic_pointer_cast(event_); if (mucInviteEvent) { QString message = QString(QObject::tr("%1 has invited you to enter the %2 room.")).arg(P2QSTRING(mucInviteEvent->getInviter().toBare().toString())).arg(P2QSTRING(mucInviteEvent->getRoomJID().toString())); return message; } - boost::shared_ptr incomingFTEvent = boost::dynamic_pointer_cast(event_); + std::shared_ptr incomingFTEvent = std::dynamic_pointer_cast(event_); if (incomingFTEvent) { QString message = QString(QObject::tr("%1 would like to send a file to you.")).arg(P2QSTRING(incomingFTEvent->getSender().toBare().toString())); return message; diff --git a/Swift/QtUI/EventViewer/QtEvent.h b/Swift/QtUI/EventViewer/QtEvent.h index d369255..cb78b00 100644 --- a/Swift/QtUI/EventViewer/QtEvent.h +++ b/Swift/QtUI/EventViewer/QtEvent.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include @@ -15,9 +15,9 @@ namespace Swift { class QtEvent { public: - QtEvent(boost::shared_ptr event, bool active); + QtEvent(std::shared_ptr event, bool active); QVariant data(int role); - boost::shared_ptr getEvent() { return event_; } + std::shared_ptr getEvent() { return event_; } enum EventRoles { SenderRole = Qt::UserRole @@ -26,7 +26,7 @@ namespace Swift { private: QString text(); QString sender(); - boost::shared_ptr event_; + std::shared_ptr event_; bool active_; }; } diff --git a/Swift/QtUI/EventViewer/QtEventWindow.cpp b/Swift/QtUI/EventViewer/QtEventWindow.cpp index 8395a6c..e77699b 100644 --- a/Swift/QtUI/EventViewer/QtEventWindow.cpp +++ b/Swift/QtUI/EventViewer/QtEventWindow.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -73,26 +73,26 @@ void QtEventWindow::handleReadClicked() { void QtEventWindow::handleItemActivated(const QModelIndex& item) { QtEvent* event = model_->getItem(item.row()); - boost::shared_ptr messageEvent = boost::dynamic_pointer_cast(event->getEvent()); - boost::shared_ptr subscriptionEvent = boost::dynamic_pointer_cast(event->getEvent()); - boost::shared_ptr mucInviteEvent = boost::dynamic_pointer_cast(event->getEvent()); - boost::shared_ptr incomingFTEvent = boost::dynamic_pointer_cast(event->getEvent()); - boost::shared_ptr errorEvent = boost::dynamic_pointer_cast(event->getEvent()); + std::shared_ptr messageEvent = std::dynamic_pointer_cast(event->getEvent()); + std::shared_ptr subscriptionEvent = std::dynamic_pointer_cast(event->getEvent()); + std::shared_ptr mucInviteEvent = std::dynamic_pointer_cast(event->getEvent()); + std::shared_ptr incomingFTEvent = std::dynamic_pointer_cast(event->getEvent()); + std::shared_ptr errorEvent = std::dynamic_pointer_cast(event->getEvent()); if (messageEvent) { if (messageEvent->getStanza()->getType() == Message::Groupchat) { - eventStream_->send(boost::shared_ptr(new JoinMUCUIEvent(messageEvent->getStanza()->getFrom().toBare(), messageEvent->getStanza()->getTo().getResource()))); + eventStream_->send(std::make_shared(messageEvent->getStanza()->getFrom().toBare(), messageEvent->getStanza()->getTo().getResource())); } else { - eventStream_->send(boost::shared_ptr(new RequestChatUIEvent(messageEvent->getStanza()->getFrom()))); + eventStream_->send(std::make_shared(messageEvent->getStanza()->getFrom())); } } else if (subscriptionEvent) { QtSubscriptionRequestWindow* window = QtSubscriptionRequestWindow::getWindow(subscriptionEvent, this); window->show(); } else if (mucInviteEvent) { - eventStream_->send(boost::shared_ptr(new RequestChatUIEvent(mucInviteEvent->getInviter()))); + eventStream_->send(std::make_shared(mucInviteEvent->getInviter())); mucInviteEvent->conclude(); } else if (incomingFTEvent) { - eventStream_->send(boost::shared_ptr(new RequestChatUIEvent(incomingFTEvent->getSender()))); + eventStream_->send(std::make_shared(incomingFTEvent->getSender())); incomingFTEvent->conclude(); } else { if (errorEvent) { @@ -105,14 +105,14 @@ void QtEventWindow::handleItemActivated(const QModelIndex& item) { } -void QtEventWindow::addEvent(boost::shared_ptr event, bool active) { +void QtEventWindow::addEvent(std::shared_ptr event, bool active) { view_->clearSelection(); model_->addEvent(event, active); emit onNewEventCountUpdated(model_->getNewEventCount()); readButton_->setEnabled(model_->rowCount() > 0); } -void QtEventWindow::removeEvent(boost::shared_ptr event) { +void QtEventWindow::removeEvent(std::shared_ptr event) { view_->clearSelection(); model_->removeEvent(event); emit onNewEventCountUpdated(model_->getNewEventCount()); diff --git a/Swift/QtUI/EventViewer/QtEventWindow.h b/Swift/QtUI/EventViewer/QtEventWindow.h index 92f8de0..bad20e4 100644 --- a/Swift/QtUI/EventViewer/QtEventWindow.h +++ b/Swift/QtUI/EventViewer/QtEventWindow.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include @@ -25,8 +25,8 @@ namespace Swift { public: QtEventWindow(UIEventStream* eventStream); ~QtEventWindow(); - void addEvent(boost::shared_ptr event, bool active); - void removeEvent(boost::shared_ptr event); + void addEvent(std::shared_ptr event, bool active); + void removeEvent(std::shared_ptr event); signals: void onNewEventCountUpdated(int count); private slots: diff --git a/Swift/QtUI/EventViewer/main.cpp b/Swift/QtUI/EventViewer/main.cpp index 5eddd90..492599e 100644 --- a/Swift/QtUI/EventViewer/main.cpp +++ b/Swift/QtUI/EventViewer/main.cpp @@ -21,13 +21,13 @@ int main(int argc, char *argv[]) Swift::UIEventStream eventStream; Swift::QtEventWindow* viewer = new Swift::QtEventWindow(&eventStream); viewer->show(); - boost::shared_ptr message1(new Swift::Message()); + std::shared_ptr message1(new Swift::Message()); message1->setBody("Oooh, shiny"); - boost::shared_ptr event1(new Swift::MessageEvent(message1)); - viewer->addEvent(boost::dynamic_pointer_cast(event1), true); + std::shared_ptr event1(new Swift::MessageEvent(message1)); + viewer->addEvent(std::dynamic_pointer_cast(event1), true); for (int i = 0; i < 100; i++) { - viewer->addEvent(boost::dynamic_pointer_cast(event1), false); + viewer->addEvent(std::dynamic_pointer_cast(event1), false); } - viewer->addEvent(boost::dynamic_pointer_cast(boost::make_shared(Swift::JID("me@example.com"), "Something bad did happen to you.")), true); + viewer->addEvent(std::dynamic_pointer_cast(std::make_shared(Swift::JID("me@example.com"), "Something bad did happen to you.")), true); return app.exec(); } diff --git a/Swift/QtUI/MUCSearch/MUCSearchModel.h b/Swift/QtUI/MUCSearch/MUCSearchModel.h index d6a24f3..2922ca6 100644 --- a/Swift/QtUI/MUCSearch/MUCSearchModel.h +++ b/Swift/QtUI/MUCSearch/MUCSearchModel.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include diff --git a/Swift/QtUI/MessageSnippet.cpp b/Swift/QtUI/MessageSnippet.cpp index 85cbdb9..4682365 100644 --- a/Swift/QtUI/MessageSnippet.cpp +++ b/Swift/QtUI/MessageSnippet.cpp @@ -12,7 +12,7 @@ namespace Swift { MessageSnippet::MessageSnippet(const QString& message, const QString& sender, const QDateTime& time, const QString& iconURI, bool isIncoming, bool appendToPrevious, QtChatTheme* theme, const QString& id, Direction direction) : ChatSnippet(appendToPrevious) { if (appendToPrevious) { - setContinuationFallbackSnippet(boost::shared_ptr(new MessageSnippet(message, sender, time, iconURI, isIncoming, false, theme, id, direction))); + setContinuationFallbackSnippet(std::make_shared(message, sender, time, iconURI, isIncoming, false, theme, id, direction)); } if (isIncoming) { if (appendToPrevious) { diff --git a/Swift/QtUI/QtAdHocCommandWindow.cpp b/Swift/QtUI/QtAdHocCommandWindow.cpp index e638523..6b982b1 100644 --- a/Swift/QtUI/QtAdHocCommandWindow.cpp +++ b/Swift/QtUI/QtAdHocCommandWindow.cpp @@ -19,7 +19,7 @@ const int FormLayoutIndex = 1; namespace Swift { -QtAdHocCommandWindow::QtAdHocCommandWindow(boost::shared_ptr command) : command_(command) { +QtAdHocCommandWindow::QtAdHocCommandWindow(std::shared_ptr command) : command_(command) { formWidget_ = nullptr; setAttribute(Qt::WA_DeleteOnClose); diff --git a/Swift/QtUI/QtAdHocCommandWindow.h b/Swift/QtUI/QtAdHocCommandWindow.h index 61cd5be..1135ef9 100644 --- a/Swift/QtUI/QtAdHocCommandWindow.h +++ b/Swift/QtUI/QtAdHocCommandWindow.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -22,7 +22,7 @@ namespace Swift { class QtAdHocCommandWindow : public QWidget, public AdHocCommandWindow { Q_OBJECT public: - QtAdHocCommandWindow(boost::shared_ptr command); + QtAdHocCommandWindow(std::shared_ptr command); virtual ~QtAdHocCommandWindow(); virtual void setOnline(bool online); @@ -41,7 +41,7 @@ namespace Swift { void handleCompleteClicked(); private: - boost::shared_ptr command_; + std::shared_ptr command_; QtFormWidget* formWidget_; Form::ref form_; QLabel* label_; diff --git a/Swift/QtUI/QtAdHocCommandWithJIDWindow.cpp b/Swift/QtUI/QtAdHocCommandWithJIDWindow.cpp index 69e1d68..1b114d9 100644 --- a/Swift/QtUI/QtAdHocCommandWithJIDWindow.cpp +++ b/Swift/QtUI/QtAdHocCommandWithJIDWindow.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -52,7 +52,7 @@ QtAdHocCommandWithJIDWindow::~QtAdHocCommandWithJIDWindow() { void QtAdHocCommandWithJIDWindow::handleAcceptClick() { const JID jid = JID(Q2PSTRING(jid_->text())); const std::string node = Q2PSTRING(node_->text()); - boost::shared_ptr event(new RequestAdHocWithJIDUIEvent(jid, node)); + std::shared_ptr event(new RequestAdHocWithJIDUIEvent(jid, node)); uiEventStream_->send(event); accept(); } diff --git a/Swift/QtUI/QtAddBookmarkWindow.cpp b/Swift/QtUI/QtAddBookmarkWindow.cpp index 500b298..8c5d662 100644 --- a/Swift/QtUI/QtAddBookmarkWindow.cpp +++ b/Swift/QtUI/QtAddBookmarkWindow.cpp @@ -19,7 +19,7 @@ QtAddBookmarkWindow::QtAddBookmarkWindow(UIEventStream* eventStream, const MUCBo bool QtAddBookmarkWindow::commit() { boost::optional bookmark = createBookmarkFromForm(); if (bookmark) { - eventStream_->send(boost::shared_ptr(new AddMUCBookmarkUIEvent(*bookmark))); + eventStream_->send(std::make_shared(*bookmark)); return true; } else { diff --git a/Swift/QtUI/QtChatView.h b/Swift/QtUI/QtChatView.h index cca3bdf..fd13cc2 100644 --- a/Swift/QtUI/QtChatView.h +++ b/Swift/QtUI/QtChatView.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include @@ -28,11 +28,11 @@ namespace Swift { /** Add message to window. * @return id of added message (for acks). */ - virtual std::string addMessage(const ChatWindow::ChatMessage& message, const std::string& senderName, bool senderIsSelf, boost::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) = 0; + virtual std::string addMessage(const ChatWindow::ChatMessage& message, const std::string& senderName, bool senderIsSelf, std::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) = 0; /** Adds action to window. * @return id of added message (for acks); */ - virtual std::string addAction(const ChatWindow::ChatMessage& message, const std::string& senderName, bool senderIsSelf, boost::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) = 0; + virtual std::string addAction(const ChatWindow::ChatMessage& message, const std::string& senderName, bool senderIsSelf, std::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) = 0; virtual std::string addSystemMessage(const ChatWindow::ChatMessage& message, ChatWindow::Direction direction) = 0; virtual void addPresenceMessage(const ChatWindow::ChatMessage& message, ChatWindow::Direction direction) = 0; diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp index 6cb2292..a828210 100644 --- a/Swift/QtUI/QtChatWindow.cpp +++ b/Swift/QtUI/QtChatWindow.cpp @@ -6,9 +6,10 @@ #include +#include + #include #include -#include #include #include @@ -630,7 +631,7 @@ void QtChatWindow::dropEvent(QDropEvent *event) { else { std::string messageText(Q2PSTRING(tr("Sending of multiple files at once isn't supported at this time."))); ChatMessage message; - message.append(boost::make_shared(messageText)); + message.append(std::make_shared(messageText)); addSystemMessage(message, DefaultDirection); } } @@ -866,12 +867,12 @@ void QtChatWindow::addMUCInvitation(const std::string& senderName, const JID& ji messageLog_->addMUCInvitation(senderName, jid, reason, password, direct, isImpromptu, isContinuation); } -std::string QtChatWindow::addMessage(const ChatMessage& message, const std::string& senderName, bool senderIsSelf, boost::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) { +std::string QtChatWindow::addMessage(const ChatMessage& message, const std::string& senderName, bool senderIsSelf, std::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) { handleAppendedToLog(); return messageLog_->addMessage(message, senderName, senderIsSelf, label, avatarPath, time); } -std::string QtChatWindow::addAction(const ChatMessage& message, const std::string& senderName, bool senderIsSelf, boost::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) { +std::string QtChatWindow::addAction(const ChatMessage& message, const std::string& senderName, bool senderIsSelf, std::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) { handleAppendedToLog(); return messageLog_->addAction(message, senderName, senderIsSelf, label, avatarPath, time); } diff --git a/Swift/QtUI/QtChatWindow.h b/Swift/QtUI/QtChatWindow.h index 00693d2..25a1948 100644 --- a/Swift/QtUI/QtChatWindow.h +++ b/Swift/QtUI/QtChatWindow.h @@ -55,7 +55,7 @@ namespace Swift { if (!index.isValid()) { return QVariant(); } - boost::shared_ptr label = availableLabels_[index.row()].getLabel(); + std::shared_ptr label = availableLabels_[index.row()].getLabel(); if (label && role == Qt::TextColorRole) { return P2QSTRING(label->getForegroundColor()); } @@ -80,8 +80,8 @@ namespace Swift { public: QtChatWindow(const QString& contact, QtChatTheme* theme, UIEventStream* eventStream, SettingsProvider* settings, const std::map& emoticons); virtual ~QtChatWindow(); - std::string addMessage(const ChatMessage& message, const std::string &senderName, bool senderIsSelf, boost::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time); - std::string addAction(const ChatMessage& message, const std::string &senderName, bool senderIsSelf, boost::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time); + std::string addMessage(const ChatMessage& message, const std::string &senderName, bool senderIsSelf, std::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time); + std::string addAction(const ChatMessage& message, const std::string &senderName, bool senderIsSelf, std::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time); std::string addSystemMessage(const ChatMessage& message, Direction direction); void addPresenceMessage(const ChatMessage& message, Direction direction); diff --git a/Swift/QtUI/QtContactEditWidget.h b/Swift/QtUI/QtContactEditWidget.h index 5c081e9..d4ea609 100644 --- a/Swift/QtUI/QtContactEditWidget.h +++ b/Swift/QtUI/QtContactEditWidget.h @@ -7,12 +7,11 @@ #pragma once #include +#include #include #include #include -#include - #include class QLabel; diff --git a/Swift/QtUI/QtEditBookmarkWindow.cpp b/Swift/QtUI/QtEditBookmarkWindow.cpp index a17b1aa..1d6b467 100644 --- a/Swift/QtUI/QtEditBookmarkWindow.cpp +++ b/Swift/QtUI/QtEditBookmarkWindow.cpp @@ -22,7 +22,7 @@ bool QtEditBookmarkWindow::commit() { if (!bookmark) { return false; } - eventStream_->send(boost::shared_ptr(new EditMUCBookmarkUIEvent(bookmark_, *bookmark))); + eventStream_->send(std::make_shared(bookmark_, *bookmark)); return true; } diff --git a/Swift/QtUI/QtFormWidget.cpp b/Swift/QtUI/QtFormWidget.cpp index 31f9a10..1d26815 100644 --- a/Swift/QtUI/QtFormWidget.cpp +++ b/Swift/QtUI/QtFormWidget.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -156,8 +157,8 @@ QWidget* QtFormWidget::createWidget(FormField::ref field, const FormField::Type Form::ref QtFormWidget::getCompletedForm() { Form::ref result(new Form(Form::SubmitType)); - foreach (boost::shared_ptr field, form_->getFields()) { - boost::shared_ptr resultField = boost::make_shared(field->getType()); + foreach (std::shared_ptr field, form_->getFields()) { + std::shared_ptr resultField = std::make_shared(field->getType()); if (field->getType() == FormField::BooleanType) { resultField->setBoolValue(qobject_cast(fields_[field->getName()])->checkState() == Qt::Checked); } @@ -225,7 +226,7 @@ void QtFormWidget::setEditable(bool editable) { if (!form_) { return; } - foreach (boost::shared_ptr field, form_->getFields()) { + foreach (std::shared_ptr field, form_->getFields()) { QWidget* widget = nullptr; if (field) { widget = fields_[field->getName()]; diff --git a/Swift/QtUI/QtHistoryWindow.cpp b/Swift/QtUI/QtHistoryWindow.cpp index 035e73f..53e7ffe 100644 --- a/Swift/QtUI/QtHistoryWindow.cpp +++ b/Swift/QtUI/QtHistoryWindow.cpp @@ -12,12 +12,11 @@ #include +#include #include #include #include -#include -#include #include #include @@ -138,14 +137,14 @@ void QtHistoryWindow::addMessage(const std::string &message, const std::string & if (addAtTheTop) { bool appendToPrevious = ((senderIsSelf && previousTopMessageWasSelf_) || (!senderIsSelf && !previousTopMessageWasSelf_&& previousTopSenderName_ == P2QSTRING(senderName))); - conversation_->addMessageTop(boost::shared_ptr(new MessageSnippet(messageHTML, QtUtilities::htmlEscape(P2QSTRING(senderName)), qTime, qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), ChatSnippet::getDirection(message)))); + conversation_->addMessageTop(std::make_shared(messageHTML, QtUtilities::htmlEscape(P2QSTRING(senderName)), qTime, qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), ChatSnippet::getDirection(message))); previousTopMessageWasSelf_ = senderIsSelf; previousTopSenderName_ = P2QSTRING(senderName); } else { bool appendToPrevious = ((senderIsSelf && previousBottomMessageWasSelf_) || (!senderIsSelf && !previousBottomMessageWasSelf_&& previousBottomSenderName_ == P2QSTRING(senderName))); - conversation_->addMessageBottom(boost::make_shared(messageHTML, QtUtilities::htmlEscape(P2QSTRING(senderName)), qTime, qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), ChatSnippet::getDirection(message))); + conversation_->addMessageBottom(std::make_shared(messageHTML, QtUtilities::htmlEscape(P2QSTRING(senderName)), qTime, qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), ChatSnippet::getDirection(message))); previousBottomMessageWasSelf_ = senderIsSelf; previousBottomSenderName_ = P2QSTRING(senderName); } diff --git a/Swift/QtUI/QtJoinMUCWindow.cpp b/Swift/QtUI/QtJoinMUCWindow.cpp index 7225b06..ec2028c 100644 --- a/Swift/QtUI/QtJoinMUCWindow.cpp +++ b/Swift/QtUI/QtJoinMUCWindow.cpp @@ -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. */ #include -#include +#include #include @@ -49,7 +49,7 @@ void QtJoinMUCWindow::handleJoin() { lastSetNick = Q2PSTRING(ui.nickName->text()); std::string password = Q2PSTRING(ui.password->text()); JID room(Q2PSTRING(ui.room->text())); - uiEventStream->send(boost::make_shared(room, password, lastSetNick, ui.joinAutomatically->isChecked(), !ui.instantRoom->isChecked())); + uiEventStream->send(std::make_shared(room, password, lastSetNick, ui.joinAutomatically->isChecked(), !ui.instantRoom->isChecked())); hide(); } diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp index 11458f0..b2778a1 100644 --- a/Swift/QtUI/QtLoginWindow.cpp +++ b/Swift/QtUI/QtLoginWindow.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include @@ -399,12 +399,12 @@ void QtLoginWindow::loginClicked() { if (!certificateString.empty()) { #if defined(HAVE_SCHANNEL) if (isCAPIURI(certificateString)) { - certificate = boost::make_shared(certificateString, timerFactory_); + certificate = std::make_shared(certificateString, timerFactory_); } else { - certificate = boost::make_shared(certificateString, createSafeByteArray(Q2PSTRING(password_->text()))); + certificate = std::make_shared(certificateString, createSafeByteArray(Q2PSTRING(password_->text()))); } #else - certificate = boost::make_shared(certificateString, createSafeByteArray(Q2PSTRING(password_->text()))); + certificate = std::make_shared(certificateString, createSafeByteArray(Q2PSTRING(password_->text()))); #endif } @@ -454,15 +454,15 @@ void QtLoginWindow::handleAbout() { } void QtLoginWindow::handleShowXMLConsole() { - uiEventStream_->send(boost::make_shared()); + uiEventStream_->send(std::make_shared()); } void QtLoginWindow::handleShowFileTransferOverview() { - uiEventStream_->send(boost::make_shared()); + uiEventStream_->send(std::make_shared()); } void QtLoginWindow::handleShowHighlightEditor() { - uiEventStream_->send(boost::make_shared()); + uiEventStream_->send(std::make_shared()); } void QtLoginWindow::handleToggleSounds(bool enabled) { diff --git a/Swift/QtUI/QtMainWindow.cpp b/Swift/QtUI/QtMainWindow.cpp index e351bd3..611fc80 100644 --- a/Swift/QtUI/QtMainWindow.cpp +++ b/Swift/QtUI/QtMainWindow.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -225,7 +225,7 @@ void QtMainWindow::handleShowCertificateInfo() { } void QtMainWindow::handleEditBlockingList() { - uiEventStream_->send(boost::make_shared()); + uiEventStream_->send(std::make_shared()); } void QtMainWindow::handleSomethingSelectedChanged(bool itemSelected) { @@ -246,7 +246,7 @@ void QtMainWindow::setRosterModel(Roster* roster) { } void QtMainWindow::handleEditProfileRequest() { - uiEventStream_->send(boost::make_shared()); + uiEventStream_->send(std::make_shared()); } void QtMainWindow::handleEventCountUpdated(int count) { @@ -272,12 +272,12 @@ void QtMainWindow::handleChatCountUpdated(int count) { } void QtMainWindow::handleAddUserActionTriggered(bool /*checked*/) { - boost::shared_ptr event(new RequestAddUserDialogUIEvent()); + std::shared_ptr event(new RequestAddUserDialogUIEvent()); uiEventStream_->send(event); } void QtMainWindow::handleChatUserActionTriggered(bool /*checked*/) { - boost::shared_ptr event(new RequestChatWithUserDialogUIEvent()); + std::shared_ptr event(new RequestChatWithUserDialogUIEvent()); uiEventStream_->send(event); } @@ -291,15 +291,15 @@ void QtMainWindow::handleSignOutAction() { } void QtMainWindow::handleEditProfileAction() { - uiEventStream_->send(boost::make_shared()); + uiEventStream_->send(std::make_shared()); } void QtMainWindow::handleJoinMUCAction() { - uiEventStream_->send(boost::make_shared()); + uiEventStream_->send(std::make_shared()); } void QtMainWindow::handleViewLogsAction() { - uiEventStream_->send(boost::make_shared()); + uiEventStream_->send(std::make_shared()); } void QtMainWindow::handleStatusChanged(StatusShow::Type showType, const QString &statusMessage) { @@ -363,7 +363,7 @@ void QtMainWindow::setMyStatusType(StatusShow::Type type) { serverAdHocMenu_->setEnabled(online); } -void QtMainWindow::setMyContactRosterItem(boost::shared_ptr contact) { +void QtMainWindow::setMyContactRosterItem(std::shared_ptr contact) { meView_->setContactRosterItem(contact); } @@ -393,7 +393,7 @@ void QtMainWindow::handleAdHocActionTriggered(bool /*checked*/) { QAction* action = qobject_cast(sender()); assert(action); DiscoItems::Item command = serverAdHocCommands_[serverAdHocCommandActions_.indexOf(action)]; - uiEventStream_->send(boost::shared_ptr(new RequestAdHocUIEvent(command))); + uiEventStream_->send(std::make_shared(command)); } void QtMainWindow::setAvailableAdHocCommands(const std::vector& commands) { diff --git a/Swift/QtUI/QtMainWindow.h b/Swift/QtUI/QtMainWindow.h index d90dade..c46fdfc 100644 --- a/Swift/QtUI/QtMainWindow.h +++ b/Swift/QtUI/QtMainWindow.h @@ -47,7 +47,7 @@ namespace Swift { void setMyAvatarPath(const std::string& path); void setMyStatusText(const std::string& status); void setMyStatusType(StatusShow::Type type); - void setMyContactRosterItem(boost::shared_ptr contact); + void setMyContactRosterItem(std::shared_ptr contact); void setConnecting(); void setStreamEncryptionStatus(bool tlsInPlaceAndValid); void openCertificateDialog(const std::vector& chain); diff --git a/Swift/QtUI/QtPlainChatView.cpp b/Swift/QtUI/QtPlainChatView.cpp index fc53666..d682cfa 100644 --- a/Swift/QtUI/QtPlainChatView.cpp +++ b/Swift/QtUI/QtPlainChatView.cpp @@ -45,28 +45,28 @@ QtPlainChatView::~QtPlainChatView() { QString chatMessageToString(const ChatWindow::ChatMessage& message) { QString result; - foreach (boost::shared_ptr part, message.getParts()) { - boost::shared_ptr textPart; - boost::shared_ptr uriPart; - boost::shared_ptr emoticonPart; - boost::shared_ptr highlightPart; + foreach (std::shared_ptr part, message.getParts()) { + std::shared_ptr textPart; + std::shared_ptr uriPart; + std::shared_ptr emoticonPart; + std::shared_ptr highlightPart; - if ((textPart = boost::dynamic_pointer_cast(part))) { + if ((textPart = std::dynamic_pointer_cast(part))) { QString text = QtUtilities::htmlEscape(P2QSTRING(textPart->text)); text.replace("\n","
"); result += text; continue; } - if ((uriPart = boost::dynamic_pointer_cast(part))) { + if ((uriPart = std::dynamic_pointer_cast(part))) { QString uri = QtUtilities::htmlEscape(P2QSTRING(uriPart->target)); result += "" + uri + ""; continue; } - if ((emoticonPart = boost::dynamic_pointer_cast(part))) { + if ((emoticonPart = std::dynamic_pointer_cast(part))) { result += P2QSTRING(emoticonPart->alternativeText); continue; } - if ((highlightPart = boost::dynamic_pointer_cast(part))) { + if ((highlightPart = std::dynamic_pointer_cast(part))) { //FIXME: Maybe do something here. Anything, really. continue; } @@ -74,7 +74,7 @@ QString chatMessageToString(const ChatWindow::ChatMessage& message) { return result; } -std::string QtPlainChatView::addMessage(const ChatWindow::ChatMessage& message, const std::string& senderName, bool senderIsSelf, boost::shared_ptr label, const std::string& /*avatarPath*/, const boost::posix_time::ptime& time) { +std::string QtPlainChatView::addMessage(const ChatWindow::ChatMessage& message, const std::string& senderName, bool senderIsSelf, std::shared_ptr label, const std::string& /*avatarPath*/, const boost::posix_time::ptime& time) { QString text = "

"; if (label) { text += P2QSTRING(label->getLabel()) + "
"; @@ -89,7 +89,7 @@ std::string QtPlainChatView::addMessage(const ChatWindow::ChatMessage& message, return idx; } -std::string QtPlainChatView::addAction(const ChatWindow::ChatMessage& message, const std::string& senderName, bool senderIsSelf, boost::shared_ptr label, const std::string& /*avatarPath*/, const boost::posix_time::ptime& time) { +std::string QtPlainChatView::addAction(const ChatWindow::ChatMessage& message, const std::string& senderName, bool senderIsSelf, std::shared_ptr label, const std::string& /*avatarPath*/, const boost::posix_time::ptime& time) { QString text = "

"; if (label) { text += P2QSTRING(label->getLabel()) + "
"; @@ -328,7 +328,7 @@ void QtPlainChatView::acceptMUCInvite() { AcceptMUCInviteAction *action = dynamic_cast(sender()); if (action) { - eventStream_->send(boost::make_shared(action->jid_.toString(), action->password_, boost::optional(), false, false, action->isImpromptu_, action->isContinuation_)); + eventStream_->send(std::make_shared(action->jid_.toString(), action->password_, boost::optional(), false, false, action->isImpromptu_, action->isContinuation_)); delete action->parent_; } } diff --git a/Swift/QtUI/QtPlainChatView.h b/Swift/QtUI/QtPlainChatView.h index cd6ab7e..2a9b3e1 100644 --- a/Swift/QtUI/QtPlainChatView.h +++ b/Swift/QtUI/QtPlainChatView.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -35,11 +35,11 @@ namespace Swift { /** Add message to window. * @return id of added message (for acks). */ - virtual std::string addMessage(const ChatWindow::ChatMessage& /*message*/, const std::string& /*senderName*/, bool /*senderIsSelf*/, boost::shared_ptr /*label*/, const std::string& /*avatarPath*/, const boost::posix_time::ptime& /*time*/); + virtual std::string addMessage(const ChatWindow::ChatMessage& /*message*/, const std::string& /*senderName*/, bool /*senderIsSelf*/, std::shared_ptr /*label*/, const std::string& /*avatarPath*/, const boost::posix_time::ptime& /*time*/); /** Adds action to window. * @return id of added message (for acks); */ - virtual std::string addAction(const ChatWindow::ChatMessage& /*message*/, const std::string& /*senderName*/, bool /*senderIsSelf*/, boost::shared_ptr /*label*/, const std::string& /*avatarPath*/, const boost::posix_time::ptime& /*time*/); + virtual std::string addAction(const ChatWindow::ChatMessage& /*message*/, const std::string& /*senderName*/, bool /*senderIsSelf*/, std::shared_ptr /*label*/, const std::string& /*avatarPath*/, const boost::posix_time::ptime& /*time*/); virtual std::string addSystemMessage(const ChatWindow::ChatMessage& /*message*/, ChatWindow::Direction /*direction*/); virtual void addPresenceMessage(const ChatWindow::ChatMessage& /*message*/, ChatWindow::Direction /*direction*/); @@ -127,7 +127,7 @@ namespace Swift { UIEventStream* eventStream_; LogTextEdit* log_; FileTransferMap fileTransfers_; - std::map > lastMessageLabel_; + std::map > lastMessageLabel_; int idGenerator_; }; diff --git a/Swift/QtUI/QtRosterHeader.cpp b/Swift/QtUI/QtRosterHeader.cpp index 56c3104..11dacb0 100644 --- a/Swift/QtUI/QtRosterHeader.cpp +++ b/Swift/QtUI/QtRosterHeader.cpp @@ -128,7 +128,7 @@ void QtRosterHeader::setNick(const QString& nick) { nameWidget_->setNick(nick); } -void QtRosterHeader::setContactRosterItem(boost::shared_ptr contact) { +void QtRosterHeader::setContactRosterItem(std::shared_ptr contact) { contact_ = contact; } diff --git a/Swift/QtUI/QtRosterHeader.h b/Swift/QtUI/QtRosterHeader.h index 7447c88..8370eb5 100644 --- a/Swift/QtUI/QtRosterHeader.h +++ b/Swift/QtUI/QtRosterHeader.h @@ -38,7 +38,7 @@ namespace Swift { void setJID(const QString& jid); void setNick(const QString& nick); - void setContactRosterItem(boost::shared_ptr contact); + void setContactRosterItem(std::shared_ptr contact); void setStatusText(const QString& statusMessage); void setStatusType(StatusShow::Type type); @@ -61,6 +61,6 @@ namespace Swift { QtStatusWidget* statusWidget_; QToolButton* securityInfoButton_; static const int avatarSize_; - boost::shared_ptr contact_; + std::shared_ptr contact_; }; } diff --git a/Swift/QtUI/QtSubscriptionRequestWindow.cpp b/Swift/QtUI/QtSubscriptionRequestWindow.cpp index 9e1fc37..eea13f2 100644 --- a/Swift/QtUI/QtSubscriptionRequestWindow.cpp +++ b/Swift/QtUI/QtSubscriptionRequestWindow.cpp @@ -14,7 +14,7 @@ #include namespace Swift { -QtSubscriptionRequestWindow::QtSubscriptionRequestWindow(boost::shared_ptr event, QWidget* parent) : QDialog(parent), event_(event) { +QtSubscriptionRequestWindow::QtSubscriptionRequestWindow(std::shared_ptr event, QWidget* parent) : QDialog(parent), event_(event) { QString text = QString(tr("%1 would like to add you to their contact list.")).arg(P2QSTRING(event->getJID().toString())); QVBoxLayout* layout = new QVBoxLayout(); QLabel* label = new QLabel(text, this); @@ -72,7 +72,7 @@ QtSubscriptionRequestWindow::~QtSubscriptionRequestWindow() { windows_.removeOne(this); } -QtSubscriptionRequestWindow* QtSubscriptionRequestWindow::getWindow(boost::shared_ptr event, QWidget* parent) { +QtSubscriptionRequestWindow* QtSubscriptionRequestWindow::getWindow(std::shared_ptr event, QWidget* parent) { foreach (QtSubscriptionRequestWindow* window, windows_) { if (window->getEvent() == event) { return window; @@ -83,7 +83,7 @@ QtSubscriptionRequestWindow* QtSubscriptionRequestWindow::getWindow(boost::share return window; } -boost::shared_ptr QtSubscriptionRequestWindow::getEvent() { +std::shared_ptr QtSubscriptionRequestWindow::getEvent() { return event_; } diff --git a/Swift/QtUI/QtSubscriptionRequestWindow.h b/Swift/QtUI/QtSubscriptionRequestWindow.h index 83c6333..3f1e816 100644 --- a/Swift/QtUI/QtSubscriptionRequestWindow.h +++ b/Swift/QtUI/QtSubscriptionRequestWindow.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include @@ -16,17 +16,17 @@ namespace Swift { class QtSubscriptionRequestWindow : public QDialog { Q_OBJECT public: - static QtSubscriptionRequestWindow* getWindow(boost::shared_ptr event, QWidget* parent = nullptr); + static QtSubscriptionRequestWindow* getWindow(std::shared_ptr event, QWidget* parent = nullptr); ~QtSubscriptionRequestWindow(); - boost::shared_ptr getEvent(); + std::shared_ptr getEvent(); private slots: void handleYes(); void handleNo(); void handleDefer(); private: - QtSubscriptionRequestWindow(boost::shared_ptr event, QWidget* parent = nullptr); + QtSubscriptionRequestWindow(std::shared_ptr event, QWidget* parent = nullptr); static QList windows_; - boost::shared_ptr event_; + std::shared_ptr event_; /*QPushButton* yesButton_; QPushButton* noButton_; QPushButton* deferButton_;*/ diff --git a/Swift/QtUI/QtUIFactory.cpp b/Swift/QtUI/QtUIFactory.cpp index 3318c21..a9e0e8f 100644 --- a/Swift/QtUI/QtUIFactory.cpp +++ b/Swift/QtUI/QtUIFactory.cpp @@ -159,7 +159,7 @@ ContactEditWindow* QtUIFactory::createContactEditWindow() { return new QtContactEditWindow(); } -WhiteboardWindow* QtUIFactory::createWhiteboardWindow(boost::shared_ptr whiteboardSession) { +WhiteboardWindow* QtUIFactory::createWhiteboardWindow(std::shared_ptr whiteboardSession) { return new QtWhiteboardWindow(whiteboardSession); } @@ -171,7 +171,7 @@ BlockListEditorWidget *QtUIFactory::createBlockListEditorWidget() { return new QtBlockListEditorWindow(); } -AdHocCommandWindow* QtUIFactory::createAdHocCommandWindow(boost::shared_ptr command) { +AdHocCommandWindow* QtUIFactory::createAdHocCommandWindow(std::shared_ptr command) { return new QtAdHocCommandWindow(command); } diff --git a/Swift/QtUI/QtUIFactory.h b/Swift/QtUI/QtUIFactory.h index c72bf63..a57d509 100644 --- a/Swift/QtUI/QtUIFactory.h +++ b/Swift/QtUI/QtUIFactory.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -48,10 +48,10 @@ namespace Swift { virtual ProfileWindow* createProfileWindow(); virtual ContactEditWindow* createContactEditWindow(); virtual FileTransferListWidget* createFileTransferListWidget(); - virtual WhiteboardWindow* createWhiteboardWindow(boost::shared_ptr whiteboardSession); + virtual WhiteboardWindow* createWhiteboardWindow(std::shared_ptr whiteboardSession); virtual HighlightEditorWindow* createHighlightEditorWindow(); virtual BlockListEditorWidget* createBlockListEditorWidget(); - virtual AdHocCommandWindow* createAdHocCommandWindow(boost::shared_ptr command); + virtual AdHocCommandWindow* createAdHocCommandWindow(std::shared_ptr command); private slots: void handleLoginWindowGeometryChanged(); diff --git a/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp b/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp index fffd4b3..c5f99f0 100644 --- a/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp +++ b/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp @@ -52,17 +52,17 @@ QtVCardWidget::QtVCardWidget(QWidget* parent) : toolButton->hide(); toolButton->setMenu(menu); - addFieldType(menu, boost::make_shared()); - addFieldType(menu, boost::make_shared()); - addFieldType(menu, boost::make_shared()); - addFieldType(menu, boost::make_shared()); - addFieldType(menu, boost::make_shared()); - addFieldType(menu, boost::make_shared()); - addFieldType(menu, boost::make_shared()); - addFieldType(menu, boost::make_shared()); - addFieldType(menu, boost::make_shared()); - addFieldType(menu, boost::make_shared()); - addFieldType(menu, boost::make_shared()); + addFieldType(menu, std::make_shared()); + addFieldType(menu, std::make_shared()); + addFieldType(menu, std::make_shared()); + addFieldType(menu, std::make_shared()); + addFieldType(menu, std::make_shared()); + addFieldType(menu, std::make_shared()); + addFieldType(menu, std::make_shared()); + addFieldType(menu, std::make_shared()); + addFieldType(menu, std::make_shared()); + addFieldType(menu, std::make_shared()); + addFieldType(menu, std::make_shared()); setEditable(false); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); @@ -111,7 +111,7 @@ void QtVCardWidget::setEditable(bool editable) { void QtVCardWidget::setVCard(VCard::ref vcard) { clearFields(); - this->vcard = boost::make_shared(*vcard); + this->vcard = std::make_shared(*vcard); ui->photoAndName->setFormattedName(P2QSTRING(vcard->getFullName())); ui->photoAndName->setNickname(P2QSTRING(vcard->getNickname())); ui->photoAndName->setPrefix(P2QSTRING(vcard->getPrefix())); @@ -312,7 +312,7 @@ VCard::ref QtVCardWidget::getVCard() { void QtVCardWidget::addField() { QAction* action = nullptr; if ((action = dynamic_cast(sender()))) { - boost::shared_ptr fieldInfo = actionFieldInfo[action]; + std::shared_ptr fieldInfo = actionFieldInfo[action]; QWidget* newField = fieldInfo->createFieldInstance(this, ui->cardFields, true); QtVCardGeneralField* newGeneralField = dynamic_cast(newField); if (newGeneralField) { @@ -341,7 +341,7 @@ void QtVCardWidget::removeField(QtVCardGeneralField *field) { delete field; } -void QtVCardWidget::addFieldType(QMenu* menu, boost::shared_ptr fieldType) { +void QtVCardWidget::addFieldType(QMenu* menu, std::shared_ptr fieldType) { if (!fieldType->getMenuName().isEmpty()) { QAction* action = new QAction(tr("Add %1").arg(fieldType->getMenuName()), this); actionFieldInfo[action] = fieldType; @@ -350,7 +350,7 @@ void QtVCardWidget::addFieldType(QMenu* menu, boost::shared_ptr fieldType) { +int QtVCardWidget::fieldTypeInstances(std::shared_ptr fieldType) { int instances = 0; for (int n = 0; n < ui->cardFields->count(); n++) { if (fieldType->testInstance(ui->cardFields->itemAt(n)->widget())) instances++; diff --git a/Swift/QtUI/QtVCardWidget/QtVCardWidget.h b/Swift/QtUI/QtVCardWidget/QtVCardWidget.h index 76fc46c..5334016 100644 --- a/Swift/QtUI/QtVCardWidget/QtVCardWidget.h +++ b/Swift/QtUI/QtVCardWidget/QtVCardWidget.h @@ -12,7 +12,7 @@ #pragma once -#include +#include #include #include @@ -53,8 +53,8 @@ namespace Swift { void removeField(QtVCardGeneralField* field); private: - void addFieldType(QMenu*, boost::shared_ptr); - int fieldTypeInstances(boost::shared_ptr); + void addFieldType(QMenu*, std::shared_ptr); + int fieldTypeInstances(std::shared_ptr); void clearFields(); void clearEmptyFields(); void appendField(QtVCardGeneralField* field); @@ -67,7 +67,7 @@ namespace Swift { bool editable; QMenu* menu; std::list fields; - std::map > actionFieldInfo; + std::map > actionFieldInfo; }; } diff --git a/Swift/QtUI/QtWebKitChatView.cpp b/Swift/QtUI/QtWebKitChatView.cpp index 4193921..a40d0b3 100644 --- a/Swift/QtUI/QtWebKitChatView.cpp +++ b/Swift/QtUI/QtWebKitChatView.cpp @@ -118,7 +118,7 @@ void QtWebKitChatView::handleKeyPressEvent(QKeyEvent* event) { webView_->keyPressEvent(event); } -void QtWebKitChatView::addMessageBottom(boost::shared_ptr snippet) { +void QtWebKitChatView::addMessageBottom(std::shared_ptr snippet) { if (viewReady_) { addToDOM(snippet); } else { @@ -127,12 +127,12 @@ void QtWebKitChatView::addMessageBottom(boost::shared_ptr snippet) } } -void QtWebKitChatView::addMessageTop(boost::shared_ptr /* snippet */) { +void QtWebKitChatView::addMessageTop(std::shared_ptr /* snippet */) { // TODO: Implement this in a sensible manner later. assert(false); } -void QtWebKitChatView::addToDOM(boost::shared_ptr snippet) { +void QtWebKitChatView::addToDOM(std::shared_ptr snippet) { //qDebug() << snippet->getContent(); rememberScrolledToBottom(); @@ -475,7 +475,7 @@ std::string QtWebKitChatView::addMessage( const ChatWindow::ChatMessage& message, const std::string& senderName, bool senderIsSelf, - boost::shared_ptr label, + std::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) { return addMessage(chatMessageToHTML(message), senderName, senderIsSelf, label, avatarPath, "", time, message.getFullMessageHighlightAction(), ChatSnippet::getDirection(message)); @@ -499,30 +499,30 @@ QString QtWebKitChatView::getHighlightSpanStart(const HighlightAction& highlight QString QtWebKitChatView::chatMessageToHTML(const ChatWindow::ChatMessage& message) { QString result; - foreach (boost::shared_ptr part, message.getParts()) { - boost::shared_ptr textPart; - boost::shared_ptr uriPart; - boost::shared_ptr emoticonPart; - boost::shared_ptr highlightPart; + foreach (std::shared_ptr part, message.getParts()) { + std::shared_ptr textPart; + std::shared_ptr uriPart; + std::shared_ptr emoticonPart; + std::shared_ptr highlightPart; - if ((textPart = boost::dynamic_pointer_cast(part))) { + if ((textPart = std::dynamic_pointer_cast(part))) { QString text = QtUtilities::htmlEscape(P2QSTRING(textPart->text)); text.replace("\n","
"); result += text; continue; } - if ((uriPart = boost::dynamic_pointer_cast(part))) { + if ((uriPart = std::dynamic_pointer_cast(part))) { QString uri = QtUtilities::htmlEscape(P2QSTRING(uriPart->target)); result += "" + uri + ""; continue; } - if ((emoticonPart = boost::dynamic_pointer_cast(part))) { + if ((emoticonPart = std::dynamic_pointer_cast(part))) { QString textStyle = showEmoticons_ ? "style='display:none'" : ""; QString imageStyle = showEmoticons_ ? "" : "style='display:none'"; result += "" + QtUtilities::htmlEscape(P2QSTRING(emoticonPart->alternativeText)) + ""; continue; } - if ((highlightPart = boost::dynamic_pointer_cast(part))) { + if ((highlightPart = std::dynamic_pointer_cast(part))) { QString spanStart = getHighlightSpanStart(highlightPart->action.getTextColor(), highlightPart->action.getTextBackground()); result += spanStart + QtUtilities::htmlEscape(P2QSTRING(highlightPart->text)) + ""; continue; @@ -536,7 +536,7 @@ std::string QtWebKitChatView::addMessage( const QString& message, const std::string& senderName, bool senderIsSelf, - boost::shared_ptr label, + std::shared_ptr label, const std::string& avatarPath, const QString& style, const boost::posix_time::ptime& time, @@ -563,7 +563,7 @@ std::string QtWebKitChatView::addMessage( QString qAvatarPath = scaledAvatarPath.isEmpty() ? "qrc:/icons/avatar.png" : QUrl::fromLocalFile(scaledAvatarPath).toEncoded(); std::string id = "id" + boost::lexical_cast(idCounter_++); - addMessageBottom(boost::make_shared(htmlString, QtUtilities::htmlEscape(P2QSTRING(senderName)), B2QDATE(time), qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), direction)); + addMessageBottom(std::make_shared(htmlString, QtUtilities::htmlEscape(P2QSTRING(senderName)), B2QDATE(time), qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), direction)); previousMessageWasSelf_ = senderIsSelf; previousSenderName_ = P2QSTRING(senderName); @@ -571,7 +571,7 @@ std::string QtWebKitChatView::addMessage( return id; } -std::string QtWebKitChatView::addAction(const ChatWindow::ChatMessage& message, const std::string &senderName, bool senderIsSelf, boost::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) { +std::string QtWebKitChatView::addAction(const ChatWindow::ChatMessage& message, const std::string &senderName, bool senderIsSelf, std::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) { return addMessage(" *" + chatMessageToHTML(message) + "*", senderName, senderIsSelf, label, avatarPath, "font-style:italic ", time, message.getFullMessageHighlightAction(), ChatSnippet::getDirection(message)); } @@ -622,13 +622,13 @@ std::string QtWebKitChatView::addFileTransfer(const std::string& senderName, boo ""; } - //addMessage(message, senderName, senderIsSelf, boost::shared_ptr(), "", boost::posix_time::second_clock::local_time()); + //addMessage(message, senderName, senderIsSelf, std::shared_ptr(), "", boost::posix_time::second_clock::local_time()); bool appendToPrevious = appendToPreviousCheck(PreviousMessageWasFileTransfer, senderName, senderIsSelf); QString qAvatarPath = "qrc:/icons/avatar.png"; std::string id = "ftmessage" + boost::lexical_cast(idCounter_++); - addMessageBottom(boost::make_shared(htmlString, QtUtilities::htmlEscape(P2QSTRING(senderName)), B2QDATE(boost::posix_time::second_clock::universal_time()), qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), ChatSnippet::getDirection(actionText))); + addMessageBottom(std::make_shared(htmlString, QtUtilities::htmlEscape(P2QSTRING(senderName)), B2QDATE(boost::posix_time::second_clock::universal_time()), qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), ChatSnippet::getDirection(actionText))); previousMessageWasSelf_ = senderIsSelf; previousSenderName_ = P2QSTRING(senderName); @@ -662,7 +662,7 @@ std::string QtWebKitChatView::addWhiteboardRequest(const QString& contact, bool } QString qAvatarPath = "qrc:/icons/avatar.png"; std::string id = "wbmessage" + boost::lexical_cast(idCounter_++); - addMessageBottom(boost::make_shared(htmlString, QtUtilities::htmlEscape(contact), B2QDATE(boost::posix_time::second_clock::universal_time()), qAvatarPath, false, false, theme_, P2QSTRING(id), ChatSnippet::getDirection(actionText))); + addMessageBottom(std::make_shared(htmlString, QtUtilities::htmlEscape(contact), B2QDATE(boost::posix_time::second_clock::universal_time()), qAvatarPath, false, false, theme_, P2QSTRING(id), ChatSnippet::getDirection(actionText))); previousMessageWasSelf_ = false; previousSenderName_ = contact; return Q2PSTRING(wb_id); @@ -780,7 +780,7 @@ void QtWebKitChatView::handleHTMLButtonClicked(QString id, QString encodedArgume QString elementID = arg3; QString isImpromptu = arg4; QString isContinuation = arg5; - eventStream_->send(boost::make_shared(Q2PSTRING(roomJID), Q2PSTRING(password), boost::optional(), false, false, isImpromptu.contains("true"), isContinuation.contains("true"))); + eventStream_->send(std::make_shared(Q2PSTRING(roomJID), Q2PSTRING(password), boost::optional(), false, false, isImpromptu.contains("true"), isContinuation.contains("true"))); setMUCInvitationJoined(elementID); } else { @@ -795,7 +795,7 @@ void QtWebKitChatView::addErrorMessage(const ChatWindow::ChatMessage& errorMessa QString errorMessageHTML(chatMessageToHTML(errorMessage)); std::string id = "id" + boost::lexical_cast(idCounter_++); - addMessageBottom(boost::make_shared("" + errorMessageHTML + "", QDateTime::currentDateTime(), false, theme_, P2QSTRING(id), ChatSnippet::getDirection(errorMessage))); + addMessageBottom(std::make_shared("" + errorMessageHTML + "", QDateTime::currentDateTime(), false, theme_, P2QSTRING(id), ChatSnippet::getDirection(errorMessage))); previousMessageWasSelf_ = false; previousMessageKind_ = PreviousMessageWasSystem; @@ -808,7 +808,7 @@ std::string QtWebKitChatView::addSystemMessage(const ChatWindow::ChatMessage& me QString messageHTML = chatMessageToHTML(message); std::string id = "id" + boost::lexical_cast(idCounter_++); - addMessageBottom(boost::make_shared(messageHTML, QDateTime::currentDateTime(), false, theme_, P2QSTRING(id), getActualDirection(message, direction))); + addMessageBottom(std::make_shared(messageHTML, QDateTime::currentDateTime(), false, theme_, P2QSTRING(id), getActualDirection(message, direction))); previousMessageKind_ = PreviousMessageWasSystem; return id; @@ -874,7 +874,7 @@ void QtWebKitChatView::addPresenceMessage(const ChatWindow::ChatMessage& message QString messageHTML = chatMessageToHTML(message); std::string id = "id" + boost::lexical_cast(idCounter_++); - addMessageBottom(boost::make_shared(messageHTML, QDateTime::currentDateTime(), false, theme_, P2QSTRING(id), getActualDirection(message, direction))); + addMessageBottom(std::make_shared(messageHTML, QDateTime::currentDateTime(), false, theme_, P2QSTRING(id), getActualDirection(message, direction))); previousMessageKind_ = PreviousMessageWasPresence; } @@ -913,7 +913,7 @@ void QtWebKitChatView::addMUCInvitation(const std::string& senderName, const JID QString qAvatarPath = "qrc:/icons/avatar.png"; - addMessageBottom(boost::make_shared(htmlString, QtUtilities::htmlEscape(P2QSTRING(senderName)), B2QDATE(boost::posix_time::second_clock::universal_time()), qAvatarPath, false, appendToPrevious, theme_, id, ChatSnippet::getDirection(message))); + addMessageBottom(std::make_shared(htmlString, QtUtilities::htmlEscape(P2QSTRING(senderName)), B2QDATE(boost::posix_time::second_clock::universal_time()), qAvatarPath, false, appendToPrevious, theme_, id, ChatSnippet::getDirection(message))); previousMessageWasSelf_ = false; previousSenderName_ = P2QSTRING(senderName); previousMessageKind_ = PreviousMessageWasMUCInvite; diff --git a/Swift/QtUI/QtWebKitChatView.h b/Swift/QtUI/QtWebKitChatView.h index e3fb967..31bf8a5 100644 --- a/Swift/QtUI/QtWebKitChatView.h +++ b/Swift/QtUI/QtWebKitChatView.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -50,11 +50,11 @@ namespace Swift { /** Add message to window. * @return id of added message (for acks). */ - virtual std::string addMessage(const ChatWindow::ChatMessage& message, const std::string& senderName, bool senderIsSelf, boost::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) SWIFTEN_OVERRIDE; + virtual std::string addMessage(const ChatWindow::ChatMessage& message, const std::string& senderName, bool senderIsSelf, std::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) SWIFTEN_OVERRIDE; /** Adds action to window. * @return id of added message (for acks); */ - virtual std::string addAction(const ChatWindow::ChatMessage& message, const std::string& senderName, bool senderIsSelf, boost::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) SWIFTEN_OVERRIDE; + virtual std::string addAction(const ChatWindow::ChatMessage& message, const std::string& senderName, bool senderIsSelf, std::shared_ptr label, const std::string& avatarPath, const boost::posix_time::ptime& time) SWIFTEN_OVERRIDE; virtual std::string addSystemMessage(const ChatWindow::ChatMessage& message, ChatWindow::Direction direction) SWIFTEN_OVERRIDE; virtual void addPresenceMessage(const ChatWindow::ChatMessage& message, ChatWindow::Direction direction) SWIFTEN_OVERRIDE; @@ -75,8 +75,8 @@ namespace Swift { virtual void setMessageReceiptState(const std::string& id, ChatWindow::ReceiptState state) SWIFTEN_OVERRIDE; virtual void showEmoticons(bool show) SWIFTEN_OVERRIDE; - void addMessageTop(boost::shared_ptr snippet); - void addMessageBottom(boost::shared_ptr snippet); + void addMessageTop(std::shared_ptr snippet); + void addMessageBottom(std::shared_ptr snippet); int getSnippetPositionByDate(const QDate& date); // FIXME : This probably shouldn't have been public virtual void addLastSeenLine() SWIFTEN_OVERRIDE; @@ -140,7 +140,7 @@ namespace Swift { const QString& message, const std::string& senderName, bool senderIsSelf, - boost::shared_ptr label, + std::shared_ptr label, const std::string& avatarPath, const QString& style, const boost::posix_time::ptime& time, @@ -162,7 +162,7 @@ namespace Swift { private: void headerEncode(); void messageEncode(); - void addToDOM(boost::shared_ptr snippet); + void addToDOM(std::shared_ptr snippet); QtChatWindow* window_; UIEventStream* eventStream_; diff --git a/Swift/QtUI/Roster/QtFilterWidget.cpp b/Swift/QtUI/Roster/QtFilterWidget.cpp index 3ed23b6..d2e4d09 100644 --- a/Swift/QtUI/Roster/QtFilterWidget.cpp +++ b/Swift/QtUI/Roster/QtFilterWidget.cpp @@ -77,7 +77,7 @@ bool QtFilterWidget::eventFilter(QObject*, QEvent* event) { } else if (keyEvent->key() == Qt::Key_Return) { JID target = treeView_->selectedJID(); if (target.isValid()) { - eventStream_->send(boost::shared_ptr(new RequestChatUIEvent(target))); + eventStream_->send(std::make_shared(target)); } filterLineEdit_->setText(""); updateRosterFilters(); diff --git a/Swift/QtUI/Roster/QtRosterWidget.cpp b/Swift/QtUI/Roster/QtRosterWidget.cpp index 92fed86..935d6f6 100644 --- a/Swift/QtUI/Roster/QtRosterWidget.cpp +++ b/Swift/QtUI/Roster/QtRosterWidget.cpp @@ -48,7 +48,7 @@ void QtRosterWidget::handleEditUserActionTriggered(bool /*checked*/) { } RosterItem* item = static_cast(index.internalPointer()); if (ContactRosterItem* contact = dynamic_cast(item)) { - eventStream_->send(boost::make_shared(contact->getJID())); + eventStream_->send(std::make_shared(contact->getJID())); } } @@ -95,15 +95,15 @@ void QtRosterWidget::contextMenuEvent(QContextMenuEvent* event) { #endif QAction* result = contextMenu.exec(event->globalPos()); if (result == editContact) { - eventStream_->send(boost::make_shared(contact->getJID())); + eventStream_->send(std::make_shared(contact->getJID())); } else if (result == removeContact) { if (QtContactEditWindow::confirmContactDeletion(contact->getJID())) { - eventStream_->send(boost::make_shared(contact->getJID())); + eventStream_->send(std::make_shared(contact->getJID())); } } else if (result == showProfileForContact) { - eventStream_->send(boost::make_shared(contact->getJID())); + eventStream_->send(std::make_shared(contact->getJID())); } else if (unblockContact && result == unblockContact) { if (contact->blockState() == ContactRosterItem::IsDomainBlocked) { @@ -113,26 +113,26 @@ void QtRosterWidget::contextMenuEvent(QContextMenuEvent* event) { messageBox.exec(); if (messageBox.clickedButton() == unblockDomainButton) { - eventStream_->send(boost::make_shared(RequestChangeBlockStateUIEvent::Unblocked, contact->getJID().getDomain())); + eventStream_->send(std::make_shared(RequestChangeBlockStateUIEvent::Unblocked, contact->getJID().getDomain())); } } else { - eventStream_->send(boost::make_shared(RequestChangeBlockStateUIEvent::Unblocked, contact->getJID())); + eventStream_->send(std::make_shared(RequestChangeBlockStateUIEvent::Unblocked, contact->getJID())); } } else if (blockContact && result == blockContact) { - eventStream_->send(boost::make_shared(RequestChangeBlockStateUIEvent::Blocked, contact->getJID())); + eventStream_->send(std::make_shared(RequestChangeBlockStateUIEvent::Blocked, contact->getJID())); } #ifdef SWIFT_EXPERIMENTAL_FT else if (sendFile && result == sendFile) { QString fileName = QFileDialog::getOpenFileName(this, tr("Send File"), "", tr("All Files (*);;")); if (!fileName.isEmpty()) { - eventStream_->send(boost::make_shared(contact->getJID(), Q2PSTRING(fileName))); + eventStream_->send(std::make_shared(contact->getJID(), Q2PSTRING(fileName))); } } #endif #ifdef SWIFT_EXPERIMENTAL_WB else if (startWhiteboardChat && result == startWhiteboardChat) { - eventStream_->send(boost::make_shared(contact->getJID())); + eventStream_->send(std::make_shared(contact->getJID())); } #endif } @@ -155,7 +155,7 @@ void QtRosterWidget::renameGroup(GroupRosterItem* group) { bool ok; QString newName = QInputDialog::getText(nullptr, tr("Rename group"), tr("Enter a new name for group '%1':").arg(P2QSTRING(group->getDisplayName())), QLineEdit::Normal, P2QSTRING(group->getDisplayName()), &ok); if (ok) { - eventStream_->send(boost::make_shared(group->getDisplayName(), Q2PSTRING(newName))); + eventStream_->send(std::make_shared(group->getDisplayName(), Q2PSTRING(newName))); } } diff --git a/Swift/QtUI/Roster/QtTreeWidget.cpp b/Swift/QtUI/Roster/QtTreeWidget.cpp index 16a186e..249523c 100644 --- a/Swift/QtUI/Roster/QtTreeWidget.cpp +++ b/Swift/QtUI/Roster/QtTreeWidget.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -140,7 +141,7 @@ void QtTreeWidget::currentChanged(const QModelIndex& current, const QModelIndex& void QtTreeWidget::handleItemActivated(const QModelIndex& index) { JID target = jidFromIndex(index); if (target.isValid()) { - eventStream_->send(boost::shared_ptr(new RequestChatUIEvent(target))); + eventStream_->send(std::make_shared(target)); } } @@ -158,7 +159,7 @@ void QtTreeWidget::dropEvent(QDropEvent *event) { if (contact->supportsFeature(ContactRosterItem::FileTransferFeature)) { QString filename = event->mimeData()->urls().at(0).toLocalFile(); if (!filename.isEmpty()) { - eventStream_->send(boost::make_shared(contact->getJID(), Q2PSTRING(filename))); + eventStream_->send(std::make_shared(contact->getJID(), Q2PSTRING(filename))); } } } diff --git a/Swift/QtUI/SystemMessageSnippet.cpp b/Swift/QtUI/SystemMessageSnippet.cpp index fbf8810..eeb6b9a 100644 --- a/Swift/QtUI/SystemMessageSnippet.cpp +++ b/Swift/QtUI/SystemMessageSnippet.cpp @@ -12,7 +12,7 @@ namespace Swift { SystemMessageSnippet::SystemMessageSnippet(const QString& message, const QDateTime& time, bool appendToPrevious, QtChatTheme* theme, const QString& id, Direction direction) : ChatSnippet(appendToPrevious) { if (appendToPrevious) { - setContinuationFallbackSnippet(boost::shared_ptr(new SystemMessageSnippet(message, time, false, theme, id, direction))); + setContinuationFallbackSnippet(std::make_shared(message, time, false, theme, id, direction)); } content_ = theme->getStatus(); diff --git a/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp b/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp index 4e8f4e1..e9a26ea 100644 --- a/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp +++ b/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp @@ -74,13 +74,13 @@ Contact::ref QtSuggestingJIDInput::getContact() { if (!text().isEmpty()) { JID jid(Q2PSTRING(text())); if (jid.isValid()) { - Contact::ref manualContact = boost::make_shared(); + Contact::ref manualContact = std::make_shared(); manualContact->name = jid.toString(); manualContact->jid = jid; return manualContact; } } - return boost::shared_ptr(); + return std::shared_ptr(); } void QtSuggestingJIDInput::setSuggestions(const std::vector& suggestions) { diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp index 09943c5..83b8df6 100644 --- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp +++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -132,11 +133,11 @@ void QtUserSearchWindow::handleAccepted() { switch(type_) { case AddContact: jid = getContactJID(); - eventStream_->send(boost::make_shared(jid, detailsPage_->getName(), detailsPage_->getSelectedGroups())); + eventStream_->send(std::make_shared(jid, detailsPage_->getName(), detailsPage_->getSelectedGroups())); break; case ChatToContact: if (contactVector_.size() == 1) { - boost::shared_ptr event(new RequestChatUIEvent(contactVector_[0]->jid)); + std::shared_ptr event(new RequestChatUIEvent(contactVector_[0]->jid)); eventStream_->send(event); break; } @@ -145,13 +146,13 @@ void QtUserSearchWindow::handleAccepted() { jids.push_back(contact->jid); } - eventStream_->send(boost::make_shared(jids, JID(), Q2PSTRING(firstMultiJIDPage_->reason_->text()))); + eventStream_->send(std::make_shared(jids, JID(), Q2PSTRING(firstMultiJIDPage_->reason_->text()))); break; case InviteToChat: foreach(Contact::ref contact, contactVector_) { jids.push_back(contact->jid); } - eventStream_->send(boost::make_shared(roomJID_, jids, Q2PSTRING(firstMultiJIDPage_->reason_->text()))); + eventStream_->send(std::make_shared(roomJID_, jids, Q2PSTRING(firstMultiJIDPage_->reason_->text()))); break; } } @@ -229,7 +230,7 @@ void QtUserSearchWindow::handleFirstPageRadioChange() { } void QtUserSearchWindow::handleSearch() { - boost::shared_ptr search(new SearchPayload()); + std::shared_ptr search(new SearchPayload()); if (fieldsPage_->getFormWidget()) { search->setForm(fieldsPage_->getFormWidget()->getCompletedForm()); search->getForm()->clearEmptyTextFields(); @@ -292,7 +293,7 @@ JID QtUserSearchWindow::getContactJID() const { } Contact::ref QtUserSearchWindow::getContact() const { - return boost::make_shared("", getContactJID(), StatusShow::None, ""); + return std::make_shared("", getContactJID(), StatusShow::None, ""); } void QtUserSearchWindow::addSearchedJIDToList(const Contact::ref& contact) { @@ -330,7 +331,7 @@ void QtUserSearchWindow::addSavedServices(const std::vector& services) { } } -void QtUserSearchWindow::setSearchFields(boost::shared_ptr fields) { +void QtUserSearchWindow::setSearchFields(std::shared_ptr fields) { fieldsPage_->fetchingThrobber_->hide(); fieldsPage_->fetchingThrobber_->movie()->stop(); fieldsPage_->fetchingLabel_->hide(); @@ -375,7 +376,7 @@ void QtUserSearchWindow::setContactSuggestions(const std::vector& void QtUserSearchWindow::setJIDs(const std::vector &jids) { foreach(JID jid, jids) { - addSearchedJIDToList(boost::make_shared("", jid, StatusShow::None, "")); + addSearchedJIDToList(std::make_shared("", jid, StatusShow::None, "")); } onJIDUpdateRequested(jids); } diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.h b/Swift/QtUI/UserSearch/QtUserSearchWindow.h index bcef0b9..5d8b755 100644 --- a/Swift/QtUI/UserSearch/QtUserSearchWindow.h +++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.h @@ -42,7 +42,7 @@ namespace Swift { virtual void setSelectedService(const JID& jid); virtual void setServerSupportsSearch(bool error); virtual void setSearchError(bool error); - virtual void setSearchFields(boost::shared_ptr fields); + virtual void setSearchFields(std::shared_ptr fields); virtual void setNameSuggestions(const std::vector& suggestions); virtual void prepopulateJIDAndName(const JID& jid, const std::string& name); virtual void setContactSuggestions(const std::vector& suggestions); diff --git a/Swift/QtUI/UserSearch/UserSearchModel.h b/Swift/QtUI/UserSearch/UserSearchModel.h index 0a57b28..a3940da 100644 --- a/Swift/QtUI/UserSearch/UserSearchModel.h +++ b/Swift/QtUI/UserSearch/UserSearchModel.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include diff --git a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp index 2eae84d..62f5b89 100644 --- a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp +++ b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp @@ -13,10 +13,10 @@ #include #include +#include #include #include -#include #include #include @@ -154,13 +154,13 @@ namespace Swift { } void QtWhiteboardWindow::handleWhiteboardOperationReceive(const WhiteboardOperation::ref operation) { - WhiteboardInsertOperation::ref insertOp = boost::dynamic_pointer_cast(operation); + WhiteboardInsertOperation::ref insertOp = std::dynamic_pointer_cast(operation); if (insertOp) { WhiteboardElementDrawingVisitor visitor(graphicsView, operation->getPos(), GView::New); insertOp->getElement()->accept(visitor); } - WhiteboardUpdateOperation::ref updateOp = boost::dynamic_pointer_cast(operation); + WhiteboardUpdateOperation::ref updateOp = std::dynamic_pointer_cast(operation); if (updateOp) { WhiteboardElementDrawingVisitor visitor(graphicsView, operation->getPos(), GView::Update); updateOp->getElement()->accept(visitor); @@ -169,7 +169,7 @@ namespace Swift { } } - WhiteboardDeleteOperation::ref deleteOp = boost::dynamic_pointer_cast(operation); + WhiteboardDeleteOperation::ref deleteOp = std::dynamic_pointer_cast(operation); if (deleteOp) { graphicsView->deleteItem(P2QSTRING(deleteOp->getElementID())); } @@ -261,7 +261,7 @@ namespace Swift { if (lineItem != nullptr) { QLine line = lineItem->line().toLine(); QColor color = lineItem->pen().color(); - WhiteboardLineElement::ref element = boost::make_shared(line.x1()+lineItem->pos().x(), line.y1()+lineItem->pos().y(), line.x2()+lineItem->pos().x(), line.y2()+lineItem->pos().y()); + WhiteboardLineElement::ref element = std::make_shared(line.x1()+lineItem->pos().x(), line.y1()+lineItem->pos().y(), line.x2()+lineItem->pos().x(), line.y2()+lineItem->pos().y()); element->setColor(WhiteboardColor(color.red(), color.green(), color.blue(), color.alpha())); element->setPenWidth(lineItem->pen().width()); @@ -271,7 +271,7 @@ namespace Swift { FreehandLineItem* freehandLineItem = qgraphicsitem_cast(item); if (freehandLineItem != nullptr) { - WhiteboardFreehandPathElement::ref element = boost::make_shared(); + WhiteboardFreehandPathElement::ref element = std::make_shared(); QColor color = freehandLineItem->pen().color(); std::vector > points; QVector::const_iterator it = freehandLineItem->points().constBegin(); @@ -292,7 +292,7 @@ namespace Swift { QGraphicsRectItem* rectItem = qgraphicsitem_cast(item); if (rectItem != nullptr) { QRectF rect = rectItem->rect(); - WhiteboardRectElement::ref element = boost::make_shared(rect.x()+item->pos().x(), rect.y()+item->pos().y(), rect.width(), rect.height()); + WhiteboardRectElement::ref element = std::make_shared(rect.x()+item->pos().x(), rect.y()+item->pos().y(), rect.width(), rect.height()); QColor penColor = rectItem->pen().color(); QColor brushColor = rectItem->brush().color(); @@ -307,7 +307,7 @@ namespace Swift { QGraphicsTextItem* textItem = qgraphicsitem_cast(item); if (textItem != nullptr) { QPointF point = textItem->pos(); - WhiteboardTextElement::ref element = boost::make_shared(point.x(), point.y()); + WhiteboardTextElement::ref element = std::make_shared(point.x(), point.y()); element->setText(textItem->toPlainText().toStdString()); element->setSize(textItem->font().pointSize()); QColor color = textItem->defaultTextColor(); @@ -319,7 +319,7 @@ namespace Swift { QGraphicsPolygonItem* polygonItem = qgraphicsitem_cast(item); if (polygonItem) { - WhiteboardPolygonElement::ref element = boost::make_shared(); + WhiteboardPolygonElement::ref element = std::make_shared(); QPolygonF polygon = polygonItem->polygon(); std::vector > points; QVector::const_iterator it = polygon.begin(); @@ -348,7 +348,7 @@ namespace Swift { int cy = boost::numeric_cast(rect.y()+rect.height()/2 + item->pos().y()); int rx = boost::numeric_cast(rect.width()/2); int ry = boost::numeric_cast(rect.height()/2); - WhiteboardEllipseElement::ref element = boost::make_shared(cx, cy, rx, ry); + WhiteboardEllipseElement::ref element = std::make_shared(cx, cy, rx, ry); QColor penColor = ellipseItem->pen().color(); QColor brushColor = ellipseItem->brush().color(); @@ -361,12 +361,12 @@ namespace Swift { } if (type == GView::New) { - WhiteboardInsertOperation::ref insertOp = boost::make_shared(); + WhiteboardInsertOperation::ref insertOp = std::make_shared(); insertOp->setPos(pos); insertOp->setElement(el); whiteboardSession_->sendOperation(insertOp); } else { - WhiteboardUpdateOperation::ref updateOp = boost::make_shared(); + WhiteboardUpdateOperation::ref updateOp = std::make_shared(); updateOp->setPos(pos); if (type == GView::Update) { updateOp->setNewPos(pos); @@ -381,7 +381,7 @@ namespace Swift { } void QtWhiteboardWindow::handleItemDeleted(QString id, int pos) { - WhiteboardDeleteOperation::ref deleteOp = boost::make_shared(); + WhiteboardDeleteOperation::ref deleteOp = std::make_shared(); deleteOp->setElementID(Q2PSTRING(id)); deleteOp->setPos(pos); whiteboardSession_->sendOperation(deleteOp); diff --git a/Swift/QtUI/WinUIHelpers.cpp b/Swift/QtUI/WinUIHelpers.cpp index 30f18a6..4898916 100644 --- a/Swift/QtUI/WinUIHelpers.cpp +++ b/Swift/QtUI/WinUIHelpers.cpp @@ -17,7 +17,7 @@ #include #pragma comment(lib, "cryptui.lib") -#include +#include #include @@ -35,7 +35,7 @@ void WinUIHelpers::displayCertificateChainAsSheet(QWidget* parent, const std::ve } ByteArray certAsDER = chain[0]->toDER(); - boost::shared_ptr certificate_chain; + std::shared_ptr certificate_chain; { PCCERT_CONTEXT certChain; BOOL ok = CertAddCertificateContextToStore(chainStore, CertCreateCertificateContext(X509_ASN_ENCODING, vecptr(certAsDER), certAsDER.size()), CERT_STORE_ADD_ALWAYS, &certChain); diff --git a/Swiften/AdHoc/OutgoingAdHocCommandSession.cpp b/Swiften/AdHoc/OutgoingAdHocCommandSession.cpp index 1cdf467..22c478d 100644 --- a/Swiften/AdHoc/OutgoingAdHocCommandSession.cpp +++ b/Swiften/AdHoc/OutgoingAdHocCommandSession.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -21,7 +22,7 @@ OutgoingAdHocCommandSession::~OutgoingAdHocCommandSession() { connection_.disconnect(); } -void OutgoingAdHocCommandSession::handleResponse(boost::shared_ptr payload, ErrorPayload::ref error) { +void OutgoingAdHocCommandSession::handleResponse(std::shared_ptr payload, ErrorPayload::ref error) { if (error) { onError(error); } else { @@ -61,7 +62,7 @@ bool OutgoingAdHocCommandSession::getIsMultiStage() const { } void OutgoingAdHocCommandSession::start() { - boost::shared_ptr > commandRequest = boost::make_shared< GenericRequest >(IQ::Set, to_, boost::make_shared(commandNode_), iqRouter_); + std::shared_ptr > commandRequest = std::make_shared< GenericRequest >(IQ::Set, to_, std::make_shared(commandNode_), iqRouter_); connection_ = commandRequest->onResponse.connect(boost::bind(&OutgoingAdHocCommandSession::handleResponse, this, _1, _2)); commandRequest->send(); } @@ -85,9 +86,9 @@ void OutgoingAdHocCommandSession::goNext(Form::ref form) { } void OutgoingAdHocCommandSession::submitForm(Form::ref form, Command::Action action) { - boost::shared_ptr command(boost::make_shared(commandNode_, sessionID_, action)); + std::shared_ptr command(std::make_shared(commandNode_, sessionID_, action)); command->setForm(form); - boost::shared_ptr > commandRequest = boost::make_shared< GenericRequest >(IQ::Set, to_, command, iqRouter_); + std::shared_ptr > commandRequest = std::make_shared< GenericRequest >(IQ::Set, to_, command, iqRouter_); connection_.disconnect(); connection_ = commandRequest->onResponse.connect(boost::bind(&OutgoingAdHocCommandSession::handleResponse, this, _1, _2)); commandRequest->send(); diff --git a/Swiften/AdHoc/OutgoingAdHocCommandSession.h b/Swiften/AdHoc/OutgoingAdHocCommandSession.h index fdb6e35..48135c1 100644 --- a/Swiften/AdHoc/OutgoingAdHocCommandSession.h +++ b/Swiften/AdHoc/OutgoingAdHocCommandSession.h @@ -7,10 +7,9 @@ #pragma once #include +#include #include -#include - #include #include #include @@ -84,7 +83,7 @@ namespace Swift { ActionState getActionState(Command::Action action) const; private: - void handleResponse(boost::shared_ptr payload, ErrorPayload::ref error); + void handleResponse(std::shared_ptr payload, ErrorPayload::ref error); void submitForm(Form::ref, Command::Action action); private: diff --git a/Swiften/Avatars/UnitTest/AvatarManagerImplTest.cpp b/Swiften/Avatars/UnitTest/AvatarManagerImplTest.cpp index 79769a8..241f375 100644 --- a/Swiften/Avatars/UnitTest/AvatarManagerImplTest.cpp +++ b/Swiften/Avatars/UnitTest/AvatarManagerImplTest.cpp @@ -38,14 +38,14 @@ class AvatarManagerImplTest : public CppUnit::TestFixture { public: void setUp() { ownerJID = JID("owner@domain.com/theowner"); - stanzaChannel = boost::make_shared(); - iqRouter = boost::make_shared(stanzaChannel.get()); - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); - vcardStorage = boost::make_shared(crypto.get()); - vcardManager = boost::make_shared(ownerJID, iqRouter.get(), vcardStorage.get()); - avatarStorage = boost::make_shared(); - mucRegistry = boost::make_shared(); - avatarManager = boost::make_shared(vcardManager.get(), stanzaChannel.get(), avatarStorage.get(), crypto.get(), mucRegistry.get()); + stanzaChannel = std::make_shared(); + iqRouter = std::make_shared(stanzaChannel.get()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); + vcardStorage = std::make_shared(crypto.get()); + vcardManager = std::make_shared(ownerJID, iqRouter.get(), vcardStorage.get()); + avatarStorage = std::make_shared(); + mucRegistry = std::make_shared(); + avatarManager = std::make_shared(vcardManager.get(), stanzaChannel.get(), avatarStorage.get(), crypto.get(), mucRegistry.get()); } void testGetSetAvatar() { @@ -57,9 +57,9 @@ class AvatarManagerImplTest : public CppUnit::TestFixture { /* notify the 'owner' JID that our avatar has changed */ ByteArray fullAvatar = createByteArray("abcdefg"); - boost::shared_ptr vcardUpdate = boost::make_shared(); + std::shared_ptr vcardUpdate = std::make_shared(); vcardUpdate->setPhotoHash(Hexify::hexify(crypto->getSHA1Hash(fullAvatar))); - boost::shared_ptr presence = boost::make_shared(); + std::shared_ptr presence = std::make_shared(); presence->setTo(ownerJID); presence->setFrom(personJID); presence->setType(Presence::Available); @@ -69,13 +69,13 @@ class AvatarManagerImplTest : public CppUnit::TestFixture { /* reply to the avatar request with our new avatar */ CPPUNIT_ASSERT_EQUAL(size_t(1), stanzaChannel->sentStanzas.size()); - boost::shared_ptr request = boost::dynamic_pointer_cast(stanzaChannel->sentStanzas[0]); + std::shared_ptr request = std::dynamic_pointer_cast(stanzaChannel->sentStanzas[0]); stanzaChannel->sentStanzas.pop_back(); CPPUNIT_ASSERT(!!request); - boost::shared_ptr vcard = request->getPayload(); + std::shared_ptr vcard = request->getPayload(); CPPUNIT_ASSERT(!!vcard); - boost::shared_ptr reply = boost::make_shared(IQ::Result); + std::shared_ptr reply = std::make_shared(IQ::Result); reply->setTo(request->getFrom()); reply->setFrom(request->getTo()); reply->setID(request->getID()); @@ -90,8 +90,8 @@ class AvatarManagerImplTest : public CppUnit::TestFixture { /* send new presence to notify of blank avatar */ - vcardUpdate = boost::make_shared(); - presence = boost::make_shared(); + vcardUpdate = std::make_shared(); + presence = std::make_shared(); presence->setTo(ownerJID); presence->setFrom(personJID); presence->setType(Presence::Available); @@ -101,14 +101,14 @@ class AvatarManagerImplTest : public CppUnit::TestFixture { /* reply to the avatar request with our EMPTY avatar */ CPPUNIT_ASSERT_EQUAL(size_t(1), stanzaChannel->sentStanzas.size()); - request = boost::dynamic_pointer_cast(stanzaChannel->sentStanzas[0]); + request = std::dynamic_pointer_cast(stanzaChannel->sentStanzas[0]); stanzaChannel->sentStanzas.pop_back(); CPPUNIT_ASSERT(!!request); vcard = request->getPayload(); CPPUNIT_ASSERT(!!vcard); ByteArray blankAvatar = createByteArray(""); - reply = boost::make_shared(IQ::Result); + reply = std::make_shared(IQ::Result); reply->setTo(request->getFrom()); reply->setFrom(request->getTo()); reply->setID(request->getID()); @@ -130,14 +130,14 @@ class AvatarManagerImplTest : public CppUnit::TestFixture { private: JID ownerJID; - boost::shared_ptr stanzaChannel; - boost::shared_ptr iqRouter; - boost::shared_ptr crypto; - boost::shared_ptr vcardStorage; - boost::shared_ptr vcardManager; - boost::shared_ptr avatarStorage; - boost::shared_ptr mucRegistry; - boost::shared_ptr avatarManager; + std::shared_ptr stanzaChannel; + std::shared_ptr iqRouter; + std::shared_ptr crypto; + std::shared_ptr vcardStorage; + std::shared_ptr vcardManager; + std::shared_ptr avatarStorage; + std::shared_ptr mucRegistry; + std::shared_ptr avatarManager; }; diff --git a/Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp b/Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp index fb4cd8f..288a5af 100644 --- a/Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp +++ b/Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp @@ -62,14 +62,14 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { } void testGetAvatarWithNoAvatarProviderReturnsEmpty() { - boost::shared_ptr testling(createProvider()); + std::shared_ptr testling(createProvider()); boost::optional hash = testling->getAvatarHash(user1); CPPUNIT_ASSERT(!hash); } void testGetAvatarWithSingleAvatarProvider() { - boost::shared_ptr testling(createProvider()); + std::shared_ptr testling(createProvider()); avatarProvider1->avatars[user1] = avatarHash1; testling->addProvider(avatarProvider1); @@ -79,7 +79,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { } void testGetAvatarWithMultipleAvatarProviderReturnsFirstAvatar() { - boost::shared_ptr testling(createProvider()); + std::shared_ptr testling(createProvider()); avatarProvider1->avatars[user1] = avatarHash1; avatarProvider2->avatars[user1] = avatarHash2; testling->addProvider(avatarProvider1); @@ -91,7 +91,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { } void testGetAvatarWithMultipleAvatarProviderAndFailingFirstProviderReturnsSecondAvatar() { - boost::shared_ptr testling(createProvider()); + std::shared_ptr testling(createProvider()); avatarProvider2->avatars[user1] = avatarHash2; testling->addProvider(avatarProvider1); testling->addProvider(avatarProvider2); @@ -102,7 +102,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { } void testProviderUpdateTriggersChange() { - boost::shared_ptr testling(createProvider()); + std::shared_ptr testling(createProvider()); testling->addProvider(avatarProvider1); avatarProvider1->avatars[user1] = avatarHash1; avatarProvider1->onAvatarChanged(user1); @@ -112,7 +112,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { } void testProviderUpdateWithoutChangeDoesNotTriggerChange() { - boost::shared_ptr testling(createProvider()); + std::shared_ptr testling(createProvider()); testling->addProvider(avatarProvider1); testling->addProvider(avatarProvider2); avatarProvider1->avatars[user1] = avatarHash1; @@ -126,7 +126,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { } void testProviderSecondUpdateTriggersChange() { - boost::shared_ptr testling(createProvider()); + std::shared_ptr testling(createProvider()); testling->addProvider(avatarProvider1); avatarProvider1->avatars[user1] = avatarHash1; avatarProvider1->onAvatarChanged(user1); @@ -140,7 +140,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { void testProviderUpdateWithAvatarDisappearingTriggersChange() { - boost::shared_ptr testling(createProvider()); + std::shared_ptr testling(createProvider()); testling->addProvider(avatarProvider1); avatarProvider1->avatars[user1] = avatarHash1; avatarProvider1->onAvatarChanged(user1); @@ -153,7 +153,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { } void testProviderUpdateAfterAvatarDisappearedTriggersChange() { - boost::shared_ptr testling(createProvider()); + std::shared_ptr testling(createProvider()); testling->addProvider(avatarProvider1); avatarProvider1->avatars[user1] = avatarHash1; avatarProvider1->onAvatarChanged(user1); @@ -169,7 +169,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { void testProviderUpdateAfterGetDoesNotTriggerChange() { - boost::shared_ptr testling(createProvider()); + std::shared_ptr testling(createProvider()); testling->addProvider(avatarProvider1); avatarProvider1->avatars[user1] = avatarHash1; @@ -180,7 +180,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { } void testRemoveProviderDisconnectsUpdates() { - boost::shared_ptr testling(createProvider()); + std::shared_ptr testling(createProvider()); testling->addProvider(avatarProvider1); testling->addProvider(avatarProvider2); testling->removeProvider(avatarProvider1); @@ -192,7 +192,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { } void testProviderUpdateBareJIDAfterGetFullJID() { - boost::shared_ptr testling(createProvider()); + std::shared_ptr testling(createProvider()); avatarProvider1->useBare = true; testling->addProvider(avatarProvider1); @@ -210,7 +210,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { JID ownJID = JID("user0@own.com/res"); JID user1 = JID("user1@bar.com/bla"); - boost::shared_ptr crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + std::shared_ptr crypto = std::shared_ptr(PlatformCryptoProvider::create()); DummyStanzaChannel* stanzaChannel = new DummyStanzaChannel(); stanzaChannel->setAvailable(true); IQRouter* iqRouter = new IQRouter(stanzaChannel); @@ -219,16 +219,16 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { VCardMemoryStorage* vcardStorage = new VCardMemoryStorage(crypto.get()); VCardManager* vcardManager = new VCardManager(ownJID, iqRouter, vcardStorage); - boost::shared_ptr updateManager(new VCardUpdateAvatarManager(vcardManager, stanzaChannel, avatarStorage, crypto.get(), mucRegistry)); + std::shared_ptr updateManager(new VCardUpdateAvatarManager(vcardManager, stanzaChannel, avatarStorage, crypto.get(), mucRegistry)); updateManager->onAvatarChanged.connect(boost::bind(&CombinedAvatarProviderTest::handleAvatarChanged, this, _1)); - boost::shared_ptr manager(new VCardAvatarManager(vcardManager, avatarStorage, crypto.get(), mucRegistry)); + std::shared_ptr manager(new VCardAvatarManager(vcardManager, avatarStorage, crypto.get(), mucRegistry)); manager->onAvatarChanged.connect(boost::bind(&CombinedAvatarProviderTest::handleAvatarChanged, this, _1)); - boost::shared_ptr offlineManager(new OfflineAvatarManager(avatarStorage)); + std::shared_ptr offlineManager(new OfflineAvatarManager(avatarStorage)); offlineManager->onAvatarChanged.connect(boost::bind(&CombinedAvatarProviderTest::handleAvatarChanged, this, _1)); - boost::shared_ptr testling(createProvider()); + std::shared_ptr testling(createProvider()); avatarProvider1->useBare = true; testling->addProvider(updateManager.get()); testling->addProvider(manager.get()); @@ -257,7 +257,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { vcardManager->requestVCard(user1.toBare()); CPPUNIT_ASSERT_EQUAL(size_t(1), stanzaChannel->sentStanzas.size()); - IQ::ref request = boost::dynamic_pointer_cast(stanzaChannel->sentStanzas.back()); + IQ::ref request = std::dynamic_pointer_cast(stanzaChannel->sentStanzas.back()); VCard::ref payload = request->getPayload(); CPPUNIT_ASSERT(!!payload); stanzaChannel->sentStanzas.pop_back(); @@ -267,7 +267,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { VCard::ref vcard2(new VCard()); vcard2->setPhoto(avatar2); - IQ::ref reply = boost::make_shared(); + IQ::ref reply = std::make_shared(); reply->setTo(request->getFrom()); reply->setFrom(request->getTo()); reply->setID(request->getID()); @@ -295,13 +295,13 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { vcardManager->requestVCard(user1.toBare()); CPPUNIT_ASSERT_EQUAL(size_t(1), stanzaChannel->sentStanzas.size()); - request = boost::dynamic_pointer_cast(stanzaChannel->sentStanzas.back()); + request = std::dynamic_pointer_cast(stanzaChannel->sentStanzas.back()); payload = request->getPayload(); CPPUNIT_ASSERT(!!payload); stanzaChannel->sentStanzas.pop_back(); VCard::ref vcard3(new VCard()); - reply = boost::make_shared(); + reply = std::make_shared(); reply->setTo(request->getFrom()); reply->setFrom(request->getTo()); reply->setID(request->getID()); @@ -331,8 +331,8 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createProvider() { - boost::shared_ptr result(new CombinedAvatarProvider()); + std::shared_ptr createProvider() { + std::shared_ptr result(new CombinedAvatarProvider()); result->onAvatarChanged.connect(boost::bind(&CombinedAvatarProviderTest::handleAvatarChanged, this, _1)); return result; } diff --git a/Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp b/Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp index 5a28995..2ca9c1a 100644 --- a/Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp +++ b/Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp @@ -38,7 +38,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture { public: void setUp() { - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); ownJID = JID("foo@fum.com/bum"); stanzaChannel = new DummyStanzaChannel(); stanzaChannel->setAvailable(true); @@ -63,7 +63,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture { } void testGetAvatarHashKnownAvatar() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); storeVCardWithPhoto(user1.toBare(), avatar1); avatarStorage->addAvatar(avatar1Hash, avatar1); @@ -74,7 +74,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture { } void testGetAvatarHashEmptyAvatar() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); storeEmptyVCard(user1.toBare()); boost::optional result = testling->getAvatarHash(user1); @@ -84,7 +84,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture { } void testGetAvatarHashUnknownAvatarKnownVCardStoresAvatar() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); storeVCardWithPhoto(user1.toBare(), avatar1); boost::optional result = testling->getAvatarHash(user1); @@ -96,7 +96,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture { } void testGetAvatarHashUnknownAvatarUnknownVCard() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); boost::optional result = testling->getAvatarHash(user1); @@ -105,7 +105,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture { } void testGetAvatarHashKnownAvatarUnknownVCard() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); avatarStorage->setAvatarForJID(user1, avatar1Hash); @@ -117,7 +117,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture { void testVCardUpdateTriggersUpdate() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); vcardManager->requestVCard(user1); sendVCardResult(); @@ -125,8 +125,8 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createManager() { - boost::shared_ptr result(new VCardAvatarManager(vcardManager, avatarStorage, crypto.get(), mucRegistry)); + std::shared_ptr createManager() { + std::shared_ptr result(new VCardAvatarManager(vcardManager, avatarStorage, crypto.get(), mucRegistry)); result->onAvatarChanged.connect(boost::bind(&VCardAvatarManagerTest::handleAvatarChanged, this, _1)); return result; } @@ -170,7 +170,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture { std::vector changes; JID user1; JID user2; - boost::shared_ptr crypto; + std::shared_ptr crypto; }; CPPUNIT_TEST_SUITE_REGISTRATION(VCardAvatarManagerTest); diff --git a/Swiften/Avatars/UnitTest/VCardUpdateAvatarManagerTest.cpp b/Swiften/Avatars/UnitTest/VCardUpdateAvatarManagerTest.cpp index 5f6c691..bfa13cd 100644 --- a/Swiften/Avatars/UnitTest/VCardUpdateAvatarManagerTest.cpp +++ b/Swiften/Avatars/UnitTest/VCardUpdateAvatarManagerTest.cpp @@ -39,7 +39,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture { public: void setUp() { - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); ownJID = JID("foo@fum.com/bum"); stanzaChannel = new DummyStanzaChannel(); stanzaChannel->setAvailable(true); @@ -65,7 +65,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture { } void testUpdate_NewHashNewVCardRequestsVCard() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); stanzaChannel->onPresenceReceived(createPresenceWithPhotoHash(user1, avatar1Hash)); CPPUNIT_ASSERT_EQUAL(1, static_cast(stanzaChannel->sentStanzas.size())); @@ -73,7 +73,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture { } void testUpdate_NewHashStoresAvatarAndEmitsNotificationOnVCardReceive() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); stanzaChannel->onPresenceReceived(createPresenceWithPhotoHash(user1, avatar1Hash)); stanzaChannel->onIQReceived(createVCardResult(avatar1)); @@ -87,7 +87,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture { } void testUpdate_KnownHash() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); stanzaChannel->onPresenceReceived(createPresenceWithPhotoHash(user1, avatar1Hash)); stanzaChannel->onIQReceived(createVCardResult(avatar1)); changes.clear(); @@ -100,7 +100,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture { } void testUpdate_KnownHashFromDifferentUserDoesNotRequestVCardButTriggersNotification() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); stanzaChannel->onPresenceReceived(createPresenceWithPhotoHash(user1, avatar1Hash)); stanzaChannel->onIQReceived(createVCardResult(avatar1)); changes.clear(); @@ -117,7 +117,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture { } void testVCardWithEmptyPhoto() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); vcardManager->requestVCard(JID("foo@bar.com")); stanzaChannel->onIQReceived(createVCardResult(ByteArray())); @@ -128,7 +128,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture { } void testStanzaChannelReset_ClearsHash() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); stanzaChannel->onPresenceReceived(createPresenceWithPhotoHash(user1, avatar1Hash)); stanzaChannel->onIQReceived(createVCardResult(avatar1)); changes.clear(); @@ -145,7 +145,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture { } void testStanzaChannelReset_ReceiveHashAfterResetUpdatesHash() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); stanzaChannel->onPresenceReceived(createPresenceWithPhotoHash(user1, avatar1Hash)); stanzaChannel->onIQReceived(createVCardResult(avatar1)); changes.clear(); @@ -163,16 +163,16 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createManager() { - boost::shared_ptr result(new VCardUpdateAvatarManager(vcardManager, stanzaChannel, avatarStorage, crypto.get(), mucRegistry)); + std::shared_ptr createManager() { + std::shared_ptr result(new VCardUpdateAvatarManager(vcardManager, stanzaChannel, avatarStorage, crypto.get(), mucRegistry)); result->onAvatarChanged.connect(boost::bind(&VCardUpdateAvatarManagerTest::handleAvatarChanged, this, _1)); return result; } - boost::shared_ptr createPresenceWithPhotoHash(const JID& jid, const std::string& hash) { - boost::shared_ptr presence(new Presence()); + std::shared_ptr createPresenceWithPhotoHash(const JID& jid, const std::string& hash) { + std::shared_ptr presence(new Presence()); presence->setFrom(jid); - presence->addPayload(boost::make_shared(hash)); + presence->addPayload(std::make_shared(hash)); return presence; } @@ -206,7 +206,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture { std::vector changes; JID user1; JID user2; - boost::shared_ptr crypto; + std::shared_ptr crypto; }; CPPUNIT_TEST_SUITE_REGISTRATION(VCardUpdateAvatarManagerTest); diff --git a/Swiften/Avatars/VCardUpdateAvatarManager.cpp b/Swiften/Avatars/VCardUpdateAvatarManager.cpp index e40eee3..3e8d87b 100644 --- a/Swiften/Avatars/VCardUpdateAvatarManager.cpp +++ b/Swiften/Avatars/VCardUpdateAvatarManager.cpp @@ -26,8 +26,8 @@ VCardUpdateAvatarManager::VCardUpdateAvatarManager(VCardManager* vcardManager, S vcardManager_->onVCardChanged.connect(boost::bind(&VCardUpdateAvatarManager::handleVCardChanged, this, _1, _2)); } -void VCardUpdateAvatarManager::handlePresenceReceived(boost::shared_ptr presence) { - boost::shared_ptr update = presence->getPayload(); +void VCardUpdateAvatarManager::handlePresenceReceived(std::shared_ptr presence) { + std::shared_ptr update = presence->getPayload(); if (!update || presence->getPayload()) { return; } diff --git a/Swiften/Avatars/VCardUpdateAvatarManager.h b/Swiften/Avatars/VCardUpdateAvatarManager.h index d66da3a..c58d491 100644 --- a/Swiften/Avatars/VCardUpdateAvatarManager.h +++ b/Swiften/Avatars/VCardUpdateAvatarManager.h @@ -7,8 +7,7 @@ #pragma once #include - -#include +#include #include #include @@ -31,7 +30,7 @@ namespace Swift { boost::optional getAvatarHash(const JID&) const; private: - void handlePresenceReceived(boost::shared_ptr); + void handlePresenceReceived(std::shared_ptr); void handleStanzaChannelAvailableChanged(bool); void handleVCardChanged(const JID& from, VCard::ref); void setAvatarHash(const JID& from, const std::string& hash); diff --git a/Swiften/Base/Debug.cpp b/Swiften/Base/Debug.cpp index 2d306d5..b59de35 100644 --- a/Swiften/Base/Debug.cpp +++ b/Swiften/Base/Debug.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -7,8 +7,7 @@ #include #include - -#include +#include #include #include @@ -119,16 +118,16 @@ std::ostream& operator<<(std::ostream& os, const Swift::ClientError& error) { std::ostream& operator<<(std::ostream& os, Swift::Element* ele) { using namespace Swift; - boost::shared_ptr element = boost::shared_ptr(ele); + std::shared_ptr element = std::shared_ptr(ele); - boost::shared_ptr payload = boost::dynamic_pointer_cast(element); + std::shared_ptr payload = std::dynamic_pointer_cast(element); if (payload) { FullPayloadSerializerCollection payloadSerializerCollection; PayloadSerializer *serializer = payloadSerializerCollection.getPayloadSerializer(payload); os << "Payload(" << serializer->serialize(payload) << ")"; return os; } - boost::shared_ptr topLevelElement = boost::dynamic_pointer_cast(element); + std::shared_ptr topLevelElement = std::dynamic_pointer_cast(element); if (topLevelElement) { FullPayloadSerializerCollection payloadSerializerCollection; XMPPSerializer xmppSerializer(&payloadSerializerCollection, ClientStreamType, false); diff --git a/Swiften/Base/SafeByteArray.h b/Swiften/Base/SafeByteArray.h index f824194..342c185 100644 --- a/Swiften/Base/SafeByteArray.h +++ b/Swiften/Base/SafeByteArray.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -27,8 +26,8 @@ namespace Swift { return SafeByteArray(s.begin(), s.end()); } - inline boost::shared_ptr createSafeByteArrayRef(const std::string& s) { - return boost::make_shared(s.begin(), s.end()); + inline std::shared_ptr createSafeByteArrayRef(const std::string& s) { + return std::make_shared(s.begin(), s.end()); } inline SafeByteArray createSafeByteArray(char c) { @@ -39,16 +38,16 @@ namespace Swift { return SafeByteArray(c, c + n); } - inline boost::shared_ptr createSafeByteArrayRef(const char* c, size_t n) { - return boost::make_shared(c, c + n); + inline std::shared_ptr createSafeByteArrayRef(const char* c, size_t n) { + return std::make_shared(c, c + n); } inline SafeByteArray createSafeByteArray(const unsigned char* c, size_t n) { return SafeByteArray(c, c + n); } - inline boost::shared_ptr createSafeByteArrayRef(const unsigned char* c, size_t n) { - return boost::make_shared(c, c + n); + inline std::shared_ptr createSafeByteArrayRef(const unsigned char* c, size_t n) { + return std::make_shared(c, c + n); } /* WARNING! This breaks the safety of the data in the safe byte array. diff --git a/Swiften/Chat/ChatStateNotifier.cpp b/Swiften/Chat/ChatStateNotifier.cpp index c623ce1..cbb9b0b 100644 --- a/Swiften/Chat/ChatStateNotifier.cpp +++ b/Swiften/Chat/ChatStateNotifier.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -69,15 +70,15 @@ bool ChatStateNotifier::contactShouldReceiveStates() { } void ChatStateNotifier::changeState(ChatState::ChatStateType state) { - boost::shared_ptr message(boost::make_shared()); + std::shared_ptr message(std::make_shared()); message->setTo(contact_); - message->addPayload(boost::make_shared(state)); + message->addPayload(std::make_shared(state)); stanzaChannel_->sendMessage(message); } void ChatStateNotifier::addChatStateRequest(Message::ref message) { if (contactShouldReceiveStates()) { - message->addPayload(boost::make_shared(ChatState::Active)); + message->addPayload(std::make_shared(ChatState::Active)); } } diff --git a/Swiften/Chat/ChatStateNotifier.h b/Swiften/Chat/ChatStateNotifier.h index a53fad8..a8cc86a 100644 --- a/Swiften/Chat/ChatStateNotifier.h +++ b/Swiften/Chat/ChatStateNotifier.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include diff --git a/Swiften/Chat/ChatStateTracker.cpp b/Swiften/Chat/ChatStateTracker.cpp index 5141872..25ecd1c 100644 --- a/Swiften/Chat/ChatStateTracker.cpp +++ b/Swiften/Chat/ChatStateTracker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -11,17 +11,17 @@ ChatStateTracker::ChatStateTracker() { currentState_ = ChatState::Gone; } -void ChatStateTracker::handleMessageReceived(boost::shared_ptr message) { +void ChatStateTracker::handleMessageReceived(std::shared_ptr message) { if (message->getType() == Message::Error) { return; } - boost::shared_ptr statePayload = message->getPayload(); + std::shared_ptr statePayload = message->getPayload(); if (statePayload) { changeState(statePayload->getChatState());; } } -void ChatStateTracker::handlePresenceChange(boost::shared_ptr newPresence) { +void ChatStateTracker::handlePresenceChange(std::shared_ptr newPresence) { if (newPresence->getType() == Presence::Unavailable) { onChatStateChange(ChatState::Gone); } diff --git a/Swiften/Chat/ChatStateTracker.h b/Swiften/Chat/ChatStateTracker.h index f31da0b..5bbc7ec 100644 --- a/Swiften/Chat/ChatStateTracker.h +++ b/Swiften/Chat/ChatStateTracker.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -18,8 +18,8 @@ namespace Swift { class SWIFTEN_API ChatStateTracker { public: ChatStateTracker(); - void handleMessageReceived(boost::shared_ptr message); - void handlePresenceChange(boost::shared_ptr newPresence); + void handleMessageReceived(std::shared_ptr message); + void handlePresenceChange(std::shared_ptr newPresence); boost::signal onChatStateChange; private: void changeState(ChatState::ChatStateType state); diff --git a/Swiften/Chat/UnitTest/ChatStateNotifierTest.cpp b/Swiften/Chat/UnitTest/ChatStateNotifierTest.cpp index af43ced..278068a 100644 --- a/Swiften/Chat/UnitTest/ChatStateNotifierTest.cpp +++ b/Swiften/Chat/UnitTest/ChatStateNotifierTest.cpp @@ -70,21 +70,21 @@ public: void testContactShouldReceiveStates_CapsOnly() { setContactHas85Caps(); - boost::shared_ptr message(new Message()); + std::shared_ptr message(new Message()); notifier_->addChatStateRequest(message); CPPUNIT_ASSERT(message->getPayload()); CPPUNIT_ASSERT_EQUAL(ChatState::Active, message->getPayload()->getChatState()); } void testContactShouldReceiveStates_CapsNorActive() { - boost::shared_ptr message(new Message()); + std::shared_ptr message(new Message()); notifier_->addChatStateRequest(message); CPPUNIT_ASSERT(!message->getPayload()); } void testContactShouldReceiveStates_ActiveOverrideOn() { notifier_->receivedMessageFromContact(true); - boost::shared_ptr message(new Message()); + std::shared_ptr message(new Message()); notifier_->addChatStateRequest(message); CPPUNIT_ASSERT(message->getPayload()); CPPUNIT_ASSERT_EQUAL(ChatState::Active, message->getPayload()->getChatState()); @@ -97,7 +97,7 @@ public: * thought this should check for false, but I later found it was OPTIONAL * (MAY) behaviour only for if you didn't receive caps. */ - boost::shared_ptr message(new Message()); + std::shared_ptr message(new Message()); notifier_->addChatStateRequest(message); CPPUNIT_ASSERT(message->getPayload()); CPPUNIT_ASSERT_EQUAL(ChatState::Active, message->getPayload()->getChatState()); @@ -142,7 +142,7 @@ public: int getComposingCount() const { int result = 0; - foreach(boost::shared_ptr stanza, stanzaChannel->sentStanzas) { + foreach(std::shared_ptr stanza, stanzaChannel->sentStanzas) { if (stanza->getPayload() && stanza->getPayload()->getChatState() == ChatState::Composing) { result++; } @@ -152,7 +152,7 @@ public: int getActiveCount() const { int result = 0; - foreach(boost::shared_ptr stanza, stanzaChannel->sentStanzas) { + foreach(std::shared_ptr stanza, stanzaChannel->sentStanzas) { if (stanza->getPayload() && stanza->getPayload()->getChatState() == ChatState::Active) { result++; } diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h index 7763745..9c51065 100644 --- a/Swiften/Client/Client.h +++ b/Swiften/Client/Client.h @@ -93,12 +93,12 @@ namespace Swift { /** * Returns the last received presence for the given (full) JID. */ - boost::shared_ptr getLastPresence(const JID& jid) const; + std::shared_ptr getLastPresence(const JID& jid) const; /** * Returns the presence with the highest priority received for the given JID. */ - boost::shared_ptr getHighestPriorityPresence(const JID& bareJID) const; + std::shared_ptr getHighestPriorityPresence(const JID& bareJID) const; PresenceOracle* getPresenceOracle() const { return presenceOracle; @@ -169,7 +169,7 @@ namespace Swift { /** * This signal is emitted when a JID changes presence. */ - boost::signal)> onPresenceChange; + boost::signal)> onPresenceChange; private: Storages* getStorages() const; diff --git a/Swiften/Client/ClientBlockListManager.cpp b/Swiften/Client/ClientBlockListManager.cpp index 84a5639..bfdec30 100644 --- a/Swiften/Client/ClientBlockListManager.cpp +++ b/Swiften/Client/ClientBlockListManager.cpp @@ -7,9 +7,9 @@ #include #include +#include #include -#include #include @@ -18,15 +18,15 @@ using namespace Swift; namespace { class BlockResponder : public SetResponder { public: - BlockResponder(boost::shared_ptr blockList, IQRouter* iqRouter) : SetResponder(iqRouter), blockList(blockList) { + BlockResponder(std::shared_ptr blockList, IQRouter* iqRouter) : SetResponder(iqRouter), blockList(blockList) { } - virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr payload) { + virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr payload) { if (getIQRouter()->isAccountJID(from)) { if (payload) { blockList->addItems(payload->getItems()); } - sendResponse(from, id, boost::shared_ptr()); + sendResponse(from, id, std::shared_ptr()); } else { sendError(from, id, ErrorPayload::NotAuthorized, ErrorPayload::Cancel); @@ -35,15 +35,15 @@ namespace { } private: - boost::shared_ptr blockList; + std::shared_ptr blockList; }; class UnblockResponder : public SetResponder { public: - UnblockResponder(boost::shared_ptr blockList, IQRouter* iqRouter) : SetResponder(iqRouter), blockList(blockList) { + UnblockResponder(std::shared_ptr blockList, IQRouter* iqRouter) : SetResponder(iqRouter), blockList(blockList) { } - virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr payload) { + virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr payload) { if (getIQRouter()->isAccountJID(from)) { if (payload) { if (payload->getItems().empty()) { @@ -53,7 +53,7 @@ namespace { blockList->removeItems(payload->getItems()); } } - sendResponse(from, id, boost::shared_ptr()); + sendResponse(from, id, std::shared_ptr()); } else { sendError(from, id, ErrorPayload::NotAuthorized, ErrorPayload::Cancel); @@ -62,7 +62,7 @@ namespace { } private: - boost::shared_ptr blockList; + std::shared_ptr blockList; }; } @@ -77,20 +77,20 @@ ClientBlockListManager::~ClientBlockListManager() { } } -boost::shared_ptr ClientBlockListManager::getBlockList() { +std::shared_ptr ClientBlockListManager::getBlockList() { if (!blockList) { - blockList = boost::make_shared(); + blockList = std::make_shared(); blockList->setState(BlockList::Init); } return blockList; } -boost::shared_ptr ClientBlockListManager::requestBlockList() { +std::shared_ptr ClientBlockListManager::requestBlockList() { if (!blockList) { - blockList = boost::make_shared(); + blockList = std::make_shared(); } blockList->setState(BlockList::Requesting); - boost::shared_ptr > getRequest = boost::make_shared< GenericRequest >(IQ::Get, JID(), boost::make_shared(), iqRouter); + std::shared_ptr > getRequest = std::make_shared< GenericRequest >(IQ::Get, JID(), std::make_shared(), iqRouter); getRequest->onResponse.connect(boost::bind(&ClientBlockListManager::handleBlockListReceived, this, _1, _2)); getRequest->send(); return blockList; @@ -101,8 +101,8 @@ GenericRequest::ref ClientBlockListManager::createBlockJIDRequest( } GenericRequest::ref ClientBlockListManager::createBlockJIDsRequest(const std::vector& jids) { - boost::shared_ptr payload = boost::make_shared(jids); - return boost::make_shared< GenericRequest >(IQ::Set, JID(), payload, iqRouter); + std::shared_ptr payload = std::make_shared(jids); + return std::make_shared< GenericRequest >(IQ::Set, JID(), payload, iqRouter); } GenericRequest::ref ClientBlockListManager::createUnblockJIDRequest(const JID& jid) { @@ -110,8 +110,8 @@ GenericRequest::ref ClientBlockListManager::createUnblockJIDRequ } GenericRequest::ref ClientBlockListManager::createUnblockJIDsRequest(const std::vector& jids) { - boost::shared_ptr payload = boost::make_shared(jids); - return boost::make_shared< GenericRequest >(IQ::Set, JID(), payload, iqRouter); + std::shared_ptr payload = std::make_shared(jids); + return std::make_shared< GenericRequest >(IQ::Set, JID(), payload, iqRouter); } GenericRequest::ref ClientBlockListManager::createUnblockAllRequest() { @@ -119,7 +119,7 @@ GenericRequest::ref ClientBlockListManager::createUnblockAllRequ } -void ClientBlockListManager::handleBlockListReceived(boost::shared_ptr payload, ErrorPayload::ref error) { +void ClientBlockListManager::handleBlockListReceived(std::shared_ptr payload, ErrorPayload::ref error) { if (error || !payload) { blockList->setState(BlockList::Error); } @@ -127,11 +127,11 @@ void ClientBlockListManager::handleBlockListReceived(boost::shared_ptrsetItems(payload->getItems()); blockList->setState(BlockList::Available); if (!blockResponder) { - blockResponder = boost::make_shared(blockList, iqRouter); + blockResponder = std::make_shared(blockList, iqRouter); blockResponder->start(); } if (!unblockResponder) { - unblockResponder = boost::make_shared(blockList, iqRouter); + unblockResponder = std::make_shared(blockList, iqRouter); unblockResponder->start(); } } diff --git a/Swiften/Client/ClientBlockListManager.h b/Swiften/Client/ClientBlockListManager.h index 63ff1cd..44e3ee1 100644 --- a/Swiften/Client/ClientBlockListManager.h +++ b/Swiften/Client/ClientBlockListManager.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -30,12 +30,12 @@ namespace Swift { /** * Returns the blocklist. */ - boost::shared_ptr getBlockList(); + std::shared_ptr getBlockList(); /** * Get the blocklist from the server. */ - boost::shared_ptr requestBlockList(); + std::shared_ptr requestBlockList(); GenericRequest::ref createBlockJIDRequest(const JID& jid); GenericRequest::ref createBlockJIDsRequest(const std::vector& jids); @@ -45,13 +45,13 @@ namespace Swift { GenericRequest::ref createUnblockAllRequest(); private: - void handleBlockListReceived(boost::shared_ptr payload, ErrorPayload::ref); + void handleBlockListReceived(std::shared_ptr payload, ErrorPayload::ref); private: IQRouter* iqRouter; - boost::shared_ptr > blockResponder; - boost::shared_ptr > unblockResponder; - boost::shared_ptr blockList; + std::shared_ptr > blockResponder; + std::shared_ptr > unblockResponder; + std::shared_ptr blockList; }; } diff --git a/Swiften/Client/ClientError.h b/Swiften/Client/ClientError.h index 5ae1086..3453611 100644 --- a/Swiften/Client/ClientError.h +++ b/Swiften/Client/ClientError.h @@ -1,12 +1,13 @@ /* - * 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 +#include + #include namespace Swift { @@ -54,12 +55,12 @@ namespace Swift { Type getType() const { return type_; } - void setErrorCode(boost::shared_ptr errorCode) { errorCode_ = errorCode; } + void setErrorCode(std::shared_ptr errorCode) { errorCode_ = errorCode; } - boost::shared_ptr getErrorCode() const { return errorCode_; } + std::shared_ptr getErrorCode() const { return errorCode_; } private: Type type_; - boost::shared_ptr errorCode_; + std::shared_ptr errorCode_; }; } diff --git a/Swiften/Client/ClientOptions.h b/Swiften/Client/ClientOptions.h index c902388..3a93197 100644 --- a/Swiften/Client/ClientOptions.h +++ b/Swiften/Client/ClientOptions.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -152,7 +152,7 @@ namespace Swift { * This can be initialized with a custom HTTPTrafficFilter, which allows HTTP CONNECT * proxy initialization to be customized. */ - boost::shared_ptr httpTrafficFilter; + std::shared_ptr httpTrafficFilter; /** * Options passed to the TLS stack diff --git a/Swiften/Client/ClientSession.cpp b/Swiften/Client/ClientSession.cpp index 1b67c96..c301881 100644 --- a/Swiften/Client/ClientSession.cpp +++ b/Swiften/Client/ClientSession.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -57,7 +57,7 @@ namespace Swift { ClientSession::ClientSession( const JID& jid, - boost::shared_ptr stream, + std::shared_ptr stream, IDNConverter* idnConverter, CryptoProvider* crypto) : localJID(jid), @@ -104,7 +104,7 @@ void ClientSession::sendStreamHeader() { stream->writeHeader(header); } -void ClientSession::sendStanza(boost::shared_ptr stanza) { +void ClientSession::sendStanza(std::shared_ptr stanza) { stream->writeElement(stanza); if (stanzaAckRequester_) { stanzaAckRequester_->handleStanzaSent(stanza); @@ -116,17 +116,17 @@ void ClientSession::handleStreamStart(const ProtocolHeader&) { state = Negotiating; } -void ClientSession::handleElement(boost::shared_ptr element) { - if (boost::shared_ptr stanza = boost::dynamic_pointer_cast(element)) { +void ClientSession::handleElement(std::shared_ptr element) { + if (std::shared_ptr stanza = std::dynamic_pointer_cast(element)) { if (stanzaAckResponder_) { stanzaAckResponder_->handleStanzaReceived(); } if (getState() == Initialized) { onStanzaReceived(stanza); } - else if (boost::shared_ptr iq = boost::dynamic_pointer_cast(element)) { + else if (std::shared_ptr iq = std::dynamic_pointer_cast(element)) { if (state == BindingResource) { - boost::shared_ptr resourceBind(iq->getPayload()); + std::shared_ptr resourceBind(iq->getPayload()); if (iq->getType() == IQ::Error && iq->getID() == "session-bind") { finishSession(Error::ResourceBindError); } @@ -162,12 +162,12 @@ void ClientSession::handleElement(boost::shared_ptr element) { } } } - else if (boost::dynamic_pointer_cast(element)) { + else if (std::dynamic_pointer_cast(element)) { if (stanzaAckResponder_) { stanzaAckResponder_->handleAckRequestReceived(); } } - else if (boost::shared_ptr ack = boost::dynamic_pointer_cast(element)) { + else if (std::shared_ptr ack = std::dynamic_pointer_cast(element)) { if (stanzaAckRequester_) { if (ack->isValid()) { stanzaAckRequester_->handleAckReceived(ack->getHandledStanzasCount()); @@ -180,11 +180,11 @@ void ClientSession::handleElement(boost::shared_ptr element) { SWIFT_LOG(warning) << "Ignoring ack"; } } - else if (StreamError::ref streamError = boost::dynamic_pointer_cast(element)) { + else if (StreamError::ref streamError = std::dynamic_pointer_cast(element)) { finishSession(Error::StreamError); } else if (getState() == Initialized) { - boost::shared_ptr stanza = boost::dynamic_pointer_cast(element); + std::shared_ptr stanza = std::dynamic_pointer_cast(element); if (stanza) { if (stanzaAckResponder_) { stanzaAckResponder_->handleStanzaReceived(); @@ -197,14 +197,14 @@ void ClientSession::handleElement(boost::shared_ptr element) { if (streamFeatures->hasStartTLS() && stream->supportsTLSEncryption() && useTLS != NeverUseTLS) { state = WaitingForEncrypt; - stream->writeElement(boost::make_shared()); + stream->writeElement(std::make_shared()); } else if (useTLS == RequireTLS && !stream->isTLSEncrypted()) { finishSession(Error::NoSupportedAuthMechanismsError); } else if (useStreamCompression && stream->supportsZLibCompression() && streamFeatures->hasCompressionMethod("zlib")) { state = Compressing; - stream->writeElement(boost::make_shared("zlib")); + stream->writeElement(std::make_shared("zlib")); } else if (streamFeatures->hasAuthenticationMechanisms()) { #ifdef SWIFTEN_PLATFORM_WIN32 @@ -217,13 +217,13 @@ void ClientSession::handleElement(boost::shared_ptr element) { } else { WindowsGSSAPIClientAuthenticator* gssapiAuthenticator = new WindowsGSSAPIClientAuthenticator(*authenticationHostname, localJID.getDomain(), authenticationPort); - boost::shared_ptr error = boost::make_shared(Error::AuthenticationFailedError); + std::shared_ptr error = std::make_shared(Error::AuthenticationFailedError); authenticator = gssapiAuthenticator; if (!gssapiAuthenticator->isError()) { state = Authenticating; - stream->writeElement(boost::make_shared(authenticator->getName(), authenticator->getResponse())); + stream->writeElement(std::make_shared(authenticator->getName(), authenticator->getResponse())); } else { error->errorCode = gssapiAuthenticator->getErrorCode(); @@ -237,7 +237,7 @@ void ClientSession::handleElement(boost::shared_ptr element) { if (streamFeatures->hasAuthenticationMechanism("EXTERNAL")) { authenticator = new EXTERNALClientAuthenticator(); state = Authenticating; - stream->writeElement(boost::make_shared("EXTERNAL", createSafeByteArray(""))); + stream->writeElement(std::make_shared("EXTERNAL", createSafeByteArray(""))); } else { finishSession(Error::TLSClientCertificateError); @@ -246,7 +246,7 @@ void ClientSession::handleElement(boost::shared_ptr element) { else if (streamFeatures->hasAuthenticationMechanism("EXTERNAL")) { authenticator = new EXTERNALClientAuthenticator(); state = Authenticating; - stream->writeElement(boost::make_shared("EXTERNAL", createSafeByteArray(""))); + stream->writeElement(std::make_shared("EXTERNAL", createSafeByteArray(""))); } else if (streamFeatures->hasAuthenticationMechanism("SCRAM-SHA-1") || streamFeatures->hasAuthenticationMechanism("SCRAM-SHA-1-PLUS")) { std::ostringstream s; @@ -298,26 +298,26 @@ void ClientSession::handleElement(boost::shared_ptr element) { } } } - else if (boost::dynamic_pointer_cast(element)) { + else if (std::dynamic_pointer_cast(element)) { CHECK_STATE_OR_RETURN(Compressing); state = WaitingForStreamStart; stream->addZLibCompression(); stream->resetXMPPParser(); sendStreamHeader(); } - else if (boost::dynamic_pointer_cast(element)) { + else if (std::dynamic_pointer_cast(element)) { finishSession(Error::CompressionFailedError); } - else if (boost::dynamic_pointer_cast(element)) { - stanzaAckRequester_ = boost::make_shared(); + else if (std::dynamic_pointer_cast(element)) { + stanzaAckRequester_ = std::make_shared(); stanzaAckRequester_->onRequestAck.connect(boost::bind(&ClientSession::requestAck, shared_from_this())); stanzaAckRequester_->onStanzaAcked.connect(boost::bind(&ClientSession::handleStanzaAcked, shared_from_this(), _1)); - stanzaAckResponder_ = boost::make_shared(); + stanzaAckResponder_ = std::make_shared(); stanzaAckResponder_->onAck.connect(boost::bind(&ClientSession::ack, shared_from_this(), _1)); needAcking = false; continueSessionInitialization(); } - else if (boost::dynamic_pointer_cast(element)) { + else if (std::dynamic_pointer_cast(element)) { needAcking = false; continueSessionInitialization(); } @@ -325,11 +325,11 @@ void ClientSession::handleElement(boost::shared_ptr element) { CHECK_STATE_OR_RETURN(Authenticating); assert(authenticator); if (authenticator->setChallenge(challenge->getValue())) { - stream->writeElement(boost::make_shared(authenticator->getResponse())); + stream->writeElement(std::make_shared(authenticator->getResponse())); } #ifdef SWIFTEN_PLATFORM_WIN32 else if (WindowsGSSAPIClientAuthenticator* gssapiAuthenticator = dynamic_cast(authenticator)) { - boost::shared_ptr error = boost::make_shared(Error::AuthenticationFailedError); + std::shared_ptr error = std::make_shared(Error::AuthenticationFailedError); error->errorCode = gssapiAuthenticator->getErrorCode(); finishSession(error); @@ -374,7 +374,7 @@ void ClientSession::handleElement(boost::shared_ptr element) { void ClientSession::continueSessionInitialization() { if (needResourceBind) { state = BindingResource; - boost::shared_ptr resourceBind(boost::make_shared()); + std::shared_ptr resourceBind(std::make_shared()); if (!localJID.getResource().empty()) { resourceBind->setResource(localJID.getResource()); } @@ -382,11 +382,11 @@ void ClientSession::continueSessionInitialization() { } else if (needAcking) { state = EnablingSessionManagement; - stream->writeElement(boost::make_shared()); + stream->writeElement(std::make_shared()); } else if (needSessionStart) { state = StartingSession; - sendStanza(IQ::createRequest(IQ::Set, JID(), "session-start", boost::make_shared())); + sendStanza(IQ::createRequest(IQ::Set, JID(), "session-start", std::make_shared())); } else { state = Initialized; @@ -407,14 +407,14 @@ void ClientSession::sendCredentials(const SafeByteArray& password) { assert(authenticator); state = Authenticating; authenticator->setCredentials(localJID.getNode(), password); - stream->writeElement(boost::make_shared(authenticator->getName(), authenticator->getResponse())); + stream->writeElement(std::make_shared(authenticator->getName(), authenticator->getResponse())); } void ClientSession::handleTLSEncrypted() { CHECK_STATE_OR_RETURN(Encrypting); std::vector certificateChain = stream->getPeerCertificateChain(); - boost::shared_ptr verificationError = stream->getPeerCertificateVerificationError(); + std::shared_ptr verificationError = stream->getPeerCertificateVerificationError(); if (verificationError) { checkTrustOrFinish(certificateChain, verificationError); } @@ -424,12 +424,12 @@ void ClientSession::handleTLSEncrypted() { continueAfterTLSEncrypted(); } else { - checkTrustOrFinish(certificateChain, boost::make_shared(CertificateVerificationError::InvalidServerIdentity)); + checkTrustOrFinish(certificateChain, std::make_shared(CertificateVerificationError::InvalidServerIdentity)); } } } -void ClientSession::checkTrustOrFinish(const std::vector& certificateChain, boost::shared_ptr error) { +void ClientSession::checkTrustOrFinish(const std::vector& certificateChain, std::shared_ptr error) { if (certificateTrustChecker && certificateTrustChecker->isCertificateTrusted(certificateChain)) { continueAfterTLSEncrypted(); } @@ -444,7 +444,7 @@ void ClientSession::continueAfterTLSEncrypted() { sendStreamHeader(); } -void ClientSession::handleStreamClosed(boost::shared_ptr streamError) { +void ClientSession::handleStreamClosed(std::shared_ptr streamError) { State previousState = state; state = Finished; @@ -472,14 +472,14 @@ void ClientSession::handleStreamClosed(boost::shared_ptr streamErr } void ClientSession::finish() { - finishSession(boost::shared_ptr()); + finishSession(std::shared_ptr()); } void ClientSession::finishSession(Error::Type error) { - finishSession(boost::make_shared(error)); + finishSession(std::make_shared(error)); } -void ClientSession::finishSession(boost::shared_ptr error) { +void ClientSession::finishSession(std::shared_ptr error) { state = Finishing; if (!error_) { error_ = error; @@ -500,15 +500,15 @@ void ClientSession::finishSession(boost::shared_ptr error) { } void ClientSession::requestAck() { - stream->writeElement(boost::make_shared()); + stream->writeElement(std::make_shared()); } -void ClientSession::handleStanzaAcked(boost::shared_ptr stanza) { +void ClientSession::handleStanzaAcked(std::shared_ptr stanza) { onStanzaAcked(stanza); } void ClientSession::ack(unsigned int handledStanzasCount) { - stream->writeElement(boost::make_shared(handledStanzasCount)); + stream->writeElement(std::make_shared(handledStanzasCount)); } } diff --git a/Swiften/Client/ClientSession.h b/Swiften/Client/ClientSession.h index b1b6755..7309218 100644 --- a/Swiften/Client/ClientSession.h +++ b/Swiften/Client/ClientSession.h @@ -6,11 +6,9 @@ #pragma once +#include #include -#include -#include - #include #include #include @@ -26,7 +24,7 @@ namespace Swift { class IDNConverter; class CryptoProvider; - class SWIFTEN_API ClientSession : public boost::enable_shared_from_this { + class SWIFTEN_API ClientSession : public std::enable_shared_from_this { public: enum State { Initial, @@ -58,7 +56,7 @@ namespace Swift { TLSError, StreamError } type; - boost::shared_ptr errorCode; + std::shared_ptr errorCode; Error(Type type) : type(type) {} }; @@ -70,8 +68,8 @@ namespace Swift { ~ClientSession(); - static boost::shared_ptr create(const JID& jid, boost::shared_ptr stream, IDNConverter* idnConverter, CryptoProvider* crypto) { - return boost::shared_ptr(new ClientSession(jid, stream, idnConverter, crypto)); + static std::shared_ptr create(const JID& jid, std::shared_ptr stream, IDNConverter* idnConverter, CryptoProvider* crypto) { + return std::shared_ptr(new ClientSession(jid, stream, idnConverter, crypto)); } State getState() const { @@ -121,7 +119,7 @@ namespace Swift { } void sendCredentials(const SafeByteArray& password); - void sendStanza(boost::shared_ptr); + void sendStanza(std::shared_ptr); void setCertificateTrustChecker(CertificateTrustChecker* checker) { certificateTrustChecker = checker; @@ -142,19 +140,19 @@ namespace Swift { public: boost::signal onNeedCredentials; boost::signal onInitialized; - boost::signal)> onFinished; - boost::signal)> onStanzaReceived; - boost::signal)> onStanzaAcked; + boost::signal)> onFinished; + boost::signal)> onStanzaReceived; + boost::signal)> onStanzaAcked; private: ClientSession( const JID& jid, - boost::shared_ptr, + std::shared_ptr, IDNConverter* idnConverter, CryptoProvider* crypto); void finishSession(Error::Type error); - void finishSession(boost::shared_ptr error); + void finishSession(std::shared_ptr error); JID getRemoteJID() const { return JID("", localJID.getDomain()); @@ -162,9 +160,9 @@ namespace Swift { void sendStreamHeader(); - void handleElement(boost::shared_ptr); + void handleElement(std::shared_ptr); void handleStreamStart(const ProtocolHeader&); - void handleStreamClosed(boost::shared_ptr); + void handleStreamClosed(std::shared_ptr); void handleTLSEncrypted(); @@ -172,15 +170,15 @@ namespace Swift { void continueSessionInitialization(); void requestAck(); - void handleStanzaAcked(boost::shared_ptr stanza); + void handleStanzaAcked(std::shared_ptr stanza); void ack(unsigned int handledStanzasCount); void continueAfterTLSEncrypted(); - void checkTrustOrFinish(const std::vector& certificateChain, boost::shared_ptr error); + void checkTrustOrFinish(const std::vector& certificateChain, std::shared_ptr error); private: JID localJID; State state; - boost::shared_ptr stream; + std::shared_ptr stream; IDNConverter* idnConverter; CryptoProvider* crypto; bool allowPLAINOverNonTLS; @@ -192,9 +190,9 @@ namespace Swift { bool needAcking; bool rosterVersioningSupported; ClientAuthenticator* authenticator; - boost::shared_ptr stanzaAckRequester_; - boost::shared_ptr stanzaAckResponder_; - boost::shared_ptr error_; + std::shared_ptr stanzaAckRequester_; + std::shared_ptr stanzaAckResponder_; + std::shared_ptr error_; CertificateTrustChecker* certificateTrustChecker; bool singleSignOn; int authenticationPort; diff --git a/Swiften/Client/ClientSessionStanzaChannel.cpp b/Swiften/Client/ClientSessionStanzaChannel.cpp index 1340b7c..f1cba5d 100644 --- a/Swiften/Client/ClientSessionStanzaChannel.cpp +++ b/Swiften/Client/ClientSessionStanzaChannel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -22,7 +22,7 @@ ClientSessionStanzaChannel::~ClientSessionStanzaChannel() { } } -void ClientSessionStanzaChannel::setSession(boost::shared_ptr session) { +void ClientSessionStanzaChannel::setSession(std::shared_ptr session) { assert(!this->session); this->session = session; session->onInitialized.connect(boost::bind(&ClientSessionStanzaChannel::handleSessionInitialized, this)); @@ -31,15 +31,15 @@ void ClientSessionStanzaChannel::setSession(boost::shared_ptr ses session->onStanzaAcked.connect(boost::bind(&ClientSessionStanzaChannel::handleStanzaAcked, this, _1)); } -void ClientSessionStanzaChannel::sendIQ(boost::shared_ptr iq) { +void ClientSessionStanzaChannel::sendIQ(std::shared_ptr iq) { send(iq); } -void ClientSessionStanzaChannel::sendMessage(boost::shared_ptr message) { +void ClientSessionStanzaChannel::sendMessage(std::shared_ptr message) { send(message); } -void ClientSessionStanzaChannel::sendPresence(boost::shared_ptr presence) { +void ClientSessionStanzaChannel::sendPresence(std::shared_ptr presence) { send(presence); } @@ -47,7 +47,7 @@ std::string ClientSessionStanzaChannel::getNewIQID() { return idGenerator.generateID(); } -void ClientSessionStanzaChannel::send(boost::shared_ptr stanza) { +void ClientSessionStanzaChannel::send(std::shared_ptr stanza) { if (!isAvailable()) { std::cerr << "Warning: Client: Trying to send a stanza while disconnected." << std::endl; return; @@ -55,7 +55,7 @@ void ClientSessionStanzaChannel::send(boost::shared_ptr stanza) { session->sendStanza(stanza); } -void ClientSessionStanzaChannel::handleSessionFinished(boost::shared_ptr) { +void ClientSessionStanzaChannel::handleSessionFinished(std::shared_ptr) { session->onFinished.disconnect(boost::bind(&ClientSessionStanzaChannel::handleSessionFinished, this, _1)); session->onStanzaReceived.disconnect(boost::bind(&ClientSessionStanzaChannel::handleStanza, this, _1)); session->onStanzaAcked.disconnect(boost::bind(&ClientSessionStanzaChannel::handleStanzaAcked, this, _1)); @@ -65,20 +65,20 @@ void ClientSessionStanzaChannel::handleSessionFinished(boost::shared_ptr) onAvailableChanged(false); } -void ClientSessionStanzaChannel::handleStanza(boost::shared_ptr stanza) { - boost::shared_ptr message = boost::dynamic_pointer_cast(stanza); +void ClientSessionStanzaChannel::handleStanza(std::shared_ptr stanza) { + std::shared_ptr message = std::dynamic_pointer_cast(stanza); if (message) { onMessageReceived(message); return; } - boost::shared_ptr presence = boost::dynamic_pointer_cast(stanza); + std::shared_ptr presence = std::dynamic_pointer_cast(stanza); if (presence) { onPresenceReceived(presence); return; } - boost::shared_ptr iq = boost::dynamic_pointer_cast(stanza); + std::shared_ptr iq = std::dynamic_pointer_cast(stanza); if (iq) { onIQReceived(iq); return; @@ -100,7 +100,7 @@ std::vector ClientSessionStanzaChannel::getPeerCertificateChai return std::vector(); } -void ClientSessionStanzaChannel::handleStanzaAcked(boost::shared_ptr stanza) { +void ClientSessionStanzaChannel::handleStanzaAcked(std::shared_ptr stanza) { onStanzaAcked(stanza); } diff --git a/Swiften/Client/ClientSessionStanzaChannel.h b/Swiften/Client/ClientSessionStanzaChannel.h index d3b302b..0527a5c 100644 --- a/Swiften/Client/ClientSessionStanzaChannel.h +++ b/Swiften/Client/ClientSessionStanzaChannel.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 +#include #include #include @@ -24,11 +24,11 @@ namespace Swift { public: virtual ~ClientSessionStanzaChannel(); - void setSession(boost::shared_ptr session); + void setSession(std::shared_ptr session); - void sendIQ(boost::shared_ptr iq); - void sendMessage(boost::shared_ptr message); - void sendPresence(boost::shared_ptr presence); + void sendIQ(std::shared_ptr iq); + void sendMessage(std::shared_ptr message); + void sendPresence(std::shared_ptr presence); bool getStreamManagementEnabled() const; virtual std::vector getPeerCertificateChain() const; @@ -38,15 +38,15 @@ namespace Swift { private: std::string getNewIQID(); - void send(boost::shared_ptr stanza); - void handleSessionFinished(boost::shared_ptr error); - void handleStanza(boost::shared_ptr stanza); - void handleStanzaAcked(boost::shared_ptr stanza); + void send(std::shared_ptr stanza); + void handleSessionFinished(std::shared_ptr error); + void handleStanza(std::shared_ptr stanza); + void handleStanzaAcked(std::shared_ptr stanza); void handleSessionInitialized(); private: IDGenerator idGenerator; - boost::shared_ptr session; + std::shared_ptr session; }; } diff --git a/Swiften/Client/CoreClient.cpp b/Swiften/Client/CoreClient.cpp index 44fadc6..c2f8fd7 100644 --- a/Swiften/Client/CoreClient.cpp +++ b/Swiften/Client/CoreClient.cpp @@ -6,9 +6,10 @@ #include +#include + #include #include -#include #include #include @@ -115,7 +116,7 @@ void CoreClient::connect(const ClientOptions& o) { } assert(!connector_); if (options.boshURL.isEmpty()) { - connector_ = boost::make_shared(host, port, serviceLookupPrefix, networkFactories->getDomainNameResolver(), connectionFactories, networkFactories->getTimerFactory()); + connector_ = std::make_shared(host, port, serviceLookupPrefix, networkFactories->getDomainNameResolver(), connectionFactories, networkFactories->getTimerFactory()); connector_->onConnectFinished.connect(boost::bind(&CoreClient::handleConnectorFinished, this, _1, _2)); connector_->setTimeoutMilliseconds(2*60*1000); connector_->start(); @@ -124,7 +125,7 @@ void CoreClient::connect(const ClientOptions& o) { /* Autodiscovery of which proxy works is largely ok with a TCP session, because this is a one-off. With BOSH * it would be quite painful given that potentially every stanza could be sent on a new connection. */ - boost::shared_ptr boshSessionStream_ = boost::shared_ptr(new BOSHSessionStream( + std::shared_ptr boshSessionStream_ = std::shared_ptr(new BOSHSessionStream( options.boshURL, getPayloadParserFactories(), getPayloadSerializers(), @@ -181,7 +182,7 @@ void CoreClient::bindSessionToStream() { /** * Only called for TCP sessions. BOSH is handled inside the BOSHSessionStream. */ -void CoreClient::handleConnectorFinished(boost::shared_ptr connection, boost::shared_ptr error) { +void CoreClient::handleConnectorFinished(std::shared_ptr connection, std::shared_ptr error) { resetConnector(); if (!connection) { if (options.forgetPassword) { @@ -189,7 +190,7 @@ void CoreClient::handleConnectorFinished(boost::shared_ptr connectio } boost::optional clientError; if (!disconnectRequested_) { - clientError = boost::dynamic_pointer_cast(error) ? boost::optional(ClientError::DomainNameResolveError) : boost::optional(ClientError::ConnectionError); + clientError = std::dynamic_pointer_cast(error) ? boost::optional(ClientError::DomainNameResolveError) : boost::optional(ClientError::ConnectionError); } onDisconnected(clientError); } @@ -205,7 +206,7 @@ void CoreClient::handleConnectorFinished(boost::shared_ptr connectio connection_ = connection; - sessionStream_ = boost::make_shared(ClientStreamType, connection_, getPayloadParserFactories(), getPayloadSerializers(), networkFactories->getTLSContextFactory(), networkFactories->getTimerFactory(), networkFactories->getXMLParserFactory(), options.tlsOptions); + sessionStream_ = std::make_shared(ClientStreamType, connection_, getPayloadParserFactories(), getPayloadSerializers(), networkFactories->getTLSContextFactory(), networkFactories->getTimerFactory(), networkFactories->getXMLParserFactory(), options.tlsOptions); if (certificate_) { sessionStream_->setTLSCertificate(certificate_); } @@ -232,7 +233,7 @@ void CoreClient::setCertificate(CertificateWithKey::ref certificate) { certificate_ = certificate; } -void CoreClient::handleSessionFinished(boost::shared_ptr error) { +void CoreClient::handleSessionFinished(std::shared_ptr error) { if (options.forgetPassword) { purgePassword(); } @@ -241,7 +242,7 @@ void CoreClient::handleSessionFinished(boost::shared_ptr error) { boost::optional actualError; if (error) { ClientError clientError; - if (boost::shared_ptr actualError = boost::dynamic_pointer_cast(error)) { + if (std::shared_ptr actualError = std::dynamic_pointer_cast(error)) { switch(actualError->type) { case ClientSession::Error::AuthenticationFailedError: clientError = ClientError(ClientError::AuthenticationFailedError); @@ -276,7 +277,7 @@ void CoreClient::handleSessionFinished(boost::shared_ptr error) { } clientError.setErrorCode(actualError->errorCode); } - else if (boost::shared_ptr actualError = boost::dynamic_pointer_cast(error)) { + else if (std::shared_ptr actualError = std::dynamic_pointer_cast(error)) { switch(actualError->getType()) { case TLSError::CertificateCardRemoved: clientError = ClientError(ClientError::CertificateCardRemoved); @@ -286,7 +287,7 @@ void CoreClient::handleSessionFinished(boost::shared_ptr error) { break; } } - else if (boost::shared_ptr actualError = boost::dynamic_pointer_cast(error)) { + else if (std::shared_ptr actualError = std::dynamic_pointer_cast(error)) { switch(actualError->type) { case SessionStream::SessionStreamError::ParseError: clientError = ClientError(ClientError::XMLError); @@ -305,7 +306,7 @@ void CoreClient::handleSessionFinished(boost::shared_ptr error) { break; } } - else if (boost::shared_ptr verificationError = boost::dynamic_pointer_cast(error)) { + else if (std::shared_ptr verificationError = std::dynamic_pointer_cast(error)) { switch(verificationError->getType()) { case CertificateVerificationError::UnknownError: clientError = ClientError(ClientError::UnknownCertificateError); @@ -377,11 +378,11 @@ void CoreClient::handleStanzaChannelAvailableChanged(bool available) { } } -void CoreClient::sendMessage(boost::shared_ptr message) { +void CoreClient::sendMessage(std::shared_ptr message) { stanzaChannel_->sendMessage(message); } -void CoreClient::sendPresence(boost::shared_ptr presence) { +void CoreClient::sendPresence(std::shared_ptr presence) { stanzaChannel_->sendPresence(presence); } @@ -458,7 +459,7 @@ void CoreClient::resetSession() { if (connection_) { connection_->disconnect(); } - else if (boost::dynamic_pointer_cast(sessionStream_)) { + else if (std::dynamic_pointer_cast(sessionStream_)) { sessionStream_->close(); } sessionStream_.reset(); diff --git a/Swiften/Client/CoreClient.h b/Swiften/Client/CoreClient.h index 3efc38f..a1e4681 100644 --- a/Swiften/Client/CoreClient.h +++ b/Swiften/Client/CoreClient.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -78,12 +77,12 @@ namespace Swift { /** * Sends a message. */ - void sendMessage(boost::shared_ptr); + void sendMessage(std::shared_ptr); /** * Sends a presence stanza. */ - void sendPresence(boost::shared_ptr); + void sendPresence(std::shared_ptr); /** * Sends raw, unchecked data. @@ -177,12 +176,12 @@ namespace Swift { /** * Emitted when a message is received. */ - boost::signal)> onMessageReceived; + boost::signal)> onMessageReceived; /** * Emitted when a presence stanza is received. */ - boost::signal) > onPresenceReceived; + boost::signal) > onPresenceReceived; /** * Emitted when the server acknowledges receipt of a @@ -190,10 +189,10 @@ namespace Swift { * * \see getStreamManagementEnabled() */ - boost::signal)> onStanzaAcked; + boost::signal)> onStanzaAcked; protected: - boost::shared_ptr getSession() const { + std::shared_ptr getSession() const { return session_; } @@ -207,15 +206,15 @@ namespace Swift { virtual void handleConnected() {} private: - void handleConnectorFinished(boost::shared_ptr, boost::shared_ptr error); + void handleConnectorFinished(std::shared_ptr, std::shared_ptr error); void handleStanzaChannelAvailableChanged(bool available); - void handleSessionFinished(boost::shared_ptr); + void handleSessionFinished(std::shared_ptr); void handleNeedCredentials(); void handleDataRead(const SafeByteArray&); void handleDataWritten(const SafeByteArray&); - void handlePresenceReceived(boost::shared_ptr); - void handleMessageReceived(boost::shared_ptr); - void handleStanzaAcked(boost::shared_ptr); + void handlePresenceReceived(std::shared_ptr); + void handleMessageReceived(std::shared_ptr); + void handleStanzaAcked(std::shared_ptr); void purgePassword(); void bindSessionToStream(); @@ -230,11 +229,11 @@ namespace Swift { ClientSessionStanzaChannel* stanzaChannel_; IQRouter* iqRouter_; ClientOptions options; - boost::shared_ptr connector_; + std::shared_ptr connector_; std::vector proxyConnectionFactories; - boost::shared_ptr connection_; - boost::shared_ptr sessionStream_; - boost::shared_ptr session_; + std::shared_ptr connection_; + std::shared_ptr sessionStream_; + std::shared_ptr session_; CertificateWithKey::ref certificate_; bool disconnectRequested_; CertificateTrustChecker* certificateTrustChecker; diff --git a/Swiften/Client/DummyStanzaChannel.h b/Swiften/Client/DummyStanzaChannel.h index 0e52f62..48b611c 100644 --- a/Swiften/Client/DummyStanzaChannel.h +++ b/Swiften/Client/DummyStanzaChannel.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -15,7 +15,7 @@ namespace Swift { public: DummyStanzaChannel() : available_(true) {} - virtual void sendStanza(boost::shared_ptr stanza) { + virtual void sendStanza(std::shared_ptr stanza) { sentStanzas.push_back(stanza); } @@ -24,15 +24,15 @@ namespace Swift { onAvailableChanged(available); } - virtual void sendIQ(boost::shared_ptr iq) { + virtual void sendIQ(std::shared_ptr iq) { sentStanzas.push_back(iq); } - virtual void sendMessage(boost::shared_ptr message) { + virtual void sendMessage(std::shared_ptr message) { sentStanzas.push_back(message); } - virtual void sendPresence(boost::shared_ptr presence) { + virtual void sendPresence(std::shared_ptr presence) { sentStanzas.push_back(presence); } @@ -52,7 +52,7 @@ namespace Swift { if (index >= sentStanzas.size()) { return false; } - boost::shared_ptr iqStanza = boost::dynamic_pointer_cast(sentStanzas[index]); + std::shared_ptr iqStanza = std::dynamic_pointer_cast(sentStanzas[index]); return iqStanza && iqStanza->getType() == type && iqStanza->getTo() == jid && iqStanza->getPayload(); } @@ -60,7 +60,7 @@ namespace Swift { if (index >= sentStanzas.size()) { return false; } - boost::shared_ptr iqStanza = boost::dynamic_pointer_cast(sentStanzas[index]); + std::shared_ptr iqStanza = std::dynamic_pointer_cast(sentStanzas[index]); return iqStanza && iqStanza->getType() == IQ::Result && iqStanza->getID() == id; } @@ -68,22 +68,22 @@ namespace Swift { if (index >= sentStanzas.size()) { return false; } - boost::shared_ptr iqStanza = boost::dynamic_pointer_cast(sentStanzas[index]); + std::shared_ptr iqStanza = std::dynamic_pointer_cast(sentStanzas[index]); return iqStanza && iqStanza->getType() == IQ::Error && iqStanza->getID() == id; } - template boost::shared_ptr getStanzaAtIndex(size_t index) { + template std::shared_ptr getStanzaAtIndex(size_t index) { if (sentStanzas.size() <= index) { - return boost::shared_ptr(); + return std::shared_ptr(); } - return boost::dynamic_pointer_cast(sentStanzas[index]); + return std::dynamic_pointer_cast(sentStanzas[index]); } std::vector getPeerCertificateChain() const { return std::vector(); } - std::vector > sentStanzas; + std::vector > sentStanzas; bool available_; }; } diff --git a/Swiften/Client/NickResolver.cpp b/Swiften/Client/NickResolver.cpp index c424447..394d490 100644 --- a/Swiften/Client/NickResolver.cpp +++ b/Swiften/Client/NickResolver.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include diff --git a/Swiften/Client/NickResolver.h b/Swiften/Client/NickResolver.h index b187796..0e46411 100644 --- a/Swiften/Client/NickResolver.h +++ b/Swiften/Client/NickResolver.h @@ -7,10 +7,9 @@ #pragma once #include +#include #include -#include - #include #include #include diff --git a/Swiften/Client/StanzaChannel.h b/Swiften/Client/StanzaChannel.h index ec36634..933d39d 100644 --- a/Swiften/Client/StanzaChannel.h +++ b/Swiften/Client/StanzaChannel.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -18,15 +18,15 @@ namespace Swift { class SWIFTEN_API StanzaChannel : public IQChannel { public: - virtual void sendMessage(boost::shared_ptr) = 0; - virtual void sendPresence(boost::shared_ptr) = 0; + virtual void sendMessage(std::shared_ptr) = 0; + virtual void sendPresence(std::shared_ptr) = 0; virtual bool isAvailable() const = 0; virtual bool getStreamManagementEnabled() const = 0; virtual std::vector getPeerCertificateChain() const = 0; boost::signal onAvailableChanged; - boost::signal)> onMessageReceived; - boost::signal) > onPresenceReceived; - boost::signal)> onStanzaAcked; + boost::signal)> onMessageReceived; + boost::signal) > onPresenceReceived; + boost::signal)> onStanzaAcked; }; } diff --git a/Swiften/Client/UnitTest/BlockListImplTest.cpp b/Swiften/Client/UnitTest/BlockListImplTest.cpp index 0502f46..b2e45e2 100644 --- a/Swiften/Client/UnitTest/BlockListImplTest.cpp +++ b/Swiften/Client/UnitTest/BlockListImplTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -60,7 +60,7 @@ class BlockListImplTest : public CppUnit::TestFixture { } void setUp() { - blockList_ = boost::make_shared(); + blockList_ = std::make_shared(); addedJIDs_.clear(); removedJIDs_.clear(); blockList_->addItem(JID("a@example.com")); @@ -83,7 +83,7 @@ class BlockListImplTest : public CppUnit::TestFixture { } private: - boost::shared_ptr blockList_; + std::shared_ptr blockList_; std::vector addedJIDs_; std::vector removedJIDs_; }; diff --git a/Swiften/Client/UnitTest/ClientBlockListManagerTest.cpp b/Swiften/Client/UnitTest/ClientBlockListManagerTest.cpp index 2f33984..aaf99e0 100644 --- a/Swiften/Client/UnitTest/ClientBlockListManagerTest.cpp +++ b/Swiften/Client/UnitTest/ClientBlockListManagerTest.cpp @@ -61,7 +61,7 @@ class ClientBlockListManagerTest : public CppUnit::TestFixture { blockRequest->send(); IQ::ref request = stanzaChannel_->getStanzaAtIndex(2); CPPUNIT_ASSERT(request.get() != nullptr); - boost::shared_ptr blockPayload = request->getPayload(); + std::shared_ptr blockPayload = request->getPayload(); CPPUNIT_ASSERT(blockPayload.get() != nullptr); CPPUNIT_ASSERT_EQUAL(JID("romeo@montague.net"), blockPayload->getItems().at(0)); @@ -72,7 +72,7 @@ class ClientBlockListManagerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(static_cast(1), clientBlockListManager_->getBlockList()->getItems().size()); // send block push - boost::shared_ptr pushPayload = boost::make_shared(); + std::shared_ptr pushPayload = std::make_shared(); pushPayload->addItem(JID("romeo@montague.net")); IQ::ref blockPush = IQ::createRequest(IQ::Set, ownJID_, "push1", pushPayload); stanzaChannel_->sendIQ(blockPush); @@ -95,7 +95,7 @@ class ClientBlockListManagerTest : public CppUnit::TestFixture { unblockRequest->send(); IQ::ref request = stanzaChannel_->getStanzaAtIndex(2); CPPUNIT_ASSERT(request.get() != nullptr); - boost::shared_ptr unblockPayload = request->getPayload(); + std::shared_ptr unblockPayload = request->getPayload(); CPPUNIT_ASSERT(unblockPayload.get() != nullptr); CPPUNIT_ASSERT_EQUAL(JID("romeo@montague.net"), unblockPayload->getItems().at(0)); @@ -106,7 +106,7 @@ class ClientBlockListManagerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(static_cast(2), clientBlockListManager_->getBlockList()->getItems().size()); // send block push - boost::shared_ptr pushPayload = boost::make_shared(); + std::shared_ptr pushPayload = std::make_shared(); pushPayload->addItem(JID("romeo@montague.net")); IQ::ref unblockPush = IQ::createRequest(IQ::Set, ownJID_, "push1", pushPayload); stanzaChannel_->sendIQ(unblockPush); @@ -130,7 +130,7 @@ class ClientBlockListManagerTest : public CppUnit::TestFixture { unblockRequest->send(); IQ::ref request = stanzaChannel_->getStanzaAtIndex(2); CPPUNIT_ASSERT(request.get() != nullptr); - boost::shared_ptr unblockPayload = request->getPayload(); + std::shared_ptr unblockPayload = request->getPayload(); CPPUNIT_ASSERT(unblockPayload.get() != nullptr); CPPUNIT_ASSERT_EQUAL(true, unblockPayload->getItems().empty()); @@ -141,7 +141,7 @@ class ClientBlockListManagerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(static_cast(3), clientBlockListManager_->getBlockList()->getItems().size()); // send block push - boost::shared_ptr pushPayload = boost::make_shared(); + std::shared_ptr pushPayload = std::make_shared(); IQ::ref unblockPush = IQ::createRequest(IQ::Set, ownJID_, "push1", pushPayload); stanzaChannel_->sendIQ(unblockPush); stanzaChannel_->onIQReceived(unblockPush); @@ -157,20 +157,20 @@ class ClientBlockListManagerTest : public CppUnit::TestFixture { private: void helperInitialBlockListFetch(const std::vector& blockedJids) { - boost::shared_ptr blockList = clientBlockListManager_->requestBlockList(); + std::shared_ptr blockList = clientBlockListManager_->requestBlockList(); CPPUNIT_ASSERT(blockList); // check for IQ request IQ::ref request = stanzaChannel_->getStanzaAtIndex(0); CPPUNIT_ASSERT(request.get() != nullptr); - boost::shared_ptr requestPayload = request->getPayload(); + std::shared_ptr requestPayload = request->getPayload(); CPPUNIT_ASSERT(requestPayload.get() != nullptr); CPPUNIT_ASSERT_EQUAL(BlockList::Requesting, blockList->getState()); CPPUNIT_ASSERT_EQUAL(BlockList::Requesting, clientBlockListManager_->getBlockList()->getState()); // build IQ response - boost::shared_ptr responsePayload = boost::make_shared(); + std::shared_ptr responsePayload = std::make_shared(); foreach(const JID& jid, blockedJids) { responsePayload->addItem(jid); } diff --git a/Swiften/Client/UnitTest/ClientSessionTest.cpp b/Swiften/Client/UnitTest/ClientSessionTest.cpp index 335b537..bd93f4b 100644 --- a/Swiften/Client/UnitTest/ClientSessionTest.cpp +++ b/Swiften/Client/UnitTest/ClientSessionTest.cpp @@ -5,10 +5,10 @@ */ #include +#include #include #include -#include #include #include @@ -75,9 +75,9 @@ class ClientSessionTest : public CppUnit::TestFixture { public: void setUp() { - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); - idnConverter = boost::shared_ptr(PlatformIDNConverter::create()); - server = boost::make_shared(); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); + idnConverter = std::shared_ptr(PlatformIDNConverter::create()); + server = std::make_shared(); sessionFinishedReceived = false; needCredentials = false; blindCertificateTrustChecker = new BlindCertificateTrustChecker(); @@ -88,7 +88,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testStart_Error() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->breakConnection(); @@ -98,7 +98,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testStart_StreamError() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->sendStreamStart(); server->sendStreamError(); @@ -109,7 +109,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testStartTLS() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->setCertificateTrustChecker(blindCertificateTrustChecker); session->start(); server->receiveStreamStart(); @@ -127,7 +127,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testStartTLS_ServerError() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->receiveStreamStart(); server->sendStreamStart(); @@ -142,7 +142,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testStartTLS_ConnectError() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->receiveStreamStart(); server->sendStreamStart(); @@ -157,7 +157,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testStartTLS_InvalidIdentity() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->receiveStreamStart(); server->sendStreamStart(); @@ -171,11 +171,11 @@ class ClientSessionTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(ClientSession::Finished, session->getState()); CPPUNIT_ASSERT(sessionFinishedReceived); CPPUNIT_ASSERT(sessionFinishedError); - CPPUNIT_ASSERT_EQUAL(CertificateVerificationError::InvalidServerIdentity, boost::dynamic_pointer_cast(sessionFinishedError)->getType()); + CPPUNIT_ASSERT_EQUAL(CertificateVerificationError::InvalidServerIdentity, std::dynamic_pointer_cast(sessionFinishedError)->getType()); } void testStart_StreamFeaturesWithoutResourceBindingFails() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->receiveStreamStart(); server->sendStreamStart(); @@ -187,7 +187,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testAuthenticate() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->receiveStreamStart(); server->sendStreamStart(); @@ -203,7 +203,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testAuthenticate_Unauthorized() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->receiveStreamStart(); server->sendStreamStart(); @@ -220,7 +220,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testAuthenticate_PLAINOverNonTLS() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->setAllowPLAINOverNonTLS(false); session->start(); server->receiveStreamStart(); @@ -233,7 +233,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testAuthenticate_RequireTLS() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->setUseTLS(ClientSession::RequireTLS); session->setAllowPLAINOverNonTLS(true); session->start(); @@ -247,7 +247,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testAuthenticate_NoValidAuthMechanisms() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->receiveStreamStart(); server->sendStreamStart(); @@ -259,7 +259,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testAuthenticate_EXTERNAL() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->receiveStreamStart(); server->sendStreamStart(); @@ -272,7 +272,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testUnexpectedChallenge() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->receiveStreamStart(); server->sendStreamStart(); @@ -287,7 +287,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testStreamManagement() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->receiveStreamStart(); server->sendStreamStart(); @@ -311,7 +311,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testStreamManagement_Failed() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->receiveStreamStart(); server->sendStreamStart(); @@ -334,7 +334,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } void testFinishAcksStanzas() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); initializeSession(session); server->sendMessage(); server->sendMessage(); @@ -346,15 +346,15 @@ class ClientSessionTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createSession() { - boost::shared_ptr session = ClientSession::create(JID("me@foo.com"), server, idnConverter.get(), crypto.get()); + std::shared_ptr createSession() { + std::shared_ptr session = ClientSession::create(JID("me@foo.com"), server, idnConverter.get(), crypto.get()); session->onFinished.connect(boost::bind(&ClientSessionTest::handleSessionFinished, this, _1)); session->onNeedCredentials.connect(boost::bind(&ClientSessionTest::handleSessionNeedCredentials, this)); session->setAllowPLAINOverNonTLS(true); return session; } - void initializeSession(boost::shared_ptr session) { + void initializeSession(std::shared_ptr session) { session->start(); server->receiveStreamStart(); server->sendStreamStart(); @@ -371,7 +371,7 @@ class ClientSessionTest : public CppUnit::TestFixture { server->sendStreamManagementEnabled(); } - void handleSessionFinished(boost::shared_ptr error) { + void handleSessionFinished(std::shared_ptr error) { sessionFinishedReceived = true; sessionFinishedError = error; } @@ -383,11 +383,11 @@ class ClientSessionTest : public CppUnit::TestFixture { class MockSessionStream : public SessionStream { public: struct Event { - Event(boost::shared_ptr element) : element(element), footer(false) {} + Event(std::shared_ptr element) : element(element), footer(false) {} Event(const ProtocolHeader& header) : header(header), footer(false) {} Event() : footer(true) {} - boost::shared_ptr element; + std::shared_ptr element; boost::optional header; bool footer; }; @@ -396,7 +396,7 @@ class ClientSessionTest : public CppUnit::TestFixture { } virtual void close() { - onClosed(boost::shared_ptr()); + onClosed(std::shared_ptr()); } virtual bool isOpen() { @@ -411,7 +411,7 @@ class ClientSessionTest : public CppUnit::TestFixture { receivedEvents.push_back(Event()); } - virtual void writeElement(boost::shared_ptr element) { + virtual void writeElement(std::shared_ptr element) { receivedEvents.push_back(Event(element)); } @@ -442,8 +442,8 @@ class ClientSessionTest : public CppUnit::TestFixture { return std::vector(); } - virtual boost::shared_ptr getPeerCertificateVerificationError() const { - return boost::shared_ptr(); + virtual std::shared_ptr getPeerCertificateVerificationError() const { + return std::shared_ptr(); } virtual bool supportsZLibCompression() { @@ -463,11 +463,11 @@ class ClientSessionTest : public CppUnit::TestFixture { } void breakConnection() { - onClosed(boost::make_shared(SessionStream::SessionStreamError::ConnectionReadError)); + onClosed(std::make_shared(SessionStream::SessionStreamError::ConnectionReadError)); } void breakTLS() { - onClosed(boost::make_shared(SessionStream::SessionStreamError::TLSError)); + onClosed(std::make_shared(SessionStream::SessionStreamError::TLSError)); } @@ -478,29 +478,29 @@ class ClientSessionTest : public CppUnit::TestFixture { } void sendStreamFeaturesWithStartTLS() { - boost::shared_ptr streamFeatures(new StreamFeatures()); + std::shared_ptr streamFeatures(new StreamFeatures()); streamFeatures->setHasStartTLS(); onElementReceived(streamFeatures); } void sendChallenge() { - onElementReceived(boost::make_shared()); + onElementReceived(std::make_shared()); } void sendStreamError() { - onElementReceived(boost::make_shared()); + onElementReceived(std::make_shared()); } void sendTLSProceed() { - onElementReceived(boost::make_shared()); + onElementReceived(std::make_shared()); } void sendTLSFailure() { - onElementReceived(boost::make_shared()); + onElementReceived(std::make_shared()); } void sendStreamFeaturesWithMultipleAuthentication() { - boost::shared_ptr streamFeatures(new StreamFeatures()); + std::shared_ptr streamFeatures(new StreamFeatures()); streamFeatures->addAuthenticationMechanism("PLAIN"); streamFeatures->addAuthenticationMechanism("DIGEST-MD5"); streamFeatures->addAuthenticationMechanism("SCRAM-SHA1"); @@ -508,59 +508,59 @@ class ClientSessionTest : public CppUnit::TestFixture { } void sendStreamFeaturesWithPLAINAuthentication() { - boost::shared_ptr streamFeatures(new StreamFeatures()); + std::shared_ptr streamFeatures(new StreamFeatures()); streamFeatures->addAuthenticationMechanism("PLAIN"); onElementReceived(streamFeatures); } void sendStreamFeaturesWithEXTERNALAuthentication() { - boost::shared_ptr streamFeatures(new StreamFeatures()); + std::shared_ptr streamFeatures(new StreamFeatures()); streamFeatures->addAuthenticationMechanism("EXTERNAL"); onElementReceived(streamFeatures); } void sendStreamFeaturesWithUnknownAuthentication() { - boost::shared_ptr streamFeatures(new StreamFeatures()); + std::shared_ptr streamFeatures(new StreamFeatures()); streamFeatures->addAuthenticationMechanism("UNKNOWN"); onElementReceived(streamFeatures); } void sendStreamFeaturesWithBindAndStreamManagement() { - boost::shared_ptr streamFeatures(new StreamFeatures()); + std::shared_ptr streamFeatures(new StreamFeatures()); streamFeatures->setHasResourceBind(); streamFeatures->setHasStreamManagement(); onElementReceived(streamFeatures); } void sendEmptyStreamFeatures() { - onElementReceived(boost::make_shared()); + onElementReceived(std::make_shared()); } void sendAuthSuccess() { - onElementReceived(boost::make_shared()); + onElementReceived(std::make_shared()); } void sendAuthFailure() { - onElementReceived(boost::make_shared()); + onElementReceived(std::make_shared()); } void sendStreamManagementEnabled() { - onElementReceived(boost::make_shared()); + onElementReceived(std::make_shared()); } void sendStreamManagementFailed() { - onElementReceived(boost::make_shared()); + onElementReceived(std::make_shared()); } void sendBindResult() { - boost::shared_ptr resourceBind(new ResourceBind()); + std::shared_ptr resourceBind(new ResourceBind()); resourceBind->setJID(JID("foo@bar.com/bla")); - boost::shared_ptr iq = IQ::createResult(JID("foo@bar.com"), bindID, resourceBind); + std::shared_ptr iq = IQ::createResult(JID("foo@bar.com"), bindID, resourceBind); onElementReceived(iq); } void sendMessage() { - boost::shared_ptr message = boost::make_shared(); + std::shared_ptr message = std::make_shared(); message->setTo(JID("foo@bar.com/bla")); onElementReceived(message); } @@ -573,13 +573,13 @@ class ClientSessionTest : public CppUnit::TestFixture { void receiveStartTLS() { Event event = popEvent(); CPPUNIT_ASSERT(event.element); - CPPUNIT_ASSERT(boost::dynamic_pointer_cast(event.element)); + CPPUNIT_ASSERT(std::dynamic_pointer_cast(event.element)); } void receiveAuthRequest(const std::string& mech) { Event event = popEvent(); CPPUNIT_ASSERT(event.element); - boost::shared_ptr request(boost::dynamic_pointer_cast(event.element)); + std::shared_ptr request(std::dynamic_pointer_cast(event.element)); CPPUNIT_ASSERT(request); CPPUNIT_ASSERT_EQUAL(mech, request->getMechanism()); } @@ -587,13 +587,13 @@ class ClientSessionTest : public CppUnit::TestFixture { void receiveStreamManagementEnable() { Event event = popEvent(); CPPUNIT_ASSERT(event.element); - CPPUNIT_ASSERT(boost::dynamic_pointer_cast(event.element)); + CPPUNIT_ASSERT(std::dynamic_pointer_cast(event.element)); } void receiveBind() { Event event = popEvent(); CPPUNIT_ASSERT(event.element); - boost::shared_ptr iq = boost::dynamic_pointer_cast(event.element); + std::shared_ptr iq = std::dynamic_pointer_cast(event.element); CPPUNIT_ASSERT(iq); CPPUNIT_ASSERT(iq->getPayload()); bindID = iq->getID(); @@ -602,7 +602,7 @@ class ClientSessionTest : public CppUnit::TestFixture { void receiveAck(unsigned int n) { Event event = popEvent(); CPPUNIT_ASSERT(event.element); - boost::shared_ptr ack = boost::dynamic_pointer_cast(event.element); + std::shared_ptr ack = std::dynamic_pointer_cast(event.element); CPPUNIT_ASSERT(ack); CPPUNIT_ASSERT_EQUAL(n, ack->getHandledStanzasCount()); } @@ -624,20 +624,20 @@ class ClientSessionTest : public CppUnit::TestFixture { std::deque receivedEvents; }; - boost::shared_ptr idnConverter; - boost::shared_ptr server; + std::shared_ptr idnConverter; + std::shared_ptr server; bool sessionFinishedReceived; bool needCredentials; - boost::shared_ptr sessionFinishedError; + std::shared_ptr sessionFinishedError; BlindCertificateTrustChecker* blindCertificateTrustChecker; - boost::shared_ptr crypto; + std::shared_ptr crypto; }; CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); #if 0 void testAuthenticate() { - boost::shared_ptr session(createSession("me@foo.com/Bar")); + std::shared_ptr session(createSession("me@foo.com/Bar")); session->onNeedCredentials.connect(boost::bind(&ClientSessionTest::setNeedCredentials, this)); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); @@ -658,7 +658,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); } void testAuthenticate_Unauthorized() { - boost::shared_ptr session(createSession("me@foo.com/Bar")); + std::shared_ptr session(createSession("me@foo.com/Bar")); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); getMockServer()->sendStreamFeaturesWithAuthentication(); @@ -675,7 +675,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); } void testAuthenticate_NoValidAuthMechanisms() { - boost::shared_ptr session(createSession("me@foo.com/Bar")); + std::shared_ptr session(createSession("me@foo.com/Bar")); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); getMockServer()->sendStreamFeaturesWithUnsupportedAuthentication(); @@ -687,7 +687,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); } void testResourceBind() { - boost::shared_ptr session(createSession("me@foo.com/Bar")); + std::shared_ptr session(createSession("me@foo.com/Bar")); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); getMockServer()->sendStreamFeaturesWithResourceBind(); @@ -703,7 +703,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); } void testResourceBind_ChangeResource() { - boost::shared_ptr session(createSession("me@foo.com/Bar")); + std::shared_ptr session(createSession("me@foo.com/Bar")); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); getMockServer()->sendStreamFeaturesWithResourceBind(); @@ -717,7 +717,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); } void testResourceBind_EmptyResource() { - boost::shared_ptr session(createSession("me@foo.com")); + std::shared_ptr session(createSession("me@foo.com")); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); getMockServer()->sendStreamFeaturesWithResourceBind(); @@ -731,7 +731,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); } void testResourceBind_Error() { - boost::shared_ptr session(createSession("me@foo.com")); + std::shared_ptr session(createSession("me@foo.com")); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); getMockServer()->sendStreamFeaturesWithResourceBind(); @@ -745,7 +745,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); } void testSessionStart() { - boost::shared_ptr session(createSession("me@foo.com/Bar")); + std::shared_ptr session(createSession("me@foo.com/Bar")); session->onSessionStarted.connect(boost::bind(&ClientSessionTest::setSessionStarted, this)); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); @@ -761,7 +761,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); } void testSessionStart_Error() { - boost::shared_ptr session(createSession("me@foo.com/Bar")); + std::shared_ptr session(createSession("me@foo.com/Bar")); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); getMockServer()->sendStreamFeaturesWithSession(); @@ -775,7 +775,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); } void testSessionStart_AfterResourceBind() { - boost::shared_ptr session(createSession("me@foo.com/Bar")); + std::shared_ptr session(createSession("me@foo.com/Bar")); session->onSessionStarted.connect(boost::bind(&ClientSessionTest::setSessionStarted, this)); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); @@ -792,7 +792,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); } void testWhitespacePing() { - boost::shared_ptr session(createSession("me@foo.com/Bar")); + std::shared_ptr session(createSession("me@foo.com/Bar")); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); getMockServer()->sendStreamFeatures(); @@ -802,7 +802,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); } void testReceiveElementAfterSessionStarted() { - boost::shared_ptr session(createSession("me@foo.com/Bar")); + std::shared_ptr session(createSession("me@foo.com/Bar")); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); getMockServer()->sendStreamFeatures(); @@ -810,11 +810,11 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); processEvents(); getMockServer()->expectMessage(); - session->sendElement(boost::make_shared())); + session->sendElement(std::make_shared())); } void testSendElement() { - boost::shared_ptr session(createSession("me@foo.com/Bar")); + std::shared_ptr session(createSession("me@foo.com/Bar")); session->onElementReceived.connect(boost::bind(&ClientSessionTest::addReceivedElement, this, _1)); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); @@ -824,6 +824,6 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); processEvents(); CPPUNIT_ASSERT_EQUAL(1, static_cast(receivedElements_.size())); - CPPUNIT_ASSERT(boost::dynamic_pointer_cast(receivedElements_[0])); + CPPUNIT_ASSERT(std::dynamic_pointer_cast(receivedElements_[0])); } #endif diff --git a/Swiften/Client/UnitTest/NickResolverTest.cpp b/Swiften/Client/UnitTest/NickResolverTest.cpp index 855b15a..2846173 100644 --- a/Swiften/Client/UnitTest/NickResolverTest.cpp +++ b/Swiften/Client/UnitTest/NickResolverTest.cpp @@ -36,7 +36,7 @@ class NickResolverTest : public CppUnit::TestFixture { public: void setUp() { - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); ownJID_ = JID("kev@wonderland.lit"); xmppRoster_ = new XMPPRosterImpl(); stanzaChannel_ = new DummyStanzaChannel(); @@ -147,7 +147,7 @@ class NickResolverTest : public CppUnit::TestFixture { MUCRegistry* registry_; NickResolver* resolver_; JID ownJID_; - boost::shared_ptr crypto; + std::shared_ptr crypto; }; CPPUNIT_TEST_SUITE_REGISTRATION(NickResolverTest); diff --git a/Swiften/Component/ComponentConnector.cpp b/Swiften/Component/ComponentConnector.cpp index 410c19e..632eb84 100644 --- a/Swiften/Component/ComponentConnector.cpp +++ b/Swiften/Component/ComponentConnector.cpp @@ -39,14 +39,14 @@ void ComponentConnector::start() { } void ComponentConnector::stop() { - finish(boost::shared_ptr()); + finish(std::shared_ptr()); } void ComponentConnector::handleAddressQueryResult(const std::vector& addresses, boost::optional error) { addressQuery.reset(); if (error || addresses.empty()) { - finish(boost::shared_ptr()); + finish(std::shared_ptr()); } else { addressQueryResults = std::deque(addresses.begin(), addresses.end()); @@ -76,7 +76,7 @@ void ComponentConnector::handleConnectionConnectFinished(bool error) { tryNextAddress(); } else { - finish(boost::shared_ptr()); + finish(std::shared_ptr()); } } else { @@ -84,7 +84,7 @@ void ComponentConnector::handleConnectionConnectFinished(bool error) { } } -void ComponentConnector::finish(boost::shared_ptr connection) { +void ComponentConnector::finish(std::shared_ptr connection) { if (timer) { timer->stop(); timer->onTick.disconnect(boost::bind(&ComponentConnector::handleTimeout, shared_from_this())); @@ -102,7 +102,7 @@ void ComponentConnector::finish(boost::shared_ptr connection) { } void ComponentConnector::handleTimeout() { - finish(boost::shared_ptr()); + finish(std::shared_ptr()); } } diff --git a/Swiften/Component/ComponentConnector.h b/Swiften/Component/ComponentConnector.h index 68cb0d7..831851a 100644 --- a/Swiften/Component/ComponentConnector.h +++ b/Swiften/Component/ComponentConnector.h @@ -7,10 +7,9 @@ #pragma once #include +#include #include -#include - #include #include #include @@ -24,9 +23,9 @@ namespace Swift { class ConnectionFactory; class TimerFactory; - class SWIFTEN_API ComponentConnector : public boost::bsignals::trackable, public boost::enable_shared_from_this { + class SWIFTEN_API ComponentConnector : public boost::bsignals::trackable, public std::enable_shared_from_this { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static ComponentConnector::ref create(const std::string& hostname, int port, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) { return ref(new ComponentConnector(hostname, port, resolver, connectionFactory, timerFactory)); @@ -37,7 +36,7 @@ namespace Swift { void start(); void stop(); - boost::signal)> onConnectFinished; + boost::signal)> onConnectFinished; private: ComponentConnector(const std::string& hostname, int port, DomainNameResolver*, ConnectionFactory*, TimerFactory*); @@ -47,7 +46,7 @@ namespace Swift { void tryConnect(const HostAddressPort& target); void handleConnectionConnectFinished(bool error); - void finish(boost::shared_ptr); + void finish(std::shared_ptr); void handleTimeout(); @@ -58,9 +57,9 @@ namespace Swift { ConnectionFactory* connectionFactory; TimerFactory* timerFactory; int timeoutMilliseconds; - boost::shared_ptr timer; - boost::shared_ptr addressQuery; + std::shared_ptr timer; + std::shared_ptr addressQuery; std::deque addressQueryResults; - boost::shared_ptr currentConnection; + std::shared_ptr currentConnection; }; } diff --git a/Swiften/Component/ComponentSession.cpp b/Swiften/Component/ComponentSession.cpp index 46c88db..0805ac1 100644 --- a/Swiften/Component/ComponentSession.cpp +++ b/Swiften/Component/ComponentSession.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -17,7 +18,7 @@ namespace Swift { -ComponentSession::ComponentSession(const JID& jid, const std::string& secret, boost::shared_ptr stream, CryptoProvider* crypto) : jid(jid), secret(secret), stream(stream), crypto(crypto), state(Initial) { +ComponentSession::ComponentSession(const JID& jid, const std::string& secret, std::shared_ptr stream, CryptoProvider* crypto) : jid(jid), secret(secret), stream(stream), crypto(crypto), state(Initial) { } ComponentSession::~ComponentSession() { @@ -39,7 +40,7 @@ void ComponentSession::sendStreamHeader() { stream->writeHeader(header); } -void ComponentSession::sendStanza(boost::shared_ptr stanza) { +void ComponentSession::sendStanza(std::shared_ptr stanza) { stream->writeElement(stanza); } @@ -49,8 +50,8 @@ void ComponentSession::handleStreamStart(const ProtocolHeader& header) { stream->writeElement(ComponentHandshake::ref(new ComponentHandshake(ComponentHandshakeGenerator::getHandshake(header.getID(), secret, crypto)))); } -void ComponentSession::handleElement(boost::shared_ptr element) { - if (boost::shared_ptr stanza = boost::dynamic_pointer_cast(element)) { +void ComponentSession::handleElement(std::shared_ptr element) { + if (std::shared_ptr stanza = std::dynamic_pointer_cast(element)) { if (getState() == Initialized) { onStanzaReceived(stanza); } @@ -58,7 +59,7 @@ void ComponentSession::handleElement(boost::shared_ptr element) finishSession(Error::UnexpectedElementError); } } - else if (boost::dynamic_pointer_cast(element)) { + else if (std::dynamic_pointer_cast(element)) { if (!checkState(Authenticating)) { return; } @@ -67,7 +68,7 @@ void ComponentSession::handleElement(boost::shared_ptr element) onInitialized(); } else if (getState() == Authenticating) { - if (boost::dynamic_pointer_cast(element)) { + if (std::dynamic_pointer_cast(element)) { // M-Link sends stream features, so swallow that. } else { @@ -88,7 +89,7 @@ bool ComponentSession::checkState(State state) { return true; } -void ComponentSession::handleStreamClosed(boost::shared_ptr streamError) { +void ComponentSession::handleStreamClosed(std::shared_ptr streamError) { State oldState = state; state = Finished; stream->setWhitespacePingEnabled(false); @@ -104,14 +105,14 @@ void ComponentSession::handleStreamClosed(boost::shared_ptr stream } void ComponentSession::finish() { - finishSession(boost::shared_ptr()); + finishSession(std::shared_ptr()); } void ComponentSession::finishSession(Error::Type error) { - finishSession(boost::make_shared(error)); + finishSession(std::make_shared(error)); } -void ComponentSession::finishSession(boost::shared_ptr finishError) { +void ComponentSession::finishSession(std::shared_ptr finishError) { state = Finishing; error = finishError; assert(stream->isOpen()); diff --git a/Swiften/Component/ComponentSession.h b/Swiften/Component/ComponentSession.h index 608bb79..97f5378 100644 --- a/Swiften/Component/ComponentSession.h +++ b/Swiften/Component/ComponentSession.h @@ -6,11 +6,9 @@ #pragma once +#include #include -#include -#include - #include #include #include @@ -23,7 +21,7 @@ namespace Swift { class ComponentAuthenticator; class CryptoProvider; - class SWIFTEN_API ComponentSession : public boost::enable_shared_from_this { + class SWIFTEN_API ComponentSession : public std::enable_shared_from_this { public: enum State { Initial, @@ -44,8 +42,8 @@ namespace Swift { ~ComponentSession(); - static boost::shared_ptr create(const JID& jid, const std::string& secret, boost::shared_ptr stream, CryptoProvider* crypto) { - return boost::shared_ptr(new ComponentSession(jid, secret, stream, crypto)); + static std::shared_ptr create(const JID& jid, const std::string& secret, std::shared_ptr stream, CryptoProvider* crypto) { + return std::shared_ptr(new ComponentSession(jid, secret, stream, crypto)); } State getState() const { @@ -55,33 +53,33 @@ namespace Swift { void start(); void finish(); - void sendStanza(boost::shared_ptr); + void sendStanza(std::shared_ptr); public: boost::signal onInitialized; - boost::signal)> onFinished; - boost::signal)> onStanzaReceived; + boost::signal)> onFinished; + boost::signal)> onStanzaReceived; private: - ComponentSession(const JID& jid, const std::string& secret, boost::shared_ptr, CryptoProvider*); + ComponentSession(const JID& jid, const std::string& secret, std::shared_ptr, CryptoProvider*); void finishSession(Error::Type error); - void finishSession(boost::shared_ptr error); + void finishSession(std::shared_ptr error); void sendStreamHeader(); - void handleElement(boost::shared_ptr); + void handleElement(std::shared_ptr); void handleStreamStart(const ProtocolHeader&); - void handleStreamClosed(boost::shared_ptr); + void handleStreamClosed(std::shared_ptr); bool checkState(State); private: JID jid; std::string secret; - boost::shared_ptr stream; + std::shared_ptr stream; CryptoProvider* crypto; - boost::shared_ptr error; + std::shared_ptr error; State state; }; } diff --git a/Swiften/Component/ComponentSessionStanzaChannel.cpp b/Swiften/Component/ComponentSessionStanzaChannel.cpp index ffb1f13..282d9f1 100644 --- a/Swiften/Component/ComponentSessionStanzaChannel.cpp +++ b/Swiften/Component/ComponentSessionStanzaChannel.cpp @@ -12,7 +12,7 @@ namespace Swift { -void ComponentSessionStanzaChannel::setSession(boost::shared_ptr session) { +void ComponentSessionStanzaChannel::setSession(std::shared_ptr session) { assert(!this->session); this->session = session; session->onInitialized.connect(boost::bind(&ComponentSessionStanzaChannel::handleSessionInitialized, this)); @@ -20,15 +20,15 @@ void ComponentSessionStanzaChannel::setSession(boost::shared_ptronStanzaReceived.connect(boost::bind(&ComponentSessionStanzaChannel::handleStanza, this, _1)); } -void ComponentSessionStanzaChannel::sendIQ(boost::shared_ptr iq) { +void ComponentSessionStanzaChannel::sendIQ(std::shared_ptr iq) { send(iq); } -void ComponentSessionStanzaChannel::sendMessage(boost::shared_ptr message) { +void ComponentSessionStanzaChannel::sendMessage(std::shared_ptr message) { send(message); } -void ComponentSessionStanzaChannel::sendPresence(boost::shared_ptr presence) { +void ComponentSessionStanzaChannel::sendPresence(std::shared_ptr presence) { send(presence); } @@ -36,7 +36,7 @@ std::string ComponentSessionStanzaChannel::getNewIQID() { return idGenerator.generateID(); } -void ComponentSessionStanzaChannel::send(boost::shared_ptr stanza) { +void ComponentSessionStanzaChannel::send(std::shared_ptr stanza) { if (!isAvailable()) { std::cerr << "Warning: Component: Trying to send a stanza while disconnected." << std::endl; return; @@ -44,7 +44,7 @@ void ComponentSessionStanzaChannel::send(boost::shared_ptr stanza) { session->sendStanza(stanza); } -void ComponentSessionStanzaChannel::handleSessionFinished(boost::shared_ptr) { +void ComponentSessionStanzaChannel::handleSessionFinished(std::shared_ptr) { session->onFinished.disconnect(boost::bind(&ComponentSessionStanzaChannel::handleSessionFinished, this, _1)); session->onStanzaReceived.disconnect(boost::bind(&ComponentSessionStanzaChannel::handleStanza, this, _1)); session->onInitialized.disconnect(boost::bind(&ComponentSessionStanzaChannel::handleSessionInitialized, this)); @@ -53,20 +53,20 @@ void ComponentSessionStanzaChannel::handleSessionFinished(boost::shared_ptr stanza) { - boost::shared_ptr message = boost::dynamic_pointer_cast(stanza); +void ComponentSessionStanzaChannel::handleStanza(std::shared_ptr stanza) { + std::shared_ptr message = std::dynamic_pointer_cast(stanza); if (message) { onMessageReceived(message); return; } - boost::shared_ptr presence = boost::dynamic_pointer_cast(stanza); + std::shared_ptr presence = std::dynamic_pointer_cast(stanza); if (presence) { onPresenceReceived(presence); return; } - boost::shared_ptr iq = boost::dynamic_pointer_cast(stanza); + std::shared_ptr iq = std::dynamic_pointer_cast(stanza); if (iq) { onIQReceived(iq); return; diff --git a/Swiften/Component/ComponentSessionStanzaChannel.h b/Swiften/Component/ComponentSessionStanzaChannel.h index 31931ea..ad38edc 100644 --- a/Swiften/Component/ComponentSessionStanzaChannel.h +++ b/Swiften/Component/ComponentSessionStanzaChannel.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -22,11 +22,11 @@ namespace Swift { */ class SWIFTEN_API ComponentSessionStanzaChannel : public StanzaChannel { public: - void setSession(boost::shared_ptr session); + void setSession(std::shared_ptr session); - void sendIQ(boost::shared_ptr iq); - void sendMessage(boost::shared_ptr message); - void sendPresence(boost::shared_ptr presence); + void sendIQ(std::shared_ptr iq); + void sendMessage(std::shared_ptr message); + void sendPresence(std::shared_ptr presence); bool getStreamManagementEnabled() const { return false; @@ -43,14 +43,14 @@ namespace Swift { private: std::string getNewIQID(); - void send(boost::shared_ptr stanza); - void handleSessionFinished(boost::shared_ptr error); - void handleStanza(boost::shared_ptr stanza); + void send(std::shared_ptr stanza); + void handleSessionFinished(std::shared_ptr error); + void handleStanza(std::shared_ptr stanza); void handleSessionInitialized(); private: IDGenerator idGenerator; - boost::shared_ptr session; + std::shared_ptr session; }; } diff --git a/Swiften/Component/CoreComponent.cpp b/Swiften/Component/CoreComponent.cpp index ac4f14e..dfa0896 100644 --- a/Swiften/Component/CoreComponent.cpp +++ b/Swiften/Component/CoreComponent.cpp @@ -52,7 +52,7 @@ void CoreComponent::connect(const std::string& host, int port) { connector_->start(); } -void CoreComponent::handleConnectorFinished(boost::shared_ptr connection) { +void CoreComponent::handleConnectorFinished(std::shared_ptr connection) { connector_->onConnectFinished.disconnect(boost::bind(&CoreComponent::handleConnectorFinished, this, _1)); connector_.reset(); if (!connection) { @@ -65,7 +65,7 @@ void CoreComponent::handleConnectorFinished(boost::shared_ptr connec connection_ = connection; assert(!sessionStream_); - sessionStream_ = boost::shared_ptr(new BasicSessionStream(ComponentStreamType, connection_, getPayloadParserFactories(), getPayloadSerializers(), nullptr, networkFactories->getTimerFactory(), networkFactories->getXMLParserFactory(), TLSOptions())); + sessionStream_ = std::make_shared(ComponentStreamType, connection_, getPayloadParserFactories(), getPayloadSerializers(), nullptr, networkFactories->getTimerFactory(), networkFactories->getXMLParserFactory(), TLSOptions()); sessionStream_->onDataRead.connect(boost::bind(&CoreComponent::handleDataRead, this, _1)); sessionStream_->onDataWritten.connect(boost::bind(&CoreComponent::handleDataWritten, this, _1)); @@ -93,7 +93,7 @@ void CoreComponent::disconnect() { disconnectRequested_ = false; } -void CoreComponent::handleSessionFinished(boost::shared_ptr error) { +void CoreComponent::handleSessionFinished(std::shared_ptr error) { session_->onFinished.disconnect(boost::bind(&CoreComponent::handleSessionFinished, this, _1)); session_.reset(); @@ -106,7 +106,7 @@ void CoreComponent::handleSessionFinished(boost::shared_ptr error) { if (error) { ComponentError componentError; - if (boost::shared_ptr actualError = boost::dynamic_pointer_cast(error)) { + if (std::shared_ptr actualError = std::dynamic_pointer_cast(error)) { switch(actualError->type) { case ComponentSession::Error::AuthenticationFailedError: componentError = ComponentError(ComponentError::AuthenticationFailedError); @@ -116,7 +116,7 @@ void CoreComponent::handleSessionFinished(boost::shared_ptr error) { break; } } - else if (boost::shared_ptr actualError = boost::dynamic_pointer_cast(error)) { + else if (std::shared_ptr actualError = std::dynamic_pointer_cast(error)) { switch(actualError->type) { case SessionStream::SessionStreamError::ParseError: componentError = ComponentError(ComponentError::XMLError); @@ -155,11 +155,11 @@ void CoreComponent::handleStanzaChannelAvailableChanged(bool available) { } } -void CoreComponent::sendMessage(boost::shared_ptr message) { +void CoreComponent::sendMessage(std::shared_ptr message) { stanzaChannel_->sendMessage(message); } -void CoreComponent::sendPresence(boost::shared_ptr presence) { +void CoreComponent::sendPresence(std::shared_ptr presence) { stanzaChannel_->sendPresence(presence); } diff --git a/Swiften/Component/CoreComponent.h b/Swiften/Component/CoreComponent.h index ff88173..3368671 100644 --- a/Swiften/Component/CoreComponent.h +++ b/Swiften/Component/CoreComponent.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -50,8 +49,8 @@ namespace Swift { void connect(const std::string& host, int port); void disconnect(); - void sendMessage(boost::shared_ptr); - void sendPresence(boost::shared_ptr); + void sendMessage(std::shared_ptr); + void sendPresence(std::shared_ptr); void sendData(const std::string& data); IQRouter* getIQRouter() const { @@ -79,13 +78,13 @@ namespace Swift { boost::signal onDataRead; boost::signal onDataWritten; - boost::signal)> onMessageReceived; - boost::signal) > onPresenceReceived; + boost::signal)> onMessageReceived; + boost::signal) > onPresenceReceived; private: - void handleConnectorFinished(boost::shared_ptr); + void handleConnectorFinished(std::shared_ptr); void handleStanzaChannelAvailableChanged(bool available); - void handleSessionFinished(boost::shared_ptr); + void handleSessionFinished(std::shared_ptr); void handleDataRead(const SafeByteArray&); void handleDataWritten(const SafeByteArray&); @@ -96,9 +95,9 @@ namespace Swift { ComponentSessionStanzaChannel* stanzaChannel_; IQRouter* iqRouter_; ComponentConnector::ref connector_; - boost::shared_ptr connection_; - boost::shared_ptr sessionStream_; - boost::shared_ptr session_; + std::shared_ptr connection_; + std::shared_ptr sessionStream_; + std::shared_ptr session_; bool disconnectRequested_; }; } diff --git a/Swiften/Component/UnitTest/ComponentConnectorTest.cpp b/Swiften/Component/UnitTest/ComponentConnectorTest.cpp index 04a6a9e..3515a0a 100644 --- a/Swiften/Component/UnitTest/ComponentConnectorTest.cpp +++ b/Swiften/Component/UnitTest/ComponentConnectorTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -152,8 +152,8 @@ class ComponentConnectorTest : public CppUnit::TestFixture { return connector; } - void handleConnectorFinished(boost::shared_ptr connection) { - boost::shared_ptr c(boost::dynamic_pointer_cast(connection)); + void handleConnectorFinished(std::shared_ptr connection) { + std::shared_ptr c(std::dynamic_pointer_cast(connection)); if (connection) { assert(c); } @@ -188,8 +188,8 @@ class ComponentConnectorTest : public CppUnit::TestFixture { MockConnectionFactory(EventLoop* eventLoop) : eventLoop(eventLoop), isResponsive(true) { } - boost::shared_ptr createConnection() { - return boost::shared_ptr(new MockConnection(failingPorts, isResponsive, eventLoop)); + std::shared_ptr createConnection() { + return std::make_shared(failingPorts, isResponsive, eventLoop); } EventLoop* eventLoop; @@ -204,7 +204,7 @@ class ComponentConnectorTest : public CppUnit::TestFixture { StaticDomainNameResolver* resolver; MockConnectionFactory* connectionFactory; DummyTimerFactory* timerFactory; - std::vector< boost::shared_ptr > connections; + std::vector< std::shared_ptr > connections; }; CPPUNIT_TEST_SUITE_REGISTRATION(ComponentConnectorTest); diff --git a/Swiften/Component/UnitTest/ComponentHandshakeGeneratorTest.cpp b/Swiften/Component/UnitTest/ComponentHandshakeGeneratorTest.cpp index 82f43f6..ce8eaa4 100644 --- a/Swiften/Component/UnitTest/ComponentHandshakeGeneratorTest.cpp +++ b/Swiften/Component/UnitTest/ComponentHandshakeGeneratorTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ class ComponentHandshakeGeneratorTest : public CppUnit::TestFixture { public: void setUp() { - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); } void testGetHandshake() { @@ -35,7 +35,7 @@ class ComponentHandshakeGeneratorTest : public CppUnit::TestFixture { } private: - boost::shared_ptr crypto; + std::shared_ptr crypto; }; CPPUNIT_TEST_SUITE_REGISTRATION(ComponentHandshakeGeneratorTest); diff --git a/Swiften/Component/UnitTest/ComponentSessionTest.cpp b/Swiften/Component/UnitTest/ComponentSessionTest.cpp index 1726794..63c89dc 100644 --- a/Swiften/Component/UnitTest/ComponentSessionTest.cpp +++ b/Swiften/Component/UnitTest/ComponentSessionTest.cpp @@ -30,13 +30,13 @@ class ComponentSessionTest : public CppUnit::TestFixture { public: void setUp() { - server = boost::make_shared(); + server = std::make_shared(); sessionFinishedReceived = false; - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); } void testStart() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->receiveStreamStart(); server->sendStreamStart(); @@ -51,7 +51,7 @@ class ComponentSessionTest : public CppUnit::TestFixture { } void testStart_Error() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->breakConnection(); @@ -61,7 +61,7 @@ class ComponentSessionTest : public CppUnit::TestFixture { } void testStart_Unauthorized() { - boost::shared_ptr session(createSession()); + std::shared_ptr session(createSession()); session->start(); server->receiveStreamStart(); server->sendStreamStart(); @@ -74,13 +74,13 @@ class ComponentSessionTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createSession() { - boost::shared_ptr session = ComponentSession::create(JID("service.foo.com"), "servicesecret", server, crypto.get()); + std::shared_ptr createSession() { + std::shared_ptr session = ComponentSession::create(JID("service.foo.com"), "servicesecret", server, crypto.get()); session->onFinished.connect(boost::bind(&ComponentSessionTest::handleSessionFinished, this, _1)); return session; } - void handleSessionFinished(boost::shared_ptr error) { + void handleSessionFinished(std::shared_ptr error) { sessionFinishedReceived = true; sessionFinishedError = error; } @@ -88,11 +88,11 @@ class ComponentSessionTest : public CppUnit::TestFixture { class MockSessionStream : public SessionStream { public: struct Event { - Event(boost::shared_ptr element) : element(element), footer(false) {} + Event(std::shared_ptr element) : element(element), footer(false) {} Event(const ProtocolHeader& header) : header(header), footer(false) {} Event() : footer(true) {} - boost::shared_ptr element; + std::shared_ptr element; boost::optional header; bool footer; }; @@ -101,7 +101,7 @@ class ComponentSessionTest : public CppUnit::TestFixture { } virtual void close() { - onClosed(boost::shared_ptr()); + onClosed(std::shared_ptr()); } virtual bool isOpen() { @@ -116,7 +116,7 @@ class ComponentSessionTest : public CppUnit::TestFixture { receivedEvents.push_back(Event()); } - virtual void writeElement(boost::shared_ptr element) { + virtual void writeElement(std::shared_ptr element) { receivedEvents.push_back(Event(element)); } @@ -147,8 +147,8 @@ class ComponentSessionTest : public CppUnit::TestFixture { return std::vector(); } - virtual boost::shared_ptr getPeerCertificateVerificationError() const { - return boost::shared_ptr(); + virtual std::shared_ptr getPeerCertificateVerificationError() const { + return std::shared_ptr(); } virtual bool supportsZLibCompression() { @@ -168,7 +168,7 @@ class ComponentSessionTest : public CppUnit::TestFixture { } void breakConnection() { - onClosed(boost::make_shared(SessionStream::SessionStreamError::ConnectionReadError)); + onClosed(std::make_shared(SessionStream::SessionStreamError::ConnectionReadError)); } void sendStreamStart() { @@ -194,7 +194,7 @@ class ComponentSessionTest : public CppUnit::TestFixture { void receiveHandshake() { Event event = popEvent(); CPPUNIT_ASSERT(event.element); - ComponentHandshake::ref handshake(boost::dynamic_pointer_cast(event.element)); + ComponentHandshake::ref handshake(std::dynamic_pointer_cast(event.element)); CPPUNIT_ASSERT(handshake); CPPUNIT_ASSERT_EQUAL(std::string("4c4f8a41141722c8bbfbdd92d827f7b2fc0a542b"), handshake->getData()); } @@ -213,10 +213,10 @@ class ComponentSessionTest : public CppUnit::TestFixture { std::deque receivedEvents; }; - boost::shared_ptr server; + std::shared_ptr server; bool sessionFinishedReceived; - boost::shared_ptr sessionFinishedError; - boost::shared_ptr crypto; + std::shared_ptr sessionFinishedError; + std::shared_ptr crypto; }; CPPUNIT_TEST_SUITE_REGISTRATION(ComponentSessionTest); diff --git a/Swiften/Compress/ZLibCodecompressor.cpp b/Swiften/Compress/ZLibCodecompressor.cpp index fd6d3b0..a9929a8 100644 --- a/Swiften/Compress/ZLibCodecompressor.cpp +++ b/Swiften/Compress/ZLibCodecompressor.cpp @@ -22,7 +22,7 @@ namespace Swift { static const size_t CHUNK_SIZE = 1024; // If you change this, also change the unittest -ZLibCodecompressor::ZLibCodecompressor() : p(boost::make_shared()) { +ZLibCodecompressor::ZLibCodecompressor() : p(std::make_shared()) { memset(&p->stream, 0, sizeof(z_stream)); p->stream.zalloc = Z_NULL; p->stream.zfree = Z_NULL; diff --git a/Swiften/Compress/ZLibCodecompressor.h b/Swiften/Compress/ZLibCodecompressor.h index 253c34a..641b7a3 100644 --- a/Swiften/Compress/ZLibCodecompressor.h +++ b/Swiften/Compress/ZLibCodecompressor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -20,6 +20,6 @@ namespace Swift { protected: struct Private; - boost::shared_ptr p; + std::shared_ptr p; }; } diff --git a/Swiften/Crypto/CryptoProvider.cpp b/Swiften/Crypto/CryptoProvider.cpp index 04b0b16..9c7c637 100644 --- a/Swiften/Crypto/CryptoProvider.cpp +++ b/Swiften/Crypto/CryptoProvider.cpp @@ -1,12 +1,12 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include +#include using namespace Swift; diff --git a/Swiften/Crypto/CryptoProvider.h b/Swiften/Crypto/CryptoProvider.h index a86468c..3eaeeb3 100644 --- a/Swiften/Crypto/CryptoProvider.h +++ b/Swiften/Crypto/CryptoProvider.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -26,11 +26,11 @@ namespace Swift { // Convenience template ByteArray getSHA1Hash(const T& data) { - return boost::shared_ptr(createSHA1())->update(data).getHash(); + return std::shared_ptr(createSHA1())->update(data).getHash(); } template ByteArray getMD5Hash(const T& data) { - return boost::shared_ptr(createMD5())->update(data).getHash(); + return std::shared_ptr(createMD5())->update(data).getHash(); } }; } diff --git a/Swiften/Crypto/UnitTest/CryptoProviderTest.cpp b/Swiften/Crypto/UnitTest/CryptoProviderTest.cpp index d37e776..72eb81d 100644 --- a/Swiften/Crypto/UnitTest/CryptoProviderTest.cpp +++ b/Swiften/Crypto/UnitTest/CryptoProviderTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -58,14 +58,14 @@ class CryptoProviderTest : public CppUnit::TestFixture { //////////////////////////////////////////////////////////// void testGetSHA1Hash() { - boost::shared_ptr sha = boost::shared_ptr(provider->createSHA1()); + std::shared_ptr sha = std::shared_ptr(provider->createSHA1()); sha->update(createByteArray("client/pc//Exodus 0.9.1getHash()); } void testGetSHA1Hash_TwoUpdates() { - boost::shared_ptr sha = boost::shared_ptr(provider->createSHA1()); + std::shared_ptr sha = std::shared_ptr(provider->createSHA1()); sha->update(createByteArray("client/pc//Exodus 0.9.1update(createByteArray("http://jabber.org/protocol/disco#info sha = boost::shared_ptr(provider->createSHA1()); + std::shared_ptr sha = std::shared_ptr(provider->createSHA1()); sha->update(std::vector()); CPPUNIT_ASSERT_EQUAL(createByteArray("\xda\x39\xa3\xee\x5e\x6b\x4b\x0d\x32\x55\xbf\xef\x95\x60\x18\x90\xaf\xd8\x07\x09"), sha->getHash()); @@ -117,7 +117,7 @@ class CryptoProviderTest : public CppUnit::TestFixture { } void testMD5Incremental() { - boost::shared_ptr testling = boost::shared_ptr(provider->createMD5()); + std::shared_ptr testling = std::shared_ptr(provider->createMD5()); testling->update(createByteArray("ABCDEFGHIJKLMNOPQRSTUVWXYZ")); testling->update(createByteArray("abcdefghijklmnopqrstuvwxyz0123456789")); diff --git a/Swiften/Crypto/WindowsCryptoProvider.cpp b/Swiften/Crypto/WindowsCryptoProvider.cpp index e0410c6..61ac03e 100644 --- a/Swiften/Crypto/WindowsCryptoProvider.cpp +++ b/Swiften/Crypto/WindowsCryptoProvider.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include @@ -191,7 +191,7 @@ namespace { } WindowsCryptoProvider::WindowsCryptoProvider() { - p = boost::make_shared(); + p = std::make_shared(); if (!CryptAcquireContext(&p->context, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { assert(false); } diff --git a/Swiften/Crypto/WindowsCryptoProvider.h b/Swiften/Crypto/WindowsCryptoProvider.h index 4c998d2..ddf7ffa 100644 --- a/Swiften/Crypto/WindowsCryptoProvider.h +++ b/Swiften/Crypto/WindowsCryptoProvider.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include #include @@ -26,6 +27,6 @@ namespace Swift { private: struct Private; - boost::shared_ptr p; + std::shared_ptr p; }; } diff --git a/Swiften/Disco/CapsManager.cpp b/Swiften/Disco/CapsManager.cpp index 139ee6c..337bad6 100644 --- a/Swiften/Disco/CapsManager.cpp +++ b/Swiften/Disco/CapsManager.cpp @@ -23,8 +23,8 @@ CapsManager::CapsManager(CapsStorage* capsStorage, StanzaChannel* stanzaChannel, stanzaChannel->onAvailableChanged.connect(boost::bind(&CapsManager::handleStanzaChannelAvailableChanged, this, _1)); } -void CapsManager::handlePresenceReceived(boost::shared_ptr presence) { - boost::shared_ptr capsInfo = presence->getPayload(); +void CapsManager::handlePresenceReceived(std::shared_ptr presence) { + std::shared_ptr capsInfo = presence->getPayload(); if (!capsInfo || capsInfo->getHash() != "sha-1" || presence->getPayload()) { return; } diff --git a/Swiften/Disco/CapsManager.h b/Swiften/Disco/CapsManager.h index c96db13..e5d80aa 100644 --- a/Swiften/Disco/CapsManager.h +++ b/Swiften/Disco/CapsManager.h @@ -36,7 +36,7 @@ namespace Swift { } private: - void handlePresenceReceived(boost::shared_ptr); + void handlePresenceReceived(std::shared_ptr); void handleStanzaChannelAvailableChanged(bool); void handleDiscoInfoReceived(const JID&, const std::string& hash, DiscoInfo::ref, ErrorPayload::ref); void requestDiscoInfo(const JID& jid, const std::string& node, const std::string& hash); diff --git a/Swiften/Disco/CapsMemoryStorage.h b/Swiften/Disco/CapsMemoryStorage.h index 39559ec..15a1fd3 100644 --- a/Swiften/Disco/CapsMemoryStorage.h +++ b/Swiften/Disco/CapsMemoryStorage.h @@ -7,10 +7,9 @@ #pragma once #include +#include #include -#include - #include #include diff --git a/Swiften/Disco/CapsStorage.h b/Swiften/Disco/CapsStorage.h index 5459ecf..ebfd3f3 100644 --- a/Swiften/Disco/CapsStorage.h +++ b/Swiften/Disco/CapsStorage.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include diff --git a/Swiften/Disco/DiscoInfoResponder.cpp b/Swiften/Disco/DiscoInfoResponder.cpp index cf18f43..c94d299 100644 --- a/Swiften/Disco/DiscoInfoResponder.cpp +++ b/Swiften/Disco/DiscoInfoResponder.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include #include @@ -31,14 +31,14 @@ void DiscoInfoResponder::setDiscoInfo(const std::string& node, const DiscoInfo& nodeInfo_[node] = newInfo; } -bool DiscoInfoResponder::handleGetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr info) { +bool DiscoInfoResponder::handleGetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr info) { if (info->getNode().empty()) { - sendResponse(from, id, boost::make_shared(info_)); + sendResponse(from, id, std::make_shared(info_)); } else { std::map::const_iterator i = nodeInfo_.find(info->getNode()); if (i != nodeInfo_.end()) { - sendResponse(from, id, boost::make_shared((*i).second)); + sendResponse(from, id, std::make_shared((*i).second)); } else { sendError(from, id, ErrorPayload::ItemNotFound, ErrorPayload::Cancel); diff --git a/Swiften/Disco/DiscoInfoResponder.h b/Swiften/Disco/DiscoInfoResponder.h index 0781173..9995695 100644 --- a/Swiften/Disco/DiscoInfoResponder.h +++ b/Swiften/Disco/DiscoInfoResponder.h @@ -24,7 +24,7 @@ namespace Swift { void setDiscoInfo(const std::string& node, const DiscoInfo& info); private: - virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr payload); + virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr payload); private: DiscoInfo info_; diff --git a/Swiften/Disco/DiscoServiceWalker.cpp b/Swiften/Disco/DiscoServiceWalker.cpp index 19170ce..761e6ab 100644 --- a/Swiften/Disco/DiscoServiceWalker.cpp +++ b/Swiften/Disco/DiscoServiceWalker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -49,7 +49,7 @@ void DiscoServiceWalker::walkNode(const JID& jid) { discoInfoRequest->send(); } -void DiscoServiceWalker::handleDiscoInfoResponse(boost::shared_ptr info, ErrorPayload::ref error, GetDiscoInfoRequest::ref request) { +void DiscoServiceWalker::handleDiscoInfoResponse(std::shared_ptr info, ErrorPayload::ref error, GetDiscoInfoRequest::ref request) { /* If we got canceled, don't do anything */ if (!active_) { return; @@ -85,7 +85,7 @@ void DiscoServiceWalker::handleDiscoInfoResponse(boost::shared_ptr in } } -void DiscoServiceWalker::handleDiscoItemsResponse(boost::shared_ptr items, ErrorPayload::ref error, GetDiscoItemsRequest::ref request) { +void DiscoServiceWalker::handleDiscoItemsResponse(std::shared_ptr items, ErrorPayload::ref error, GetDiscoItemsRequest::ref request) { /* If we got canceled, don't do anything */ if (!active_) { return; diff --git a/Swiften/Disco/DiscoServiceWalker.h b/Swiften/Disco/DiscoServiceWalker.h index bd8102b..43bd910 100644 --- a/Swiften/Disco/DiscoServiceWalker.h +++ b/Swiften/Disco/DiscoServiceWalker.h @@ -6,12 +6,11 @@ #pragma once +#include #include #include #include -#include - #include #include #include @@ -48,7 +47,7 @@ namespace Swift { } /** Emitted for each service found. */ - boost::signal)> onServiceFound; + boost::signal)> onServiceFound; /** Emitted when walking is aborted. */ boost::signal onWalkAborted; @@ -59,8 +58,8 @@ namespace Swift { private: void walkNode(const JID& jid); void markNodeCompleted(const JID& jid); - void handleDiscoInfoResponse(boost::shared_ptr info, ErrorPayload::ref error, GetDiscoInfoRequest::ref request); - void handleDiscoItemsResponse(boost::shared_ptr items, ErrorPayload::ref error, GetDiscoItemsRequest::ref request); + void handleDiscoInfoResponse(std::shared_ptr info, ErrorPayload::ref error, GetDiscoInfoRequest::ref request); + void handleDiscoItemsResponse(std::shared_ptr items, ErrorPayload::ref error, GetDiscoItemsRequest::ref request); void handleDiscoError(const JID& jid, ErrorPayload::ref error); private: diff --git a/Swiften/Disco/EntityCapsManager.cpp b/Swiften/Disco/EntityCapsManager.cpp index d30af54..64d90be 100644 --- a/Swiften/Disco/EntityCapsManager.cpp +++ b/Swiften/Disco/EntityCapsManager.cpp @@ -19,10 +19,10 @@ EntityCapsManager::EntityCapsManager(CapsProvider* capsProvider, StanzaChannel* capsProvider->onCapsAvailable.connect(boost::bind(&EntityCapsManager::handleCapsAvailable, this, _1)); } -void EntityCapsManager::handlePresenceReceived(boost::shared_ptr presence) { +void EntityCapsManager::handlePresenceReceived(std::shared_ptr presence) { JID from = presence->getFrom(); if (presence->isAvailable()) { - boost::shared_ptr capsInfo = presence->getPayload(); + std::shared_ptr capsInfo = presence->getPayload(); if (!capsInfo || capsInfo->getHash() != "sha-1" || presence->getPayload()) { return; } diff --git a/Swiften/Disco/EntityCapsManager.h b/Swiften/Disco/EntityCapsManager.h index 2a5d2d7..00b685b 100644 --- a/Swiften/Disco/EntityCapsManager.h +++ b/Swiften/Disco/EntityCapsManager.h @@ -35,7 +35,7 @@ namespace Swift { DiscoInfo::ref getCaps(const JID&) const; private: - void handlePresenceReceived(boost::shared_ptr); + void handlePresenceReceived(std::shared_ptr); void handleStanzaChannelAvailableChanged(bool); void handleCapsAvailable(const std::string&); diff --git a/Swiften/Disco/FeatureOracle.cpp b/Swiften/Disco/FeatureOracle.cpp index 1267cb0..8328984 100644 --- a/Swiften/Disco/FeatureOracle.cpp +++ b/Swiften/Disco/FeatureOracle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -70,7 +70,7 @@ DiscoInfo::ref FeatureOracle::getDiscoResultForJID(const JID& jid) { } } } - discoInfo = boost::make_shared(); + discoInfo = std::make_shared(); foreach(const std::string& commonFeature, commonFeatures) { discoInfo->addFeature(commonFeature); diff --git a/Swiften/Disco/GetDiscoInfoRequest.h b/Swiften/Disco/GetDiscoInfoRequest.h index ccbd3e2..1d86c14 100644 --- a/Swiften/Disco/GetDiscoInfoRequest.h +++ b/Swiften/Disco/GetDiscoInfoRequest.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -15,7 +15,7 @@ namespace Swift { class SWIFTEN_API GetDiscoInfoRequest : public GenericRequest { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static ref create(const JID& jid, IQRouter* router) { return ref(new GetDiscoInfoRequest(jid, router)); @@ -27,11 +27,11 @@ namespace Swift { private: GetDiscoInfoRequest(const JID& jid, IQRouter* router) : - GenericRequest(IQ::Get, jid, boost::make_shared(), router) { + GenericRequest(IQ::Get, jid, std::make_shared(), router) { } GetDiscoInfoRequest(const JID& jid, const std::string& node, IQRouter* router) : - GenericRequest(IQ::Get, jid, boost::make_shared(), router) { + GenericRequest(IQ::Get, jid, std::make_shared(), router) { getPayloadGeneric()->setNode(node); } }; diff --git a/Swiften/Disco/GetDiscoItemsRequest.h b/Swiften/Disco/GetDiscoItemsRequest.h index 7f1adc6..5b1ccf2 100644 --- a/Swiften/Disco/GetDiscoItemsRequest.h +++ b/Swiften/Disco/GetDiscoItemsRequest.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -15,7 +15,7 @@ namespace Swift { class SWIFTEN_API GetDiscoItemsRequest : public GenericRequest { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static ref create(const JID& jid, IQRouter* router) { return ref(new GetDiscoItemsRequest(jid, router)); @@ -27,11 +27,11 @@ namespace Swift { private: GetDiscoItemsRequest(const JID& jid, IQRouter* router) : - GenericRequest(IQ::Get, jid, boost::make_shared(), router) { + GenericRequest(IQ::Get, jid, std::make_shared(), router) { } GetDiscoItemsRequest(const JID& jid, const std::string& node, IQRouter* router) : - GenericRequest(IQ::Get, jid, boost::make_shared(), router) { + GenericRequest(IQ::Get, jid, std::make_shared(), router) { getPayloadGeneric()->setNode(node); } }; diff --git a/Swiften/Disco/JIDDiscoInfoResponder.cpp b/Swiften/Disco/JIDDiscoInfoResponder.cpp index 7bec992..8802bce 100644 --- a/Swiften/Disco/JIDDiscoInfoResponder.cpp +++ b/Swiften/Disco/JIDDiscoInfoResponder.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include #include @@ -32,16 +32,16 @@ void JIDDiscoInfoResponder::setDiscoInfo(const JID& jid, const std::string& node i->second.nodeDiscoInfo[node] = newInfo; } -bool JIDDiscoInfoResponder::handleGetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr discoInfo) { +bool JIDDiscoInfoResponder::handleGetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr discoInfo) { JIDDiscoInfoMap::const_iterator i = info.find(to); if (i != info.end()) { if (discoInfo->getNode().empty()) { - sendResponse(from, to, id, boost::make_shared(i->second.discoInfo)); + sendResponse(from, to, id, std::make_shared(i->second.discoInfo)); } else { std::map::const_iterator j = i->second.nodeDiscoInfo.find(discoInfo->getNode()); if (j != i->second.nodeDiscoInfo.end()) { - sendResponse(from, to, id, boost::make_shared(j->second)); + sendResponse(from, to, id, std::make_shared(j->second)); } else { sendError(from, to, id, ErrorPayload::ItemNotFound, ErrorPayload::Cancel); diff --git a/Swiften/Disco/JIDDiscoInfoResponder.h b/Swiften/Disco/JIDDiscoInfoResponder.h index e2fbb5b7..1eb6228 100644 --- a/Swiften/Disco/JIDDiscoInfoResponder.h +++ b/Swiften/Disco/JIDDiscoInfoResponder.h @@ -25,7 +25,7 @@ namespace Swift { void setDiscoInfo(const JID& jid, const std::string& node, const DiscoInfo& info); private: - virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr payload); + virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr payload); private: struct JIDDiscoInfo { diff --git a/Swiften/Disco/UnitTest/CapsInfoGeneratorTest.cpp b/Swiften/Disco/UnitTest/CapsInfoGeneratorTest.cpp index 58c9531..8d27ec5 100644 --- a/Swiften/Disco/UnitTest/CapsInfoGeneratorTest.cpp +++ b/Swiften/Disco/UnitTest/CapsInfoGeneratorTest.cpp @@ -22,7 +22,7 @@ class CapsInfoGeneratorTest : public CppUnit::TestFixture { public: void setUp() { - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); } void testGenerate_XEP0115SimpleExample() { @@ -51,24 +51,24 @@ class CapsInfoGeneratorTest : public CppUnit::TestFixture { discoInfo.addFeature("http://jabber.org/protocol/muc"); Form::ref extension(new Form(Form::ResultType)); - FormField::ref field = boost::make_shared(FormField::HiddenType, "urn:xmpp:dataforms:softwareinfo"); + FormField::ref field = std::make_shared(FormField::HiddenType, "urn:xmpp:dataforms:softwareinfo"); field->setName("FORM_TYPE"); extension->addField(field); - field = boost::make_shared(FormField::ListMultiType); + field = std::make_shared(FormField::ListMultiType); field->addValue("ipv6"); field->addValue("ipv4"); field->setName("ip_version"); extension->addField(field); - field = boost::make_shared(FormField::TextSingleType, "Psi"); + field = std::make_shared(FormField::TextSingleType, "Psi"); field->setName("software"); extension->addField(field); - field = boost::make_shared(FormField::TextSingleType, "0.11"); + field = std::make_shared(FormField::TextSingleType, "0.11"); field->setName("software_version"); extension->addField(field); - field = boost::make_shared(FormField::TextSingleType, "Mac"); + field = std::make_shared(FormField::TextSingleType, "Mac"); field->setName("os"); extension->addField(field); - field = boost::make_shared(FormField::TextSingleType, "10.5.1"); + field = std::make_shared(FormField::TextSingleType, "10.5.1"); field->setName("os_version"); extension->addField(field); discoInfo.addExtension(extension); @@ -80,7 +80,7 @@ class CapsInfoGeneratorTest : public CppUnit::TestFixture { } private: - boost::shared_ptr crypto; + std::shared_ptr crypto; }; CPPUNIT_TEST_SUITE_REGISTRATION(CapsInfoGeneratorTest); diff --git a/Swiften/Disco/UnitTest/CapsManagerTest.cpp b/Swiften/Disco/UnitTest/CapsManagerTest.cpp index fe7ee7e..ca727c2 100644 --- a/Swiften/Disco/UnitTest/CapsManagerTest.cpp +++ b/Swiften/Disco/UnitTest/CapsManagerTest.cpp @@ -45,21 +45,21 @@ class CapsManagerTest : public CppUnit::TestFixture { public: void setUp() { - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); stanzaChannel = new DummyStanzaChannel(); iqRouter = new IQRouter(stanzaChannel); storage = new CapsMemoryStorage(); user1 = JID("user1@bar.com/bla"); - discoInfo1 = boost::make_shared(); + discoInfo1 = std::make_shared(); discoInfo1->addFeature("http://swift.im/feature1"); - capsInfo1 = boost::make_shared(CapsInfoGenerator("http://node1.im", crypto.get()).generateCapsInfo(*discoInfo1.get())); - capsInfo1alt = boost::make_shared(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo1.get())); + capsInfo1 = std::make_shared(CapsInfoGenerator("http://node1.im", crypto.get()).generateCapsInfo(*discoInfo1.get())); + capsInfo1alt = std::make_shared(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo1.get())); user2 = JID("user2@foo.com/baz"); - discoInfo2 = boost::make_shared(); + discoInfo2 = std::make_shared(); discoInfo2->addFeature("http://swift.im/feature2"); - capsInfo2 = boost::make_shared(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo2.get())); + capsInfo2 = std::make_shared(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo2.get())); user3 = JID("user3@foo.com/baz"); - legacyCapsInfo = boost::make_shared("http://swift.im", "ver1", ""); + legacyCapsInfo = std::make_shared("http://swift.im", "ver1", ""); } void tearDown() { @@ -69,17 +69,17 @@ class CapsManagerTest : public CppUnit::TestFixture { } void testReceiveNewHashRequestsDisco() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); CPPUNIT_ASSERT(stanzaChannel->isRequestAtIndex(0, user1, IQ::Get)); - boost::shared_ptr discoInfo(stanzaChannel->sentStanzas[0]->getPayload()); + std::shared_ptr discoInfo(stanzaChannel->sentStanzas[0]->getPayload()); CPPUNIT_ASSERT(discoInfo); CPPUNIT_ASSERT_EQUAL("http://node1.im#" + capsInfo1->getVersion(), discoInfo->getNode()); } void testReceiveSameHashDoesNotRequestDisco() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); stanzaChannel->sentStanzas.clear(); sendPresenceWithCaps(user1, capsInfo1); @@ -88,14 +88,14 @@ class CapsManagerTest : public CppUnit::TestFixture { } void testReceiveLegacyCapsDoesNotRequestDisco() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, legacyCapsInfo); CPPUNIT_ASSERT_EQUAL(0, static_cast(stanzaChannel->sentStanzas.size())); } void testReceiveSameHashAfterSuccesfulDiscoDoesNotRequestDisco() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); sendDiscoInfoResult(discoInfo1); @@ -106,7 +106,7 @@ class CapsManagerTest : public CppUnit::TestFixture { } void testReceiveSameHashFromSameUserAfterFailedDiscoDoesNotRequestDisco() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getID())); @@ -117,7 +117,7 @@ class CapsManagerTest : public CppUnit::TestFixture { } void testReceiveSameHashFromSameUserAfterIncorrectVerificationDoesNotRequestDisco() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); sendDiscoInfoResult(discoInfo2); @@ -128,7 +128,7 @@ class CapsManagerTest : public CppUnit::TestFixture { } void testReceiveSameHashFromDifferentUserAfterFailedDiscoRequestsDisco() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID())); @@ -138,7 +138,7 @@ class CapsManagerTest : public CppUnit::TestFixture { } void testReceiveSameHashFromDifferentUserAfterIncorrectVerificationRequestsDisco() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); sendDiscoInfoResult(discoInfo2); @@ -148,7 +148,7 @@ class CapsManagerTest : public CppUnit::TestFixture { } void testReceiveDifferentHashFromSameUserAfterFailedDiscoDoesNotRequestDisco() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getID())); @@ -159,50 +159,50 @@ class CapsManagerTest : public CppUnit::TestFixture { } void testReceiveSuccesfulDiscoStoresCaps() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); sendDiscoInfoResult(discoInfo1); - boost::shared_ptr discoInfo(storage->getDiscoInfo(capsInfo1->getVersion())); + std::shared_ptr discoInfo(storage->getDiscoInfo(capsInfo1->getVersion())); CPPUNIT_ASSERT(discoInfo); CPPUNIT_ASSERT(discoInfo->hasFeature("http://swift.im/feature1")); } void testReceiveIncorrectVerificationDiscoDoesNotStoreCaps() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); sendDiscoInfoResult(discoInfo2); - boost::shared_ptr discoInfo(storage->getDiscoInfo(capsInfo1->getVersion())); + std::shared_ptr discoInfo(storage->getDiscoInfo(capsInfo1->getVersion())); CPPUNIT_ASSERT(!discoInfo); } void testReceiveFailingDiscoFallsBack() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); sendPresenceWithCaps(user2, capsInfo1alt); stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID())); CPPUNIT_ASSERT(stanzaChannel->isRequestAtIndex(1, user2, IQ::Get)); - boost::shared_ptr discoInfo(stanzaChannel->sentStanzas[1]->getPayload()); + std::shared_ptr discoInfo(stanzaChannel->sentStanzas[1]->getPayload()); CPPUNIT_ASSERT(discoInfo); CPPUNIT_ASSERT_EQUAL("http://node2.im#" + capsInfo1alt->getVersion(), discoInfo->getNode()); } void testReceiveNoDiscoFallsBack() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); sendPresenceWithCaps(user2, capsInfo1alt); - stanzaChannel->onIQReceived(IQ::createResult(JID("baz@fum.com/dum"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID(), boost::shared_ptr())); + stanzaChannel->onIQReceived(IQ::createResult(JID("baz@fum.com/dum"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID(), std::shared_ptr())); CPPUNIT_ASSERT(stanzaChannel->isRequestAtIndex(1, user2, IQ::Get)); - boost::shared_ptr discoInfo(stanzaChannel->sentStanzas[1]->getPayload()); + std::shared_ptr discoInfo(stanzaChannel->sentStanzas[1]->getPayload()); CPPUNIT_ASSERT(discoInfo); CPPUNIT_ASSERT_EQUAL("http://node2.im#" + capsInfo1alt->getVersion(), discoInfo->getNode()); } void testReceiveFailingFallbackDiscoFallsBack() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); sendPresenceWithCaps(user2, capsInfo1alt); sendPresenceWithCaps(user3, capsInfo1); @@ -213,7 +213,7 @@ class CapsManagerTest : public CppUnit::TestFixture { } void testReceiveSameHashFromFailingUserAfterReconnectRequestsDisco() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID())); stanzaChannel->setAvailable(false); @@ -226,7 +226,7 @@ class CapsManagerTest : public CppUnit::TestFixture { } void testReconnectResetsFallback() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); sendPresenceWithCaps(user2, capsInfo1alt); stanzaChannel->setAvailable(false); @@ -239,7 +239,7 @@ class CapsManagerTest : public CppUnit::TestFixture { } void testReconnectResetsRequests() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); stanzaChannel->sentStanzas.clear(); stanzaChannel->setAvailable(false); @@ -250,8 +250,8 @@ class CapsManagerTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createManager() { - boost::shared_ptr manager(new CapsManager(storage, stanzaChannel, iqRouter, crypto.get())); + std::shared_ptr createManager() { + std::shared_ptr manager(new CapsManager(storage, stanzaChannel, iqRouter, crypto.get())); manager->setWarnOnInvalidHash(false); //manager->onCapsChanged.connect(boost::bind(&CapsManagerTest::handleCapsChanged, this, _1)); return manager; @@ -261,14 +261,14 @@ class CapsManagerTest : public CppUnit::TestFixture { changes.push_back(jid); } - void sendPresenceWithCaps(const JID& jid, boost::shared_ptr caps) { - boost::shared_ptr presence(new Presence()); + void sendPresenceWithCaps(const JID& jid, std::shared_ptr caps) { + std::shared_ptr presence(new Presence()); presence->setFrom(jid); presence->addPayload(caps); stanzaChannel->onPresenceReceived(presence); } - void sendDiscoInfoResult(boost::shared_ptr discoInfo) { + void sendDiscoInfoResult(std::shared_ptr discoInfo) { stanzaChannel->onIQReceived(IQ::createResult(JID("baz@fum.com/dum"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID(), discoInfo)); } @@ -278,15 +278,15 @@ class CapsManagerTest : public CppUnit::TestFixture { CapsStorage* storage; std::vector changes; JID user1; - boost::shared_ptr discoInfo1; - boost::shared_ptr capsInfo1; - boost::shared_ptr capsInfo1alt; + std::shared_ptr discoInfo1; + std::shared_ptr capsInfo1; + std::shared_ptr capsInfo1alt; JID user2; - boost::shared_ptr discoInfo2; - boost::shared_ptr capsInfo2; - boost::shared_ptr legacyCapsInfo; + std::shared_ptr discoInfo2; + std::shared_ptr capsInfo2; + std::shared_ptr legacyCapsInfo; JID user3; - boost::shared_ptr crypto; + std::shared_ptr crypto; }; CPPUNIT_TEST_SUITE_REGISTRATION(CapsManagerTest); diff --git a/Swiften/Disco/UnitTest/DiscoInfoResponderTest.cpp b/Swiften/Disco/UnitTest/DiscoInfoResponderTest.cpp index 907029e..45dc959 100644 --- a/Swiften/Disco/UnitTest/DiscoInfoResponderTest.cpp +++ b/Swiften/Disco/UnitTest/DiscoInfoResponderTest.cpp @@ -40,11 +40,11 @@ class DiscoInfoResponderTest : public CppUnit::TestFixture { discoInfo.addFeature("foo"); testling.setDiscoInfo(discoInfo); - boost::shared_ptr query(new DiscoInfo()); + std::shared_ptr query(new DiscoInfo()); channel_->onIQReceived(IQ::createRequest(IQ::Get, JID("foo@bar.com"), "id-1", query)); CPPUNIT_ASSERT_EQUAL(1, static_cast(channel_->iqs_.size())); - boost::shared_ptr payload(channel_->iqs_[0]->getPayload()); + std::shared_ptr payload(channel_->iqs_[0]->getPayload()); CPPUNIT_ASSERT(payload); CPPUNIT_ASSERT_EQUAL(std::string(""), payload->getNode()); CPPUNIT_ASSERT(payload->hasFeature("foo")); @@ -62,12 +62,12 @@ class DiscoInfoResponderTest : public CppUnit::TestFixture { discoInfoBar.addFeature("bar"); testling.setDiscoInfo("bar-node", discoInfoBar); - boost::shared_ptr query(new DiscoInfo()); + std::shared_ptr query(new DiscoInfo()); query->setNode("bar-node"); channel_->onIQReceived(IQ::createRequest(IQ::Get, JID("foo@bar.com"), "id-1", query)); CPPUNIT_ASSERT_EQUAL(1, static_cast(channel_->iqs_.size())); - boost::shared_ptr payload(channel_->iqs_[0]->getPayload()); + std::shared_ptr payload(channel_->iqs_[0]->getPayload()); CPPUNIT_ASSERT(payload); CPPUNIT_ASSERT_EQUAL(std::string("bar-node"), payload->getNode()); CPPUNIT_ASSERT(payload->hasFeature("bar")); @@ -77,13 +77,13 @@ class DiscoInfoResponderTest : public CppUnit::TestFixture { void testHandleRequest_GetInvalidNodeInfo() { DiscoInfoResponder testling(router_); - boost::shared_ptr query(new DiscoInfo()); + std::shared_ptr query(new DiscoInfo()); query->setNode("bar-node"); channel_->onIQReceived(IQ::createRequest(IQ::Get, JID("foo@bar.com"), "id-1", query)); testling.start(); CPPUNIT_ASSERT_EQUAL(1, static_cast(channel_->iqs_.size())); - boost::shared_ptr payload(channel_->iqs_[0]->getPayload()); + std::shared_ptr payload(channel_->iqs_[0]->getPayload()); CPPUNIT_ASSERT(payload); testling.stop(); diff --git a/Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp b/Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp index 4062753..d775f6c 100644 --- a/Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp +++ b/Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp @@ -34,22 +34,22 @@ class EntityCapsManagerTest : public CppUnit::TestFixture { public: void setUp() { - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); stanzaChannel = new DummyStanzaChannel(); capsProvider = new DummyCapsProvider(); user1 = JID("user1@bar.com/bla"); - discoInfo1 = boost::make_shared(); + discoInfo1 = std::make_shared(); discoInfo1->addFeature("http://swift.im/feature1"); - capsInfo1 = boost::make_shared(CapsInfoGenerator("http://node1.im", crypto.get()).generateCapsInfo(*discoInfo1.get())); - capsInfo1alt = boost::make_shared(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo1.get())); + capsInfo1 = std::make_shared(CapsInfoGenerator("http://node1.im", crypto.get()).generateCapsInfo(*discoInfo1.get())); + capsInfo1alt = std::make_shared(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo1.get())); user2 = JID("user2@foo.com/baz"); - discoInfo2 = boost::make_shared(); + discoInfo2 = std::make_shared(); discoInfo2->addFeature("http://swift.im/feature2"); - capsInfo2 = boost::make_shared(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo2.get())); + capsInfo2 = std::make_shared(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo2.get())); user3 = JID("user3@foo.com/baz"); - legacyCapsInfo = boost::make_shared("http://swift.im", "ver1", ""); + legacyCapsInfo = std::make_shared("http://swift.im", "ver1", ""); } void tearDown() { @@ -58,7 +58,7 @@ class EntityCapsManagerTest : public CppUnit::TestFixture { } void testReceiveKnownHash() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); capsProvider->caps[capsInfo1->getVersion()] = discoInfo1; sendPresenceWithCaps(user1, capsInfo1); @@ -68,7 +68,7 @@ class EntityCapsManagerTest : public CppUnit::TestFixture { } void testReceiveKnownHashTwiceDoesNotTriggerChange() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); capsProvider->caps[capsInfo1->getVersion()] = discoInfo1; sendPresenceWithCaps(user1, capsInfo1); changes.clear(); @@ -79,14 +79,14 @@ class EntityCapsManagerTest : public CppUnit::TestFixture { } void testReceiveUnknownHashDoesNotTriggerChange() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); CPPUNIT_ASSERT_EQUAL(0, static_cast(changes.size())); } void testHashAvailable() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); sendPresenceWithCaps(user1, capsInfo1); capsProvider->caps[capsInfo1->getVersion()] = discoInfo1; @@ -98,7 +98,7 @@ class EntityCapsManagerTest : public CppUnit::TestFixture { } void testReceiveUnknownHashAfterKnownHashTriggersChangeAndClearsCaps() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); capsProvider->caps[capsInfo1->getVersion()] = discoInfo1; sendPresenceWithCaps(user1, capsInfo1); changes.clear(); @@ -110,7 +110,7 @@ class EntityCapsManagerTest : public CppUnit::TestFixture { } void testReceiveUnavailablePresenceAfterKnownHashTriggersChangeAndClearsCaps() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); capsProvider->caps[capsInfo1->getVersion()] = discoInfo1; sendPresenceWithCaps(user1, capsInfo1); changes.clear(); @@ -122,7 +122,7 @@ class EntityCapsManagerTest : public CppUnit::TestFixture { } void testReconnectTriggersChangeAndClearsCaps() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); capsProvider->caps[capsInfo1->getVersion()] = discoInfo1; capsProvider->caps[capsInfo2->getVersion()] = discoInfo2; sendPresenceWithCaps(user1, capsInfo1); @@ -139,8 +139,8 @@ class EntityCapsManagerTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createManager() { - boost::shared_ptr manager(new EntityCapsManager(capsProvider, stanzaChannel)); + std::shared_ptr createManager() { + std::shared_ptr manager(new EntityCapsManager(capsProvider, stanzaChannel)); manager->onCapsChanged.connect(boost::bind(&EntityCapsManagerTest::handleCapsChanged, this, _1)); return manager; } @@ -149,15 +149,15 @@ class EntityCapsManagerTest : public CppUnit::TestFixture { changes.push_back(jid); } - void sendPresenceWithCaps(const JID& jid, boost::shared_ptr caps) { - boost::shared_ptr presence(new Presence()); + void sendPresenceWithCaps(const JID& jid, std::shared_ptr caps) { + std::shared_ptr presence(new Presence()); presence->setFrom(jid); presence->addPayload(caps); stanzaChannel->onPresenceReceived(presence); } void sendUnavailablePresence(const JID& jid) { - boost::shared_ptr presence(new Presence()); + std::shared_ptr presence(new Presence()); presence->setFrom(jid); presence->setType(Presence::Unavailable); stanzaChannel->onPresenceReceived(presence); @@ -180,16 +180,16 @@ class EntityCapsManagerTest : public CppUnit::TestFixture { DummyStanzaChannel* stanzaChannel; DummyCapsProvider* capsProvider; JID user1; - boost::shared_ptr discoInfo1; - boost::shared_ptr capsInfo1; - boost::shared_ptr capsInfo1alt; + std::shared_ptr discoInfo1; + std::shared_ptr capsInfo1; + std::shared_ptr capsInfo1alt; JID user2; - boost::shared_ptr discoInfo2; - boost::shared_ptr capsInfo2; - boost::shared_ptr legacyCapsInfo; + std::shared_ptr discoInfo2; + std::shared_ptr capsInfo2; + std::shared_ptr legacyCapsInfo; JID user3; std::vector changes; - boost::shared_ptr crypto; + std::shared_ptr crypto; }; CPPUNIT_TEST_SUITE_REGISTRATION(EntityCapsManagerTest); diff --git a/Swiften/Disco/UnitTest/JIDDiscoInfoResponderTest.cpp b/Swiften/Disco/UnitTest/JIDDiscoInfoResponderTest.cpp index 3c1a057..9369a04 100644 --- a/Swiften/Disco/UnitTest/JIDDiscoInfoResponderTest.cpp +++ b/Swiften/Disco/UnitTest/JIDDiscoInfoResponderTest.cpp @@ -41,11 +41,11 @@ class JIDDiscoInfoResponderTest : public CppUnit::TestFixture { discoInfo.addFeature("foo"); testling.setDiscoInfo(JID("foo@bar.com/baz"), discoInfo); - boost::shared_ptr query(new DiscoInfo()); + std::shared_ptr query(new DiscoInfo()); channel_->onIQReceived(IQ::createRequest(IQ::Get, JID("foo@bar.com/baz"), "id-1", query)); CPPUNIT_ASSERT_EQUAL(1, static_cast(channel_->iqs_.size())); - boost::shared_ptr payload(channel_->iqs_[0]->getPayload()); + std::shared_ptr payload(channel_->iqs_[0]->getPayload()); CPPUNIT_ASSERT(payload); CPPUNIT_ASSERT_EQUAL(std::string(""), payload->getNode()); CPPUNIT_ASSERT(payload->hasFeature("foo")); @@ -63,12 +63,12 @@ class JIDDiscoInfoResponderTest : public CppUnit::TestFixture { discoInfoBar.addFeature("bar"); testling.setDiscoInfo(JID("foo@bar.com/baz"), "bar-node", discoInfoBar); - boost::shared_ptr query(new DiscoInfo()); + std::shared_ptr query(new DiscoInfo()); query->setNode("bar-node"); channel_->onIQReceived(IQ::createRequest(IQ::Get, JID("foo@bar.com/baz"), "id-1", query)); CPPUNIT_ASSERT_EQUAL(1, static_cast(channel_->iqs_.size())); - boost::shared_ptr payload(channel_->iqs_[0]->getPayload()); + std::shared_ptr payload(channel_->iqs_[0]->getPayload()); CPPUNIT_ASSERT(payload); CPPUNIT_ASSERT_EQUAL(std::string("bar-node"), payload->getNode()); CPPUNIT_ASSERT(payload->hasFeature("bar")); @@ -83,12 +83,12 @@ class JIDDiscoInfoResponderTest : public CppUnit::TestFixture { testling.setDiscoInfo(JID("foo@bar.com/baz"), discoInfo); testling.start(); - boost::shared_ptr query(new DiscoInfo()); + std::shared_ptr query(new DiscoInfo()); query->setNode("bar-node"); channel_->onIQReceived(IQ::createRequest(IQ::Get, JID("foo@bar.com/baz"), "id-1", query)); CPPUNIT_ASSERT_EQUAL(1, static_cast(channel_->iqs_.size())); - boost::shared_ptr payload(channel_->iqs_[0]->getPayload()); + std::shared_ptr payload(channel_->iqs_[0]->getPayload()); CPPUNIT_ASSERT(payload); testling.stop(); @@ -101,11 +101,11 @@ class JIDDiscoInfoResponderTest : public CppUnit::TestFixture { testling.setDiscoInfo(JID("foo@bar.com/baz"), discoInfo); testling.start(); - boost::shared_ptr query(new DiscoInfo()); + std::shared_ptr query(new DiscoInfo()); channel_->onIQReceived(IQ::createRequest(IQ::Get, JID("foo@bar.com/fum"), "id-1", query)); CPPUNIT_ASSERT_EQUAL(1, static_cast(channel_->iqs_.size())); - boost::shared_ptr payload(channel_->iqs_[0]->getPayload()); + std::shared_ptr payload(channel_->iqs_[0]->getPayload()); CPPUNIT_ASSERT(payload); testling.stop(); diff --git a/Swiften/Elements/AuthFailure.h b/Swiften/Elements/AuthFailure.h index 8f6702c..9546b0d 100644 --- a/Swiften/Elements/AuthFailure.h +++ b/Swiften/Elements/AuthFailure.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 +#include #include #include @@ -14,7 +14,7 @@ namespace Swift { class SWIFTEN_API AuthFailure : public ToplevelElement { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; AuthFailure() {} }; diff --git a/Swiften/Elements/Bytestreams.h b/Swiften/Elements/Bytestreams.h index dc6ec78..ca30922 100644 --- a/Swiften/Elements/Bytestreams.h +++ b/Swiften/Elements/Bytestreams.h @@ -6,11 +6,11 @@ #pragma once +#include #include #include #include -#include #include #include @@ -19,7 +19,7 @@ namespace Swift { class SWIFTEN_API Bytestreams : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; struct StreamHost { StreamHost(const std::string& host = "", const JID& jid = JID(), int port = -1) : host(host), jid(jid), port(port) {} diff --git a/Swiften/Elements/CapsInfo.h b/Swiften/Elements/CapsInfo.h index 875ede4..d1e5103 100644 --- a/Swiften/Elements/CapsInfo.h +++ b/Swiften/Elements/CapsInfo.h @@ -6,17 +6,16 @@ #pragma once +#include #include -#include - #include #include namespace Swift { class SWIFTEN_API CapsInfo : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; CapsInfo(const std::string& node = "", const std::string& version = "", const std::string& hash = "sha-1") : node_(node), version_(version), hash_(hash) {} diff --git a/Swiften/Elements/CarbonsDisable.h b/Swiften/Elements/CarbonsDisable.h index f6c9a38..9526061 100644 --- a/Swiften/Elements/CarbonsDisable.h +++ b/Swiften/Elements/CarbonsDisable.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -14,7 +14,7 @@ namespace Swift { class SWIFTEN_API CarbonsDisable : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: virtual ~CarbonsDisable(); diff --git a/Swiften/Elements/CarbonsEnable.h b/Swiften/Elements/CarbonsEnable.h index 1cb64ad..bcb27a2 100644 --- a/Swiften/Elements/CarbonsEnable.h +++ b/Swiften/Elements/CarbonsEnable.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -14,7 +14,7 @@ namespace Swift { class SWIFTEN_API CarbonsEnable : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: virtual ~CarbonsEnable(); diff --git a/Swiften/Elements/CarbonsPrivate.h b/Swiften/Elements/CarbonsPrivate.h index fdd3944..5cc25ff 100644 --- a/Swiften/Elements/CarbonsPrivate.h +++ b/Swiften/Elements/CarbonsPrivate.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -14,7 +14,7 @@ namespace Swift { class SWIFTEN_API CarbonsPrivate : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: virtual ~CarbonsPrivate(); diff --git a/Swiften/Elements/CarbonsReceived.cpp b/Swiften/Elements/CarbonsReceived.cpp index 1c0a72b..7c233a3 100644 --- a/Swiften/Elements/CarbonsReceived.cpp +++ b/Swiften/Elements/CarbonsReceived.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -11,11 +11,11 @@ namespace Swift { } - void CarbonsReceived::setForwarded(boost::shared_ptr forwarded) { + void CarbonsReceived::setForwarded(std::shared_ptr forwarded) { forwarded_ = forwarded; } - boost::shared_ptr CarbonsReceived::getForwarded() const { + std::shared_ptr CarbonsReceived::getForwarded() const { return forwarded_; } } diff --git a/Swiften/Elements/CarbonsReceived.h b/Swiften/Elements/CarbonsReceived.h index 82ccff9..c33b600 100644 --- a/Swiften/Elements/CarbonsReceived.h +++ b/Swiften/Elements/CarbonsReceived.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -15,14 +15,14 @@ namespace Swift { class SWIFTEN_API CarbonsReceived : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: virtual ~CarbonsReceived(); - void setForwarded(boost::shared_ptr forwarded); - boost::shared_ptr getForwarded() const; + void setForwarded(std::shared_ptr forwarded); + std::shared_ptr getForwarded() const; private: - boost::shared_ptr forwarded_; + std::shared_ptr forwarded_; }; } diff --git a/Swiften/Elements/CarbonsSent.cpp b/Swiften/Elements/CarbonsSent.cpp index c2380c6..a026871 100644 --- a/Swiften/Elements/CarbonsSent.cpp +++ b/Swiften/Elements/CarbonsSent.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -11,11 +11,11 @@ namespace Swift { } - void CarbonsSent::setForwarded(boost::shared_ptr forwarded) { + void CarbonsSent::setForwarded(std::shared_ptr forwarded) { forwarded_ = forwarded; } - boost::shared_ptr CarbonsSent::getForwarded() const { + std::shared_ptr CarbonsSent::getForwarded() const { return forwarded_; } } diff --git a/Swiften/Elements/CarbonsSent.h b/Swiften/Elements/CarbonsSent.h index d025a0d..89739de 100644 --- a/Swiften/Elements/CarbonsSent.h +++ b/Swiften/Elements/CarbonsSent.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -15,14 +15,14 @@ namespace Swift { class SWIFTEN_API CarbonsSent : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: virtual ~CarbonsSent(); - void setForwarded(boost::shared_ptr forwarded); - boost::shared_ptr getForwarded() const; + void setForwarded(std::shared_ptr forwarded); + std::shared_ptr getForwarded() const; private: - boost::shared_ptr forwarded_; + std::shared_ptr forwarded_; }; } diff --git a/Swiften/Elements/ChatState.h b/Swiften/Elements/ChatState.h index c1ae68e..4288398 100644 --- a/Swiften/Elements/ChatState.h +++ b/Swiften/Elements/ChatState.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -14,7 +14,7 @@ namespace Swift { class SWIFTEN_API ChatState : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: enum ChatStateType {Active, Composing, Paused, Inactive, Gone}; diff --git a/Swiften/Elements/Command.h b/Swiften/Elements/Command.h index fff3d6b..33aadd5 100644 --- a/Swiften/Elements/Command.h +++ b/Swiften/Elements/Command.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -20,7 +19,7 @@ namespace Swift { */ class SWIFTEN_API Command : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum Status {Executing, Completed, Canceled, NoStatus}; enum Action {Cancel, Execute, Complete, Prev, Next, NoAction}; diff --git a/Swiften/Elements/ComponentHandshake.h b/Swiften/Elements/ComponentHandshake.h index e8afc18..4d6d059 100644 --- a/Swiften/Elements/ComponentHandshake.h +++ b/Swiften/Elements/ComponentHandshake.h @@ -6,17 +6,16 @@ #pragma once +#include #include -#include - #include #include namespace Swift { class SWIFTEN_API ComponentHandshake : public ToplevelElement { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; ComponentHandshake(const std::string& data = "") : data(data) { } diff --git a/Swiften/Elements/ContainerPayload.h b/Swiften/Elements/ContainerPayload.h index 7435f34..3da04b7 100644 --- a/Swiften/Elements/ContainerPayload.h +++ b/Swiften/Elements/ContainerPayload.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -19,17 +18,17 @@ namespace Swift { class SWIFTEN_API ContainerPayload : public Payload { public: ContainerPayload() {} - ContainerPayload(boost::shared_ptr payload) : payload(payload) {} + ContainerPayload(std::shared_ptr payload) : payload(payload) {} - void setPayload(boost::shared_ptr payload) { + void setPayload(std::shared_ptr payload) { this->payload = payload; } - boost::shared_ptr getPayload() const { + std::shared_ptr getPayload() const { return payload; } private: - boost::shared_ptr payload; + std::shared_ptr payload; }; } diff --git a/Swiften/Elements/DeliveryReceipt.h b/Swiften/Elements/DeliveryReceipt.h index a4936a5..238485d 100644 --- a/Swiften/Elements/DeliveryReceipt.h +++ b/Swiften/Elements/DeliveryReceipt.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ namespace Swift { class SWIFTEN_API DeliveryReceipt : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: DeliveryReceipt() {} diff --git a/Swiften/Elements/DeliveryReceiptRequest.h b/Swiften/Elements/DeliveryReceiptRequest.h index 58086df..9a7d478 100644 --- a/Swiften/Elements/DeliveryReceiptRequest.h +++ b/Swiften/Elements/DeliveryReceiptRequest.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -19,7 +19,7 @@ namespace Swift { class SWIFTEN_API DeliveryReceiptRequest : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: DeliveryReceiptRequest() {} diff --git a/Swiften/Elements/DiscoInfo.h b/Swiften/Elements/DiscoInfo.h index d6ca6b8..6ce3fbb 100644 --- a/Swiften/Elements/DiscoInfo.h +++ b/Swiften/Elements/DiscoInfo.h @@ -19,7 +19,7 @@ namespace Swift { */ class SWIFTEN_API DiscoInfo : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static const std::string ChatStatesFeature; static const std::string SecurityLabelsFeature; diff --git a/Swiften/Elements/ErrorPayload.h b/Swiften/Elements/ErrorPayload.h index 800ff22..0269e4d 100644 --- a/Swiften/Elements/ErrorPayload.h +++ b/Swiften/Elements/ErrorPayload.h @@ -6,17 +6,16 @@ #pragma once +#include #include -#include - #include #include namespace Swift { class SWIFTEN_API ErrorPayload : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum Type { Cancel, Continue, Modify, Auth, Wait }; @@ -71,11 +70,11 @@ namespace Swift { return text_; } - void setPayload(boost::shared_ptr payload) { + void setPayload(std::shared_ptr payload) { payload_ = payload; } - boost::shared_ptr getPayload() const { + std::shared_ptr getPayload() const { return payload_; } @@ -83,6 +82,6 @@ namespace Swift { Type type_; Condition condition_; std::string text_; - boost::shared_ptr payload_; + std::shared_ptr payload_; }; } diff --git a/Swiften/Elements/Form.h b/Swiften/Elements/Form.h index ebdb161..85ba9c7 100644 --- a/Swiften/Elements/Form.h +++ b/Swiften/Elements/Form.h @@ -24,7 +24,7 @@ namespace Swift { */ class SWIFTEN_API Form : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; typedef std::vector FormItem; enum Type { FormType, SubmitType, CancelType, ResultType }; @@ -32,21 +32,21 @@ namespace Swift { public: Form(Type type = FormType) : type_(type) {} - void addPage(boost::shared_ptr page) { + void addPage(std::shared_ptr page) { assert(page); pages_.push_back(page); } - const std::vector >& getPages() const { + const std::vector >& getPages() const { return pages_; } - void addField(boost::shared_ptr field) { + void addField(std::shared_ptr field) { assert(field); fields_.push_back(field); } - const std::vector >& getFields() const { + const std::vector >& getFields() const { return fields_; } @@ -54,21 +54,21 @@ namespace Swift { fields_.clear(); } - void addTextElement(boost::shared_ptr text) { + void addTextElement(std::shared_ptr text) { assert(text); textElements_.push_back(text); } - const std::vector >& getTextElements() const { + const std::vector >& getTextElements() const { return textElements_; } - void addReportedRef(boost::shared_ptr reportedRef) { + void addReportedRef(std::shared_ptr reportedRef) { assert(reportedRef); reportedRefs_.push_back(reportedRef); } - const std::vector >& getReportedRefs() const { + const std::vector >& getReportedRefs() const { return reportedRefs_; } @@ -109,13 +109,13 @@ namespace Swift { void clearReportedFields() { reportedFields_.clear(); } private: - std::vector >reportedRefs_; - std::vector > textElements_; - std::vector > pages_; - std::vector > fields_; - std::vector > reportedFields_; + std::vector >reportedRefs_; + std::vector > textElements_; + std::vector > pages_; + std::vector > fields_; + std::vector > reportedFields_; std::vector items_; - boost::shared_ptr reportedRef_; + std::shared_ptr reportedRef_; std::string title_; std::string instructions_; Type type_; diff --git a/Swiften/Elements/FormField.h b/Swiften/Elements/FormField.h index e62dec4..2d71ac7 100644 --- a/Swiften/Elements/FormField.h +++ b/Swiften/Elements/FormField.h @@ -6,18 +6,17 @@ #pragma once +#include #include #include -#include - #include #include namespace Swift { class SWIFTEN_API FormField { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum Type { UnknownType, diff --git a/Swiften/Elements/FormPage.cpp b/Swiften/Elements/FormPage.cpp index a4e1616..0afa112 100644 --- a/Swiften/Elements/FormPage.cpp +++ b/Swiften/Elements/FormPage.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,35 +21,35 @@ const std::string& FormPage::getLabel() const { return label_; } -void FormPage::addChildSection(boost::shared_ptr section) { +void FormPage::addChildSection(std::shared_ptr section) { childSections_.push_back(section); } -const std::vector >& FormPage::getChildSections() const { +const std::vector >& FormPage::getChildSections() const { return childSections_; } -void FormPage::addTextElement(boost::shared_ptr textElement) { +void FormPage::addTextElement(std::shared_ptr textElement) { textElements_.push_back(textElement); } -const std::vector >& FormPage::getTextElements() const { +const std::vector >& FormPage::getTextElements() const { return textElements_; } -void FormPage::addReportedRef(boost::shared_ptr reportedRef) { +void FormPage::addReportedRef(std::shared_ptr reportedRef) { reportedRefs_.push_back(reportedRef); } -const std::vector >& FormPage::getReportedRefs() const { +const std::vector >& FormPage::getReportedRefs() const { return reportedRefs_; } -void FormPage::addField(boost::shared_ptr field) { +void FormPage::addField(std::shared_ptr field) { fields_.push_back(field); } -const std::vector >& FormPage::getFields() const { +const std::vector >& FormPage::getFields() const { return fields_; } diff --git a/Swiften/Elements/FormPage.h b/Swiften/Elements/FormPage.h index f7a4a9a..8412d9e 100644 --- a/Swiften/Elements/FormPage.h +++ b/Swiften/Elements/FormPage.h @@ -5,11 +5,10 @@ */ #pragma once +#include #include #include -#include - #include #include #include @@ -20,28 +19,28 @@ namespace Swift { class SWIFTEN_API FormPage { public: - typedef boost::shared_ptr page; + typedef std::shared_ptr page; FormPage (); ~FormPage(); void setLabel(const std::string& label); const std::string& getLabel() const; - void addChildSection(boost::shared_ptr section); - const std::vector >& getChildSections() const; - void addTextElement(boost::shared_ptr textElement); - const std::vector >& getTextElements() const; - void addReportedRef(boost::shared_ptr reportedRef); - const std::vector >& getReportedRefs() const; - void addField(boost::shared_ptr field); - const std::vector >& getFields() const; + void addChildSection(std::shared_ptr section); + const std::vector >& getChildSections() const; + void addTextElement(std::shared_ptr textElement); + const std::vector >& getTextElements() const; + void addReportedRef(std::shared_ptr reportedRef); + const std::vector >& getReportedRefs() const; + void addField(std::shared_ptr field); + const std::vector >& getFields() const; void addFieldRef(std::string ref); const std::vector getFieldRefs() const; private: std::string label_; - std::vector > textElements_; - std::vector > childSections_; - std::vector > reportedRefs_; - std::vector > fields_; + std::vector > textElements_; + std::vector > childSections_; + std::vector > reportedRefs_; + std::vector > fields_; std::vector fieldRefs_; }; } diff --git a/Swiften/Elements/FormReportedRef.h b/Swiften/Elements/FormReportedRef.h index a972f10..d6dc718 100644 --- a/Swiften/Elements/FormReportedRef.h +++ b/Swiften/Elements/FormReportedRef.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include @@ -14,6 +14,6 @@ namespace Swift { class SWIFTEN_API FormReportedRef { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; }; } diff --git a/Swiften/Elements/FormSection.cpp b/Swiften/Elements/FormSection.cpp index 2fe1954..9ca3b4d 100644 --- a/Swiften/Elements/FormSection.cpp +++ b/Swiften/Elements/FormSection.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,35 +21,35 @@ const std::string& FormSection::getLabel() const { return label_; } -void FormSection::addTextElement(boost::shared_ptr textElement) { +void FormSection::addTextElement(std::shared_ptr textElement) { textElements_.push_back(textElement); } -const std::vector >& FormSection::getTextElements() const { +const std::vector >& FormSection::getTextElements() const { return textElements_; } -void FormSection::addReportedRef(boost::shared_ptr reportedRef) { +void FormSection::addReportedRef(std::shared_ptr reportedRef) { reportedRefs_.push_back(reportedRef); } -const std::vector >& FormSection::getReportedRefs() const { +const std::vector >& FormSection::getReportedRefs() const { return reportedRefs_; } -void FormSection::addChildSection(boost::shared_ptr childSection) { +void FormSection::addChildSection(std::shared_ptr childSection) { childSections_.push_back(childSection); } -const std::vector >& FormSection::getChildSections() const { +const std::vector >& FormSection::getChildSections() const { return childSections_; } -void FormSection::addField(boost::shared_ptr field) { +void FormSection::addField(std::shared_ptr field) { fields_.push_back(field); } -const std::vector >& FormSection::getFields() const { +const std::vector >& FormSection::getFields() const { return fields_; } diff --git a/Swiften/Elements/FormSection.h b/Swiften/Elements/FormSection.h index 69638c4..b1d60bc 100644 --- a/Swiften/Elements/FormSection.h +++ b/Swiften/Elements/FormSection.h @@ -5,11 +5,10 @@ */ #pragma once +#include #include #include -#include - #include #include #include @@ -19,28 +18,28 @@ namespace Swift { class SWIFTEN_API FormSection { public: - typedef boost::shared_ptr section; + typedef std::shared_ptr section; FormSection(); ~FormSection(); void setLabel(const std::string& label); const std::string& getLabel() const; - void addTextElement(boost::shared_ptr textElement); - const std::vector >& getTextElements() const; - void addReportedRef(boost::shared_ptr reportedRef); - const std::vector >& getReportedRefs() const; - void addChildSection(boost::shared_ptr childSection); - const std::vector >& getChildSections() const; - void addField(boost::shared_ptr field); - const std::vector >& getFields() const; + void addTextElement(std::shared_ptr textElement); + const std::vector >& getTextElements() const; + void addReportedRef(std::shared_ptr reportedRef); + const std::vector >& getReportedRefs() const; + void addChildSection(std::shared_ptr childSection); + const std::vector >& getChildSections() const; + void addField(std::shared_ptr field); + const std::vector >& getFields() const; void addFieldRef(std::string ref); const std::vector getFieldRefs() const; private: std::string label_; - std::vector > textElements_; - std::vector > reportedRefs_; - std::vector > childSections_; - std::vector > fields_; + std::vector > textElements_; + std::vector > reportedRefs_; + std::vector > childSections_; + std::vector > fields_; std::vector fieldRefs_; }; } diff --git a/Swiften/Elements/FormText.h b/Swiften/Elements/FormText.h index 1d95a3a..a0c8d56 100644 --- a/Swiften/Elements/FormText.h +++ b/Swiften/Elements/FormText.h @@ -5,10 +5,9 @@ */ #pragma once +#include #include -#include - #include namespace Swift { @@ -16,7 +15,7 @@ namespace Swift { class SWIFTEN_API FormText{ public: - typedef boost::shared_ptr text; + typedef std::shared_ptr text; FormText(); virtual ~FormText(); void setTextString(const std::string& text); diff --git a/Swiften/Elements/Forwarded.h b/Swiften/Elements/Forwarded.h index 8401fe1..1a31b89 100644 --- a/Swiften/Elements/Forwarded.h +++ b/Swiften/Elements/Forwarded.h @@ -20,14 +20,14 @@ namespace Swift { public: virtual ~Forwarded(); - void setDelay(boost::shared_ptr delay) { delay_ = delay; } - const boost::shared_ptr& getDelay() const { return delay_; } + void setDelay(std::shared_ptr delay) { delay_ = delay; } + const std::shared_ptr& getDelay() const { return delay_; } - void setStanza(boost::shared_ptr stanza) { stanza_ = stanza; } - const boost::shared_ptr& getStanza() const { return stanza_; } + void setStanza(std::shared_ptr stanza) { stanza_ = stanza; } + const std::shared_ptr& getStanza() const { return stanza_; } private: - boost::shared_ptr delay_; - boost::shared_ptr stanza_; + std::shared_ptr delay_; + std::shared_ptr stanza_; }; } diff --git a/Swiften/Elements/IBB.h b/Swiften/Elements/IBB.h index 97a46bb..bd0b661 100644 --- a/Swiften/Elements/IBB.h +++ b/Swiften/Elements/IBB.h @@ -6,19 +6,17 @@ #pragma once +#include #include #include -#include -#include - #include #include namespace Swift { class SWIFTEN_API IBB : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum Action { Open, @@ -34,20 +32,20 @@ namespace Swift { } static IBB::ref createIBBOpen(const std::string& streamID, int blockSize) { - IBB::ref result = boost::make_shared(Open, streamID); + IBB::ref result = std::make_shared(Open, streamID); result->setBlockSize(blockSize); return result; } static IBB::ref createIBBData(const std::string& streamID, int sequenceNumber, const std::vector& data) { - IBB::ref result = boost::make_shared(Data, streamID); + IBB::ref result = std::make_shared(Data, streamID); result->setSequenceNumber(sequenceNumber); result->setData(data); return result; } static IBB::ref createIBBClose(const std::string& streamID) { - return boost::make_shared(Close, streamID); + return std::make_shared(Close, streamID); } void setAction(Action action) { diff --git a/Swiften/Elements/IQ.cpp b/Swiften/Elements/IQ.cpp index cd1498e..31a654f 100644 --- a/Swiften/Elements/IQ.cpp +++ b/Swiften/Elements/IQ.cpp @@ -1,18 +1,18 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include +#include namespace Swift { -boost::shared_ptr IQ::createRequest( - Type type, const JID& to, const std::string& id, boost::shared_ptr payload) { - boost::shared_ptr iq = boost::make_shared(type); +std::shared_ptr IQ::createRequest( + Type type, const JID& to, const std::string& id, std::shared_ptr payload) { + std::shared_ptr iq = std::make_shared(type); if (to.isValid()) { iq->setTo(to); } @@ -23,8 +23,8 @@ boost::shared_ptr IQ::createRequest( return iq; } -boost::shared_ptr IQ::createResult(const JID& to, const std::string& id, boost::shared_ptr payload) { - boost::shared_ptr iq = boost::make_shared(Result); +std::shared_ptr IQ::createResult(const JID& to, const std::string& id, std::shared_ptr payload) { + std::shared_ptr iq = std::make_shared(Result); iq->setTo(to); iq->setID(id); if (payload) { @@ -33,8 +33,8 @@ boost::shared_ptr IQ::createResult(const JID& to, const std::string& id, boo return iq; } -boost::shared_ptr IQ::createResult(const JID& to, const JID& from, const std::string& id, boost::shared_ptr payload) { - boost::shared_ptr iq = boost::make_shared(Result); +std::shared_ptr IQ::createResult(const JID& to, const JID& from, const std::string& id, std::shared_ptr payload) { + std::shared_ptr iq = std::make_shared(Result); iq->setTo(to); iq->setFrom(from); iq->setID(id); @@ -44,22 +44,22 @@ boost::shared_ptr IQ::createResult(const JID& to, const JID& from, const std return iq; } -boost::shared_ptr IQ::createError(const JID& to, const std::string& id, ErrorPayload::Condition condition, ErrorPayload::Type type, boost::shared_ptr payload) { - boost::shared_ptr iq = boost::make_shared(IQ::Error); +std::shared_ptr IQ::createError(const JID& to, const std::string& id, ErrorPayload::Condition condition, ErrorPayload::Type type, std::shared_ptr payload) { + std::shared_ptr iq = std::make_shared(IQ::Error); iq->setTo(to); iq->setID(id); - boost::shared_ptr errorPayload = boost::make_shared(condition, type); + std::shared_ptr errorPayload = std::make_shared(condition, type); errorPayload->setPayload(payload); iq->addPayload(errorPayload); return iq; } -boost::shared_ptr IQ::createError(const JID& to, const JID& from, const std::string& id, ErrorPayload::Condition condition, ErrorPayload::Type type, boost::shared_ptr payload) { - boost::shared_ptr iq = boost::make_shared(IQ::Error); +std::shared_ptr IQ::createError(const JID& to, const JID& from, const std::string& id, ErrorPayload::Condition condition, ErrorPayload::Type type, std::shared_ptr payload) { + std::shared_ptr iq = std::make_shared(IQ::Error); iq->setTo(to); iq->setFrom(from); iq->setID(id); - boost::shared_ptr errorPayload = boost::make_shared(condition, type); + std::shared_ptr errorPayload = std::make_shared(condition, type); errorPayload->setPayload(payload); iq->addPayload(errorPayload); return iq; diff --git a/Swiften/Elements/IQ.h b/Swiften/Elements/IQ.h index 275c00e..00ed848 100644 --- a/Swiften/Elements/IQ.h +++ b/Swiften/Elements/IQ.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -15,7 +15,7 @@ namespace Swift { class SWIFTEN_API IQ : public Stanza { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum Type { Get, Set, Result, Error }; @@ -24,33 +24,33 @@ namespace Swift { Type getType() const { return type_; } void setType(Type type) { type_ = type; } - static boost::shared_ptr createRequest( + static std::shared_ptr createRequest( Type type, const JID& to, const std::string& id, - boost::shared_ptr payload); - static boost::shared_ptr createResult( + std::shared_ptr payload); + static std::shared_ptr createResult( const JID& to, const std::string& id, - boost::shared_ptr payload = boost::shared_ptr()); - static boost::shared_ptr createResult( + std::shared_ptr payload = std::shared_ptr()); + static std::shared_ptr createResult( const JID& to, const JID& from, const std::string& id, - boost::shared_ptr payload = boost::shared_ptr()); - static boost::shared_ptr createError( + std::shared_ptr payload = std::shared_ptr()); + static std::shared_ptr createError( const JID& to, const std::string& id, ErrorPayload::Condition condition = ErrorPayload::BadRequest, ErrorPayload::Type type = ErrorPayload::Cancel, - boost::shared_ptr payload = boost::shared_ptr()); - static boost::shared_ptr createError( + std::shared_ptr payload = std::shared_ptr()); + static std::shared_ptr createError( const JID& to, const JID& from, const std::string& id, ErrorPayload::Condition condition = ErrorPayload::BadRequest, ErrorPayload::Type type = ErrorPayload::Cancel, - boost::shared_ptr payload = boost::shared_ptr()); + std::shared_ptr payload = std::shared_ptr()); private: Type type_; diff --git a/Swiften/Elements/Idle.h b/Swiften/Elements/Idle.h index 07ecc74..9f721aa 100644 --- a/Swiften/Elements/Idle.h +++ b/Swiften/Elements/Idle.h @@ -12,8 +12,9 @@ #pragma once +#include + #include -#include #include #include @@ -22,7 +23,7 @@ namespace Swift { class SWIFTEN_API Idle : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: Idle() {} diff --git a/Swiften/Elements/InBandRegistrationPayload.h b/Swiften/Elements/InBandRegistrationPayload.h index a282df8..4fad248 100644 --- a/Swiften/Elements/InBandRegistrationPayload.h +++ b/Swiften/Elements/InBandRegistrationPayload.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -18,7 +18,7 @@ namespace Swift { class SWIFTEN_API InBandRegistrationPayload : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; InBandRegistrationPayload() : registered(false), remove(false) {} diff --git a/Swiften/Elements/IsodeIQDelegation.h b/Swiften/Elements/IsodeIQDelegation.h index 12fd9bd..39655ce 100644 --- a/Swiften/Elements/IsodeIQDelegation.h +++ b/Swiften/Elements/IsodeIQDelegation.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,16 +21,16 @@ namespace Swift { virtual ~IsodeIQDelegation(); - boost::shared_ptr getForward() const { + std::shared_ptr getForward() const { return forward; } - void setForward(boost::shared_ptr value) { + void setForward(std::shared_ptr value) { this->forward = value ; } private: - boost::shared_ptr forward; + std::shared_ptr forward; }; } diff --git a/Swiften/Elements/JingleContentPayload.h b/Swiften/Elements/JingleContentPayload.h index 46751fd..286e08b 100644 --- a/Swiften/Elements/JingleContentPayload.h +++ b/Swiften/Elements/JingleContentPayload.h @@ -20,7 +20,7 @@ namespace Swift { class SWIFTEN_API JingleContentPayload : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum Creator { UnknownCreator, @@ -62,34 +62,34 @@ namespace Swift { descriptions.push_back(description); } - const std::vector >& getTransports() const { + const std::vector >& getTransports() const { return transports; } - void addTransport(boost::shared_ptr transport) { + void addTransport(std::shared_ptr transport) { transports.push_back(transport); } template - boost::shared_ptr getDescription() const { + std::shared_ptr getDescription() const { for (size_t i = 0; i < descriptions.size(); ++i) { - boost::shared_ptr result(boost::dynamic_pointer_cast(descriptions[i])); + std::shared_ptr result(std::dynamic_pointer_cast(descriptions[i])); if (result) { return result; } } - return boost::shared_ptr(); + return std::shared_ptr(); } template - boost::shared_ptr getTransport() const { + std::shared_ptr getTransport() const { for (size_t i = 0; i < transports.size(); ++i) { - boost::shared_ptr result(boost::dynamic_pointer_cast(transports[i])); + std::shared_ptr result(std::dynamic_pointer_cast(transports[i])); if (result) { return result; } } - return boost::shared_ptr(); + return std::shared_ptr(); } private: @@ -97,6 +97,6 @@ namespace Swift { std::string name; //Senders senders; std::vector descriptions; - std::vector > transports; + std::vector > transports; }; } diff --git a/Swiften/Elements/JingleDescription.h b/Swiften/Elements/JingleDescription.h index b52291e..ee3dcae 100644 --- a/Swiften/Elements/JingleDescription.h +++ b/Swiften/Elements/JingleDescription.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -14,6 +14,6 @@ namespace Swift { class SWIFTEN_API JingleDescription : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; }; } diff --git a/Swiften/Elements/JingleFileTransferDescription.h b/Swiften/Elements/JingleFileTransferDescription.h index 4389bb2..2418f3b 100644 --- a/Swiften/Elements/JingleFileTransferDescription.h +++ b/Swiften/Elements/JingleFileTransferDescription.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -17,7 +16,7 @@ namespace Swift { class SWIFTEN_API JingleFileTransferDescription : public JingleDescription { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; void setFileInfo(const JingleFileTransferFileInfo& fileInfo) { fileInfo_ = fileInfo; diff --git a/Swiften/Elements/JingleFileTransferFileInfo.h b/Swiften/Elements/JingleFileTransferFileInfo.h index cc592c4..9fd8756 100644 --- a/Swiften/Elements/JingleFileTransferFileInfo.h +++ b/Swiften/Elements/JingleFileTransferFileInfo.h @@ -7,12 +7,12 @@ #pragma once #include +#include #include #include #include #include -#include #include #include @@ -24,7 +24,7 @@ namespace Swift { * @brief This class represents the file info used in XEP-0234. */ class SWIFTEN_API JingleFileTransferFileInfo : public Payload { - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: JingleFileTransferFileInfo(const std::string& name = "", const std::string& description = "", unsigned long long size = 0, const boost::posix_time::ptime &date = boost::posix_time::ptime()) : diff --git a/Swiften/Elements/JingleFileTransferHash.h b/Swiften/Elements/JingleFileTransferHash.h index 42fc23c..4669e1c 100644 --- a/Swiften/Elements/JingleFileTransferHash.h +++ b/Swiften/Elements/JingleFileTransferHash.h @@ -13,10 +13,9 @@ #pragma once #include +#include #include -#include - #include #include #include @@ -25,7 +24,7 @@ namespace Swift { class SWIFTEN_API JingleFileTransferHash : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; void setFileInfo(const JingleFileTransferFileInfo& fileInfo) { fileInfo_ = fileInfo; diff --git a/Swiften/Elements/JingleIBBTransportPayload.h b/Swiften/Elements/JingleIBBTransportPayload.h index 6626f51..8f0a369 100644 --- a/Swiften/Elements/JingleIBBTransportPayload.h +++ b/Swiften/Elements/JingleIBBTransportPayload.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -17,7 +17,7 @@ namespace Swift { class SWIFTEN_API JingleIBBTransportPayload : public JingleTransportPayload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum StanzaType { IQStanza, diff --git a/Swiften/Elements/JinglePayload.h b/Swiften/Elements/JinglePayload.h index a862c41..d1dfb44 100644 --- a/Swiften/Elements/JinglePayload.h +++ b/Swiften/Elements/JinglePayload.h @@ -6,11 +6,11 @@ #pragma once +#include #include #include #include -#include #include #include @@ -20,7 +20,7 @@ namespace Swift { class SWIFTEN_API JinglePayload : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; struct Reason : public Payload { enum Type { UnknownType, @@ -109,7 +109,7 @@ namespace Swift { this->payloads.push_back(content); } - void addPayload(boost::shared_ptr payload) { + void addPayload(std::shared_ptr payload) { this->payloads.push_back(payload); } @@ -117,15 +117,15 @@ namespace Swift { return getPayloads(); } - const std::vector > getPayloads() const { + const std::vector > getPayloads() const { return payloads; } template - const std::vector > getPayloads() const { - std::vector > matched_payloads; - for (std::vector >::const_iterator i = payloads.begin(); i != payloads.end(); ++i) { - boost::shared_ptr result = boost::dynamic_pointer_cast(*i); + const std::vector > getPayloads() const { + std::vector > matched_payloads; + for (std::vector >::const_iterator i = payloads.begin(); i != payloads.end(); ++i) { + std::shared_ptr result = std::dynamic_pointer_cast(*i); if (result) { matched_payloads.push_back(result); } @@ -136,10 +136,10 @@ namespace Swift { } template - const boost::shared_ptr getPayload() const { - boost::shared_ptr result; - for (std::vector >::const_iterator i = payloads.begin(); i != payloads.end(); ++i) { - result = boost::dynamic_pointer_cast(*i); + const std::shared_ptr getPayload() const { + std::shared_ptr result; + for (std::vector >::const_iterator i = payloads.begin(); i != payloads.end(); ++i) { + result = std::dynamic_pointer_cast(*i); if (result) { return result; } @@ -161,7 +161,7 @@ namespace Swift { JID initiator; JID responder; std::string sessionID; - std::vector > payloads; + std::vector > payloads; boost::optional reason; }; } diff --git a/Swiften/Elements/JingleS5BTransportPayload.h b/Swiften/Elements/JingleS5BTransportPayload.h index bb542f0..5e16243 100644 --- a/Swiften/Elements/JingleS5BTransportPayload.h +++ b/Swiften/Elements/JingleS5BTransportPayload.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -106,7 +105,7 @@ namespace Swift { return proxyError; } public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; private: Mode mode; diff --git a/Swiften/Elements/JingleTransportPayload.h b/Swiften/Elements/JingleTransportPayload.h index 12a08cd..d777213 100644 --- a/Swiften/Elements/JingleTransportPayload.h +++ b/Swiften/Elements/JingleTransportPayload.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -23,7 +23,7 @@ namespace Swift { } public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; private: std::string sessionID; diff --git a/Swiften/Elements/MAMFin.h b/Swiften/Elements/MAMFin.h index dd1f7bf..e5e719b 100644 --- a/Swiften/Elements/MAMFin.h +++ b/Swiften/Elements/MAMFin.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -37,11 +37,11 @@ namespace Swift { return isStable_; } - void setResultSet(boost::shared_ptr resultSet) { + void setResultSet(std::shared_ptr resultSet) { resultSet_ = resultSet; } - boost::shared_ptr getResultSet() const { + std::shared_ptr getResultSet() const { return resultSet_; } @@ -57,7 +57,7 @@ namespace Swift { private: bool isComplete_; bool isStable_; - boost::shared_ptr resultSet_; + std::shared_ptr resultSet_; boost::optional queryID_; }; } diff --git a/Swiften/Elements/MAMQuery.h b/Swiften/Elements/MAMQuery.h index 253fa0c..764c238 100644 --- a/Swiften/Elements/MAMQuery.h +++ b/Swiften/Elements/MAMQuery.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -27,16 +27,16 @@ namespace Swift { void setNode(const boost::optional& node) { node_ = node; } const boost::optional& getNode() const { return node_; } - void setForm(boost::shared_ptr form) { form_ = form; } - const boost::shared_ptr& getForm() const { return form_; } + void setForm(std::shared_ptr form) { form_ = form; } + const std::shared_ptr& getForm() const { return form_; } - void setResultSet(boost::shared_ptr resultSet) { resultSet_ = resultSet; } - const boost::shared_ptr& getResultSet() const { return resultSet_; } + void setResultSet(std::shared_ptr resultSet) { resultSet_ = resultSet; } + const std::shared_ptr& getResultSet() const { return resultSet_; } private: boost::optional queryID_; boost::optional node_; - boost::shared_ptr form_; - boost::shared_ptr resultSet_; + std::shared_ptr form_; + std::shared_ptr resultSet_; }; } diff --git a/Swiften/Elements/MUCAdminPayload.h b/Swiften/Elements/MUCAdminPayload.h index c9b01d9..3f78cc8 100644 --- a/Swiften/Elements/MUCAdminPayload.h +++ b/Swiften/Elements/MUCAdminPayload.h @@ -6,11 +6,11 @@ #pragma once +#include #include #include #include -#include #include #include @@ -21,7 +21,7 @@ namespace Swift { class SWIFTEN_API MUCAdminPayload : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; MUCAdminPayload() { diff --git a/Swiften/Elements/MUCDestroyPayload.h b/Swiften/Elements/MUCDestroyPayload.h index 80eb83e..ad1bda2 100644 --- a/Swiften/Elements/MUCDestroyPayload.h +++ b/Swiften/Elements/MUCDestroyPayload.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -15,7 +15,7 @@ namespace Swift { class SWIFTEN_API MUCDestroyPayload : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; MUCDestroyPayload() { } diff --git a/Swiften/Elements/MUCInvitationPayload.h b/Swiften/Elements/MUCInvitationPayload.h index 508a8ec..545e60f 100644 --- a/Swiften/Elements/MUCInvitationPayload.h +++ b/Swiften/Elements/MUCInvitationPayload.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -15,7 +15,7 @@ namespace Swift { class SWIFTEN_API MUCInvitationPayload : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; MUCInvitationPayload() : continuation_(false), impromptu_(false) { } diff --git a/Swiften/Elements/MUCOwnerPayload.h b/Swiften/Elements/MUCOwnerPayload.h index f75f677..5f3c633 100644 --- a/Swiften/Elements/MUCOwnerPayload.h +++ b/Swiften/Elements/MUCOwnerPayload.h @@ -15,24 +15,24 @@ namespace Swift { class SWIFTEN_API MUCOwnerPayload : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; MUCOwnerPayload() { } - boost::shared_ptr getPayload() const { + std::shared_ptr getPayload() const { return payload; } - void setPayload(boost::shared_ptr p) { + void setPayload(std::shared_ptr p) { payload = p; } Form::ref getForm() { - return boost::dynamic_pointer_cast(payload); + return std::dynamic_pointer_cast(payload); } private: - boost::shared_ptr payload; + std::shared_ptr payload; }; } diff --git a/Swiften/Elements/MUCPayload.h b/Swiften/Elements/MUCPayload.h index 8588ca2..6e199e5 100644 --- a/Swiften/Elements/MUCPayload.h +++ b/Swiften/Elements/MUCPayload.h @@ -18,7 +18,7 @@ namespace Swift { class SWIFTEN_API MUCPayload : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; MUCPayload() { maxChars_ = -1; diff --git a/Swiften/Elements/MUCUserPayload.h b/Swiften/Elements/MUCUserPayload.h index e83c2d0..dd57376 100644 --- a/Swiften/Elements/MUCUserPayload.h +++ b/Swiften/Elements/MUCUserPayload.h @@ -6,11 +6,11 @@ #pragma once +#include #include #include #include -#include #include #include @@ -21,7 +21,7 @@ namespace Swift { class SWIFTEN_API MUCUserPayload : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; struct StatusCode { StatusCode() : code(0) {} @@ -61,11 +61,11 @@ namespace Swift { const std::vector& getStatusCodes() const {return statusCodes_;} - boost::shared_ptr getPayload() const { + std::shared_ptr getPayload() const { return payload_; } - void setPayload(boost::shared_ptr p) { + void setPayload(std::shared_ptr p) { payload_ = p; } @@ -90,7 +90,7 @@ namespace Swift { private: std::vector items_; std::vector statusCodes_; - boost::shared_ptr payload_; + std::shared_ptr payload_; boost::optional password_; boost::optional invite_; }; diff --git a/Swiften/Elements/Message.h b/Swiften/Elements/Message.h index c55e04b..f276ef7 100644 --- a/Swiften/Elements/Message.h +++ b/Swiften/Elements/Message.h @@ -6,11 +6,10 @@ #pragma once +#include #include #include -#include -#include #include #include @@ -22,14 +21,14 @@ namespace Swift { class SWIFTEN_API Message : public Stanza { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum Type { Normal, Chat, Error, Groupchat, Headline }; Message() : type_(Chat) { } std::string getSubject() const { - boost::shared_ptr subject(getPayload()); + std::shared_ptr subject(getPayload()); if (subject) { return subject->getText(); } @@ -37,7 +36,7 @@ namespace Swift { } void setSubject(const std::string& subject) { - updatePayload(boost::make_shared(subject)); + updatePayload(std::make_shared(subject)); } // Explicitly convert to bool. In C++11, it would be cleaner to @@ -47,7 +46,7 @@ namespace Swift { } boost::optional getBody() const { - boost::shared_ptr body(getPayload()); + std::shared_ptr body(getPayload()); boost::optional bodyData; if (body) { bodyData = body->getText(); @@ -61,15 +60,15 @@ namespace Swift { void setBody(const boost::optional& body) { if (body) { - updatePayload(boost::make_shared(body.get())); + updatePayload(std::make_shared(body.get())); } else { - removePayloadOfSameType(boost::make_shared()); + removePayloadOfSameType(std::make_shared()); } } bool isError() { - boost::shared_ptr error(getPayload()); + std::shared_ptr error(getPayload()); return getType() == Message::Error || error; } diff --git a/Swiften/Elements/Payload.h b/Swiften/Elements/Payload.h index e31afa9..9923f0b 100644 --- a/Swiften/Elements/Payload.h +++ b/Swiften/Elements/Payload.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -14,7 +14,7 @@ namespace Swift { class SWIFTEN_API Payload : public Element { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: Payload() {} SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Payload) diff --git a/Swiften/Elements/Presence.cpp b/Swiften/Elements/Presence.cpp index 344efc1..f75f3be 100644 --- a/Swiften/Elements/Presence.cpp +++ b/Swiften/Elements/Presence.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -22,16 +22,16 @@ Presence::~Presence() { } int Presence::getPriority() const { - boost::shared_ptr priority(getPayload()); + std::shared_ptr priority(getPayload()); return (priority ? priority->getPriority() : 0); } void Presence::setPriority(int priority) { - updatePayload(boost::make_shared(priority)); + updatePayload(std::make_shared(priority)); } std::string Presence::getStatus() const { - boost::shared_ptr status(getPayload()); + std::shared_ptr status(getPayload()); if (status) { return status->getText(); } @@ -39,7 +39,7 @@ std::string Presence::getStatus() const { } void Presence::setStatus(const std::string& status) { - updatePayload(boost::make_shared(status)); + updatePayload(std::make_shared(status)); } } diff --git a/Swiften/Elements/Presence.h b/Swiften/Elements/Presence.h index 0b6ee5f..e658606 100644 --- a/Swiften/Elements/Presence.h +++ b/Swiften/Elements/Presence.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -15,7 +15,7 @@ namespace Swift { class SWIFTEN_API Presence : public Stanza { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum Type { Available, Error, Probe, Subscribe, Subscribed, Unavailable, Unsubscribe, Unsubscribed }; @@ -25,22 +25,22 @@ namespace Swift { virtual ~Presence(); static ref create() { - return boost::make_shared(); + return std::make_shared(); } static ref create(const std::string& status) { - return boost::make_shared(status); + return std::make_shared(status); } static ref create(Presence::ref presence) { - return boost::make_shared(*presence); + return std::make_shared(*presence); } Type getType() const { return type_; } void setType(Type type) { type_ = type; } StatusShow::Type getShow() const { - boost::shared_ptr show(getPayload()); + std::shared_ptr show(getPayload()); if (show) { return show->getType(); } @@ -48,7 +48,7 @@ namespace Swift { } void setShow(const StatusShow::Type &show) { - updatePayload(boost::make_shared(show)); + updatePayload(std::make_shared(show)); } std::string getStatus() const; @@ -57,8 +57,8 @@ namespace Swift { int getPriority() const; void setPriority(int priority); - boost::shared_ptr clone() const { - return boost::make_shared(*this); + std::shared_ptr clone() const { + return std::make_shared(*this); } bool isAvailable() const { diff --git a/Swiften/Elements/PrivateStorage.h b/Swiften/Elements/PrivateStorage.h index e1f97d5..dfae34c 100644 --- a/Swiften/Elements/PrivateStorage.h +++ b/Swiften/Elements/PrivateStorage.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 +#include #include #include @@ -14,18 +14,18 @@ namespace Swift { class SWIFTEN_API PrivateStorage : public Payload { public: - PrivateStorage(boost::shared_ptr payload = boost::shared_ptr()) : payload(payload) { + PrivateStorage(std::shared_ptr payload = std::shared_ptr()) : payload(payload) { } - boost::shared_ptr getPayload() const { + std::shared_ptr getPayload() const { return payload; } - void setPayload(boost::shared_ptr p) { + void setPayload(std::shared_ptr p) { payload = p; } private: - boost::shared_ptr payload; + std::shared_ptr payload; }; } diff --git a/Swiften/Elements/PubSubAffiliations.h b/Swiften/Elements/PubSubAffiliations.h index 9f66056..c7e22ce 100644 --- a/Swiften/Elements/PubSubAffiliations.h +++ b/Swiften/Elements/PubSubAffiliations.h @@ -6,11 +6,11 @@ #pragma once +#include #include #include #include -#include #include #include @@ -34,21 +34,21 @@ namespace Swift { this->node = value ; } - const std::vector< boost::shared_ptr >& getAffiliations() const { + const std::vector< std::shared_ptr >& getAffiliations() const { return affiliations; } - void setAffiliations(const std::vector< boost::shared_ptr >& value) { + void setAffiliations(const std::vector< std::shared_ptr >& value) { this->affiliations = value ; } - void addAffiliation(boost::shared_ptr value) { + void addAffiliation(std::shared_ptr value) { this->affiliations.push_back(value); } private: boost::optional< std::string > node; - std::vector< boost::shared_ptr > affiliations; + std::vector< std::shared_ptr > affiliations; }; } diff --git a/Swiften/Elements/PubSubConfigure.h b/Swiften/Elements/PubSubConfigure.h index e8f3cbc..8442198 100644 --- a/Swiften/Elements/PubSubConfigure.h +++ b/Swiften/Elements/PubSubConfigure.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,16 +21,16 @@ namespace Swift { virtual ~PubSubConfigure(); - boost::shared_ptr getData() const { + std::shared_ptr getData() const { return data; } - void setData(boost::shared_ptr value) { + void setData(std::shared_ptr value) { this->data = value ; } private: - boost::shared_ptr data; + std::shared_ptr data; }; } diff --git a/Swiften/Elements/PubSubCreate.h b/Swiften/Elements/PubSubCreate.h index b2226c4..5ece36e 100644 --- a/Swiften/Elements/PubSubCreate.h +++ b/Swiften/Elements/PubSubCreate.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -32,17 +31,17 @@ namespace Swift { this->node = value ; } - boost::shared_ptr getConfigure() const { + std::shared_ptr getConfigure() const { return configure; } - void setConfigure(boost::shared_ptr value) { + void setConfigure(std::shared_ptr value) { this->configure = value ; } private: std::string node; - boost::shared_ptr configure; + std::shared_ptr configure; }; } diff --git a/Swiften/Elements/PubSubEvent.h b/Swiften/Elements/PubSubEvent.h index 85d9bed..8f02258 100644 --- a/Swiften/Elements/PubSubEvent.h +++ b/Swiften/Elements/PubSubEvent.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include diff --git a/Swiften/Elements/PubSubEventCollection.h b/Swiften/Elements/PubSubEventCollection.h index 390fa58..61056e2 100644 --- a/Swiften/Elements/PubSubEventCollection.h +++ b/Swiften/Elements/PubSubEventCollection.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -34,26 +34,26 @@ namespace Swift { this->node = value ; } - boost::shared_ptr getDisassociate() const { + std::shared_ptr getDisassociate() const { return disassociate; } - void setDisassociate(boost::shared_ptr value) { + void setDisassociate(std::shared_ptr value) { this->disassociate = value ; } - boost::shared_ptr getAssociate() const { + std::shared_ptr getAssociate() const { return associate; } - void setAssociate(boost::shared_ptr value) { + void setAssociate(std::shared_ptr value) { this->associate = value ; } private: boost::optional< std::string > node; - boost::shared_ptr disassociate; - boost::shared_ptr associate; + std::shared_ptr disassociate; + std::shared_ptr associate; }; } diff --git a/Swiften/Elements/PubSubEventConfiguration.h b/Swiften/Elements/PubSubEventConfiguration.h index 14639ab..6c5305d 100644 --- a/Swiften/Elements/PubSubEventConfiguration.h +++ b/Swiften/Elements/PubSubEventConfiguration.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -32,17 +31,17 @@ namespace Swift { this->node = value ; } - boost::shared_ptr getData() const { + std::shared_ptr getData() const { return data; } - void setData(boost::shared_ptr value) { + void setData(std::shared_ptr value) { this->data = value ; } private: std::string node; - boost::shared_ptr data; + std::shared_ptr data; }; } diff --git a/Swiften/Elements/PubSubEventDelete.h b/Swiften/Elements/PubSubEventDelete.h index a778276..787dce0 100644 --- a/Swiften/Elements/PubSubEventDelete.h +++ b/Swiften/Elements/PubSubEventDelete.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -32,17 +31,17 @@ namespace Swift { this->node = value ; } - boost::shared_ptr getRedirects() const { + std::shared_ptr getRedirects() const { return redirects; } - void setRedirects(boost::shared_ptr value) { + void setRedirects(std::shared_ptr value) { this->redirects = value ; } private: std::string node; - boost::shared_ptr redirects; + std::shared_ptr redirects; }; } diff --git a/Swiften/Elements/PubSubEventItem.h b/Swiften/Elements/PubSubEventItem.h index bbadab9..50e8757 100644 --- a/Swiften/Elements/PubSubEventItem.h +++ b/Swiften/Elements/PubSubEventItem.h @@ -6,11 +6,11 @@ #pragma once +#include #include #include #include -#include #include #include @@ -40,15 +40,15 @@ namespace Swift { this->publisher = value ; } - const std::vector< boost::shared_ptr >& getData() const { + const std::vector< std::shared_ptr >& getData() const { return data; } - void setData(const std::vector< boost::shared_ptr >& value) { + void setData(const std::vector< std::shared_ptr >& value) { this->data = value ; } - void addData(boost::shared_ptr value) { + void addData(std::shared_ptr value) { this->data.push_back(value); } @@ -64,7 +64,7 @@ namespace Swift { private: boost::optional< std::string > node; boost::optional< std::string > publisher; - std::vector< boost::shared_ptr > data; + std::vector< std::shared_ptr > data; boost::optional< std::string > id; }; } diff --git a/Swiften/Elements/PubSubEventItems.h b/Swiften/Elements/PubSubEventItems.h index 9d1e09b..48fd340 100644 --- a/Swiften/Elements/PubSubEventItems.h +++ b/Swiften/Elements/PubSubEventItems.h @@ -6,11 +6,10 @@ #pragma once +#include #include #include -#include - #include #include #include @@ -34,34 +33,34 @@ namespace Swift { this->node = value ; } - const std::vector< boost::shared_ptr >& getItems() const { + const std::vector< std::shared_ptr >& getItems() const { return items; } - void setItems(const std::vector< boost::shared_ptr >& value) { + void setItems(const std::vector< std::shared_ptr >& value) { this->items = value ; } - void addItem(boost::shared_ptr value) { + void addItem(std::shared_ptr value) { this->items.push_back(value); } - const std::vector< boost::shared_ptr >& getRetracts() const { + const std::vector< std::shared_ptr >& getRetracts() const { return retracts; } - void setRetracts(const std::vector< boost::shared_ptr >& value) { + void setRetracts(const std::vector< std::shared_ptr >& value) { this->retracts = value ; } - void addRetract(boost::shared_ptr value) { + void addRetract(std::shared_ptr value) { this->retracts.push_back(value); } private: std::string node; - std::vector< boost::shared_ptr > items; - std::vector< boost::shared_ptr > retracts; + std::vector< std::shared_ptr > items; + std::vector< std::shared_ptr > retracts; }; } diff --git a/Swiften/Elements/PubSubItem.h b/Swiften/Elements/PubSubItem.h index 5a16edc..d424ae4 100644 --- a/Swiften/Elements/PubSubItem.h +++ b/Swiften/Elements/PubSubItem.h @@ -6,11 +6,10 @@ #pragma once +#include #include #include -#include - #include #include #include @@ -23,15 +22,15 @@ namespace Swift { virtual ~PubSubItem(); - const std::vector< boost::shared_ptr >& getData() const { + const std::vector< std::shared_ptr >& getData() const { return data; } - void setData(const std::vector< boost::shared_ptr >& value) { + void setData(const std::vector< std::shared_ptr >& value) { this->data = value ; } - void addData(boost::shared_ptr value) { + void addData(std::shared_ptr value) { this->data.push_back(value); } @@ -45,7 +44,7 @@ namespace Swift { private: - std::vector< boost::shared_ptr > data; + std::vector< std::shared_ptr > data; std::string id; }; } diff --git a/Swiften/Elements/PubSubItems.h b/Swiften/Elements/PubSubItems.h index b7d8fcc..9903075 100644 --- a/Swiften/Elements/PubSubItems.h +++ b/Swiften/Elements/PubSubItems.h @@ -6,11 +6,11 @@ #pragma once +#include #include #include #include -#include #include #include @@ -34,15 +34,15 @@ namespace Swift { this->node = value ; } - const std::vector< boost::shared_ptr >& getItems() const { + const std::vector< std::shared_ptr >& getItems() const { return items; } - void setItems(const std::vector< boost::shared_ptr >& value) { + void setItems(const std::vector< std::shared_ptr >& value) { this->items = value ; } - void addItem(boost::shared_ptr value) { + void addItem(std::shared_ptr value) { this->items.push_back(value); } @@ -65,7 +65,7 @@ namespace Swift { private: std::string node; - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; boost::optional< unsigned int > maximumItems; boost::optional< std::string > subscriptionID; }; diff --git a/Swiften/Elements/PubSubOptions.h b/Swiften/Elements/PubSubOptions.h index fffc175..2b312a7 100644 --- a/Swiften/Elements/PubSubOptions.h +++ b/Swiften/Elements/PubSubOptions.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -42,11 +42,11 @@ namespace Swift { this->jid = value ; } - boost::shared_ptr getData() const { + std::shared_ptr getData() const { return data; } - void setData(boost::shared_ptr value) { + void setData(std::shared_ptr value) { this->data = value ; } @@ -62,7 +62,7 @@ namespace Swift { private: std::string node; JID jid; - boost::shared_ptr data; + std::shared_ptr data; boost::optional< std::string > subscriptionID; }; } diff --git a/Swiften/Elements/PubSubOwnerAffiliations.h b/Swiften/Elements/PubSubOwnerAffiliations.h index 5005b01..f1085bb 100644 --- a/Swiften/Elements/PubSubOwnerAffiliations.h +++ b/Swiften/Elements/PubSubOwnerAffiliations.h @@ -6,11 +6,10 @@ #pragma once +#include #include #include -#include - #include #include #include @@ -33,21 +32,21 @@ namespace Swift { this->node = value ; } - const std::vector< boost::shared_ptr >& getAffiliations() const { + const std::vector< std::shared_ptr >& getAffiliations() const { return affiliations; } - void setAffiliations(const std::vector< boost::shared_ptr >& value) { + void setAffiliations(const std::vector< std::shared_ptr >& value) { this->affiliations = value ; } - void addAffiliation(boost::shared_ptr value) { + void addAffiliation(std::shared_ptr value) { this->affiliations.push_back(value); } private: std::string node; - std::vector< boost::shared_ptr > affiliations; + std::vector< std::shared_ptr > affiliations; }; } diff --git a/Swiften/Elements/PubSubOwnerConfigure.h b/Swiften/Elements/PubSubOwnerConfigure.h index 086095c..7dcf792 100644 --- a/Swiften/Elements/PubSubOwnerConfigure.h +++ b/Swiften/Elements/PubSubOwnerConfigure.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -33,17 +33,17 @@ namespace Swift { this->node = value ; } - boost::shared_ptr getData() const { + std::shared_ptr getData() const { return data; } - void setData(boost::shared_ptr value) { + void setData(std::shared_ptr value) { this->data = value ; } private: boost::optional< std::string > node; - boost::shared_ptr data; + std::shared_ptr data; }; } diff --git a/Swiften/Elements/PubSubOwnerDefault.h b/Swiften/Elements/PubSubOwnerDefault.h index a0b82f7..322f47a 100644 --- a/Swiften/Elements/PubSubOwnerDefault.h +++ b/Swiften/Elements/PubSubOwnerDefault.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -22,16 +22,16 @@ namespace Swift { virtual ~PubSubOwnerDefault(); - boost::shared_ptr getData() const { + std::shared_ptr getData() const { return data; } - void setData(boost::shared_ptr value) { + void setData(std::shared_ptr value) { this->data = value ; } private: - boost::shared_ptr data; + std::shared_ptr data; }; } diff --git a/Swiften/Elements/PubSubOwnerDelete.h b/Swiften/Elements/PubSubOwnerDelete.h index 7f908a1..7cc5d79 100644 --- a/Swiften/Elements/PubSubOwnerDelete.h +++ b/Swiften/Elements/PubSubOwnerDelete.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -32,17 +31,17 @@ namespace Swift { this->node = value ; } - boost::shared_ptr getRedirect() const { + std::shared_ptr getRedirect() const { return redirect; } - void setRedirect(boost::shared_ptr value) { + void setRedirect(std::shared_ptr value) { this->redirect = value ; } private: std::string node; - boost::shared_ptr redirect; + std::shared_ptr redirect; }; } diff --git a/Swiften/Elements/PubSubOwnerSubscriptions.h b/Swiften/Elements/PubSubOwnerSubscriptions.h index 44c31b8..ec5aa17 100644 --- a/Swiften/Elements/PubSubOwnerSubscriptions.h +++ b/Swiften/Elements/PubSubOwnerSubscriptions.h @@ -6,11 +6,10 @@ #pragma once +#include #include #include -#include - #include #include #include @@ -33,21 +32,21 @@ namespace Swift { this->node = value ; } - const std::vector< boost::shared_ptr >& getSubscriptions() const { + const std::vector< std::shared_ptr >& getSubscriptions() const { return subscriptions; } - void setSubscriptions(const std::vector< boost::shared_ptr >& value) { + void setSubscriptions(const std::vector< std::shared_ptr >& value) { this->subscriptions = value ; } - void addSubscription(boost::shared_ptr value) { + void addSubscription(std::shared_ptr value) { this->subscriptions.push_back(value); } private: std::string node; - std::vector< boost::shared_ptr > subscriptions; + std::vector< std::shared_ptr > subscriptions; }; } diff --git a/Swiften/Elements/PubSubPublish.h b/Swiften/Elements/PubSubPublish.h index a6fca8d..dff099b 100644 --- a/Swiften/Elements/PubSubPublish.h +++ b/Swiften/Elements/PubSubPublish.h @@ -6,11 +6,10 @@ #pragma once +#include #include #include -#include - #include #include #include @@ -33,21 +32,21 @@ namespace Swift { this->node = value ; } - const std::vector< boost::shared_ptr >& getItems() const { + const std::vector< std::shared_ptr >& getItems() const { return items; } - void setItems(const std::vector< boost::shared_ptr >& value) { + void setItems(const std::vector< std::shared_ptr >& value) { this->items = value ; } - void addItem(boost::shared_ptr value) { + void addItem(std::shared_ptr value) { this->items.push_back(value); } private: std::string node; - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; }; } diff --git a/Swiften/Elements/PubSubRetract.h b/Swiften/Elements/PubSubRetract.h index 60ceb28..0d30c31 100644 --- a/Swiften/Elements/PubSubRetract.h +++ b/Swiften/Elements/PubSubRetract.h @@ -6,11 +6,10 @@ #pragma once +#include #include #include -#include - #include #include #include @@ -33,15 +32,15 @@ namespace Swift { this->node = value ; } - const std::vector< boost::shared_ptr >& getItems() const { + const std::vector< std::shared_ptr >& getItems() const { return items; } - void setItems(const std::vector< boost::shared_ptr >& value) { + void setItems(const std::vector< std::shared_ptr >& value) { this->items = value ; } - void addItem(boost::shared_ptr value) { + void addItem(std::shared_ptr value) { this->items.push_back(value); } @@ -56,7 +55,7 @@ namespace Swift { private: std::string node; - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; bool notify; }; } diff --git a/Swiften/Elements/PubSubSubscribe.h b/Swiften/Elements/PubSubSubscribe.h index 8c57a21..a4c0b68 100644 --- a/Swiften/Elements/PubSubSubscribe.h +++ b/Swiften/Elements/PubSubSubscribe.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -42,11 +42,11 @@ namespace Swift { this->jid = value ; } - boost::shared_ptr getOptions() const { + std::shared_ptr getOptions() const { return options; } - void setOptions(boost::shared_ptr value) { + void setOptions(std::shared_ptr value) { this->options = value ; } @@ -54,6 +54,6 @@ namespace Swift { private: boost::optional< std::string > node; JID jid; - boost::shared_ptr options; + std::shared_ptr options; }; } diff --git a/Swiften/Elements/PubSubSubscription.h b/Swiften/Elements/PubSubSubscription.h index 5bb1194..e2b527f 100644 --- a/Swiften/Elements/PubSubSubscription.h +++ b/Swiften/Elements/PubSubSubscription.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -56,11 +56,11 @@ namespace Swift { this->jid = value ; } - boost::shared_ptr getOptions() const { + std::shared_ptr getOptions() const { return options; } - void setOptions(boost::shared_ptr value) { + void setOptions(std::shared_ptr value) { this->options = value ; } @@ -77,7 +77,7 @@ namespace Swift { boost::optional< std::string > node; boost::optional< std::string > subscriptionID; JID jid; - boost::shared_ptr options; + std::shared_ptr options; SubscriptionType subscription; }; } diff --git a/Swiften/Elements/PubSubSubscriptions.h b/Swiften/Elements/PubSubSubscriptions.h index 63fc402..441e6c1 100644 --- a/Swiften/Elements/PubSubSubscriptions.h +++ b/Swiften/Elements/PubSubSubscriptions.h @@ -6,11 +6,11 @@ #pragma once +#include #include #include #include -#include #include #include @@ -34,21 +34,21 @@ namespace Swift { this->node = value ; } - const std::vector< boost::shared_ptr >& getSubscriptions() const { + const std::vector< std::shared_ptr >& getSubscriptions() const { return subscriptions; } - void setSubscriptions(const std::vector< boost::shared_ptr >& value) { + void setSubscriptions(const std::vector< std::shared_ptr >& value) { this->subscriptions = value ; } - void addSubscription(boost::shared_ptr value) { + void addSubscription(std::shared_ptr value) { this->subscriptions.push_back(value); } private: boost::optional< std::string > node; - std::vector< boost::shared_ptr > subscriptions; + std::vector< std::shared_ptr > subscriptions; }; } diff --git a/Swiften/Elements/Replace.h b/Swiften/Elements/Replace.h index b64777f..d51981d 100644 --- a/Swiften/Elements/Replace.h +++ b/Swiften/Elements/Replace.h @@ -12,17 +12,16 @@ #pragma once +#include #include -#include - #include #include namespace Swift { class SWIFTEN_API Replace : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; Replace(const std::string& id = std::string()) : replaceID_(id) {} const std::string& getID() const { return replaceID_; diff --git a/Swiften/Elements/ResultSet.h b/Swiften/Elements/ResultSet.h index 44995d1..c8e59d4 100644 --- a/Swiften/Elements/ResultSet.h +++ b/Swiften/Elements/ResultSet.h @@ -6,6 +6,8 @@ #pragma once +#include + #include #include diff --git a/Swiften/Elements/RosterItemExchangePayload.h b/Swiften/Elements/RosterItemExchangePayload.h index 5090aff..fc61f3d 100644 --- a/Swiften/Elements/RosterItemExchangePayload.h +++ b/Swiften/Elements/RosterItemExchangePayload.h @@ -12,11 +12,10 @@ #pragma once +#include #include #include -#include - #include #include #include @@ -24,7 +23,7 @@ namespace Swift { class SWIFTEN_API RosterItemExchangePayload : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; class SWIFTEN_API Item { public: diff --git a/Swiften/Elements/RosterPayload.h b/Swiften/Elements/RosterPayload.h index 35e81cd..5fc6bd1 100644 --- a/Swiften/Elements/RosterPayload.h +++ b/Swiften/Elements/RosterPayload.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -18,7 +18,7 @@ namespace Swift { class SWIFTEN_API RosterPayload : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; typedef std::vector RosterItemPayloads; public: diff --git a/Swiften/Elements/S5BProxyRequest.h b/Swiften/Elements/S5BProxyRequest.h index cbc7d5b..e3f5206 100644 --- a/Swiften/Elements/S5BProxyRequest.h +++ b/Swiften/Elements/S5BProxyRequest.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -25,7 +25,7 @@ namespace Swift { class SWIFTEN_API S5BProxyRequest : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: struct StreamHost { diff --git a/Swiften/Elements/SearchPayload.h b/Swiften/Elements/SearchPayload.h index 6784291..0fcb2b1 100644 --- a/Swiften/Elements/SearchPayload.h +++ b/Swiften/Elements/SearchPayload.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -21,7 +21,7 @@ namespace Swift { */ class SWIFTEN_API SearchPayload : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; struct Item { std::string first; diff --git a/Swiften/Elements/SecurityLabelsCatalog.h b/Swiften/Elements/SecurityLabelsCatalog.h index 8e6db64..ba4d294 100644 --- a/Swiften/Elements/SecurityLabelsCatalog.h +++ b/Swiften/Elements/SecurityLabelsCatalog.h @@ -6,11 +6,10 @@ #pragma once +#include #include #include -#include - #include #include #include @@ -19,15 +18,15 @@ namespace Swift { class SWIFTEN_API SecurityLabelsCatalog : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; class Item { public: Item() : default_(false) {} - boost::shared_ptr getLabel() const { + std::shared_ptr getLabel() const { return label_; } - void setLabel(boost::shared_ptr label) { + void setLabel(std::shared_ptr label) { label_ = label; } @@ -43,7 +42,7 @@ namespace Swift { default_ = isDefault; } private: - boost::shared_ptr label_; + std::shared_ptr label_; std::string selector_; bool default_; }; diff --git a/Swiften/Elements/SoftwareVersion.h b/Swiften/Elements/SoftwareVersion.h index 57318b9..2bf582e 100644 --- a/Swiften/Elements/SoftwareVersion.h +++ b/Swiften/Elements/SoftwareVersion.h @@ -6,17 +6,16 @@ #pragma once +#include #include -#include - #include #include namespace Swift { class SWIFTEN_API SoftwareVersion : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; SoftwareVersion( const std::string& name = "", diff --git a/Swiften/Elements/Stanza.cpp b/Swiften/Elements/Stanza.cpp index 617be4e..5d1229c 100644 --- a/Swiften/Elements/Stanza.cpp +++ b/Swiften/Elements/Stanza.cpp @@ -22,8 +22,8 @@ Stanza::~Stanza() { payloads_.clear(); } -void Stanza::updatePayload(boost::shared_ptr payload) { - foreach (boost::shared_ptr& i, payloads_) { +void Stanza::updatePayload(std::shared_ptr payload) { + foreach (std::shared_ptr& i, payloads_) { if (typeid(*i.get()) == typeid(*payload.get())) { i = payload; return; @@ -32,32 +32,32 @@ void Stanza::updatePayload(boost::shared_ptr payload) { addPayload(payload); } -static bool sameType(boost::shared_ptr a, boost::shared_ptr b) { +static bool sameType(std::shared_ptr a, std::shared_ptr b) { return typeid(*a.get()) == typeid(*b.get()); } -void Stanza::removePayloadOfSameType(boost::shared_ptr payload) { +void Stanza::removePayloadOfSameType(std::shared_ptr payload) { payloads_.erase(std::remove_if(payloads_.begin(), payloads_.end(), boost::bind(&sameType, payload, _1)), payloads_.end()); } -boost::shared_ptr Stanza::getPayloadOfSameType(boost::shared_ptr payload) const { - foreach (const boost::shared_ptr& i, payloads_) { +std::shared_ptr Stanza::getPayloadOfSameType(std::shared_ptr payload) const { + foreach (const std::shared_ptr& i, payloads_) { if (typeid(*i.get()) == typeid(*payload.get())) { return i; } } - return boost::shared_ptr(); + return std::shared_ptr(); } boost::optional Stanza::getTimestamp() const { - boost::shared_ptr delay = getPayload(); + std::shared_ptr delay = getPayload(); return delay ? delay->getStamp() : boost::optional(); } boost::optional Stanza::getTimestampFrom(const JID& jid) const { - std::vector< boost::shared_ptr > delays = getPayloads(); + std::vector< std::shared_ptr > delays = getPayloads(); for (size_t i = 0; i < delays.size(); ++i) { if (delays[i]->getFrom() == jid) { return delays[i]->getStamp(); diff --git a/Swiften/Elements/Stanza.h b/Swiften/Elements/Stanza.h index 765aca8..2df64a1 100644 --- a/Swiften/Elements/Stanza.h +++ b/Swiften/Elements/Stanza.h @@ -6,12 +6,12 @@ #pragma once +#include #include #include #include #include -#include #include #include @@ -22,7 +22,7 @@ namespace Swift { class SWIFTEN_API Stanza : public ToplevelElement { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; protected: Stanza(); @@ -32,21 +32,21 @@ namespace Swift { SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Stanza) template - boost::shared_ptr getPayload() const { + std::shared_ptr getPayload() const { for (size_t i = 0; i < payloads_.size(); ++i) { - boost::shared_ptr result(boost::dynamic_pointer_cast(payloads_[i])); + std::shared_ptr result(std::dynamic_pointer_cast(payloads_[i])); if (result) { return result; } } - return boost::shared_ptr(); + return std::shared_ptr(); } template - std::vector< boost::shared_ptr > getPayloads() const { - std::vector< boost::shared_ptr > results; + std::vector< std::shared_ptr > getPayloads() const { + std::vector< std::shared_ptr > results; for (size_t i = 0; i < payloads_.size(); ++i) { - boost::shared_ptr result(boost::dynamic_pointer_cast(payloads_[i])); + std::shared_ptr result(std::dynamic_pointer_cast(payloads_[i])); if (result) { results.push_back(result); } @@ -55,11 +55,11 @@ namespace Swift { } - const std::vector< boost::shared_ptr >& getPayloads() const { + const std::vector< std::shared_ptr >& getPayloads() const { return payloads_; } - void addPayload(boost::shared_ptr payload) { + void addPayload(std::shared_ptr payload) { payloads_.push_back(payload); } @@ -68,10 +68,10 @@ namespace Swift { payloads_.insert(payloads_.end(), begin, end); } - void updatePayload(boost::shared_ptr payload); + void updatePayload(std::shared_ptr payload); - void removePayloadOfSameType(boost::shared_ptr); - boost::shared_ptr getPayloadOfSameType(boost::shared_ptr) const; + void removePayloadOfSameType(std::shared_ptr); + std::shared_ptr getPayloadOfSameType(std::shared_ptr) const; const JID& getFrom() const { return from_; } void setFrom(const JID& from) { from_ = from; } @@ -91,6 +91,6 @@ namespace Swift { std::string id_; JID from_; JID to_; - std::vector< boost::shared_ptr > payloads_; + std::vector< std::shared_ptr > payloads_; }; } diff --git a/Swiften/Elements/StanzaAck.h b/Swiften/Elements/StanzaAck.h index 45680c0..68f0a2f 100644 --- a/Swiften/Elements/StanzaAck.h +++ b/Swiften/Elements/StanzaAck.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 +#include #include #include @@ -14,7 +14,7 @@ namespace Swift { class SWIFTEN_API StanzaAck : public ToplevelElement { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; StanzaAck() : valid(false), handledStanzasCount(0) {} StanzaAck(unsigned int handledStanzasCount) : valid(true), handledStanzasCount(handledStanzasCount) {} diff --git a/Swiften/Elements/StreamError.h b/Swiften/Elements/StreamError.h index ce57134..aa294fd 100644 --- a/Swiften/Elements/StreamError.h +++ b/Swiften/Elements/StreamError.h @@ -6,17 +6,16 @@ #pragma once +#include #include -#include - #include #include namespace Swift { class SWIFTEN_API StreamError : public ToplevelElement { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum Type { BadFormat, diff --git a/Swiften/Elements/StreamFeatures.h b/Swiften/Elements/StreamFeatures.h index 1d07a16..5832a24 100644 --- a/Swiften/Elements/StreamFeatures.h +++ b/Swiften/Elements/StreamFeatures.h @@ -6,11 +6,11 @@ #pragma once +#include #include #include #include -#include #include #include @@ -18,7 +18,7 @@ namespace Swift { class SWIFTEN_API StreamFeatures : public ToplevelElement { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; StreamFeatures() : hasStartTLS_(false), hasResourceBind_(false), hasSession_(false), hasStreamManagement_(false), hasRosterVersioning_(false) {} diff --git a/Swiften/Elements/StreamInitiation.h b/Swiften/Elements/StreamInitiation.h index cd37974..2bb9a0e 100644 --- a/Swiften/Elements/StreamInitiation.h +++ b/Swiften/Elements/StreamInitiation.h @@ -6,11 +6,11 @@ #pragma once +#include #include #include #include -#include #include #include @@ -19,7 +19,7 @@ namespace Swift { class SWIFTEN_API StreamInitiation : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; StreamInitiation() : isFileTransfer(true) {} diff --git a/Swiften/Elements/StreamInitiationFileInfo.h b/Swiften/Elements/StreamInitiationFileInfo.h index 11bd4c5..f2dc5b9 100644 --- a/Swiften/Elements/StreamInitiationFileInfo.h +++ b/Swiften/Elements/StreamInitiationFileInfo.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -18,7 +18,7 @@ namespace Swift { class SWIFTEN_API StreamInitiationFileInfo : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: StreamInitiationFileInfo(const std::string& name = "", const std::string& description = "", unsigned long long size = 0, diff --git a/Swiften/Elements/UnitTest/FormTest.cpp b/Swiften/Elements/UnitTest/FormTest.cpp index 9255fa8..c728bde 100644 --- a/Swiften/Elements/UnitTest/FormTest.cpp +++ b/Swiften/Elements/UnitTest/FormTest.cpp @@ -4,8 +4,7 @@ * See the COPYING file for more information. */ -#include -#include +#include #include #include @@ -25,13 +24,13 @@ class FormTest : public CppUnit::TestFixture { void testGetFormType() { Form form; - form.addField(boost::make_shared(FormField::FixedType, "Foo")); + form.addField(std::make_shared(FormField::FixedType, "Foo")); - FormField::ref field = boost::make_shared(FormField::HiddenType, "jabber:bot"); + FormField::ref field = std::make_shared(FormField::HiddenType, "jabber:bot"); field->setName("FORM_TYPE"); form.addField(field); - form.addField(boost::make_shared(FormField::FixedType, "Bar")); + form.addField(std::make_shared(FormField::FixedType, "Bar")); CPPUNIT_ASSERT_EQUAL(std::string("jabber:bot"), form.getFormType()); } @@ -39,7 +38,7 @@ class FormTest : public CppUnit::TestFixture { void testGetFormType_InvalidFormType() { Form form; - FormField::ref field = boost::make_shared(FormField::FixedType, "jabber:bot"); + FormField::ref field = std::make_shared(FormField::FixedType, "jabber:bot"); field->setName("FORM_TYPE"); form.addField(field); @@ -49,7 +48,7 @@ class FormTest : public CppUnit::TestFixture { void testGetFormType_NoFormType() { Form form; - form.addField(boost::make_shared(FormField::FixedType, "Foo")); + form.addField(std::make_shared(FormField::FixedType, "Foo")); CPPUNIT_ASSERT_EQUAL(std::string(""), form.getFormType()); } diff --git a/Swiften/Elements/UnitTest/IQTest.cpp b/Swiften/Elements/UnitTest/IQTest.cpp index a88e2d6..ed98c75 100644 --- a/Swiften/Elements/UnitTest/IQTest.cpp +++ b/Swiften/Elements/UnitTest/IQTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -26,8 +26,8 @@ class IQTest : public CppUnit::TestFixture IQTest() {} void testCreateResult() { - boost::shared_ptr payload(new SoftwareVersion("myclient")); - boost::shared_ptr iq(IQ::createResult(JID("foo@bar/fum"), "myid", payload)); + std::shared_ptr payload(new SoftwareVersion("myclient")); + std::shared_ptr iq(IQ::createResult(JID("foo@bar/fum"), "myid", payload)); CPPUNIT_ASSERT_EQUAL(JID("foo@bar/fum"), iq->getTo()); CPPUNIT_ASSERT_EQUAL(std::string("myid"), iq->getID()); @@ -36,7 +36,7 @@ class IQTest : public CppUnit::TestFixture } void testCreateResult_WithoutPayload() { - boost::shared_ptr iq(IQ::createResult(JID("foo@bar/fum"), "myid")); + std::shared_ptr iq(IQ::createResult(JID("foo@bar/fum"), "myid")); CPPUNIT_ASSERT_EQUAL(JID("foo@bar/fum"), iq->getTo()); CPPUNIT_ASSERT_EQUAL(std::string("myid"), iq->getID()); @@ -44,11 +44,11 @@ class IQTest : public CppUnit::TestFixture } void testCreateError() { - boost::shared_ptr iq(IQ::createError(JID("foo@bar/fum"), "myid", ErrorPayload::BadRequest, ErrorPayload::Modify)); + std::shared_ptr iq(IQ::createError(JID("foo@bar/fum"), "myid", ErrorPayload::BadRequest, ErrorPayload::Modify)); CPPUNIT_ASSERT_EQUAL(JID("foo@bar/fum"), iq->getTo()); CPPUNIT_ASSERT_EQUAL(std::string("myid"), iq->getID()); - boost::shared_ptr error(iq->getPayload()); + std::shared_ptr error(iq->getPayload()); CPPUNIT_ASSERT(error); CPPUNIT_ASSERT_EQUAL(ErrorPayload::BadRequest, error->getCondition()); CPPUNIT_ASSERT_EQUAL(ErrorPayload::Modify, error->getType()); diff --git a/Swiften/Elements/UnitTest/StanzaTest.cpp b/Swiften/Elements/UnitTest/StanzaTest.cpp index 13c038c..6a45bd8 100644 --- a/Swiften/Elements/UnitTest/StanzaTest.cpp +++ b/Swiften/Elements/UnitTest/StanzaTest.cpp @@ -4,8 +4,9 @@ * See the COPYING file for more information. */ +#include + #include -#include #include #include @@ -70,8 +71,8 @@ class StanzaTest : public CppUnit::TestFixture void testConstructor_Copy() { Message m; - m.addPayload(boost::make_shared()); - m.addPayload(boost::make_shared()); + m.addPayload(std::make_shared()); + m.addPayload(std::make_shared()); Message copy(m); CPPUNIT_ASSERT(copy.getPayload()); @@ -82,7 +83,7 @@ class StanzaTest : public CppUnit::TestFixture bool payloadAlive = true; { Message m; - m.addPayload(boost::make_shared(&payloadAlive)); + m.addPayload(std::make_shared(&payloadAlive)); } CPPUNIT_ASSERT(!payloadAlive); @@ -91,7 +92,7 @@ class StanzaTest : public CppUnit::TestFixture void testDestructor_Copy() { bool payloadAlive = true; Message* m1 = new Message(); - m1->addPayload(boost::make_shared(&payloadAlive)); + m1->addPayload(std::make_shared(&payloadAlive)); Message* m2 = new Message(*m1); delete m1; @@ -103,30 +104,30 @@ class StanzaTest : public CppUnit::TestFixture void testGetPayload() { Message m; - m.addPayload(boost::make_shared()); - m.addPayload(boost::make_shared()); - m.addPayload(boost::make_shared()); + m.addPayload(std::make_shared()); + m.addPayload(std::make_shared()); + m.addPayload(std::make_shared()); - boost::shared_ptr p(m.getPayload()); + std::shared_ptr p(m.getPayload()); CPPUNIT_ASSERT(p); } void testGetPayload_NoSuchPayload() { Message m; - m.addPayload(boost::make_shared()); - m.addPayload(boost::make_shared()); + m.addPayload(std::make_shared()); + m.addPayload(std::make_shared()); - boost::shared_ptr p(m.getPayload()); + std::shared_ptr p(m.getPayload()); CPPUNIT_ASSERT(!p); } void testGetPayloads() { Message m; - boost::shared_ptr payload1(new MyPayload2()); - boost::shared_ptr payload2(new MyPayload2()); - m.addPayload(boost::make_shared()); + std::shared_ptr payload1(new MyPayload2()); + std::shared_ptr payload2(new MyPayload2()); + m.addPayload(std::make_shared()); m.addPayload(payload1); - m.addPayload(boost::make_shared()); + m.addPayload(std::make_shared()); m.addPayload(payload2); CPPUNIT_ASSERT_EQUAL(static_cast(2), m.getPayloads().size()); @@ -137,51 +138,51 @@ class StanzaTest : public CppUnit::TestFixture void testUpdatePayload_ExistingPayload() { Message m; - m.addPayload(boost::make_shared()); - m.addPayload(boost::make_shared("foo")); - m.addPayload(boost::make_shared()); + m.addPayload(std::make_shared()); + m.addPayload(std::make_shared("foo")); + m.addPayload(std::make_shared()); - m.updatePayload(boost::make_shared("bar")); + m.updatePayload(std::make_shared("bar")); CPPUNIT_ASSERT_EQUAL(static_cast(3), m.getPayloads().size()); - boost::shared_ptr p(m.getPayload()); + std::shared_ptr p(m.getPayload()); CPPUNIT_ASSERT_EQUAL(std::string("bar"), p->text_); } void testUpdatePayload_NewPayload() { Message m; - m.addPayload(boost::make_shared()); - m.addPayload(boost::make_shared()); + m.addPayload(std::make_shared()); + m.addPayload(std::make_shared()); - m.updatePayload(boost::make_shared("bar")); + m.updatePayload(std::make_shared("bar")); CPPUNIT_ASSERT_EQUAL(static_cast(3), m.getPayloads().size()); - boost::shared_ptr p(m.getPayload()); + std::shared_ptr p(m.getPayload()); CPPUNIT_ASSERT_EQUAL(std::string("bar"), p->text_); } void testGetPayloadOfSameType() { Message m; - m.addPayload(boost::make_shared()); - m.addPayload(boost::make_shared("foo")); - m.addPayload(boost::make_shared()); + m.addPayload(std::make_shared()); + m.addPayload(std::make_shared("foo")); + m.addPayload(std::make_shared()); - boost::shared_ptr payload(boost::dynamic_pointer_cast(m.getPayloadOfSameType(boost::make_shared("bar")))); + std::shared_ptr payload(std::dynamic_pointer_cast(m.getPayloadOfSameType(std::make_shared("bar")))); CPPUNIT_ASSERT(payload); CPPUNIT_ASSERT_EQUAL(std::string("foo"), payload->text_); } void testGetPayloadOfSameType_NoSuchPayload() { Message m; - m.addPayload(boost::make_shared()); - m.addPayload(boost::make_shared()); + m.addPayload(std::make_shared()); + m.addPayload(std::make_shared()); - CPPUNIT_ASSERT(!m.getPayloadOfSameType(boost::make_shared("bar"))); + CPPUNIT_ASSERT(!m.getPayloadOfSameType(std::make_shared("bar"))); } void testGetTimestamp() { Message m; - m.addPayload(boost::make_shared(boost::posix_time::from_time_t(1))); + m.addPayload(std::make_shared(boost::posix_time::from_time_t(1))); boost::optional timestamp = m.getTimestamp(); @@ -191,7 +192,7 @@ class StanzaTest : public CppUnit::TestFixture void testGetTimestamp_TimestampWithFrom() { Message m; - m.addPayload(boost::make_shared(boost::posix_time::from_time_t(1), JID("foo@bar.com"))); + m.addPayload(std::make_shared(boost::posix_time::from_time_t(1), JID("foo@bar.com"))); boost::optional timestamp = m.getTimestamp(); @@ -206,10 +207,10 @@ class StanzaTest : public CppUnit::TestFixture void testGetTimestampFrom() { Message m; - m.addPayload(boost::make_shared(boost::posix_time::from_time_t(0))); - m.addPayload(boost::make_shared(boost::posix_time::from_time_t(1), JID("foo1@bar.com"))); - m.addPayload(boost::make_shared(boost::posix_time::from_time_t(2), JID("foo2@bar.com"))); - m.addPayload(boost::make_shared(boost::posix_time::from_time_t(3), JID("foo3@bar.com"))); + m.addPayload(std::make_shared(boost::posix_time::from_time_t(0))); + m.addPayload(std::make_shared(boost::posix_time::from_time_t(1), JID("foo1@bar.com"))); + m.addPayload(std::make_shared(boost::posix_time::from_time_t(2), JID("foo2@bar.com"))); + m.addPayload(std::make_shared(boost::posix_time::from_time_t(3), JID("foo3@bar.com"))); boost::optional timestamp = m.getTimestampFrom(JID("foo2@bar.com")); @@ -219,8 +220,8 @@ class StanzaTest : public CppUnit::TestFixture void testGetTimestampFrom_Fallsback() { Message m; - m.addPayload(boost::make_shared(boost::posix_time::from_time_t(1), JID("foo1@bar.com"))); - m.addPayload(boost::make_shared(boost::posix_time::from_time_t(3), JID("foo3@bar.com"))); + m.addPayload(std::make_shared(boost::posix_time::from_time_t(1), JID("foo1@bar.com"))); + m.addPayload(std::make_shared(boost::posix_time::from_time_t(3), JID("foo3@bar.com"))); boost::optional timestamp = m.getTimestampFrom(JID("foo2@bar.com")); diff --git a/Swiften/Elements/VCard.h b/Swiften/Elements/VCard.h index 94cd029..5a43c3c 100644 --- a/Swiften/Elements/VCard.h +++ b/Swiften/Elements/VCard.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -19,7 +19,7 @@ namespace Swift { class SWIFTEN_API VCard : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; struct EMailAddress { EMailAddress() : isHome(false), isWork(false), isInternet(false), isPreferred(false), isX400(false) { diff --git a/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h b/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h index afecd0c..ae0fe17 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h +++ b/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h @@ -19,7 +19,7 @@ namespace Swift { class SWIFTEN_API WhiteboardDeleteOperation : public WhiteboardOperation { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: std::string getElementID() const { return elementID_; diff --git a/Swiften/Elements/Whiteboard/WhiteboardElement.h b/Swiften/Elements/Whiteboard/WhiteboardElement.h index a4d1207..6f6ff4f 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardElement.h +++ b/Swiften/Elements/Whiteboard/WhiteboardElement.h @@ -12,14 +12,15 @@ #pragma once -#include +#include +#include #include namespace Swift { class WhiteboardElement { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: virtual ~WhiteboardElement() {} diff --git a/Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h b/Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h index 15b50e4..7d80bf7 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h +++ b/Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h @@ -19,7 +19,7 @@ namespace Swift { class SWIFTEN_API WhiteboardEllipseElement : public WhiteboardElement { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: WhiteboardEllipseElement(int cx, int cy, int rx, int ry) { cx_ = cx; diff --git a/Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h b/Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h index 7522b7b..b8b7e54 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h +++ b/Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h @@ -23,7 +23,7 @@ namespace Swift { class SWIFTEN_API WhiteboardFreehandPathElement : public WhiteboardElement { typedef std::pair Point; public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: WhiteboardFreehandPathElement() { } diff --git a/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h b/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h index 855e502..256c17e 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h +++ b/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h @@ -19,7 +19,7 @@ namespace Swift { class SWIFTEN_API WhiteboardInsertOperation : public WhiteboardOperation { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: WhiteboardElement::ref getElement() const { return element_; diff --git a/Swiften/Elements/Whiteboard/WhiteboardLineElement.h b/Swiften/Elements/Whiteboard/WhiteboardLineElement.h index 7fb8a77..9c64977 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardLineElement.h +++ b/Swiften/Elements/Whiteboard/WhiteboardLineElement.h @@ -20,7 +20,7 @@ namespace Swift { class SWIFTEN_API WhiteboardLineElement : public WhiteboardElement { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: WhiteboardLineElement(int x1, int y1, int x2, int y2) : penWidth_(1) { x1_ = x1; diff --git a/Swiften/Elements/Whiteboard/WhiteboardOperation.h b/Swiften/Elements/Whiteboard/WhiteboardOperation.h index b657bd9..7d48e4d 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardOperation.h +++ b/Swiften/Elements/Whiteboard/WhiteboardOperation.h @@ -21,7 +21,7 @@ namespace Swift { class WhiteboardOperation { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: WhiteboardOperation() {} SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(WhiteboardOperation) diff --git a/Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h b/Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h index bd0b674..b8591cf 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h +++ b/Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -22,7 +22,7 @@ namespace Swift { class SWIFTEN_API WhiteboardPolygonElement : public WhiteboardElement { typedef std::pair Point; public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: WhiteboardPolygonElement() { } diff --git a/Swiften/Elements/Whiteboard/WhiteboardRectElement.h b/Swiften/Elements/Whiteboard/WhiteboardRectElement.h index c681e97..4dcdc8a 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardRectElement.h +++ b/Swiften/Elements/Whiteboard/WhiteboardRectElement.h @@ -19,7 +19,7 @@ namespace Swift { class SWIFTEN_API WhiteboardRectElement : public WhiteboardElement { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: WhiteboardRectElement(int x, int y, int width, int height) : penWidth_(1) { x_ = x; diff --git a/Swiften/Elements/Whiteboard/WhiteboardTextElement.h b/Swiften/Elements/Whiteboard/WhiteboardTextElement.h index df00bea..41f31f6 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardTextElement.h +++ b/Swiften/Elements/Whiteboard/WhiteboardTextElement.h @@ -19,7 +19,7 @@ namespace Swift { class SWIFTEN_API WhiteboardTextElement : public WhiteboardElement { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: WhiteboardTextElement(int x, int y) { x_ = x; diff --git a/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h b/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h index 5147999..b6dfd4f 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h +++ b/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h @@ -19,7 +19,7 @@ namespace Swift { class SWIFTEN_API WhiteboardUpdateOperation : public WhiteboardOperation { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: WhiteboardElement::ref getElement() const { return element_; diff --git a/Swiften/Elements/WhiteboardPayload.h b/Swiften/Elements/WhiteboardPayload.h index 42e1375..41c0acd 100644 --- a/Swiften/Elements/WhiteboardPayload.h +++ b/Swiften/Elements/WhiteboardPayload.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -22,7 +22,7 @@ namespace Swift { class SWIFTEN_API WhiteboardPayload : public Payload { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: enum Type {UnknownType, Data, SessionRequest, SessionAccept, SessionTerminate}; diff --git a/Swiften/Entity/GenericPayloadPersister.h b/Swiften/Entity/GenericPayloadPersister.h index 19afc61..7cef857 100644 --- a/Swiften/Entity/GenericPayloadPersister.h +++ b/Swiften/Entity/GenericPayloadPersister.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -18,8 +18,8 @@ namespace Swift { } public: - boost::shared_ptr loadPayloadGeneric(const boost::filesystem::path& path) { - return boost::dynamic_pointer_cast(loadPayload(path)); + std::shared_ptr loadPayloadGeneric(const boost::filesystem::path& path) { + return std::dynamic_pointer_cast(loadPayload(path)); } protected: diff --git a/Swiften/Entity/PayloadPersister.cpp b/Swiften/Entity/PayloadPersister.cpp index 7147615..4b3fb52 100644 --- a/Swiften/Entity/PayloadPersister.cpp +++ b/Swiften/Entity/PayloadPersister.cpp @@ -25,7 +25,7 @@ PayloadPersister::PayloadPersister() { PayloadPersister::~PayloadPersister() { } -void PayloadPersister::savePayload(boost::shared_ptr payload, const boost::filesystem::path& path) { +void PayloadPersister::savePayload(std::shared_ptr payload, const boost::filesystem::path& path) { try { if (!boost::filesystem::exists(path.parent_path())) { boost::filesystem::create_directories(path.parent_path()); @@ -39,12 +39,12 @@ void PayloadPersister::savePayload(boost::shared_ptr payload, const boo } } -boost::shared_ptr PayloadPersister::loadPayload(const boost::filesystem::path& path) { +std::shared_ptr PayloadPersister::loadPayload(const boost::filesystem::path& path) { try { if (boost::filesystem::exists(path)) { ByteArray data; readByteArrayFromFile(data, path); - boost::shared_ptr parser(createParser()); + std::shared_ptr parser(createParser()); PayloadParserTester tester(parser.get()); tester.parse(byteArrayToString(data)); return parser->getPayload(); @@ -53,5 +53,5 @@ boost::shared_ptr PayloadPersister::loadPayload(const boost::filesystem catch (const boost::filesystem::filesystem_error& e) { std::cerr << "ERROR: " << e.what() << std::endl; } - return boost::shared_ptr(); + return std::shared_ptr(); } diff --git a/Swiften/Entity/PayloadPersister.h b/Swiften/Entity/PayloadPersister.h index 9102f4b..c747a41 100644 --- a/Swiften/Entity/PayloadPersister.h +++ b/Swiften/Entity/PayloadPersister.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include @@ -21,8 +22,8 @@ namespace Swift { PayloadPersister(); virtual ~PayloadPersister(); - void savePayload(boost::shared_ptr, const boost::filesystem::path&); - boost::shared_ptr loadPayload(const boost::filesystem::path&); + void savePayload(std::shared_ptr, const boost::filesystem::path&); + std::shared_ptr loadPayload(const boost::filesystem::path&); protected: diff --git a/Swiften/EventLoop/BoostASIOEventLoop.cpp b/Swiften/EventLoop/BoostASIOEventLoop.cpp index a9d1440..bab8b54 100644 --- a/Swiften/EventLoop/BoostASIOEventLoop.cpp +++ b/Swiften/EventLoop/BoostASIOEventLoop.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -10,7 +10,7 @@ namespace Swift { -BoostASIOEventLoop::BoostASIOEventLoop(boost::shared_ptr ioService) : ioService_(ioService) { +BoostASIOEventLoop::BoostASIOEventLoop(std::shared_ptr ioService) : ioService_(ioService) { } diff --git a/Swiften/EventLoop/BoostASIOEventLoop.h b/Swiften/EventLoop/BoostASIOEventLoop.h index c39aaf5..41304c4 100644 --- a/Swiften/EventLoop/BoostASIOEventLoop.h +++ b/Swiften/EventLoop/BoostASIOEventLoop.h @@ -1,13 +1,14 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include + #include -#include #include #include @@ -17,7 +18,7 @@ namespace Swift { class SWIFTEN_API BoostASIOEventLoop : public EventLoop { public: - BoostASIOEventLoop(boost::shared_ptr ioService); + BoostASIOEventLoop(std::shared_ptr ioService); virtual ~BoostASIOEventLoop(); protected: @@ -26,7 +27,7 @@ namespace Swift { virtual void eventPosted(); private: - boost::shared_ptr ioService_; + std::shared_ptr ioService_; bool isEventInASIOEventLoop_; boost::recursive_mutex isEventInASIOEventLoopMutex_; diff --git a/Swiften/EventLoop/Event.h b/Swiften/EventLoop/Event.h index eecd896..e92bb33 100644 --- a/Swiften/EventLoop/Event.h +++ b/Swiften/EventLoop/Event.h @@ -6,15 +6,16 @@ #pragma once +#include + #include -#include #include namespace Swift { class Event { public: - Event(boost::shared_ptr owner, const boost::function& callback) : id(~0U), owner(owner), callback(callback) { + Event(std::shared_ptr owner, const boost::function& callback) : id(~0U), owner(owner), callback(callback) { } bool operator==(const Event& o) const { @@ -22,7 +23,7 @@ namespace Swift { } unsigned int id; - boost::shared_ptr owner; + std::shared_ptr owner; boost::function callback; }; } diff --git a/Swiften/EventLoop/EventLoop.cpp b/Swiften/EventLoop/EventLoop.cpp index 2434277..730ee0a 100644 --- a/Swiften/EventLoop/EventLoop.cpp +++ b/Swiften/EventLoop/EventLoop.cpp @@ -74,7 +74,7 @@ void EventLoop::handleNextEvents() { } } -void EventLoop::postEvent(boost::function callback, boost::shared_ptr owner) { +void EventLoop::postEvent(boost::function callback, std::shared_ptr owner) { Event event(owner, callback); bool callEventPosted = false; { @@ -91,7 +91,7 @@ void EventLoop::postEvent(boost::function callback, boost::shared_ptr owner) { +void EventLoop::removeEventsFromOwner(std::shared_ptr owner) { boost::recursive_mutex::scoped_lock removeLock(removeEventsMutex_); boost::recursive_mutex::scoped_lock lock(eventsMutex_); events_.remove_if(lambda::bind(&Event::owner, lambda::_1) == owner); diff --git a/Swiften/EventLoop/EventLoop.h b/Swiften/EventLoop/EventLoop.h index 84a3e9d..c7f7760 100644 --- a/Swiften/EventLoop/EventLoop.h +++ b/Swiften/EventLoop/EventLoop.h @@ -33,13 +33,13 @@ namespace Swift { * An optional \ref EventOwner can be passed, allowing later removal of events that have not yet been * executed using the \ref removeEventsFromOwner method. */ - void postEvent(boost::function event, boost::shared_ptr owner = boost::shared_ptr()); + void postEvent(boost::function event, std::shared_ptr owner = std::shared_ptr()); /** * The \ref removeEventsFromOwner method removes all events from the specified \ref owner from the * event queue. */ - void removeEventsFromOwner(boost::shared_ptr owner); + void removeEventsFromOwner(std::shared_ptr owner); protected: /** diff --git a/Swiften/EventLoop/UnitTest/EventLoopTest.cpp b/Swiften/EventLoop/UnitTest/EventLoopTest.cpp index 1028b7e..55715d0 100644 --- a/Swiften/EventLoop/UnitTest/EventLoopTest.cpp +++ b/Swiften/EventLoop/UnitTest/EventLoopTest.cpp @@ -44,8 +44,8 @@ class EventLoopTest : public CppUnit::TestFixture { void testRemove() { SimpleEventLoop testling; - boost::shared_ptr eventOwner1(new MyEventOwner()); - boost::shared_ptr eventOwner2(new MyEventOwner()); + std::shared_ptr eventOwner1(new MyEventOwner()); + std::shared_ptr eventOwner2(new MyEventOwner()); testling.postEvent(boost::bind(&EventLoopTest::logEvent, this, 1), eventOwner1); testling.postEvent(boost::bind(&EventLoopTest::logEvent, this, 2), eventOwner2); @@ -62,7 +62,7 @@ class EventLoopTest : public CppUnit::TestFixture { void testHandleEvent_Recursive() { DummyEventLoop testling; - boost::shared_ptr eventOwner(new MyEventOwner()); + std::shared_ptr eventOwner(new MyEventOwner()); testling.postEvent(boost::bind(&EventLoopTest::runEventLoop, this, &testling, eventOwner), eventOwner); testling.postEvent(boost::bind(&EventLoopTest::logEvent, this, 0), eventOwner); @@ -78,7 +78,7 @@ class EventLoopTest : public CppUnit::TestFixture { void logEvent(int i) { events_.push_back(i); } - void runEventLoop(DummyEventLoop* loop, boost::shared_ptr eventOwner) { + void runEventLoop(DummyEventLoop* loop, std::shared_ptr eventOwner) { loop->processEvents(); CPPUNIT_ASSERT_EQUAL(0, static_cast(events_.size())); loop->postEvent(boost::bind(&EventLoopTest::logEvent, this, 1), eventOwner); diff --git a/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp b/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp index 44a5796..c539691 100644 --- a/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp +++ b/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp @@ -30,7 +30,7 @@ static JID recipient; static int exitCode = CANNOT_CONNECT; static boost::bsignals::connection errorConnection; -static void handleServerDiscoInfoResponse(boost::shared_ptr /*info*/, ErrorPayload::ref error) { +static void handleServerDiscoInfoResponse(std::shared_ptr /*info*/, ErrorPayload::ref error) { if (!error) { errorConnection.disconnect(); client->disconnect(); diff --git a/Swiften/Examples/LinkLocalTool/main.cpp b/Swiften/Examples/LinkLocalTool/main.cpp index 37804fb..a853f0e 100644 --- a/Swiften/Examples/LinkLocalTool/main.cpp +++ b/Swiften/Examples/LinkLocalTool/main.cpp @@ -24,11 +24,11 @@ int main(int argc, char* argv[]) { SimpleEventLoop eventLoop; PlatformDNSSDQuerierFactory factory(&eventLoop); - boost::shared_ptr querier = factory.createQuerier(); + std::shared_ptr querier = factory.createQuerier(); querier->start(); if (std::string(argv[1]) == "browse") { - boost::shared_ptr browseQuery = querier->createBrowseQuery(); + std::shared_ptr browseQuery = querier->createBrowseQuery(); browseQuery->startBrowsing(); eventLoop.run(); browseQuery->stopBrowsing(); @@ -38,7 +38,7 @@ int main(int argc, char* argv[]) { std::cerr << "Invalid parameters" << std::endl; return -1; } - boost::shared_ptr resolveQuery = querier->createResolveServiceQuery(DNSSDServiceID(argv[2], argv[3], argv[4])); + std::shared_ptr resolveQuery = querier->createResolveServiceQuery(DNSSDServiceID(argv[2], argv[3], argv[4])); resolveQuery->start(); eventLoop.run(); std::cerr << "Done running" << std::endl; diff --git a/Swiften/Examples/MUCListAndJoin/MUCListAndJoin.cpp b/Swiften/Examples/MUCListAndJoin/MUCListAndJoin.cpp index 1aaebac..c3983f1 100644 --- a/Swiften/Examples/MUCListAndJoin/MUCListAndJoin.cpp +++ b/Swiften/Examples/MUCListAndJoin/MUCListAndJoin.cpp @@ -5,9 +5,9 @@ */ #include +#include #include -#include #include #include @@ -27,7 +27,7 @@ using namespace std; static SimpleEventLoop eventLoop; static BoostNetworkFactories networkFactories(&eventLoop); -static boost::shared_ptr client; +static std::shared_ptr client; static MUC::ref muc; static JID mucJID; static JID roomJID; @@ -39,7 +39,7 @@ static void joinMUC() { muc->joinAs("SwiftExample"); } -static void handleRoomsItemsResponse(boost::shared_ptr items, ErrorPayload::ref error) { +static void handleRoomsItemsResponse(std::shared_ptr items, ErrorPayload::ref error) { if (error) { cout << "Error fetching list of rooms." << endl; return; @@ -73,7 +73,7 @@ static void handleDisconnected(const boost::optional&) { cout << "Disconnected." << endl; } -static void handleIncomingMessage(boost::shared_ptr message) { +static void handleIncomingMessage(std::shared_ptr message) { if (message->getFrom().toBare() == roomJID) { cout << "[ " << roomJID << " ] " << message->getFrom().getResource() << ": " << message->getBody().get_value_or("") << endl; } @@ -91,7 +91,7 @@ int main(int argc, char* argv[]) { } else { mucJID = JID(argv[3]); - client = boost::make_shared(JID(argv[1]), string(argv[2]), &networkFactories); + client = std::make_shared(JID(argv[1]), string(argv[2]), &networkFactories); client->setAlwaysTrustCertificates(); // Enable the following line for detailed XML logging diff --git a/Swiften/Examples/NetworkTool/main.cpp b/Swiften/Examples/NetworkTool/main.cpp index 0cedfa7..c50ab67 100644 --- a/Swiften/Examples/NetworkTool/main.cpp +++ b/Swiften/Examples/NetworkTool/main.cpp @@ -57,7 +57,7 @@ int main(int argc, char* argv[]) { PlatformNATTraversalWorker natTraverser(&eventLoop); if (std::string(argv[1]) == "get-public-ip") { - boost::shared_ptr query = natTraverser.createGetPublicIPRequest(); + std::shared_ptr query = natTraverser.createGetPublicIPRequest(); query->onResult.connect(boost::bind(&handleGetPublicIPRequestResponse, _1)); query->start(); eventLoop.run(); @@ -66,7 +66,7 @@ int main(int argc, char* argv[]) { if (argc < 4) { std::cerr << "Invalid parameters" << std::endl; } - boost::shared_ptr query = natTraverser.createForwardPortRequest(boost::lexical_cast(argv[2]), boost::lexical_cast(argv[3])); + std::shared_ptr query = natTraverser.createForwardPortRequest(boost::lexical_cast(argv[2]), boost::lexical_cast(argv[3])); query->onResult.connect(boost::bind(&handleGetForwardPortRequestResponse, _1)); query->start(); eventLoop.run(); @@ -75,7 +75,7 @@ int main(int argc, char* argv[]) { if (argc < 4) { std::cerr << "Invalid parameters" << std::endl; } - boost::shared_ptr query = natTraverser.createRemovePortForwardingRequest(boost::lexical_cast(argv[2]), boost::lexical_cast(argv[3])); + std::shared_ptr query = natTraverser.createRemovePortForwardingRequest(boost::lexical_cast(argv[2]), boost::lexical_cast(argv[3])); query->onResult.connect(boost::bind(&handleRemovePortForwardingRequestResponse, _1)); query->start(); eventLoop.run(); diff --git a/Swiften/Examples/ParserTester/ParserTester.cpp b/Swiften/Examples/ParserTester/ParserTester.cpp index af79ece..71b0611 100644 --- a/Swiften/Examples/ParserTester/ParserTester.cpp +++ b/Swiften/Examples/ParserTester/ParserTester.cpp @@ -22,7 +22,7 @@ class MyXMPPParserClient : public XMPPParserClient { virtual void handleStreamStart(const ProtocolHeader&) { std::cout << "-> Stream start" << std::endl; } - virtual void handleElement(boost::shared_ptr element) { + virtual void handleElement(std::shared_ptr element) { std::cout << "-> Element " << typeid(*element.get()).name() << std::endl; } virtual void handleStreamEnd() { diff --git a/Swiften/Examples/SendFile/ReceiveFile.cpp b/Swiften/Examples/SendFile/ReceiveFile.cpp index c6e75e8..0b61987 100644 --- a/Swiften/Examples/SendFile/ReceiveFile.cpp +++ b/Swiften/Examples/SendFile/ReceiveFile.cpp @@ -5,10 +5,10 @@ */ #include +#include #include #include -#include #include #include @@ -82,7 +82,7 @@ class FileReceiver { void handleIncomingFileTransfer(IncomingFileTransfer::ref transfer) { SWIFT_LOG(debug) << "foo" << std::endl; incomingFileTransfers.push_back(transfer); - boost::shared_ptr out = boost::make_shared("out"); + std::shared_ptr out = std::make_shared("out"); transfer->onFinished.connect(boost::bind(&FileReceiver::handleFileTransferFinished, this, _1, out)); transfer->accept(out); } @@ -94,7 +94,7 @@ class FileReceiver { void handleFileTransferFinished( const boost::optional& error, - boost::shared_ptr out) { + std::shared_ptr out) { std::cout << "File transfer finished" << std::endl; out->close(); if (error) { diff --git a/Swiften/Examples/SendFile/SendFile.cpp b/Swiften/Examples/SendFile/SendFile.cpp index 1b70747..0e1fb23 100644 --- a/Swiften/Examples/SendFile/SendFile.cpp +++ b/Swiften/Examples/SendFile/SendFile.cpp @@ -67,7 +67,7 @@ class FileSender { void handleCapsChanged(JID jid) { if (jid.toBare() == recipient) { // create ReadBytestream from file - boost::shared_ptr fileStream = boost::make_shared(file); + std::shared_ptr fileStream = std::make_shared(file); outgoingFileTransfer = client->getFileTransferManager()->createOutgoingFileTransfer(recipient, file, "Some File!", fileStream); diff --git a/Swiften/Examples/SendMessage/SendMessage.cpp b/Swiften/Examples/SendMessage/SendMessage.cpp index 9a954f2..2458e65 100644 --- a/Swiften/Examples/SendMessage/SendMessage.cpp +++ b/Swiften/Examples/SendMessage/SendMessage.cpp @@ -30,7 +30,7 @@ static boost::bsignals::connection errorConnection; static void handleConnected() { - boost::shared_ptr message(new Message()); + std::shared_ptr message(new Message()); message->setBody(messageBody); message->setTo(recipient); client->sendMessage(message); diff --git a/Swiften/FileTransfer/ByteArrayReadBytestream.cpp b/Swiften/FileTransfer/ByteArrayReadBytestream.cpp index c1fadee..cd9fa4a 100644 --- a/Swiften/FileTransfer/ByteArrayReadBytestream.cpp +++ b/Swiften/FileTransfer/ByteArrayReadBytestream.cpp @@ -6,19 +6,20 @@ #include +#include + #include -#include #include using namespace Swift; -boost::shared_ptr ByteArrayReadBytestream::read(size_t size) { +std::shared_ptr ByteArrayReadBytestream::read(size_t size) { size_t readSize = size; if (position + readSize > data.size()) { readSize = data.size() - position; } - boost::shared_ptr result = boost::make_shared( + std::shared_ptr result = std::make_shared( data.begin() + boost::numeric_cast(position), data.begin() + boost::numeric_cast(position) + boost::numeric_cast(readSize)); diff --git a/Swiften/FileTransfer/ByteArrayReadBytestream.h b/Swiften/FileTransfer/ByteArrayReadBytestream.h index a711acb..d90e5cc 100644 --- a/Swiften/FileTransfer/ByteArrayReadBytestream.h +++ b/Swiften/FileTransfer/ByteArrayReadBytestream.h @@ -18,7 +18,7 @@ namespace Swift { ByteArrayReadBytestream(const std::vector& data) : data(data), position(0), dataComplete(true) { } - virtual boost::shared_ptr read(size_t size); + virtual std::shared_ptr read(size_t size); virtual bool isFinished() const { return position >= data.size() && dataComplete; diff --git a/Swiften/FileTransfer/BytestreamsRequest.h b/Swiften/FileTransfer/BytestreamsRequest.h index 7fa3660..d278e79 100644 --- a/Swiften/FileTransfer/BytestreamsRequest.h +++ b/Swiften/FileTransfer/BytestreamsRequest.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -15,21 +15,21 @@ namespace Swift { class SWIFTEN_API BytestreamsRequest : public GenericRequest { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; - static ref create(const JID& jid, boost::shared_ptr payload, IQRouter* router) { + static ref create(const JID& jid, std::shared_ptr payload, IQRouter* router) { return ref(new BytestreamsRequest(jid, payload, router)); } - static ref create(const JID& from, const JID& to, boost::shared_ptr payload, IQRouter* router) { + static ref create(const JID& from, const JID& to, std::shared_ptr payload, IQRouter* router) { return ref(new BytestreamsRequest(from, to, payload, router)); } private: - BytestreamsRequest(const JID& jid, boost::shared_ptr payload, IQRouter* router) : GenericRequest(IQ::Set, jid, payload, router) { + BytestreamsRequest(const JID& jid, std::shared_ptr payload, IQRouter* router) : GenericRequest(IQ::Set, jid, payload, router) { } - BytestreamsRequest(const JID& from, const JID& to, boost::shared_ptr payload, IQRouter* router) : GenericRequest(IQ::Set, from, to, payload, router) { + BytestreamsRequest(const JID& from, const JID& to, std::shared_ptr payload, IQRouter* router) : GenericRequest(IQ::Set, from, to, payload, router) { } }; } diff --git a/Swiften/FileTransfer/DefaultFileTransferTransporter.cpp b/Swiften/FileTransfer/DefaultFileTransferTransporter.cpp index b54f1c1..9428d0b 100644 --- a/Swiften/FileTransfer/DefaultFileTransferTransporter.cpp +++ b/Swiften/FileTransfer/DefaultFileTransferTransporter.cpp @@ -1,13 +1,14 @@ /* - * Copyright (c) 2013-2015 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include +#include + #include -#include #include #include @@ -107,7 +108,7 @@ void DefaultFileTransferTransporter::handleLocalCandidatesGenerated( void DefaultFileTransferTransporter::handleRemoteCandidateSelectFinished( const boost::optional& candidate, - boost::shared_ptr session) { + std::shared_ptr session) { remoteS5BClientSession = session; onRemoteCandidateSelectFinished(s5bSessionID, candidate); } @@ -134,11 +135,11 @@ void DefaultFileTransferTransporter::handleActivateProxySessionResult(const std: void DefaultFileTransferTransporter::startActivatingProxy(const JID& proxyServiceJID) { // activate proxy SWIFT_LOG(debug) << "Start activating proxy " << proxyServiceJID.toString() << " with sid = " << s5bSessionID << "." << std::endl; - S5BProxyRequest::ref proxyRequest = boost::make_shared(); + S5BProxyRequest::ref proxyRequest = std::make_shared(); proxyRequest->setSID(s5bSessionID); proxyRequest->setActivate(role == Initiator ? responder : initiator); - boost::shared_ptr > request = boost::make_shared >(IQ::Set, proxyServiceJID, proxyRequest, router); + std::shared_ptr > request = std::make_shared >(IQ::Set, proxyServiceJID, proxyRequest, router); request->onResponse.connect(boost::bind(&DefaultFileTransferTransporter::handleActivateProxySessionResult, this, s5bSessionID, _2)); request->send(); } @@ -148,97 +149,97 @@ void DefaultFileTransferTransporter::stopActivatingProxy() { assert(false); } -boost::shared_ptr DefaultFileTransferTransporter::createIBBSendSession( - const std::string& sessionID, unsigned int blockSize, boost::shared_ptr stream) { +std::shared_ptr DefaultFileTransferTransporter::createIBBSendSession( + const std::string& sessionID, unsigned int blockSize, std::shared_ptr stream) { if (s5bServerManager->getServer()) { closeLocalSession(); } closeRemoteSession(); - boost::shared_ptr ibbSession = boost::make_shared( + std::shared_ptr ibbSession = std::make_shared( sessionID, initiator, responder, stream, router); ibbSession->setBlockSize(blockSize); - return boost::make_shared(ibbSession); + return std::make_shared(ibbSession); } -boost::shared_ptr DefaultFileTransferTransporter::createIBBReceiveSession( - const std::string& sessionID, unsigned long long size, boost::shared_ptr stream) { +std::shared_ptr DefaultFileTransferTransporter::createIBBReceiveSession( + const std::string& sessionID, unsigned long long size, std::shared_ptr stream) { if (s5bServerManager->getServer()) { closeLocalSession(); } closeRemoteSession(); - boost::shared_ptr ibbSession = boost::make_shared( + std::shared_ptr ibbSession = std::make_shared( sessionID, initiator, responder, size, stream, router); - return boost::make_shared(ibbSession); + return std::make_shared(ibbSession); } -boost::shared_ptr DefaultFileTransferTransporter::createRemoteCandidateSession( - boost::shared_ptr stream, const JingleS5BTransportPayload::Candidate& /* candidate */) { +std::shared_ptr DefaultFileTransferTransporter::createRemoteCandidateSession( + std::shared_ptr stream, const JingleS5BTransportPayload::Candidate& /* candidate */) { closeLocalSession(); - return boost::make_shared >( + return std::make_shared >( remoteS5BClientSession, stream); } -boost::shared_ptr DefaultFileTransferTransporter::createRemoteCandidateSession( - boost::shared_ptr stream, const JingleS5BTransportPayload::Candidate& /* candidate */) { +std::shared_ptr DefaultFileTransferTransporter::createRemoteCandidateSession( + std::shared_ptr stream, const JingleS5BTransportPayload::Candidate& /* candidate */) { closeLocalSession(); - return boost::make_shared >( + return std::make_shared >( remoteS5BClientSession, stream); } -boost::shared_ptr DefaultFileTransferTransporter::getServerSession() { +std::shared_ptr DefaultFileTransferTransporter::getServerSession() { s5bRegistry->setHasBytestream(getSOCKS5DstAddr(), false); - std::vector > serverSessions = + std::vector > serverSessions = s5bServerManager->getServer()->getSessions(getSOCKS5DstAddr()); while (serverSessions.size() > 1) { - boost::shared_ptr session = serverSessions.back(); + std::shared_ptr session = serverSessions.back(); serverSessions.pop_back(); session->stop(); } - return !serverSessions.empty() ? serverSessions.front() : boost::shared_ptr(); + return !serverSessions.empty() ? serverSessions.front() : std::shared_ptr(); } -boost::shared_ptr DefaultFileTransferTransporter::createLocalCandidateSession( - boost::shared_ptr stream, const JingleS5BTransportPayload::Candidate& candidate) { +std::shared_ptr DefaultFileTransferTransporter::createLocalCandidateSession( + std::shared_ptr stream, const JingleS5BTransportPayload::Candidate& candidate) { closeRemoteSession(); - boost::shared_ptr transportSession; + std::shared_ptr transportSession; if (candidate.type == JingleS5BTransportPayload::Candidate::ProxyType) { SOCKS5BytestreamClientSession::ref proxySession = s5bProxy->getProxySessionAndCloseOthers(candidate.jid, getLocalCandidateSOCKS5DstAddr()); assert(proxySession); - transportSession = boost::make_shared >(proxySession, stream); + transportSession = std::make_shared >(proxySession, stream); } if (!transportSession) { - boost::shared_ptr serverSession = getServerSession(); + std::shared_ptr serverSession = getServerSession(); if (serverSession) { - transportSession = boost::make_shared >(serverSession, stream); + transportSession = std::make_shared >(serverSession, stream); } } if (!transportSession) { - transportSession = boost::make_shared(); + transportSession = std::make_shared(); } return transportSession; } -boost::shared_ptr DefaultFileTransferTransporter::createLocalCandidateSession( - boost::shared_ptr stream, const JingleS5BTransportPayload::Candidate& candidate) { +std::shared_ptr DefaultFileTransferTransporter::createLocalCandidateSession( + std::shared_ptr stream, const JingleS5BTransportPayload::Candidate& candidate) { closeRemoteSession(); - boost::shared_ptr transportSession; + std::shared_ptr transportSession; if (candidate.type == JingleS5BTransportPayload::Candidate::ProxyType) { SOCKS5BytestreamClientSession::ref proxySession = s5bProxy->getProxySessionAndCloseOthers(candidate.jid, getLocalCandidateSOCKS5DstAddr()); assert(proxySession); - transportSession = boost::make_shared >(proxySession, stream); + transportSession = std::make_shared >(proxySession, stream); } if (!transportSession) { - boost::shared_ptr serverSession = getServerSession(); + std::shared_ptr serverSession = getServerSession(); if (serverSession) { - transportSession = boost::make_shared >(serverSession, stream); + transportSession = std::make_shared >(serverSession, stream); } } if (!transportSession) { - transportSession = boost::make_shared(); + transportSession = std::make_shared(); } return transportSession; } @@ -285,8 +286,8 @@ std::string DefaultFileTransferTransporter::getLocalCandidateSOCKS5DstAddr() con void DefaultFileTransferTransporter::closeLocalSession() { s5bRegistry->setHasBytestream(getSOCKS5DstAddr(), false); if (s5bServerManager->getServer()) { - std::vector > serverSessions = s5bServerManager->getServer()->getSessions(getSOCKS5DstAddr()); - foreach(boost::shared_ptr session, serverSessions) { + std::vector > serverSessions = s5bServerManager->getServer()->getSessions(getSOCKS5DstAddr()); + foreach(std::shared_ptr session, serverSessions) { session->stop(); } } diff --git a/Swiften/FileTransfer/DefaultFileTransferTransporter.h b/Swiften/FileTransfer/DefaultFileTransferTransporter.h index 7ec6a12..339232f 100644 --- a/Swiften/FileTransfer/DefaultFileTransferTransporter.h +++ b/Swiften/FileTransfer/DefaultFileTransferTransporter.h @@ -65,28 +65,28 @@ namespace Swift { virtual void startActivatingProxy(const JID& jid) SWIFTEN_OVERRIDE; virtual void stopActivatingProxy() SWIFTEN_OVERRIDE; - virtual boost::shared_ptr createIBBSendSession( - const std::string& sessionID, unsigned int blockSize, boost::shared_ptr) SWIFTEN_OVERRIDE; - virtual boost::shared_ptr createIBBReceiveSession( - const std::string& sessionID, unsigned long long size, boost::shared_ptr) SWIFTEN_OVERRIDE; - virtual boost::shared_ptr createRemoteCandidateSession( - boost::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE; - virtual boost::shared_ptr createRemoteCandidateSession( - boost::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE; - virtual boost::shared_ptr createLocalCandidateSession( - boost::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE; - virtual boost::shared_ptr createLocalCandidateSession( - boost::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE; + virtual std::shared_ptr createIBBSendSession( + const std::string& sessionID, unsigned int blockSize, std::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr createIBBReceiveSession( + const std::string& sessionID, unsigned long long size, std::shared_ptr) SWIFTEN_OVERRIDE; + virtual std::shared_ptr createRemoteCandidateSession( + std::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE; + virtual std::shared_ptr createRemoteCandidateSession( + std::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE; + virtual std::shared_ptr createLocalCandidateSession( + std::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE; + virtual std::shared_ptr createLocalCandidateSession( + std::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE; private: void handleLocalCandidatesGenerated(const std::vector&); void handleRemoteCandidateSelectFinished( const boost::optional&, - boost::shared_ptr); + std::shared_ptr); void handleActivateProxySessionResult(const std::string& sessionID, ErrorPayload::ref error); void closeLocalSession(); void closeRemoteSession(); - boost::shared_ptr getServerSession(); + std::shared_ptr getServerSession(); std::string getSOCKS5DstAddr() const; std::string getInitiatorCandidateSOCKS5DstAddr() const; @@ -106,7 +106,7 @@ namespace Swift { LocalJingleTransportCandidateGenerator* localCandidateGenerator; RemoteJingleTransportCandidateSelector* remoteCandidateSelector; std::string s5bSessionID; - boost::shared_ptr remoteS5BClientSession; + std::shared_ptr remoteS5BClientSession; }; } diff --git a/Swiften/FileTransfer/FileReadBytestream.cpp b/Swiften/FileTransfer/FileReadBytestream.cpp index ad9a33b..2ff00dc 100644 --- a/Swiften/FileTransfer/FileReadBytestream.cpp +++ b/Swiften/FileTransfer/FileReadBytestream.cpp @@ -7,10 +7,10 @@ #include #include +#include #include #include -#include #include @@ -27,11 +27,11 @@ FileReadBytestream::~FileReadBytestream() { } } -boost::shared_ptr FileReadBytestream::read(size_t size) { +std::shared_ptr FileReadBytestream::read(size_t size) { if (!stream) { stream = new boost::filesystem::ifstream(file, std::ios_base::in|std::ios_base::binary); } - boost::shared_ptr result = boost::make_shared(); + std::shared_ptr result = std::make_shared(); result->resize(size); assert(stream->good()); stream->read(reinterpret_cast(vecptr(*result)), boost::numeric_cast(size)); diff --git a/Swiften/FileTransfer/FileReadBytestream.h b/Swiften/FileTransfer/FileReadBytestream.h index 24cfbae..aaf3de3 100644 --- a/Swiften/FileTransfer/FileReadBytestream.h +++ b/Swiften/FileTransfer/FileReadBytestream.h @@ -18,7 +18,7 @@ namespace Swift { FileReadBytestream(const boost::filesystem::path& file); virtual ~FileReadBytestream(); - virtual boost::shared_ptr< std::vector > read(size_t size); + virtual std::shared_ptr< std::vector > read(size_t size); virtual bool isFinished() const; private: diff --git a/Swiften/FileTransfer/FileTransfer.h b/Swiften/FileTransfer/FileTransfer.h index b585ab9..e6442b7 100644 --- a/Swiften/FileTransfer/FileTransfer.h +++ b/Swiften/FileTransfer/FileTransfer.h @@ -5,16 +5,17 @@ */ /* - * Copyright (c) 2013-2015 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include + #include #include -#include #include #include @@ -46,7 +47,7 @@ namespace Swift { Type type; std::string message; }; - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: FileTransfer(); diff --git a/Swiften/FileTransfer/FileTransferManager.h b/Swiften/FileTransfer/FileTransferManager.h index be2902a..60deeaa 100644 --- a/Swiften/FileTransfer/FileTransferManager.h +++ b/Swiften/FileTransfer/FileTransferManager.h @@ -36,7 +36,7 @@ namespace Swift { const JID& to, const boost::filesystem::path& filepath, const std::string& description, - boost::shared_ptr bytestream, + std::shared_ptr bytestream, const FileTransferOptions& = FileTransferOptions()) = 0; virtual OutgoingFileTransfer::ref createOutgoingFileTransfer( const JID& to, @@ -44,7 +44,7 @@ namespace Swift { const std::string& description, const boost::uintmax_t sizeInBytes, const boost::posix_time::ptime& lastModified, - boost::shared_ptr bytestream, + std::shared_ptr bytestream, const FileTransferOptions& = FileTransferOptions()) = 0; static bool isSupportedBy(const DiscoInfo::ref info); diff --git a/Swiften/FileTransfer/FileTransferManagerImpl.cpp b/Swiften/FileTransfer/FileTransferManagerImpl.cpp index 80993ef..d449179 100644 --- a/Swiften/FileTransfer/FileTransferManagerImpl.cpp +++ b/Swiften/FileTransfer/FileTransferManagerImpl.cpp @@ -125,7 +125,7 @@ OutgoingFileTransfer::ref FileTransferManagerImpl::createOutgoingFileTransfer( const JID& to, const boost::filesystem::path& filepath, const std::string& description, - boost::shared_ptr bytestream, + std::shared_ptr bytestream, const FileTransferOptions& config) { #if BOOST_FILESYSTEM_VERSION == 2 // TODO: Delete this when boost 1.44 becomes a minimum requirement, and we no longer need v2 std::string filename = filepath.filename(); @@ -144,7 +144,7 @@ OutgoingFileTransfer::ref FileTransferManagerImpl::createOutgoingFileTransfer( const std::string& description, const boost::uintmax_t sizeInBytes, const boost::posix_time::ptime& lastModified, - boost::shared_ptr bytestream, + std::shared_ptr bytestream, const FileTransferOptions& config) { JingleFileTransferFileInfo fileInfo; fileInfo.setDate(lastModified); diff --git a/Swiften/FileTransfer/FileTransferManagerImpl.h b/Swiften/FileTransfer/FileTransferManagerImpl.h index a939ace..3566e92 100644 --- a/Swiften/FileTransfer/FileTransferManagerImpl.h +++ b/Swiften/FileTransfer/FileTransferManagerImpl.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2013-2015 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -71,7 +71,7 @@ namespace Swift { const JID& to, const boost::filesystem::path& filepath, const std::string& description, - boost::shared_ptr bytestream, + std::shared_ptr bytestream, const FileTransferOptions&) SWIFTEN_OVERRIDE; OutgoingFileTransfer::ref createOutgoingFileTransfer( const JID& to, @@ -79,7 +79,7 @@ namespace Swift { const std::string& description, const boost::uintmax_t sizeInBytes, const boost::posix_time::ptime& lastModified, - boost::shared_ptr bytestream, + std::shared_ptr bytestream, const FileTransferOptions&) SWIFTEN_OVERRIDE; void start(); diff --git a/Swiften/FileTransfer/FileTransferTransporter.h b/Swiften/FileTransfer/FileTransferTransporter.h index dc12b0e..a680ca2 100644 --- a/Swiften/FileTransfer/FileTransferTransporter.h +++ b/Swiften/FileTransfer/FileTransferTransporter.h @@ -40,21 +40,21 @@ namespace Swift { virtual void startActivatingProxy(const JID& proxy) = 0; virtual void stopActivatingProxy() = 0; - virtual boost::shared_ptr createIBBSendSession( - const std::string& sessionID, unsigned int blockSize, boost::shared_ptr) = 0; - virtual boost::shared_ptr createIBBReceiveSession( - const std::string& sessionID, unsigned long long size, boost::shared_ptr) = 0; - virtual boost::shared_ptr createRemoteCandidateSession( - boost::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) = 0; - virtual boost::shared_ptr createRemoteCandidateSession( - boost::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) = 0; - virtual boost::shared_ptr createLocalCandidateSession( - boost::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) = 0; - virtual boost::shared_ptr createLocalCandidateSession( - boost::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) = 0; + virtual std::shared_ptr createIBBSendSession( + const std::string& sessionID, unsigned int blockSize, std::shared_ptr) = 0; + virtual std::shared_ptr createIBBReceiveSession( + const std::string& sessionID, unsigned long long size, std::shared_ptr) = 0; + virtual std::shared_ptr createRemoteCandidateSession( + std::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) = 0; + virtual std::shared_ptr createRemoteCandidateSession( + std::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) = 0; + virtual std::shared_ptr createLocalCandidateSession( + std::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) = 0; + virtual std::shared_ptr createLocalCandidateSession( + std::shared_ptr, const JingleS5BTransportPayload::Candidate& candidate) = 0; boost::signal&, const std::string& /* dstAddr */)> onLocalCandidatesGenerated; boost::signal&)> onRemoteCandidateSelectFinished; - boost::signal)> onProxyActivated; + boost::signal)> onProxyActivated; }; } diff --git a/Swiften/FileTransfer/IBBReceiveSession.cpp b/Swiften/FileTransfer/IBBReceiveSession.cpp index 5a29ccb..24996ed 100644 --- a/Swiften/FileTransfer/IBBReceiveSession.cpp +++ b/Swiften/FileTransfer/IBBReceiveSession.cpp @@ -72,7 +72,7 @@ IBBReceiveSession::IBBReceiveSession( const JID& from, const JID& to, unsigned long long size, - boost::shared_ptr bytestream, + std::shared_ptr bytestream, IQRouter* router) : id(id), from(from), diff --git a/Swiften/FileTransfer/IBBReceiveSession.h b/Swiften/FileTransfer/IBBReceiveSession.h index 3eec96e..c383455 100644 --- a/Swiften/FileTransfer/IBBReceiveSession.h +++ b/Swiften/FileTransfer/IBBReceiveSession.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include #include @@ -26,7 +27,7 @@ namespace Swift { const JID& from, const JID& to, unsigned long long size, - boost::shared_ptr bytestream, + std::shared_ptr bytestream, IQRouter* router); ~IBBReceiveSession(); @@ -55,7 +56,7 @@ namespace Swift { JID from; JID to; unsigned long long size; - boost::shared_ptr bytestream; + std::shared_ptr bytestream; IQRouter* router; IBBResponder* responder; bool active; diff --git a/Swiften/FileTransfer/IBBReceiveTransportSession.cpp b/Swiften/FileTransfer/IBBReceiveTransportSession.cpp index 2e19b75..6e47ac6 100644 --- a/Swiften/FileTransfer/IBBReceiveTransportSession.cpp +++ b/Swiften/FileTransfer/IBBReceiveTransportSession.cpp @@ -10,7 +10,7 @@ namespace Swift { -IBBReceiveTransportSession::IBBReceiveTransportSession(boost::shared_ptr session) : session(session) { +IBBReceiveTransportSession::IBBReceiveTransportSession(std::shared_ptr session) : session(session) { finishedConnection = session->onFinished.connect(boost::bind(boost::ref(onFinished), _1)); } diff --git a/Swiften/FileTransfer/IBBReceiveTransportSession.h b/Swiften/FileTransfer/IBBReceiveTransportSession.h index f66731b..65488d9 100644 --- a/Swiften/FileTransfer/IBBReceiveTransportSession.h +++ b/Swiften/FileTransfer/IBBReceiveTransportSession.h @@ -15,14 +15,14 @@ namespace Swift { class SWIFTEN_API IBBReceiveTransportSession : public TransportSession { public: - IBBReceiveTransportSession(boost::shared_ptr session); + IBBReceiveTransportSession(std::shared_ptr session); virtual ~IBBReceiveTransportSession(); virtual void start() SWIFTEN_OVERRIDE; virtual void stop() SWIFTEN_OVERRIDE; private: - boost::shared_ptr session; + std::shared_ptr session; boost::bsignals::scoped_connection finishedConnection; boost::bsignals::scoped_connection bytesSentConnection; }; diff --git a/Swiften/FileTransfer/IBBRequest.h b/Swiften/FileTransfer/IBBRequest.h index 165dd21..67bd33a 100644 --- a/Swiften/FileTransfer/IBBRequest.h +++ b/Swiften/FileTransfer/IBBRequest.h @@ -13,14 +13,14 @@ namespace Swift { class SWIFTEN_API IBBRequest : public GenericRequest { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; - static ref create(const JID& from, const JID& to, boost::shared_ptr payload, IQRouter* router) { + static ref create(const JID& from, const JID& to, std::shared_ptr payload, IQRouter* router) { return ref(new IBBRequest(from, to, payload, router)); } private: - IBBRequest(const JID& from, const JID& to, boost::shared_ptr payload, IQRouter* router) : GenericRequest(IQ::Set, from, to, payload, router) { + IBBRequest(const JID& from, const JID& to, std::shared_ptr payload, IQRouter* router) : GenericRequest(IQ::Set, from, to, payload, router) { } }; } diff --git a/Swiften/FileTransfer/IBBSendSession.cpp b/Swiften/FileTransfer/IBBSendSession.cpp index 10a36a9..e51c91c 100644 --- a/Swiften/FileTransfer/IBBSendSession.cpp +++ b/Swiften/FileTransfer/IBBSendSession.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -20,7 +20,7 @@ IBBSendSession::IBBSendSession( const std::string& id, const JID& from, const JID& to, - boost::shared_ptr bytestream, + std::shared_ptr bytestream, IQRouter* router) : id(id), from(from), @@ -75,7 +75,7 @@ void IBBSendSession::handleIBBResponse(IBB::ref, ErrorPayload::ref error) { void IBBSendSession::sendMoreData() { try { - boost::shared_ptr data = bytestream->read(blockSize); + std::shared_ptr data = bytestream->read(blockSize); if (!data->empty()) { waitingForData = false; IBBRequest::ref request = IBBRequest::create(from, to, IBB::createIBBData(id, sequenceNumber, *data), router); diff --git a/Swiften/FileTransfer/IBBSendSession.h b/Swiften/FileTransfer/IBBSendSession.h index e62ef79..7988398 100644 --- a/Swiften/FileTransfer/IBBSendSession.h +++ b/Swiften/FileTransfer/IBBSendSession.h @@ -1,13 +1,14 @@ /* - * 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 + #include -#include #include #include @@ -27,7 +28,7 @@ namespace Swift { const std::string& id, const JID& from, const JID& to, - boost::shared_ptr bytestream, + std::shared_ptr bytestream, IQRouter* router); ~IBBSendSession(); @@ -59,12 +60,12 @@ namespace Swift { std::string id; JID from; JID to; - boost::shared_ptr bytestream; + std::shared_ptr bytestream; IQRouter* router; unsigned int blockSize; int sequenceNumber; bool active; bool waitingForData; - boost::shared_ptr currentRequest; + std::shared_ptr currentRequest; }; } diff --git a/Swiften/FileTransfer/IBBSendTransportSession.cpp b/Swiften/FileTransfer/IBBSendTransportSession.cpp index fd2d8e6..81972c9 100644 --- a/Swiften/FileTransfer/IBBSendTransportSession.cpp +++ b/Swiften/FileTransfer/IBBSendTransportSession.cpp @@ -10,7 +10,7 @@ namespace Swift { -IBBSendTransportSession::IBBSendTransportSession(boost::shared_ptr session) : session(session) { +IBBSendTransportSession::IBBSendTransportSession(std::shared_ptr session) : session(session) { finishedConnection = session->onFinished.connect(boost::bind(boost::ref(onFinished), _1)); bytesSentConnection = session->onBytesSent.connect(boost::bind(boost::ref(onBytesSent), _1)); } diff --git a/Swiften/FileTransfer/IBBSendTransportSession.h b/Swiften/FileTransfer/IBBSendTransportSession.h index 812c42e..5b55215 100644 --- a/Swiften/FileTransfer/IBBSendTransportSession.h +++ b/Swiften/FileTransfer/IBBSendTransportSession.h @@ -15,14 +15,14 @@ namespace Swift { class SWIFTEN_API IBBSendTransportSession : public TransportSession { public: - IBBSendTransportSession(boost::shared_ptr session); + IBBSendTransportSession(std::shared_ptr session); virtual ~IBBSendTransportSession(); virtual void start() SWIFTEN_OVERRIDE; virtual void stop() SWIFTEN_OVERRIDE; private: - boost::shared_ptr session; + std::shared_ptr session; boost::bsignals::scoped_connection finishedConnection; boost::bsignals::scoped_connection bytesSentConnection; }; diff --git a/Swiften/FileTransfer/IncomingFileTransfer.h b/Swiften/FileTransfer/IncomingFileTransfer.h index 4cb18e8..2976216 100644 --- a/Swiften/FileTransfer/IncomingFileTransfer.h +++ b/Swiften/FileTransfer/IncomingFileTransfer.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 +#include #include #include @@ -23,12 +23,12 @@ namespace Swift { */ class SWIFTEN_API IncomingFileTransfer : public FileTransfer { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; virtual ~IncomingFileTransfer(); virtual void accept( - boost::shared_ptr, + std::shared_ptr, const FileTransferOptions& = FileTransferOptions()) = 0; virtual const JID& getSender() const = 0; diff --git a/Swiften/FileTransfer/IncomingFileTransferManager.cpp b/Swiften/FileTransfer/IncomingFileTransferManager.cpp index b0b4d49..1c2b788 100644 --- a/Swiften/FileTransfer/IncomingFileTransferManager.cpp +++ b/Swiften/FileTransfer/IncomingFileTransferManager.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include #include @@ -43,7 +43,7 @@ bool IncomingFileTransferManager::handleIncomingJingleSession( if (content->getTransport() || content->getTransport()) { JingleFileTransferDescription::ref description = content->getDescription(); if (description) { - IncomingJingleFileTransfer::ref transfer = boost::make_shared( + IncomingJingleFileTransfer::ref transfer = std::make_shared( recipient, session, content, transporterFactory, timerFactory, crypto); onIncomingFileTransfer(transfer); } diff --git a/Swiften/FileTransfer/IncomingFileTransferManager.h b/Swiften/FileTransfer/IncomingFileTransferManager.h index 7a34b2a..fa1b3bb 100644 --- a/Swiften/FileTransfer/IncomingFileTransferManager.h +++ b/Swiften/FileTransfer/IncomingFileTransferManager.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 +#include #include #include diff --git a/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp b/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp index 526c54c..f73cd38 100644 --- a/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp +++ b/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp @@ -6,10 +6,10 @@ #include +#include #include #include -#include #include #include @@ -66,7 +66,7 @@ IncomingJingleFileTransfer::~IncomingJingleFileTransfer() { } void IncomingJingleFileTransfer::accept( - boost::shared_ptr stream, + std::shared_ptr stream, const FileTransferOptions& options) { SWIFT_LOG(debug) << std::endl; if (state != Initial) { SWIFT_LOG(warning) << "Incorrect state" << std::endl; return; } @@ -126,7 +126,7 @@ void IncomingJingleFileTransfer::handleLocalTransportCandidatesGenerated( fillCandidateMap(localCandidates, candidates); - JingleS5BTransportPayload::ref transport = boost::make_shared(); + JingleS5BTransportPayload::ref transport = std::make_shared(); transport->setSessionID(s5bSessionID); transport->setMode(JingleS5BTransportPayload::TCPMode); transport->setDstAddr(dstAddr); @@ -233,7 +233,7 @@ void IncomingJingleFileTransfer::handleTransportReplaceReceived( } JingleIBBTransportPayload::ref ibbTransport; - if (options.isInBandAllowed() && (ibbTransport = boost::dynamic_pointer_cast(transport))) { + if (options.isInBandAllowed() && (ibbTransport = std::dynamic_pointer_cast(transport))) { SWIFT_LOG(debug) << "transport replaced with IBB" << std::endl; startTransferring(transporter->createIBBReceiveSession( @@ -379,7 +379,7 @@ void IncomingJingleFileTransfer::startTransferViaLocalCandidate() { } } -void IncomingJingleFileTransfer::startTransferring(boost::shared_ptr transportSession) { +void IncomingJingleFileTransfer::startTransferring(std::shared_ptr transportSession) { SWIFT_LOG(debug) << std::endl; this->transportSession = transportSession; @@ -401,11 +401,11 @@ bool IncomingJingleFileTransfer::isTryingCandidates() const { return state == TryingCandidates; } -boost::shared_ptr IncomingJingleFileTransfer::createLocalCandidateSession() { +std::shared_ptr IncomingJingleFileTransfer::createLocalCandidateSession() { return transporter->createLocalCandidateSession(stream, theirCandidateChoice.get()); } -boost::shared_ptr IncomingJingleFileTransfer::createRemoteCandidateSession() { +std::shared_ptr IncomingJingleFileTransfer::createRemoteCandidateSession() { return transporter->createRemoteCandidateSession(stream, ourCandidateChoice.get()); } diff --git a/Swiften/FileTransfer/IncomingJingleFileTransfer.h b/Swiften/FileTransfer/IncomingJingleFileTransfer.h index d3cc331..36b76b1 100644 --- a/Swiften/FileTransfer/IncomingJingleFileTransfer.h +++ b/Swiften/FileTransfer/IncomingJingleFileTransfer.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -42,18 +42,18 @@ namespace Swift { */ class SWIFTEN_API IncomingJingleFileTransfer : public IncomingFileTransfer, public JingleFileTransfer { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; IncomingJingleFileTransfer( const JID& recipient, - boost::shared_ptr, - boost::shared_ptr content, + std::shared_ptr, + std::shared_ptr content, FileTransferTransporterFactory*, TimerFactory*, CryptoProvider*); virtual ~IncomingJingleFileTransfer(); - virtual void accept(boost::shared_ptr, const FileTransferOptions& = FileTransferOptions()) SWIFTEN_OVERRIDE; + virtual void accept(std::shared_ptr, const FileTransferOptions& = FileTransferOptions()) SWIFTEN_OVERRIDE; virtual void cancel() SWIFTEN_OVERRIDE; private: @@ -71,9 +71,9 @@ namespace Swift { virtual void handleSessionTerminateReceived( boost::optional reason) SWIFTEN_OVERRIDE; - virtual void handleSessionInfoReceived(boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual void handleSessionInfoReceived(std::shared_ptr) SWIFTEN_OVERRIDE; virtual void handleTransportReplaceReceived( - const JingleContentID&, boost::shared_ptr) SWIFTEN_OVERRIDE; + const JingleContentID&, std::shared_ptr) SWIFTEN_OVERRIDE; virtual void handleLocalTransportCandidatesGenerated( const std::string& s5bSessionID, @@ -101,24 +101,24 @@ namespace Swift { static FileTransfer::State::Type getExternalState(State state); virtual bool hasPriorityOnCandidateTie() const SWIFTEN_OVERRIDE; virtual void fallback() SWIFTEN_OVERRIDE; - virtual void startTransferring(boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual void startTransferring(std::shared_ptr) SWIFTEN_OVERRIDE; virtual bool isWaitingForPeerProxyActivate() const SWIFTEN_OVERRIDE; virtual bool isWaitingForLocalProxyActivate() const SWIFTEN_OVERRIDE; virtual bool isTryingCandidates() const SWIFTEN_OVERRIDE; - virtual boost::shared_ptr createLocalCandidateSession() SWIFTEN_OVERRIDE; - virtual boost::shared_ptr createRemoteCandidateSession() SWIFTEN_OVERRIDE; + virtual std::shared_ptr createLocalCandidateSession() SWIFTEN_OVERRIDE; + virtual std::shared_ptr createRemoteCandidateSession() SWIFTEN_OVERRIDE; virtual void terminate(JinglePayload::Reason::Type reason) SWIFTEN_OVERRIDE; private: - boost::shared_ptr initialContent; + std::shared_ptr initialContent; CryptoProvider* crypto; State state; - boost::shared_ptr description; - boost::shared_ptr stream; + std::shared_ptr description; + std::shared_ptr stream; boost::uintmax_t receivedBytes; IncrementalBytestreamHashCalculator* hashCalculator; - boost::shared_ptr waitOnHashTimer; + std::shared_ptr waitOnHashTimer; std::map hashes; FileTransferOptions options; diff --git a/Swiften/FileTransfer/JingleFileTransfer.cpp b/Swiften/FileTransfer/JingleFileTransfer.cpp index 53977ec..36725de 100644 --- a/Swiften/FileTransfer/JingleFileTransfer.cpp +++ b/Swiften/FileTransfer/JingleFileTransfer.cpp @@ -19,7 +19,7 @@ using namespace Swift; JingleFileTransfer::JingleFileTransfer( - boost::shared_ptr session, + std::shared_ptr session, const JID& target, FileTransferTransporterFactory* transporterFactory) : session(session), @@ -87,7 +87,7 @@ void JingleFileTransfer::handleRemoteTransportCandidateSelectFinished( ourCandidateChoice = candidate; ourCandidateSelectFinished = true; - JingleS5BTransportPayload::ref s5bPayload = boost::make_shared(); + JingleS5BTransportPayload::ref s5bPayload = std::make_shared(); s5bPayload->setSessionID(s5bSessionID); if (candidate) { s5bPayload->setCandidateUsed(candidate->cid); @@ -151,14 +151,14 @@ void JingleFileTransfer::handleProxyActivateFinished( if (error) { SWIFT_LOG(debug) << "Error activating proxy" << std::endl; - JingleS5BTransportPayload::ref proxyError = boost::make_shared(); + JingleS5BTransportPayload::ref proxyError = std::make_shared(); proxyError->setSessionID(s5bSessionID); proxyError->setProxyError(true); session->sendTransportInfo(getContentID(), proxyError); fallback(); } else { - JingleS5BTransportPayload::ref proxyActivate = boost::make_shared(); + JingleS5BTransportPayload::ref proxyActivate = std::make_shared(); proxyActivate->setSessionID(s5bSessionID); proxyActivate->setActivated(theirCandidateChoice->cid); session->sendTransportInfo(getContentID(), proxyActivate); @@ -170,7 +170,7 @@ void JingleFileTransfer::handleTransportInfoReceived( const JingleContentID& /* contentID */, JingleTransportPayload::ref transport) { SWIFT_LOG(debug) << std::endl; - if (JingleS5BTransportPayload::ref s5bPayload = boost::dynamic_pointer_cast(transport)) { + if (JingleS5BTransportPayload::ref s5bPayload = std::dynamic_pointer_cast(transport)) { if (s5bPayload->hasCandidateError() || !s5bPayload->getCandidateUsed().empty()) { SWIFT_LOG(debug) << "Received candidate decision from peer" << std::endl; if (!isTryingCandidates()) { SWIFT_LOG(warning) << "Incorrect state" << std::endl; return; } diff --git a/Swiften/FileTransfer/JingleFileTransfer.h b/Swiften/FileTransfer/JingleFileTransfer.h index 6862ba2..8a80e06 100644 --- a/Swiften/FileTransfer/JingleFileTransfer.h +++ b/Swiften/FileTransfer/JingleFileTransfer.h @@ -1,15 +1,14 @@ /* - * Copyright (c) 2013-2015 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include #include -#include - #include #include #include @@ -31,7 +30,7 @@ namespace Swift { class SWIFTEN_API JingleFileTransfer : public AbstractJingleSessionListener { public: JingleFileTransfer( - boost::shared_ptr, + std::shared_ptr, const JID& target, FileTransferTransporterFactory*); virtual ~JingleFileTransfer(); @@ -49,15 +48,15 @@ namespace Swift { void handleRemoteTransportCandidateSelectFinished( const std::string& s5bSessionID, const boost::optional&); virtual JingleContentID getContentID() const = 0; - virtual void startTransferring(boost::shared_ptr) = 0; + virtual void startTransferring(std::shared_ptr) = 0; virtual void terminate(JinglePayload::Reason::Type reason) = 0; virtual void fallback() = 0; virtual bool hasPriorityOnCandidateTie() const = 0; virtual bool isWaitingForPeerProxyActivate() const = 0; virtual bool isWaitingForLocalProxyActivate() const = 0; virtual bool isTryingCandidates() const = 0; - virtual boost::shared_ptr createLocalCandidateSession() = 0; - virtual boost::shared_ptr createRemoteCandidateSession() = 0; + virtual std::shared_ptr createLocalCandidateSession() = 0; + virtual std::shared_ptr createRemoteCandidateSession() = 0; virtual void startTransferViaLocalCandidate() = 0; virtual void startTransferViaRemoteCandidate() = 0; @@ -75,7 +74,7 @@ namespace Swift { static FileTransfer::State::Type getExternalFinishedState(JinglePayload::Reason::Type); static boost::optional getFileTransferError(JinglePayload::Reason::Type); - boost::shared_ptr session; + std::shared_ptr session; JID target; FileTransferTransporterFactory* transporterFactory; FileTransferTransporter* transporter; @@ -87,7 +86,7 @@ namespace Swift { boost::optional theirCandidateChoice; CandidateMap localCandidates; - boost::shared_ptr transportSession; + std::shared_ptr transportSession; boost::bsignals::scoped_connection localTransportCandidatesGeneratedConnection; boost::bsignals::scoped_connection remoteTransportCandidateSelectFinishedConnection; diff --git a/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp b/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp index 3703ba1..2975193 100644 --- a/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp +++ b/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp @@ -5,18 +5,17 @@ */ /* - * Copyright (c) 2013-2015 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include +#include #include #include -#include -#include #include #include diff --git a/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.h b/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.h index 74c6bfb..66b035e 100644 --- a/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.h +++ b/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.h @@ -58,9 +58,9 @@ namespace Swift { SOCKS5BytestreamProxiesManager* s5bProxy; JID ownJID; IDGenerator* idGenerator; - boost::shared_ptr s5bServerInitializeRequest; - boost::shared_ptr s5bServerResourceUser_; - boost::shared_ptr s5bServerPortForwardingUser_; + std::shared_ptr s5bServerInitializeRequest; + std::shared_ptr s5bServerResourceUser_; + std::shared_ptr s5bServerPortForwardingUser_; bool triedServerInit_; bool triedForwarding_; bool triedProxyDiscovery_; diff --git a/Swiften/FileTransfer/OutgoingFileTransfer.h b/Swiften/FileTransfer/OutgoingFileTransfer.h index e83a893..07fc6d2 100644 --- a/Swiften/FileTransfer/OutgoingFileTransfer.h +++ b/Swiften/FileTransfer/OutgoingFileTransfer.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 +#include #include #include @@ -14,7 +14,7 @@ namespace Swift { class SWIFTEN_API OutgoingFileTransfer : public FileTransfer { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: virtual ~OutgoingFileTransfer(); diff --git a/Swiften/FileTransfer/OutgoingFileTransferManager.cpp b/Swiften/FileTransfer/OutgoingFileTransferManager.cpp index f6d216e..c74aefb 100644 --- a/Swiften/FileTransfer/OutgoingFileTransferManager.cpp +++ b/Swiften/FileTransfer/OutgoingFileTransferManager.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include @@ -41,16 +41,16 @@ OutgoingFileTransferManager::~OutgoingFileTransferManager() { delete idGenerator; } -boost::shared_ptr OutgoingFileTransferManager::createOutgoingFileTransfer( +std::shared_ptr OutgoingFileTransferManager::createOutgoingFileTransfer( const JID& from, const JID& recipient, - boost::shared_ptr readBytestream, + std::shared_ptr readBytestream, const JingleFileTransferFileInfo& fileInfo, const FileTransferOptions& config) { - JingleSessionImpl::ref jingleSession = boost::make_shared( + JingleSessionImpl::ref jingleSession = std::make_shared( from, recipient, idGenerator->generateID(), iqRouter); jingleSessionManager->registerOutgoingSession(from, jingleSession); - return boost::shared_ptr(new OutgoingJingleFileTransfer( + return std::shared_ptr(new OutgoingJingleFileTransfer( recipient, jingleSession, readBytestream, diff --git a/Swiften/FileTransfer/OutgoingFileTransferManager.h b/Swiften/FileTransfer/OutgoingFileTransferManager.h index 3981005..48a6e5a 100644 --- a/Swiften/FileTransfer/OutgoingFileTransferManager.h +++ b/Swiften/FileTransfer/OutgoingFileTransferManager.h @@ -5,14 +5,14 @@ */ /* - * Copyright (c) 2013-2015 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include @@ -39,10 +39,10 @@ namespace Swift { CryptoProvider* crypto); ~OutgoingFileTransferManager(); - boost::shared_ptr createOutgoingFileTransfer( + std::shared_ptr createOutgoingFileTransfer( const JID& from, const JID& to, - boost::shared_ptr, + std::shared_ptr, const JingleFileTransferFileInfo&, const FileTransferOptions&); diff --git a/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp b/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp index c7573c2..fcc160a 100644 --- a/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp +++ b/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp @@ -17,8 +17,9 @@ #include +#include + #include -#include #include #include @@ -46,7 +47,7 @@ static const int DEFAULT_BLOCK_SIZE = 4096; OutgoingJingleFileTransfer::OutgoingJingleFileTransfer( const JID& toJID, JingleSession::ref session, - boost::shared_ptr stream, + std::shared_ptr stream, FileTransferTransporterFactory* transporterFactory, TimerFactory* timerFactory, IDGenerator* idGenerator, @@ -125,12 +126,12 @@ void OutgoingJingleFileTransfer::handleSessionAcceptReceived( SWIFT_LOG(debug) << std::endl; if (state != WaitingForAccept) { SWIFT_LOG(warning) << "Incorrect state" << std::endl; return; } - if (JingleS5BTransportPayload::ref s5bPayload = boost::dynamic_pointer_cast(transportPayload)) { + if (JingleS5BTransportPayload::ref s5bPayload = std::dynamic_pointer_cast(transportPayload)) { transporter->addRemoteCandidates(s5bPayload->getCandidates(), s5bPayload->getDstAddr()); setInternalState(TryingCandidates); transporter->startTryingRemoteCandidates(); } - else if (JingleIBBTransportPayload::ref ibbPayload = boost::dynamic_pointer_cast(transportPayload)) { + else if (JingleIBBTransportPayload::ref ibbPayload = std::dynamic_pointer_cast(transportPayload)) { startTransferring(transporter->createIBBSendSession(ibbPayload->getSessionID(), ibbPayload->getBlockSize().get_value_or(DEFAULT_BLOCK_SIZE), stream)); } else { @@ -165,7 +166,7 @@ void OutgoingJingleFileTransfer::handleTransportAcceptReceived(const JingleConte SWIFT_LOG(debug) << std::endl; if (state != FallbackRequested) { SWIFT_LOG(warning) << "Incorrect state" << std::endl; return; } - if (JingleIBBTransportPayload::ref ibbPayload = boost::dynamic_pointer_cast(transport)) { + if (JingleIBBTransportPayload::ref ibbPayload = std::dynamic_pointer_cast(transport)) { startTransferring(transporter->createIBBSendSession(ibbPayload->getSessionID(), ibbPayload->getBlockSize().get_value_or(DEFAULT_BLOCK_SIZE), stream)); } else { @@ -174,7 +175,7 @@ void OutgoingJingleFileTransfer::handleTransportAcceptReceived(const JingleConte } } -void OutgoingJingleFileTransfer::handleTransportRejectReceived(const JingleContentID &, boost::shared_ptr) { +void OutgoingJingleFileTransfer::handleTransportRejectReceived(const JingleContentID &, std::shared_ptr) { SWIFT_LOG(debug) << std::endl; terminate(JinglePayload::Reason::UnsupportedTransports); @@ -183,7 +184,7 @@ void OutgoingJingleFileTransfer::handleTransportRejectReceived(const JingleConte void OutgoingJingleFileTransfer::sendSessionInfoHash() { SWIFT_LOG(debug) << std::endl; - JingleFileTransferHash::ref hashElement = boost::make_shared(); + JingleFileTransferHash::ref hashElement = std::make_shared(); hashElement->getFileInfo().addHash(HashElement("sha-1", hashCalculator->getSHA1Hash())); hashElement->getFileInfo().addHash(HashElement("md5", hashCalculator->getMD5Hash())); session->sendInfo(hashElement); @@ -196,7 +197,7 @@ void OutgoingJingleFileTransfer::handleLocalTransportCandidatesGenerated( fillCandidateMap(localCandidates, candidates); - JingleFileTransferDescription::ref description = boost::make_shared(); + JingleFileTransferDescription::ref description = std::make_shared(); fileInfo.addHash(HashElement("sha-1", ByteArray())); fileInfo.addHash(HashElement("md5", ByteArray())); description->setFileInfo(fileInfo); @@ -204,13 +205,13 @@ void OutgoingJingleFileTransfer::handleLocalTransportCandidatesGenerated( JingleTransportPayload::ref transport; if (candidates.empty()) { SWIFT_LOG(debug) << "no S5B candidates generated. Send IBB transport candidate." << std::endl; - JingleIBBTransportPayload::ref ibbTransport = boost::make_shared(); + JingleIBBTransportPayload::ref ibbTransport = std::make_shared(); ibbTransport->setBlockSize(DEFAULT_BLOCK_SIZE); ibbTransport->setSessionID(idGenerator->generateID()); transport = ibbTransport; } else { - JingleS5BTransportPayload::ref s5bTransport = boost::make_shared(); + JingleS5BTransportPayload::ref s5bTransport = std::make_shared(); s5bTransport->setSessionID(s5bSessionID); s5bTransport->setMode(JingleS5BTransportPayload::TCPMode); s5bTransport->setDstAddr(dstAddr); @@ -227,7 +228,7 @@ void OutgoingJingleFileTransfer::handleLocalTransportCandidatesGenerated( void OutgoingJingleFileTransfer::fallback() { if (options.isInBandAllowed()) { SWIFT_LOG(debug) << "Trying to fallback to IBB transport." << std::endl; - JingleIBBTransportPayload::ref ibbTransport = boost::make_shared(); + JingleIBBTransportPayload::ref ibbTransport = std::make_shared(); ibbTransport->setBlockSize(DEFAULT_BLOCK_SIZE); ibbTransport->setSessionID(idGenerator->generateID()); setInternalState(FallbackRequested); @@ -255,7 +256,7 @@ void OutgoingJingleFileTransfer::handleTransferFinished(boost::optional transportSession) { +void OutgoingJingleFileTransfer::startTransferring(std::shared_ptr transportSession) { SWIFT_LOG(debug) << std::endl; this->transportSession = transportSession; @@ -390,11 +391,11 @@ bool OutgoingJingleFileTransfer::isTryingCandidates() const { return state == TryingCandidates; } -boost::shared_ptr OutgoingJingleFileTransfer::createLocalCandidateSession() { +std::shared_ptr OutgoingJingleFileTransfer::createLocalCandidateSession() { return transporter->createLocalCandidateSession(stream, theirCandidateChoice.get()); } -boost::shared_ptr OutgoingJingleFileTransfer::createRemoteCandidateSession() { +std::shared_ptr OutgoingJingleFileTransfer::createRemoteCandidateSession() { return transporter->createRemoteCandidateSession(stream, ourCandidateChoice.get()); } diff --git a/Swiften/FileTransfer/OutgoingJingleFileTransfer.h b/Swiften/FileTransfer/OutgoingJingleFileTransfer.h index a8dad1e..4f28433 100644 --- a/Swiften/FileTransfer/OutgoingJingleFileTransfer.h +++ b/Swiften/FileTransfer/OutgoingJingleFileTransfer.h @@ -5,15 +5,16 @@ */ /* - * Copyright (c) 2013-2015 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include + #include -#include #include #include @@ -38,8 +39,8 @@ namespace Swift { public: OutgoingJingleFileTransfer( const JID& to, - boost::shared_ptr, - boost::shared_ptr, + std::shared_ptr, + std::shared_ptr, FileTransferTransporterFactory*, TimerFactory*, IDGenerator*, @@ -66,10 +67,10 @@ namespace Swift { Finished }; - virtual void handleSessionAcceptReceived(const JingleContentID&, boost::shared_ptr, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual void handleSessionAcceptReceived(const JingleContentID&, std::shared_ptr, std::shared_ptr) SWIFTEN_OVERRIDE; virtual void handleSessionTerminateReceived(boost::optional reason) SWIFTEN_OVERRIDE; - virtual void handleTransportAcceptReceived(const JingleContentID&, boost::shared_ptr) SWIFTEN_OVERRIDE; - virtual void handleTransportRejectReceived(const JingleContentID &, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual void handleTransportAcceptReceived(const JingleContentID&, std::shared_ptr) SWIFTEN_OVERRIDE; + virtual void handleTransportRejectReceived(const JingleContentID &, std::shared_ptr) SWIFTEN_OVERRIDE; virtual void startTransferViaRemoteCandidate() SWIFTEN_OVERRIDE; virtual void startTransferViaLocalCandidate() SWIFTEN_OVERRIDE; void startTransferringIfCandidateAcknowledged(); @@ -86,14 +87,14 @@ namespace Swift { void sendSessionInfoHash(); - virtual void startTransferring(boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual void startTransferring(std::shared_ptr) SWIFTEN_OVERRIDE; virtual bool hasPriorityOnCandidateTie() const SWIFTEN_OVERRIDE; virtual bool isWaitingForPeerProxyActivate() const SWIFTEN_OVERRIDE; virtual bool isWaitingForLocalProxyActivate() const SWIFTEN_OVERRIDE; virtual bool isTryingCandidates() const SWIFTEN_OVERRIDE; - virtual boost::shared_ptr createLocalCandidateSession() SWIFTEN_OVERRIDE; - virtual boost::shared_ptr createRemoteCandidateSession() SWIFTEN_OVERRIDE; + virtual std::shared_ptr createLocalCandidateSession() SWIFTEN_OVERRIDE; + virtual std::shared_ptr createRemoteCandidateSession() SWIFTEN_OVERRIDE; void handleWaitForRemoteTerminationTimeout(); @@ -105,7 +106,7 @@ namespace Swift { private: IDGenerator* idGenerator; - boost::shared_ptr stream; + std::shared_ptr stream; JingleFileTransferFileInfo fileInfo; FileTransferOptions options; JingleContentID contentID; diff --git a/Swiften/FileTransfer/ReadBytestream.h b/Swiften/FileTransfer/ReadBytestream.h index e967c53..62542bc 100644 --- a/Swiften/FileTransfer/ReadBytestream.h +++ b/Swiften/FileTransfer/ReadBytestream.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include @@ -22,7 +21,7 @@ namespace Swift { * Return an empty vector if no more data is available. * Use onDataAvailable signal for signaling there is data available again. */ - virtual boost::shared_ptr< std::vector > read(size_t size) = 0; + virtual std::shared_ptr< std::vector > read(size_t size) = 0; virtual bool isFinished() const = 0; diff --git a/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp b/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp index 296723e..c29fd5c 100644 --- a/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp +++ b/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp @@ -12,8 +12,9 @@ #include +#include + #include -#include #include #include @@ -58,7 +59,7 @@ void RemoteJingleTransportCandidateSelector::tryNextCandidate() { if (candidates.empty()) { SWIFT_LOG(debug) << "No more candidates" << std::endl; onCandidateSelectFinished( - boost::optional(), boost::shared_ptr()); + boost::optional(), std::shared_ptr()); } else { lastCandidate = candidates.top(); @@ -67,8 +68,8 @@ void RemoteJingleTransportCandidateSelector::tryNextCandidate() { if ((lastCandidate.type == JingleS5BTransportPayload::Candidate::DirectType && options.isDirectAllowed()) || (lastCandidate.type == JingleS5BTransportPayload::Candidate::AssistedType && options.isAssistedAllowed()) || (lastCandidate.type == JingleS5BTransportPayload::Candidate::ProxyType && options.isProxiedAllowed())) { - boost::shared_ptr connection = connectionFactory->createConnection(); - s5bSession = boost::make_shared( + std::shared_ptr connection = connectionFactory->createConnection(); + s5bSession = std::make_shared( connection, lastCandidate.hostPort, socks5DstAddr, timerFactory); sessionReadyConnection = s5bSession->onSessionReady.connect( boost::bind(&RemoteJingleTransportCandidateSelector::handleSessionReady, this, _1)); diff --git a/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.h b/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.h index 5928754..1f24b6a 100644 --- a/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.h +++ b/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.h @@ -14,11 +14,10 @@ #include +#include #include #include -#include - #include #include #include @@ -40,7 +39,7 @@ namespace Swift { virtual void startSelectingCandidate(); virtual void stopSelectingCandidate(); - boost::signal&, boost::shared_ptr)> onCandidateSelectFinished; + boost::signal&, std::shared_ptr)> onCandidateSelectFinished; private: void tryNextCandidate(); @@ -54,7 +53,7 @@ namespace Swift { JingleS5BTransportPayload::Candidate, std::vector, JingleS5BTransportPayload::CompareCandidate> candidates; - boost::shared_ptr s5bSession; + std::shared_ptr s5bSession; boost::bsignals::connection sessionReadyConnection; JingleS5BTransportPayload::Candidate lastCandidate; std::string socks5DstAddr; diff --git a/Swiften/FileTransfer/S5BTransportSession.h b/Swiften/FileTransfer/S5BTransportSession.h index 95143bd..683e9c4 100644 --- a/Swiften/FileTransfer/S5BTransportSession.h +++ b/Swiften/FileTransfer/S5BTransportSession.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -20,16 +20,16 @@ template class SWIFTEN_API S5BTransportSession : public TransportSession { public: S5BTransportSession( - boost::shared_ptr session, - boost::shared_ptr readStream) : + std::shared_ptr session, + std::shared_ptr readStream) : session(session), readStream(readStream) { initialize(); } S5BTransportSession( - boost::shared_ptr session, - boost::shared_ptr writeStream) : + std::shared_ptr session, + std::shared_ptr writeStream) : session(session), writeStream(writeStream) { initialize(); @@ -58,9 +58,9 @@ class SWIFTEN_API S5BTransportSession : public TransportSession { } private: - boost::shared_ptr session; - boost::shared_ptr readStream; - boost::shared_ptr writeStream; + std::shared_ptr session; + std::shared_ptr readStream; + std::shared_ptr writeStream; boost::bsignals::scoped_connection finishedConnection; boost::bsignals::scoped_connection bytesSentConnection; diff --git a/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp b/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp index 98a0988..5ddd32b 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp +++ b/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp @@ -27,7 +27,7 @@ namespace Swift { SOCKS5BytestreamClientSession::SOCKS5BytestreamClientSession( - boost::shared_ptr connection, + std::shared_ptr connection, const HostAddressPort& addressPort, const std::string& destination, TimerFactory* timerFactory) : @@ -161,7 +161,7 @@ void SOCKS5BytestreamClientSession::authenticate() { state = Authenticating; } -void SOCKS5BytestreamClientSession::startReceiving(boost::shared_ptr writeStream) { +void SOCKS5BytestreamClientSession::startReceiving(std::shared_ptr writeStream) { if (state == Ready) { state = Reading; writeBytestream = writeStream; @@ -172,7 +172,7 @@ void SOCKS5BytestreamClientSession::startReceiving(boost::shared_ptr readStream) { +void SOCKS5BytestreamClientSession::startSending(std::shared_ptr readStream) { if (state == Ready) { state = Writing; readBytestream = readStream; @@ -191,7 +191,7 @@ HostAddressPort SOCKS5BytestreamClientSession::getAddressPort() const { void SOCKS5BytestreamClientSession::sendData() { if (!readBytestream->isFinished()) { try { - boost::shared_ptr dataToSend = readBytestream->read(boost::numeric_cast(chunkSize)); + std::shared_ptr dataToSend = readBytestream->read(boost::numeric_cast(chunkSize)); connection->write(createSafeByteArray(*dataToSend)); onBytesSent(dataToSend->size()); } @@ -241,7 +241,7 @@ void SOCKS5BytestreamClientSession::handleConnectFinished(bool error) { } } -void SOCKS5BytestreamClientSession::handleDataRead(boost::shared_ptr data) { +void SOCKS5BytestreamClientSession::handleDataRead(std::shared_ptr data) { SWIFT_LOG(debug) << "state: " << state << " data.size() = " << data->size() << std::endl; if (state != Reading) { append(unprocessedData, *data); diff --git a/Swiften/FileTransfer/SOCKS5BytestreamClientSession.h b/Swiften/FileTransfer/SOCKS5BytestreamClientSession.h index 5aea7d0..2a73a79 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamClientSession.h +++ b/Swiften/FileTransfer/SOCKS5BytestreamClientSession.h @@ -5,15 +5,16 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include + #include -#include #include #include @@ -48,11 +49,11 @@ public: }; public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: SOCKS5BytestreamClientSession( - boost::shared_ptr connection, + std::shared_ptr connection, const HostAddressPort&, const std::string&, TimerFactory*); @@ -61,8 +62,8 @@ public: void start(); void stop(); - void startReceiving(boost::shared_ptr); - void startSending(boost::shared_ptr); + void startReceiving(std::shared_ptr); + void startSending(std::shared_ptr); HostAddressPort getAddressPort() const; @@ -78,7 +79,7 @@ private: void authenticate(); void handleConnectFinished(bool error); - void handleDataRead(boost::shared_ptr); + void handleDataRead(std::shared_ptr); void handleDisconnected(const boost::optional&); void handleWeFailedTimeout(); @@ -87,7 +88,7 @@ private: void closeConnection(); private: - boost::shared_ptr connection; + std::shared_ptr connection; HostAddressPort addressPort; std::string destination; // hexify(SHA1(sessionID + requester + target)) @@ -97,8 +98,8 @@ private: ByteArray authenticateAddress; int chunkSize; - boost::shared_ptr writeBytestream; - boost::shared_ptr readBytestream; + std::shared_ptr writeBytestream; + std::shared_ptr readBytestream; Timer::ref weFailedTimeout; diff --git a/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp b/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp index 881a82d..6a738ee 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp +++ b/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -13,8 +13,9 @@ #include +#include + #include -#include #include #include @@ -67,13 +68,13 @@ void SOCKS5BytestreamProxiesManager::connectToProxies(const std::string& session if (localS5BProxies_) { foreach(S5BProxyRequest::ref proxy, localS5BProxies_.get()) { - boost::shared_ptr conn = connectionFactory_->createConnection(); + std::shared_ptr conn = connectionFactory_->createConnection(); HostAddressPort addressPort = HostAddressPort(proxy->getStreamHost().get().host, proxy->getStreamHost().get().port); SWIFT_LOG_ASSERT(addressPort.isValid(), warning) << std::endl; - boost::shared_ptr session = boost::make_shared(conn, addressPort, sessionID, timerFactory_); + std::shared_ptr session = std::make_shared(conn, addressPort, sessionID, timerFactory_); JID proxyJid = proxy->getStreamHost().get().jid; - clientSessions.push_back(std::pair >(proxyJid, session)); + clientSessions.push_back(std::pair >(proxyJid, session)); session->onSessionReady.connect(boost::bind(&SOCKS5BytestreamProxiesManager::handleProxySessionReady, this,sessionID, proxyJid, session, _1)); session->onFinished.connect(boost::bind(&SOCKS5BytestreamProxiesManager::handleProxySessionFinished, this, sessionID, proxyJid, session, _1)); session->start(); @@ -83,14 +84,14 @@ void SOCKS5BytestreamProxiesManager::connectToProxies(const std::string& session proxySessions_[sessionID] = clientSessions; } -boost::shared_ptr SOCKS5BytestreamProxiesManager::getProxySessionAndCloseOthers(const JID& proxyJID, const std::string& sessionID) { +std::shared_ptr SOCKS5BytestreamProxiesManager::getProxySessionAndCloseOthers(const JID& proxyJID, const std::string& sessionID) { // checking parameters if (proxySessions_.find(sessionID) == proxySessions_.end()) { - return boost::shared_ptr(); + return std::shared_ptr(); } // get active session - boost::shared_ptr activeSession; + std::shared_ptr activeSession; for (ProxyJIDClientSessionVector::iterator i = proxySessions_[sessionID].begin(); i != proxySessions_[sessionID].end(); i++) { i->second->onSessionReady.disconnect(boost::bind(&SOCKS5BytestreamProxiesManager::handleProxySessionReady, this,sessionID, proxyJID, i->second, _1)); i->second->onFinished.disconnect(boost::bind(&SOCKS5BytestreamProxiesManager::handleProxySessionFinished, this, sessionID, proxyJID, i->second, _1)); @@ -107,8 +108,8 @@ boost::shared_ptr SOCKS5BytestreamProxiesManager: return activeSession; } -boost::shared_ptr SOCKS5BytestreamProxiesManager::createSOCKS5BytestreamClientSession(HostAddressPort addressPort, const std::string& destAddr) { - SOCKS5BytestreamClientSession::ref connection = boost::make_shared(connectionFactory_->createConnection(), addressPort, destAddr, timerFactory_); +std::shared_ptr SOCKS5BytestreamProxiesManager::createSOCKS5BytestreamClientSession(HostAddressPort addressPort, const std::string& destAddr) { + SOCKS5BytestreamClientSession::ref connection = std::make_shared(connectionFactory_->createConnection(), addressPort, destAddr, timerFactory_); return connection; } @@ -146,7 +147,7 @@ void SOCKS5BytestreamProxiesManager::handleNameLookupResult(const std::vectorgetStreamHost().get(); - S5BProxyRequest::ref proxyForAddress = boost::make_shared(*proxy); + S5BProxyRequest::ref proxyForAddress = std::make_shared(*proxy); streamHost.host = address.toString(); proxyForAddress->setStreamHost(streamHost); addS5BProxy(proxyForAddress); @@ -157,13 +158,13 @@ void SOCKS5BytestreamProxiesManager::handleNameLookupResult(const std::vector(serviceRoot_, iqRouter_); + proxyFinder_ = std::make_shared(serviceRoot_, iqRouter_); proxyFinder_->onProxiesFound.connect(boost::bind(&SOCKS5BytestreamProxiesManager::handleProxiesFound, this, _1)); proxyFinder_->start(); } -void SOCKS5BytestreamProxiesManager::handleProxySessionReady(const std::string& sessionID, const JID& jid, boost::shared_ptr session, bool error) { +void SOCKS5BytestreamProxiesManager::handleProxySessionReady(const std::string& sessionID, const JID& jid, std::shared_ptr session, bool error) { session->onSessionReady.disconnect(boost::bind(&SOCKS5BytestreamProxiesManager::handleProxySessionReady, this, boost::cref(sessionID), boost::cref(jid), session, _1)); if (!error) { // The SOCKS5 bytestream session to the proxy succeeded; stop and remove other sessions. @@ -181,7 +182,7 @@ void SOCKS5BytestreamProxiesManager::handleProxySessionReady(const std::string& } } -void SOCKS5BytestreamProxiesManager::handleProxySessionFinished(const std::string& sessionID, const JID& jid, boost::shared_ptr session, boost::optional error) { +void SOCKS5BytestreamProxiesManager::handleProxySessionFinished(const std::string& sessionID, const JID& jid, std::shared_ptr session, boost::optional error) { session->onFinished.disconnect(boost::bind(&SOCKS5BytestreamProxiesManager::handleProxySessionFinished, this, sessionID, jid, session, _1)); if (error.is_initialized()) { // The SOCKS5 bytestream session to the proxy failed; remove it. diff --git a/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.h b/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.h index b490ffa..0b566f3 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.h +++ b/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -49,9 +49,9 @@ namespace Swift { const boost::optional >& getOrDiscoverS5BProxies(); void connectToProxies(const std::string& sessionID); - boost::shared_ptr getProxySessionAndCloseOthers(const JID& proxyJID, const std::string& sessionID); + std::shared_ptr getProxySessionAndCloseOthers(const JID& proxyJID, const std::string& sessionID); - boost::shared_ptr createSOCKS5BytestreamClientSession(HostAddressPort addressPort, const std::string& destAddr); + std::shared_ptr createSOCKS5BytestreamClientSession(HostAddressPort addressPort, const std::string& destAddr); public: boost::signal onDiscoveredProxiesChanged; @@ -62,8 +62,8 @@ namespace Swift { void queryForProxies(); - void handleProxySessionReady(const std::string& sessionID, const JID& jid, boost::shared_ptr session, bool error); - void handleProxySessionFinished(const std::string& sessionID, const JID& jid, boost::shared_ptr session, boost::optional error); + void handleProxySessionReady(const std::string& sessionID, const JID& jid, std::shared_ptr session, bool error); + void handleProxySessionFinished(const std::string& sessionID, const JID& jid, std::shared_ptr session, boost::optional error); private: ConnectionFactory* connectionFactory_; @@ -72,11 +72,11 @@ namespace Swift { IQRouter* iqRouter_; JID serviceRoot_; - typedef std::vector > > ProxyJIDClientSessionVector; + typedef std::vector > > ProxyJIDClientSessionVector; typedef std::map ProxySessionsMap; ProxySessionsMap proxySessions_; - boost::shared_ptr proxyFinder_; + std::shared_ptr proxyFinder_; boost::optional > localS5BProxies_; }; diff --git a/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.cpp b/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.cpp index e6c85cf..9624d4c 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.cpp +++ b/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.cpp @@ -5,15 +5,16 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include +#include + #include -#include #include #include @@ -30,14 +31,14 @@ SOCKS5BytestreamProxyFinder::~SOCKS5BytestreamProxyFinder() { } void SOCKS5BytestreamProxyFinder::start() { - serviceWalker = boost::make_shared(service, iqRouter); + serviceWalker = std::make_shared(service, iqRouter); serviceWalker->onServiceFound.connect(boost::bind(&SOCKS5BytestreamProxyFinder::handleServiceFound, this, _1, _2)); serviceWalker->onWalkComplete.connect(boost::bind(&SOCKS5BytestreamProxyFinder::handleWalkEnded, this)); serviceWalker->beginWalk(); } void SOCKS5BytestreamProxyFinder::stop() { - typedef boost::shared_ptr > S5BProxyRequestGenericRequest; + typedef std::shared_ptr > S5BProxyRequestGenericRequest; foreach (S5BProxyRequestGenericRequest requester, pendingRequests) { requester->onResponse.disconnect(boost::bind(&SOCKS5BytestreamProxyFinder::handleProxyResponse, this, requester, _1, _2)); } @@ -49,14 +50,14 @@ void SOCKS5BytestreamProxyFinder::stop() { } void SOCKS5BytestreamProxyFinder::sendBytestreamQuery(const JID& jid) { - S5BProxyRequest::ref proxyRequest = boost::make_shared(); - boost::shared_ptr > request = boost::make_shared >(IQ::Get, jid, proxyRequest, iqRouter); + S5BProxyRequest::ref proxyRequest = std::make_shared(); + std::shared_ptr > request = std::make_shared >(IQ::Get, jid, proxyRequest, iqRouter); request->onResponse.connect(boost::bind(&SOCKS5BytestreamProxyFinder::handleProxyResponse, this, request, _1, _2)); pendingRequests.insert(request); request->send(); } -void SOCKS5BytestreamProxyFinder::handleServiceFound(const JID& jid, boost::shared_ptr discoInfo) { +void SOCKS5BytestreamProxyFinder::handleServiceFound(const JID& jid, std::shared_ptr discoInfo) { if (discoInfo->hasFeature(DiscoInfo::Bytestream)) { sendBytestreamQuery(jid); } @@ -68,7 +69,7 @@ void SOCKS5BytestreamProxyFinder::handleWalkEnded() { } } -void SOCKS5BytestreamProxyFinder::handleProxyResponse(boost::shared_ptr > requester, boost::shared_ptr request, ErrorPayload::ref error) { +void SOCKS5BytestreamProxyFinder::handleProxyResponse(std::shared_ptr > requester, std::shared_ptr request, ErrorPayload::ref error) { requester->onResponse.disconnect(boost::bind(&SOCKS5BytestreamProxyFinder::handleProxyResponse, this, requester, _1, _2)); pendingRequests.erase(requester); if (error) { diff --git a/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.h b/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.h index 1047df0..55e499e 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.h +++ b/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -13,7 +13,7 @@ #pragma once -#include +#include #include #include @@ -36,21 +36,21 @@ class SWIFTEN_API SOCKS5BytestreamProxyFinder { void start(); void stop(); - boost::signal >)> onProxiesFound; + boost::signal >)> onProxiesFound; private: void sendBytestreamQuery(const JID&); - void handleServiceFound(const JID&, boost::shared_ptr); - void handleProxyResponse(boost::shared_ptr > requester, boost::shared_ptr, ErrorPayload::ref); + void handleServiceFound(const JID&, std::shared_ptr); + void handleProxyResponse(std::shared_ptr > requester, std::shared_ptr, ErrorPayload::ref); void handleWalkEnded(); private: JID service; IQRouter* iqRouter; - boost::shared_ptr serviceWalker; + std::shared_ptr serviceWalker; std::vector proxyHosts; - std::set > > pendingRequests; + std::set > > pendingRequests; }; } diff --git a/Swiften/FileTransfer/SOCKS5BytestreamRegistry.cpp b/Swiften/FileTransfer/SOCKS5BytestreamRegistry.cpp index 2f66dff..1591e24 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamRegistry.cpp +++ b/Swiften/FileTransfer/SOCKS5BytestreamRegistry.cpp @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010-2013 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include +#include #include #include diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServer.cpp b/Swiften/FileTransfer/SOCKS5BytestreamServer.cpp index f25227a..b68bd58 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamServer.cpp +++ b/Swiften/FileTransfer/SOCKS5BytestreamServer.cpp @@ -18,7 +18,7 @@ namespace Swift { SOCKS5BytestreamServer::SOCKS5BytestreamServer( - boost::shared_ptr connectionServer, + std::shared_ptr connectionServer, SOCKS5BytestreamRegistry* registry) : connectionServer(connectionServer), registry(registry) { @@ -30,16 +30,16 @@ void SOCKS5BytestreamServer::start() { void SOCKS5BytestreamServer::stop() { connectionServer->onNewConnection.disconnect(boost::bind(&SOCKS5BytestreamServer::handleNewConnection, this, _1)); - foreach (boost::shared_ptr session, sessions) { + foreach (std::shared_ptr session, sessions) { session->onFinished.disconnect(boost::bind(&SOCKS5BytestreamServer::handleSessionFinished, this, session)); session->stop(); } sessions.clear(); } -void SOCKS5BytestreamServer::handleNewConnection(boost::shared_ptr connection) { - boost::shared_ptr session = - boost::make_shared(connection, registry); +void SOCKS5BytestreamServer::handleNewConnection(std::shared_ptr connection) { + std::shared_ptr session = + std::make_shared(connection, registry); session->onFinished.connect(boost::bind(&SOCKS5BytestreamServer::handleSessionFinished, this, session)); sessions.push_back(session); session->start(); @@ -49,10 +49,10 @@ HostAddressPort SOCKS5BytestreamServer::getAddressPort() const { return connectionServer->getAddressPort(); } -std::vector< boost::shared_ptr > SOCKS5BytestreamServer::getSessions( +std::vector< std::shared_ptr > SOCKS5BytestreamServer::getSessions( const std::string& streamID) const { - std::vector< boost::shared_ptr > result; - foreach (boost::shared_ptr session, sessions) { + std::vector< std::shared_ptr > result; + foreach (std::shared_ptr session, sessions) { if (session->getStreamID() == streamID) { result.push_back(session); } @@ -60,7 +60,7 @@ std::vector< boost::shared_ptr > SOCKS5Bytestream return result; } -void SOCKS5BytestreamServer::handleSessionFinished(boost::shared_ptr session) { +void SOCKS5BytestreamServer::handleSessionFinished(std::shared_ptr session) { sessions.erase(std::remove(sessions.begin(), sessions.end(), session), sessions.end()); session->onFinished.disconnect(boost::bind(&SOCKS5BytestreamServer::handleSessionFinished, this, session)); } diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServer.h b/Swiften/FileTransfer/SOCKS5BytestreamServer.h index f9b293e..c8866c4 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamServer.h +++ b/Swiften/FileTransfer/SOCKS5BytestreamServer.h @@ -7,10 +7,9 @@ #pragma once #include +#include #include -#include - #include #include #include @@ -24,7 +23,7 @@ namespace Swift { class SWIFTEN_API SOCKS5BytestreamServer { public: SOCKS5BytestreamServer( - boost::shared_ptr connectionServer, + std::shared_ptr connectionServer, SOCKS5BytestreamRegistry* registry); HostAddressPort getAddressPort() const; @@ -32,18 +31,18 @@ namespace Swift { void start(); void stop(); - std::vector< boost::shared_ptr > getSessions(const std::string& id) const; + std::vector< std::shared_ptr > getSessions(const std::string& id) const; private: - void handleNewConnection(boost::shared_ptr connection); - void handleSessionFinished(boost::shared_ptr); + void handleNewConnection(std::shared_ptr connection); + void handleSessionFinished(std::shared_ptr); private: friend class SOCKS5BytestreamServerSession; - boost::shared_ptr connectionServer; + std::shared_ptr connectionServer; SOCKS5BytestreamRegistry* registry; - std::vector > sessions; + std::vector > sessions; }; } diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp b/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp index 22a07fd..33a5283 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp +++ b/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp @@ -12,8 +12,9 @@ #include +#include + #include -#include #include #include @@ -59,10 +60,10 @@ SOCKS5BytestreamServerManager::~SOCKS5BytestreamServerManager() { } } -boost::shared_ptr SOCKS5BytestreamServerManager::aquireResourceUser() { - boost::shared_ptr resourceUser; +std::shared_ptr SOCKS5BytestreamServerManager::aquireResourceUser() { + std::shared_ptr resourceUser; if (s5bServerResourceUser_.expired()) { - resourceUser = boost::make_shared(this); + resourceUser = std::make_shared(this); s5bServerResourceUser_ = resourceUser; } else { @@ -71,10 +72,10 @@ boost::shared_ptr SOCKS5BytestreamServerMana return resourceUser; } -boost::shared_ptr SOCKS5BytestreamServerManager::aquirePortForwardingUser() { - boost::shared_ptr portForwardingUser; +std::shared_ptr SOCKS5BytestreamServerManager::aquirePortForwardingUser() { + std::shared_ptr portForwardingUser; if (s5bServerPortForwardingUser_.expired()) { - portForwardingUser = boost::make_shared(this); + portForwardingUser = std::make_shared(this); s5bServerPortForwardingUser_ = portForwardingUser; } else { diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerManager.h b/Swiften/FileTransfer/SOCKS5BytestreamServerManager.h index ab12dfe..98b5bea 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamServerManager.h +++ b/Swiften/FileTransfer/SOCKS5BytestreamServerManager.h @@ -6,11 +6,9 @@ #pragma once +#include #include -#include -#include - #include #include #include @@ -41,8 +39,8 @@ namespace Swift { NATTraverser* natTraverser); ~SOCKS5BytestreamServerManager(); - boost::shared_ptr aquireResourceUser(); - boost::shared_ptr aquirePortForwardingUser(); + std::shared_ptr aquireResourceUser(); + std::shared_ptr aquirePortForwardingUser(); void stop(); @@ -78,18 +76,18 @@ namespace Swift { NATTraverser* natTraverser; enum { Start, Initializing, Initialized } state; SOCKS5BytestreamServer* server; - boost::shared_ptr connectionServer; + std::shared_ptr connectionServer; int connectionServerPort; - boost::shared_ptr getPublicIPRequest; - boost::shared_ptr forwardPortRequest; - boost::shared_ptr unforwardPortRequest; + std::shared_ptr getPublicIPRequest; + std::shared_ptr forwardPortRequest; + std::shared_ptr unforwardPortRequest; boost::optional publicAddress; boost::optional portMapping; bool attemptedPortMapping_; - boost::weak_ptr s5bServerResourceUser_; - boost::weak_ptr s5bServerPortForwardingUser_; + std::weak_ptr s5bServerResourceUser_; + std::weak_ptr s5bServerPortForwardingUser_; }; } diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp index e2d46f4..bc4e8e4 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp +++ b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp @@ -21,7 +21,7 @@ namespace Swift { SOCKS5BytestreamServerSession::SOCKS5BytestreamServerSession( - boost::shared_ptr connection, + std::shared_ptr connection, SOCKS5BytestreamRegistry* bytestreams) : connection(connection), bytestreams(bytestreams), @@ -49,7 +49,7 @@ void SOCKS5BytestreamServerSession::stop() { finish(); } -void SOCKS5BytestreamServerSession::startSending(boost::shared_ptr stream) { +void SOCKS5BytestreamServerSession::startSending(std::shared_ptr stream) { if (state != ReadyForTransfer) { SWIFT_LOG(debug) << "Not ready for transfer!" << std::endl; return; } readBytestream = stream; @@ -61,7 +61,7 @@ void SOCKS5BytestreamServerSession::startSending(boost::shared_ptr stream) { +void SOCKS5BytestreamServerSession::startReceiving(std::shared_ptr stream) { if (state != ReadyForTransfer) { SWIFT_LOG(debug) << "Not ready for transfer!" << std::endl; return; } writeBytestream = stream; @@ -75,7 +75,7 @@ HostAddressPort SOCKS5BytestreamServerSession::getAddressPort() const { return connection->getLocalAddress(); } -void SOCKS5BytestreamServerSession::handleDataRead(boost::shared_ptr data) { +void SOCKS5BytestreamServerSession::handleDataRead(std::shared_ptr data) { if (state != ReadingData) { append(unprocessedData, *data); process(); diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h index a90e8c5..d530a06 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h +++ b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -20,7 +20,7 @@ namespace Swift { class SWIFTEN_API SOCKS5BytestreamServerSession { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: enum State { @@ -33,7 +33,7 @@ namespace Swift { Finished }; - SOCKS5BytestreamServerSession(boost::shared_ptr connection, SOCKS5BytestreamRegistry* registry); + SOCKS5BytestreamServerSession(std::shared_ptr connection, SOCKS5BytestreamRegistry* registry); ~SOCKS5BytestreamServerSession(); void setChunkSize(int chunkSize) { @@ -43,8 +43,8 @@ namespace Swift { void start(); void stop(); - void startSending(boost::shared_ptr); - void startReceiving(boost::shared_ptr); + void startSending(std::shared_ptr); + void startReceiving(std::shared_ptr); HostAddressPort getAddressPort() const; @@ -58,20 +58,20 @@ namespace Swift { private: void finish(const boost::optional& error = boost::optional()); void process(); - void handleDataRead(boost::shared_ptr); + void handleDataRead(std::shared_ptr); void handleDisconnected(const boost::optional&); void handleDataAvailable(); void sendData(); private: - boost::shared_ptr connection; + std::shared_ptr connection; SOCKS5BytestreamRegistry* bytestreams; ByteArray unprocessedData; State state; int chunkSize; std::string streamID; - boost::shared_ptr readBytestream; - boost::shared_ptr writeBytestream; + std::shared_ptr readBytestream; + std::shared_ptr writeBytestream; bool waitingForData; boost::bsignals::connection disconnectedConnection; diff --git a/Swiften/FileTransfer/StreamInitiationRequest.h b/Swiften/FileTransfer/StreamInitiationRequest.h index c03fae6..44e826c 100644 --- a/Swiften/FileTransfer/StreamInitiationRequest.h +++ b/Swiften/FileTransfer/StreamInitiationRequest.h @@ -13,21 +13,21 @@ namespace Swift { class SWIFTEN_API StreamInitiationRequest : public GenericRequest { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; - static ref create(const JID& jid, boost::shared_ptr payload, IQRouter* router) { + static ref create(const JID& jid, std::shared_ptr payload, IQRouter* router) { return ref(new StreamInitiationRequest(jid, payload, router)); } - static ref create(const JID& from, const JID& to, boost::shared_ptr payload, IQRouter* router) { + static ref create(const JID& from, const JID& to, std::shared_ptr payload, IQRouter* router) { return ref(new StreamInitiationRequest(from, to, payload, router)); } private: - StreamInitiationRequest(const JID& jid, boost::shared_ptr payload, IQRouter* router) : GenericRequest(IQ::Set, jid, payload, router) { + StreamInitiationRequest(const JID& jid, std::shared_ptr payload, IQRouter* router) : GenericRequest(IQ::Set, jid, payload, router) { } - StreamInitiationRequest(const JID& from, const JID& to, boost::shared_ptr payload, IQRouter* router) : GenericRequest(IQ::Set, from, to, payload, router) { + StreamInitiationRequest(const JID& from, const JID& to, std::shared_ptr payload, IQRouter* router) : GenericRequest(IQ::Set, from, to, payload, router) { } }; } diff --git a/Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h b/Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h index 70d25a5..03e2476 100644 --- a/Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h +++ b/Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h @@ -33,7 +33,7 @@ namespace Swift { const JID&, const boost::filesystem::path&, const std::string&, - boost::shared_ptr, + std::shared_ptr, const FileTransferOptions&) SWIFTEN_OVERRIDE { return OutgoingFileTransfer::ref(); } @@ -44,12 +44,12 @@ namespace Swift { const std::string&, const boost::uintmax_t, const boost::posix_time::ptime&, - boost::shared_ptr, + std::shared_ptr, const FileTransferOptions&) SWIFTEN_OVERRIDE { return OutgoingFileTransfer::ref(); } - virtual void addS5BProxy(boost::shared_ptr) { + virtual void addS5BProxy(std::shared_ptr) { } }; diff --git a/Swiften/FileTransfer/UnitTest/DummyFileTransferTransporterFactory.h b/Swiften/FileTransfer/UnitTest/DummyFileTransferTransporterFactory.h index f3972ab..5db3368 100644 --- a/Swiften/FileTransfer/UnitTest/DummyFileTransferTransporterFactory.h +++ b/Swiften/FileTransfer/UnitTest/DummyFileTransferTransporterFactory.h @@ -84,37 +84,37 @@ public: virtual void stopActivatingProxy() { } - virtual boost::shared_ptr createIBBSendSession(const std::string& sessionID, unsigned int blockSize, boost::shared_ptr stream) { - boost::shared_ptr ibbSession = boost::make_shared( + virtual std::shared_ptr createIBBSendSession(const std::string& sessionID, unsigned int blockSize, std::shared_ptr stream) { + std::shared_ptr ibbSession = std::make_shared( sessionID, initiator_, responder_, stream, iqRouter_); ibbSession->setBlockSize(blockSize); - return boost::make_shared(ibbSession); + return std::make_shared(ibbSession); } - virtual boost::shared_ptr createIBBReceiveSession(const std::string& sessionID, unsigned long long size, boost::shared_ptr stream) { - boost::shared_ptr ibbSession = boost::make_shared( + virtual std::shared_ptr createIBBReceiveSession(const std::string& sessionID, unsigned long long size, std::shared_ptr stream) { + std::shared_ptr ibbSession = std::make_shared( sessionID, initiator_, responder_, size, stream, iqRouter_); - return boost::make_shared(ibbSession); + return std::make_shared(ibbSession); } - virtual boost::shared_ptr createRemoteCandidateSession( - boost::shared_ptr, const JingleS5BTransportPayload::Candidate& /* candidate */) { - return boost::shared_ptr(); + virtual std::shared_ptr createRemoteCandidateSession( + std::shared_ptr, const JingleS5BTransportPayload::Candidate& /* candidate */) { + return std::shared_ptr(); } - virtual boost::shared_ptr createRemoteCandidateSession( - boost::shared_ptr, const JingleS5BTransportPayload::Candidate& /* candidate */) { - return boost::shared_ptr(); + virtual std::shared_ptr createRemoteCandidateSession( + std::shared_ptr, const JingleS5BTransportPayload::Candidate& /* candidate */) { + return std::shared_ptr(); } - virtual boost::shared_ptr createLocalCandidateSession( - boost::shared_ptr, const JingleS5BTransportPayload::Candidate& /* candidate */) { - return boost::shared_ptr(); + virtual std::shared_ptr createLocalCandidateSession( + std::shared_ptr, const JingleS5BTransportPayload::Candidate& /* candidate */) { + return std::shared_ptr(); } - virtual boost::shared_ptr createLocalCandidateSession( - boost::shared_ptr, const JingleS5BTransportPayload::Candidate& /* candidate */) { - return boost::shared_ptr(); + virtual std::shared_ptr createLocalCandidateSession( + std::shared_ptr, const JingleS5BTransportPayload::Candidate& /* candidate */) { + return std::shared_ptr(); } private: diff --git a/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp b/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp index d78f4f0..31f46de 100644 --- a/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp +++ b/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp @@ -5,10 +5,10 @@ */ +#include #include #include -#include #include #include @@ -38,7 +38,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture { stanzaChannel = new DummyStanzaChannel(); iqRouter = new IQRouter(stanzaChannel); finished = false; - bytestream = boost::make_shared(); + bytestream = std::make_shared(); } void tearDown() { @@ -47,7 +47,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture { } void testOpen() { - boost::shared_ptr testling(createSession("foo@bar.com/baz", "mysession")); + std::shared_ptr testling(createSession("foo@bar.com/baz", "mysession")); testling->start(); stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open")); @@ -58,7 +58,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture { } void testReceiveData() { - boost::shared_ptr testling(createSession("foo@bar.com/baz", "mysession")); + std::shared_ptr testling(createSession("foo@bar.com/baz", "mysession")); testling->start(); stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open")); @@ -72,7 +72,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture { } void testReceiveMultipleData() { - boost::shared_ptr testling(createSession("foo@bar.com/baz", "mysession")); + std::shared_ptr testling(createSession("foo@bar.com/baz", "mysession")); testling->start(); stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open")); @@ -87,7 +87,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture { } void testReceiveDataForOtherSession() { - boost::shared_ptr testling(createSession("foo@bar.com/baz", "mysession")); + std::shared_ptr testling(createSession("foo@bar.com/baz", "mysession")); testling->start(); stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open")); @@ -99,7 +99,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture { } void testReceiveDataOutOfOrder() { - boost::shared_ptr testling(createSession("foo@bar.com/baz", "mysession")); + std::shared_ptr testling(createSession("foo@bar.com/baz", "mysession")); testling->start(); stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open")); @@ -114,7 +114,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture { } void testReceiveLastData() { - boost::shared_ptr testling(createSession("foo@bar.com/baz", "mysession", 6)); + std::shared_ptr testling(createSession("foo@bar.com/baz", "mysession", 6)); testling->start(); stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open")); @@ -130,7 +130,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture { } void testReceiveClose() { - boost::shared_ptr testling(createSession("foo@bar.com/baz", "mysession")); + std::shared_ptr testling(createSession("foo@bar.com/baz", "mysession")); testling->start(); stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open")); @@ -143,7 +143,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture { } void testStopWhileActive() { - boost::shared_ptr testling(createSession("foo@bar.com/baz", "mysession")); + std::shared_ptr testling(createSession("foo@bar.com/baz", "mysession")); testling->start(); stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open")); @@ -181,7 +181,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture { IQRouter* iqRouter; bool finished; boost::optional error; - boost::shared_ptr bytestream; + std::shared_ptr bytestream; }; CPPUNIT_TEST_SUITE_REGISTRATION(IBBReceiveSessionTest); diff --git a/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp b/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp index e417c77..f9057f8 100644 --- a/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp +++ b/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp @@ -39,7 +39,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture { void setUp() { stanzaChannel = new DummyStanzaChannel(); iqRouter = new IQRouter(stanzaChannel); - bytestream = boost::make_shared(createByteArray("abcdefg")); + bytestream = std::make_shared(createByteArray("abcdefg")); finished = false; } @@ -49,7 +49,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture { } void testStart() { - boost::shared_ptr testling = createSession("foo@bar.com/baz"); + std::shared_ptr testling = createSession("foo@bar.com/baz"); testling->setBlockSize(1234); testling->start(); @@ -63,7 +63,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture { } void testStart_ResponseStartsSending() { - boost::shared_ptr testling = createSession("foo@bar.com/baz"); + std::shared_ptr testling = createSession("foo@bar.com/baz"); testling->setBlockSize(3); testling->start(); @@ -79,7 +79,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture { } void testResponseContinuesSending() { - boost::shared_ptr testling = createSession("foo@bar.com/baz"); + std::shared_ptr testling = createSession("foo@bar.com/baz"); testling->setBlockSize(3); testling->start(); stanzaChannel->onIQReceived(createIBBResult()); @@ -95,7 +95,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture { } void testRespondToAllFinishes() { - boost::shared_ptr testling = createSession("foo@bar.com/baz"); + std::shared_ptr testling = createSession("foo@bar.com/baz"); testling->setBlockSize(3); testling->start(); stanzaChannel->onIQReceived(createIBBResult()); @@ -108,7 +108,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture { } void testErrorResponseFinishesWithError() { - boost::shared_ptr testling = createSession("foo@bar.com/baz"); + std::shared_ptr testling = createSession("foo@bar.com/baz"); testling->setBlockSize(3); testling->start(); stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID())); @@ -118,7 +118,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture { } void testStopDuringSessionCloses() { - boost::shared_ptr testling = createSession("foo@bar.com/baz"); + std::shared_ptr testling = createSession("foo@bar.com/baz"); testling->setBlockSize(3); testling->start(); testling->stop(); @@ -133,7 +133,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture { } void testStopAfterFinishedDoesNotClose() { - boost::shared_ptr testling = createSession("foo@bar.com/baz"); + std::shared_ptr testling = createSession("foo@bar.com/baz"); testling->setBlockSize(16); testling->start(); stanzaChannel->onIQReceived(createIBBResult()); @@ -146,7 +146,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture { } void testDataStreamPauseStopsSendingData() { - boost::shared_ptr testling = createSession("foo@bar.com/baz"); + std::shared_ptr testling = createSession("foo@bar.com/baz"); bytestream->setDataComplete(false); testling->setBlockSize(3); testling->start(); @@ -162,7 +162,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture { } void testDataStreamResumeAfterPauseSendsData() { - boost::shared_ptr testling = createSession("foo@bar.com/baz"); + std::shared_ptr testling = createSession("foo@bar.com/baz"); bytestream->setDataComplete(false); testling->setBlockSize(3); testling->start(); @@ -177,7 +177,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture { } void testDataStreamResumeBeforePauseDoesNotSendData() { - boost::shared_ptr testling = createSession("foo@bar.com/baz"); + std::shared_ptr testling = createSession("foo@bar.com/baz"); bytestream->setDataComplete(false); testling->setBlockSize(3); testling->start(); @@ -189,7 +189,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture { } void testDataStreamResumeAfterResumeDoesNotSendData() { - boost::shared_ptr testling = createSession("foo@bar.com/baz"); + std::shared_ptr testling = createSession("foo@bar.com/baz"); bytestream->setDataComplete(false); testling->setBlockSize(3); testling->start(); @@ -206,12 +206,12 @@ class IBBSendSessionTest : public CppUnit::TestFixture { private: IQ::ref createIBBResult() { - return IQ::createResult(JID("baz@fum.com/dum"), stanzaChannel->sentStanzas[stanzaChannel->sentStanzas.size()-1]->getTo(), stanzaChannel->sentStanzas[stanzaChannel->sentStanzas.size()-1]->getID(), boost::shared_ptr()); + return IQ::createResult(JID("baz@fum.com/dum"), stanzaChannel->sentStanzas[stanzaChannel->sentStanzas.size()-1]->getTo(), stanzaChannel->sentStanzas[stanzaChannel->sentStanzas.size()-1]->getID(), std::shared_ptr()); } private: - boost::shared_ptr createSession(const std::string& to) { - boost::shared_ptr session(new IBBSendSession("myid", JID(), JID(to), bytestream, iqRouter)); + std::shared_ptr createSession(const std::string& to) { + std::shared_ptr session(new IBBSendSession("myid", JID(), JID(to), bytestream, iqRouter)); session->onFinished.connect(boost::bind(&IBBSendSessionTest::handleFinished, this, _1)); return session; } @@ -226,7 +226,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture { IQRouter* iqRouter; bool finished; boost::optional error; - boost::shared_ptr bytestream; + std::shared_ptr bytestream; }; CPPUNIT_TEST_SUITE_REGISTRATION(IBBSendSessionTest); diff --git a/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp b/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp index a76773c..72b933d 100644 --- a/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp +++ b/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp @@ -5,14 +5,13 @@ */ /* - * Copyright (c) 2013-2015 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include - -#include +#include #include #include @@ -45,7 +44,6 @@ #include using namespace Swift; -using namespace boost; class IncomingJingleFileTransferTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(IncomingJingleFileTransferTest); @@ -54,9 +52,9 @@ class IncomingJingleFileTransferTest : public CppUnit::TestFixture { //CPPUNIT_TEST(test_AcceptFailingS5BFallsBackToIBB); CPPUNIT_TEST_SUITE_END(); public: - shared_ptr createTestling() { + std::shared_ptr createTestling() { JID ourJID("our@jid.org/full"); - return boost::make_shared(ourJID, shared_ptr(session), jingleContentPayload, ftTransporterFactory, timerFactory, crypto.get()); + return std::make_shared(ourJID, std::shared_ptr(session), jingleContentPayload, ftTransporterFactory, timerFactory, crypto.get()); } IQ::ref createIBBRequest(IBB::ref ibb, const JID& from, const std::string& id) { @@ -66,13 +64,13 @@ public: } void setUp() { - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); eventLoop = new DummyEventLoop(); resolver = new StaticDomainNameResolver(eventLoop); - session = boost::make_shared("foo@bar.com/baz", "mysession"); - jingleContentPayload = make_shared(); - // fakeRJTCSF = make_shared(); - // fakeLJTCF = make_shared(); + session = std::make_shared("foo@bar.com/baz", "mysession"); + jingleContentPayload = std::make_shared(); + // fakeRJTCSF = std::make_shared(); + // fakeLJTCF = std::make_shared(); stanzaChannel = new DummyStanzaChannel(); connectionFactory = new DummyConnectionFactory(eventLoop); serverConnectionFactory = new DummyConnectionServerFactory(eventLoop); @@ -108,17 +106,17 @@ public: // Tests whether IncomingJingleFileTransfer would accept a IBB only file transfer. void test_AcceptOnyIBBSendsSessionAccept() { //1. create your test incoming file transfer - shared_ptr desc = make_shared(); + std::shared_ptr desc = std::make_shared(); desc->setFileInfo(JingleFileTransferFileInfo("foo.txt", "", 10)); jingleContentPayload->addDescription(desc); - JingleIBBTransportPayload::ref tpRef = make_shared(); + JingleIBBTransportPayload::ref tpRef = std::make_shared(); tpRef->setSessionID("mysession"); jingleContentPayload->addTransport(tpRef); - shared_ptr fileTransfer = createTestling(); + std::shared_ptr fileTransfer = createTestling(); //2. do 'accept' on a dummy writebytestream (you'll have to look if there already is one) - shared_ptr byteStream = make_shared(); + std::shared_ptr byteStream = std::make_shared(); fileTransfer->accept(byteStream); // check whether accept has been called @@ -127,17 +125,17 @@ public: void test_OnlyIBBTransferReceiveWorks() { //1. create your test incoming file transfer - shared_ptr desc = make_shared(); + std::shared_ptr desc = std::make_shared(); desc->setFileInfo(JingleFileTransferFileInfo("file.txt", "", 10)); jingleContentPayload->addDescription(desc); - JingleIBBTransportPayload::ref tpRef = make_shared(); + JingleIBBTransportPayload::ref tpRef = std::make_shared(); tpRef->setSessionID("mysession"); jingleContentPayload->addTransport(tpRef); - shared_ptr fileTransfer = createTestling(); + std::shared_ptr fileTransfer = createTestling(); //2. do 'accept' on a dummy writebytestream (you'll have to look if there already is one) - shared_ptr byteStream = make_shared(); + std::shared_ptr byteStream = std::make_shared(); fileTransfer->accept(byteStream); // check whether accept has been called @@ -154,10 +152,10 @@ public: // add SOCKS5BytestreamTransportPayload JingleS5BTransportPayload::ref payLoad = addJingleS5BPayload(); - shared_ptr fileTransfer = createTestling(); + std::shared_ptr fileTransfer = createTestling(); //2. do 'accept' on a dummy writebytestream (you'll have to look if there already is one) - shared_ptr byteStream = make_shared(); + std::shared_ptr byteStream = std::make_shared(); fileTransfer->accept(byteStream); // candidates are gathered @@ -168,7 +166,7 @@ public: // check for candidate error FakeJingleSession::InfoTransportCall infoTransportCall = getCall(1); - JingleS5BTransportPayload::ref s5bPayload = dynamic_pointer_cast(infoTransportCall.payload); + JingleS5BTransportPayload::ref s5bPayload = std::dynamic_pointer_cast(infoTransportCall.payload); CPPUNIT_ASSERT(s5bPayload->hasCandidateError()); // indicate transport replace (Romeo) @@ -189,20 +187,20 @@ public: #endif private: void addFileTransferDescription() { - shared_ptr desc = make_shared(); + std::shared_ptr desc = std::make_shared(); desc->setFileInfo(JingleFileTransferFileInfo("file.txt", "", 10)); jingleContentPayload->addDescription(desc); } - shared_ptr addJingleS5BPayload() { - JingleS5BTransportPayload::ref payLoad = make_shared(); + std::shared_ptr addJingleS5BPayload() { + JingleS5BTransportPayload::ref payLoad = std::make_shared(); payLoad->setSessionID("mysession"); jingleContentPayload->addTransport(payLoad); return payLoad; } - shared_ptr addJingleIBBPayload() { - JingleIBBTransportPayload::ref payLoad = make_shared(); + std::shared_ptr addJingleIBBPayload() { + JingleIBBTransportPayload::ref payLoad = std::make_shared(); payLoad->setSessionID("mysession"); jingleContentPayload->addTransport(payLoad); return payLoad; @@ -222,9 +220,9 @@ private: private: EventLoop* eventLoop; - boost::shared_ptr crypto; - boost::shared_ptr session; - shared_ptr jingleContentPayload; + std::shared_ptr crypto; + std::shared_ptr session; + std::shared_ptr jingleContentPayload; // shared_ptr fakeRJTCSF; // shared_ptr fakeLJTCF; FileTransferTransporterFactory* ftTransporterFactory; diff --git a/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp b/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp index 401463c..3f4d20f 100644 --- a/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp +++ b/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp @@ -11,10 +11,10 @@ */ #include +#include #include #include -#include #include #include @@ -81,16 +81,16 @@ class OutgoingJingleFileTransferTest : public CppUnit::TestFixture { public: - boost::shared_ptr createTestling(const FileTransferOptions& options = FileTransferOptions().withAssistedAllowed(false).withDirectAllowed(false).withProxiedAllowed(false)) { + std::shared_ptr createTestling(const FileTransferOptions& options = FileTransferOptions().withAssistedAllowed(false).withDirectAllowed(false).withProxiedAllowed(false)) { JID to("test@foo.com/bla"); JingleFileTransferFileInfo fileInfo; fileInfo.setDescription("some file"); fileInfo.setName("test.bin"); fileInfo.addHash(HashElement("sha-1", ByteArray())); fileInfo.setSize(1024 * 1024); - return boost::shared_ptr(new OutgoingJingleFileTransfer( + return std::shared_ptr(new OutgoingJingleFileTransfer( to, - boost::shared_ptr(fakeJingleSession), + std::shared_ptr(fakeJingleSession), stream, ftTransportFactory, timerFactory, @@ -107,9 +107,9 @@ public: } void setUp() { - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); fakeJingleSession = new FakeJingleSession("foo@bar.com/baz", "mysession"); - jingleContentPayload = boost::make_shared(); + jingleContentPayload = std::make_shared(); stanzaChannel = new DummyStanzaChannel(); iqRouter = new IQRouter(stanzaChannel); eventLoop = new DummyEventLoop(); @@ -126,7 +126,7 @@ public: data.push_back(34); } - stream = boost::make_shared(data); + stream = std::make_shared(data); idGen = new IDGenerator(); s5bProxy = new SOCKS5BytestreamProxiesManager(connectionFactory, timerFactory, resolver, iqRouter, "bar.com"); @@ -151,29 +151,29 @@ public: void test_SendSessionInitiateOnStart() { - boost::shared_ptr transfer = createTestling(); + std::shared_ptr transfer = createTestling(); transfer->start(); FakeJingleSession::InitiateCall call = getCall(0); - JingleFileTransferDescription::ref description = boost::dynamic_pointer_cast(call.description); + JingleFileTransferDescription::ref description = std::dynamic_pointer_cast(call.description); CPPUNIT_ASSERT(description); CPPUNIT_ASSERT(static_cast(1048576) == description->getFileInfo().getSize()); - JingleIBBTransportPayload::ref transport = boost::dynamic_pointer_cast(call.payload); + JingleIBBTransportPayload::ref transport = std::dynamic_pointer_cast(call.payload); CPPUNIT_ASSERT(transport); } void test_FallbackToIBBAfterFailingS5B() { - boost::shared_ptr transfer = createTestling(FileTransferOptions().withAssistedAllowed(true).withDirectAllowed(true).withProxiedAllowed(true)); + std::shared_ptr transfer = createTestling(FileTransferOptions().withAssistedAllowed(true).withDirectAllowed(true).withProxiedAllowed(true)); transfer->start(); FakeJingleSession::InitiateCall call = getCall(0); - CPPUNIT_ASSERT(boost::dynamic_pointer_cast(call.payload)); + CPPUNIT_ASSERT(std::dynamic_pointer_cast(call.payload)); fakeJingleSession->handleSessionAcceptReceived(call.id, call.description, call.payload); // send candidate failure - JingleS5BTransportPayload::ref candidateFailurePayload = boost::make_shared(); + JingleS5BTransportPayload::ref candidateFailurePayload = std::make_shared(); candidateFailurePayload->setCandidateError(true); candidateFailurePayload->setSessionID(call.payload->getSessionID()); fakeJingleSession->handleTransportInfoReceived(call.id, candidateFailurePayload); @@ -193,7 +193,7 @@ public: } void test_ReceiveSessionTerminateAfterSessionInitiate() { - boost::shared_ptr transfer = createTestling(); + std::shared_ptr transfer = createTestling(); transfer->start(); getCall(0); @@ -207,7 +207,7 @@ public: } void test_DeclineEmitsFinishedStateCanceled() { - boost::shared_ptr transfer = createTestling(); + std::shared_ptr transfer = createTestling(); transfer->start(); getCall(0); @@ -227,20 +227,20 @@ public: private: void addFileTransferDescription() { - boost::shared_ptr desc = boost::make_shared(); + std::shared_ptr desc = std::make_shared(); desc->setFileInfo(JingleFileTransferFileInfo()); jingleContentPayload->addDescription(desc); } - boost::shared_ptr addJingleS5BPayload() { - JingleS5BTransportPayload::ref payLoad = boost::make_shared(); + std::shared_ptr addJingleS5BPayload() { + JingleS5BTransportPayload::ref payLoad = std::make_shared(); payLoad->setSessionID("mysession"); jingleContentPayload->addTransport(payLoad); return payLoad; } - boost::shared_ptr addJingleIBBPayload() { - JingleIBBTransportPayload::ref payLoad = boost::make_shared(); + std::shared_ptr addJingleIBBPayload() { + JingleIBBTransportPayload::ref payLoad = std::make_shared(); payLoad->setSessionID("mysession"); jingleContentPayload->addTransport(payLoad); return payLoad; @@ -260,9 +260,9 @@ private: private: std::vector data; - boost::shared_ptr stream; + std::shared_ptr stream; FakeJingleSession* fakeJingleSession; - boost::shared_ptr jingleContentPayload; + std::shared_ptr jingleContentPayload; FileTransferTransporterFactory* ftTransportFactory; SOCKS5BytestreamServerManager* bytestreamServerManager; DummyStanzaChannel* stanzaChannel; @@ -274,7 +274,7 @@ private: DummyTimerFactory* timerFactory; DummyConnectionFactory* connectionFactory; DummyConnectionServerFactory* serverConnectionFactory; - boost::shared_ptr crypto; + std::shared_ptr crypto; NetworkEnvironment* networkEnvironment; NATTraverser* natTraverser; DomainNameResolver* resolver; diff --git a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp index 9690c09..5408cd4 100644 --- a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp +++ b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp @@ -10,11 +10,12 @@ * See the COPYING file for more information. */ +#include + #include #include #include #include -#include #include @@ -55,14 +56,14 @@ public: SOCKS5BytestreamClientSessionTest() : destinationAddressPort(HostAddressPort(HostAddress("127.0.0.1"), 8888)) {} void setUp() { - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); destination = "092a44d859d19c9eed676b551ee80025903351c2"; randomGen.seed(static_cast(time(nullptr))); eventLoop = new DummyEventLoop(); timerFactory = new DummyTimerFactory(); - connection = boost::make_shared(failingPorts, true, eventLoop); + connection = std::make_shared(failingPorts, true, eventLoop); //connection->onDataSent.connect(boost::bind(&SOCKS5BytestreamServerSessionTest::handleDataWritten, this, _1)); - //stream1 = boost::make_shared(createByteArray("abcdefg"))); + //stream1 = std::make_shared(createByteArray("abcdefg"))); // connection->onDataRead.connect(boost::bind(&SOCKS5BytestreamClientSessionTest::handleDataRead, this, _1)); } @@ -76,7 +77,7 @@ public: TestHelper helper; connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1)); - SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared(connection, destinationAddressPort, destination, timerFactory); + SOCKS5BytestreamClientSession::ref clientSession = std::make_shared(connection, destinationAddressPort, destination, timerFactory); clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1)); clientSession->start(); @@ -102,7 +103,7 @@ public: TestHelper helper; connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1)); - SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared(connection, destinationAddressPort, destination, timerFactory); + SOCKS5BytestreamClientSession::ref clientSession = std::make_shared(connection, destinationAddressPort, destination, timerFactory); clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1)); clientSession->start(); @@ -122,7 +123,7 @@ public: TestHelper helper; connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1)); - SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared(connection, destinationAddressPort, destination, timerFactory); + SOCKS5BytestreamClientSession::ref clientSession = std::make_shared(connection, destinationAddressPort, destination, timerFactory); clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1)); clientSession->start(); @@ -149,7 +150,7 @@ public: TestHelper helper; connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1)); - SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared(connection, destinationAddressPort, destination, timerFactory); + SOCKS5BytestreamClientSession::ref clientSession = std::make_shared(connection, destinationAddressPort, destination, timerFactory); clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1)); clientSession->start(); @@ -165,7 +166,7 @@ public: CPPUNIT_ASSERT_EQUAL(true, helper.sessionReadyCalled); CPPUNIT_ASSERT_EQUAL(false, helper.sessionReadyError); - boost::shared_ptr output = boost::make_shared(); + std::shared_ptr output = std::make_shared(); clientSession->startReceiving(output); ByteArray transferData = generateRandomByteArray(1024); @@ -177,7 +178,7 @@ public: TestHelper helper; connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1)); - SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared(connection, destinationAddressPort, destination, timerFactory); + SOCKS5BytestreamClientSession::ref clientSession = std::make_shared(connection, destinationAddressPort, destination, timerFactory); clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1)); clientSession->start(); @@ -195,7 +196,7 @@ public: helper.unprocessedInput.clear(); ByteArray transferData = generateRandomByteArray(1024); - boost::shared_ptr input = boost::make_shared(transferData); + std::shared_ptr input = std::make_shared(transferData); clientSession->startSending(input); eventLoop->processEvents(); @@ -225,7 +226,7 @@ private: } void serverRespondRequestOK() { - boost::shared_ptr dataToSend = createSafeByteArrayRef("\x05\x00\x00\x03", 4); + std::shared_ptr dataToSend = createSafeByteArrayRef("\x05\x00\x00\x03", 4); append(*dataToSend, createSafeByteArray(static_cast(destination.size()))); append(*dataToSend, createSafeByteArray(destination)); append(*dataToSend, createSafeByteArray("\x00", 1)); @@ -233,12 +234,12 @@ private: } void serverRespondRequestFail() { - boost::shared_ptr correctData = createSafeByteArrayRef("\x05\x00\x00\x03", 4); + std::shared_ptr correctData = createSafeByteArrayRef("\x05\x00\x00\x03", 4); append(*correctData, createSafeByteArray(static_cast(destination.size()))); append(*correctData, createSafeByteArray(destination)); append(*correctData, createSafeByteArray("\x00", 1)); - boost::shared_ptr dataToSend; + std::shared_ptr dataToSend; //ByteArray failingData = Hexify::unhexify("8417947d1d305c72c11520ea7d2c6e787396705e72c312c6ccc3f66613d7cae1b91b7ab48e8b59a17d559c15fb51"); //append(dataToSend, failingData); //SWIFT_LOG(debug) << "hexed: " << Hexify::hexify(failingData) << std::endl; @@ -269,7 +270,7 @@ private: private: - struct MockeryConnection : public Connection, public EventOwner, public boost::enable_shared_from_this { + struct MockeryConnection : public Connection, public EventOwner, public std::enable_shared_from_this { public: MockeryConnection(const std::vector& failingPorts, bool isResponsive, EventLoop* eventLoop) : eventLoop(eventLoop), failingPorts(failingPorts), isResponsive(isResponsive), disconnectCalled(false) {} @@ -309,9 +310,9 @@ private: std::string destination; DummyEventLoop* eventLoop; DummyTimerFactory* timerFactory; - boost::shared_ptr connection; + std::shared_ptr connection; const std::vector failingPorts; - boost::shared_ptr crypto; + std::shared_ptr crypto; }; CPPUNIT_TEST_SUITE_REGISTRATION(SOCKS5BytestreamClientSessionTest); diff --git a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp index 12690ff..d419b8a 100644 --- a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp +++ b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp @@ -37,9 +37,9 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { receivedDataChunks = 0; eventLoop = new DummyEventLoop(); bytestreams = new SOCKS5BytestreamRegistry(); - connection = boost::make_shared(eventLoop); + connection = std::make_shared(eventLoop); connection->onDataSent.connect(boost::bind(&SOCKS5BytestreamServerSessionTest::handleDataWritten, this, _1)); - stream1 = boost::make_shared(createByteArray("abcdefg")); + stream1 = std::make_shared(createByteArray("abcdefg")); finished = false; } @@ -50,7 +50,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { } void testAuthenticate() { - boost::shared_ptr testling(createSession()); + std::shared_ptr testling(createSession()); StartStopper stopper(testling.get()); receive(createSafeByteArray("\x05\x02\x01\x02")); @@ -59,7 +59,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { } void testAuthenticate_Chunked() { - boost::shared_ptr testling(createSession()); + std::shared_ptr testling(createSession()); StartStopper stopper(testling.get()); receive(createSafeByteArray("\x05\x02\x01")); @@ -70,7 +70,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { } void testRequest() { - boost::shared_ptr testling(createSession()); + std::shared_ptr testling(createSession()); StartStopper stopper(testling.get()); bytestreams->setHasBytestream("abcdef", true); authenticate(); @@ -81,7 +81,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { } void testRequest_UnknownBytestream() { - boost::shared_ptr testling(createSession()); + std::shared_ptr testling(createSession()); StartStopper stopper(testling.get()); authenticate(); @@ -91,7 +91,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { } void testReceiveData() { - boost::shared_ptr testling(createSession()); + std::shared_ptr testling(createSession()); StartStopper stopper(testling.get()); bytestreams->setHasBytestream("abcdef", true); authenticate(); @@ -106,7 +106,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { } void testReceiveData_Chunked() { - boost::shared_ptr testling(createSession()); + std::shared_ptr testling(createSession()); testling->setChunkSize(3); StartStopper stopper(testling.get()); bytestreams->setHasBytestream("abcdef", true); @@ -121,7 +121,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { } void testDataStreamPauseStopsSendingData() { - boost::shared_ptr testling(createSession()); + std::shared_ptr testling(createSession()); testling->setChunkSize(3); stream1->setDataComplete(false); StartStopper stopper(testling.get()); @@ -140,7 +140,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { } void testDataStreamResumeAfterPauseSendsData() { - boost::shared_ptr testling(createSession()); + std::shared_ptr testling(createSession()); testling->setChunkSize(3); stream1->setDataComplete(false); StartStopper stopper(testling.get()); @@ -202,10 +202,10 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { private: DummyEventLoop* eventLoop; SOCKS5BytestreamRegistry* bytestreams; - boost::shared_ptr connection; + std::shared_ptr connection; std::vector receivedData; int receivedDataChunks; - boost::shared_ptr stream1; + std::shared_ptr stream1; bool finished; boost::optional error; }; diff --git a/Swiften/FileTransfer/WriteBytestream.h b/Swiften/FileTransfer/WriteBytestream.h index ffcfdcc..ccc7880 100644 --- a/Swiften/FileTransfer/WriteBytestream.h +++ b/Swiften/FileTransfer/WriteBytestream.h @@ -6,17 +6,16 @@ #pragma once +#include #include -#include - #include #include namespace Swift { class SWIFTEN_API WriteBytestream { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; virtual ~WriteBytestream(); diff --git a/Swiften/History/UnitTest/SQLiteHistoryManagerTest.cpp b/Swiften/History/UnitTest/SQLiteHistoryManagerTest.cpp index 5968d7e..4d8a111 100644 --- a/Swiften/History/UnitTest/SQLiteHistoryManagerTest.cpp +++ b/Swiften/History/UnitTest/SQLiteHistoryManagerTest.cpp @@ -35,7 +35,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture { } void testAddMessage() { - boost::shared_ptr testling(createHistoryManager()); + std::shared_ptr testling(createHistoryManager()); HistoryMessage testMessage("Test", JID("foo@bar.com"), JID("fum@baz.org"), boost::posix_time::time_from_string("1980-01-21 22:03")); testling->addMessage(testMessage); @@ -45,7 +45,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture { } void testAddMessage_TwoMessages() { - boost::shared_ptr testling(createHistoryManager()); + std::shared_ptr testling(createHistoryManager()); HistoryMessage testMessage1("Test1", JID("foo@bar.com"), JID("fum@baz.org"), boost::posix_time::time_from_string("1980-01-21 22:03")); testling->addMessage(testMessage1); HistoryMessage testMessage2("Test2", JID("fum@baz.org"), JID("foo@bar.com"), boost::posix_time::time_from_string("1975-03-09 22:04")); @@ -58,7 +58,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture { } void testGetIDForJID_SameJID() { - boost::shared_ptr testling(createHistoryManager()); + std::shared_ptr testling(createHistoryManager()); int id1 = testling->getIDForJID(JID("foo@bar.com")); int id2 = testling->getIDForJID(JID("foo@bar.com")); @@ -66,7 +66,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture { } void testGetIDForJID_DifferentJIDs() { - boost::shared_ptr testling(createHistoryManager()); + std::shared_ptr testling(createHistoryManager()); int id1 = testling->getIDForJID(JID("foo@bar.com")); int id2 = testling->getIDForJID(JID("foo@baz.com")); @@ -74,7 +74,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture { } void getJIDFromID() { - boost::shared_ptr testling(createHistoryManager()); + std::shared_ptr testling(createHistoryManager()); int id = testling->addJID(JID("foo@bar.com")); boost::optional result(testling->getJIDFromID(id)); @@ -83,7 +83,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture { } void getJIDFromID_UnexistingID() { - boost::shared_ptr testling(createHistoryManager()); + std::shared_ptr testling(createHistoryManager()); boost::optional result(testling->getJIDFromID(1)); @@ -91,7 +91,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture { } void getIDFromJID() { - boost::shared_ptr testling(createHistoryManager()); + std::shared_ptr testling(createHistoryManager()); int id = testling->addJID(JID("foo@bar.com")); boost::optional result(testling->getIDFromJID(JID("foo@bar.com"))); @@ -100,7 +100,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture { } void getIDFromJID_UnexistingJID() { - boost::shared_ptr testling(createHistoryManager()); + std::shared_ptr testling(createHistoryManager()); boost::optional result(testling->getIDFromJID(JID("foo@bar.com"))); diff --git a/Swiften/IDN/ICUConverter.cpp b/Swiften/IDN/ICUConverter.cpp index b83739c..d6b0827 100644 --- a/Swiften/IDN/ICUConverter.cpp +++ b/Swiften/IDN/ICUConverter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 Isode Limited. + * Copyright (c) 2012-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -87,7 +87,7 @@ namespace { std::vector > getStringPreparedDetail(const StringType& s, IDNConverter::StringPrepProfile profile) { UErrorCode status = U_ZERO_ERROR; - boost::shared_ptr icuProfile(usprep_openByType(getICUProfileType(profile), &status), usprep_close); + std::shared_ptr icuProfile(usprep_openByType(getICUProfileType(profile), &status), usprep_close); assert(U_SUCCESS(status)); ICUString icuInput = convertToICUString(s); diff --git a/Swiften/IDN/LibIDNConverter.cpp b/Swiften/IDN/LibIDNConverter.cpp index 0823bcc..0c01352 100644 --- a/Swiften/IDN/LibIDNConverter.cpp +++ b/Swiften/IDN/LibIDNConverter.cpp @@ -15,7 +15,7 @@ extern "C" { #include #include -#include +#include #include #include diff --git a/Swiften/IDN/UnitTest/IDNConverterTest.cpp b/Swiften/IDN/UnitTest/IDNConverterTest.cpp index e0c97b5..508a28c 100644 --- a/Swiften/IDN/UnitTest/IDNConverterTest.cpp +++ b/Swiften/IDN/UnitTest/IDNConverterTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -25,7 +25,7 @@ class IDNConverterTest : public CppUnit::TestFixture { public: void setUp() { - testling = boost::shared_ptr(PlatformIDNConverter::create()); + testling = std::shared_ptr(PlatformIDNConverter::create()); } void testStringPrep() { @@ -58,7 +58,7 @@ class IDNConverterTest : public CppUnit::TestFixture { } private: - boost::shared_ptr testling; + std::shared_ptr testling; }; CPPUNIT_TEST_SUITE_REGISTRATION(IDNConverterTest); diff --git a/Swiften/JID/JID.cpp b/Swiften/JID/JID.cpp index b1805df..c7abe45 100644 --- a/Swiften/JID/JID.cpp +++ b/Swiften/JID/JID.cpp @@ -26,7 +26,7 @@ #include #include #ifndef SWIFTEN_JID_NO_DEFAULT_IDN_CONVERTER -#include +#include #include #endif @@ -51,7 +51,7 @@ namespace { IDNInitializer() : defaultIDNConverter(PlatformIDNConverter::create()) { idnConverter = defaultIDNConverter.get(); } - boost::shared_ptr defaultIDNConverter; + std::shared_ptr defaultIDNConverter; } initializer; } #endif diff --git a/Swiften/Jingle/AbstractJingleSessionListener.cpp b/Swiften/Jingle/AbstractJingleSessionListener.cpp index 791dcb3..20edf15 100644 --- a/Swiften/Jingle/AbstractJingleSessionListener.cpp +++ b/Swiften/Jingle/AbstractJingleSessionListener.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -10,11 +10,11 @@ using namespace Swift; -void AbstractJingleSessionListener::handleSessionAcceptReceived(const JingleContentID&, boost::shared_ptr, boost::shared_ptr) { +void AbstractJingleSessionListener::handleSessionAcceptReceived(const JingleContentID&, std::shared_ptr, std::shared_ptr) { SWIFT_LOG(warning) << "Unimplemented" << std::endl; } -void AbstractJingleSessionListener::handleSessionInfoReceived(boost::shared_ptr) { +void AbstractJingleSessionListener::handleSessionInfoReceived(std::shared_ptr) { SWIFT_LOG(warning) << "Unimplemented" << std::endl; } @@ -22,19 +22,19 @@ void AbstractJingleSessionListener::handleSessionTerminateReceived(boost::option SWIFT_LOG(warning) << "Unimplemented" << std::endl; } -void AbstractJingleSessionListener::handleTransportAcceptReceived(const JingleContentID&, boost::shared_ptr) { +void AbstractJingleSessionListener::handleTransportAcceptReceived(const JingleContentID&, std::shared_ptr) { SWIFT_LOG(warning) << "Unimplemented" << std::endl; } -void AbstractJingleSessionListener::handleTransportInfoReceived(const JingleContentID&, boost::shared_ptr) { +void AbstractJingleSessionListener::handleTransportInfoReceived(const JingleContentID&, std::shared_ptr) { SWIFT_LOG(warning) << "Unimplemented" << std::endl; } -void AbstractJingleSessionListener::handleTransportRejectReceived(const JingleContentID&, boost::shared_ptr) { +void AbstractJingleSessionListener::handleTransportRejectReceived(const JingleContentID&, std::shared_ptr) { SWIFT_LOG(warning) << "Unimplemented" << std::endl; } -void AbstractJingleSessionListener::handleTransportReplaceReceived(const JingleContentID&, boost::shared_ptr) { +void AbstractJingleSessionListener::handleTransportReplaceReceived(const JingleContentID&, std::shared_ptr) { SWIFT_LOG(warning) << "Unimplemented" << std::endl; } diff --git a/Swiften/Jingle/AbstractJingleSessionListener.h b/Swiften/Jingle/AbstractJingleSessionListener.h index 678f173..590cd14 100644 --- a/Swiften/Jingle/AbstractJingleSessionListener.h +++ b/Swiften/Jingle/AbstractJingleSessionListener.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -13,13 +13,13 @@ namespace Swift { class SWIFTEN_API AbstractJingleSessionListener : public JingleSessionListener { public: - virtual void handleSessionAcceptReceived(const JingleContentID&, boost::shared_ptr, boost::shared_ptr) SWIFTEN_OVERRIDE; - virtual void handleSessionInfoReceived(boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual void handleSessionAcceptReceived(const JingleContentID&, std::shared_ptr, std::shared_ptr) SWIFTEN_OVERRIDE; + virtual void handleSessionInfoReceived(std::shared_ptr) SWIFTEN_OVERRIDE; virtual void handleSessionTerminateReceived(boost::optional) SWIFTEN_OVERRIDE; - virtual void handleTransportAcceptReceived(const JingleContentID&, boost::shared_ptr) SWIFTEN_OVERRIDE; - virtual void handleTransportInfoReceived(const JingleContentID&, boost::shared_ptr) SWIFTEN_OVERRIDE; - virtual void handleTransportRejectReceived(const JingleContentID&, boost::shared_ptr) SWIFTEN_OVERRIDE; - virtual void handleTransportReplaceReceived(const JingleContentID&, boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual void handleTransportAcceptReceived(const JingleContentID&, std::shared_ptr) SWIFTEN_OVERRIDE; + virtual void handleTransportInfoReceived(const JingleContentID&, std::shared_ptr) SWIFTEN_OVERRIDE; + virtual void handleTransportRejectReceived(const JingleContentID&, std::shared_ptr) SWIFTEN_OVERRIDE; + virtual void handleTransportReplaceReceived(const JingleContentID&, std::shared_ptr) SWIFTEN_OVERRIDE; virtual void handleTransportInfoAcknowledged(const std::string& id) SWIFTEN_OVERRIDE; }; } diff --git a/Swiften/Jingle/FakeJingleSession.cpp b/Swiften/Jingle/FakeJingleSession.cpp index ec792ab..6b88477 100644 --- a/Swiften/Jingle/FakeJingleSession.cpp +++ b/Swiften/Jingle/FakeJingleSession.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include @@ -33,7 +33,7 @@ void FakeJingleSession::sendTerminate(JinglePayload::Reason::Type reason) { calledCommands.push_back(TerminateCall(reason)); } -void FakeJingleSession::sendInfo(boost::shared_ptr payload) { +void FakeJingleSession::sendInfo(std::shared_ptr payload) { calledCommands.push_back(InfoCall(payload)); } @@ -74,7 +74,7 @@ void FakeJingleSession::handleSessionTerminateReceived(boost::optional desc, boost::shared_ptr payload) { +void FakeJingleSession::handleSessionAcceptReceived(const JingleContentID& contentID, std::shared_ptr desc, std::shared_ptr payload) { notifyListeners(&JingleSessionListener::handleSessionAcceptReceived, contentID, desc, payload); } diff --git a/Swiften/Jingle/FakeJingleSession.h b/Swiften/Jingle/FakeJingleSession.h index 0107384..d961d1d 100644 --- a/Swiften/Jingle/FakeJingleSession.h +++ b/Swiften/Jingle/FakeJingleSession.h @@ -12,10 +12,10 @@ #pragma once +#include #include #include -#include #include #include @@ -45,8 +45,8 @@ namespace Swift { }; struct InfoCall { - InfoCall(boost::shared_ptr info) : payload(info) {} - boost::shared_ptr payload; + InfoCall(std::shared_ptr info) : payload(info) {} + std::shared_ptr payload; }; struct AcceptCall { @@ -83,14 +83,14 @@ namespace Swift { typedef boost::variant Command; public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; FakeJingleSession(const JID& initiator, const std::string& id); virtual ~FakeJingleSession(); virtual void sendInitiate(const JingleContentID&, JingleDescription::ref, JingleTransportPayload::ref) SWIFTEN_OVERRIDE; virtual void sendTerminate(JinglePayload::Reason::Type reason) SWIFTEN_OVERRIDE; - virtual void sendInfo(boost::shared_ptr) SWIFTEN_OVERRIDE; + virtual void sendInfo(std::shared_ptr) SWIFTEN_OVERRIDE; virtual void sendAccept(const JingleContentID&, JingleDescription::ref, JingleTransportPayload::ref = JingleTransportPayload::ref()) SWIFTEN_OVERRIDE; virtual std::string sendTransportInfo(const JingleContentID&, JingleTransportPayload::ref) SWIFTEN_OVERRIDE; virtual void sendTransportAccept(const JingleContentID&, JingleTransportPayload::ref) SWIFTEN_OVERRIDE; @@ -98,13 +98,13 @@ namespace Swift { virtual void sendTransportReplace(const JingleContentID&, JingleTransportPayload::ref) SWIFTEN_OVERRIDE; void handleSessionTerminateReceived(boost::optional); - void handleSessionAcceptReceived(const JingleContentID&, boost::shared_ptr, boost::shared_ptr); - void handleSessionInfoReceived(boost::shared_ptr); + void handleSessionAcceptReceived(const JingleContentID&, std::shared_ptr, std::shared_ptr); + void handleSessionInfoReceived(std::shared_ptr); void handleTransportReplaceReceived(const JingleContentID&, JingleTransportPayload::ref); - void handleTransportAcceptReceived(const JingleContentID&, boost::shared_ptr); - void handleTransportInfoReceived(const JingleContentID&, boost::shared_ptr); - void handleTransportRejectReceived(const JingleContentID&, boost::shared_ptr); + void handleTransportAcceptReceived(const JingleContentID&, std::shared_ptr); + void handleTransportInfoReceived(const JingleContentID&, std::shared_ptr); + void handleTransportRejectReceived(const JingleContentID&, std::shared_ptr); void handleTransportInfoAcknowledged(const std::string& id); public: diff --git a/Swiften/Jingle/JingleResponder.cpp b/Swiften/Jingle/JingleResponder.cpp index d0c2edd..09bb234 100644 --- a/Swiften/Jingle/JingleResponder.cpp +++ b/Swiften/Jingle/JingleResponder.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include #include @@ -20,16 +20,16 @@ JingleResponder::JingleResponder(JingleSessionManager* sessionManager, IQRouter* JingleResponder::~JingleResponder() { } -bool JingleResponder::handleSetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr payload) { +bool JingleResponder::handleSetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr payload) { if (payload->getAction() == JinglePayload::SessionInitiate) { if (sessionManager->getSession(from, payload->getSessionID())) { // TODO: Add tie-break error sendError(from, id, ErrorPayload::Conflict, ErrorPayload::Cancel); } else { - sendResponse(from, id, boost::shared_ptr()); + sendResponse(from, id, std::shared_ptr()); if (!payload->getInitiator().isBare()) { - JingleSessionImpl::ref session = boost::make_shared(payload->getInitiator(), from, payload->getSessionID(), router); + JingleSessionImpl::ref session = std::make_shared(payload->getInitiator(), from, payload->getSessionID(), router); sessionManager->handleIncomingSession(from, to, session, payload->getContents()); } else { SWIFT_LOG(debug) << "Unable to create Jingle session due to initiator not being a full JID." << std::endl; @@ -47,7 +47,7 @@ bool JingleResponder::handleSetRequest(const JID& from, const JID& to, const std } if (session) { session->handleIncomingAction(payload); - sendResponse(from, id, boost::shared_ptr()); + sendResponse(from, id, std::shared_ptr()); } else { SWIFT_LOG(warning) << "Didn't find jingle session!"; diff --git a/Swiften/Jingle/JingleResponder.h b/Swiften/Jingle/JingleResponder.h index 1340835..cb9220c 100644 --- a/Swiften/Jingle/JingleResponder.h +++ b/Swiften/Jingle/JingleResponder.h @@ -19,7 +19,7 @@ namespace Swift { JingleResponder(JingleSessionManager* sessionManager, IQRouter* router); virtual ~JingleResponder(); private: - virtual bool handleSetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr payload); + virtual bool handleSetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr payload); private: JingleSessionManager* sessionManager; diff --git a/Swiften/Jingle/JingleSession.cpp b/Swiften/Jingle/JingleSession.cpp index 8abbd56..778ee1d 100644 --- a/Swiften/Jingle/JingleSession.cpp +++ b/Swiften/Jingle/JingleSession.cpp @@ -7,9 +7,9 @@ #include #include +#include #include -#include #include diff --git a/Swiften/Jingle/JingleSession.h b/Swiften/Jingle/JingleSession.h index 7a64c47..993e8de 100644 --- a/Swiften/Jingle/JingleSession.h +++ b/Swiften/Jingle/JingleSession.h @@ -6,11 +6,11 @@ #pragma once +#include #include #include #include -#include #include #include @@ -24,7 +24,7 @@ namespace Swift { class SWIFTEN_API JingleSession : public Listenable { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; JingleSession(const JID& initiator, const std::string& id); virtual ~JingleSession(); @@ -39,7 +39,7 @@ namespace Swift { virtual void sendInitiate(const JingleContentID&, JingleDescription::ref, JingleTransportPayload::ref) = 0; virtual void sendTerminate(JinglePayload::Reason::Type reason) = 0; - virtual void sendInfo(boost::shared_ptr) = 0; + virtual void sendInfo(std::shared_ptr) = 0; virtual void sendAccept(const JingleContentID&, JingleDescription::ref, JingleTransportPayload::ref = JingleTransportPayload::ref()) = 0; virtual std::string sendTransportInfo(const JingleContentID&, JingleTransportPayload::ref) = 0; virtual void sendTransportAccept(const JingleContentID&, JingleTransportPayload::ref) = 0; diff --git a/Swiften/Jingle/JingleSessionImpl.cpp b/Swiften/Jingle/JingleSessionImpl.cpp index 3063242..06aa039 100644 --- a/Swiften/Jingle/JingleSessionImpl.cpp +++ b/Swiften/Jingle/JingleSessionImpl.cpp @@ -7,9 +7,9 @@ #include #include +#include #include -#include #include #include @@ -81,9 +81,9 @@ void JingleSessionImpl::handleIncomingAction(JinglePayload::ref action) { } void JingleSessionImpl::sendInitiate(const JingleContentID& id, JingleDescription::ref description, JingleTransportPayload::ref transport) { - JinglePayload::ref payload = boost::make_shared(JinglePayload::SessionInitiate, getID()); + JinglePayload::ref payload = std::make_shared(JinglePayload::SessionInitiate, getID()); payload->setInitiator(getInitiator()); - JingleContentPayload::ref content = boost::make_shared(); + JingleContentPayload::ref content = std::make_shared(); content->setCreator(id.getCreator()); content->setName(id.getName()); content->addDescription(description); @@ -94,14 +94,14 @@ void JingleSessionImpl::sendInitiate(const JingleContentID& id, JingleDescriptio } void JingleSessionImpl::sendTerminate(JinglePayload::Reason::Type reason) { - JinglePayload::ref payload = boost::make_shared(JinglePayload::SessionTerminate, getID()); + JinglePayload::ref payload = std::make_shared(JinglePayload::SessionTerminate, getID()); payload->setReason(JinglePayload::Reason(reason)); payload->setInitiator(getInitiator()); sendSetRequest(payload); } -void JingleSessionImpl::sendInfo(boost::shared_ptr info) { - JinglePayload::ref payload = boost::make_shared(JinglePayload::SessionInfo, getID()); +void JingleSessionImpl::sendInfo(std::shared_ptr info) { + JinglePayload::ref payload = std::make_shared(JinglePayload::SessionInfo, getID()); payload->addPayload(info); sendSetRequest(payload); @@ -110,7 +110,7 @@ void JingleSessionImpl::sendInfo(boost::shared_ptr info) { void JingleSessionImpl::sendAccept(const JingleContentID& id, JingleDescription::ref description, JingleTransportPayload::ref transPayload) { JinglePayload::ref payload = createPayload(); - JingleContentPayload::ref content = boost::make_shared(); + JingleContentPayload::ref content = std::make_shared(); content->setCreator(id.getCreator()); content->setName(id.getName()); content->addTransport(transPayload); @@ -126,7 +126,7 @@ void JingleSessionImpl::sendAccept(const JingleContentID& id, JingleDescription: void JingleSessionImpl::sendTransportAccept(const JingleContentID& id, JingleTransportPayload::ref transPayload) { JinglePayload::ref payload = createPayload(); - JingleContentPayload::ref content = boost::make_shared(); + JingleContentPayload::ref content = std::make_shared(); content->setCreator(id.getCreator()); content->setName(id.getName()); content->addTransport(transPayload); @@ -140,7 +140,7 @@ void JingleSessionImpl::sendTransportAccept(const JingleContentID& id, JingleTra std::string JingleSessionImpl::sendTransportInfo(const JingleContentID& id, JingleTransportPayload::ref transPayload) { JinglePayload::ref payload = createPayload(); - JingleContentPayload::ref content = boost::make_shared(); + JingleContentPayload::ref content = std::make_shared(); content->setCreator(id.getCreator()); content->setName(id.getName()); content->addTransport(transPayload); @@ -153,7 +153,7 @@ std::string JingleSessionImpl::sendTransportInfo(const JingleContentID& id, Jing void JingleSessionImpl::sendTransportReject(const JingleContentID& id, JingleTransportPayload::ref transPayload) { JinglePayload::ref payload = createPayload(); - JingleContentPayload::ref content = boost::make_shared(); + JingleContentPayload::ref content = std::make_shared(); content->setCreator(id.getCreator()); content->setName(id.getName()); content->addTransport(transPayload); @@ -166,7 +166,7 @@ void JingleSessionImpl::sendTransportReject(const JingleContentID& id, JingleTra void JingleSessionImpl::sendTransportReplace(const JingleContentID& id, JingleTransportPayload::ref transPayload) { JinglePayload::ref payload = createPayload(); - JingleContentPayload::ref content = boost::make_shared(); + JingleContentPayload::ref content = std::make_shared(); content->setCreator(id.getCreator()); content->setName(id.getName()); content->addTransport(transPayload); @@ -178,7 +178,7 @@ void JingleSessionImpl::sendTransportReplace(const JingleContentID& id, JingleTr std::string JingleSessionImpl::sendSetRequest(JinglePayload::ref payload) { - boost::shared_ptr > request = boost::make_shared >( + std::shared_ptr > request = std::make_shared >( IQ::Set, peerJID, payload, iqRouter); pendingRequests.insert(std::make_pair( request, @@ -188,7 +188,7 @@ std::string JingleSessionImpl::sendSetRequest(JinglePayload::ref payload) { JinglePayload::ref JingleSessionImpl::createPayload() const { - JinglePayload::ref payload = boost::make_shared(); + JinglePayload::ref payload = std::make_shared(); payload->setSessionID(getID()); payload->setInitiator(getInitiator()); return payload; diff --git a/Swiften/Jingle/JingleSessionImpl.h b/Swiften/Jingle/JingleSessionImpl.h index eec2370..4dd32ed 100644 --- a/Swiften/Jingle/JingleSessionImpl.h +++ b/Swiften/Jingle/JingleSessionImpl.h @@ -7,8 +7,7 @@ #pragma once #include - -#include +#include #include #include @@ -20,13 +19,13 @@ namespace Swift { class JingleSessionImpl : public JingleSession { friend class JingleResponder; public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; JingleSessionImpl(const JID& initiator, const JID&, const std::string& id, IQRouter* router); virtual void sendInitiate(const JingleContentID&, JingleDescription::ref, JingleTransportPayload::ref); virtual void sendTerminate(JinglePayload::Reason::Type reason); - virtual void sendInfo(boost::shared_ptr); + virtual void sendInfo(std::shared_ptr); virtual void sendAccept(const JingleContentID&, JingleDescription::ref, JingleTransportPayload::ref); virtual std::string sendTransportInfo(const JingleContentID&, JingleTransportPayload::ref); virtual void sendTransportAccept(const JingleContentID&, JingleTransportPayload::ref); @@ -34,7 +33,7 @@ namespace Swift { virtual void sendTransportReplace(const JingleContentID&, JingleTransportPayload::ref); private: - typedef boost::shared_ptr > RequestRef; + typedef std::shared_ptr > RequestRef; void handleIncomingAction(JinglePayload::ref); diff --git a/Swiften/Jingle/JingleSessionListener.h b/Swiften/Jingle/JingleSessionListener.h index 54101b6..7c015f0 100644 --- a/Swiften/Jingle/JingleSessionListener.h +++ b/Swiften/Jingle/JingleSessionListener.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -20,20 +20,20 @@ namespace Swift { virtual void handleSessionAcceptReceived( const JingleContentID&, - boost::shared_ptr, - boost::shared_ptr) = 0; - virtual void handleSessionInfoReceived(boost::shared_ptr) = 0; + std::shared_ptr, + std::shared_ptr) = 0; + virtual void handleSessionInfoReceived(std::shared_ptr) = 0; virtual void handleSessionTerminateReceived(boost::optional) = 0; virtual void handleTransportAcceptReceived( const JingleContentID&, - boost::shared_ptr) = 0; + std::shared_ptr) = 0; virtual void handleTransportInfoReceived( const JingleContentID&, - boost::shared_ptr) = 0; + std::shared_ptr) = 0; virtual void handleTransportRejectReceived( - const JingleContentID&, boost::shared_ptr) = 0; + const JingleContentID&, std::shared_ptr) = 0; virtual void handleTransportReplaceReceived( - const JingleContentID&, boost::shared_ptr) = 0; + const JingleContentID&, std::shared_ptr) = 0; virtual void handleTransportInfoAcknowledged(const std::string& id) = 0; }; diff --git a/Swiften/Jingle/JingleSessionManager.h b/Swiften/Jingle/JingleSessionManager.h index fea6c73..0c0f775 100644 --- a/Swiften/Jingle/JingleSessionManager.h +++ b/Swiften/Jingle/JingleSessionManager.h @@ -7,8 +7,7 @@ #pragma once #include - -#include +#include #include #include diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h index 767ee1d..a227613 100644 --- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h +++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h @@ -17,7 +17,7 @@ namespace Swift { class AvahiBrowseQuery : public DNSSDBrowseQuery, public AvahiQuery { public: - AvahiBrowseQuery(boost::shared_ptr q, EventLoop* eventLoop) : AvahiQuery(q, eventLoop), browser(NULL) { + AvahiBrowseQuery(std::shared_ptr q, EventLoop* eventLoop) : AvahiQuery(q, eventLoop), browser(NULL) { } void startBrowsing(); diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp index 11f1650..1b79946 100644 --- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp +++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp @@ -21,20 +21,20 @@ AvahiQuerier::AvahiQuerier(EventLoop* eventLoop) : eventLoop(eventLoop), client( AvahiQuerier::~AvahiQuerier() { } -boost::shared_ptr AvahiQuerier::createBrowseQuery() { - return boost::shared_ptr(new AvahiBrowseQuery(shared_from_this(), eventLoop)); +std::shared_ptr AvahiQuerier::createBrowseQuery() { + return std::make_shared(shared_from_this(), eventLoop); } -boost::shared_ptr AvahiQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) { - return boost::shared_ptr(new AvahiRegisterQuery(name, port, info, shared_from_this(), eventLoop)); +std::shared_ptr AvahiQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) { + return std::make_shared(name, port, info, shared_from_this(), eventLoop); } -boost::shared_ptr AvahiQuerier::createResolveServiceQuery(const DNSSDServiceID& service) { - return boost::shared_ptr(new AvahiResolveServiceQuery(service, shared_from_this(), eventLoop)); +std::shared_ptr AvahiQuerier::createResolveServiceQuery(const DNSSDServiceID& service) { + return std::make_shared(service, shared_from_this(), eventLoop); } -boost::shared_ptr AvahiQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) { - return boost::shared_ptr(new AvahiResolveHostnameQuery(hostname, interfaceIndex, shared_from_this(), eventLoop)); +std::shared_ptr AvahiQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) { + return std::make_shared(hostname, interfaceIndex, shared_from_this(), eventLoop); } void AvahiQuerier::start() { diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h index fa9580e..5dce19d 100644 --- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h +++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h @@ -6,8 +6,7 @@ #pragma once -#include -#include +#include #include #include @@ -24,17 +23,17 @@ namespace Swift { class AvahiQuerier : public DNSSDQuerier, - public boost::enable_shared_from_this { + public std::enable_shared_from_this { public: AvahiQuerier(EventLoop* eventLoop); ~AvahiQuerier(); - boost::shared_ptr createBrowseQuery(); - boost::shared_ptr createRegisterQuery( + std::shared_ptr createBrowseQuery(); + std::shared_ptr createRegisterQuery( const std::string& name, int port, const ByteArray& info); - boost::shared_ptr createResolveServiceQuery( + std::shared_ptr createResolveServiceQuery( const DNSSDServiceID&); - boost::shared_ptr createResolveHostnameQuery( + std::shared_ptr createResolveHostnameQuery( const std::string& hostname, int interfaceIndex); void start(); diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.cpp b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.cpp index 97a7912..08997f6 100644 --- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.cpp +++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.cpp @@ -10,7 +10,7 @@ namespace Swift { -AvahiQuery::AvahiQuery(boost::shared_ptr q, EventLoop* eventLoop) : querier(q), eventLoop(eventLoop) { +AvahiQuery::AvahiQuery(std::shared_ptr q, EventLoop* eventLoop) : querier(q), eventLoop(eventLoop) { } AvahiQuery::~AvahiQuery() { diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h index 5752003..1b98bbf 100644 --- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h +++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h @@ -6,8 +6,7 @@ #pragma once -#include -#include +#include #include @@ -17,13 +16,13 @@ namespace Swift { class AvahiQuery : public EventOwner, - public boost::enable_shared_from_this { + public std::enable_shared_from_this { public: - AvahiQuery(boost::shared_ptr, EventLoop* eventLoop); + AvahiQuery(std::shared_ptr, EventLoop* eventLoop); virtual ~AvahiQuery(); protected: - boost::shared_ptr querier; + std::shared_ptr querier; EventLoop* eventLoop; }; } diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h index 5570559..68281d0 100644 --- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h +++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h @@ -18,7 +18,7 @@ namespace Swift { class AvahiRegisterQuery : public DNSSDRegisterQuery, public AvahiQuery { public: - AvahiRegisterQuery(const std::string& name, int port, const ByteArray& txtRecord, boost::shared_ptr querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), name(name), port(port), txtRecord(txtRecord), group(0) { + AvahiRegisterQuery(const std::string& name, int port, const ByteArray& txtRecord, std::shared_ptr querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), name(name), port(port), txtRecord(txtRecord), group(0) { } void registerService(); diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp index af1a048..6510275 100644 --- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp +++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp @@ -12,7 +12,7 @@ namespace Swift { -AvahiResolveHostnameQuery::AvahiResolveHostnameQuery(const std::string& hostname, int, boost::shared_ptr querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), hostname(hostname) { +AvahiResolveHostnameQuery::AvahiResolveHostnameQuery(const std::string& hostname, int, std::shared_ptr querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), hostname(hostname) { std::cout << "Resolving hostname " << hostname << std::endl; } diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h index 9d21bf9..5498285 100644 --- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h +++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h @@ -20,7 +20,7 @@ namespace Swift { class AvahiResolveHostnameQuery : public DNSSDResolveHostnameQuery, public AvahiQuery { public: - AvahiResolveHostnameQuery(const std::string& hostname, int, boost::shared_ptr querier, EventLoop* eventLoop); + AvahiResolveHostnameQuery(const std::string& hostname, int, std::shared_ptr querier, EventLoop* eventLoop); void run(); diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h index c95d131..c05c73e 100644 --- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h +++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h @@ -19,7 +19,7 @@ namespace Swift { class AvahiResolveServiceQuery : public DNSSDResolveServiceQuery, public AvahiQuery { public: - AvahiResolveServiceQuery(const DNSSDServiceID& service, boost::shared_ptr querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), service(service), resolver(NULL) { + AvahiResolveServiceQuery(const DNSSDServiceID& service, std::shared_ptr querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), service(service), resolver(NULL) { } void start(); diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h index 988f025..c049ed2 100644 --- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h +++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h @@ -17,7 +17,7 @@ namespace Swift { class BonjourBrowseQuery : public DNSSDBrowseQuery, public BonjourQuery { public: - BonjourBrowseQuery(boost::shared_ptr q, EventLoop* eventLoop) : BonjourQuery(q, eventLoop) { + BonjourBrowseQuery(std::shared_ptr q, EventLoop* eventLoop) : BonjourQuery(q, eventLoop) { DNSServiceErrorType result = DNSServiceBrowse( &sdRef, 0, 0, "_presence._tcp", nullptr, &BonjourBrowseQuery::handleServiceDiscoveredStatic, this); diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp index fda5032..e6d8b94 100644 --- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp +++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp @@ -33,23 +33,23 @@ BonjourQuerier::~BonjourQuerier() { assert(!thread); } -boost::shared_ptr BonjourQuerier::createBrowseQuery() { - return boost::shared_ptr(new BonjourBrowseQuery(shared_from_this(), eventLoop)); +std::shared_ptr BonjourQuerier::createBrowseQuery() { + return std::make_shared(shared_from_this(), eventLoop); } -boost::shared_ptr BonjourQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) { - return boost::shared_ptr(new BonjourRegisterQuery(name, port, info, shared_from_this(), eventLoop)); +std::shared_ptr BonjourQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) { + return std::make_shared(name, port, info, shared_from_this(), eventLoop); } -boost::shared_ptr BonjourQuerier::createResolveServiceQuery(const DNSSDServiceID& service) { - return boost::shared_ptr(new BonjourResolveServiceQuery(service, shared_from_this(), eventLoop)); +std::shared_ptr BonjourQuerier::createResolveServiceQuery(const DNSSDServiceID& service) { + return std::make_shared(service, shared_from_this(), eventLoop); } -boost::shared_ptr BonjourQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) { - return boost::shared_ptr(new BonjourResolveHostnameQuery(hostname, interfaceIndex, shared_from_this(), eventLoop)); +std::shared_ptr BonjourQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) { + return std::make_shared(hostname, interfaceIndex, shared_from_this(), eventLoop); } -void BonjourQuerier::addRunningQuery(boost::shared_ptr query) { +void BonjourQuerier::addRunningQuery(std::shared_ptr query) { { boost::lock_guard lock(runningQueriesMutex); runningQueries.push_back(query); @@ -58,7 +58,7 @@ void BonjourQuerier::addRunningQuery(boost::shared_ptr query) { interruptSelect(); } -void BonjourQuerier::removeRunningQuery(boost::shared_ptr query) { +void BonjourQuerier::removeRunningQuery(std::shared_ptr query) { { boost::lock_guard lock(runningQueriesMutex); erase(runningQueries, query); @@ -106,7 +106,7 @@ void BonjourQuerier::run() { maxSocket = interruptSelectReadSocket; FD_SET(interruptSelectReadSocket, &fdSet); - foreach(const boost::shared_ptr& query, runningQueries) { + foreach(const std::shared_ptr& query, runningQueries) { int socketID = query->getSocketID(); maxSocket = std::max(maxSocket, socketID); FD_SET(socketID, &fdSet); @@ -124,7 +124,7 @@ void BonjourQuerier::run() { { boost::lock_guard lock(runningQueriesMutex); - foreach(boost::shared_ptr query, runningQueries) { + foreach(std::shared_ptr query, runningQueries) { if (FD_ISSET(query->getSocketID(), &fdSet)) { query->processResult(); } diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.h index 74140ac..199eeb2 100644 --- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.h +++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.h @@ -7,9 +7,8 @@ #pragma once #include +#include -#include -#include #include #include @@ -20,17 +19,17 @@ namespace Swift { class BonjourQuerier : public DNSSDQuerier, - public boost::enable_shared_from_this { + public std::enable_shared_from_this { public: BonjourQuerier(EventLoop* eventLoop); ~BonjourQuerier(); - boost::shared_ptr createBrowseQuery(); - boost::shared_ptr createRegisterQuery( + std::shared_ptr createBrowseQuery(); + std::shared_ptr createRegisterQuery( const std::string& name, int port, const ByteArray& info); - boost::shared_ptr createResolveServiceQuery( + std::shared_ptr createResolveServiceQuery( const DNSSDServiceID&); - boost::shared_ptr createResolveHostnameQuery( + std::shared_ptr createResolveHostnameQuery( const std::string& hostname, int interfaceIndex); void start(); @@ -39,8 +38,8 @@ namespace Swift { private: friend class BonjourQuery; - void addRunningQuery(boost::shared_ptr); - void removeRunningQuery(boost::shared_ptr); + void addRunningQuery(std::shared_ptr); + void removeRunningQuery(std::shared_ptr); void interruptSelect(); void run(); @@ -49,7 +48,7 @@ namespace Swift { bool stopRequested; boost::thread* thread; boost::mutex runningQueriesMutex; - std::list< boost::shared_ptr > runningQueries; + std::list< std::shared_ptr > runningQueries; int interruptSelectReadSocket; int interruptSelectWriteSocket; boost::condition_variable runningQueriesAvailableEvent; diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.cpp b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.cpp index fa4b6fe..5f9a98f 100644 --- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.cpp +++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.cpp @@ -10,7 +10,7 @@ namespace Swift { -BonjourQuery::BonjourQuery(boost::shared_ptr q, EventLoop* eventLoop) : eventLoop(eventLoop), querier(q), sdRef(nullptr) { +BonjourQuery::BonjourQuery(std::shared_ptr q, EventLoop* eventLoop) : eventLoop(eventLoop), querier(q), sdRef(nullptr) { } BonjourQuery::~BonjourQuery() { diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h index 2e3eb80..5520158 100644 --- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h +++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h @@ -6,8 +6,8 @@ #pragma once -#include -#include +#include + #include #include @@ -20,9 +20,9 @@ namespace Swift { class BonjourQuery : public EventOwner, - public boost::enable_shared_from_this { + public std::enable_shared_from_this { public: - BonjourQuery(boost::shared_ptr, EventLoop* eventLoop); + BonjourQuery(std::shared_ptr, EventLoop* eventLoop); virtual ~BonjourQuery(); void processResult(); @@ -34,7 +34,7 @@ namespace Swift { protected: EventLoop* eventLoop; - boost::shared_ptr querier; + std::shared_ptr querier; mutable boost::mutex sdRefMutex; DNSServiceRef sdRef; }; diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourRegisterQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourRegisterQuery.h index 67c96bd..776b434 100644 --- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourRegisterQuery.h +++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourRegisterQuery.h @@ -19,7 +19,7 @@ namespace Swift { class BonjourRegisterQuery : public DNSSDRegisterQuery, public BonjourQuery { public: - BonjourRegisterQuery(const std::string& name, int port, const ByteArray& txtRecord, boost::shared_ptr querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) { + BonjourRegisterQuery(const std::string& name, int port, const ByteArray& txtRecord, std::shared_ptr querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) { DNSServiceErrorType result = DNSServiceRegister( &sdRef, 0, 0, name.c_str(), "_presence._tcp", nullptr, nullptr, boost::numeric_cast(port), boost::numeric_cast(txtRecord.size()), vecptr(txtRecord), diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h index adc5486..dbf3f0e 100644 --- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h +++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h @@ -22,7 +22,7 @@ namespace Swift { class BonjourResolveHostnameQuery : public DNSSDResolveHostnameQuery, public BonjourQuery { public: - BonjourResolveHostnameQuery(const std::string& hostname, int interfaceIndex, boost::shared_ptr querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) { + BonjourResolveHostnameQuery(const std::string& hostname, int interfaceIndex, std::shared_ptr querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) { DNSServiceErrorType result = DNSServiceGetAddrInfo( &sdRef, 0, boost::numeric_cast(interfaceIndex), kDNSServiceProtocol_IPv4, hostname.c_str(), diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveServiceQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveServiceQuery.h index ee20a25..86b6015 100644 --- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveServiceQuery.h +++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveServiceQuery.h @@ -17,7 +17,7 @@ namespace Swift { class BonjourResolveServiceQuery : public DNSSDResolveServiceQuery, public BonjourQuery { public: - BonjourResolveServiceQuery(const DNSSDServiceID& service, boost::shared_ptr querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) { + BonjourResolveServiceQuery(const DNSSDServiceID& service, std::shared_ptr querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) { DNSServiceErrorType result = DNSServiceResolve( &sdRef, 0, boost::numeric_cast(service.getNetworkInterfaceID()), service.getName().c_str(), service.getType().c_str(), diff --git a/Swiften/LinkLocal/DNSSD/DNSSDQuerier.h b/Swiften/LinkLocal/DNSSD/DNSSDQuerier.h index 85051fe..8f3c3ec 100644 --- a/Swiften/LinkLocal/DNSSD/DNSSDQuerier.h +++ b/Swiften/LinkLocal/DNSSD/DNSSDQuerier.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include @@ -24,12 +24,12 @@ namespace Swift { virtual void start() = 0; virtual void stop() = 0; - virtual boost::shared_ptr createBrowseQuery() = 0; - virtual boost::shared_ptr createRegisterQuery( + virtual std::shared_ptr createBrowseQuery() = 0; + virtual std::shared_ptr createRegisterQuery( const std::string& name, int port, const ByteArray& info) = 0; - virtual boost::shared_ptr createResolveServiceQuery( + virtual std::shared_ptr createResolveServiceQuery( const DNSSDServiceID&) = 0; - virtual boost::shared_ptr createResolveHostnameQuery( + virtual std::shared_ptr createResolveHostnameQuery( const std::string& hostname, int interfaceIndex) = 0; }; } diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDBrowseQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDBrowseQuery.h index 860de41..15d8128 100644 --- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDBrowseQuery.h +++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDBrowseQuery.h @@ -14,7 +14,7 @@ namespace Swift { class FakeDNSSDBrowseQuery : public DNSSDBrowseQuery, public FakeDNSSDQuery { public: - FakeDNSSDBrowseQuery(boost::shared_ptr querier) : FakeDNSSDQuery(querier) { + FakeDNSSDBrowseQuery(std::shared_ptr querier) : FakeDNSSDQuery(querier) { } void startBrowsing() { diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp index 89698a6..63ad3b8 100644 --- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp +++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp @@ -29,42 +29,42 @@ FakeDNSSDQuerier::~FakeDNSSDQuerier() { } } -boost::shared_ptr FakeDNSSDQuerier::createBrowseQuery() { - return boost::shared_ptr(new FakeDNSSDBrowseQuery(shared_from_this())); +std::shared_ptr FakeDNSSDQuerier::createBrowseQuery() { + return std::make_shared(shared_from_this()); } -boost::shared_ptr FakeDNSSDQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) { - return boost::shared_ptr(new FakeDNSSDRegisterQuery(name, port, info, shared_from_this())); +std::shared_ptr FakeDNSSDQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) { + return std::make_shared(name, port, info, shared_from_this()); } -boost::shared_ptr FakeDNSSDQuerier::createResolveServiceQuery(const DNSSDServiceID& service) { - return boost::shared_ptr(new FakeDNSSDResolveServiceQuery(service, shared_from_this())); +std::shared_ptr FakeDNSSDQuerier::createResolveServiceQuery(const DNSSDServiceID& service) { + return std::make_shared(service, shared_from_this()); } -boost::shared_ptr FakeDNSSDQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) { - return boost::shared_ptr(new FakeDNSSDResolveHostnameQuery(hostname, interfaceIndex, shared_from_this())); +std::shared_ptr FakeDNSSDQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) { + return std::make_shared(hostname, interfaceIndex, shared_from_this()); } -void FakeDNSSDQuerier::addRunningQuery(boost::shared_ptr query) { +void FakeDNSSDQuerier::addRunningQuery(std::shared_ptr query) { runningQueries.push_back(query); allQueriesEverRun.push_back(query); - if (boost::shared_ptr browseQuery = boost::dynamic_pointer_cast(query)) { + if (std::shared_ptr browseQuery = std::dynamic_pointer_cast(query)) { foreach(const DNSSDServiceID& service, services) { eventLoop->postEvent(boost::bind(boost::ref(browseQuery->onServiceAdded), service), shared_from_this()); } } - else if (boost::shared_ptr resolveQuery = boost::dynamic_pointer_cast(query)) { + else if (std::shared_ptr resolveQuery = std::dynamic_pointer_cast(query)) { for(ServiceInfoMap::const_iterator i = serviceInfo.begin(); i != serviceInfo.end(); ++i) { if (i->first == resolveQuery->service) { eventLoop->postEvent(boost::bind(boost::ref(resolveQuery->onServiceResolved), i->second), shared_from_this()); } } } - else if (boost::shared_ptr registerQuery = boost::dynamic_pointer_cast(query)) { + else if (std::shared_ptr registerQuery = std::dynamic_pointer_cast(query)) { DNSSDServiceID service(registerQuery->name, domain); eventLoop->postEvent(boost::bind(boost::ref(registerQuery->onRegisterFinished), service), shared_from_this()); } - else if (boost::shared_ptr resolveHostnameQuery = boost::dynamic_pointer_cast(query)) { + else if (std::shared_ptr resolveHostnameQuery = std::dynamic_pointer_cast(query)) { std::map >::const_iterator i = addresses.find(resolveHostnameQuery->hostname); if (i != addresses.end()) { eventLoop->postEvent( @@ -75,13 +75,13 @@ void FakeDNSSDQuerier::addRunningQuery(boost::shared_ptr query) } } -void FakeDNSSDQuerier::removeRunningQuery(boost::shared_ptr query) { +void FakeDNSSDQuerier::removeRunningQuery(std::shared_ptr query) { erase(runningQueries, query); } void FakeDNSSDQuerier::addService(const DNSSDServiceID& id) { services.insert(id); - foreach(const boost::shared_ptr& query, getQueries()) { + foreach(const std::shared_ptr& query, getQueries()) { eventLoop->postEvent(boost::bind(boost::ref(query->onServiceAdded), id), shared_from_this()); } } @@ -89,7 +89,7 @@ void FakeDNSSDQuerier::addService(const DNSSDServiceID& id) { void FakeDNSSDQuerier::removeService(const DNSSDServiceID& id) { services.erase(id); serviceInfo.erase(id); - foreach(const boost::shared_ptr& query, getQueries()) { + foreach(const std::shared_ptr& query, getQueries()) { eventLoop->postEvent(boost::bind(boost::ref(query->onServiceRemoved), id), shared_from_this()); } } @@ -99,7 +99,7 @@ void FakeDNSSDQuerier::setServiceInfo(const DNSSDServiceID& id, const DNSSDResol if (!r.second) { r.first->second = info; } - foreach(const boost::shared_ptr& query, getQueries()) { + foreach(const std::shared_ptr& query, getQueries()) { if (query->service == id) { eventLoop->postEvent(boost::bind(boost::ref(query->onServiceResolved), info), shared_from_this()); } @@ -107,7 +107,7 @@ void FakeDNSSDQuerier::setServiceInfo(const DNSSDServiceID& id, const DNSSDResol } bool FakeDNSSDQuerier::isServiceRegistered(const std::string& name, int port, const ByteArray& info) { - foreach(const boost::shared_ptr& query, getQueries()) { + foreach(const std::shared_ptr& query, getQueries()) { if (query->name == name && query->port == port && query->info == info) { return true; } @@ -116,20 +116,20 @@ bool FakeDNSSDQuerier::isServiceRegistered(const std::string& name, int port, co } void FakeDNSSDQuerier::setBrowseError() { - foreach(const boost::shared_ptr& query, getQueries()) { + foreach(const std::shared_ptr& query, getQueries()) { eventLoop->postEvent(boost::ref(query->onError), shared_from_this()); } } void FakeDNSSDQuerier::setRegisterError() { - foreach(const boost::shared_ptr& query, getQueries()) { + foreach(const std::shared_ptr& query, getQueries()) { eventLoop->postEvent(boost::bind(boost::ref(query->onRegisterFinished), boost::optional()), shared_from_this()); } } void FakeDNSSDQuerier::setAddress(const std::string& hostname, boost::optional address) { addresses[hostname] = address; - foreach(const boost::shared_ptr& query, getQueries()) { + foreach(const std::shared_ptr& query, getQueries()) { if (query->hostname == hostname) { eventLoop->postEvent(boost::bind( boost::ref(query->onHostnameResolved), address), shared_from_this()); diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h index 536bf90..85fdc3a 100644 --- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h +++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h @@ -7,12 +7,10 @@ #pragma once #include +#include #include #include -#include -#include - #include #include #include @@ -28,7 +26,7 @@ namespace Swift { class SWIFTEN_API FakeDNSSDQuerier : public DNSSDQuerier, public EventOwner, - public boost::enable_shared_from_this { + public std::enable_shared_from_this { public: FakeDNSSDQuerier(const std::string& domain, EventLoop* eventLoop); ~FakeDNSSDQuerier(); @@ -40,16 +38,16 @@ namespace Swift { allQueriesEverRun.clear(); } - boost::shared_ptr createBrowseQuery(); - boost::shared_ptr createRegisterQuery( + std::shared_ptr createBrowseQuery(); + std::shared_ptr createRegisterQuery( const std::string& name, int port, const ByteArray& info); - boost::shared_ptr createResolveServiceQuery( + std::shared_ptr createResolveServiceQuery( const DNSSDServiceID&); - boost::shared_ptr createResolveHostnameQuery( + std::shared_ptr createResolveHostnameQuery( const std::string& hostname, int interfaceIndex); - void addRunningQuery(boost::shared_ptr); - void removeRunningQuery(boost::shared_ptr); + void addRunningQuery(std::shared_ptr); + void removeRunningQuery(std::shared_ptr); void addService(const DNSSDServiceID& id); void removeService(const DNSSDServiceID& id); @@ -62,10 +60,10 @@ namespace Swift { public: template - std::vector< boost::shared_ptr > getAllQueriesEverRun() const { - std::vector< boost::shared_ptr > result; + std::vector< std::shared_ptr > getAllQueriesEverRun() const { + std::vector< std::shared_ptr > result; for (QueryList::const_iterator i = allQueriesEverRun.begin(); i != allQueriesEverRun.end(); ++i) { - if (boost::shared_ptr resultQuery = boost::dynamic_pointer_cast(*i)) { + if (std::shared_ptr resultQuery = std::dynamic_pointer_cast(*i)) { result.push_back(resultQuery); } } @@ -74,10 +72,10 @@ namespace Swift { private: template - std::vector< boost::shared_ptr > getQueries() const { - std::vector< boost::shared_ptr > result; + std::vector< std::shared_ptr > getQueries() const { + std::vector< std::shared_ptr > result; for (QueryList::const_iterator i = runningQueries.begin(); i != runningQueries.end(); ++i) { - if (boost::shared_ptr resultQuery = boost::dynamic_pointer_cast(*i)) { + if (std::shared_ptr resultQuery = std::dynamic_pointer_cast(*i)) { result.push_back(resultQuery); } } @@ -87,7 +85,7 @@ namespace Swift { private: std::string domain; EventLoop* eventLoop; - typedef std::list< boost::shared_ptr > QueryList; + typedef std::list< std::shared_ptr > QueryList; QueryList runningQueries; QueryList allQueriesEverRun; std::set services; diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.cpp b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.cpp index 980b757..0e05968 100644 --- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.cpp +++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.cpp @@ -10,7 +10,7 @@ namespace Swift { -FakeDNSSDQuery::FakeDNSSDQuery(boost::shared_ptr querier) : querier(querier) { +FakeDNSSDQuery::FakeDNSSDQuery(std::shared_ptr querier) : querier(querier) { } FakeDNSSDQuery::~FakeDNSSDQuery() { diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.h index 0d7dedc..5d869d4 100644 --- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.h +++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.h @@ -6,8 +6,7 @@ #pragma once -#include -#include +#include #include @@ -16,9 +15,9 @@ namespace Swift { class FakeDNSSDQuery : public EventOwner, - public boost::enable_shared_from_this { + public std::enable_shared_from_this { public: - FakeDNSSDQuery(boost::shared_ptr); + FakeDNSSDQuery(std::shared_ptr); virtual ~FakeDNSSDQuery(); protected: @@ -26,6 +25,6 @@ namespace Swift { void finish(); protected: - boost::shared_ptr querier; + std::shared_ptr querier; }; } diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDRegisterQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDRegisterQuery.h index 484b2c2..7478841 100644 --- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDRegisterQuery.h +++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDRegisterQuery.h @@ -17,7 +17,7 @@ namespace Swift { class FakeDNSSDRegisterQuery : public DNSSDRegisterQuery, public FakeDNSSDQuery { public: - FakeDNSSDRegisterQuery(const std::string& name, int port, const ByteArray& info, boost::shared_ptr querier) : FakeDNSSDQuery(querier), name(name), port(port), info(info) { + FakeDNSSDRegisterQuery(const std::string& name, int port, const ByteArray& info, std::shared_ptr querier) : FakeDNSSDQuery(querier), name(name), port(port), info(info) { } void registerService() { diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveHostnameQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveHostnameQuery.h index 0b6a95d..60dc144 100644 --- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveHostnameQuery.h +++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveHostnameQuery.h @@ -17,7 +17,7 @@ namespace Swift { class FakeDNSSDResolveHostnameQuery : public DNSSDResolveHostnameQuery, public FakeDNSSDQuery { public: - FakeDNSSDResolveHostnameQuery(const std::string& hostname, int interfaceIndex, boost::shared_ptr querier) : FakeDNSSDQuery(querier), hostname(hostname), interfaceIndex(interfaceIndex) { + FakeDNSSDResolveHostnameQuery(const std::string& hostname, int interfaceIndex, std::shared_ptr querier) : FakeDNSSDQuery(querier), hostname(hostname), interfaceIndex(interfaceIndex) { } void run() { diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveServiceQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveServiceQuery.h index 180fbb2..8a02e7b 100644 --- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveServiceQuery.h +++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveServiceQuery.h @@ -15,7 +15,7 @@ namespace Swift { class FakeDNSSDResolveServiceQuery : public DNSSDResolveServiceQuery, public FakeDNSSDQuery { public: - FakeDNSSDResolveServiceQuery(const DNSSDServiceID& service, boost::shared_ptr querier) : FakeDNSSDQuery(querier), service(service) { + FakeDNSSDResolveServiceQuery(const DNSSDServiceID& service, std::shared_ptr querier) : FakeDNSSDQuery(querier), service(service) { } void start() { diff --git a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp index f2bfa2e..e20326b 100644 --- a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp +++ b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -18,14 +18,14 @@ namespace Swift { PlatformDNSSDQuerierFactory::PlatformDNSSDQuerierFactory(EventLoop* eventLoop) : eventLoop(eventLoop) { } -boost::shared_ptr PlatformDNSSDQuerierFactory::createQuerier() { +std::shared_ptr PlatformDNSSDQuerierFactory::createQuerier() { #if defined(HAVE_BONJOUR) - return boost::shared_ptr(new BonjourQuerier(eventLoop)); + return std::make_shared(eventLoop); #elif defined(HAVE_AVAHI) - return boost::shared_ptr(new AvahiQuerier(eventLoop)); + return std::make_shared(eventLoop); #else (void)eventLoop; - return boost::shared_ptr(); + return std::shared_ptr(); #endif } diff --git a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h index dc40d01..68e10cf 100644 --- a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h +++ b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include @@ -18,7 +18,7 @@ namespace Swift { public: PlatformDNSSDQuerierFactory(EventLoop* eventLoop); - boost::shared_ptr createQuerier(); + std::shared_ptr createQuerier(); bool canCreate(); diff --git a/Swiften/LinkLocal/IncomingLinkLocalSession.cpp b/Swiften/LinkLocal/IncomingLinkLocalSession.cpp index 435b065..9d446a9 100644 --- a/Swiften/LinkLocal/IncomingLinkLocalSession.cpp +++ b/Swiften/LinkLocal/IncomingLinkLocalSession.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -21,7 +22,7 @@ namespace Swift { IncomingLinkLocalSession::IncomingLinkLocalSession( const JID& localJID, - boost::shared_ptr connection, + std::shared_ptr connection, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers, XMLParserFactory* xmlParserFactory) : @@ -42,15 +43,15 @@ void IncomingLinkLocalSession::handleStreamStart(const ProtocolHeader& incomingH getXMPPLayer()->writeHeader(header); if (incomingHeader.getVersion() == "1.0") { - getXMPPLayer()->writeElement(boost::make_shared()); + getXMPPLayer()->writeElement(std::make_shared()); } else { setInitialized(); } } -void IncomingLinkLocalSession::handleElement(boost::shared_ptr element) { - boost::shared_ptr stanza = boost::dynamic_pointer_cast(element); +void IncomingLinkLocalSession::handleElement(std::shared_ptr element) { + std::shared_ptr stanza = std::dynamic_pointer_cast(element); // If we get our first stanza before streamfeatures, our session is implicitly // initialized if (stanza && !isInitialized()) { diff --git a/Swiften/LinkLocal/IncomingLinkLocalSession.h b/Swiften/LinkLocal/IncomingLinkLocalSession.h index 44a8719..b3f0866 100644 --- a/Swiften/LinkLocal/IncomingLinkLocalSession.h +++ b/Swiften/LinkLocal/IncomingLinkLocalSession.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -25,7 +25,7 @@ namespace Swift { public: IncomingLinkLocalSession( const JID& localJID, - boost::shared_ptr connection, + std::shared_ptr connection, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers, XMLParserFactory* xmlParserFactory); @@ -33,7 +33,7 @@ namespace Swift { boost::signal onSessionStarted; private: - void handleElement(boost::shared_ptr); + void handleElement(std::shared_ptr); void handleStreamStart(const ProtocolHeader&); void setInitialized(); bool isInitialized() const { diff --git a/Swiften/LinkLocal/LinkLocalConnector.cpp b/Swiften/LinkLocal/LinkLocalConnector.cpp index 9123e8e..d961030 100644 --- a/Swiften/LinkLocal/LinkLocalConnector.cpp +++ b/Swiften/LinkLocal/LinkLocalConnector.cpp @@ -19,8 +19,8 @@ namespace Swift { LinkLocalConnector::LinkLocalConnector( const LinkLocalService& service, - boost::shared_ptr querier, - boost::shared_ptr connection) : + std::shared_ptr querier, + std::shared_ptr connection) : service(service), querier(querier), connection(connection) { @@ -36,7 +36,7 @@ void LinkLocalConnector::connect() { service.getID().getNetworkInterfaceID()); resolveQueryHostNameResolvedConnection = resolveQuery->onHostnameResolved.connect(boost::bind( &LinkLocalConnector::handleHostnameResolved, - boost::dynamic_pointer_cast(shared_from_this()), + std::dynamic_pointer_cast(shared_from_this()), _1)); resolveQuery->run(); } @@ -71,7 +71,7 @@ void LinkLocalConnector::handleConnected(bool error) { connectionConnectFinishedConnection.disconnect(); } -void LinkLocalConnector::queueElement(boost::shared_ptr element) { +void LinkLocalConnector::queueElement(std::shared_ptr element) { queuedElements.push_back(element); } diff --git a/Swiften/LinkLocal/LinkLocalConnector.h b/Swiften/LinkLocal/LinkLocalConnector.h index 4e05dce..a55d1b6 100644 --- a/Swiften/LinkLocal/LinkLocalConnector.h +++ b/Swiften/LinkLocal/LinkLocalConnector.h @@ -6,11 +6,9 @@ #pragma once +#include #include -#include -#include - #include #include #include @@ -25,12 +23,12 @@ namespace Swift { class DNSSDQuerier; class DNSSDResolveHostnameQuery; - class SWIFTEN_API LinkLocalConnector : public boost::enable_shared_from_this { + class SWIFTEN_API LinkLocalConnector : public std::enable_shared_from_this { public: LinkLocalConnector( const LinkLocalService& service, - boost::shared_ptr querier, - boost::shared_ptr connection); + std::shared_ptr querier, + std::shared_ptr connection); ~LinkLocalConnector(); const LinkLocalService& getService() const { @@ -39,13 +37,13 @@ namespace Swift { void connect(); void cancel(); - void queueElement(boost::shared_ptr element); + void queueElement(std::shared_ptr element); - const std::vector >& getQueuedElements() const { + const std::vector >& getQueuedElements() const { return queuedElements; } - boost::shared_ptr getConnection() const { + std::shared_ptr getConnection() const { return connection; } @@ -57,11 +55,11 @@ namespace Swift { private: LinkLocalService service; - boost::shared_ptr querier; - boost::shared_ptr resolveQuery; + std::shared_ptr querier; + std::shared_ptr resolveQuery; boost::bsignals::connection resolveQueryHostNameResolvedConnection; - boost::shared_ptr connection; + std::shared_ptr connection; boost::bsignals::connection connectionConnectFinishedConnection; - std::vector > queuedElements; + std::vector > queuedElements; }; } diff --git a/Swiften/LinkLocal/LinkLocalServiceBrowser.cpp b/Swiften/LinkLocal/LinkLocalServiceBrowser.cpp index d9dfd64..e3b6028 100644 --- a/Swiften/LinkLocal/LinkLocalServiceBrowser.cpp +++ b/Swiften/LinkLocal/LinkLocalServiceBrowser.cpp @@ -15,7 +15,7 @@ namespace Swift { -LinkLocalServiceBrowser::LinkLocalServiceBrowser(boost::shared_ptr querier) : querier(querier), haveError(false) { +LinkLocalServiceBrowser::LinkLocalServiceBrowser(std::shared_ptr querier) : querier(querier), haveError(false) { } LinkLocalServiceBrowser::~LinkLocalServiceBrowser() { @@ -98,10 +98,10 @@ void LinkLocalServiceBrowser::handleServiceAdded(const DNSSDServiceID& service) return; } - std::pair r = resolveQueries.insert(std::make_pair(service, boost::shared_ptr())); + std::pair r = resolveQueries.insert(std::make_pair(service, std::shared_ptr())); if (r.second) { // There was no existing query yet. Start a new query. - boost::shared_ptr resolveQuery = querier->createResolveServiceQuery(service); + std::shared_ptr resolveQuery = querier->createResolveServiceQuery(service); resolveQuery->onServiceResolved.connect( boost::bind(&LinkLocalServiceBrowser::handleServiceResolved, this, service, _1)); r.first->second = resolveQuery; diff --git a/Swiften/LinkLocal/LinkLocalServiceBrowser.h b/Swiften/LinkLocal/LinkLocalServiceBrowser.h index 3795258..2b0545e 100644 --- a/Swiften/LinkLocal/LinkLocalServiceBrowser.h +++ b/Swiften/LinkLocal/LinkLocalServiceBrowser.h @@ -7,11 +7,11 @@ #pragma once #include +#include #include #include #include -#include #include #include @@ -25,7 +25,7 @@ namespace Swift { class SWIFTEN_API LinkLocalServiceBrowser { public: - LinkLocalServiceBrowser(boost::shared_ptr querier); + LinkLocalServiceBrowser(std::shared_ptr querier); ~LinkLocalServiceBrowser(); void start(); @@ -45,7 +45,7 @@ namespace Swift { std::vector getServices() const; // FIXME: Ugly that we need this - boost::shared_ptr getQuerier() const { + std::shared_ptr getQuerier() const { return querier; } @@ -63,11 +63,11 @@ namespace Swift { void handleBrowseError(); private: - boost::shared_ptr querier; + std::shared_ptr querier; boost::optional selfService; - boost::shared_ptr browseQuery; - boost::shared_ptr registerQuery; - typedef std::map > ResolveQueryMap; + std::shared_ptr browseQuery; + std::shared_ptr registerQuery; + typedef std::map > ResolveQueryMap; ResolveQueryMap resolveQueries; typedef std::map ServiceMap; ServiceMap services; diff --git a/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp b/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp index 89d0e89..f97d9a1 100644 --- a/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp +++ b/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp @@ -19,7 +19,7 @@ namespace Swift { OutgoingLinkLocalSession::OutgoingLinkLocalSession( const JID& localJID, const JID& remoteJID, - boost::shared_ptr connection, + std::shared_ptr connection, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers, XMLParserFactory* xmlParserFactory) : @@ -35,17 +35,17 @@ void OutgoingLinkLocalSession::handleSessionStarted() { } void OutgoingLinkLocalSession::handleStreamStart(const ProtocolHeader&) { - foreach(const boost::shared_ptr& stanza, queuedElements_) { + foreach(const std::shared_ptr& stanza, queuedElements_) { sendElement(stanza); } queuedElements_.clear(); } -void OutgoingLinkLocalSession::handleElement(boost::shared_ptr element) { +void OutgoingLinkLocalSession::handleElement(std::shared_ptr element) { onElementReceived(element); } -void OutgoingLinkLocalSession::queueElement(boost::shared_ptr element) { +void OutgoingLinkLocalSession::queueElement(std::shared_ptr element) { queuedElements_.push_back(element); } diff --git a/Swiften/LinkLocal/OutgoingLinkLocalSession.h b/Swiften/LinkLocal/OutgoingLinkLocalSession.h index b467918..2f08ed3 100644 --- a/Swiften/LinkLocal/OutgoingLinkLocalSession.h +++ b/Swiften/LinkLocal/OutgoingLinkLocalSession.h @@ -6,11 +6,9 @@ #pragma once +#include #include -#include -#include - #include #include #include @@ -28,19 +26,19 @@ namespace Swift { OutgoingLinkLocalSession( const JID& localJID, const JID& remoteJID, - boost::shared_ptr connection, + std::shared_ptr connection, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers, XMLParserFactory* xmlParserFactory); - void queueElement(boost::shared_ptr element); + void queueElement(std::shared_ptr element); private: void handleSessionStarted(); - void handleElement(boost::shared_ptr); + void handleElement(std::shared_ptr); void handleStreamStart(const ProtocolHeader&); private: - std::vector > queuedElements_; + std::vector > queuedElements_; }; } diff --git a/Swiften/LinkLocal/UnitTest/LinkLocalConnectorTest.cpp b/Swiften/LinkLocal/UnitTest/LinkLocalConnectorTest.cpp index 3511f90..3c5e098 100644 --- a/Swiften/LinkLocal/UnitTest/LinkLocalConnectorTest.cpp +++ b/Swiften/LinkLocal/UnitTest/LinkLocalConnectorTest.cpp @@ -31,8 +31,8 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture { public: void setUp() { eventLoop = new DummyEventLoop(); - querier = boost::make_shared("rabbithole.local", eventLoop); - connection = boost::make_shared(eventLoop); + querier = std::make_shared("rabbithole.local", eventLoop); + connection = std::make_shared(eventLoop); connectFinished = false; } @@ -42,7 +42,7 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture { } void testConnect() { - boost::shared_ptr + std::shared_ptr testling(createConnector("rabbithole.local", 1234)); querier->setAddress("rabbithole.local", HostAddress("192.168.1.1")); @@ -57,7 +57,7 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture { } void testConnect_UnableToResolve() { - boost::shared_ptr + std::shared_ptr testling(createConnector("rabbithole.local", 1234)); querier->setAddress("rabbithole.local", boost::optional()); @@ -70,7 +70,7 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture { } void testConnect_UnableToConnect() { - boost::shared_ptr + std::shared_ptr testling(createConnector("rabbithole.local", 1234)); querier->setAddress("rabbithole.local", HostAddress("192.168.1.1")); connection->setError(Connection::ReadError); @@ -84,7 +84,7 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture { } void testCancel_DuringResolve() { - boost::shared_ptr + std::shared_ptr testling(createConnector("rabbithole.local", 1234)); testling->connect(); eventLoop->processEvents(); @@ -99,7 +99,7 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture { } void testCancel_DuringConnect() { - boost::shared_ptr + std::shared_ptr testling(createConnector("rabbithole.local", 1234)); querier->setAddress("rabbithole.local", HostAddress("192.168.1.1")); connection->setDelayConnect(); @@ -114,13 +114,13 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createConnector(const std::string& hostname, int port) { + std::shared_ptr createConnector(const std::string& hostname, int port) { LinkLocalService service( DNSSDServiceID("myname", "local."), DNSSDResolveServiceQuery::Result( "myname._presence._tcp.local", hostname, port, LinkLocalServiceInfo().toTXTRecord())); - boost::shared_ptr result( + std::shared_ptr result( new LinkLocalConnector(service, querier, connection)); result->onConnectFinished.connect( boost::bind(&LinkLocalConnectorTest::handleConnected, this, _1)); @@ -134,8 +134,8 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture { private: DummyEventLoop* eventLoop; - boost::shared_ptr querier; - boost::shared_ptr connection; + std::shared_ptr querier; + std::shared_ptr connection; bool connectFinished; bool connectError; }; diff --git a/Swiften/LinkLocal/UnitTest/LinkLocalServiceBrowserTest.cpp b/Swiften/LinkLocal/UnitTest/LinkLocalServiceBrowserTest.cpp index 6d8ba97..a80d748 100644 --- a/Swiften/LinkLocal/UnitTest/LinkLocalServiceBrowserTest.cpp +++ b/Swiften/LinkLocal/UnitTest/LinkLocalServiceBrowserTest.cpp @@ -5,9 +5,9 @@ */ #include +#include #include -#include #include #include @@ -45,7 +45,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { public: void setUp() { eventLoop = new DummyEventLoop(); - querier = boost::make_shared("wonderland.lit", eventLoop); + querier = std::make_shared("wonderland.lit", eventLoop); aliceServiceID = new DNSSDServiceID("alice", "wonderland.lit"); aliceServiceInfo = new DNSSDResolveServiceQuery::Result("_presence._tcp.wonderland.lit", "xmpp.wonderland.lit", 1234, LinkLocalServiceInfo().toTXTRecord()); testServiceID = new DNSSDServiceID("foo", "bar.local"); @@ -70,14 +70,14 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } void testConstructor() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); CPPUNIT_ASSERT(!testling->isRunning()); CPPUNIT_ASSERT(!testling->hasError()); } void testStart() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); CPPUNIT_ASSERT(testling->isRunning()); @@ -87,7 +87,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } void testServiceAdded() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); eventLoop->processEvents(); @@ -109,7 +109,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } void testServiceAdded_NoServiceInfo() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); eventLoop->processEvents(); @@ -123,7 +123,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } void testServiceAdded_RegisteredService() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); eventLoop->processEvents(); @@ -140,7 +140,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } void testServiceAdded_UnregisteredService() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); eventLoop->processEvents(); testling->registerService("alice", 1234, LinkLocalServiceInfo()); @@ -166,7 +166,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } void testServiceRemoved_UnregisteredService() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); eventLoop->processEvents(); testling->registerService("alice", 1234, LinkLocalServiceInfo()); @@ -183,7 +183,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } void testServiceAdded_Twice() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); eventLoop->processEvents(); @@ -208,7 +208,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { void testServiceChanged() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); querier->setServiceInfo(*testServiceID,*testServiceInfo); querier->addService(*testServiceID); @@ -231,7 +231,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } void testServiceRemoved() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); querier->setServiceInfo(*testServiceID,*testServiceInfo); querier->addService(*testServiceID); @@ -252,7 +252,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } void testError_BrowseErrorAfterStart() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); querier->setBrowseError(); @@ -264,7 +264,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } void testError_BrowseErrorAfterResolve() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); querier->setServiceInfo(*testServiceID,*testServiceInfo); querier->addService(*testServiceID); @@ -283,7 +283,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } void testRegisterService() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); eventLoop->processEvents(); @@ -299,7 +299,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } void testRegisterService_Error() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); LinkLocalServiceInfo info; testling->registerService("foo@bar", 1234, info); @@ -315,7 +315,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } void testRegisterService_Reregister() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); eventLoop->processEvents(); LinkLocalServiceInfo info; @@ -335,7 +335,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } void testUpdateService() { - boost::shared_ptr testling = createTestling(); + std::shared_ptr testling = createTestling(); testling->start(); eventLoop->processEvents(); @@ -352,8 +352,8 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createTestling() { - boost::shared_ptr testling( + std::shared_ptr createTestling() { + std::shared_ptr testling( new LinkLocalServiceBrowser(querier)); testling->onServiceAdded.connect(boost::bind( &LinkLocalServiceBrowserTest::handleServiceAdded, this, _1)); @@ -397,7 +397,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { private: DummyEventLoop* eventLoop; - boost::shared_ptr querier; + std::shared_ptr querier; std::vector addedServices; std::vector changedServices; std::vector removedServices; diff --git a/Swiften/MUC/MUC.h b/Swiften/MUC/MUC.h index e8f953e..d0c2bab 100644 --- a/Swiften/MUC/MUC.h +++ b/Swiften/MUC/MUC.h @@ -7,9 +7,9 @@ #pragma once #include +#include #include -#include #include #include @@ -30,7 +30,7 @@ namespace Swift { class SWIFTEN_API MUC { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum JoinResult { JoinSucceeded, JoinFailed }; enum LeavingType { LeavePart, LeaveKick, LeaveBan, LeaveDestroy, LeaveNotMember, Disconnect }; diff --git a/Swiften/MUC/MUCBookmarkManager.cpp b/Swiften/MUC/MUCBookmarkManager.cpp index 1d8c2aa..570c613 100644 --- a/Swiften/MUC/MUCBookmarkManager.cpp +++ b/Swiften/MUC/MUCBookmarkManager.cpp @@ -7,9 +7,9 @@ #include #include +#include #include -#include #include #include @@ -26,7 +26,7 @@ MUCBookmarkManager::MUCBookmarkManager(IQRouter* iqRouter) { request->send(); } -void MUCBookmarkManager::handleBookmarksReceived(boost::shared_ptr payload, ErrorPayload::ref error) { +void MUCBookmarkManager::handleBookmarksReceived(std::shared_ptr payload, ErrorPayload::ref error) { if (error) { return; } @@ -99,7 +99,7 @@ void MUCBookmarkManager::removeBookmark(const MUCBookmark& bookmark) { void MUCBookmarkManager::flush() { if (!storage) { - storage = boost::make_shared(); + storage = std::make_shared(); } // Update the storage element storage->clearRooms(); diff --git a/Swiften/MUC/MUCBookmarkManager.h b/Swiften/MUC/MUCBookmarkManager.h index 18dd677..58aaeee 100644 --- a/Swiften/MUC/MUCBookmarkManager.h +++ b/Swiften/MUC/MUCBookmarkManager.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -40,13 +40,13 @@ namespace Swift { private: bool containsEquivalent(const std::vector& list, const MUCBookmark& bookmark); - void handleBookmarksReceived(boost::shared_ptr payload, ErrorPayload::ref error); + void handleBookmarksReceived(std::shared_ptr payload, ErrorPayload::ref error); void flush(); private: bool ready_; std::vector bookmarks_; IQRouter* iqRouter_; - boost::shared_ptr storage; + std::shared_ptr storage; }; } diff --git a/Swiften/MUC/MUCImpl.cpp b/Swiften/MUC/MUCImpl.cpp index 8562ec8..4bab39d 100644 --- a/Swiften/MUC/MUCImpl.cpp +++ b/Swiften/MUC/MUCImpl.cpp @@ -6,9 +6,9 @@ #include +#include + #include -#include -#include #include #include @@ -92,10 +92,10 @@ void MUCImpl::internalJoin(const std::string &nick) { ownMUCJID = JID(ownMUCJID.getNode(), ownMUCJID.getDomain(), nick); - Presence::ref joinPresence = presenceSender->getLastSentUndirectedPresence() ? (*presenceSender->getLastSentUndirectedPresence())->clone() : boost::make_shared(); + Presence::ref joinPresence = presenceSender->getLastSentUndirectedPresence() ? (*presenceSender->getLastSentUndirectedPresence())->clone() : std::make_shared(); assert(joinPresence->getType() == Presence::Available); joinPresence->setTo(ownMUCJID); - MUCPayload::ref mucPayload = boost::make_shared(); + MUCPayload::ref mucPayload = std::make_shared(); if (joinSince_ != boost::posix_time::not_a_date_time) { mucPayload->setSince(joinSince_); } @@ -108,7 +108,7 @@ void MUCImpl::internalJoin(const std::string &nick) { } void MUCImpl::changeNickname(const std::string& newNickname) { - Presence::ref changeNicknamePresence = boost::make_shared(); + Presence::ref changeNicknamePresence = std::make_shared(); changeNicknamePresence->setTo(ownMUCJID.toBare().toString() + std::string("/") + newNickname); presenceSender->sendPresence(changeNicknamePresence); } @@ -157,7 +157,7 @@ void MUCImpl::handleIncomingPresence(Presence::ref presence) { presenceSender->addDirectedPresenceReceiver(ownMUCJID, DirectedPresenceSender::DontSendPresence); if (presenceSender->getLastSentUndirectedPresence() && !isEqualExceptID(**(presenceSender->getLastSentUndirectedPresence()), *joinRequestPresence_)) { // our presence changed between join request and join complete, send current presence to MUC - Presence::ref latestPresence = boost::make_shared(**presenceSender->getLastSentUndirectedPresence()); + Presence::ref latestPresence = std::make_shared(**presenceSender->getLastSentUndirectedPresence()); latestPresence->setTo(ownMUCJID); presenceSender->sendPresence(latestPresence); } @@ -185,7 +185,7 @@ void MUCImpl::handleIncomingPresence(Presence::ref presence) { LeavingType type = LeavePart; boost::optional newNickname; if (mucPayload) { - if (boost::dynamic_pointer_cast(mucPayload->getPayload())) { + if (std::dynamic_pointer_cast(mucPayload->getPayload())) { type = LeaveDestroy; } else foreach (MUCUserPayload::StatusCode status, mucPayload->getStatusCodes()) { @@ -285,8 +285,8 @@ void MUCImpl::handleIncomingPresence(Presence::ref presence) { // Accept default room configuration and create an instant room http://xmpp.org/extensions/xep-0045.html#createroom-instant MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload()); presenceSender->addDirectedPresenceReceiver(ownMUCJID, DirectedPresenceSender::DontSendPresence); - mucPayload->setPayload(boost::make_shared(Form::SubmitType)); - boost::shared_ptr< GenericRequest > request = boost::make_shared< GenericRequest >(IQ::Set, getJID(), mucPayload, iqRouter_); + mucPayload->setPayload(std::make_shared(Form::SubmitType)); + std::shared_ptr< GenericRequest > request = std::make_shared< GenericRequest >(IQ::Set, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleCreationConfigResponse, this, _1, _2)); request->send(); } @@ -330,12 +330,12 @@ void MUCImpl::kickOccupant(const JID& jid) { * Call with the room JID, not the real JID. */ void MUCImpl::changeOccupantRole(const JID& jid, MUCOccupant::Role role) { - MUCAdminPayload::ref mucPayload = boost::make_shared(); + MUCAdminPayload::ref mucPayload = std::make_shared(); MUCItem item; item.role = role; item.nick = jid.getResource(); mucPayload->addItem(item); - boost::shared_ptr > request = boost::make_shared >(IQ::Set, getJID(), mucPayload, iqRouter_); + std::shared_ptr > request = std::make_shared >(IQ::Set, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleOccupantRoleChangeResponse, this, _1, _2, jid, role)); request->send(); @@ -348,11 +348,11 @@ void MUCImpl::handleOccupantRoleChangeResponse(MUCAdminPayload::ref /*unused*/, } void MUCImpl::requestAffiliationList(MUCOccupant::Affiliation affiliation) { - MUCAdminPayload::ref mucPayload = boost::make_shared(); + MUCAdminPayload::ref mucPayload = std::make_shared(); MUCItem item; item.affiliation = affiliation; mucPayload->addItem(item); - boost::shared_ptr > request = boost::make_shared< GenericRequest >(IQ::Get, getJID(), mucPayload, iqRouter_); + std::shared_ptr > request = std::make_shared< GenericRequest >(IQ::Get, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleAffiliationListResponse, this, _1, _2, affiliation)); request->send(); } @@ -361,12 +361,12 @@ void MUCImpl::requestAffiliationList(MUCOccupant::Affiliation affiliation) { * Must be called with the real JID, not the room JID. */ void MUCImpl::changeAffiliation(const JID& jid, MUCOccupant::Affiliation affiliation) { - MUCAdminPayload::ref mucPayload = boost::make_shared(); + MUCAdminPayload::ref mucPayload = std::make_shared(); MUCItem item; item.affiliation = affiliation; item.realJID = jid.toBare(); mucPayload->addItem(item); - boost::shared_ptr > request = boost::make_shared >(IQ::Set, getJID(), mucPayload, iqRouter_); + std::shared_ptr > request = std::make_shared >(IQ::Set, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleAffiliationChangeResponse, this, _1, _2, jid, affiliation)); request->send(); } @@ -393,7 +393,7 @@ void MUCImpl::handleAffiliationChangeResponse(MUCAdminPayload::ref /*unused*/, E } void MUCImpl::changeSubject(const std::string& subject) { - Message::ref message = boost::make_shared(); + Message::ref message = std::make_shared(); message->setSubject(subject); message->setType(Message::Groupchat); message->setTo(ownMUCJID.toBare()); @@ -402,15 +402,15 @@ void MUCImpl::changeSubject(const std::string& subject) { void MUCImpl::requestConfigurationForm() { MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload()); - boost::shared_ptr > request = boost::make_shared >(IQ::Get, getJID(), mucPayload, iqRouter_); + std::shared_ptr > request = std::make_shared >(IQ::Get, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleConfigurationFormReceived, this, _1, _2)); request->send(); } void MUCImpl::cancelConfigureRoom() { MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload()); - mucPayload->setPayload(boost::make_shared(Form::CancelType)); - boost::shared_ptr > request = boost::make_shared >(IQ::Set, getJID(), mucPayload, iqRouter_); + mucPayload->setPayload(std::make_shared(Form::CancelType)); + std::shared_ptr > request = std::make_shared >(IQ::Set, getJID(), mucPayload, iqRouter_); request->send(); } @@ -435,7 +435,7 @@ void MUCImpl::handleConfigurationResultReceived(MUCOwnerPayload::ref /*payload*/ void MUCImpl::configureRoom(Form::ref form) { MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload()); mucPayload->setPayload(form); - boost::shared_ptr > request = boost::make_shared >(IQ::Set, getJID(), mucPayload, iqRouter_); + std::shared_ptr > request = std::make_shared >(IQ::Set, getJID(), mucPayload, iqRouter_); if (unlocking) { request->onResponse.connect(boost::bind(&MUCImpl::handleCreationConfigResponse, this, _1, _2)); } @@ -446,19 +446,19 @@ void MUCImpl::configureRoom(Form::ref form) { } void MUCImpl::destroyRoom() { - MUCOwnerPayload::ref mucPayload = boost::make_shared(); - MUCDestroyPayload::ref mucDestroyPayload = boost::make_shared(); + MUCOwnerPayload::ref mucPayload = std::make_shared(); + MUCDestroyPayload::ref mucDestroyPayload = std::make_shared(); mucPayload->setPayload(mucDestroyPayload); - boost::shared_ptr< GenericRequest > request = boost::make_shared >(IQ::Set, getJID(), mucPayload, iqRouter_); + std::shared_ptr< GenericRequest > request = std::make_shared >(IQ::Set, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleConfigurationResultReceived, this, _1, _2)); request->send(); } void MUCImpl::invitePerson(const JID& person, const std::string& reason, bool isImpromptu, bool isReuseChat) { - Message::ref message = boost::make_shared(); + Message::ref message = std::make_shared(); message->setTo(person); message->setType(Message::Normal); - MUCInvitationPayload::ref invite = boost::make_shared(); + MUCInvitationPayload::ref invite = std::make_shared(); invite->setReason(reason); invite->setJID(ownMUCJID.toBare()); invite->setIsImpromptu(isImpromptu); diff --git a/Swiften/MUC/MUCImpl.h b/Swiften/MUC/MUCImpl.h index 9b4377a..f9802af 100644 --- a/Swiften/MUC/MUCImpl.h +++ b/Swiften/MUC/MUCImpl.h @@ -7,9 +7,9 @@ #pragma once #include +#include #include -#include #include #include @@ -31,7 +31,7 @@ namespace Swift { class SWIFTEN_API MUCImpl : public MUC { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: MUCImpl(StanzaChannel* stanzaChannel, IQRouter* iqRouter, DirectedPresenceSender* presenceSender, const JID &muc, MUCRegistry* mucRegistry); diff --git a/Swiften/MUC/MUCManager.cpp b/Swiften/MUC/MUCManager.cpp index b4e3b00..81e5cd5 100644 --- a/Swiften/MUC/MUCManager.cpp +++ b/Swiften/MUC/MUCManager.cpp @@ -14,7 +14,7 @@ MUCManager::MUCManager(StanzaChannel* stanzaChannel, IQRouter* iqRouter, Directe } MUC::ref MUCManager::createMUC(const JID& jid) { - return boost::make_shared(stanzaChannel, iqRouter, presenceSender, jid, mucRegistry); + return std::make_shared(stanzaChannel, iqRouter, presenceSender, jid, mucRegistry); } } diff --git a/Swiften/MUC/UnitTest/MUCTest.cpp b/Swiften/MUC/UnitTest/MUCTest.cpp index 548617c..115787e 100644 --- a/Swiften/MUC/UnitTest/MUCTest.cpp +++ b/Swiften/MUC/UnitTest/MUCTest.cpp @@ -4,9 +4,9 @@ * See the COPYING file for more information. */ +#include + #include -#include -#include #include #include @@ -102,7 +102,7 @@ class MUCTest : public CppUnit::TestFixture { void testCreateInstant() { MUC::ref testling = createMUC(JID("rabbithole@wonderland.lit")); testling->joinAs("Alice"); - Presence::ref serverRespondsLocked = boost::make_shared(); + Presence::ref serverRespondsLocked = std::make_shared(); serverRespondsLocked->setFrom(JID("rabbithole@wonderland.lit/Alice")); MUCUserPayload::ref mucPayload(new MUCUserPayload()); MUCItem myItem; @@ -122,12 +122,12 @@ class MUCTest : public CppUnit::TestFixture { } void testReplicateBug() { - Presence::ref initialPresence = boost::make_shared(); + Presence::ref initialPresence = std::make_shared(); initialPresence->setStatus(""); - VCard::ref vcard = boost::make_shared(); + VCard::ref vcard = std::make_shared(); vcard->setPhoto(createByteArray("15c30080ae98ec48be94bf0e191d43edd06e500a")); initialPresence->addPayload(vcard); - CapsInfo::ref caps = boost::make_shared(); + CapsInfo::ref caps = std::make_shared(); caps->setNode("http://swift.im"); caps->setVersion("p2UP0DrcVgKM6jJqYN/B92DKK0o="); initialPresence->addPayload(caps); @@ -135,7 +135,7 @@ class MUCTest : public CppUnit::TestFixture { MUC::ref testling = createMUC(JID("test@rooms.swift.im")); testling->joinAs("Test"); - Presence::ref serverRespondsLocked = boost::make_shared(); + Presence::ref serverRespondsLocked = std::make_shared(); serverRespondsLocked->setFrom(JID("test@rooms.swift.im/Test")); serverRespondsLocked->setTo(JID("test@swift.im/6913d576d55f0b67")); serverRespondsLocked->addPayload(vcard); @@ -163,14 +163,14 @@ class MUCTest : public CppUnit::TestFixture { testling->joinAs("Rabbit"); // Rabbit joins - Presence::ref rabbitJoins = boost::make_shared(); + Presence::ref rabbitJoins = std::make_shared(); rabbitJoins->setTo("test@swift.im/6913d576d55f0b67"); rabbitJoins->setFrom(testling->getJID().toString() + "/Rabbit"); channel->onPresenceReceived(rabbitJoins); CPPUNIT_ASSERT_EQUAL(true, testling->hasOccupant("Rabbit")); // Alice joins - Presence::ref aliceJoins = boost::make_shared(); + Presence::ref aliceJoins = std::make_shared(); aliceJoins->setTo("test@swift.im/6913d576d55f0b67"); aliceJoins->setFrom(testling->getJID().toString() + "/Alice"); channel->onPresenceReceived(aliceJoins); @@ -183,7 +183,7 @@ class MUCTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(std::string("Dodo"), stanza->getTo().getResource()); // Alice changes nick to Alice2 - stanza = boost::make_shared(); + stanza = std::make_shared(); stanza->setFrom(JID("foo@bar.com/Alice")); stanza->setTo(JID(router->getJID())); stanza->setType(Presence::Unavailable); @@ -201,7 +201,7 @@ class MUCTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(true, testling->hasOccupant("Alice2")); // We (Rabbit) change nick to Robot - stanza = boost::make_shared(); + stanza = std::make_shared(); stanza->setFrom(JID("foo@bar.com/Rabbit")); stanza->setTo(JID(router->getJID())); stanza->setType(Presence::Unavailable); @@ -235,7 +235,7 @@ class MUCTest : public CppUnit::TestFixture { private: MUC::ref createMUC(const JID& jid) { - MUC::ref muc = boost::make_shared(channel, router, presenceSender, jid, mucRegistry); + MUC::ref muc = std::make_shared(channel, router, presenceSender, jid, mucRegistry); muc->onOccupantNicknameChanged.connect(boost::bind(&MUCTest::handleOccupantNicknameChanged, this, _1, _2)); return muc; } @@ -250,7 +250,7 @@ class MUCTest : public CppUnit::TestFixture { void receivePresence(const JID& jid, const std::string& status) { Presence::ref p = Presence::create(status); p->setFrom(jid); - //MUCUserPayload::ref mucUserPayload = boost::make_shared(); + //MUCUserPayload::ref mucUserPayload = std::make_shared(); //mucUserPayload->addItem(item); //p->addPayload(mucUserPayload); channel->onPresenceReceived(p); diff --git a/Swiften/MUC/UnitTest/MockMUC.h b/Swiften/MUC/UnitTest/MockMUC.h index c61f8a9..575c8e7 100644 --- a/Swiften/MUC/UnitTest/MockMUC.h +++ b/Swiften/MUC/UnitTest/MockMUC.h @@ -7,9 +7,9 @@ #pragma once #include +#include #include -#include #include #include @@ -31,7 +31,7 @@ namespace Swift { class SWIFTEN_API MockMUC : public MUC{ public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: MockMUC(const JID &muc); diff --git a/Swiften/Network/BOSHConnection.cpp b/Swiften/Network/BOSHConnection.cpp index 887a5f0..757b1db 100644 --- a/Swiften/Network/BOSHConnection.cpp +++ b/Swiften/Network/BOSHConnection.cpp @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -42,10 +42,10 @@ BOSHConnection::BOSHConnection(const URL& boshURL, Connector::ref connector, XML connectionReady_(false) { if (boshURL_.getScheme() == "https") { - tlsLayer_ = boost::make_shared(tlsContextFactory, tlsOptions); + tlsLayer_ = std::make_shared(tlsContextFactory, tlsOptions); // The following dummyLayer_ is needed as the TLSLayer will pass the decrypted data to its parent layer. // The dummyLayer_ will serve as the parent layer. - dummyLayer_ = boost::make_shared(tlsLayer_.get()); + dummyLayer_ = std::make_shared(tlsLayer_.get()); } } @@ -78,7 +78,7 @@ void BOSHConnection::handleTLSConnected() { void BOSHConnection::handleTLSApplicationDataRead(const SafeByteArray& data) { SWIFT_LOG(debug) << std::endl; - handleDataRead(boost::make_shared(data)); + handleDataRead(std::make_shared(data)); } void BOSHConnection::handleTLSNetowrkDataWriteRequest(const SafeByteArray& data) { @@ -86,12 +86,12 @@ void BOSHConnection::handleTLSNetowrkDataWriteRequest(const SafeByteArray& data) connection_->write(data); } -void BOSHConnection::handleRawDataRead(boost::shared_ptr data) { +void BOSHConnection::handleRawDataRead(std::shared_ptr data) { SWIFT_LOG(debug) << std::endl; tlsLayer_->handleDataRead(*data.get()); } -void BOSHConnection::handleTLSError(boost::shared_ptr /* error */) { +void BOSHConnection::handleTLSError(std::shared_ptr /* error */) { } @@ -276,7 +276,7 @@ void BOSHConnection::startStream(const std::string& to, unsigned long long rid) SWIFT_LOG(debug) << "write stream header: " << safeByteArrayToString(safeHeader) << std::endl; } -void BOSHConnection::handleDataRead(boost::shared_ptr data) { +void BOSHConnection::handleDataRead(std::shared_ptr data) { onBOSHDataRead(*data); buffer_ = concat(buffer_, *data); std::string response = safeByteArrayToString(buffer_); @@ -295,7 +295,7 @@ void BOSHConnection::handleDataRead(boost::shared_ptr data) { if (parser.getBody()) { if (parser.getBody()->attributes.getAttribute("type") == "terminate") { BOSHError::Type errorType = parseTerminationCondition(parser.getBody()->attributes.getAttribute("condition")); - onSessionTerminated(errorType == BOSHError::NoError ? boost::shared_ptr() : boost::make_shared(errorType)); + onSessionTerminated(errorType == BOSHError::NoError ? std::shared_ptr() : std::make_shared(errorType)); } buffer_.clear(); if (waitingForStartResponse_) { diff --git a/Swiften/Network/BOSHConnection.h b/Swiften/Network/BOSHConnection.h index dc0f3a5..485e86a 100644 --- a/Swiften/Network/BOSHConnection.h +++ b/Swiften/Network/BOSHConnection.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -13,7 +13,7 @@ #pragma once -#include +#include #include #include @@ -51,15 +51,15 @@ namespace Swift { BOSHError(Type type) : SessionStream::SessionStreamError(SessionStream::SessionStreamError::ConnectionReadError), type(type) {} Type getType() {return type;} - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; private: Type type; }; - class SWIFTEN_API BOSHConnection : public boost::enable_shared_from_this { + class SWIFTEN_API BOSHConnection : public std::enable_shared_from_this { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static ref create(const URL& boshURL, Connector::ref connector, XMLParserFactory* parserFactory, TLSContextFactory* tlsContextFactory, const TLSOptions& tlsOptions) { return ref(new BOSHConnection(boshURL, connector, parserFactory, tlsContextFactory, tlsOptions)); } @@ -97,7 +97,7 @@ namespace Swift { static std::pair createHTTPRequest(const SafeByteArray& data, bool streamRestart, bool terminate, unsigned long long rid, const std::string& sid, const URL& boshURL); void handleConnectFinished(Connection::ref); - void handleDataRead(boost::shared_ptr data); + void handleDataRead(std::shared_ptr data); void handleDisconnected(const boost::optional& error); void write(const SafeByteArray& data, bool streamRestart, bool terminate); /* FIXME: refactor */ BOSHError::Type parseTerminationCondition(const std::string& text); @@ -106,16 +106,16 @@ namespace Swift { void handleTLSConnected(); void handleTLSApplicationDataRead(const SafeByteArray& data); void handleTLSNetowrkDataWriteRequest(const SafeByteArray& data); - void handleRawDataRead(boost::shared_ptr data); - void handleTLSError(boost::shared_ptr error); + void handleRawDataRead(std::shared_ptr data); + void handleTLSError(std::shared_ptr error); void writeData(const SafeByteArray& data); URL boshURL_; Connector::ref connector_; XMLParserFactory* parserFactory_; - boost::shared_ptr connection_; - boost::shared_ptr dummyLayer_; - boost::shared_ptr tlsLayer_; + std::shared_ptr connection_; + std::shared_ptr dummyLayer_; + std::shared_ptr tlsLayer_; std::string sid_; bool waitingForStartResponse_; unsigned long long rid_; diff --git a/Swiften/Network/BOSHConnectionPool.cpp b/Swiften/Network/BOSHConnectionPool.cpp index 7d5c164..9ce40d3 100644 --- a/Swiften/Network/BOSHConnectionPool.cpp +++ b/Swiften/Network/BOSHConnectionPool.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -17,7 +17,7 @@ #include namespace Swift { -BOSHConnectionPool::BOSHConnectionPool(const URL& boshURL, DomainNameResolver* realResolver, ConnectionFactory* connectionFactoryParameter, XMLParserFactory* parserFactory, TLSContextFactory* tlsFactory, TimerFactory* timerFactory, EventLoop* eventLoop, const std::string& to, unsigned long long initialRID, const URL& boshHTTPConnectProxyURL, const SafeString& boshHTTPConnectProxyAuthID, const SafeString& boshHTTPConnectProxyAuthPassword, const TLSOptions& tlsOptions, boost::shared_ptr trafficFilter) : +BOSHConnectionPool::BOSHConnectionPool(const URL& boshURL, DomainNameResolver* realResolver, ConnectionFactory* connectionFactoryParameter, XMLParserFactory* parserFactory, TLSContextFactory* tlsFactory, TimerFactory* timerFactory, EventLoop* eventLoop, const std::string& to, unsigned long long initialRID, const URL& boshHTTPConnectProxyURL, const SafeString& boshHTTPConnectProxyAuthID, const SafeString& boshHTTPConnectProxyAuthPassword, const TLSOptions& tlsOptions, std::shared_ptr trafficFilter) : boshURL(boshURL), connectionFactory(connectionFactoryParameter), xmlParserFactory(parserFactory), @@ -96,7 +96,7 @@ std::vector BOSHConnectionPool::getPeerCertificateChain() cons return pinnedCertificateChain_; } -boost::shared_ptr BOSHConnectionPool::getPeerCertificateVerificationError() const { +std::shared_ptr BOSHConnectionPool::getPeerCertificateVerificationError() const { return lastVerificationError_; } @@ -132,7 +132,7 @@ void BOSHConnectionPool::handleSessionStarted(const std::string& sessionID, size void BOSHConnectionPool::handleConnectFinished(bool error, BOSHConnection::ref connection) { if (error) { - onSessionTerminated(boost::make_shared(BOSHError::UndefinedCondition)); + onSessionTerminated(std::make_shared(BOSHError::UndefinedCondition)); /*TODO: We can probably manage to not terminate the stream here and use the rid/ack retry * logic to just swallow the error and try again (some number of tries). */ @@ -235,7 +235,7 @@ void BOSHConnectionPool::tryToSendQueuedData() { } void BOSHConnectionPool::handleHTTPError(const std::string& /*errorCode*/) { - handleSessionTerminated(boost::make_shared(BOSHError::UndefinedCondition)); + handleSessionTerminated(std::make_shared(BOSHError::UndefinedCondition)); } void BOSHConnectionPool::handleConnectionDisconnected(bool/* error*/, BOSHConnection::ref connection) { @@ -244,7 +244,7 @@ void BOSHConnectionPool::handleConnectionDisconnected(bool/* error*/, BOSHConnec handleSessionTerminated(BOSHError::ref()); } //else if (error) { - // handleSessionTerminated(boost::make_shared(BOSHError::UndefinedCondition)); + // handleSessionTerminated(std::make_shared(BOSHError::UndefinedCondition)); //} else { /* We might have just freed up a connection slot to send with */ @@ -252,7 +252,7 @@ void BOSHConnectionPool::handleConnectionDisconnected(bool/* error*/, BOSHConnec } } -boost::shared_ptr BOSHConnectionPool::createConnection() { +std::shared_ptr BOSHConnectionPool::createConnection() { Connector::ref connector = Connector::create(boshURL.getHost(), URL::getPortOrDefaultPort(boshURL), boost::optional(), resolver, connectionFactory, timerFactory); BOSHConnection::ref connection = BOSHConnection::create(boshURL, connector, xmlParserFactory, tlsContextFactory_, tlsOptions_); connection->onXMPPDataRead.connect(boost::bind(&BOSHConnectionPool::handleDataRead, this, _1)); @@ -274,7 +274,7 @@ boost::shared_ptr BOSHConnectionPool::createConnection() { return connection; } -void BOSHConnectionPool::destroyConnection(boost::shared_ptr connection) { +void BOSHConnectionPool::destroyConnection(std::shared_ptr connection) { connections.erase(std::remove(connections.begin(), connections.end(), connection), connections.end()); connection->onXMPPDataRead.disconnect(boost::bind(&BOSHConnectionPool::handleDataRead, this, _1)); connection->onSessionStarted.disconnect(boost::bind(&BOSHConnectionPool::handleSessionStarted, this, _1, _2)); diff --git a/Swiften/Network/BOSHConnectionPool.h b/Swiften/Network/BOSHConnectionPool.h index 5088be6..b288505 100644 --- a/Swiften/Network/BOSHConnectionPool.h +++ b/Swiften/Network/BOSHConnectionPool.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -26,7 +26,7 @@ namespace Swift { class SWIFTEN_API BOSHConnectionPool : public boost::bsignals::trackable { public: - BOSHConnectionPool(const URL& boshURL, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, XMLParserFactory* parserFactory, TLSContextFactory* tlsFactory, TimerFactory* timerFactory, EventLoop* eventLoop, const std::string& to, unsigned long long initialRID, const URL& boshHTTPConnectProxyURL, const SafeString& boshHTTPConnectProxyAuthID, const SafeString& boshHTTPConnectProxyAuthPassword, const TLSOptions& tlsOptions, boost::shared_ptr trafficFilter = boost::shared_ptr()); + BOSHConnectionPool(const URL& boshURL, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, XMLParserFactory* parserFactory, TLSContextFactory* tlsFactory, TimerFactory* timerFactory, EventLoop* eventLoop, const std::string& to, unsigned long long initialRID, const URL& boshHTTPConnectProxyURL, const SafeString& boshHTTPConnectProxyAuthID, const SafeString& boshHTTPConnectProxyAuthPassword, const TLSOptions& tlsOptions, std::shared_ptr trafficFilter = std::shared_ptr()); ~BOSHConnectionPool(); void open(); @@ -39,7 +39,7 @@ namespace Swift { bool isTLSEncrypted() const; Certificate::ref getPeerCertificate() const; std::vector getPeerCertificateChain() const; - boost::shared_ptr getPeerCertificateVerificationError() const; + std::shared_ptr getPeerCertificateVerificationError() const; boost::signal onSessionTerminated; boost::signal onSessionStarted; @@ -82,7 +82,7 @@ namespace Swift { CertificateWithKey::ref clientCertificate; TLSContextFactory* tlsContextFactory_; TLSOptions tlsOptions_; - std::vector > pinnedCertificateChain_; - boost::shared_ptr lastVerificationError_; + std::vector > pinnedCertificateChain_; + std::shared_ptr lastVerificationError_; }; } diff --git a/Swiften/Network/BoostConnection.cpp b/Swiften/Network/BoostConnection.cpp index 80cb6b8..a987790 100644 --- a/Swiften/Network/BoostConnection.cpp +++ b/Swiften/Network/BoostConnection.cpp @@ -7,13 +7,13 @@ #include #include +#include #include #include #include #include #include -#include #include #include @@ -45,13 +45,13 @@ class SharedBuffer { const boost::asio::const_buffer* end() const { return &buffer_ + 1; } private: - boost::shared_ptr< std::vector > > data_; + std::shared_ptr< std::vector > > data_; boost::asio::const_buffer buffer_; }; // ----------------------------------------------------------------------------- -BoostConnection::BoostConnection(boost::shared_ptr ioService, EventLoop* eventLoop) : +BoostConnection::BoostConnection(std::shared_ptr ioService, EventLoop* eventLoop) : eventLoop(eventLoop), ioService(ioService), socket_(*ioService), writing_(false), closeSocketAfterNextWrite_(false) { } @@ -119,7 +119,7 @@ void BoostConnection::handleConnectFinished(const boost::system::error_code& err } void BoostConnection::doRead() { - readBuffer_ = boost::make_shared(BUFFER_SIZE); + readBuffer_ = std::make_shared(BUFFER_SIZE); boost::lock_guard lock(readCloseMutex_); socket_.async_read_some( boost::asio::buffer(*readBuffer_), diff --git a/Swiften/Network/BoostConnection.h b/Swiften/Network/BoostConnection.h index 9909455..82208a1 100644 --- a/Swiften/Network/BoostConnection.h +++ b/Swiften/Network/BoostConnection.h @@ -6,9 +6,10 @@ #pragma once +#include + #include #include -#include #include #include @@ -29,13 +30,13 @@ namespace boost { namespace Swift { class EventLoop; - class SWIFTEN_API BoostConnection : public Connection, public EventOwner, public boost::enable_shared_from_this { + class SWIFTEN_API BoostConnection : public Connection, public EventOwner, public std::enable_shared_from_this { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; virtual ~BoostConnection(); - static ref create(boost::shared_ptr ioService, EventLoop* eventLoop) { + static ref create(std::shared_ptr ioService, EventLoop* eventLoop) { return ref(new BoostConnection(ioService, eventLoop)); } @@ -55,10 +56,10 @@ namespace Swift { Certificate::ref getPeerCertificate() const; std::vector getPeerCertificateChain() const; - boost::shared_ptr getPeerCertificateVerificationError() const; + std::shared_ptr getPeerCertificateVerificationError() const; private: - BoostConnection(boost::shared_ptr ioService, EventLoop* eventLoop); + BoostConnection(std::shared_ptr ioService, EventLoop* eventLoop); void handleConnectFinished(const boost::system::error_code& error); void handleSocketRead(const boost::system::error_code& error, size_t bytesTransferred); @@ -69,9 +70,9 @@ namespace Swift { private: EventLoop* eventLoop; - boost::shared_ptr ioService; + std::shared_ptr ioService; boost::asio::ip::tcp::socket socket_; - boost::shared_ptr readBuffer_; + std::shared_ptr readBuffer_; boost::mutex writeMutex_; bool writing_; SafeByteArray writeQueue_; diff --git a/Swiften/Network/BoostConnectionFactory.cpp b/Swiften/Network/BoostConnectionFactory.cpp index d22f600..9ec30f5 100644 --- a/Swiften/Network/BoostConnectionFactory.cpp +++ b/Swiften/Network/BoostConnectionFactory.cpp @@ -10,10 +10,10 @@ namespace Swift { -BoostConnectionFactory::BoostConnectionFactory(boost::shared_ptr ioService, EventLoop* eventLoop) : ioService(ioService), eventLoop(eventLoop) { +BoostConnectionFactory::BoostConnectionFactory(std::shared_ptr ioService, EventLoop* eventLoop) : ioService(ioService), eventLoop(eventLoop) { } -boost::shared_ptr BoostConnectionFactory::createConnection() { +std::shared_ptr BoostConnectionFactory::createConnection() { return BoostConnection::create(ioService, eventLoop); } diff --git a/Swiften/Network/BoostConnectionFactory.h b/Swiften/Network/BoostConnectionFactory.h index 46502de..a4e3b0d 100644 --- a/Swiften/Network/BoostConnectionFactory.h +++ b/Swiften/Network/BoostConnectionFactory.h @@ -17,12 +17,12 @@ namespace Swift { class SWIFTEN_API BoostConnectionFactory : public ConnectionFactory { public: - BoostConnectionFactory(boost::shared_ptr, EventLoop* eventLoop); + BoostConnectionFactory(std::shared_ptr, EventLoop* eventLoop); - virtual boost::shared_ptr createConnection(); + virtual std::shared_ptr createConnection(); private: - boost::shared_ptr ioService; + std::shared_ptr ioService; EventLoop* eventLoop; }; } diff --git a/Swiften/Network/BoostConnectionServer.cpp b/Swiften/Network/BoostConnectionServer.cpp index 99fe9b6..34b5799 100644 --- a/Swiften/Network/BoostConnectionServer.cpp +++ b/Swiften/Network/BoostConnectionServer.cpp @@ -19,10 +19,10 @@ namespace Swift { -BoostConnectionServer::BoostConnectionServer(int port, boost::shared_ptr ioService, EventLoop* eventLoop) : port_(port), ioService_(ioService), eventLoop(eventLoop), acceptor_(nullptr) { +BoostConnectionServer::BoostConnectionServer(int port, std::shared_ptr ioService, EventLoop* eventLoop) : port_(port), ioService_(ioService), eventLoop(eventLoop), acceptor_(nullptr) { } -BoostConnectionServer::BoostConnectionServer(const HostAddress &address, int port, boost::shared_ptr ioService, EventLoop* eventLoop) : address_(address), port_(port), ioService_(ioService), eventLoop(eventLoop), acceptor_(nullptr) { +BoostConnectionServer::BoostConnectionServer(const HostAddress &address, int port, std::shared_ptr ioService, EventLoop* eventLoop) : address_(address), port_(port), ioService_(ioService), eventLoop(eventLoop), acceptor_(nullptr) { } void BoostConnectionServer::start() { @@ -81,7 +81,7 @@ void BoostConnectionServer::acceptNextConnection() { boost::bind(&BoostConnectionServer::handleAccept, shared_from_this(), newConnection, boost::asio::placeholders::error)); } -void BoostConnectionServer::handleAccept(boost::shared_ptr newConnection, const boost::system::error_code& error) { +void BoostConnectionServer::handleAccept(std::shared_ptr newConnection, const boost::system::error_code& error) { if (error) { eventLoop->postEvent( boost::bind( diff --git a/Swiften/Network/BoostConnectionServer.h b/Swiften/Network/BoostConnectionServer.h index 8ee2a6d..b8a1c64 100644 --- a/Swiften/Network/BoostConnectionServer.h +++ b/Swiften/Network/BoostConnectionServer.h @@ -6,11 +6,11 @@ #pragma once +#include + #include #include -#include #include -#include #include #include @@ -19,15 +19,15 @@ #include namespace Swift { - class SWIFTEN_API BoostConnectionServer : public ConnectionServer, public EventOwner, public boost::enable_shared_from_this { + class SWIFTEN_API BoostConnectionServer : public ConnectionServer, public EventOwner, public std::enable_shared_from_this { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; - static ref create(int port, boost::shared_ptr ioService, EventLoop* eventLoop) { + static ref create(int port, std::shared_ptr ioService, EventLoop* eventLoop) { return ref(new BoostConnectionServer(port, ioService, eventLoop)); } - static ref create(const HostAddress &address, int port, boost::shared_ptr ioService, EventLoop* eventLoop) { + static ref create(const HostAddress &address, int port, std::shared_ptr ioService, EventLoop* eventLoop) { return ref(new BoostConnectionServer(address, port, ioService, eventLoop)); } @@ -40,17 +40,17 @@ namespace Swift { boost::signal)> onStopped; private: - BoostConnectionServer(int port, boost::shared_ptr ioService, EventLoop* eventLoop); - BoostConnectionServer(const HostAddress &address, int port, boost::shared_ptr ioService, EventLoop* eventLoop); + BoostConnectionServer(int port, std::shared_ptr ioService, EventLoop* eventLoop); + BoostConnectionServer(const HostAddress &address, int port, std::shared_ptr ioService, EventLoop* eventLoop); void stop(boost::optional e); void acceptNextConnection(); - void handleAccept(boost::shared_ptr newConnection, const boost::system::error_code& error); + void handleAccept(std::shared_ptr newConnection, const boost::system::error_code& error); private: HostAddress address_; int port_; - boost::shared_ptr ioService_; + std::shared_ptr ioService_; EventLoop* eventLoop; boost::asio::ip::tcp::acceptor* acceptor_; }; diff --git a/Swiften/Network/BoostConnectionServerFactory.cpp b/Swiften/Network/BoostConnectionServerFactory.cpp index 25afdb6..8b3fd2f 100644 --- a/Swiften/Network/BoostConnectionServerFactory.cpp +++ b/Swiften/Network/BoostConnectionServerFactory.cpp @@ -16,14 +16,14 @@ namespace Swift { -BoostConnectionServerFactory::BoostConnectionServerFactory(boost::shared_ptr ioService, EventLoop* eventLoop) : ioService(ioService), eventLoop(eventLoop) { +BoostConnectionServerFactory::BoostConnectionServerFactory(std::shared_ptr ioService, EventLoop* eventLoop) : ioService(ioService), eventLoop(eventLoop) { } -boost::shared_ptr BoostConnectionServerFactory::createConnectionServer(int port) { +std::shared_ptr BoostConnectionServerFactory::createConnectionServer(int port) { return BoostConnectionServer::create(port, ioService, eventLoop); } -boost::shared_ptr BoostConnectionServerFactory::createConnectionServer(const Swift::HostAddress &hostAddress, int port) { +std::shared_ptr BoostConnectionServerFactory::createConnectionServer(const Swift::HostAddress &hostAddress, int port) { return BoostConnectionServer::create(hostAddress, port, ioService, eventLoop); } diff --git a/Swiften/Network/BoostConnectionServerFactory.h b/Swiften/Network/BoostConnectionServerFactory.h index 1e0daa3..033e63d 100644 --- a/Swiften/Network/BoostConnectionServerFactory.h +++ b/Swiften/Network/BoostConnectionServerFactory.h @@ -23,14 +23,14 @@ namespace Swift { class SWIFTEN_API BoostConnectionServerFactory : public ConnectionServerFactory { public: - BoostConnectionServerFactory(boost::shared_ptr, EventLoop* eventLoop); + BoostConnectionServerFactory(std::shared_ptr, EventLoop* eventLoop); - virtual boost::shared_ptr createConnectionServer(int port); + virtual std::shared_ptr createConnectionServer(int port); - virtual boost::shared_ptr createConnectionServer(const Swift::HostAddress &hostAddress, int port); + virtual std::shared_ptr createConnectionServer(const Swift::HostAddress &hostAddress, int port); private: - boost::shared_ptr ioService; + std::shared_ptr ioService; EventLoop* eventLoop; }; } diff --git a/Swiften/Network/BoostIOServiceThread.cpp b/Swiften/Network/BoostIOServiceThread.cpp index 79112d8..0b0b7a4 100644 --- a/Swiften/Network/BoostIOServiceThread.cpp +++ b/Swiften/Network/BoostIOServiceThread.cpp @@ -6,17 +6,17 @@ #include -#include +#include namespace Swift { -BoostIOServiceThread::BoostIOServiceThread(boost::shared_ptr ioService) { +BoostIOServiceThread::BoostIOServiceThread(std::shared_ptr ioService) { if (!!ioService) { ioService_ = ioService; thread_ = nullptr; } else { - ioService_ = boost::make_shared(); + ioService_ = std::make_shared(); thread_ = new boost::thread(boost::bind(&BoostIOServiceThread::doRun, this)); } } diff --git a/Swiften/Network/BoostIOServiceThread.h b/Swiften/Network/BoostIOServiceThread.h index 54f1840..18d5a5b 100644 --- a/Swiften/Network/BoostIOServiceThread.h +++ b/Swiften/Network/BoostIOServiceThread.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include #include @@ -23,10 +24,10 @@ namespace Swift { * you are re-using an io_service from elsewhere (particularly if you * are using the BoostASIOEventLoop). */ - BoostIOServiceThread(boost::shared_ptr ioService = boost::shared_ptr()); + BoostIOServiceThread(std::shared_ptr ioService = std::shared_ptr()); ~BoostIOServiceThread(); - boost::shared_ptr getIOService() const { + std::shared_ptr getIOService() const { return ioService_; } @@ -34,7 +35,7 @@ namespace Swift { void doRun(); private: - boost::shared_ptr ioService_; + std::shared_ptr ioService_; boost::thread* thread_; }; } diff --git a/Swiften/Network/BoostNetworkFactories.cpp b/Swiften/Network/BoostNetworkFactories.cpp index 40282f2..9fef73c 100644 --- a/Swiften/Network/BoostNetworkFactories.cpp +++ b/Swiften/Network/BoostNetworkFactories.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -28,7 +28,7 @@ namespace Swift { -BoostNetworkFactories::BoostNetworkFactories(EventLoop* eventLoop, boost::shared_ptr ioService) : ioServiceThread(ioService), eventLoop(eventLoop) { +BoostNetworkFactories::BoostNetworkFactories(EventLoop* eventLoop, std::shared_ptr ioService) : ioServiceThread(ioService), eventLoop(eventLoop) { timerFactory = new BoostTimerFactory(ioServiceThread.getIOService(), eventLoop); connectionFactory = new BoostConnectionFactory(ioServiceThread.getIOService(), eventLoop); connectionServerFactory = new BoostConnectionServerFactory(ioServiceThread.getIOService(), eventLoop); diff --git a/Swiften/Network/BoostNetworkFactories.h b/Swiften/Network/BoostNetworkFactories.h index ccacbf0..72afb04 100644 --- a/Swiften/Network/BoostNetworkFactories.h +++ b/Swiften/Network/BoostNetworkFactories.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -23,7 +23,7 @@ namespace Swift { * @param ioService If this optional parameter is provided, it will be * used for the construction of the BoostIOServiceThread. */ - BoostNetworkFactories(EventLoop* eventLoop, boost::shared_ptr ioService = boost::shared_ptr()); + BoostNetworkFactories(EventLoop* eventLoop, std::shared_ptr ioService = std::shared_ptr()); virtual ~BoostNetworkFactories(); virtual TimerFactory* getTimerFactory() const SWIFTEN_OVERRIDE { diff --git a/Swiften/Network/BoostTimer.cpp b/Swiften/Network/BoostTimer.cpp index 734a9c8..846192c 100644 --- a/Swiften/Network/BoostTimer.cpp +++ b/Swiften/Network/BoostTimer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -14,7 +14,7 @@ namespace Swift { -BoostTimer::BoostTimer(int milliseconds, boost::shared_ptr service, EventLoop* eventLoop) : +BoostTimer::BoostTimer(int milliseconds, std::shared_ptr service, EventLoop* eventLoop) : timeout(milliseconds), ioService(service), eventLoop(eventLoop), shuttingDown(false) { timer.reset(new boost::asio::deadline_timer(*service)); } diff --git a/Swiften/Network/BoostTimer.h b/Swiften/Network/BoostTimer.h index 79c71cd..c54b401 100644 --- a/Swiften/Network/BoostTimer.h +++ b/Swiften/Network/BoostTimer.h @@ -1,14 +1,15 @@ /* - * 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 + #include #include -#include #include #include @@ -19,13 +20,13 @@ namespace Swift { class EventLoop; - class SWIFTEN_API BoostTimer : public Timer, public EventOwner, public boost::enable_shared_from_this { + class SWIFTEN_API BoostTimer : public Timer, public EventOwner, public std::enable_shared_from_this { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; virtual ~BoostTimer(); - static ref create(int milliseconds, boost::shared_ptr service, EventLoop* eventLoop) { + static ref create(int milliseconds, std::shared_ptr service, EventLoop* eventLoop) { return ref(new BoostTimer(milliseconds, service, eventLoop)); } @@ -33,13 +34,13 @@ namespace Swift { virtual void stop(); private: - BoostTimer(int milliseconds, boost::shared_ptr service, EventLoop* eventLoop); + BoostTimer(int milliseconds, std::shared_ptr service, EventLoop* eventLoop); void handleTimerTick(const boost::system::error_code& error); private: int timeout; - boost::shared_ptr ioService; + std::shared_ptr ioService; boost::scoped_ptr timer; boost::mutex timerMutex; EventLoop* eventLoop; diff --git a/Swiften/Network/BoostTimerFactory.cpp b/Swiften/Network/BoostTimerFactory.cpp index 086eb60..ffa9b30 100644 --- a/Swiften/Network/BoostTimerFactory.cpp +++ b/Swiften/Network/BoostTimerFactory.cpp @@ -10,10 +10,10 @@ namespace Swift { -BoostTimerFactory::BoostTimerFactory(boost::shared_ptr ioService, EventLoop* eventLoop) : ioService(ioService), eventLoop(eventLoop) { +BoostTimerFactory::BoostTimerFactory(std::shared_ptr ioService, EventLoop* eventLoop) : ioService(ioService), eventLoop(eventLoop) { } -boost::shared_ptr BoostTimerFactory::createTimer(int milliseconds) { +std::shared_ptr BoostTimerFactory::createTimer(int milliseconds) { return BoostTimer::create(milliseconds, ioService, eventLoop); } diff --git a/Swiften/Network/BoostTimerFactory.h b/Swiften/Network/BoostTimerFactory.h index 4fbabe9..ca9a833 100644 --- a/Swiften/Network/BoostTimerFactory.h +++ b/Swiften/Network/BoostTimerFactory.h @@ -18,12 +18,12 @@ namespace Swift { class SWIFTEN_API BoostTimerFactory : public TimerFactory { public: - BoostTimerFactory(boost::shared_ptr, EventLoop* eventLoop); + BoostTimerFactory(std::shared_ptr, EventLoop* eventLoop); - virtual boost::shared_ptr createTimer(int milliseconds); + virtual std::shared_ptr createTimer(int milliseconds); private: - boost::shared_ptr ioService; + std::shared_ptr ioService; EventLoop* eventLoop; }; } diff --git a/Swiften/Network/CachingDomainNameResolver.cpp b/Swiften/Network/CachingDomainNameResolver.cpp index d731eb9..8846e09 100644 --- a/Swiften/Network/CachingDomainNameResolver.cpp +++ b/Swiften/Network/CachingDomainNameResolver.cpp @@ -1,12 +1,12 @@ /* - * Copyright (c) 2012 Isode Limited. + * Copyright (c) 2012-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include +#include namespace Swift { diff --git a/Swiften/Network/CachingDomainNameResolver.h b/Swiften/Network/CachingDomainNameResolver.h index 25cb86c..9339a77 100644 --- a/Swiften/Network/CachingDomainNameResolver.h +++ b/Swiften/Network/CachingDomainNameResolver.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2012-2015 Isode Limited. + * Copyright (c) 2012-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include diff --git a/Swiften/Network/ChainedConnector.cpp b/Swiften/Network/ChainedConnector.cpp index 08c4aac..fbea868 100644 --- a/Swiften/Network/ChainedConnector.cpp +++ b/Swiften/Network/ChainedConnector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -58,14 +58,14 @@ void ChainedConnector::stop() { currentConnector->stop(); currentConnector.reset(); } - finish(boost::shared_ptr(), boost::shared_ptr()); + finish(std::shared_ptr(), std::shared_ptr()); } void ChainedConnector::tryNextConnectionFactory() { assert(!currentConnector); if (connectionFactoryQueue.empty()) { SWIFT_LOG(debug) << "No more connection factories" << std::endl; - finish(boost::shared_ptr(), lastError); + finish(std::shared_ptr(), lastError); } else { ConnectionFactory* connectionFactory = connectionFactoryQueue.front(); @@ -78,7 +78,7 @@ void ChainedConnector::tryNextConnectionFactory() { } } -void ChainedConnector::handleConnectorFinished(boost::shared_ptr connection, boost::shared_ptr error) { +void ChainedConnector::handleConnectorFinished(std::shared_ptr connection, std::shared_ptr error) { SWIFT_LOG(debug) << "Connector finished" << std::endl; currentConnector->onConnectFinished.disconnect(boost::bind(&ChainedConnector::handleConnectorFinished, this, _1, _2)); lastError = error; @@ -91,6 +91,6 @@ void ChainedConnector::handleConnectorFinished(boost::shared_ptr con } } -void ChainedConnector::finish(boost::shared_ptr connection, boost::shared_ptr error) { +void ChainedConnector::finish(std::shared_ptr connection, std::shared_ptr error) { onConnectFinished(connection, error); } diff --git a/Swiften/Network/ChainedConnector.h b/Swiften/Network/ChainedConnector.h index 416dccb..bba9bfa 100644 --- a/Swiften/Network/ChainedConnector.h +++ b/Swiften/Network/ChainedConnector.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -7,11 +7,11 @@ #pragma once #include +#include #include #include #include -#include #include #include @@ -33,12 +33,12 @@ namespace Swift { void start(); void stop(); - boost::signal, boost::shared_ptr)> onConnectFinished; + boost::signal, std::shared_ptr)> onConnectFinished; private: - void finish(boost::shared_ptr connection, boost::shared_ptr); + void finish(std::shared_ptr connection, std::shared_ptr); void tryNextConnectionFactory(); - void handleConnectorFinished(boost::shared_ptr, boost::shared_ptr); + void handleConnectorFinished(std::shared_ptr, std::shared_ptr); private: std::string hostname; @@ -49,7 +49,7 @@ namespace Swift { TimerFactory* timerFactory; int timeoutMilliseconds; std::deque connectionFactoryQueue; - boost::shared_ptr currentConnector; - boost::shared_ptr lastError; + std::shared_ptr currentConnector; + std::shared_ptr lastError; }; } diff --git a/Swiften/Network/Connection.h b/Swiften/Network/Connection.h index c38b98f..1ef5824 100644 --- a/Swiften/Network/Connection.h +++ b/Swiften/Network/Connection.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 +#include #include #include @@ -17,7 +17,7 @@ namespace Swift { class SWIFTEN_API Connection { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum Error { ReadError, @@ -38,7 +38,7 @@ namespace Swift { public: boost::signal onConnectFinished; boost::signal&)> onDisconnected; - boost::signal)> onDataRead; + boost::signal)> onDataRead; boost::signal onDataWritten; }; } diff --git a/Swiften/Network/ConnectionFactory.h b/Swiften/Network/ConnectionFactory.h index fd65908..e749fa3 100644 --- a/Swiften/Network/ConnectionFactory.h +++ b/Swiften/Network/ConnectionFactory.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include @@ -17,6 +17,6 @@ namespace Swift { public: virtual ~ConnectionFactory(); - virtual boost::shared_ptr createConnection() = 0; + virtual std::shared_ptr createConnection() = 0; }; } diff --git a/Swiften/Network/ConnectionServer.h b/Swiften/Network/ConnectionServer.h index a8c77eb..ae510e5 100644 --- a/Swiften/Network/ConnectionServer.h +++ b/Swiften/Network/ConnectionServer.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include #include @@ -32,6 +33,6 @@ namespace Swift { virtual void stop() = 0; - boost::signal)> onNewConnection; + boost::signal)> onNewConnection; }; } diff --git a/Swiften/Network/ConnectionServerFactory.h b/Swiften/Network/ConnectionServerFactory.h index 7f988bf..413131e 100644 --- a/Swiften/Network/ConnectionServerFactory.h +++ b/Swiften/Network/ConnectionServerFactory.h @@ -12,7 +12,7 @@ #pragma once -#include +#include #include @@ -24,8 +24,8 @@ namespace Swift { public: virtual ~ConnectionServerFactory(); - virtual boost::shared_ptr createConnectionServer(int port) = 0; + virtual std::shared_ptr createConnectionServer(int port) = 0; - virtual boost::shared_ptr createConnectionServer(const Swift::HostAddress& hostAddress, int port) = 0; + virtual std::shared_ptr createConnectionServer(const Swift::HostAddress& hostAddress, int port) = 0; }; } diff --git a/Swiften/Network/Connector.cpp b/Swiften/Network/Connector.cpp index bd25e70..37cf35d 100644 --- a/Swiften/Network/Connector.cpp +++ b/Swiften/Network/Connector.cpp @@ -54,7 +54,7 @@ void Connector::stop() { currentConnection->onConnectFinished.disconnect(boost::bind(&Connector::handleConnectionConnectFinished, shared_from_this(), _1)); currentConnection->disconnect(); } - finish(boost::shared_ptr()); + finish(std::shared_ptr()); } void Connector::queryAddress(const std::string& hostname) { @@ -77,7 +77,7 @@ void Connector::handleServiceQueryResult(const std::vector()); + finish(std::shared_ptr()); } else if (serviceQueryResults.empty()) { SWIFT_LOG(debug) << "Falling back on A resolution" << std::endl; @@ -165,7 +165,7 @@ void Connector::handleConnectionConnectFinished(bool error) { } } -void Connector::finish(boost::shared_ptr connection) { +void Connector::finish(std::shared_ptr connection) { if (timer) { timer->stop(); timer->onTick.disconnect(boost::bind(&Connector::handleTimeout, shared_from_this())); @@ -183,7 +183,7 @@ void Connector::finish(boost::shared_ptr connection) { currentConnection->onConnectFinished.disconnect(boost::bind(&Connector::handleConnectionConnectFinished, shared_from_this(), _1)); currentConnection.reset(); } - onConnectFinished(connection, (connection || foundSomeDNS) ? boost::shared_ptr() : boost::make_shared()); + onConnectFinished(connection, (connection || foundSomeDNS) ? std::shared_ptr() : std::make_shared()); } void Connector::handleTimeout() { diff --git a/Swiften/Network/Connector.h b/Swiften/Network/Connector.h index 52486b6..8114dd1 100644 --- a/Swiften/Network/Connector.h +++ b/Swiften/Network/Connector.h @@ -7,10 +7,10 @@ #pragma once #include +#include #include #include -#include #include #include @@ -26,9 +26,9 @@ namespace Swift { class ConnectionFactory; class TimerFactory; - class SWIFTEN_API Connector : public boost::bsignals::trackable, public boost::enable_shared_from_this { + class SWIFTEN_API Connector : public boost::bsignals::trackable, public std::enable_shared_from_this { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static Connector::ref create(const std::string& hostname, int port, const boost::optional& serviceLookupPrefix, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) { return ref(new Connector(hostname, port, serviceLookupPrefix, resolver, connectionFactory, timerFactory)); @@ -43,7 +43,7 @@ namespace Swift { void start(); void stop(); - boost::signal, boost::shared_ptr)> onConnectFinished; + boost::signal, std::shared_ptr)> onConnectFinished; private: Connector(const std::string& hostname, int port, const boost::optional& serviceLookupPrefix, DomainNameResolver*, ConnectionFactory*, TimerFactory*); @@ -57,7 +57,7 @@ namespace Swift { void tryConnect(const HostAddressPort& target); void handleConnectionConnectFinished(bool error); - void finish(boost::shared_ptr); + void finish(std::shared_ptr); void handleTimeout(); @@ -69,13 +69,13 @@ namespace Swift { ConnectionFactory* connectionFactory; TimerFactory* timerFactory; int timeoutMilliseconds; - boost::shared_ptr timer; - boost::shared_ptr serviceQuery; + std::shared_ptr timer; + std::shared_ptr serviceQuery; std::deque serviceQueryResults; - boost::shared_ptr addressQuery; + std::shared_ptr addressQuery; std::deque addressQueryResults; bool queriedAllServices; - boost::shared_ptr currentConnection; + std::shared_ptr currentConnection; bool foundSomeDNS; }; } diff --git a/Swiften/Network/DomainNameAddressQuery.h b/Swiften/Network/DomainNameAddressQuery.h index 10bcd5a..f6650c6 100644 --- a/Swiften/Network/DomainNameAddressQuery.h +++ b/Swiften/Network/DomainNameAddressQuery.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include #include @@ -16,7 +17,7 @@ namespace Swift { class DomainNameAddressQuery { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; virtual ~DomainNameAddressQuery(); diff --git a/Swiften/Network/DomainNameResolver.h b/Swiften/Network/DomainNameResolver.h index 97997c9..5fe30d5 100644 --- a/Swiften/Network/DomainNameResolver.h +++ b/Swiften/Network/DomainNameResolver.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include namespace Swift { @@ -21,7 +20,7 @@ namespace Swift { public: virtual ~DomainNameResolver(); - virtual boost::shared_ptr createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) = 0; - virtual boost::shared_ptr createAddressQuery(const std::string& name) = 0; + virtual std::shared_ptr createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) = 0; + virtual std::shared_ptr createAddressQuery(const std::string& name) = 0; }; } diff --git a/Swiften/Network/DomainNameServiceQuery.h b/Swiften/Network/DomainNameServiceQuery.h index acbccf0..b8e0e7c 100644 --- a/Swiften/Network/DomainNameServiceQuery.h +++ b/Swiften/Network/DomainNameServiceQuery.h @@ -6,11 +6,11 @@ #pragma once +#include #include #include #include -#include #include #include @@ -21,7 +21,7 @@ namespace Swift { class SWIFTEN_API DomainNameServiceQuery { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; struct Result { Result(const std::string& hostname = "", int port = -1, int priority = -1, int weight = -1) : hostname(hostname), port(port), priority(priority), weight(weight) {} diff --git a/Swiften/Network/DummyConnection.cpp b/Swiften/Network/DummyConnection.cpp index a4e5419..3024b21 100644 --- a/Swiften/Network/DummyConnection.cpp +++ b/Swiften/Network/DummyConnection.cpp @@ -7,9 +7,9 @@ #include #include +#include #include -#include namespace Swift { @@ -17,7 +17,7 @@ DummyConnection::DummyConnection(EventLoop* eventLoop) : eventLoop(eventLoop) { } void DummyConnection::receive(const SafeByteArray& data) { - eventLoop->postEvent(boost::bind(boost::ref(onDataRead), boost::make_shared(data)), shared_from_this()); + eventLoop->postEvent(boost::bind(boost::ref(onDataRead), std::make_shared(data)), shared_from_this()); } void DummyConnection::listen() { diff --git a/Swiften/Network/DummyConnection.h b/Swiften/Network/DummyConnection.h index fcfdb15..f7b9e29 100644 --- a/Swiften/Network/DummyConnection.h +++ b/Swiften/Network/DummyConnection.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 +#include #include #include @@ -15,7 +15,7 @@ #include namespace Swift { - class SWIFTEN_API DummyConnection : public Connection, public EventOwner, public boost::enable_shared_from_this { + class SWIFTEN_API DummyConnection : public Connection, public EventOwner, public std::enable_shared_from_this { public: DummyConnection(EventLoop* eventLoop); diff --git a/Swiften/Network/DummyConnectionFactory.h b/Swiften/Network/DummyConnectionFactory.h index f861312..d723283 100644 --- a/Swiften/Network/DummyConnectionFactory.h +++ b/Swiften/Network/DummyConnectionFactory.h @@ -4,9 +4,15 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once -#include +#include #include #include @@ -19,8 +25,8 @@ class DummyConnectionFactory : public ConnectionFactory { public: DummyConnectionFactory(EventLoop *eventLoop) : eventLoop(eventLoop) {} virtual ~DummyConnectionFactory() {} - virtual boost::shared_ptr createConnection() { - return boost::make_shared(eventLoop); + virtual std::shared_ptr createConnection() { + return std::make_shared(eventLoop); } private: EventLoop* eventLoop; diff --git a/Swiften/Network/DummyConnectionServer.h b/Swiften/Network/DummyConnectionServer.h index 0bf7386..970cbb7 100644 --- a/Swiften/Network/DummyConnectionServer.h +++ b/Swiften/Network/DummyConnectionServer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -15,7 +15,7 @@ #include namespace Swift { - class SWIFTEN_API DummyConnectionServer : public ConnectionServer, public EventOwner, public boost::enable_shared_from_this { + class SWIFTEN_API DummyConnectionServer : public ConnectionServer, public EventOwner, public std::enable_shared_from_this { public: DummyConnectionServer(EventLoop* /*eventLoop*/, int port) : localAddressPort(HostAddress(), port) {} DummyConnectionServer(EventLoop* /*eventLoop*/, const Swift::HostAddress& hostAddress, int port) : localAddressPort(hostAddress, port) {} diff --git a/Swiften/Network/DummyConnectionServerFactory.h b/Swiften/Network/DummyConnectionServerFactory.h index 0952a38..822f95f 100644 --- a/Swiften/Network/DummyConnectionServerFactory.h +++ b/Swiften/Network/DummyConnectionServerFactory.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -20,12 +20,12 @@ public: DummyConnectionServerFactory(EventLoop* eventLoop) : eventLoop(eventLoop) {} virtual ~DummyConnectionServerFactory() {} - virtual boost::shared_ptr createConnectionServer(int port) { - return boost::make_shared(eventLoop, port); + virtual std::shared_ptr createConnectionServer(int port) { + return std::make_shared(eventLoop, port); } - virtual boost::shared_ptr createConnectionServer(const Swift::HostAddress& hostAddress, int port) { - return boost::make_shared(eventLoop, hostAddress, port); + virtual std::shared_ptr createConnectionServer(const Swift::HostAddress& hostAddress, int port) { + return std::make_shared(eventLoop, hostAddress, port); } private: diff --git a/Swiften/Network/DummyTimerFactory.cpp b/Swiften/Network/DummyTimerFactory.cpp index cae5c84..cdc776c 100644 --- a/Swiften/Network/DummyTimerFactory.cpp +++ b/Swiften/Network/DummyTimerFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -41,15 +41,15 @@ class DummyTimerFactory::DummyTimer : public Timer { DummyTimerFactory::DummyTimerFactory() : currentTime(0) { } -boost::shared_ptr DummyTimerFactory::createTimer(int milliseconds) { - boost::shared_ptr timer(new DummyTimer(milliseconds, this)); +std::shared_ptr DummyTimerFactory::createTimer(int milliseconds) { + std::shared_ptr timer(new DummyTimer(milliseconds, this)); timers.push_back(timer); return timer; } void DummyTimerFactory::setTime(int time) { assert(time > currentTime); - foreach(boost::shared_ptr timer, timers) { + foreach(std::shared_ptr timer, timers) { if (timer->getAlarmTime() > currentTime && timer->getAlarmTime() <= time && timer->isRunning) { timer->onTick(); } diff --git a/Swiften/Network/DummyTimerFactory.h b/Swiften/Network/DummyTimerFactory.h index bb2f813..5ccbf93 100644 --- a/Swiften/Network/DummyTimerFactory.h +++ b/Swiften/Network/DummyTimerFactory.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -18,12 +18,12 @@ namespace Swift { DummyTimerFactory(); - virtual boost::shared_ptr createTimer(int milliseconds); + virtual std::shared_ptr createTimer(int milliseconds); void setTime(int time); private: friend class DummyTimer; int currentTime; - std::list > timers; + std::list > timers; }; } diff --git a/Swiften/Network/FakeConnection.h b/Swiften/Network/FakeConnection.h index c7d1f27..08c1d75 100644 --- a/Swiften/Network/FakeConnection.h +++ b/Swiften/Network/FakeConnection.h @@ -1,14 +1,14 @@ /* - * 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 #include -#include #include #include @@ -21,7 +21,7 @@ namespace Swift { class SWIFTEN_API FakeConnection : public Connection, public EventOwner, - public boost::enable_shared_from_this { + public std::enable_shared_from_this { public: enum State { Initial, diff --git a/Swiften/Network/HTTPConnectProxiedConnection.cpp b/Swiften/Network/HTTPConnectProxiedConnection.cpp index 991e815..b9ab604 100644 --- a/Swiften/Network/HTTPConnectProxiedConnection.cpp +++ b/Swiften/Network/HTTPConnectProxiedConnection.cpp @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -49,7 +49,7 @@ HTTPConnectProxiedConnection::~HTTPConnectProxiedConnection() { } -void HTTPConnectProxiedConnection::setHTTPTrafficFilter(boost::shared_ptr trafficFilter) { +void HTTPConnectProxiedConnection::setHTTPTrafficFilter(std::shared_ptr trafficFilter) { trafficFilter_ = trafficFilter; } @@ -112,7 +112,7 @@ void HTTPConnectProxiedConnection::sendHTTPRequest(const std::string& statusLine write(createSafeByteArray(request.str())); } -void HTTPConnectProxiedConnection::handleProxyInitializeData(boost::shared_ptr data) { +void HTTPConnectProxiedConnection::handleProxyInitializeData(std::shared_ptr data) { std::string dataString = byteArrayToString(ByteArray(data->begin(), data->end())); SWIFT_LOG(debug) << data << std::endl; httpResponseBuffer_.append(dataString); diff --git a/Swiften/Network/HTTPConnectProxiedConnection.h b/Swiften/Network/HTTPConnectProxiedConnection.h index adb8d08..21b3960 100644 --- a/Swiften/Network/HTTPConnectProxiedConnection.h +++ b/Swiften/Network/HTTPConnectProxiedConnection.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -13,7 +13,7 @@ #pragma once -#include +#include #include #include @@ -27,7 +27,7 @@ namespace Swift { class SWIFTEN_API HTTPConnectProxiedConnection : public ProxiedConnection { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; virtual ~HTTPConnectProxiedConnection(); @@ -35,13 +35,13 @@ namespace Swift { return ref(new HTTPConnectProxiedConnection(resolver, connectionFactory, timerFactory, proxyHost, proxyPort, authID, authPassword)); } - void setHTTPTrafficFilter(boost::shared_ptr trafficFilter); + void setHTTPTrafficFilter(std::shared_ptr trafficFilter); private: HTTPConnectProxiedConnection(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, const SafeString& authID, const SafeString& authPassword); virtual void initializeProxy(); - virtual void handleProxyInitializeData(boost::shared_ptr data); + virtual void handleProxyInitializeData(std::shared_ptr data); void sendHTTPRequest(const std::string& statusLine, const std::vector >& headerFields); void parseHTTPHeader(const std::string& data, std::string& statusLine, std::vector >& headerFields); @@ -49,7 +49,7 @@ namespace Swift { private: SafeByteArray authID_; SafeByteArray authPassword_; - boost::shared_ptr trafficFilter_; + std::shared_ptr trafficFilter_; std::string httpResponseBuffer_; std::vector > nextHTTPRequestHeaders_; }; diff --git a/Swiften/Network/HTTPConnectProxiedConnectionFactory.cpp b/Swiften/Network/HTTPConnectProxiedConnectionFactory.cpp index 735791f..91ace3d 100644 --- a/Swiften/Network/HTTPConnectProxiedConnectionFactory.cpp +++ b/Swiften/Network/HTTPConnectProxiedConnectionFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 Isode Limited. + * Copyright (c) 2012-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -16,14 +16,14 @@ namespace Swift { -HTTPConnectProxiedConnectionFactory::HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, boost::shared_ptr httpTrafficFilter) : resolver_(resolver), connectionFactory_(connectionFactory), timerFactory_(timerFactory), proxyHost_(proxyHost), proxyPort_(proxyPort), authID_(""), authPassword_(""), httpTrafficFilter_(httpTrafficFilter) { +HTTPConnectProxiedConnectionFactory::HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, std::shared_ptr httpTrafficFilter) : resolver_(resolver), connectionFactory_(connectionFactory), timerFactory_(timerFactory), proxyHost_(proxyHost), proxyPort_(proxyPort), authID_(""), authPassword_(""), httpTrafficFilter_(httpTrafficFilter) { } -HTTPConnectProxiedConnectionFactory::HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, const SafeString& authID, const SafeString& authPassword, boost::shared_ptr httpTrafficFilter) : resolver_(resolver), connectionFactory_(connectionFactory), timerFactory_(timerFactory), proxyHost_(proxyHost), proxyPort_(proxyPort), authID_(authID), authPassword_(authPassword), httpTrafficFilter_(httpTrafficFilter) { +HTTPConnectProxiedConnectionFactory::HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, const SafeString& authID, const SafeString& authPassword, std::shared_ptr httpTrafficFilter) : resolver_(resolver), connectionFactory_(connectionFactory), timerFactory_(timerFactory), proxyHost_(proxyHost), proxyPort_(proxyPort), authID_(authID), authPassword_(authPassword), httpTrafficFilter_(httpTrafficFilter) { } -boost::shared_ptr HTTPConnectProxiedConnectionFactory::createConnection() { +std::shared_ptr HTTPConnectProxiedConnectionFactory::createConnection() { HTTPConnectProxiedConnection::ref proxyConnection = HTTPConnectProxiedConnection::create(resolver_, connectionFactory_, timerFactory_, proxyHost_, proxyPort_, authID_, authPassword_); proxyConnection->setHTTPTrafficFilter(httpTrafficFilter_); return proxyConnection; diff --git a/Swiften/Network/HTTPConnectProxiedConnectionFactory.h b/Swiften/Network/HTTPConnectProxiedConnectionFactory.h index 455fba0..74d6279 100644 --- a/Swiften/Network/HTTPConnectProxiedConnectionFactory.h +++ b/Swiften/Network/HTTPConnectProxiedConnectionFactory.h @@ -25,10 +25,10 @@ namespace Swift { class SWIFTEN_API HTTPConnectProxiedConnectionFactory : public ConnectionFactory { public: - HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, boost::shared_ptr httpTrafficFilter = boost::shared_ptr()); - HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, const SafeString& authID, const SafeString& authPassword, boost::shared_ptr httpTrafficFilter = boost::shared_ptr()); + HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, std::shared_ptr httpTrafficFilter = std::shared_ptr()); + HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, const SafeString& authID, const SafeString& authPassword, std::shared_ptr httpTrafficFilter = std::shared_ptr()); - virtual boost::shared_ptr createConnection(); + virtual std::shared_ptr createConnection(); private: DomainNameResolver* resolver_; @@ -38,6 +38,6 @@ namespace Swift { int proxyPort_; SafeString authID_; SafeString authPassword_; - boost::shared_ptr httpTrafficFilter_; + std::shared_ptr httpTrafficFilter_; }; } diff --git a/Swiften/Network/MiniUPnPInterface.cpp b/Swiften/Network/MiniUPnPInterface.cpp index b298fc6..b2afd88 100644 --- a/Swiften/Network/MiniUPnPInterface.cpp +++ b/Swiften/Network/MiniUPnPInterface.cpp @@ -12,8 +12,9 @@ #include +#include + #include -#include #include #include @@ -31,7 +32,7 @@ struct MiniUPnPInterface::Private { IGDdatas data; }; -MiniUPnPInterface::MiniUPnPInterface() : p(boost::make_shared()) { +MiniUPnPInterface::MiniUPnPInterface() : p(std::make_shared()) { p->isValid = false; int error = 0; p->deviceList = upnpDiscover(1500 /* timeout in ms */, nullptr, nullptr, 0, 0 /* do IPv6? */, &error); diff --git a/Swiften/Network/MiniUPnPInterface.h b/Swiften/Network/MiniUPnPInterface.h index 5253e71..ea956d9 100644 --- a/Swiften/Network/MiniUPnPInterface.h +++ b/Swiften/Network/MiniUPnPInterface.h @@ -6,9 +6,10 @@ #pragma once +#include + #include #include -#include #include #include @@ -27,6 +28,6 @@ namespace Swift { private: struct Private; - boost::shared_ptr p; + std::shared_ptr p; }; } diff --git a/Swiften/Network/NATPMPInterface.cpp b/Swiften/Network/NATPMPInterface.cpp index 3782f75..c811212 100644 --- a/Swiften/Network/NATPMPInterface.cpp +++ b/Swiften/Network/NATPMPInterface.cpp @@ -12,8 +12,9 @@ #include +#include + #include -#include #include @@ -29,7 +30,7 @@ struct NATPMPInterface::Private { natpmp_t natpmp; }; -NATPMPInterface::NATPMPInterface() : p(boost::make_shared()) { +NATPMPInterface::NATPMPInterface() : p(std::make_shared()) { initnatpmp(&p->natpmp, 0, 0); } diff --git a/Swiften/Network/NATPMPInterface.h b/Swiften/Network/NATPMPInterface.h index a4bb816..80f619c 100644 --- a/Swiften/Network/NATPMPInterface.h +++ b/Swiften/Network/NATPMPInterface.h @@ -6,9 +6,10 @@ #pragma once +#include + #include #include -#include #include #include @@ -27,6 +28,6 @@ namespace Swift { private: struct Private; - boost::shared_ptr p; + std::shared_ptr p; }; } diff --git a/Swiften/Network/NATTraverser.h b/Swiften/Network/NATTraverser.h index 0ff6bb3..716bfcb 100644 --- a/Swiften/Network/NATTraverser.h +++ b/Swiften/Network/NATTraverser.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include @@ -19,8 +19,8 @@ namespace Swift { public: virtual ~NATTraverser(); - virtual boost::shared_ptr createGetPublicIPRequest() = 0; - virtual boost::shared_ptr createForwardPortRequest(int localPort, int publicPort) = 0; - virtual boost::shared_ptr createRemovePortForwardingRequest(int localPort, int publicPort) = 0; + virtual std::shared_ptr createGetPublicIPRequest() = 0; + virtual std::shared_ptr createForwardPortRequest(int localPort, int publicPort) = 0; + virtual std::shared_ptr createRemovePortForwardingRequest(int localPort, int publicPort) = 0; }; } diff --git a/Swiften/Network/NullNATTraverser.cpp b/Swiften/Network/NullNATTraverser.cpp index c4e121b..cc8bae0 100644 --- a/Swiften/Network/NullNATTraverser.cpp +++ b/Swiften/Network/NullNATTraverser.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -67,16 +68,16 @@ class NullNATTraversalRemovePortForwardingRequest : public NATTraversalRemovePor NullNATTraverser::NullNATTraverser(EventLoop* eventLoop) : eventLoop(eventLoop) { } -boost::shared_ptr NullNATTraverser::createGetPublicIPRequest() { - return boost::make_shared(eventLoop); +std::shared_ptr NullNATTraverser::createGetPublicIPRequest() { + return std::make_shared(eventLoop); } -boost::shared_ptr NullNATTraverser::createForwardPortRequest(int, int) { - return boost::make_shared(eventLoop); +std::shared_ptr NullNATTraverser::createForwardPortRequest(int, int) { + return std::make_shared(eventLoop); } -boost::shared_ptr NullNATTraverser::createRemovePortForwardingRequest(int, int) { - return boost::make_shared(eventLoop); +std::shared_ptr NullNATTraverser::createRemovePortForwardingRequest(int, int) { + return std::make_shared(eventLoop); } } diff --git a/Swiften/Network/NullNATTraverser.h b/Swiften/Network/NullNATTraverser.h index 3492940..d3a6640 100644 --- a/Swiften/Network/NullNATTraverser.h +++ b/Swiften/Network/NullNATTraverser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -15,9 +15,9 @@ namespace Swift { public: NullNATTraverser(EventLoop* eventLoop); - boost::shared_ptr createGetPublicIPRequest(); - boost::shared_ptr createForwardPortRequest(int localPort, int publicPort); - boost::shared_ptr createRemovePortForwardingRequest(int localPort, int publicPort); + std::shared_ptr createGetPublicIPRequest(); + std::shared_ptr createForwardPortRequest(int localPort, int publicPort); + std::shared_ptr createRemovePortForwardingRequest(int localPort, int publicPort); private: EventLoop* eventLoop; diff --git a/Swiften/Network/PlatformDomainNameAddressQuery.h b/Swiften/Network/PlatformDomainNameAddressQuery.h index a5cfda7..6cb3e0a 100644 --- a/Swiften/Network/PlatformDomainNameAddressQuery.h +++ b/Swiften/Network/PlatformDomainNameAddressQuery.h @@ -1,15 +1,15 @@ /* - * 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 #include #include -#include #include #include @@ -19,7 +19,7 @@ namespace Swift { class PlatformDomainNameResolver; class EventLoop; - class PlatformDomainNameAddressQuery : public DomainNameAddressQuery, public PlatformDomainNameQuery, public boost::enable_shared_from_this, public EventOwner { + class PlatformDomainNameAddressQuery : public DomainNameAddressQuery, public PlatformDomainNameQuery, public std::enable_shared_from_this, public EventOwner { public: PlatformDomainNameAddressQuery(const boost::optional& host, EventLoop* eventLoop, PlatformDomainNameResolver*); virtual ~PlatformDomainNameAddressQuery(); diff --git a/Swiften/Network/PlatformDomainNameQuery.h b/Swiften/Network/PlatformDomainNameQuery.h index 3c5e152..a279f20 100644 --- a/Swiften/Network/PlatformDomainNameQuery.h +++ b/Swiften/Network/PlatformDomainNameQuery.h @@ -1,19 +1,19 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include namespace Swift { class PlatformDomainNameResolver; class PlatformDomainNameQuery { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; PlatformDomainNameQuery(PlatformDomainNameResolver* resolver) : resolver(resolver) {} virtual ~PlatformDomainNameQuery() {} diff --git a/Swiften/Network/PlatformDomainNameResolver.cpp b/Swiften/Network/PlatformDomainNameResolver.cpp index ed08057..ecb5247 100644 --- a/Swiften/Network/PlatformDomainNameResolver.cpp +++ b/Swiften/Network/PlatformDomainNameResolver.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -33,22 +33,22 @@ PlatformDomainNameResolver::PlatformDomainNameResolver(IDNConverter* idnConverte PlatformDomainNameResolver::~PlatformDomainNameResolver() { stopRequested = true; - addQueryToQueue(boost::shared_ptr()); + addQueryToQueue(std::shared_ptr()); thread->join(); delete thread; } -boost::shared_ptr PlatformDomainNameResolver::createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) { +std::shared_ptr PlatformDomainNameResolver::createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) { boost::optional encodedDomain = idnConverter->getIDNAEncoded(domain); std::string result; if (encodedDomain) { result = serviceLookupPrefix + *encodedDomain; } - return boost::shared_ptr(new PlatformDomainNameServiceQuery(result, eventLoop, this)); + return std::make_shared(result, eventLoop, this); } -boost::shared_ptr PlatformDomainNameResolver::createAddressQuery(const std::string& name) { - return boost::shared_ptr(new PlatformDomainNameAddressQuery(idnConverter->getIDNAEncoded(name), eventLoop, this)); +std::shared_ptr PlatformDomainNameResolver::createAddressQuery(const std::string& name) { + return std::make_shared(idnConverter->getIDNAEncoded(name), eventLoop, this); } void PlatformDomainNameResolver::run() { diff --git a/Swiften/Network/PlatformDomainNameServiceQuery.h b/Swiften/Network/PlatformDomainNameServiceQuery.h index e415005..0d690f3 100644 --- a/Swiften/Network/PlatformDomainNameServiceQuery.h +++ b/Swiften/Network/PlatformDomainNameServiceQuery.h @@ -1,15 +1,14 @@ /* - * 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 #include -#include - #include #include #include @@ -17,7 +16,7 @@ namespace Swift { class EventLoop; - class PlatformDomainNameServiceQuery : public DomainNameServiceQuery, public PlatformDomainNameQuery, public boost::enable_shared_from_this, public EventOwner { + class PlatformDomainNameServiceQuery : public DomainNameServiceQuery, public PlatformDomainNameQuery, public std::enable_shared_from_this, public EventOwner { public: PlatformDomainNameServiceQuery(const boost::optional& serviceName, EventLoop* eventLoop, PlatformDomainNameResolver* resolver); virtual ~PlatformDomainNameServiceQuery(); diff --git a/Swiften/Network/PlatformNATTraversalWorker.cpp b/Swiften/Network/PlatformNATTraversalWorker.cpp index cb5758e..9b5ec2b 100644 --- a/Swiften/Network/PlatformNATTraversalWorker.cpp +++ b/Swiften/Network/PlatformNATTraversalWorker.cpp @@ -12,8 +12,8 @@ #include "PlatformNATTraversalWorker.h" -#include -#include +#include +#include #include #include @@ -31,9 +31,9 @@ namespace Swift { -class PlatformNATTraversalRequest : public boost::enable_shared_from_this, public EventOwner { +class PlatformNATTraversalRequest : public std::enable_shared_from_this, public EventOwner { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: PlatformNATTraversalRequest(PlatformNATTraversalWorker* worker) : worker(worker) { @@ -139,7 +139,7 @@ PlatformNATTraversalWorker::PlatformNATTraversalWorker(EventLoop* eventLoop) : e PlatformNATTraversalWorker::~PlatformNATTraversalWorker() { stopRequested = true; - addRequestToQueue(boost::shared_ptr()); + addRequestToQueue(std::shared_ptr()); thread->join(); delete thread; #ifdef HAVE_LIBNATPMP @@ -177,17 +177,17 @@ NATTraversalInterface* PlatformNATTraversalWorker::getNATTraversalInterface() co return nullNATTraversalInterface; } -boost::shared_ptr PlatformNATTraversalWorker::createGetPublicIPRequest() { - return boost::make_shared(this); +std::shared_ptr PlatformNATTraversalWorker::createGetPublicIPRequest() { + return std::make_shared(this); } -boost::shared_ptr PlatformNATTraversalWorker::createForwardPortRequest(int localPort, int publicPort) { - return boost::make_shared(this, localPort, publicPort); +std::shared_ptr PlatformNATTraversalWorker::createForwardPortRequest(int localPort, int publicPort) { + return std::make_shared(this, localPort, publicPort); } -boost::shared_ptr PlatformNATTraversalWorker::createRemovePortForwardingRequest(int localPort, int publicPort) { +std::shared_ptr PlatformNATTraversalWorker::createRemovePortForwardingRequest(int localPort, int publicPort) { NATPortMapping mapping(localPort, publicPort, NATPortMapping::TCP); // FIXME - return boost::make_shared(this, mapping); + return std::make_shared(this, mapping); } void PlatformNATTraversalWorker::start() { diff --git a/Swiften/Network/PlatformNATTraversalWorker.h b/Swiften/Network/PlatformNATTraversalWorker.h index 280a537..35f4ea6 100644 --- a/Swiften/Network/PlatformNATTraversalWorker.h +++ b/Swiften/Network/PlatformNATTraversalWorker.h @@ -44,13 +44,13 @@ namespace Swift { PlatformNATTraversalWorker(EventLoop* eventLoop); virtual ~PlatformNATTraversalWorker(); - boost::shared_ptr createGetPublicIPRequest(); - boost::shared_ptr createForwardPortRequest(int localPort, int publicPort); - boost::shared_ptr createRemovePortForwardingRequest(int localPort, int publicPort); + std::shared_ptr createGetPublicIPRequest(); + std::shared_ptr createForwardPortRequest(int localPort, int publicPort); + std::shared_ptr createRemovePortForwardingRequest(int localPort, int publicPort); private: NATTraversalInterface* getNATTraversalInterface() const; - void addRequestToQueue(boost::shared_ptr); + void addRequestToQueue(std::shared_ptr); void start(); void stop(); @@ -62,7 +62,7 @@ namespace Swift { EventLoop* eventLoop; Atomic stopRequested; boost::thread* thread; - std::deque > queue; + std::deque > queue; boost::mutex queueMutex; boost::condition_variable queueNonEmpty; diff --git a/Swiften/Network/ProxiedConnection.cpp b/Swiften/Network/ProxiedConnection.cpp index 27f5cd9..16bab0d 100644 --- a/Swiften/Network/ProxiedConnection.cpp +++ b/Swiften/Network/ProxiedConnection.cpp @@ -92,7 +92,7 @@ void ProxiedConnection::handleConnectFinished(Connection::ref connection) { } } -void ProxiedConnection::handleDataRead(boost::shared_ptr data) { +void ProxiedConnection::handleDataRead(std::shared_ptr data) { if (!connected_) { handleProxyInitializeData(data); } diff --git a/Swiften/Network/ProxiedConnection.h b/Swiften/Network/ProxiedConnection.h index 80f748c..38194aa 100644 --- a/Swiften/Network/ProxiedConnection.h +++ b/Swiften/Network/ProxiedConnection.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 Isode Limited. + * Copyright (c) 2012-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -7,7 +7,7 @@ #pragma once -#include +#include #include #include @@ -25,7 +25,7 @@ namespace boost { namespace Swift { class ConnectionFactory; - class SWIFTEN_API ProxiedConnection : public Connection, public boost::enable_shared_from_this { + class SWIFTEN_API ProxiedConnection : public Connection, public std::enable_shared_from_this { public: ProxiedConnection(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort); virtual ~ProxiedConnection(); @@ -40,7 +40,7 @@ namespace Swift { private: void handleConnectFinished(Connection::ref connection); - void handleDataRead(boost::shared_ptr data); + void handleDataRead(std::shared_ptr data); void handleDisconnected(const boost::optional& error); void cancelConnector(); @@ -48,7 +48,7 @@ namespace Swift { void setProxyInitializeFinished(bool success); virtual void initializeProxy() = 0; - virtual void handleProxyInitializeData(boost::shared_ptr data) = 0; + virtual void handleProxyInitializeData(std::shared_ptr data) = 0; const HostAddressPort& getServer() const { return server_; @@ -65,7 +65,7 @@ namespace Swift { int proxyPort_; HostAddressPort server_; Connector::ref connector_; - boost::shared_ptr connection_; + std::shared_ptr connection_; }; } diff --git a/Swiften/Network/SOCKS5ProxiedConnection.cpp b/Swiften/Network/SOCKS5ProxiedConnection.cpp index 2b7a3f3..67ef4ad 100644 --- a/Swiften/Network/SOCKS5ProxiedConnection.cpp +++ b/Swiften/Network/SOCKS5ProxiedConnection.cpp @@ -47,7 +47,7 @@ void SOCKS5ProxiedConnection::initializeProxy() { write(socksConnect); } -void SOCKS5ProxiedConnection::handleProxyInitializeData(boost::shared_ptr data) { +void SOCKS5ProxiedConnection::handleProxyInitializeData(std::shared_ptr data) { SafeByteArray socksConnect; boost::asio::ip::address rawAddress = getServer().getAddress().getRawAddress(); assert(rawAddress.is_v4() || rawAddress.is_v6()); diff --git a/Swiften/Network/SOCKS5ProxiedConnection.h b/Swiften/Network/SOCKS5ProxiedConnection.h index edbc56c..c8faae9 100644 --- a/Swiften/Network/SOCKS5ProxiedConnection.h +++ b/Swiften/Network/SOCKS5ProxiedConnection.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -22,7 +22,7 @@ namespace Swift { class SWIFTEN_API SOCKS5ProxiedConnection : public ProxiedConnection { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static ref create(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort) { return ref(new SOCKS5ProxiedConnection(resolver, connectionFactory, timerFactory, proxyHost, proxyPort)); @@ -32,7 +32,7 @@ namespace Swift { SOCKS5ProxiedConnection(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort); virtual void initializeProxy(); - virtual void handleProxyInitializeData(boost::shared_ptr data); + virtual void handleProxyInitializeData(std::shared_ptr data); private: enum { diff --git a/Swiften/Network/SOCKS5ProxiedConnectionFactory.cpp b/Swiften/Network/SOCKS5ProxiedConnectionFactory.cpp index 3e24f00..01ce8ac 100644 --- a/Swiften/Network/SOCKS5ProxiedConnectionFactory.cpp +++ b/Swiften/Network/SOCKS5ProxiedConnectionFactory.cpp @@ -4,6 +4,12 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #include #include @@ -13,7 +19,7 @@ namespace Swift { SOCKS5ProxiedConnectionFactory::SOCKS5ProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort) : resolver_(resolver), connectionFactory_(connectionFactory), timerFactory_(timerFactory), proxyHost_(proxyHost), proxyPort_(proxyPort) { } -boost::shared_ptr SOCKS5ProxiedConnectionFactory::createConnection() { +std::shared_ptr SOCKS5ProxiedConnectionFactory::createConnection() { return SOCKS5ProxiedConnection::create(resolver_, connectionFactory_, timerFactory_, proxyHost_, proxyPort_); } diff --git a/Swiften/Network/SOCKS5ProxiedConnectionFactory.h b/Swiften/Network/SOCKS5ProxiedConnectionFactory.h index 1092381..8631239 100644 --- a/Swiften/Network/SOCKS5ProxiedConnectionFactory.h +++ b/Swiften/Network/SOCKS5ProxiedConnectionFactory.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -25,7 +25,7 @@ namespace Swift { public: SOCKS5ProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort); - virtual boost::shared_ptr createConnection(); + virtual std::shared_ptr createConnection(); private: DomainNameResolver* resolver_; diff --git a/Swiften/Network/StaticDomainNameResolver.cpp b/Swiften/Network/StaticDomainNameResolver.cpp index 45e6c5f..3601bf2 100644 --- a/Swiften/Network/StaticDomainNameResolver.cpp +++ b/Swiften/Network/StaticDomainNameResolver.cpp @@ -17,8 +17,8 @@ using namespace Swift; namespace { - struct ServiceQuery : public DomainNameServiceQuery, public boost::enable_shared_from_this { - ServiceQuery(const std::string& service, Swift::StaticDomainNameResolver* resolver, EventLoop* eventLoop, boost::shared_ptr owner) : eventLoop(eventLoop), service(service), resolver(resolver), owner(owner) {} + struct ServiceQuery : public DomainNameServiceQuery, public std::enable_shared_from_this { + ServiceQuery(const std::string& service, Swift::StaticDomainNameResolver* resolver, EventLoop* eventLoop, std::shared_ptr owner) : eventLoop(eventLoop), service(service), resolver(resolver), owner(owner) {} virtual void run() { if (!resolver->getIsResponsive()) { @@ -40,11 +40,11 @@ namespace { EventLoop* eventLoop; std::string service; StaticDomainNameResolver* resolver; - boost::shared_ptr owner; + std::shared_ptr owner; }; - struct AddressQuery : public DomainNameAddressQuery, public boost::enable_shared_from_this { - AddressQuery(const std::string& host, StaticDomainNameResolver* resolver, EventLoop* eventLoop, boost::shared_ptr owner) : eventLoop(eventLoop), host(host), resolver(resolver), owner(owner) {} + struct AddressQuery : public DomainNameAddressQuery, public std::enable_shared_from_this { + AddressQuery(const std::string& host, StaticDomainNameResolver* resolver, EventLoop* eventLoop, std::shared_ptr owner) : eventLoop(eventLoop), host(host), resolver(resolver), owner(owner) {} virtual void run() { if (!resolver->getIsResponsive()) { @@ -67,7 +67,7 @@ namespace { EventLoop* eventLoop; std::string host; StaticDomainNameResolver* resolver; - boost::shared_ptr owner; + std::shared_ptr owner; }; } @@ -109,12 +109,12 @@ void StaticDomainNameResolver::addXMPPClientService(const std::string& domain, c addService("_xmpp-client._tcp." + domain, ServiceQuery::Result(hostname, port, 0, 0)); } -boost::shared_ptr StaticDomainNameResolver::createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) { - return boost::shared_ptr(new ServiceQuery(serviceLookupPrefix + domain, this, eventLoop, owner)); +std::shared_ptr StaticDomainNameResolver::createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) { + return std::make_shared(serviceLookupPrefix + domain, this, eventLoop, owner); } -boost::shared_ptr StaticDomainNameResolver::createAddressQuery(const std::string& name) { - return boost::shared_ptr(new AddressQuery(name, this, eventLoop, owner)); +std::shared_ptr StaticDomainNameResolver::createAddressQuery(const std::string& name) { + return std::make_shared(name, this, eventLoop, owner); } } diff --git a/Swiften/Network/StaticDomainNameResolver.h b/Swiften/Network/StaticDomainNameResolver.h index 6d38a26..76394d0 100644 --- a/Swiften/Network/StaticDomainNameResolver.h +++ b/Swiften/Network/StaticDomainNameResolver.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include #include @@ -48,13 +49,13 @@ namespace Swift { isResponsive = b; } - virtual boost::shared_ptr createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain); - virtual boost::shared_ptr createAddressQuery(const std::string& name); + virtual std::shared_ptr createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain); + virtual std::shared_ptr createAddressQuery(const std::string& name); private: EventLoop* eventLoop; bool isResponsive; AddressesMap addresses; ServicesCollection services; - boost::shared_ptr owner; + std::shared_ptr owner; }; } diff --git a/Swiften/Network/TLSConnection.cpp b/Swiften/Network/TLSConnection.cpp index 4099de7..7c293d1 100644 --- a/Swiften/Network/TLSConnection.cpp +++ b/Swiften/Network/TLSConnection.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -47,7 +47,7 @@ void TLSConnection::handleTLSDataForNetwork(const SafeByteArray& data) { } void TLSConnection::handleTLSDataForApplication(const SafeByteArray& data) { - onDataRead(boost::make_shared(data)); + onDataRead(std::make_shared(data)); } void TLSConnection::connect(const HostAddressPort& address) { @@ -88,7 +88,7 @@ void TLSConnection::handleRawDisconnected(const boost::optional& error) { onDisconnected(error); } -void TLSConnection::handleRawDataRead(boost::shared_ptr data) { +void TLSConnection::handleRawDataRead(std::shared_ptr data) { context->handleDataFromNetwork(*data); } diff --git a/Swiften/Network/TLSConnection.h b/Swiften/Network/TLSConnection.h index 41543a2..fdcdb6d 100644 --- a/Swiften/Network/TLSConnection.h +++ b/Swiften/Network/TLSConnection.h @@ -1,13 +1,12 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include -#include +#include #include #include @@ -39,7 +38,7 @@ namespace Swift { private: void handleRawConnectFinished(bool error); void handleRawDisconnected(const boost::optional& error); - void handleRawDataRead(boost::shared_ptr data); + void handleRawDataRead(std::shared_ptr data); void handleRawDataWritten(); void handleTLSConnectFinished(bool error); void handleTLSDataForNetwork(const SafeByteArray& data); diff --git a/Swiften/Network/TLSConnectionFactory.cpp b/Swiften/Network/TLSConnectionFactory.cpp index e0396e2..b311c7d 100644 --- a/Swiften/Network/TLSConnectionFactory.cpp +++ b/Swiften/Network/TLSConnectionFactory.cpp @@ -1,12 +1,12 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include +#include #include @@ -21,8 +21,8 @@ TLSConnectionFactory::~TLSConnectionFactory() { } -boost::shared_ptr TLSConnectionFactory::createConnection() { - return boost::make_shared(connectionFactory->createConnection(), contextFactory, options_); +std::shared_ptr TLSConnectionFactory::createConnection() { + return std::make_shared(connectionFactory->createConnection(), contextFactory, options_); } } diff --git a/Swiften/Network/TLSConnectionFactory.h b/Swiften/Network/TLSConnectionFactory.h index 8e39c35..148e345 100644 --- a/Swiften/Network/TLSConnectionFactory.h +++ b/Swiften/Network/TLSConnectionFactory.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { TLSConnectionFactory(TLSContextFactory* contextFactory, ConnectionFactory* connectionFactory, const TLSOptions&); virtual ~TLSConnectionFactory(); - virtual boost::shared_ptr createConnection(); + virtual std::shared_ptr createConnection(); private: TLSContextFactory* contextFactory; ConnectionFactory* connectionFactory; diff --git a/Swiften/Network/Timer.h b/Swiften/Network/Timer.h index 1abf5bc..501fbd8 100644 --- a/Swiften/Network/Timer.h +++ b/Swiften/Network/Timer.h @@ -15,7 +15,7 @@ namespace Swift { */ class SWIFTEN_API Timer { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; virtual ~Timer(); diff --git a/Swiften/Network/TimerFactory.h b/Swiften/Network/TimerFactory.h index 47e89f8..ebb1b6e 100644 --- a/Swiften/Network/TimerFactory.h +++ b/Swiften/Network/TimerFactory.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include diff --git a/Swiften/Network/UnboundDomainNameResolver.cpp b/Swiften/Network/UnboundDomainNameResolver.cpp index a9fed24..380e087 100755 --- a/Swiften/Network/UnboundDomainNameResolver.cpp +++ b/Swiften/Network/UnboundDomainNameResolver.cpp @@ -10,11 +10,10 @@ * See the COPYING file for more information. */ +#include #include #include -#include -#include #include #include @@ -44,12 +43,12 @@ class UnboundQuery { }; struct UnboundWrapperHelper { - UnboundWrapperHelper(UnboundDomainNameResolver* resolver, boost::shared_ptr query) : resolver(resolver), query(query) {} + UnboundWrapperHelper(UnboundDomainNameResolver* resolver, std::shared_ptr query) : resolver(resolver), query(query) {} UnboundDomainNameResolver* resolver; - boost::shared_ptr query; + std::shared_ptr query; }; -class UnboundDomainNameServiceQuery : public DomainNameServiceQuery, public UnboundQuery, public boost::enable_shared_from_this { +class UnboundDomainNameServiceQuery : public DomainNameServiceQuery, public UnboundQuery, public std::enable_shared_from_this { public: UnboundDomainNameServiceQuery(UnboundDomainNameResolver* resolver, ub_ctx* context, std::string name) : UnboundQuery(resolver, context), name(name) { } @@ -121,7 +120,7 @@ class UnboundDomainNameServiceQuery : public DomainNameServiceQuery, public Unbo std::string name; }; -class UnboundDomainNameAddressQuery : public DomainNameAddressQuery, public UnboundQuery, public boost::enable_shared_from_this { +class UnboundDomainNameAddressQuery : public DomainNameAddressQuery, public UnboundQuery, public std::enable_shared_from_this { public: UnboundDomainNameAddressQuery(UnboundDomainNameResolver* resolver, ub_ctx* context, std::string name) : UnboundQuery(resolver, context), name(name) { } @@ -179,12 +178,12 @@ class UnboundDomainNameAddressQuery : public DomainNameAddressQuery, public Unbo std::string name; }; -UnboundDomainNameResolver::UnboundDomainNameResolver(IDNConverter* idnConverter, boost::shared_ptr ioService, EventLoop* eventLoop) : idnConverter(idnConverter), ioService(ioService), ubDescriptior(*ioService), eventLoop(eventLoop) { +UnboundDomainNameResolver::UnboundDomainNameResolver(IDNConverter* idnConverter, std::shared_ptr ioService, EventLoop* eventLoop) : idnConverter(idnConverter), ioService(ioService), ubDescriptior(*ioService), eventLoop(eventLoop) { ubContext = ub_ctx_create(); if(!ubContext) { SWIFT_LOG(debug) << "could not create unbound context" << std::endl; } - eventOwner = boost::make_shared(); + eventOwner = std::make_shared(); ub_ctx_async(ubContext, true); @@ -211,7 +210,7 @@ UnboundDomainNameResolver::~UnboundDomainNameResolver() { } } -void UnboundDomainNameResolver::unbound_callback(boost::shared_ptr query, int err, ub_result* result) { +void UnboundDomainNameResolver::unbound_callback(std::shared_ptr query, int err, ub_result* result) { query->handleResult(err, result); } @@ -236,17 +235,17 @@ void UnboundDomainNameResolver::processData() { } } -boost::shared_ptr UnboundDomainNameResolver::createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) { +std::shared_ptr UnboundDomainNameResolver::createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) { boost::optional encodedDomain = idnConverter->getIDNAEncoded(domain); std::string result; if (encodedDomain) { result = serviceLookupPrefix + *encodedDomain; } - return boost::make_shared(this, ubContext, result); + return std::make_shared(this, ubContext, result); } -boost::shared_ptr UnboundDomainNameResolver::createAddressQuery(const std::string& name) { - return boost::make_shared(this, ubContext, idnConverter->getIDNAEncoded(name).get_value_or("")); +std::shared_ptr UnboundDomainNameResolver::createAddressQuery(const std::string& name) { + return std::make_shared(this, ubContext, idnConverter->getIDNAEncoded(name).get_value_or("")); } } diff --git a/Swiften/Network/UnboundDomainNameResolver.h b/Swiften/Network/UnboundDomainNameResolver.h index afb21c8..a97e385 100755 --- a/Swiften/Network/UnboundDomainNameResolver.h +++ b/Swiften/Network/UnboundDomainNameResolver.h @@ -12,9 +12,9 @@ #pragma once +#include + #include -#include -#include #include #include @@ -31,26 +31,26 @@ namespace Swift { class UnboundDomainNameResolver; class UnboundQuery; - class UnboundDomainNameResolver : public DomainNameResolver, public EventOwner, public boost::enable_shared_from_this { + class UnboundDomainNameResolver : public DomainNameResolver, public EventOwner, public std::enable_shared_from_this { public: - UnboundDomainNameResolver(IDNConverter* idnConverter, boost::shared_ptr ioService, EventLoop* eventLoop); + UnboundDomainNameResolver(IDNConverter* idnConverter, std::shared_ptr ioService, EventLoop* eventLoop); virtual ~UnboundDomainNameResolver(); - virtual boost::shared_ptr createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain); - virtual boost::shared_ptr createAddressQuery(const std::string& name); + virtual std::shared_ptr createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain); + virtual std::shared_ptr createAddressQuery(const std::string& name); static void unbound_callback_wrapper(void* data, int err, ub_result* result); private: - void unbound_callback(boost::shared_ptr query, int err, ub_result* result); + void unbound_callback(std::shared_ptr query, int err, ub_result* result); void handleUBSocketReadable(boost::system::error_code); void processData(); private: IDNConverter* idnConverter; - boost::shared_ptr eventOwner; - boost::shared_ptr ioService; + std::shared_ptr eventOwner; + std::shared_ptr ioService; boost::asio::posix::stream_descriptor ubDescriptior; EventLoop* eventLoop; ub_ctx* ubContext; diff --git a/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp b/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp index 12b48a9..8dbd09e 100644 --- a/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp +++ b/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp @@ -4,11 +4,11 @@ * See the COPYING file for more information. */ +#include + #include #include #include -#include -#include #include @@ -29,7 +29,7 @@ using namespace Swift; -typedef boost::shared_ptr PoolRef; +typedef std::shared_ptr PoolRef; class BOSHConnectionPoolTest : public CppUnit::TestFixture { @@ -167,8 +167,8 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture { } void testConnectionCount_ThreeWritesTwoReads() { - boost::shared_ptr c0; - boost::shared_ptr c1; + std::shared_ptr c0; + std::shared_ptr c1; unsigned long long rid = initialRID; PoolRef testling = createTestling(); @@ -294,7 +294,7 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture { } void testWrite_Empty() { - boost::shared_ptr c0; + std::shared_ptr c0; PoolRef testling = createTestling(); CPPUNIT_ASSERT_EQUAL(st(1), connectionFactory->connections.size()); @@ -406,32 +406,32 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture { MockConnectionFactory(EventLoop* eventLoop, bool autoFinishConnect = true) : eventLoop(eventLoop), autoFinishConnect(autoFinishConnect) { } - boost::shared_ptr createConnection() { - boost::shared_ptr connection = boost::make_shared(failingPorts, eventLoop, autoFinishConnect); + std::shared_ptr createConnection() { + std::shared_ptr connection = std::make_shared(failingPorts, eventLoop, autoFinishConnect); connections.push_back(connection); return connection; } EventLoop* eventLoop; - std::vector< boost::shared_ptr > connections; + std::vector< std::shared_ptr > connections; std::vector failingPorts; bool autoFinishConnect; }; - void readResponse(const std::string& response, boost::shared_ptr connection) { + void readResponse(const std::string& response, std::shared_ptr connection) { connection->pending = false; - boost::shared_ptr data1 = boost::make_shared(createSafeByteArray( + std::shared_ptr data1 = std::make_shared(createSafeByteArray( "HTTP/1.1 200 OK\r\n" "Content-Type: text/xml; charset=utf-8\r\n" "Access-Control-Allow-Origin: *\r\n" "Access-Control-Allow-Headers: Content-Type\r\n" "Content-Length: ")); connection->onDataRead(data1); - boost::shared_ptr data2 = boost::make_shared(createSafeByteArray(boost::lexical_cast(response.size()))); + std::shared_ptr data2 = std::make_shared(createSafeByteArray(boost::lexical_cast(response.size()))); connection->onDataRead(data2); - boost::shared_ptr data3 = boost::make_shared(createSafeByteArray("\r\n\r\n")); + std::shared_ptr data3 = std::make_shared(createSafeByteArray("\r\n\r\n")); connection->onDataRead(data3); - boost::shared_ptr data4 = boost::make_shared(createSafeByteArray(response)); + std::shared_ptr data4 = std::make_shared(createSafeByteArray(response)); connection->onDataRead(data4); } diff --git a/Swiften/Network/UnitTest/BOSHConnectionTest.cpp b/Swiften/Network/UnitTest/BOSHConnectionTest.cpp index abd020f..a791e96 100644 --- a/Swiften/Network/UnitTest/BOSHConnectionTest.cpp +++ b/Swiften/Network/UnitTest/BOSHConnectionTest.cpp @@ -4,11 +4,11 @@ * See the COPYING file for more information. */ +#include + #include #include #include -#include -#include #include @@ -151,17 +151,17 @@ class BOSHConnectionTest : public CppUnit::TestFixture { testling->connect(); eventLoop->processEvents(); CPPUNIT_ASSERT_EQUAL(static_cast(1), connectionFactory->connections.size()); - boost::shared_ptr connection = connectionFactory->connections[0]; - boost::shared_ptr data1 = boost::make_shared(createSafeByteArray( + std::shared_ptr connection = connectionFactory->connections[0]; + std::shared_ptr data1 = std::make_shared(createSafeByteArray( "HTTP/1.1 200 OK\r\n" "Content-Type: text/xml; charset=utf-8\r\n" "Access-Control-Allow-Origin: *\r\n" "Access-Control-Allow-Headers: Content-Type\r\n" "Content-Length: 64\r\n")); - boost::shared_ptr data2 = boost::make_shared(createSafeByteArray( + std::shared_ptr data2 = std::make_shared(createSafeByteArray( "\r\n" " data3 = boost::make_shared(createSafeByteArray( + std::shared_ptr data3 = std::make_shared(createSafeByteArray( "ah/>" "")); connection->onDataRead(data1); @@ -258,30 +258,30 @@ class BOSHConnectionTest : public CppUnit::TestFixture { MockConnectionFactory(EventLoop* eventLoop) : eventLoop(eventLoop) { } - boost::shared_ptr createConnection() { - boost::shared_ptr connection = boost::make_shared(failingPorts, eventLoop); + std::shared_ptr createConnection() { + std::shared_ptr connection = std::make_shared(failingPorts, eventLoop); connections.push_back(connection); return connection; } EventLoop* eventLoop; - std::vector< boost::shared_ptr > connections; + std::vector< std::shared_ptr > connections; std::vector failingPorts; }; - void readResponse(const std::string& response, boost::shared_ptr connection) { - boost::shared_ptr data1 = boost::make_shared(createSafeByteArray( + void readResponse(const std::string& response, std::shared_ptr connection) { + std::shared_ptr data1 = std::make_shared(createSafeByteArray( "HTTP/1.1 200 OK\r\n" "Content-Type: text/xml; charset=utf-8\r\n" "Access-Control-Allow-Origin: *\r\n" "Access-Control-Allow-Headers: Content-Type\r\n" "Content-Length: ")); connection->onDataRead(data1); - boost::shared_ptr data2 = boost::make_shared(createSafeByteArray(boost::lexical_cast(response.size()))); + std::shared_ptr data2 = std::make_shared(createSafeByteArray(boost::lexical_cast(response.size()))); connection->onDataRead(data2); - boost::shared_ptr data3 = boost::make_shared(createSafeByteArray("\r\n\r\n")); + std::shared_ptr data3 = std::make_shared(createSafeByteArray("\r\n\r\n")); connection->onDataRead(data3); - boost::shared_ptr data4 = boost::make_shared(createSafeByteArray(response)); + std::shared_ptr data4 = std::make_shared(createSafeByteArray(response)); connection->onDataRead(data4); } diff --git a/Swiften/Network/UnitTest/ChainedConnectorTest.cpp b/Swiften/Network/UnitTest/ChainedConnectorTest.cpp index 9496e13..3fad433 100644 --- a/Swiften/Network/UnitTest/ChainedConnectorTest.cpp +++ b/Swiften/Network/UnitTest/ChainedConnectorTest.cpp @@ -1,11 +1,12 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ +#include + #include -#include #include #include @@ -51,7 +52,7 @@ class ChainedConnectorTest : public CppUnit::TestFixture { } void testConnect_FirstConnectorSucceeds() { - boost::shared_ptr testling(createConnector()); + std::shared_ptr testling(createConnector()); connectionFactory1->connects = true; connectionFactory2->connects = false; @@ -60,12 +61,12 @@ class ChainedConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(connections[0]); - CPPUNIT_ASSERT_EQUAL(1, boost::dynamic_pointer_cast(connections[0])->id); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT_EQUAL(1, std::dynamic_pointer_cast(connections[0])->id); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } void testConnect_SecondConnectorSucceeds() { - boost::shared_ptr testling(createConnector()); + std::shared_ptr testling(createConnector()); connectionFactory1->connects = false; connectionFactory2->connects = true; @@ -74,12 +75,12 @@ class ChainedConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(connections[0]); - CPPUNIT_ASSERT_EQUAL(2, boost::dynamic_pointer_cast(connections[0])->id); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT_EQUAL(2, std::dynamic_pointer_cast(connections[0])->id); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } void testConnect_NoConnectorSucceeds() { - boost::shared_ptr testling(createConnector()); + std::shared_ptr testling(createConnector()); connectionFactory1->connects = false; connectionFactory2->connects = false; @@ -88,14 +89,14 @@ class ChainedConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(!connections[0]); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } void testConnect_NoDNS() { /* Reset resolver so there's no record */ delete resolver; resolver = new StaticDomainNameResolver(eventLoop); - boost::shared_ptr testling(createConnector()); + std::shared_ptr testling(createConnector()); connectionFactory1->connects = false; connectionFactory2->connects = false; @@ -105,11 +106,11 @@ class ChainedConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(!connections[0]); - CPPUNIT_ASSERT(boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(std::dynamic_pointer_cast(error)); } void testStop() { - boost::shared_ptr testling(createConnector()); + std::shared_ptr testling(createConnector()); connectionFactory1->connects = true; connectionFactory2->connects = false; @@ -122,18 +123,18 @@ class ChainedConnectorTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createConnector() { + std::shared_ptr createConnector() { std::vector factories; factories.push_back(connectionFactory1); factories.push_back(connectionFactory2); - boost::shared_ptr connector = boost::make_shared("foo.com", -1, boost::optional("_xmpp-client._tcp."), resolver, factories, timerFactory); + std::shared_ptr connector = std::make_shared("foo.com", -1, boost::optional("_xmpp-client._tcp."), resolver, factories, timerFactory); connector->onConnectFinished.connect(boost::bind(&ChainedConnectorTest::handleConnectorFinished, this, _1, _2)); return connector; } - void handleConnectorFinished(boost::shared_ptr connection, boost::shared_ptr resultError) { + void handleConnectorFinished(std::shared_ptr connection, std::shared_ptr resultError) { error = resultError; - boost::shared_ptr c(boost::dynamic_pointer_cast(connection)); + std::shared_ptr c(std::dynamic_pointer_cast(connection)); if (connection) { assert(c); } @@ -164,8 +165,8 @@ class ChainedConnectorTest : public CppUnit::TestFixture { MockConnectionFactory(EventLoop* eventLoop, int id) : eventLoop(eventLoop), connects(true), id(id) { } - boost::shared_ptr createConnection() { - return boost::make_shared(connects, id, eventLoop); + std::shared_ptr createConnection() { + return std::make_shared(connects, id, eventLoop); } EventLoop* eventLoop; @@ -180,8 +181,8 @@ class ChainedConnectorTest : public CppUnit::TestFixture { MockConnectionFactory* connectionFactory1; MockConnectionFactory* connectionFactory2; DummyTimerFactory* timerFactory; - std::vector< boost::shared_ptr > connections; - boost::shared_ptr error; + std::vector< std::shared_ptr > connections; + std::shared_ptr error; }; CPPUNIT_TEST_SUITE_REGISTRATION(ChainedConnectorTest); diff --git a/Swiften/Network/UnitTest/ConnectorTest.cpp b/Swiften/Network/UnitTest/ConnectorTest.cpp index ac2bc83..20ad68d 100644 --- a/Swiften/Network/UnitTest/ConnectorTest.cpp +++ b/Swiften/Network/UnitTest/ConnectorTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -71,7 +71,7 @@ class ConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(connections[0]); CPPUNIT_ASSERT(host1 == *(connections[0]->hostAddressPort)); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } void testConnect_NoServiceLookups() { @@ -87,7 +87,7 @@ class ConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT(connections[0]); CPPUNIT_ASSERT(host3.getAddress() == (*(connections[0]->hostAddressPort)).getAddress()); CPPUNIT_ASSERT(4321 == (*(connections[0]->hostAddressPort)).getPort()); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } void testConnect_NoServiceLookups_DefaultPort() { @@ -103,7 +103,7 @@ class ConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT(connections[0]); CPPUNIT_ASSERT(host3.getAddress() == (*(connections[0]->hostAddressPort)).getAddress()); CPPUNIT_ASSERT_EQUAL(5222, (*(connections[0]->hostAddressPort)).getPort()); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } void testConnect_NoSRVHost() { @@ -116,7 +116,7 @@ class ConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(connections[0]); CPPUNIT_ASSERT(host3 == *(connections[0]->hostAddressPort)); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } void testConnect_FirstAddressHostFails() { @@ -135,7 +135,7 @@ class ConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(connections[0]); CPPUNIT_ASSERT(HostAddressPort(address2, 1234) == *(connections[0]->hostAddressPort)); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } void testConnect_NoHosts() { @@ -146,7 +146,7 @@ class ConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(!connections[0]); - CPPUNIT_ASSERT(boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(std::dynamic_pointer_cast(error)); } void testConnect_FirstSRVHostFails() { @@ -160,7 +160,7 @@ class ConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(host2 == *(connections[0]->hostAddressPort)); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } void testConnect_AllSRVHostsFailWithoutFallbackHost() { @@ -175,7 +175,7 @@ class ConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(!connections[0]); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } void testConnect_AllSRVHostsFailWithFallbackHost() { @@ -192,7 +192,7 @@ class ConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(connections[0]); CPPUNIT_ASSERT(host3 == *(connections[0]->hostAddressPort)); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } void testConnect_SRVAndFallbackHostsFail() { @@ -207,7 +207,7 @@ class ConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(!connections[0]); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } /*void testConnect_TimeoutDuringResolve() { @@ -221,7 +221,7 @@ class ConnectorTest : public CppUnit::TestFixture { eventLoop->processEvents(); CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); - CPPUNIT_ASSERT(boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(std::dynamic_pointer_cast(error)); CPPUNIT_ASSERT(!connections[0]); }*/ @@ -238,7 +238,7 @@ class ConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(!connections[0]); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } void testConnect_TimeoutDuringConnectToCandidateFallsBack() { @@ -261,7 +261,7 @@ class ConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(connections[0]); CPPUNIT_ASSERT(HostAddressPort(address2, 1234) == *(connections[0]->hostAddressPort)); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } @@ -277,7 +277,7 @@ class ConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(connections[0]); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(error)); } void testStop_DuringSRVQuery() { @@ -291,7 +291,7 @@ class ConnectorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(connections.size())); CPPUNIT_ASSERT(!connections[0]); - CPPUNIT_ASSERT(boost::dynamic_pointer_cast(error)); + CPPUNIT_ASSERT(std::dynamic_pointer_cast(error)); } void testStop_Timeout() { @@ -318,8 +318,8 @@ class ConnectorTest : public CppUnit::TestFixture { return connector; } - void handleConnectorFinished(boost::shared_ptr connection, boost::shared_ptr resultError) { - boost::shared_ptr c(boost::dynamic_pointer_cast(connection)); + void handleConnectorFinished(std::shared_ptr connection, std::shared_ptr resultError) { + std::shared_ptr c(std::dynamic_pointer_cast(connection)); if (connection) { assert(c); } @@ -355,8 +355,8 @@ class ConnectorTest : public CppUnit::TestFixture { MockConnectionFactory(EventLoop* eventLoop) : eventLoop(eventLoop), isResponsive(true) { } - boost::shared_ptr createConnection() { - return boost::shared_ptr(new MockConnection(failingPorts, isResponsive, eventLoop)); + std::shared_ptr createConnection() { + return std::make_shared(failingPorts, isResponsive, eventLoop); } EventLoop* eventLoop; @@ -372,8 +372,8 @@ class ConnectorTest : public CppUnit::TestFixture { StaticDomainNameResolver* resolver; MockConnectionFactory* connectionFactory; DummyTimerFactory* timerFactory; - std::vector< boost::shared_ptr > connections; - boost::shared_ptr error; + std::vector< std::shared_ptr > connections; + std::shared_ptr error; }; diff --git a/Swiften/Network/UnitTest/HTTPConnectProxiedConnectionTest.cpp b/Swiften/Network/UnitTest/HTTPConnectProxiedConnectionTest.cpp index aa3d578..232847b 100644 --- a/Swiften/Network/UnitTest/HTTPConnectProxiedConnectionTest.cpp +++ b/Swiften/Network/UnitTest/HTTPConnectProxiedConnectionTest.cpp @@ -1,15 +1,15 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ +#include + #include #include #include #include -#include -#include #include @@ -254,7 +254,7 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture { void testTrafficFilter() { HTTPConnectProxiedConnection::ref testling(createTestling()); - boost::shared_ptr httpTrafficFilter = boost::make_shared(); + std::shared_ptr httpTrafficFilter = std::make_shared(); testling->setHTTPTrafficFilter(httpTrafficFilter); connect(testling, HostAddressPort(HostAddress("2.2.2.2"), 2345)); @@ -295,7 +295,7 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture { void testTrafficFilterNoConnectionReuse() { HTTPConnectProxiedConnection::ref testling = createTestling(); - boost::shared_ptr httpTrafficFilter = boost::make_shared(); + std::shared_ptr httpTrafficFilter = std::make_shared(); testling->setHTTPTrafficFilter(httpTrafficFilter); connect(testling, HostAddressPort(HostAddress("2.2.2.2"), 2345)); @@ -351,7 +351,7 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture { private: HTTPConnectProxiedConnection::ref createTestling() { - boost::shared_ptr c = HTTPConnectProxiedConnection::create(resolver, connectionFactory, timerFactory, proxyHost, proxyPort, "", ""); + std::shared_ptr c = HTTPConnectProxiedConnection::create(resolver, connectionFactory, timerFactory, proxyHost, proxyPort, "", ""); c->onConnectFinished.connect(boost::bind(&HTTPConnectProxiedConnectionTest::handleConnectFinished, this, _1)); c->onDisconnected.connect(boost::bind(&HTTPConnectProxiedConnectionTest::handleDisconnected, this, _1)); c->onDataRead.connect(boost::bind(&HTTPConnectProxiedConnectionTest::handleDataRead, this, _1)); @@ -368,7 +368,7 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture { disconnectedError = e; } - void handleDataRead(boost::shared_ptr d) { + void handleDataRead(std::shared_ptr d) { append(dataRead, *d); } @@ -408,15 +408,15 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture { MockConnectionFactory(EventLoop* eventLoop) : eventLoop(eventLoop) { } - boost::shared_ptr createConnection() { - boost::shared_ptr connection = boost::make_shared(failingPorts, eventLoop); + std::shared_ptr createConnection() { + std::shared_ptr connection = std::make_shared(failingPorts, eventLoop); connections.push_back(connection); SWIFT_LOG(debug) << "new connection created" << std::endl; return connection; } EventLoop* eventLoop; - std::vector< boost::shared_ptr > connections; + std::vector< std::shared_ptr > connections; std::vector failingPorts; }; diff --git a/Swiften/Parser/BOSHBodyExtractor.cpp b/Swiften/Parser/BOSHBodyExtractor.cpp index c5723be..c45d338 100644 --- a/Swiften/Parser/BOSHBodyExtractor.cpp +++ b/Swiften/Parser/BOSHBodyExtractor.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -125,7 +126,7 @@ BOSHBodyExtractor::BOSHBodyExtractor(XMLParserFactory* parserFactory, const Byte // Parse the body element BOSHBodyParserClient parserClient(this); - boost::shared_ptr parser(parserFactory->createXMLParser(&parserClient)); + std::shared_ptr parser(parserFactory->createXMLParser(&parserClient)); if (!parser->parse(std::string( reinterpret_cast(vecptr(data)), boost::numeric_cast(std::distance(data.begin(), i))))) { diff --git a/Swiften/Parser/ElementParser.h b/Swiften/Parser/ElementParser.h index 12c6c38..71d4bce 100644 --- a/Swiften/Parser/ElementParser.h +++ b/Swiften/Parser/ElementParser.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -23,6 +22,6 @@ namespace Swift { virtual void handleEndElement(const std::string& element, const std::string& ns) = 0; virtual void handleCharacterData(const std::string& data) = 0; - virtual boost::shared_ptr getElement() const = 0; + virtual std::shared_ptr getElement() const = 0; }; } diff --git a/Swiften/Parser/ExpatParser.h b/Swiften/Parser/ExpatParser.h index 581847b..6580a7a 100644 --- a/Swiften/Parser/ExpatParser.h +++ b/Swiften/Parser/ExpatParser.h @@ -1,13 +1,14 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include + #include -#include #include #include @@ -24,6 +25,6 @@ namespace Swift { private: struct Private; - boost::shared_ptr p; + std::shared_ptr p; }; } diff --git a/Swiften/Parser/GenericElementParser.h b/Swiften/Parser/GenericElementParser.h index 7a0f989..5aa62c9 100644 --- a/Swiften/Parser/GenericElementParser.h +++ b/Swiften/Parser/GenericElementParser.h @@ -1,13 +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 -#include +#include #include #include @@ -20,14 +19,14 @@ namespace Swift { class SWIFTEN_API GenericElementParser : public ElementParser { public: GenericElementParser() { - stanza_ = boost::make_shared(); + stanza_ = std::make_shared(); } - virtual boost::shared_ptr getElement() const { + virtual std::shared_ptr getElement() const { return stanza_; } - virtual boost::shared_ptr getElementGeneric() const { + virtual std::shared_ptr getElementGeneric() const { return stanza_; } @@ -42,6 +41,6 @@ namespace Swift { } private: - boost::shared_ptr stanza_; + std::shared_ptr stanza_; }; } diff --git a/Swiften/Parser/GenericPayloadParser.h b/Swiften/Parser/GenericPayloadParser.h index be0172c..ea0a7bd 100644 --- a/Swiften/Parser/GenericPayloadParser.h +++ b/Swiften/Parser/GenericPayloadParser.h @@ -1,13 +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 -#include +#include #include #include @@ -26,18 +25,18 @@ namespace Swift { class GenericPayloadParser : public PayloadParser { public: GenericPayloadParser() : PayloadParser() { - payload_ = boost::make_shared(); + payload_ = std::make_shared(); } - virtual boost::shared_ptr getPayload() const { + virtual std::shared_ptr getPayload() const { return payload_; } - virtual boost::shared_ptr getPayloadInternal() const { + virtual std::shared_ptr getPayloadInternal() const { return payload_; } private: - boost::shared_ptr payload_; + std::shared_ptr payload_; }; } diff --git a/Swiften/Parser/GenericPayloadTreeParser.h b/Swiften/Parser/GenericPayloadTreeParser.h index 2a7e190..b4da1a9 100644 --- a/Swiften/Parser/GenericPayloadTreeParser.h +++ b/Swiften/Parser/GenericPayloadTreeParser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -7,9 +7,7 @@ #pragma once #include - -#include -#include +#include #include #include @@ -24,7 +22,7 @@ namespace Swift { public: virtual void handleStartElement(const std::string& element, const std::string& xmlns, const AttributeMap& attributes) { if (!root_) { - root_ = boost::make_shared(element, xmlns, attributes); + root_ = std::make_shared(element, xmlns, attributes); elementStack_.push_back(root_); } else { diff --git a/Swiften/Parser/GenericStanzaParser.h b/Swiften/Parser/GenericStanzaParser.h index 7d16a0c..2686f2f 100644 --- a/Swiften/Parser/GenericStanzaParser.h +++ b/Swiften/Parser/GenericStanzaParser.h @@ -1,13 +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 -#include +#include #include #include @@ -21,18 +20,18 @@ namespace Swift { public: GenericStanzaParser(PayloadParserFactoryCollection* collection) : StanzaParser(collection) { - stanza_ = boost::make_shared(); + stanza_ = std::make_shared(); } - virtual boost::shared_ptr getElement() const { + virtual std::shared_ptr getElement() const { return stanza_; } - virtual boost::shared_ptr getStanzaGeneric() const { + virtual std::shared_ptr getStanzaGeneric() const { return stanza_; } private: - boost::shared_ptr stanza_; + std::shared_ptr stanza_; }; } diff --git a/Swiften/Parser/LibXMLParser.h b/Swiften/Parser/LibXMLParser.h index eb2a038..e63a628 100644 --- a/Swiften/Parser/LibXMLParser.h +++ b/Swiften/Parser/LibXMLParser.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include @@ -27,6 +28,6 @@ namespace Swift { static bool initialized; struct Private; - boost::shared_ptr p; + std::shared_ptr p; }; } diff --git a/Swiften/Parser/PayloadParser.h b/Swiften/Parser/PayloadParser.h index cb50061..a824922 100644 --- a/Swiften/Parser/PayloadParser.h +++ b/Swiften/Parser/PayloadParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -45,6 +45,6 @@ namespace Swift { /** * Retrieve a pointer to the payload. */ - virtual boost::shared_ptr getPayload() const = 0; + virtual std::shared_ptr getPayload() const = 0; }; } diff --git a/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.cpp b/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.cpp index d6fb6be..e4f8ab9 100644 --- a/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.cpp +++ b/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -16,7 +16,7 @@ namespace Swift { void CarbonsReceivedParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { if (level_ == PayloadLevel) { if (element == "forwarded") { - forwardedParser_ = boost::dynamic_pointer_cast(boost::make_shared(factories_)); + forwardedParser_ = std::dynamic_pointer_cast(std::make_shared(factories_)); } } if (forwardedParser_) { diff --git a/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.h b/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.h index 666f20b..6cc1f43 100644 --- a/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.h +++ b/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -29,7 +29,7 @@ namespace Swift { private: PayloadParserFactoryCollection* factories_; - boost::shared_ptr forwardedParser_; + std::shared_ptr forwardedParser_; int level_; }; } diff --git a/Swiften/Parser/PayloadParsers/CarbonsSentParser.cpp b/Swiften/Parser/PayloadParsers/CarbonsSentParser.cpp index e616211..f446042 100644 --- a/Swiften/Parser/PayloadParsers/CarbonsSentParser.cpp +++ b/Swiften/Parser/PayloadParsers/CarbonsSentParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -16,7 +16,7 @@ namespace Swift { void CarbonsSentParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { if (level_ == PayloadLevel) { if (element == "forwarded") { - forwardedParser_ = boost::dynamic_pointer_cast(boost::make_shared(factories_)); + forwardedParser_ = std::dynamic_pointer_cast(std::make_shared(factories_)); } } if (forwardedParser_) { diff --git a/Swiften/Parser/PayloadParsers/CarbonsSentParser.h b/Swiften/Parser/PayloadParsers/CarbonsSentParser.h index 9faf62d..d4e12ba 100644 --- a/Swiften/Parser/PayloadParsers/CarbonsSentParser.h +++ b/Swiften/Parser/PayloadParsers/CarbonsSentParser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -29,7 +29,7 @@ namespace Swift { private: PayloadParserFactoryCollection* factories_; - boost::shared_ptr forwardedParser_; + std::shared_ptr forwardedParser_; int level_; }; } diff --git a/Swiften/Parser/PayloadParsers/CommandParser.cpp b/Swiften/Parser/PayloadParsers/CommandParser.cpp index bdfeaec..cb6fc0a 100644 --- a/Swiften/Parser/PayloadParsers/CommandParser.cpp +++ b/Swiften/Parser/PayloadParsers/CommandParser.cpp @@ -89,7 +89,7 @@ void CommandParser::handleEndElement(const std::string& element, const std::stri if (level_ == FormOrNoteOrActionsLevel) { if (formParser_) { - Form::ref form(boost::dynamic_pointer_cast(formParser_->getPayload())); + Form::ref form(std::dynamic_pointer_cast(formParser_->getPayload())); assert(form); getPayloadInternal()->setForm(form); delete formParser_; diff --git a/Swiften/Parser/PayloadParsers/ErrorParser.h b/Swiften/Parser/PayloadParsers/ErrorParser.h index dd1aa95..10f5431 100644 --- a/Swiften/Parser/PayloadParsers/ErrorParser.h +++ b/Swiften/Parser/PayloadParsers/ErrorParser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -28,6 +28,6 @@ namespace Swift { PayloadParserFactoryCollection* factories; int level_; std::string currentText_; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/FormParser.cpp b/Swiften/Parser/PayloadParsers/FormParser.cpp index 3a2c880..4a0a26f 100644 --- a/Swiften/Parser/PayloadParsers/FormParser.cpp +++ b/Swiften/Parser/PayloadParsers/FormParser.cpp @@ -45,7 +45,7 @@ void FormParser::handleStartElement(const std::string& element, const std::strin parsingItem_ = true; } else if (element == "page") { - currentPage_ = boost::make_shared(); + currentPage_ = std::make_shared(); currentPage_->setLabel(attributes.getAttribute("label")); } } @@ -59,7 +59,7 @@ void FormParser::handleStartElement(const std::string& element, const std::strin } if (level_ >= PayloadLevel) { if (element == "field") { - currentField_ = boost::make_shared(); + currentField_ = std::make_shared(); std::string type = attributes.getAttribute("type"); FormField::Type fieldType = FormField::UnknownType; if (type == "boolean") { @@ -102,13 +102,13 @@ void FormParser::handleStartElement(const std::string& element, const std::strin } if (level_ > PayloadLevel) { if (element == "section") { - currentSection_ = boost::make_shared(); + currentSection_ = std::make_shared(); currentSection_->setLabel(attributes.getAttribute("label")); sectionStack_.push_back(currentSection_); currentSections_.push_back(currentSection_); } if (element == "reportedref") { - currentReportedRef_ = boost::make_shared(); + currentReportedRef_ = std::make_shared(); } if (element == "fieldref") { currentText_.clear(); @@ -121,7 +121,7 @@ void FormParser::handleStartElement(const std::string& element, const std::strin } if (element == "text") { currentText_.clear(); - currentTextElement_ = boost::make_shared(); + currentTextElement_ = std::make_shared(); } } ++level_; @@ -191,14 +191,14 @@ void FormParser::handleEndElement(const std::string& element, const std::string& } else { if (currentPages_.size() > 0) { - foreach (boost::shared_ptr page, currentPages_) { + foreach (std::shared_ptr page, currentPages_) { foreach (std::string pageRef, page->getFieldRefs()) { if (pageRef == currentField_->getName()) { page->addField(currentField_); } } } - foreach (boost::shared_ptr section, currentSections_) { + foreach (std::shared_ptr section, currentSections_) { foreach (std::string sectionRef, section->getFieldRefs()) { if (sectionRef == currentField_->getName()) { section->addField(currentField_); diff --git a/Swiften/Parser/PayloadParsers/FormParser.h b/Swiften/Parser/PayloadParsers/FormParser.h index 81032ee..e1491b1 100644 --- a/Swiften/Parser/PayloadParsers/FormParser.h +++ b/Swiften/Parser/PayloadParsers/FormParser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -39,8 +39,8 @@ namespace Swift { FormReportedRef::ref currentReportedRef_; FormPage::page currentPage_; FormSection::section currentSection_; - std::vector > currentPages_; - std::vector > sectionStack_; - std::vector > currentSections_; + std::vector > currentPages_; + std::vector > sectionStack_; + std::vector > currentSections_; }; } diff --git a/Swiften/Parser/PayloadParsers/ForwardedParser.cpp b/Swiften/Parser/PayloadParsers/ForwardedParser.cpp index 35d20a9..72a665a 100644 --- a/Swiften/Parser/PayloadParsers/ForwardedParser.cpp +++ b/Swiften/Parser/PayloadParsers/ForwardedParser.cpp @@ -25,13 +25,13 @@ ForwardedParser::ForwardedParser(PayloadParserFactoryCollection* factories) : fa void ForwardedParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { if (level_ == PayloadLevel) { if (element == "iq" && ns == "jabber:client") { /* begin parsing a nested stanza? */ - childParser_ = boost::dynamic_pointer_cast(boost::make_shared(factories_)); + childParser_ = std::dynamic_pointer_cast(std::make_shared(factories_)); } else if (element == "message" && ns == "jabber:client") { - childParser_ = boost::dynamic_pointer_cast(boost::make_shared(factories_)); + childParser_ = std::dynamic_pointer_cast(std::make_shared(factories_)); } else if (element == "presence" && ns == "jabber:client") { - childParser_ = boost::dynamic_pointer_cast(boost::make_shared(factories_)); + childParser_ = std::dynamic_pointer_cast(std::make_shared(factories_)); } else if (element == "delay" && ns == "urn:xmpp:delay") { /* nested delay payload */ - delayParser_ = boost::make_shared(); + delayParser_ = std::make_shared(); } } if (childParser_) { /* parsing a nested stanza? */ @@ -58,7 +58,7 @@ void ForwardedParser::handleEndElement(const std::string& element, const std::st } if (delayParser_ && level_ == PayloadLevel) { /* done parsing nested delay payload */ - getPayloadInternal()->setDelay(boost::dynamic_pointer_cast(delayParser_->getPayload())); + getPayloadInternal()->setDelay(std::dynamic_pointer_cast(delayParser_->getPayload())); delayParser_.reset(); } } diff --git a/Swiften/Parser/PayloadParsers/ForwardedParser.h b/Swiften/Parser/PayloadParsers/ForwardedParser.h index 70eecdf..f91fda5 100644 --- a/Swiften/Parser/PayloadParsers/ForwardedParser.h +++ b/Swiften/Parser/PayloadParsers/ForwardedParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -33,8 +33,8 @@ namespace Swift { private: PayloadParserFactoryCollection* factories_; - boost::shared_ptr childParser_; - boost::shared_ptr delayParser_; + std::shared_ptr childParser_; + std::shared_ptr delayParser_; int level_; }; } diff --git a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp index d59d9a0..a231397 100644 --- a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp +++ b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp @@ -89,87 +89,85 @@ #include #include -using namespace boost; - namespace Swift { FullPayloadParserFactoryCollection::FullPayloadParserFactoryCollection() { - factories_.push_back(boost::make_shared >("", "http://jabber.org/protocol/ibb")); - factories_.push_back(boost::make_shared >("show")); - factories_.push_back(boost::make_shared >("status")); - factories_.push_back(boost::make_shared >("replace", "http://swift.im/protocol/replace")); - factories_.push_back(boost::make_shared >("replace", "urn:xmpp:message-correct:0")); - factories_.push_back(boost::make_shared >("query", "jabber:iq:last")); - factories_.push_back(boost::make_shared >("body")); - factories_.push_back(boost::make_shared >("subject")); - factories_.push_back(boost::make_shared >("thread")); - factories_.push_back(boost::make_shared >("priority")); - factories_.push_back(boost::make_shared(this)); - factories_.push_back(boost::make_shared >("delay", "urn:xmpp:delay")); - factories_.push_back(boost::make_shared >("query", "jabber:iq:version")); - factories_.push_back(boost::make_shared >("storage", "storage:bookmarks")); - factories_.push_back(boost::make_shared >("x", "http://jabber.org/protocol/rosterx")); - factories_.push_back(boost::make_shared >("query", "jabber:iq:roster")); - factories_.push_back(boost::make_shared >("query", "http://jabber.org/protocol/disco#info")); - factories_.push_back(boost::make_shared >("query", "http://jabber.org/protocol/disco#items")); - factories_.push_back(boost::make_shared >("c", "http://jabber.org/protocol/caps")); - factories_.push_back(boost::make_shared >("bind", "urn:ietf:params:xml:ns:xmpp-bind")); - factories_.push_back(boost::make_shared >("session", "urn:ietf:params:xml:ns:xmpp-session")); - factories_.push_back(boost::make_shared > >("block", "urn:xmpp:blocking")); - factories_.push_back(boost::make_shared > >("blocklist", "urn:xmpp:blocking")); - factories_.push_back(boost::make_shared > >("unblock", "urn:xmpp:blocking")); - factories_.push_back(boost::make_shared()); - factories_.push_back(boost::make_shared >("catalog", "urn:xmpp:sec-label:catalog:2")); - factories_.push_back(boost::make_shared()); - factories_.push_back(boost::make_shared >("command", "http://jabber.org/protocol/commands")); - factories_.push_back(boost::make_shared >("query", "jabber:iq:register")); - factories_.push_back(boost::make_shared >("query", "jabber:iq:search")); - factories_.push_back(boost::make_shared >("si", "http://jabber.org/protocol/si")); - factories_.push_back(boost::make_shared >("query", "http://jabber.org/protocol/bytestreams")); - factories_.push_back(boost::make_shared >("x", "vcard-temp:x:update")); - factories_.push_back(boost::make_shared >("vCard", "vcard-temp")); - factories_.push_back(boost::make_shared(this)); - factories_.push_back(boost::make_shared()); - factories_.push_back(boost::make_shared(this)); - factories_.push_back(boost::make_shared(this)); - factories_.push_back(boost::make_shared >("x", "jabber:x:conference")); - factories_.push_back(boost::make_shared >("query", "http://jabber.org/protocol/muc#admin")); - factories_.push_back(boost::make_shared >("destroy", "http://jabber.org/protocol/muc#user")); - factories_.push_back(boost::make_shared >("destroy", "http://jabber.org/protocol/muc#owner")); - factories_.push_back(boost::make_shared >("nick", "http://jabber.org/protocol/nick")); - factories_.push_back(boost::make_shared(this)); - factories_.push_back(boost::make_shared >("reason", "urn:xmpp:jingle:1")); - factories_.push_back(boost::make_shared(this)); - factories_.push_back(boost::make_shared >("transport", "urn:xmpp:jingle:transports:ibb:1")); - factories_.push_back(boost::make_shared >("transport", "urn:xmpp:jingle:transports:s5b:1")); - factories_.push_back(boost::make_shared(this)); - factories_.push_back(boost::make_shared >("file", "http://jabber.org/protocol/si/profile/file-transfer")); - factories_.push_back(boost::make_shared >("file", "urn:xmpp:jingle:apps:file-transfer:4")); - factories_.push_back(boost::make_shared >("checksum")); - factories_.push_back(boost::make_shared >("query", "http://jabber.org/protocol/bytestreams")); - factories_.push_back(boost::make_shared >("wb", "http://swift.im/whiteboard")); - factories_.push_back(boost::make_shared >("geoloc", "http://jabber.org/protocol/geoloc")); - factories_.push_back(boost::make_shared >("tune", "http://jabber.org/protocol/tune")); - factories_.push_back(boost::make_shared()); - factories_.push_back(boost::make_shared()); - factories_.push_back(boost::make_shared >("idle", "urn:xmpp:idle:1")); - factories_.push_back(boost::make_shared >("pubsub", "http://jabber.org/protocol/pubsub", this)); - factories_.push_back(boost::make_shared >("pubsub", "http://jabber.org/protocol/pubsub#owner", this)); - factories_.push_back(boost::make_shared >("event", "http://jabber.org/protocol/pubsub#event", this)); - factories_.push_back(boost::make_shared()); - factories_.push_back(boost::make_shared >("set", "http://jabber.org/protocol/rsm")); - factories_.push_back(boost::make_shared >("forwarded", "urn:xmpp:forward:0", this)); - factories_.push_back(boost::make_shared >("result", "urn:xmpp:mam:0", this)); - factories_.push_back(boost::make_shared >("query", "urn:xmpp:mam:0")); - factories_.push_back(boost::make_shared >("fin", "urn:xmpp:mam:0")); - factories_.push_back(boost::make_shared >("delegate", "http://isode.com/iq_delegation", this)); - factories_.push_back(boost::make_shared >("enable", "urn:xmpp:carbons:2")); - factories_.push_back(boost::make_shared >("disable", "urn:xmpp:carbons:2")); - factories_.push_back(boost::make_shared >("received", "urn:xmpp:carbons:2", this)); - factories_.push_back(boost::make_shared >("sent", "urn:xmpp:carbons:2", this)); - factories_.push_back(boost::make_shared >("private", "urn:xmpp:carbons:2")); + factories_.push_back(std::make_shared >("", "http://jabber.org/protocol/ibb")); + factories_.push_back(std::make_shared >("show")); + factories_.push_back(std::make_shared >("status")); + factories_.push_back(std::make_shared >("replace", "http://swift.im/protocol/replace")); + factories_.push_back(std::make_shared >("replace", "urn:xmpp:message-correct:0")); + factories_.push_back(std::make_shared >("query", "jabber:iq:last")); + factories_.push_back(std::make_shared >("body")); + factories_.push_back(std::make_shared >("subject")); + factories_.push_back(std::make_shared >("thread")); + factories_.push_back(std::make_shared >("priority")); + factories_.push_back(std::make_shared(this)); + factories_.push_back(std::make_shared >("delay", "urn:xmpp:delay")); + factories_.push_back(std::make_shared >("query", "jabber:iq:version")); + factories_.push_back(std::make_shared >("storage", "storage:bookmarks")); + factories_.push_back(std::make_shared >("x", "http://jabber.org/protocol/rosterx")); + factories_.push_back(std::make_shared >("query", "jabber:iq:roster")); + factories_.push_back(std::make_shared >("query", "http://jabber.org/protocol/disco#info")); + factories_.push_back(std::make_shared >("query", "http://jabber.org/protocol/disco#items")); + factories_.push_back(std::make_shared >("c", "http://jabber.org/protocol/caps")); + factories_.push_back(std::make_shared >("bind", "urn:ietf:params:xml:ns:xmpp-bind")); + factories_.push_back(std::make_shared >("session", "urn:ietf:params:xml:ns:xmpp-session")); + factories_.push_back(std::make_shared > >("block", "urn:xmpp:blocking")); + factories_.push_back(std::make_shared > >("blocklist", "urn:xmpp:blocking")); + factories_.push_back(std::make_shared > >("unblock", "urn:xmpp:blocking")); + factories_.push_back(std::make_shared()); + factories_.push_back(std::make_shared >("catalog", "urn:xmpp:sec-label:catalog:2")); + factories_.push_back(std::make_shared()); + factories_.push_back(std::make_shared >("command", "http://jabber.org/protocol/commands")); + factories_.push_back(std::make_shared >("query", "jabber:iq:register")); + factories_.push_back(std::make_shared >("query", "jabber:iq:search")); + factories_.push_back(std::make_shared >("si", "http://jabber.org/protocol/si")); + factories_.push_back(std::make_shared >("query", "http://jabber.org/protocol/bytestreams")); + factories_.push_back(std::make_shared >("x", "vcard-temp:x:update")); + factories_.push_back(std::make_shared >("vCard", "vcard-temp")); + factories_.push_back(std::make_shared(this)); + factories_.push_back(std::make_shared()); + factories_.push_back(std::make_shared(this)); + factories_.push_back(std::make_shared(this)); + factories_.push_back(std::make_shared >("x", "jabber:x:conference")); + factories_.push_back(std::make_shared >("query", "http://jabber.org/protocol/muc#admin")); + factories_.push_back(std::make_shared >("destroy", "http://jabber.org/protocol/muc#user")); + factories_.push_back(std::make_shared >("destroy", "http://jabber.org/protocol/muc#owner")); + factories_.push_back(std::make_shared >("nick", "http://jabber.org/protocol/nick")); + factories_.push_back(std::make_shared(this)); + factories_.push_back(std::make_shared >("reason", "urn:xmpp:jingle:1")); + factories_.push_back(std::make_shared(this)); + factories_.push_back(std::make_shared >("transport", "urn:xmpp:jingle:transports:ibb:1")); + factories_.push_back(std::make_shared >("transport", "urn:xmpp:jingle:transports:s5b:1")); + factories_.push_back(std::make_shared(this)); + factories_.push_back(std::make_shared >("file", "http://jabber.org/protocol/si/profile/file-transfer")); + factories_.push_back(std::make_shared >("file", "urn:xmpp:jingle:apps:file-transfer:4")); + factories_.push_back(std::make_shared >("checksum")); + factories_.push_back(std::make_shared >("query", "http://jabber.org/protocol/bytestreams")); + factories_.push_back(std::make_shared >("wb", "http://swift.im/whiteboard")); + factories_.push_back(std::make_shared >("geoloc", "http://jabber.org/protocol/geoloc")); + factories_.push_back(std::make_shared >("tune", "http://jabber.org/protocol/tune")); + factories_.push_back(std::make_shared()); + factories_.push_back(std::make_shared()); + factories_.push_back(std::make_shared >("idle", "urn:xmpp:idle:1")); + factories_.push_back(std::make_shared >("pubsub", "http://jabber.org/protocol/pubsub", this)); + factories_.push_back(std::make_shared >("pubsub", "http://jabber.org/protocol/pubsub#owner", this)); + factories_.push_back(std::make_shared >("event", "http://jabber.org/protocol/pubsub#event", this)); + factories_.push_back(std::make_shared()); + factories_.push_back(std::make_shared >("set", "http://jabber.org/protocol/rsm")); + factories_.push_back(std::make_shared >("forwarded", "urn:xmpp:forward:0", this)); + factories_.push_back(std::make_shared >("result", "urn:xmpp:mam:0", this)); + factories_.push_back(std::make_shared >("query", "urn:xmpp:mam:0")); + factories_.push_back(std::make_shared >("fin", "urn:xmpp:mam:0")); + factories_.push_back(std::make_shared >("delegate", "http://isode.com/iq_delegation", this)); + factories_.push_back(std::make_shared >("enable", "urn:xmpp:carbons:2")); + factories_.push_back(std::make_shared >("disable", "urn:xmpp:carbons:2")); + factories_.push_back(std::make_shared >("received", "urn:xmpp:carbons:2", this)); + factories_.push_back(std::make_shared >("sent", "urn:xmpp:carbons:2", this)); + factories_.push_back(std::make_shared >("private", "urn:xmpp:carbons:2")); - foreach(shared_ptr factory, factories_) { + foreach(std::shared_ptr factory, factories_) { addFactory(factory.get()); } defaultFactory_ = new RawXMLPayloadParserFactory(); @@ -179,7 +177,7 @@ FullPayloadParserFactoryCollection::FullPayloadParserFactoryCollection() { FullPayloadParserFactoryCollection::~FullPayloadParserFactoryCollection() { setDefaultFactory(nullptr); delete defaultFactory_; - foreach(shared_ptr factory, factories_) { + foreach(std::shared_ptr factory, factories_) { removeFactory(factory.get()); } } diff --git a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h index 210e85e..e59a6e0 100644 --- a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h +++ b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -21,7 +20,7 @@ namespace Swift { ~FullPayloadParserFactoryCollection(); private: - std::vector< boost::shared_ptr > factories_; + std::vector< std::shared_ptr > factories_; PayloadParserFactory* defaultFactory_; }; } diff --git a/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp b/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp index 6bdd517..ddcd425 100644 --- a/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp +++ b/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -46,7 +46,7 @@ void IsodeIQDelegationParser::handleEndElement(const std::string& element, const } if (level == 1) { - getPayloadInternal()->setForward(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->setForward(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); currentPayloadParser.reset(); } } diff --git a/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.h b/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.h index cf86a1a..eaedd27 100644 --- a/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.h +++ b/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.cpp b/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.cpp index 30404f3..3a01676 100644 --- a/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.cpp +++ b/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.cpp @@ -59,12 +59,12 @@ namespace Swift { } if (level == 1) { - boost::shared_ptr transport = boost::dynamic_pointer_cast(currentPayloadParser->getPayload()); + std::shared_ptr transport = std::dynamic_pointer_cast(currentPayloadParser->getPayload()); if (transport) { getPayloadInternal()->addTransport(transport); } - boost::shared_ptr description = boost::dynamic_pointer_cast(currentPayloadParser->getPayload()); + std::shared_ptr description = std::dynamic_pointer_cast(currentPayloadParser->getPayload()); if (description) { getPayloadInternal()->addDescription(description); } diff --git a/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.h b/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.h index eaa8ff6..fde07cb 100644 --- a/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.h +++ b/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -31,7 +31,7 @@ class SWIFTEN_API JingleContentPayloadParser : public GenericPayloadParser currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.cpp b/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.cpp index 32a6e4c..1e433a6 100644 --- a/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.cpp +++ b/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.cpp @@ -46,7 +46,7 @@ void JingleFileTransferDescriptionParser::handleEndElement(const std::string& el } if (level == 0) { - boost::shared_ptr info = boost::dynamic_pointer_cast(currentPayloadParser->getPayload()); + std::shared_ptr info = std::dynamic_pointer_cast(currentPayloadParser->getPayload()); if (info) { getPayloadInternal()->setFileInfo(*info); } diff --git a/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.h b/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.h index c7f80e1..b148d9b 100644 --- a/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.h +++ b/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2014-2015 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -32,7 +32,7 @@ class SWIFTEN_API JingleFileTransferDescriptionParser : public GenericPayloadPar private: PayloadParserFactoryCollection* factories; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.cpp b/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.cpp index a890a99..4adf3bd 100644 --- a/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.cpp +++ b/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.cpp @@ -12,8 +12,9 @@ #include +#include + #include -#include #include #include @@ -26,7 +27,7 @@ JingleFileTransferHashParser::JingleFileTransferHashParser() : level(0) { void JingleFileTransferHashParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { if (level == 1 && element == "file") { - currentPayloadParser = boost::make_shared(); + currentPayloadParser = std::make_shared(); } if (level >= 1 && currentPayloadParser) { @@ -42,7 +43,7 @@ void JingleFileTransferHashParser::handleEndElement(const std::string& element, } if (level == 1) { - boost::shared_ptr info = boost::dynamic_pointer_cast(currentPayloadParser->getPayload()); + std::shared_ptr info = std::dynamic_pointer_cast(currentPayloadParser->getPayload()); if (info) { getPayloadInternal()->setFileInfo(*info); } diff --git a/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.h b/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.h index 8a28d5a..1b47921 100644 --- a/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.h +++ b/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2014-2015 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -28,7 +28,7 @@ public: private: int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/JingleParser.cpp b/Swiften/Parser/PayloadParsers/JingleParser.cpp index 48507af..a88a5b2 100644 --- a/Swiften/Parser/PayloadParsers/JingleParser.cpp +++ b/Swiften/Parser/PayloadParsers/JingleParser.cpp @@ -57,17 +57,17 @@ namespace Swift { } if (level == 1) { - boost::shared_ptr reason = boost::dynamic_pointer_cast(currentPayloadParser->getPayload()); + std::shared_ptr reason = std::dynamic_pointer_cast(currentPayloadParser->getPayload()); if (reason) { getPayloadInternal()->setReason(*reason); } - boost::shared_ptr payload = boost::dynamic_pointer_cast(currentPayloadParser->getPayload()); + std::shared_ptr payload = std::dynamic_pointer_cast(currentPayloadParser->getPayload()); if (payload) { getPayloadInternal()->addContent(payload); } - boost::shared_ptr hash = boost::dynamic_pointer_cast(currentPayloadParser->getPayload()); + std::shared_ptr hash = std::dynamic_pointer_cast(currentPayloadParser->getPayload()); if (hash) { getPayloadInternal()->addPayload(hash); } diff --git a/Swiften/Parser/PayloadParsers/JingleParser.h b/Swiften/Parser/PayloadParsers/JingleParser.h index 28850e2..1dcc9e7 100644 --- a/Swiften/Parser/PayloadParsers/JingleParser.h +++ b/Swiften/Parser/PayloadParsers/JingleParser.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -33,7 +33,7 @@ class SWIFTEN_API JingleParser : public GenericPayloadParser { private: PayloadParserFactoryCollection* factories; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/MAMFinParser.cpp b/Swiften/Parser/PayloadParsers/MAMFinParser.cpp index a29a7c4..88dd571 100644 --- a/Swiften/Parser/PayloadParsers/MAMFinParser.cpp +++ b/Swiften/Parser/PayloadParsers/MAMFinParser.cpp @@ -30,7 +30,7 @@ void MAMFinParser::handleStartElement(const std::string& element, const std::str } else if (level_ == PayloadLevel) { if (element == "set" && ns == "http://jabber.org/protocol/rsm") { - resultSetParser_ = boost::make_shared(); + resultSetParser_ = std::make_shared(); } } @@ -49,7 +49,7 @@ void MAMFinParser::handleEndElement(const std::string& element, const std::strin } if (resultSetParser_ && level_ == PayloadLevel) { /* done parsing nested ResultSet */ - getPayloadInternal()->setResultSet(boost::dynamic_pointer_cast(resultSetParser_->getPayload())); + getPayloadInternal()->setResultSet(std::dynamic_pointer_cast(resultSetParser_->getPayload())); resultSetParser_.reset(); } } diff --git a/Swiften/Parser/PayloadParsers/MAMFinParser.h b/Swiften/Parser/PayloadParsers/MAMFinParser.h index 2e805ad..f08231e 100644 --- a/Swiften/Parser/PayloadParsers/MAMFinParser.h +++ b/Swiften/Parser/PayloadParsers/MAMFinParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -30,7 +30,7 @@ namespace Swift { }; private: - boost::shared_ptr resultSetParser_; + std::shared_ptr resultSetParser_; int level_; }; } diff --git a/Swiften/Parser/PayloadParsers/MAMQueryParser.cpp b/Swiften/Parser/PayloadParsers/MAMQueryParser.cpp index 41fbbb7..4919d22 100644 --- a/Swiften/Parser/PayloadParsers/MAMQueryParser.cpp +++ b/Swiften/Parser/PayloadParsers/MAMQueryParser.cpp @@ -29,9 +29,9 @@ void MAMQueryParser::handleStartElement(const std::string& element, const std::s } } else if (level_ == PayloadLevel) { if (element == "x" && ns == "jabber:x:data") { - formParser_ = boost::make_shared(); + formParser_ = std::make_shared(); } else if (element == "set" && ns == "http://jabber.org/protocol/rsm") { - resultSetParser_ = boost::make_shared(); + resultSetParser_ = std::make_shared(); } } @@ -54,7 +54,7 @@ void MAMQueryParser::handleEndElement(const std::string& element, const std::str } if (formParser_ && level_ == PayloadLevel) { /* done parsing nested Form */ - getPayloadInternal()->setForm(boost::dynamic_pointer_cast(formParser_->getPayload())); + getPayloadInternal()->setForm(std::dynamic_pointer_cast(formParser_->getPayload())); formParser_.reset(); } @@ -63,7 +63,7 @@ void MAMQueryParser::handleEndElement(const std::string& element, const std::str } if (resultSetParser_ && level_ == PayloadLevel) { /* done parsing nested ResultSet */ - getPayloadInternal()->setResultSet(boost::dynamic_pointer_cast(resultSetParser_->getPayload())); + getPayloadInternal()->setResultSet(std::dynamic_pointer_cast(resultSetParser_->getPayload())); resultSetParser_.reset(); } } diff --git a/Swiften/Parser/PayloadParsers/MAMQueryParser.h b/Swiften/Parser/PayloadParsers/MAMQueryParser.h index 4f5bd47..7e4b58a 100644 --- a/Swiften/Parser/PayloadParsers/MAMQueryParser.h +++ b/Swiften/Parser/PayloadParsers/MAMQueryParser.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -33,8 +32,8 @@ namespace Swift { }; private: - boost::shared_ptr formParser_; - boost::shared_ptr resultSetParser_; + std::shared_ptr formParser_; + std::shared_ptr resultSetParser_; int level_; }; } diff --git a/Swiften/Parser/PayloadParsers/MAMResultParser.cpp b/Swiften/Parser/PayloadParsers/MAMResultParser.cpp index e39ed94..b810b87 100644 --- a/Swiften/Parser/PayloadParsers/MAMResultParser.cpp +++ b/Swiften/Parser/PayloadParsers/MAMResultParser.cpp @@ -28,7 +28,7 @@ void MAMResultParser::handleStartElement(const std::string& element, const std:: } } else if (level_ == PayloadLevel) { if (element == "forwarded" && ns == "urn:xmpp:forward:0") { - payloadParser_ = boost::make_shared(factories_); + payloadParser_ = std::make_shared(factories_); } } @@ -47,7 +47,7 @@ void MAMResultParser::handleEndElement(const std::string& element, const std::st } if (payloadParser_ && level_ == PayloadLevel) { /* done parsing nested stanza */ - getPayloadInternal()->setPayload(boost::dynamic_pointer_cast(payloadParser_->getPayload())); + getPayloadInternal()->setPayload(std::dynamic_pointer_cast(payloadParser_->getPayload())); payloadParser_.reset(); } } diff --git a/Swiften/Parser/PayloadParsers/MAMResultParser.h b/Swiften/Parser/PayloadParsers/MAMResultParser.h index 5177f8b..e68e365 100644 --- a/Swiften/Parser/PayloadParsers/MAMResultParser.h +++ b/Swiften/Parser/PayloadParsers/MAMResultParser.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -33,7 +32,7 @@ namespace Swift { }; private: - boost::shared_ptr payloadParser_; + std::shared_ptr payloadParser_; PayloadParserFactoryCollection* factories_; int level_; }; diff --git a/Swiften/Parser/PayloadParsers/MUCInvitationPayloadParser.cpp b/Swiften/Parser/PayloadParsers/MUCInvitationPayloadParser.cpp index 20e5f2b..14d6d16 100644 --- a/Swiften/Parser/PayloadParsers/MUCInvitationPayloadParser.cpp +++ b/Swiften/Parser/PayloadParsers/MUCInvitationPayloadParser.cpp @@ -18,7 +18,7 @@ void MUCInvitationPayloadParser::handleTree(ParserElement::ref root) { invite->setReason(root->getAttributes().getAttribute("reason")); invite->setThread(root->getAttributes().getAttribute("thread")); ParserElement::ref impromptuNode = root->getChild("impromptu", "http://swift.im/impromptu"); - invite->setIsImpromptu(!boost::dynamic_pointer_cast(impromptuNode)); + invite->setIsImpromptu(!std::dynamic_pointer_cast(impromptuNode)); } } diff --git a/Swiften/Parser/PayloadParsers/MUCOwnerPayloadParser.h b/Swiften/Parser/PayloadParsers/MUCOwnerPayloadParser.h index 6502512..4c1f048 100644 --- a/Swiften/Parser/PayloadParsers/MUCOwnerPayloadParser.h +++ b/Swiften/Parser/PayloadParsers/MUCOwnerPayloadParser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -27,6 +27,6 @@ namespace Swift { private: PayloadParserFactoryCollection* factories; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PrivateStorageParser.h b/Swiften/Parser/PayloadParsers/PrivateStorageParser.h index 761a019..c1d695c 100644 --- a/Swiften/Parser/PayloadParsers/PrivateStorageParser.h +++ b/Swiften/Parser/PayloadParsers/PrivateStorageParser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -27,6 +27,6 @@ namespace Swift { private: PayloadParserFactoryCollection* factories; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubAffiliationParser.h b/Swiften/Parser/PayloadParsers/PubSubAffiliationParser.h index 1d3f4fd..6c38f37 100644 --- a/Swiften/Parser/PayloadParsers/PubSubAffiliationParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubAffiliationParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.cpp b/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.cpp index 8a11553..9c44f31 100644 --- a/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -32,7 +32,7 @@ void PubSubAffiliationsParser::handleStartElement(const std::string& element, co if (level == 1) { if (element == "affiliation" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -51,7 +51,7 @@ void PubSubAffiliationsParser::handleEndElement(const std::string& element, cons if (level == 1) { if (element == "affiliation" && ns == "http://jabber.org/protocol/pubsub") { - getPayloadInternal()->addAffiliation(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->addAffiliation(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.h b/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.h index a26942f..2f80dbd 100644 --- a/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubConfigureParser.cpp b/Swiften/Parser/PayloadParsers/PubSubConfigureParser.cpp index f3af12f..0abfe0b 100644 --- a/Swiften/Parser/PayloadParsers/PubSubConfigureParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubConfigureParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -28,7 +28,7 @@ void PubSubConfigureParser::handleStartElement(const std::string& element, const if (level == 1) { if (element == "x" && ns == "jabber:x:data") { - currentPayloadParser = boost::make_shared(); + currentPayloadParser = std::make_shared(); } } @@ -47,7 +47,7 @@ void PubSubConfigureParser::handleEndElement(const std::string& element, const s if (level == 1) { if (element == "x" && ns == "jabber:x:data") { - getPayloadInternal()->setData(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->setData(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubConfigureParser.h b/Swiften/Parser/PayloadParsers/PubSubConfigureParser.h index 33a3da5..16f1cd9 100644 --- a/Swiften/Parser/PayloadParsers/PubSubConfigureParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubConfigureParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubCreateParser.h b/Swiften/Parser/PayloadParsers/PubSubCreateParser.h index 3f277ed..fa1f98c 100644 --- a/Swiften/Parser/PayloadParsers/PubSubCreateParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubCreateParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubDefaultParser.h b/Swiften/Parser/PayloadParsers/PubSubDefaultParser.h index b0f0e25..e4d4834 100644 --- a/Swiften/Parser/PayloadParsers/PubSubDefaultParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubDefaultParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubErrorParser.h b/Swiften/Parser/PayloadParsers/PubSubErrorParser.h index 749fb1a..adc36e9 100644 --- a/Swiften/Parser/PayloadParsers/PubSubErrorParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubErrorParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include diff --git a/Swiften/Parser/PayloadParsers/PubSubEventAssociateParser.h b/Swiften/Parser/PayloadParsers/PubSubEventAssociateParser.h index c2cc9f6..5e1fc45 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventAssociateParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubEventAssociateParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.cpp b/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.cpp index bb167e3..bfa9cf5 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -33,10 +33,10 @@ void PubSubEventCollectionParser::handleStartElement(const std::string& element, if (level == 1) { if (element == "disassociate" && ns == "http://jabber.org/protocol/pubsub#event") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "associate" && ns == "http://jabber.org/protocol/pubsub#event") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -55,10 +55,10 @@ void PubSubEventCollectionParser::handleEndElement(const std::string& element, c if (level == 1) { if (element == "disassociate" && ns == "http://jabber.org/protocol/pubsub#event") { - getPayloadInternal()->setDisassociate(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->setDisassociate(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } if (element == "associate" && ns == "http://jabber.org/protocol/pubsub#event") { - getPayloadInternal()->setAssociate(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->setAssociate(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.h b/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.h index a2b1663..ffdafcf 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.cpp b/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.cpp index d118ab8..73112da 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -32,7 +32,7 @@ void PubSubEventConfigurationParser::handleStartElement(const std::string& eleme if (level == 1) { if (element == "x" && ns == "jabber:x:data") { - currentPayloadParser = boost::make_shared(); + currentPayloadParser = std::make_shared(); } } @@ -51,7 +51,7 @@ void PubSubEventConfigurationParser::handleEndElement(const std::string& element if (level == 1) { if (element == "x" && ns == "jabber:x:data") { - getPayloadInternal()->setData(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->setData(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.h b/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.h index e3fcab6..a79ee07 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.cpp b/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.cpp index 167a682..da308db 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -32,7 +32,7 @@ void PubSubEventDeleteParser::handleStartElement(const std::string& element, con if (level == 1) { if (element == "redirect" && ns == "http://jabber.org/protocol/pubsub#event") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -51,7 +51,7 @@ void PubSubEventDeleteParser::handleEndElement(const std::string& element, const if (level == 1) { if (element == "redirect" && ns == "http://jabber.org/protocol/pubsub#event") { - getPayloadInternal()->setRedirects(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->setRedirects(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.h b/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.h index 24d6b6b..270430e 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventDisassociateParser.h b/Swiften/Parser/PayloadParsers/PubSubEventDisassociateParser.h index 6835602..9088359 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventDisassociateParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubEventDisassociateParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventItemParser.h b/Swiften/Parser/PayloadParsers/PubSubEventItemParser.h index 4b34a26..bd2e72e 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventItemParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubEventItemParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.cpp b/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.cpp index 90d3fe8..0264275 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -33,10 +33,10 @@ void PubSubEventItemsParser::handleStartElement(const std::string& element, cons if (level == 1) { if (element == "item" && ns == "http://jabber.org/protocol/pubsub#event") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "retract" && ns == "http://jabber.org/protocol/pubsub#event") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -55,10 +55,10 @@ void PubSubEventItemsParser::handleEndElement(const std::string& element, const if (level == 1) { if (element == "item" && ns == "http://jabber.org/protocol/pubsub#event") { - getPayloadInternal()->addItem(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->addItem(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } if (element == "retract" && ns == "http://jabber.org/protocol/pubsub#event") { - getPayloadInternal()->addRetract(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->addRetract(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.h b/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.h index 6cb0148..34b3669 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventParser.cpp b/Swiften/Parser/PayloadParsers/PubSubEventParser.cpp index ae0439c..7677369 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubEventParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -33,22 +33,22 @@ void PubSubEventParser::handleStartElement(const std::string& element, const std if (level == 1) { if (element == "items" && ns == "http://jabber.org/protocol/pubsub#event") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "collection" && ns == "http://jabber.org/protocol/pubsub#event") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "purge" && ns == "http://jabber.org/protocol/pubsub#event") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "configuration" && ns == "http://jabber.org/protocol/pubsub#event") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "delete" && ns == "http://jabber.org/protocol/pubsub#event") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "subscription" && ns == "http://jabber.org/protocol/pubsub#event") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -67,7 +67,7 @@ void PubSubEventParser::handleEndElement(const std::string& element, const std:: if (level == 1) { if (currentPayloadParser) { - getPayloadInternal()->setPayload(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->setPayload(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventParser.h b/Swiften/Parser/PayloadParsers/PubSubEventParser.h index a4fc5a6..3b231b0 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubEventParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventPurgeParser.h b/Swiften/Parser/PayloadParsers/PubSubEventPurgeParser.h index 7afc754..e1b1d05 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventPurgeParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubEventPurgeParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventRedirectParser.h b/Swiften/Parser/PayloadParsers/PubSubEventRedirectParser.h index ecdeca5..63f0f98 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventRedirectParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubEventRedirectParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventRetractParser.h b/Swiften/Parser/PayloadParsers/PubSubEventRetractParser.h index 8bc6a9c..eacaac2 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventRetractParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubEventRetractParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubEventSubscriptionParser.h b/Swiften/Parser/PayloadParsers/PubSubEventSubscriptionParser.h index b43e64a..b1d065a 100644 --- a/Swiften/Parser/PayloadParsers/PubSubEventSubscriptionParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubEventSubscriptionParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubItemParser.h b/Swiften/Parser/PayloadParsers/PubSubItemParser.h index 39d24bc..c6e4ccf 100644 --- a/Swiften/Parser/PayloadParsers/PubSubItemParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubItemParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubItemsParser.cpp b/Swiften/Parser/PayloadParsers/PubSubItemsParser.cpp index 643eb85..7cbeb70 100644 --- a/Swiften/Parser/PayloadParsers/PubSubItemsParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubItemsParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -42,7 +42,7 @@ void PubSubItemsParser::handleStartElement(const std::string& element, const std if (level == 1) { if (element == "item" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -61,7 +61,7 @@ void PubSubItemsParser::handleEndElement(const std::string& element, const std:: if (level == 1) { if (element == "item" && ns == "http://jabber.org/protocol/pubsub") { - getPayloadInternal()->addItem(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->addItem(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubItemsParser.h b/Swiften/Parser/PayloadParsers/PubSubItemsParser.h index 84c8f79..ad6e746 100644 --- a/Swiften/Parser/PayloadParsers/PubSubItemsParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubItemsParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubOptionsParser.cpp b/Swiften/Parser/PayloadParsers/PubSubOptionsParser.cpp index 2683ae6..04d11a1 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOptionsParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubOptionsParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -40,7 +40,7 @@ void PubSubOptionsParser::handleStartElement(const std::string& element, const s if (level == 1) { if (element == "x" && ns == "jabber:x:data") { - currentPayloadParser = boost::make_shared(); + currentPayloadParser = std::make_shared(); } } @@ -59,7 +59,7 @@ void PubSubOptionsParser::handleEndElement(const std::string& element, const std if (level == 1) { if (element == "x" && ns == "jabber:x:data") { - getPayloadInternal()->setData(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->setData(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubOptionsParser.h b/Swiften/Parser/PayloadParsers/PubSubOptionsParser.h index 52d374c..b4ee87a 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOptionsParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubOptionsParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationParser.h index 972930c..8b74106 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.cpp b/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.cpp index 247bf4c..265c404 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -32,7 +32,7 @@ void PubSubOwnerAffiliationsParser::handleStartElement(const std::string& elemen if (level == 1) { if (element == "affiliation" && ns == "http://jabber.org/protocol/pubsub#owner") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -51,7 +51,7 @@ void PubSubOwnerAffiliationsParser::handleEndElement(const std::string& element, if (level == 1) { if (element == "affiliation" && ns == "http://jabber.org/protocol/pubsub#owner") { - getPayloadInternal()->addAffiliation(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->addAffiliation(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.h index 870d809..52c7fa9 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.cpp b/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.cpp index 62dd1ac..ce9ccff 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -32,7 +32,7 @@ void PubSubOwnerConfigureParser::handleStartElement(const std::string& element, if (level == 1) { if (element == "x" && ns == "jabber:x:data") { - currentPayloadParser = boost::make_shared(); + currentPayloadParser = std::make_shared(); } } @@ -51,7 +51,7 @@ void PubSubOwnerConfigureParser::handleEndElement(const std::string& element, co if (level == 1) { if (element == "x" && ns == "jabber:x:data") { - getPayloadInternal()->setData(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->setData(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.h index 914a309..e23e257 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.cpp b/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.cpp index 36ccbaf..e65aa2a 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -28,7 +28,7 @@ void PubSubOwnerDefaultParser::handleStartElement(const std::string& element, co if (level == 1) { if (element == "x" && ns == "jabber:x:data") { - currentPayloadParser = boost::make_shared(); + currentPayloadParser = std::make_shared(); } } @@ -47,7 +47,7 @@ void PubSubOwnerDefaultParser::handleEndElement(const std::string& element, cons if (level == 1) { if (element == "x" && ns == "jabber:x:data") { - getPayloadInternal()->setData(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->setData(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.h index 3106854..82e4825 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.cpp b/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.cpp index 047fe8b..0051ee7 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -32,7 +32,7 @@ void PubSubOwnerDeleteParser::handleStartElement(const std::string& element, con if (level == 1) { if (element == "redirect" && ns == "http://jabber.org/protocol/pubsub#owner") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -51,7 +51,7 @@ void PubSubOwnerDeleteParser::handleEndElement(const std::string& element, const if (level == 1) { if (element == "redirect" && ns == "http://jabber.org/protocol/pubsub#owner") { - getPayloadInternal()->setRedirect(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->setRedirect(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.h index f56ae3c..99a8c0e 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.cpp b/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.cpp index aa7310e..ca73b00 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -33,22 +33,22 @@ void PubSubOwnerPubSubParser::handleStartElement(const std::string& element, con if (level == 1) { if (element == "configure" && ns == "http://jabber.org/protocol/pubsub#owner") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "subscriptions" && ns == "http://jabber.org/protocol/pubsub#owner") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "default" && ns == "http://jabber.org/protocol/pubsub#owner") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "purge" && ns == "http://jabber.org/protocol/pubsub#owner") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "affiliations" && ns == "http://jabber.org/protocol/pubsub#owner") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "delete" && ns == "http://jabber.org/protocol/pubsub#owner") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -67,7 +67,7 @@ void PubSubOwnerPubSubParser::handleEndElement(const std::string& element, const if (level == 1) { if (currentPayloadParser) { - getPayloadInternal()->setPayload(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->setPayload(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.h index d4d67f9..35420f7 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerPurgeParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerPurgeParser.h index 364de29..044ac04 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerPurgeParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerPurgeParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerRedirectParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerRedirectParser.h index fd48dbb..5714d46 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerRedirectParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerRedirectParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionParser.h index 46df820..48e2786 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.cpp b/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.cpp index e08d782..da82600 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -32,7 +32,7 @@ void PubSubOwnerSubscriptionsParser::handleStartElement(const std::string& eleme if (level == 1) { if (element == "subscription" && ns == "http://jabber.org/protocol/pubsub#owner") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -51,7 +51,7 @@ void PubSubOwnerSubscriptionsParser::handleEndElement(const std::string& element if (level == 1) { if (element == "subscription" && ns == "http://jabber.org/protocol/pubsub#owner") { - getPayloadInternal()->addSubscription(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->addSubscription(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.h index 10c11e4..541d225 100644 --- a/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubParser.cpp b/Swiften/Parser/PayloadParsers/PubSubParser.cpp index 9c86c21..b527d4c 100644 --- a/Swiften/Parser/PayloadParsers/PubSubParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -38,40 +38,40 @@ PubSubParser::~PubSubParser() { void PubSubParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { if (level == 1) { if (element == "items" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "create" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "publish" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "affiliations" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "retract" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "options" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "configure" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "default" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "subscriptions" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "subscribe" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "unsubscribe" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } if (element == "subscription" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -91,25 +91,25 @@ void PubSubParser::handleEndElement(const std::string& element, const std::strin if (level == 1) { if (currentPayloadParser) { if (element == "options" && ns == "http://jabber.org/protocol/pubsub") { - optionsPayload = boost::dynamic_pointer_cast(currentPayloadParser->getPayload()); + optionsPayload = std::dynamic_pointer_cast(currentPayloadParser->getPayload()); } else if (element == "configure" && ns == "http://jabber.org/protocol/pubsub") { - configurePayload = boost::dynamic_pointer_cast(currentPayloadParser->getPayload()); + configurePayload = std::dynamic_pointer_cast(currentPayloadParser->getPayload()); } else { - getPayloadInternal()->setPayload(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->setPayload(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } } currentPayloadParser.reset(); } if (level == 0) { - if (boost::shared_ptr create = boost::dynamic_pointer_cast(getPayloadInternal()->getPayload())) { + if (std::shared_ptr create = std::dynamic_pointer_cast(getPayloadInternal()->getPayload())) { if (configurePayload) { create->setConfigure(configurePayload); } } - if (boost::shared_ptr subscribe = boost::dynamic_pointer_cast(getPayloadInternal()->getPayload())) { + if (std::shared_ptr subscribe = std::dynamic_pointer_cast(getPayloadInternal()->getPayload())) { if (optionsPayload) { subscribe->setOptions(optionsPayload); } diff --git a/Swiften/Parser/PayloadParsers/PubSubParser.h b/Swiften/Parser/PayloadParsers/PubSubParser.h index a8043fc..1f40ca9 100644 --- a/Swiften/Parser/PayloadParsers/PubSubParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -31,8 +31,8 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; - boost::shared_ptr configurePayload; - boost::shared_ptr optionsPayload; + std::shared_ptr currentPayloadParser; + std::shared_ptr configurePayload; + std::shared_ptr optionsPayload; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubPublishParser.cpp b/Swiften/Parser/PayloadParsers/PubSubPublishParser.cpp index 3bd3ac0..3fd2951 100644 --- a/Swiften/Parser/PayloadParsers/PubSubPublishParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubPublishParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -32,7 +32,7 @@ void PubSubPublishParser::handleStartElement(const std::string& element, const s if (level == 1) { if (element == "item" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -51,7 +51,7 @@ void PubSubPublishParser::handleEndElement(const std::string& element, const std if (level == 1) { if (element == "item" && ns == "http://jabber.org/protocol/pubsub") { - getPayloadInternal()->addItem(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->addItem(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubPublishParser.h b/Swiften/Parser/PayloadParsers/PubSubPublishParser.h index 1df7c6f..ad7dd11 100644 --- a/Swiften/Parser/PayloadParsers/PubSubPublishParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubPublishParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubRetractParser.cpp b/Swiften/Parser/PayloadParsers/PubSubRetractParser.cpp index e710fad..b011b76 100644 --- a/Swiften/Parser/PayloadParsers/PubSubRetractParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubRetractParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -35,7 +35,7 @@ void PubSubRetractParser::handleStartElement(const std::string& element, const s if (level == 1) { if (element == "item" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -54,7 +54,7 @@ void PubSubRetractParser::handleEndElement(const std::string& element, const std if (level == 1) { if (element == "item" && ns == "http://jabber.org/protocol/pubsub") { - getPayloadInternal()->addItem(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->addItem(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubRetractParser.h b/Swiften/Parser/PayloadParsers/PubSubRetractParser.h index ece2a52..6bea498 100644 --- a/Swiften/Parser/PayloadParsers/PubSubRetractParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubRetractParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubSubscribeOptionsParser.h b/Swiften/Parser/PayloadParsers/PubSubSubscribeOptionsParser.h index 9136f44..4e995dd 100644 --- a/Swiften/Parser/PayloadParsers/PubSubSubscribeOptionsParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubSubscribeOptionsParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubSubscribeParser.h b/Swiften/Parser/PayloadParsers/PubSubSubscribeParser.h index 823c086..2b1788f 100644 --- a/Swiften/Parser/PayloadParsers/PubSubSubscribeParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubSubscribeParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.cpp b/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.cpp index 5954bf1..4ce83cc 100644 --- a/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -46,7 +46,7 @@ void PubSubSubscriptionParser::handleStartElement(const std::string& element, co if (level == 1) { if (element == "subscribe-options" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -65,7 +65,7 @@ void PubSubSubscriptionParser::handleEndElement(const std::string& element, cons if (level == 1) { if (element == "subscribe-options" && ns == "http://jabber.org/protocol/pubsub") { - getPayloadInternal()->setOptions(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->setOptions(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.h b/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.h index 771a74a..7075a99 100644 --- a/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.cpp b/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.cpp index 30198a5..3badaa2 100644 --- a/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.cpp +++ b/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -32,7 +32,7 @@ void PubSubSubscriptionsParser::handleStartElement(const std::string& element, c if (level == 1) { if (element == "subscription" && ns == "http://jabber.org/protocol/pubsub") { - currentPayloadParser = boost::make_shared(parsers); + currentPayloadParser = std::make_shared(parsers); } } @@ -51,7 +51,7 @@ void PubSubSubscriptionsParser::handleEndElement(const std::string& element, con if (level == 1) { if (element == "subscription" && ns == "http://jabber.org/protocol/pubsub") { - getPayloadInternal()->addSubscription(boost::dynamic_pointer_cast(currentPayloadParser->getPayload())); + getPayloadInternal()->addSubscription(std::dynamic_pointer_cast(currentPayloadParser->getPayload())); } currentPayloadParser.reset(); } diff --git a/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.h b/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.h index 9f18376..2371a56 100644 --- a/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/PubSubUnsubscribeParser.h b/Swiften/Parser/PayloadParsers/PubSubUnsubscribeParser.h index d33d33c..d63dd70 100644 --- a/Swiften/Parser/PayloadParsers/PubSubUnsubscribeParser.h +++ b/Swiften/Parser/PayloadParsers/PubSubUnsubscribeParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -29,6 +29,6 @@ namespace Swift { private: PayloadParserFactoryCollection* parsers; int level; - boost::shared_ptr currentPayloadParser; + std::shared_ptr currentPayloadParser; }; } diff --git a/Swiften/Parser/PayloadParsers/ResultSetParser.h b/Swiften/Parser/PayloadParsers/ResultSetParser.h index 335a798..aa18ae6 100644 --- a/Swiften/Parser/PayloadParsers/ResultSetParser.h +++ b/Swiften/Parser/PayloadParsers/ResultSetParser.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp b/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp index b3a8c67..3dd5811 100644 --- a/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp +++ b/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp @@ -63,7 +63,7 @@ void SecurityLabelParser::handleCharacterData(const std::string& data) { } } -boost::shared_ptr SecurityLabelParser::getLabelPayload() const { +std::shared_ptr SecurityLabelParser::getLabelPayload() const { return getPayloadInternal(); } diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelParser.h b/Swiften/Parser/PayloadParsers/SecurityLabelParser.h index d5b0466..cc444a4 100644 --- a/Swiften/Parser/PayloadParsers/SecurityLabelParser.h +++ b/Swiften/Parser/PayloadParsers/SecurityLabelParser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -20,7 +20,7 @@ namespace Swift { virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); virtual void handleEndElement(const std::string& element, const std::string&); virtual void handleCharacterData(const std::string& data); - boost::shared_ptr getLabelPayload() const; + std::shared_ptr getLabelPayload() const; private: enum Level { TopLevel = 0, diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp index 024d587..0de7544 100644 --- a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp +++ b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include #include @@ -29,7 +29,7 @@ void SecurityLabelsCatalogParser::handleStartElement(const std::string& element, getPayloadInternal()->setDescription(attributes.getAttribute("desc")); } else if (level_ == ItemLevel && element == "item" && ns == "urn:xmpp:sec-label:catalog:2") { - currentItem_ = boost::make_shared(); + currentItem_ = std::make_shared(); currentItem_->setSelector(attributes.getAttribute("selector")); currentItem_->setIsDefault(attributes.getBoolAttribute("default", false)); } @@ -51,7 +51,7 @@ void SecurityLabelsCatalogParser::handleEndElement(const std::string& element, c labelParser_->handleEndElement(element, ns); } if (level_ == LabelLevel && labelParser_ && currentItem_) { - boost::shared_ptr currentLabel = labelParser_->getLabelPayload(); + std::shared_ptr currentLabel = labelParser_->getLabelPayload(); assert(currentLabel); currentItem_->setLabel(currentLabel); delete labelParser_; diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h index bb44369..edfa86b 100644 --- a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h +++ b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -33,6 +33,6 @@ namespace Swift { int level_; SecurityLabelParserFactory* labelParserFactory_; SecurityLabelParser* labelParser_; - boost::shared_ptr currentItem_; + std::shared_ptr currentItem_; }; } diff --git a/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp b/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp index 12dace9..ca6f644 100644 --- a/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp +++ b/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp @@ -88,7 +88,7 @@ void StreamInitiationParser::handleEndElement(const std::string& element, const else if (formParser) { Form::ref form = formParser->getPayloadInternal(); if (form) { - FormField::ref field = boost::dynamic_pointer_cast(form->getField("stream-method")); + FormField::ref field = std::dynamic_pointer_cast(form->getField("stream-method")); if (field) { if (form->getType() == Form::FormType) { foreach (const FormField::Option& option, field->getOptions()) { diff --git a/Swiften/Parser/PayloadParsers/UnitTest/CarbonsParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/CarbonsParserTest.cpp index f85efb2..b5b9995 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/CarbonsParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/CarbonsParserTest.cpp @@ -73,14 +73,14 @@ class CarbonsParserTest : public CppUnit::TestFixture { CarbonsReceived::ref received = parser.getPayload(); CPPUNIT_ASSERT(received); - boost::shared_ptr forwarded = received->getForwarded(); + std::shared_ptr forwarded = received->getForwarded(); CPPUNIT_ASSERT(forwarded); - boost::shared_ptr message = boost::dynamic_pointer_cast(forwarded->getStanza()); + std::shared_ptr message = std::dynamic_pointer_cast(forwarded->getStanza()); CPPUNIT_ASSERT(message); CPPUNIT_ASSERT_EQUAL(JID("juliet@capulet.example/balcony"), message->getFrom()); - boost::shared_ptr thread = message->getPayload(); + std::shared_ptr thread = message->getPayload(); CPPUNIT_ASSERT(thread); CPPUNIT_ASSERT_EQUAL(std::string("0e3141cd80894871a68e6fe6b1ec56fa"), thread->getText()); } @@ -105,10 +105,10 @@ class CarbonsParserTest : public CppUnit::TestFixture { CarbonsSent::ref sent = parser.getPayload(); CPPUNIT_ASSERT(sent); - boost::shared_ptr forwarded = sent->getForwarded(); + std::shared_ptr forwarded = sent->getForwarded(); CPPUNIT_ASSERT(forwarded); - boost::shared_ptr message = boost::dynamic_pointer_cast(forwarded->getStanza()); + std::shared_ptr message = std::dynamic_pointer_cast(forwarded->getStanza()); CPPUNIT_ASSERT(message); CPPUNIT_ASSERT_EQUAL(JID("juliet@capulet.example/balcony"), message->getTo()); } diff --git a/Swiften/Parser/PayloadParsers/UnitTest/DeliveryReceiptParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/DeliveryReceiptParserTest.cpp index d18e1b4..d93fd1f 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/DeliveryReceiptParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/DeliveryReceiptParserTest.cpp @@ -4,6 +4,12 @@ * See http://www.opensource.org/licenses/bsd-license.php for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #include #include @@ -25,7 +31,7 @@ class DeliveryReceiptParserTest : public CppUnit::TestFixture { PayloadsParserTester parser; CPPUNIT_ASSERT(parser.parse("")); - DeliveryReceiptRequest::ref request = boost::dynamic_pointer_cast(parser.getPayload()); + DeliveryReceiptRequest::ref request = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT(request); } @@ -34,7 +40,7 @@ class DeliveryReceiptParserTest : public CppUnit::TestFixture { PayloadsParserTester parser; CPPUNIT_ASSERT(parser.parse("")); - DeliveryReceipt::ref receipt = boost::dynamic_pointer_cast(parser.getPayload()); + DeliveryReceipt::ref receipt = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT_EQUAL(std::string("richard2-4.1.247"), receipt->getReceivedID()); } diff --git a/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp index c23b1d0..6e866fc 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -32,7 +32,7 @@ class DiscoInfoParserTest : public CppUnit::TestFixture { "" "")); - DiscoInfo::ref payload = boost::dynamic_pointer_cast(parser.getPayload()); + DiscoInfo::ref payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT_EQUAL(2, static_cast(payload->getIdentities().size())); CPPUNIT_ASSERT_EQUAL(std::string("Swift"), payload->getIdentities()[0].getName()); CPPUNIT_ASSERT_EQUAL(std::string("pc"), payload->getIdentities()[0].getType()); @@ -61,7 +61,7 @@ class DiscoInfoParserTest : public CppUnit::TestFixture { "" "")); - DiscoInfo::ref payload = boost::dynamic_pointer_cast(parser.getPayload()); + DiscoInfo::ref payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT_EQUAL(2, static_cast(payload->getIdentities().size())); CPPUNIT_ASSERT_EQUAL(std::string("Swift"), payload->getIdentities()[0].getName()); CPPUNIT_ASSERT_EQUAL(std::string("pc"), payload->getIdentities()[0].getType()); @@ -91,7 +91,7 @@ class DiscoInfoParserTest : public CppUnit::TestFixture { "" "")); - DiscoInfo::ref payload = boost::dynamic_pointer_cast(parser.getPayload()); + DiscoInfo::ref payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT_EQUAL(1, static_cast(payload->getExtensions().size())); CPPUNIT_ASSERT_EQUAL(std::string("Bot Configuration"), payload->getExtensions()[0]->getTitle()); CPPUNIT_ASSERT_EQUAL(2, static_cast(payload->getFeatures().size())); diff --git a/Swiften/Parser/PayloadParsers/UnitTest/DiscoItemsParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/DiscoItemsParserTest.cpp index 01db978..977ef8e 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/DiscoItemsParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/DiscoItemsParserTest.cpp @@ -4,6 +4,12 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #include #include @@ -27,7 +33,7 @@ class DiscoItemsParserTest : public CppUnit::TestFixture { "" "")); - boost::shared_ptr payload = boost::dynamic_pointer_cast(parser.getPayload()); + std::shared_ptr payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT_EQUAL(2, static_cast(payload->getItems().size())); CPPUNIT_ASSERT_EQUAL(std::string("List Service Configurations"), payload->getItems()[0].getName()); CPPUNIT_ASSERT_EQUAL(std::string("list"), payload->getItems()[0].getNode()); diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp index 529d573..5402614 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp @@ -29,7 +29,7 @@ class ErrorParserTest : public CppUnit::TestFixture { "boo" "")); - ErrorPayload::ref payload = boost::dynamic_pointer_cast(parser.getPayload()); + ErrorPayload::ref payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT_EQUAL(ErrorPayload::BadRequest, payload->getCondition()); CPPUNIT_ASSERT_EQUAL(ErrorPayload::Modify, payload->getType()); CPPUNIT_ASSERT_EQUAL(std::string("boo"), payload->getText()); @@ -46,11 +46,11 @@ class ErrorParserTest : public CppUnit::TestFixture { "boo" "")); - ErrorPayload::ref payload = boost::dynamic_pointer_cast(parser.getPayload()); + ErrorPayload::ref payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT_EQUAL(ErrorPayload::BadRequest, payload->getCondition()); CPPUNIT_ASSERT_EQUAL(ErrorPayload::Modify, payload->getType()); CPPUNIT_ASSERT_EQUAL(std::string("boo"), payload->getText()); - CPPUNIT_ASSERT(boost::dynamic_pointer_cast(payload->getPayload())); + CPPUNIT_ASSERT(std::dynamic_pointer_cast(payload->getPayload())); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp index 4ffc776..ace6bcb 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp @@ -203,7 +203,7 @@ class FormParserTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(std::string("first"), item[0]->getName()); CPPUNIT_ASSERT_EQUAL(std::string("Montague"), item[1]->getValues()[0]); CPPUNIT_ASSERT_EQUAL(std::string("last"), item[1]->getName()); - boost::shared_ptr jidField = item[2]; + std::shared_ptr jidField = item[2]; CPPUNIT_ASSERT_EQUAL(JID("benvolio@montague.net"), jidField->getJIDSingleValue()); CPPUNIT_ASSERT_EQUAL(std::string("jid"), item[2]->getName()); CPPUNIT_ASSERT_EQUAL(std::string("male"), item[3]->getValues()[0]); diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ForwardedParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ForwardedParserTest.cpp index 30af3ec..a807d4e 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/ForwardedParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/ForwardedParserTest.cpp @@ -35,12 +35,12 @@ class ForwardedParserTest : public CppUnit::TestFixture "" "")); - boost::shared_ptr payload = parser.getPayload(); + std::shared_ptr payload = parser.getPayload(); CPPUNIT_ASSERT(!!payload); CPPUNIT_ASSERT(payload->getDelay()); CPPUNIT_ASSERT_EQUAL(std::string("2010-07-10T23:08:25Z"), dateTimeToString(payload->getDelay()->getStamp())); - boost::shared_ptr iq = boost::dynamic_pointer_cast(payload->getStanza()); + std::shared_ptr iq = std::dynamic_pointer_cast(payload->getStanza()); CPPUNIT_ASSERT(!!iq); CPPUNIT_ASSERT_EQUAL(JID("stupidnewbie@example.com"), iq->getTo()); CPPUNIT_ASSERT_EQUAL(JID("kindanormal@example.com/IM"), iq->getFrom()); @@ -58,12 +58,12 @@ class ForwardedParserTest : public CppUnit::TestFixture "" "")); - boost::shared_ptr payload = parser.getPayload(); + std::shared_ptr payload = parser.getPayload(); CPPUNIT_ASSERT(!!payload); CPPUNIT_ASSERT(payload->getDelay()); CPPUNIT_ASSERT_EQUAL(std::string("2010-07-10T23:08:25Z"), dateTimeToString(payload->getDelay()->getStamp())); - boost::shared_ptr message = boost::dynamic_pointer_cast(payload->getStanza()); + std::shared_ptr message = std::dynamic_pointer_cast(payload->getStanza()); CPPUNIT_ASSERT(!!message); const std::string expectedBody = "Call me but love, and I'll be new baptized; Henceforth I never will be Romeo."; CPPUNIT_ASSERT_EQUAL(expectedBody, message->getBody().get()); @@ -81,11 +81,11 @@ class ForwardedParserTest : public CppUnit::TestFixture "" "")); - boost::shared_ptr payload = parser.getPayload(); + std::shared_ptr payload = parser.getPayload(); CPPUNIT_ASSERT(!!payload); CPPUNIT_ASSERT(!payload->getDelay()); - boost::shared_ptr message = boost::dynamic_pointer_cast(payload->getStanza()); + std::shared_ptr message = std::dynamic_pointer_cast(payload->getStanza()); CPPUNIT_ASSERT(!!message); const std::string expectedBody = "Call me but love, and I'll be new baptized; Henceforth I never will be Romeo."; CPPUNIT_ASSERT_EQUAL(expectedBody, message->getBody().get()); @@ -102,12 +102,12 @@ class ForwardedParserTest : public CppUnit::TestFixture "" "")); - boost::shared_ptr payload = parser.getPayload(); + std::shared_ptr payload = parser.getPayload(); CPPUNIT_ASSERT(!!payload); CPPUNIT_ASSERT(payload->getDelay()); CPPUNIT_ASSERT_EQUAL(std::string("2010-07-10T23:08:25Z"), dateTimeToString(payload->getDelay()->getStamp())); - boost::shared_ptr presence = boost::dynamic_pointer_cast(payload->getStanza()); + std::shared_ptr presence = std::dynamic_pointer_cast(payload->getStanza()); CPPUNIT_ASSERT(!!presence); CPPUNIT_ASSERT_EQUAL(JID("madhatter@wonderland.lit"), presence->getTo()); CPPUNIT_ASSERT_EQUAL(JID("alice@wonderland.lit/rabbithole"), presence->getFrom()); diff --git a/Swiften/Parser/PayloadParsers/UnitTest/MAMFinParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/MAMFinParserTest.cpp index b045ca5..6a8e2ed 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/MAMFinParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/MAMFinParserTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -25,7 +25,7 @@ class MAMFinParserTest : public CppUnit::TestFixture CPPUNIT_ASSERT(parser.parse( "")); - boost::shared_ptr payload = parser.getPayload(); + std::shared_ptr payload = parser.getPayload(); CPPUNIT_ASSERT(!!payload); CPPUNIT_ASSERT_EQUAL(false, payload->isComplete()); CPPUNIT_ASSERT_EQUAL(true, payload->isStable()); @@ -46,13 +46,13 @@ class MAMFinParserTest : public CppUnit::TestFixture "" "")); - boost::shared_ptr payload = parser.getPayload(); + std::shared_ptr payload = parser.getPayload(); CPPUNIT_ASSERT(!!payload); CPPUNIT_ASSERT_EQUAL(true, payload->isComplete()); CPPUNIT_ASSERT_EQUAL(true, payload->isStable()); CPPUNIT_ASSERT(!!payload->getResultSet()); - boost::shared_ptr resultSet = payload->getResultSet(); + std::shared_ptr resultSet = payload->getResultSet(); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/MAMQueryParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/MAMQueryParserTest.cpp index 8bdefc1..8750c2e 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/MAMQueryParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/MAMQueryParserTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -41,22 +41,22 @@ class MAMQueryParserTest : public CppUnit::TestFixture "")); - boost::shared_ptr payload = parser.getPayload(); + std::shared_ptr payload = parser.getPayload(); CPPUNIT_ASSERT(!!payload); CPPUNIT_ASSERT(payload->getQueryID()); CPPUNIT_ASSERT_EQUAL(std::string("id0"), *payload->getQueryID()); CPPUNIT_ASSERT_EQUAL(std::string("node1"), *payload->getNode()); CPPUNIT_ASSERT(payload->getForm()); - boost::shared_ptr fieldType = payload->getForm()->getField("FORM_TYPE"); + std::shared_ptr fieldType = payload->getForm()->getField("FORM_TYPE"); CPPUNIT_ASSERT(fieldType); CPPUNIT_ASSERT_EQUAL(std::string("urn:xmpp:mam:0"), fieldType->getTextSingleValue()); - boost::shared_ptr fieldStart = payload->getForm()->getField("start"); + std::shared_ptr fieldStart = payload->getForm()->getField("start"); CPPUNIT_ASSERT(fieldStart); CPPUNIT_ASSERT_EQUAL(std::string("2010-08-07T00:00:00Z"), fieldStart->getTextSingleValue()); CPPUNIT_ASSERT(payload->getResultSet()); - boost::shared_ptr resultSet = payload->getResultSet(); + std::shared_ptr resultSet = payload->getResultSet(); CPPUNIT_ASSERT(resultSet->getMaxItems()); CPPUNIT_ASSERT_EQUAL(*resultSet->getMaxItems(), 10); } @@ -75,7 +75,7 @@ class MAMQueryParserTest : public CppUnit::TestFixture "" "")); - boost::shared_ptr payload = parser.getPayload(); + std::shared_ptr payload = parser.getPayload(); CPPUNIT_ASSERT(!!payload && !!payload->getForm() && !!payload->getForm()->getField("FORM_TYPE") && !!payload->getForm()->getField("with")); CPPUNIT_ASSERT_EQUAL(std::string("urn:xmpp:mam:0"), payload->getForm()->getField("FORM_TYPE")->getTextSingleValue()); CPPUNIT_ASSERT_EQUAL(std::string("juliet@capulet.lit"), payload->getForm()->getField("with")->getTextSingleValue()); @@ -97,7 +97,7 @@ class MAMQueryParserTest : public CppUnit::TestFixture "" "" "")); - boost::shared_ptr payload = parser.getPayload(); + std::shared_ptr payload = parser.getPayload(); CPPUNIT_ASSERT(!!payload && !!payload->getForm() && !!payload->getForm()->getField("FORM_TYPE") && !!payload->getForm()->getField("start") && !!payload->getForm()->getField("start")); CPPUNIT_ASSERT_EQUAL(std::string("urn:xmpp:mam:0"), payload->getForm()->getField("FORM_TYPE")->getTextSingleValue()); CPPUNIT_ASSERT_EQUAL(std::string("2010-06-07T00:00:00Z"), payload->getForm()->getField("start")->getTextSingleValue()); @@ -110,7 +110,7 @@ class MAMQueryParserTest : public CppUnit::TestFixture "" "")); - boost::shared_ptr payload = parser.getPayload(); + std::shared_ptr payload = parser.getPayload(); CPPUNIT_ASSERT(!!payload); CPPUNIT_ASSERT(payload->getQueryID()); CPPUNIT_ASSERT_EQUAL(std::string("id0"), *payload->getQueryID()); diff --git a/Swiften/Parser/PayloadParsers/UnitTest/MAMResultParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/MAMResultParserTest.cpp index 7393630..15912b1 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/MAMResultParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/MAMResultParserTest.cpp @@ -35,17 +35,17 @@ class MAMResultParserTest : public CppUnit::TestFixture "" "")); - boost::shared_ptr payload = parser.getPayload(); + std::shared_ptr payload = parser.getPayload(); CPPUNIT_ASSERT(!!payload); CPPUNIT_ASSERT_EQUAL(std::string("28482-98726-73623"), payload->getID()); CPPUNIT_ASSERT(payload->getQueryID()); CPPUNIT_ASSERT_EQUAL(std::string("f27"), *payload->getQueryID()); - boost::shared_ptr forwarded = payload->getPayload(); + std::shared_ptr forwarded = payload->getPayload(); CPPUNIT_ASSERT(forwarded->getDelay()); CPPUNIT_ASSERT_EQUAL(std::string("2010-07-10T23:08:25Z"), dateTimeToString(forwarded->getDelay()->getStamp())); - boost::shared_ptr message = boost::dynamic_pointer_cast(forwarded->getStanza()); + std::shared_ptr message = std::dynamic_pointer_cast(forwarded->getStanza()); CPPUNIT_ASSERT(!!message); const std::string expectedBody = "Call me but love, and I'll be new baptized; Henceforth I never will be Romeo."; CPPUNIT_ASSERT_EQUAL(expectedBody, message->getBody().get()); diff --git a/Swiften/Parser/PayloadParsers/UnitTest/MUCAdminPayloadParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/MUCAdminPayloadParserTest.cpp index 495aefe..d403872 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/MUCAdminPayloadParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/MUCAdminPayloadParserTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -26,7 +26,7 @@ class MUCAdminPayloadParserTest : public CppUnit::TestFixture CPPUNIT_ASSERT(parser.parse("malice")); - MUCAdminPayload::ref payload = boost::dynamic_pointer_cast(parser.getPayload()); + MUCAdminPayload::ref payload = std::dynamic_pointer_cast(parser.getPayload()); MUCItem item = payload->getItems()[0]; CPPUNIT_ASSERT_EQUAL(MUCOccupant::Owner, item.affiliation.get()); CPPUNIT_ASSERT_EQUAL(MUCOccupant::Visitor, item.role.get()); diff --git a/Swiften/Parser/PayloadParsers/UnitTest/MUCUserPayloadParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/MUCUserPayloadParserTest.cpp index a8cf246..18597bd 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/MUCUserPayloadParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/MUCUserPayloadParserTest.cpp @@ -34,7 +34,7 @@ class MUCUserPayloadParserTest : public CppUnit::TestFixture bool found110 = false; bool found210 = false; - MUCUserPayload::ref payload = boost::dynamic_pointer_cast(parser.getPayload()); + MUCUserPayload::ref payload = std::dynamic_pointer_cast(parser.getPayload()); foreach (MUCUserPayload::StatusCode status, payload->getStatusCodes()) { if (status.code == 110) found110 = true; @@ -55,7 +55,7 @@ class MUCUserPayloadParserTest : public CppUnit::TestFixture CPPUNIT_ASSERT(parser.parse("")); - MUCUserPayload::ref payload = boost::dynamic_pointer_cast(parser.getPayload()); + MUCUserPayload::ref payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT(payload); CPPUNIT_ASSERT(payload->getItems().empty()); } @@ -65,9 +65,9 @@ class MUCUserPayloadParserTest : public CppUnit::TestFixture CPPUNIT_ASSERT(parser.parse("bert")); - MUCUserPayload::ref payload = boost::dynamic_pointer_cast(parser.getPayload()); + MUCUserPayload::ref payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT(payload); - MUCDestroyPayload::ref destroy = boost::dynamic_pointer_cast(payload->getPayload()); + MUCDestroyPayload::ref destroy = std::dynamic_pointer_cast(payload->getPayload()); CPPUNIT_ASSERT(destroy); CPPUNIT_ASSERT_EQUAL(std::string("bert"), destroy->getReason()); CPPUNIT_ASSERT_EQUAL(JID("alice@wonderland.lit"), destroy->getNewVenue()); @@ -78,7 +78,7 @@ class MUCUserPayloadParserTest : public CppUnit::TestFixture CPPUNIT_ASSERT(parser.parse(" Hey Hecate, this is the place for all good witches! cauldronburn")); - MUCUserPayload::ref payload = boost::dynamic_pointer_cast(parser.getPayload()); + MUCUserPayload::ref payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT(payload); CPPUNIT_ASSERT(payload->getInvite()); CPPUNIT_ASSERT(payload->getPassword()); diff --git a/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h b/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h index 8e871b2..89b990c 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h +++ b/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h @@ -48,19 +48,19 @@ namespace Swift { payloadParser->handleCharacterData(data); } - boost::shared_ptr getPayload() const { + std::shared_ptr getPayload() const { return payloadParser->getPayload(); } template - boost::shared_ptr getPayload() const { - return boost::dynamic_pointer_cast(payloadParser->getPayload()); + std::shared_ptr getPayload() const { + return std::dynamic_pointer_cast(payloadParser->getPayload()); } private: XMLParser* xmlParser; FullPayloadParserFactoryCollection factories; - boost::shared_ptr payloadParser; + std::shared_ptr payloadParser; int level; }; } diff --git a/Swiften/Parser/PayloadParsers/UnitTest/PriorityParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/PriorityParserTest.cpp index e724090..2c89f0f 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/PriorityParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/PriorityParserTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -24,7 +24,7 @@ class PriorityParserTest : public CppUnit::TestFixture { CPPUNIT_ASSERT(parser.parse("-120")); - boost::shared_ptr payload = boost::dynamic_pointer_cast(parser.getPayload()); + std::shared_ptr payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT_EQUAL(-120, payload->getPriority()); } @@ -33,7 +33,7 @@ class PriorityParserTest : public CppUnit::TestFixture { CPPUNIT_ASSERT(parser.parse("invalid")); - boost::shared_ptr payload = boost::dynamic_pointer_cast(parser.getPayload()); + std::shared_ptr payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT_EQUAL(0, payload->getPriority()); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp index 2975485..06f3ae5 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp @@ -36,9 +36,9 @@ class PrivateStorageParserTest : public CppUnit::TestFixture { "" "")); - boost::shared_ptr payload = boost::dynamic_pointer_cast(parser.getPayload()); + std::shared_ptr payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT(payload); - boost::shared_ptr storage = boost::dynamic_pointer_cast(payload->getPayload()); + std::shared_ptr storage = std::dynamic_pointer_cast(payload->getPayload()); CPPUNIT_ASSERT(storage); CPPUNIT_ASSERT_EQUAL(std::string("Alice"), storage->getRooms()[0].nick); CPPUNIT_ASSERT_EQUAL(JID("swift@rooms.swift.im"), storage->getRooms()[0].jid); @@ -49,7 +49,7 @@ class PrivateStorageParserTest : public CppUnit::TestFixture { CPPUNIT_ASSERT(parser.parse("")); - boost::shared_ptr payload = boost::dynamic_pointer_cast(parser.getPayload()); + std::shared_ptr payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT(payload); CPPUNIT_ASSERT(!payload->getPayload()); } @@ -71,9 +71,9 @@ class PrivateStorageParserTest : public CppUnit::TestFixture { "" "")); - boost::shared_ptr payload = boost::dynamic_pointer_cast(parser.getPayload()); + std::shared_ptr payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT(payload); - boost::shared_ptr storage = boost::dynamic_pointer_cast(payload->getPayload()); + std::shared_ptr storage = std::dynamic_pointer_cast(payload->getPayload()); CPPUNIT_ASSERT(storage); CPPUNIT_ASSERT_EQUAL(std::string("Rabbit"), storage->getRooms()[0].nick); } @@ -88,7 +88,7 @@ class PrivateStorageParserTest : public CppUnit::TestFixture { "Bar" "")); - CPPUNIT_ASSERT(!boost::dynamic_pointer_cast(testling.getPayload())->getPayload()); + CPPUNIT_ASSERT(!std::dynamic_pointer_cast(testling.getPayload())->getPayload()); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ReplaceTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ReplaceTest.cpp index 3e42788..6d77d4a 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/ReplaceTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/ReplaceTest.cpp @@ -4,6 +4,12 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #include #include @@ -22,13 +28,13 @@ class ReplaceParserTest : public CppUnit::TestFixture { void testParseTrivial() { PayloadsParserTester parser; CPPUNIT_ASSERT(parser.parse("")); - Replace::ref payload = boost::dynamic_pointer_cast (parser.getPayload()); + Replace::ref payload = std::dynamic_pointer_cast (parser.getPayload()); CPPUNIT_ASSERT_EQUAL(std::string("bad1"), payload->getID()); } void testParseChild() { PayloadsParserTester parser; CPPUNIT_ASSERT(parser.parse("")); - Replace::ref payload = boost::dynamic_pointer_cast (parser.getPayload()); + Replace::ref payload = std::dynamic_pointer_cast (parser.getPayload()); CPPUNIT_ASSERT_EQUAL(std::string("bad1"), payload->getID()); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp index 7924e05..da5d978 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -33,7 +33,7 @@ class ResultSetParserTest : public CppUnit::TestFixture "09af3-cc343-b409f" "")); - boost::shared_ptr payload = parser.getPayload(); + std::shared_ptr payload = parser.getPayload(); CPPUNIT_ASSERT(!!payload); CPPUNIT_ASSERT(payload->getMaxItems()); CPPUNIT_ASSERT_EQUAL(100, *payload->getMaxItems()); @@ -60,7 +60,7 @@ class ResultSetParserTest : public CppUnit::TestFixture "stpeter@jabber.org" "")); - boost::shared_ptr payload = parser.getPayload(); + std::shared_ptr payload = parser.getPayload(); CPPUNIT_ASSERT(!!payload); CPPUNIT_ASSERT(payload->getFirstID()); CPPUNIT_ASSERT_EQUAL(std::string("stpeter@jabber.org"), *payload->getFirstID()); diff --git a/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp index e02eb7a..bc29921 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp @@ -84,7 +84,7 @@ class VCardParserTest : public CppUnit::TestFixture { "mutt" "")); - boost::shared_ptr payload = boost::dynamic_pointer_cast(parser.getPayload()); + std::shared_ptr payload = std::dynamic_pointer_cast(parser.getPayload()); CPPUNIT_ASSERT_EQUAL(std::string("2.0"), payload->getVersion()); CPPUNIT_ASSERT_EQUAL(std::string("Alice In Wonderland"), payload->getFullName()); CPPUNIT_ASSERT_EQUAL(std::string("Alice"), payload->getGivenName()); diff --git a/Swiften/Parser/PayloadParsers/UserLocationParser.h b/Swiften/Parser/PayloadParsers/UserLocationParser.h index c2a226e..1445d3e 100644 --- a/Swiften/Parser/PayloadParsers/UserLocationParser.h +++ b/Swiften/Parser/PayloadParsers/UserLocationParser.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include diff --git a/Swiften/Parser/PayloadParsers/UserTuneParser.h b/Swiften/Parser/PayloadParsers/UserTuneParser.h index 5c35074..5a27273 100644 --- a/Swiften/Parser/PayloadParsers/UserTuneParser.h +++ b/Swiften/Parser/PayloadParsers/UserTuneParser.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include diff --git a/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp b/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp index b9786c9..d3a7211 100644 --- a/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp +++ b/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp @@ -12,9 +12,10 @@ #include +#include + #include #include -#include #include #include @@ -37,15 +38,15 @@ namespace Swift { } else if (level_ == 1) { std::string type = attributes.getAttributeValue("type").get_value_or(""); if (type == "insert") { - WhiteboardInsertOperation::ref insertOp = boost::make_shared(); + WhiteboardInsertOperation::ref insertOp = std::make_shared(); operation = insertOp; } else if (type == "update") { - WhiteboardUpdateOperation::ref updateOp = boost::make_shared(); + WhiteboardUpdateOperation::ref updateOp = std::make_shared(); std::string move = attributes.getAttributeValue("newpos").get_value_or("0"); updateOp->setNewPos(boost::lexical_cast(attributes.getAttributeValue("newpos").get_value_or("0"))); operation = updateOp; } else if (type == "delete") { - WhiteboardDeleteOperation::ref deleteOp = boost::make_shared(); + WhiteboardDeleteOperation::ref deleteOp = std::make_shared(); deleteOp->setElementID(attributes.getAttributeValue("elementid").get_value_or("")); operation = deleteOp; } @@ -71,7 +72,7 @@ namespace Swift { y2 = boost::lexical_cast(attributes.getAttributeValue("y2").get_value_or("0")); } catch (boost::bad_lexical_cast&) { } - WhiteboardLineElement::ref whiteboardElement = boost::make_shared(x1, y1, x2, y2); + WhiteboardLineElement::ref whiteboardElement = std::make_shared(x1, y1, x2, y2); WhiteboardColor color(attributes.getAttributeValue("stroke").get_value_or("#000000")); color.setAlpha(opacityToAlpha(attributes.getAttributeValue("opacity").get_value_or("1"))); @@ -87,7 +88,7 @@ namespace Swift { getPayloadInternal()->setElement(whiteboardElement); wbElement = whiteboardElement; } else if (element == "path") { - WhiteboardFreehandPathElement::ref whiteboardElement = boost::make_shared(); + WhiteboardFreehandPathElement::ref whiteboardElement = std::make_shared(); std::string pathData = attributes.getAttributeValue("d").get_value_or(""); std::vector > points; if (pathData[0] == 'M') { @@ -148,7 +149,7 @@ namespace Swift { } catch (boost::bad_lexical_cast&) { } - WhiteboardRectElement::ref whiteboardElement = boost::make_shared(x, y, width, height); + WhiteboardRectElement::ref whiteboardElement = std::make_shared(x, y, width, height); int penWidth = 1; try { @@ -167,7 +168,7 @@ namespace Swift { getPayloadInternal()->setElement(whiteboardElement); wbElement = whiteboardElement; } else if (element == "polygon") { - WhiteboardPolygonElement::ref whiteboardElement = boost::make_shared(); + WhiteboardPolygonElement::ref whiteboardElement = std::make_shared(); std::string pointsData = attributes.getAttributeValue("points").get_value_or(""); std::vector > points; @@ -214,7 +215,7 @@ namespace Swift { } catch (boost::bad_lexical_cast&) { } - WhiteboardTextElement::ref whiteboardElement = boost::make_shared(x, y); + WhiteboardTextElement::ref whiteboardElement = std::make_shared(x, y); actualIsText = true; WhiteboardColor color(attributes.getAttributeValue("fill").get_value_or("#000000")); @@ -243,7 +244,7 @@ namespace Swift { } catch (boost::bad_lexical_cast&) { } - WhiteboardEllipseElement::ref whiteboardElement = boost::make_shared(cx, cy, rx, ry); + WhiteboardEllipseElement::ref whiteboardElement = std::make_shared(cx, cy, rx, ry); int penWidth = 1; try { @@ -271,12 +272,12 @@ namespace Swift { if (level_ == 0) { getPayloadInternal()->setData(data_); } else if (level_ == 1) { - WhiteboardInsertOperation::ref insertOp = boost::dynamic_pointer_cast(operation); + WhiteboardInsertOperation::ref insertOp = std::dynamic_pointer_cast(operation); if (insertOp) { insertOp->setElement(wbElement); } - WhiteboardUpdateOperation::ref updateOp = boost::dynamic_pointer_cast(operation); + WhiteboardUpdateOperation::ref updateOp = std::dynamic_pointer_cast(operation); if (updateOp) { updateOp->setElement(wbElement); } @@ -290,7 +291,7 @@ namespace Swift { void WhiteboardParser::handleCharacterData(const std::string& data) { if (level_ == 3 && actualIsText) { - WhiteboardTextElement::ref element = boost::dynamic_pointer_cast(getPayloadInternal()->getElement()); + WhiteboardTextElement::ref element = std::dynamic_pointer_cast(getPayloadInternal()->getElement()); element->setText(data); } } diff --git a/Swiften/Parser/SerializingParser.cpp b/Swiften/Parser/SerializingParser.cpp index b58ccd6..9e39279 100644 --- a/Swiften/Parser/SerializingParser.cpp +++ b/Swiften/Parser/SerializingParser.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include #include @@ -17,7 +17,7 @@ SerializingParser::SerializingParser() { } void SerializingParser::handleStartElement(const std::string& tag, const std::string& ns, const AttributeMap& attributes) { - boost::shared_ptr element = boost::make_shared(tag, ns); + std::shared_ptr element = std::make_shared(tag, ns); // FIXME: Ignoring attribute namespace foreach (const AttributeMap::Entry& e, attributes.getEntries()) { element->setAttribute(e.getAttribute().getName(), e.getValue()); @@ -39,7 +39,7 @@ void SerializingParser::handleEndElement(const std::string&, const std::string&) void SerializingParser::handleCharacterData(const std::string& data) { if (!elementStack_.empty()) { - (*(elementStack_.end()-1))->addNode(boost::make_shared(data)); + (*(elementStack_.end()-1))->addNode(std::make_shared(data)); } } diff --git a/Swiften/Parser/SerializingParser.h b/Swiften/Parser/SerializingParser.h index b94d2b8..bc2d872 100644 --- a/Swiften/Parser/SerializingParser.h +++ b/Swiften/Parser/SerializingParser.h @@ -24,7 +24,7 @@ namespace Swift { std::string getResult() const; private: - std::vector< boost::shared_ptr > elementStack_; - boost::shared_ptr rootElement_; + std::vector< std::shared_ptr > elementStack_; + std::shared_ptr rootElement_; }; } diff --git a/Swiften/Parser/StanzaParser.cpp b/Swiften/Parser/StanzaParser.cpp index 82ddb5c..da252bf 100644 --- a/Swiften/Parser/StanzaParser.cpp +++ b/Swiften/Parser/StanzaParser.cpp @@ -65,7 +65,7 @@ void StanzaParser::handleEndElement(const std::string& element, const std::strin currentPayloadParser_->handleEndElement(element, ns); --currentDepth_; if (!inPayload()) { - boost::shared_ptr payload(currentPayloadParser_->getPayload()); + std::shared_ptr payload(currentPayloadParser_->getPayload()); if (payload) { getStanza()->addPayload(payload); } diff --git a/Swiften/Parser/StanzaParser.h b/Swiften/Parser/StanzaParser.h index 866df04..7b83e99 100644 --- a/Swiften/Parser/StanzaParser.h +++ b/Swiften/Parser/StanzaParser.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include @@ -29,11 +29,11 @@ namespace Swift { void handleEndElement(const std::string& element, const std::string& ns); void handleCharacterData(const std::string& data); - virtual boost::shared_ptr getElement() const = 0; + virtual std::shared_ptr getElement() const = 0; virtual void handleStanzaAttributes(const AttributeMap&) {} - virtual boost::shared_ptr getStanza() const { - return boost::dynamic_pointer_cast(getElement()); + virtual std::shared_ptr getStanza() const { + return std::dynamic_pointer_cast(getElement()); } private: @@ -49,6 +49,6 @@ namespace Swift { private: int currentDepth_; PayloadParserFactoryCollection* factories_; - boost::shared_ptr currentPayloadParser_; + std::shared_ptr currentPayloadParser_; }; } diff --git a/Swiften/Parser/Tree/NullParserElement.cpp b/Swiften/Parser/Tree/NullParserElement.cpp index 4a2db8f..7b52926 100644 --- a/Swiften/Parser/Tree/NullParserElement.cpp +++ b/Swiften/Parser/Tree/NullParserElement.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,6 +8,6 @@ namespace Swift { -boost::shared_ptr NullParserElement::element = boost::make_shared(); +std::shared_ptr NullParserElement::element = std::make_shared(); } diff --git a/Swiften/Parser/Tree/NullParserElement.h b/Swiften/Parser/Tree/NullParserElement.h index 8dae25d..320e098 100644 --- a/Swiften/Parser/Tree/NullParserElement.h +++ b/Swiften/Parser/Tree/NullParserElement.h @@ -18,6 +18,6 @@ namespace Swift { virtual operator bool() { return false; } - static boost::shared_ptr element; + static std::shared_ptr element; }; } diff --git a/Swiften/Parser/Tree/ParserElement.cpp b/Swiften/Parser/Tree/ParserElement.cpp index 6bbd93e..27bd790 100644 --- a/Swiften/Parser/Tree/ParserElement.cpp +++ b/Swiften/Parser/Tree/ParserElement.cpp @@ -25,7 +25,7 @@ ParserElement::~ParserElement() { } ParserElement::ref ParserElement::addChild(const std::string& name, const std::string& xmlns, const AttributeMap& attributes) { - ParserElement::ref child = boost::make_shared(name, xmlns, attributes); + ParserElement::ref child = std::make_shared(name, xmlns, attributes); children_.push_back(child); return child; } diff --git a/Swiften/Parser/Tree/ParserElement.h b/Swiften/Parser/Tree/ParserElement.h index dc9f31c..cffd59a 100644 --- a/Swiften/Parser/Tree/ParserElement.h +++ b/Swiften/Parser/Tree/ParserElement.h @@ -7,12 +7,10 @@ #pragma once +#include #include #include -#include -#include - #include #include #include @@ -20,7 +18,7 @@ namespace Swift { class SWIFTEN_API ParserElement { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; ParserElement(const std::string& name, const std::string& xmlns, const AttributeMap& attributes); virtual ~ParserElement(); diff --git a/Swiften/Parser/Tree/TreeReparser.cpp b/Swiften/Parser/Tree/TreeReparser.cpp index 269b2ea..7fc74cf 100644 --- a/Swiften/Parser/Tree/TreeReparser.cpp +++ b/Swiften/Parser/Tree/TreeReparser.cpp @@ -21,7 +21,7 @@ namespace Swift { typedef std::pair ElementState; -boost::shared_ptr TreeReparser::parseTree(ParserElement::ref root, PayloadParserFactoryCollection* collection) { +std::shared_ptr TreeReparser::parseTree(ParserElement::ref root, PayloadParserFactoryCollection* collection) { PayloadParser* parser = collection->getPayloadParserFactory(root->getName(), root->getNamespace(), root->getAttributes())->createPayloadParser(); std::deque stack; stack.push_back(ElementState(root, true)); @@ -41,7 +41,7 @@ boost::shared_ptr TreeReparser::parseTree(ParserElement::ref root, Payl } - boost::shared_ptr payload = parser->getPayload(); + std::shared_ptr payload = parser->getPayload(); delete parser; return payload; } diff --git a/Swiften/Parser/Tree/TreeReparser.h b/Swiften/Parser/Tree/TreeReparser.h index fb96c1b..435922b 100644 --- a/Swiften/Parser/Tree/TreeReparser.h +++ b/Swiften/Parser/Tree/TreeReparser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -14,7 +14,7 @@ namespace Swift { class PayloadParserFactoryCollection; class SWIFTEN_API TreeReparser { public: - static boost::shared_ptr parseTree(ParserElement::ref root, PayloadParserFactoryCollection* collection); + static std::shared_ptr parseTree(ParserElement::ref root, PayloadParserFactoryCollection* collection); }; } diff --git a/Swiften/Parser/UnitTest/StanzaParserTest.cpp b/Swiften/Parser/UnitTest/StanzaParserTest.cpp index c081b1b..6febdbc 100644 --- a/Swiften/Parser/UnitTest/StanzaParserTest.cpp +++ b/Swiften/Parser/UnitTest/StanzaParserTest.cpp @@ -193,15 +193,15 @@ class StanzaParserTest : public CppUnit::TestFixture { public: MyStanzaParser(PayloadParserFactoryCollection* collection) : StanzaParser(collection) { - stanza_ = boost::make_shared(); + stanza_ = std::make_shared(); } - virtual boost::shared_ptr getElement() const { + virtual std::shared_ptr getElement() const { return stanza_; } private: - boost::shared_ptr stanza_; + std::shared_ptr stanza_; }; MyPayload1ParserFactory factory1_; diff --git a/Swiften/Parser/UnitTest/StreamFeaturesParserTest.cpp b/Swiften/Parser/UnitTest/StreamFeaturesParserTest.cpp index 031f2f3..4664df2 100644 --- a/Swiften/Parser/UnitTest/StreamFeaturesParserTest.cpp +++ b/Swiften/Parser/UnitTest/StreamFeaturesParserTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -42,7 +42,7 @@ class StreamFeaturesParserTest : public CppUnit::TestFixture { "" "")); - StreamFeatures::ref element = boost::dynamic_pointer_cast(testling.getElement()); + StreamFeatures::ref element = std::dynamic_pointer_cast(testling.getElement()); CPPUNIT_ASSERT(element->hasStartTLS()); CPPUNIT_ASSERT(element->hasSession()); CPPUNIT_ASSERT(element->hasResourceBind()); @@ -62,7 +62,7 @@ class StreamFeaturesParserTest : public CppUnit::TestFixture { CPPUNIT_ASSERT(parser.parse("")); - StreamFeatures::ref element = boost::dynamic_pointer_cast(testling.getElement()); + StreamFeatures::ref element = std::dynamic_pointer_cast(testling.getElement()); CPPUNIT_ASSERT(!element->hasStartTLS()); CPPUNIT_ASSERT(!element->hasSession()); CPPUNIT_ASSERT(!element->hasResourceBind()); @@ -82,7 +82,7 @@ class StreamFeaturesParserTest : public CppUnit::TestFixture { "" "")); - StreamFeatures::ref element = boost::dynamic_pointer_cast(testling.getElement()); + StreamFeatures::ref element = std::dynamic_pointer_cast(testling.getElement()); CPPUNIT_ASSERT(element->hasAuthenticationMechanism("GSSAPI")); CPPUNIT_ASSERT_EQUAL(*element->getAuthenticationHostname(), hostname); } @@ -99,7 +99,7 @@ class StreamFeaturesParserTest : public CppUnit::TestFixture { "" "")); - StreamFeatures::ref element = boost::dynamic_pointer_cast(testling.getElement()); + StreamFeatures::ref element = std::dynamic_pointer_cast(testling.getElement()); CPPUNIT_ASSERT(element->hasAuthenticationMechanism("GSSAPI")); CPPUNIT_ASSERT(element->getAuthenticationHostname()->empty()); } diff --git a/Swiften/Parser/UnitTest/StreamManagementEnabledParserTest.cpp b/Swiften/Parser/UnitTest/StreamManagementEnabledParserTest.cpp index 7b4a9cc..704a89f 100644 --- a/Swiften/Parser/UnitTest/StreamManagementEnabledParserTest.cpp +++ b/Swiften/Parser/UnitTest/StreamManagementEnabledParserTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -25,7 +25,7 @@ class StreamManagementEnabledParserTest : public CppUnit::TestFixture { CPPUNIT_ASSERT(parser.parse( "")); - boost::shared_ptr element = boost::dynamic_pointer_cast(testling.getElement()); + std::shared_ptr element = std::dynamic_pointer_cast(testling.getElement()); CPPUNIT_ASSERT(element->getResumeSupported()); CPPUNIT_ASSERT_EQUAL(std::string("some-long-sm-id"), element->getResumeID()); } diff --git a/Swiften/Parser/UnitTest/XMPPParserTest.cpp b/Swiften/Parser/UnitTest/XMPPParserTest.cpp index a4cb7b8..2424d4d 100644 --- a/Swiften/Parser/UnitTest/XMPPParserTest.cpp +++ b/Swiften/Parser/UnitTest/XMPPParserTest.cpp @@ -163,7 +163,7 @@ class XMPPParserTest : public CppUnit::TestFixture { public: enum Type { StreamStart, ElementEvent, StreamEnd }; struct Event { - Event(Type type, boost::shared_ptr element) + Event(Type type, std::shared_ptr element) : type(type), element(element) {} Event(Type type, const ProtocolHeader& header) : type(type), header(header) {} @@ -171,7 +171,7 @@ class XMPPParserTest : public CppUnit::TestFixture { Type type; boost::optional header; - boost::shared_ptr element; + std::shared_ptr element; }; Client() {} @@ -180,7 +180,7 @@ class XMPPParserTest : public CppUnit::TestFixture { events.push_back(Event(StreamStart, header)); } - void handleElement(boost::shared_ptr element) { + void handleElement(std::shared_ptr element) { events.push_back(Event(ElementEvent, element)); } diff --git a/Swiften/Parser/UnknownPayloadParser.h b/Swiften/Parser/UnknownPayloadParser.h index ca49269..1553704 100644 --- a/Swiften/Parser/UnknownPayloadParser.h +++ b/Swiften/Parser/UnknownPayloadParser.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 +#include #include #include @@ -20,8 +20,8 @@ namespace Swift { virtual void handleEndElement(const std::string&, const std::string&) {} virtual void handleCharacterData(const std::string&) {} - virtual boost::shared_ptr getPayload() const { - return boost::shared_ptr(); + virtual std::shared_ptr getPayload() const { + return std::shared_ptr(); } }; } diff --git a/Swiften/Parser/XMPPParser.h b/Swiften/Parser/XMPPParser.h index 52b2921..09fae38 100644 --- a/Swiften/Parser/XMPPParser.h +++ b/Swiften/Parser/XMPPParser.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include #include diff --git a/Swiften/Parser/XMPPParserClient.h b/Swiften/Parser/XMPPParserClient.h index 73f8119..97c0c64 100644 --- a/Swiften/Parser/XMPPParserClient.h +++ b/Swiften/Parser/XMPPParserClient.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -20,7 +20,7 @@ namespace Swift { virtual ~XMPPParserClient(); virtual void handleStreamStart(const ProtocolHeader&) = 0; - virtual void handleElement(boost::shared_ptr) = 0; + virtual void handleElement(std::shared_ptr) = 0; virtual void handleStreamEnd() = 0; }; } diff --git a/Swiften/Presence/DirectedPresenceSender.cpp b/Swiften/Presence/DirectedPresenceSender.cpp index a3deea5..c1ce3a0 100644 --- a/Swiften/Presence/DirectedPresenceSender.cpp +++ b/Swiften/Presence/DirectedPresenceSender.cpp @@ -13,7 +13,7 @@ namespace Swift { DirectedPresenceSender::DirectedPresenceSender(PresenceSender* sender) : sender(sender) { } -void DirectedPresenceSender::sendPresence(boost::shared_ptr presence) { +void DirectedPresenceSender::sendPresence(std::shared_ptr presence) { if (!sender->isAvailable()) { return; } @@ -21,7 +21,7 @@ void DirectedPresenceSender::sendPresence(boost::shared_ptr presence) sender->sendPresence(presence); if (!presence->getTo().isValid()) { - boost::shared_ptr presenceCopy(new Presence(*presence)); + std::shared_ptr presenceCopy(new Presence(*presence)); foreach(const JID& jid, directedPresenceReceivers) { presenceCopy->setTo(jid); sender->sendPresence(presenceCopy); @@ -48,7 +48,7 @@ void DirectedPresenceSender::addDirectedPresenceReceiver(const JID& jid, SendPre directedPresenceReceivers.insert(jid); if (sendPresence == AndSendPresence && sender->isAvailable()) { if (lastSentUndirectedPresence && (*lastSentUndirectedPresence)->getType() == Presence::Available) { - boost::shared_ptr presenceCopy((*lastSentUndirectedPresence)->clone()); + std::shared_ptr presenceCopy((*lastSentUndirectedPresence)->clone()); presenceCopy->setTo(jid); sender->sendPresence(presenceCopy); } @@ -63,7 +63,7 @@ void DirectedPresenceSender::addDirectedPresenceReceiver(const JID& jid, SendPre void DirectedPresenceSender::removeDirectedPresenceReceiver(const JID& jid, SendPresence sendPresence) { directedPresenceReceivers.erase(jid); if (sendPresence == AndSendPresence && sender->isAvailable()) { - boost::shared_ptr presence(new Presence()); + std::shared_ptr presence(new Presence()); presence->setType(Presence::Unavailable); presence->setTo(jid); sender->sendPresence(presence); diff --git a/Swiften/Presence/PayloadAddingPresenceSender.cpp b/Swiften/Presence/PayloadAddingPresenceSender.cpp index 2f55374..e5d2688 100644 --- a/Swiften/Presence/PayloadAddingPresenceSender.cpp +++ b/Swiften/Presence/PayloadAddingPresenceSender.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -34,7 +34,7 @@ bool PayloadAddingPresenceSender::isAvailable() const { return sender->isAvailable(); } -void PayloadAddingPresenceSender::setPayload(boost::shared_ptr payload) { +void PayloadAddingPresenceSender::setPayload(std::shared_ptr payload) { this->payload = payload; if (lastSentPresence) { sendPresence(lastSentPresence); diff --git a/Swiften/Presence/PayloadAddingPresenceSender.h b/Swiften/Presence/PayloadAddingPresenceSender.h index edb9484..3a55183 100644 --- a/Swiften/Presence/PayloadAddingPresenceSender.h +++ b/Swiften/Presence/PayloadAddingPresenceSender.h @@ -22,7 +22,7 @@ namespace Swift { public: PayloadAddingPresenceSender(PresenceSender*); - void sendPresence(boost::shared_ptr); + void sendPresence(std::shared_ptr); bool isAvailable() const; /** @@ -31,7 +31,7 @@ namespace Swift { * with an updated payload. Initial presence is reset when unavailable presence is * sent, or when reset() is called. */ - void setPayload(boost::shared_ptr); + void setPayload(std::shared_ptr); /** * Resets the presence sender. @@ -42,8 +42,8 @@ namespace Swift { void reset(); private: - boost::shared_ptr lastSentPresence; + std::shared_ptr lastSentPresence; PresenceSender* sender; - boost::shared_ptr payload; + std::shared_ptr payload; }; } diff --git a/Swiften/Presence/UnitTest/DirectedPresenceSenderTest.cpp b/Swiften/Presence/UnitTest/DirectedPresenceSenderTest.cpp index 37679a9..2ce67dc 100644 --- a/Swiften/Presence/UnitTest/DirectedPresenceSenderTest.cpp +++ b/Swiften/Presence/UnitTest/DirectedPresenceSenderTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -28,9 +28,9 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture { public: void setUp() { channel = new DummyStanzaChannel(); - testPresence = boost::make_shared(); + testPresence = std::make_shared(); testPresence->setStatus("Foo"); - secondTestPresence = boost::make_shared(); + secondTestPresence = std::make_shared(); secondTestPresence->setStatus("Bar"); stanzaChannelPresenceSender = new StanzaChannelPresenceSender(channel); } @@ -41,30 +41,30 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture { } void testSendPresence() { - boost::shared_ptr testling(createPresenceSender()); + std::shared_ptr testling(createPresenceSender()); testling->sendPresence(testPresence); CPPUNIT_ASSERT_EQUAL(1, static_cast(channel->sentStanzas.size())); - boost::shared_ptr presence = boost::dynamic_pointer_cast(channel->sentStanzas[0]); + std::shared_ptr presence = std::dynamic_pointer_cast(channel->sentStanzas[0]); CPPUNIT_ASSERT(testPresence == presence); } void testSendPresence_UndirectedPresenceWithDirectedPresenceReceivers() { - boost::shared_ptr testling(createPresenceSender()); + std::shared_ptr testling(createPresenceSender()); testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence); testling->sendPresence(testPresence); CPPUNIT_ASSERT_EQUAL(2, static_cast(channel->sentStanzas.size())); - boost::shared_ptr presence = boost::dynamic_pointer_cast(channel->sentStanzas[0]); + std::shared_ptr presence = std::dynamic_pointer_cast(channel->sentStanzas[0]); CPPUNIT_ASSERT(testPresence == presence); - presence = boost::dynamic_pointer_cast(channel->sentStanzas[1]); + presence = std::dynamic_pointer_cast(channel->sentStanzas[1]); CPPUNIT_ASSERT_EQUAL(testPresence->getStatus(), presence->getStatus()); CPPUNIT_ASSERT_EQUAL(JID("alice@wonderland.lit/teaparty"), presence->getTo()); } void testSendPresence_DirectedPresenceWithDirectedPresenceReceivers() { - boost::shared_ptr testling(createPresenceSender()); + std::shared_ptr testling(createPresenceSender()); testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence); channel->sentStanzas.clear(); @@ -72,25 +72,25 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture { testling->sendPresence(testPresence); CPPUNIT_ASSERT_EQUAL(1, static_cast(channel->sentStanzas.size())); - boost::shared_ptr presence = boost::dynamic_pointer_cast(channel->sentStanzas[0]); + std::shared_ptr presence = std::dynamic_pointer_cast(channel->sentStanzas[0]); CPPUNIT_ASSERT(testPresence == presence); } void testAddDirectedPresenceReceiver() { - boost::shared_ptr testling(createPresenceSender()); + std::shared_ptr testling(createPresenceSender()); testling->sendPresence(testPresence); channel->sentStanzas.clear(); testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence); CPPUNIT_ASSERT_EQUAL(1, static_cast(channel->sentStanzas.size())); - boost::shared_ptr presence = boost::dynamic_pointer_cast(channel->sentStanzas[0]); + std::shared_ptr presence = std::dynamic_pointer_cast(channel->sentStanzas[0]); CPPUNIT_ASSERT_EQUAL(testPresence->getStatus(), presence->getStatus()); CPPUNIT_ASSERT_EQUAL(JID("alice@wonderland.lit/teaparty"), presence->getTo()); } void testAddDirectedPresenceReceiver_WithoutSendingPresence() { - boost::shared_ptr testling(createPresenceSender()); + std::shared_ptr testling(createPresenceSender()); testling->sendPresence(testPresence); channel->sentStanzas.clear(); @@ -100,7 +100,7 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture { } void testAddDirectedPresenceReceiver_AfterSendingDirectedPresence() { - boost::shared_ptr testling(createPresenceSender()); + std::shared_ptr testling(createPresenceSender()); testling->sendPresence(testPresence); secondTestPresence->setTo(JID("foo@bar.com")); testling->sendPresence(secondTestPresence); @@ -109,25 +109,25 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture { testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence); CPPUNIT_ASSERT_EQUAL(1, static_cast(channel->sentStanzas.size())); - boost::shared_ptr presence = boost::dynamic_pointer_cast(channel->sentStanzas[0]); + std::shared_ptr presence = std::dynamic_pointer_cast(channel->sentStanzas[0]); CPPUNIT_ASSERT_EQUAL(testPresence->getStatus(), presence->getStatus()); CPPUNIT_ASSERT_EQUAL(JID("alice@wonderland.lit/teaparty"), presence->getTo()); } void testRemoveDirectedPresenceReceiver() { - boost::shared_ptr testling(createPresenceSender()); + std::shared_ptr testling(createPresenceSender()); testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::DontSendPresence); testling->removeDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence); testling->sendPresence(testPresence); CPPUNIT_ASSERT_EQUAL(2, static_cast(channel->sentStanzas.size())); - CPPUNIT_ASSERT_EQUAL(boost::dynamic_pointer_cast(channel->sentStanzas[0])->getType(), Presence::Unavailable); + CPPUNIT_ASSERT_EQUAL(std::dynamic_pointer_cast(channel->sentStanzas[0])->getType(), Presence::Unavailable); CPPUNIT_ASSERT(channel->sentStanzas[1] == testPresence); } void testRemoveDirectedPresenceReceiver_WithoutSendingPresence() { - boost::shared_ptr testling(createPresenceSender()); + std::shared_ptr testling(createPresenceSender()); testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence); channel->sentStanzas.clear(); @@ -146,8 +146,8 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture { private: DummyStanzaChannel* channel; StanzaChannelPresenceSender* stanzaChannelPresenceSender; - boost::shared_ptr testPresence; - boost::shared_ptr secondTestPresence; + std::shared_ptr testPresence; + std::shared_ptr secondTestPresence; }; CPPUNIT_TEST_SUITE_REGISTRATION(DirectedPresenceSenderTest); diff --git a/Swiften/Presence/UnitTest/PayloadAddingPresenceSenderTest.cpp b/Swiften/Presence/UnitTest/PayloadAddingPresenceSenderTest.cpp index 84c0838..234f303 100644 --- a/Swiften/Presence/UnitTest/PayloadAddingPresenceSenderTest.cpp +++ b/Swiften/Presence/UnitTest/PayloadAddingPresenceSenderTest.cpp @@ -41,7 +41,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture { } void testSetPayloadAddsPayloadOnPresenceSend() { - boost::shared_ptr testling(createSender()); + std::shared_ptr testling(createSender()); testling->setPayload(MyPayload::create("foo")); testling->sendPresence(Presence::create("bar")); @@ -52,7 +52,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture { } void testSetNullPayloadDoesNotAddPayloadOnPresenceSend() { - boost::shared_ptr testling(createSender()); + std::shared_ptr testling(createSender()); testling->setPayload(MyPayload::ref()); testling->sendPresence(Presence::create("bar")); @@ -63,7 +63,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture { } void testSendPresenceDoesNotAlterOriginalPayload() { - boost::shared_ptr testling(createSender()); + std::shared_ptr testling(createSender()); testling->setPayload(MyPayload::create("foo")); Presence::ref presence(Presence::create("bar")); @@ -73,7 +73,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture { } void testSetPayloadAfterInitialPresenceResendsPresence() { - boost::shared_ptr testling(createSender()); + std::shared_ptr testling(createSender()); testling->sendPresence(Presence::create("bar")); testling->setPayload(MyPayload::create("foo")); @@ -84,7 +84,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture { } void testSetPayloadAfterUnavailablePresenceDoesNotResendPresence() { - boost::shared_ptr testling(createSender()); + std::shared_ptr testling(createSender()); testling->sendPresence(Presence::create("bar")); @@ -98,7 +98,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture { } void testSetPayloadAfterResetDoesNotResendPresence() { - boost::shared_ptr testling(createSender()); + std::shared_ptr testling(createSender()); testling->sendPresence(Presence::create("bar")); testling->reset(); @@ -108,7 +108,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture { } void testSendDirectedPresenceIsNotResent() { - boost::shared_ptr testling(createSender()); + std::shared_ptr testling(createSender()); testling->sendPresence(Presence::create("bar")); Presence::ref directedPresence = Presence::create("baz"); @@ -121,13 +121,13 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createSender() { - boost::shared_ptr sender(new PayloadAddingPresenceSender(presenceSender)); + std::shared_ptr createSender() { + std::shared_ptr sender(new PayloadAddingPresenceSender(presenceSender)); return sender; } struct MyPayload : public Payload { - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; MyPayload(const std::string& body) : body(body) {} diff --git a/Swiften/Presence/UnitTest/PresenceOracleTest.cpp b/Swiften/Presence/UnitTest/PresenceOracleTest.cpp index 4f066c7..86a7925 100644 --- a/Swiften/Presence/UnitTest/PresenceOracleTest.cpp +++ b/Swiften/Presence/UnitTest/PresenceOracleTest.cpp @@ -1,11 +1,12 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ +#include + #include -#include #include #include @@ -109,7 +110,7 @@ class PresenceOracleTest : public CppUnit::TestFixture { } void testReceivePresence() { - boost::shared_ptr sentPresence(createPresence(user1)); + std::shared_ptr sentPresence(createPresence(user1)); stanzaChannel_->onPresenceReceived(sentPresence); CPPUNIT_ASSERT_EQUAL(1, static_cast(changes.size())); @@ -119,8 +120,8 @@ class PresenceOracleTest : public CppUnit::TestFixture { } void testReceivePresenceFromDifferentResources() { - boost::shared_ptr sentPresence1(createPresence(user1)); - boost::shared_ptr sentPresence2(createPresence(user1alt)); + std::shared_ptr sentPresence1(createPresence(user1)); + std::shared_ptr sentPresence2(createPresence(user1alt)); stanzaChannel_->onPresenceReceived(sentPresence1); stanzaChannel_->onPresenceReceived(sentPresence2); @@ -132,7 +133,7 @@ class PresenceOracleTest : public CppUnit::TestFixture { std::string reasonText = "Because I want to"; JID sentJID = JID("me@example.com"); - boost::shared_ptr sentPresence(new Presence()); + std::shared_ptr sentPresence(new Presence()); sentPresence->setType(Presence::Subscribe); sentPresence->setFrom(sentJID); sentPresence->setStatus(reasonText); @@ -145,7 +146,7 @@ class PresenceOracleTest : public CppUnit::TestFixture { } void testReconnectResetsPresences() { - boost::shared_ptr sentPresence(createPresence(user1)); + std::shared_ptr sentPresence(createPresence(user1)); stanzaChannel_->onPresenceReceived(sentPresence); stanzaChannel_->setAvailable(false); stanzaChannel_->setAvailable(true); @@ -189,7 +190,7 @@ class PresenceOracleTest : public CppUnit::TestFixture { private: Presence::ref createPresence(const JID &jid, int priority, Presence::Type type, const StatusShow::Type& statusShow) { - Presence::ref presence = boost::make_shared(); + Presence::ref presence = std::make_shared(); presence->setFrom(jid); presence->setPriority(priority); presence->setType(type); @@ -212,7 +213,7 @@ class PresenceOracleTest : public CppUnit::TestFixture { return presence; } - void handlePresenceChange(boost::shared_ptr newPresence) { + void handlePresenceChange(std::shared_ptr newPresence) { changes.push_back(newPresence); } @@ -223,8 +224,8 @@ class PresenceOracleTest : public CppUnit::TestFixture { subscriptionRequests.push_back(subscriptionRequest); } - boost::shared_ptr createPresence(const JID& jid) { - boost::shared_ptr sentPresence(new Presence("blarb")); + std::shared_ptr createPresence(const JID& jid) { + std::shared_ptr sentPresence(new Presence("blarb")); sentPresence->setFrom(jid); return sentPresence; } diff --git a/Swiften/PubSub/PubSubManager.h b/Swiften/PubSub/PubSubManager.h index daed7e5..c143a81 100644 --- a/Swiften/PubSub/PubSubManager.h +++ b/Swiften/PubSub/PubSubManager.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -34,8 +34,8 @@ #include #include #define SWIFTEN_PUBSUBMANAGER_DECLARE_CREATE_REQUEST(payload, container, response) \ - virtual boost::shared_ptr< PubSubRequest > \ - createRequest(IQ::Type, const JID&, boost::shared_ptr) = 0; + virtual std::shared_ptr< PubSubRequest > \ + createRequest(IQ::Type, const JID&, std::shared_ptr) = 0; namespace Swift { class JID; @@ -47,6 +47,6 @@ namespace Swift { SWIFTEN_PUBSUB_FOREACH_PUBSUB_PAYLOAD_TYPE( SWIFTEN_PUBSUBMANAGER_DECLARE_CREATE_REQUEST) - boost::signal)> onEvent; + boost::signal)> onEvent; }; } diff --git a/Swiften/PubSub/PubSubManagerImpl.cpp b/Swiften/PubSub/PubSubManagerImpl.cpp index b186a08..12eb25c 100644 --- a/Swiften/PubSub/PubSubManagerImpl.cpp +++ b/Swiften/PubSub/PubSubManagerImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -24,8 +24,8 @@ PubSubManagerImpl::~PubSubManagerImpl() { stanzaChannel->onMessageReceived.disconnect(boost::bind(&PubSubManagerImpl::handleMessageRecevied, this, _1)); } -void PubSubManagerImpl::handleMessageRecevied(boost::shared_ptr message) { - if (boost::shared_ptr event = message->getPayload()) { +void PubSubManagerImpl::handleMessageRecevied(std::shared_ptr message) { + if (std::shared_ptr event = message->getPayload()) { onEvent(message->getFrom(), event->getPayload()); } } diff --git a/Swiften/PubSub/PubSubManagerImpl.h b/Swiften/PubSub/PubSubManagerImpl.h index c752b84..58c5fc0 100644 --- a/Swiften/PubSub/PubSubManagerImpl.h +++ b/Swiften/PubSub/PubSubManagerImpl.h @@ -6,15 +6,15 @@ #pragma once -#include +#include #include #include #include #define SWIFTEN_PUBSUBMANAGERIMPL_DECLARE_CREATE_REQUEST(payload, container, response) \ - virtual boost::shared_ptr< PubSubRequest > \ - createRequest(IQ::Type type, const JID& receiver, boost::shared_ptr p) SWIFTEN_OVERRIDE { \ - return boost::make_shared< PubSubRequest >(type, receiver, p, router); \ + virtual std::shared_ptr< PubSubRequest > \ + createRequest(IQ::Type type, const JID& receiver, std::shared_ptr p) SWIFTEN_OVERRIDE { \ + return std::make_shared< PubSubRequest >(type, receiver, p, router); \ } namespace Swift { @@ -31,7 +31,7 @@ namespace Swift { SWIFTEN_PUBSUBMANAGERIMPL_DECLARE_CREATE_REQUEST) private: - void handleMessageRecevied(boost::shared_ptr); + void handleMessageRecevied(std::shared_ptr); private: StanzaChannel* stanzaChannel; diff --git a/Swiften/QA/ClientTest/ClientTest.cpp b/Swiften/QA/ClientTest/ClientTest.cpp index f34a501..9684234 100644 --- a/Swiften/QA/ClientTest/ClientTest.cpp +++ b/Swiften/QA/ClientTest/ClientTest.cpp @@ -42,7 +42,7 @@ static void handleDisconnected(boost::optional e) { } } -static void handleRosterReceived(boost::shared_ptr) { +static void handleRosterReceived(std::shared_ptr) { rosterReceived = true; std::cout << "Disconnecting" << std::endl; client->disconnect(); diff --git a/Swiften/QA/ConcurrentFileTransferTest/ConcurrentFileTransferTest.cpp b/Swiften/QA/ConcurrentFileTransferTest/ConcurrentFileTransferTest.cpp index b9ec7b8..8122c63 100644 --- a/Swiften/QA/ConcurrentFileTransferTest/ConcurrentFileTransferTest.cpp +++ b/Swiften/QA/ConcurrentFileTransferTest/ConcurrentFileTransferTest.cpp @@ -36,8 +36,8 @@ using namespace Swift; static const std::string CLIENT_NAME = "Swiften FT Test"; static const std::string CLIENT_NODE = "http://swift.im"; -static boost::shared_ptr eventLoop; -static boost::shared_ptr networkFactories; +static std::shared_ptr eventLoop; +static std::shared_ptr networkFactories; BoostRandomGenerator randGen; @@ -56,12 +56,12 @@ class ConcurrentFileTransferTest { private: int clientACandidates_; - boost::shared_ptr clientA_; + std::shared_ptr clientA_; std::map clientASendFiles_; int clientBCandidates_; - boost::shared_ptr clientB_; + std::shared_ptr clientB_; }; /** diff --git a/Swiften/QA/DNSSDTest/DNSSDTest.cpp b/Swiften/QA/DNSSDTest/DNSSDTest.cpp index 3b7191d..ae2fafd 100644 --- a/Swiften/QA/DNSSDTest/DNSSDTest.cpp +++ b/Swiften/QA/DNSSDTest/DNSSDTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -35,7 +35,7 @@ class DNSSDTest : public CppUnit::TestFixture { public: void setUp() { eventLoop = new DummyEventLoop(); - querier = boost::shared_ptr(new DNSSDQuerierType()); + querier = std::make_shared(); querier->start(); } @@ -46,7 +46,7 @@ class DNSSDTest : public CppUnit::TestFixture { } void testPublish() { - boost::shared_ptr browseQuery = querier->createBrowseQuery(); + std::shared_ptr browseQuery = querier->createBrowseQuery(); browseQuery->onServiceAdded.connect(boost::bind(&DNSSDTest::handleServiceAdded, this, _1)); browseQuery->onServiceRemoved.connect(boost::bind(&DNSSDTest::handleServiceRemoved, this, _1)); browseQuery->onError.connect(boost::bind(&DNSSDTest::handleBrowseError, this)); @@ -55,7 +55,7 @@ class DNSSDTest : public CppUnit::TestFixture { // Publish the service LinkLocalServiceInfo info; - boost::shared_ptr registerQuery = querier->createRegisterQuery("DNSSDTest", 1234, info.toTXTRecord()); + std::shared_ptr registerQuery = querier->createRegisterQuery("DNSSDTest", 1234, info.toTXTRecord()); registerQuery->onRegisterFinished.connect(boost::bind(&DNSSDTest::handleRegisterFinished, this, _1)); registerQuery->registerService(); @@ -82,7 +82,7 @@ class DNSSDTest : public CppUnit::TestFixture { // Resolve all added services for (size_t i = 0; i < added.size(); ++i) { resolvedServices.clear(); - boost::shared_ptr resolveServiceQuery = querier->createResolveServiceQuery(added[i]); + std::shared_ptr resolveServiceQuery = querier->createResolveServiceQuery(added[i]); resolveServiceQuery->onServiceResolved.connect(boost::bind(&DNSSDTest::handleResolveFinished, this, _1)); resolveServiceQuery->start(); wait(); @@ -137,7 +137,7 @@ class DNSSDTest : public CppUnit::TestFixture { private: DummyEventLoop* eventLoop; - boost::shared_ptr querier; + std::shared_ptr querier; std::vector added; std::vector registered; std::vector toRemove; diff --git a/Swiften/QA/FileTransferTest/FileTransferTest.cpp b/Swiften/QA/FileTransferTest/FileTransferTest.cpp index 8017927..dd8c139 100644 --- a/Swiften/QA/FileTransferTest/FileTransferTest.cpp +++ b/Swiften/QA/FileTransferTest/FileTransferTest.cpp @@ -35,8 +35,8 @@ using namespace Swift; static const std::string CLIENT_NAME = "Swiften FT Test"; static const std::string CLIENT_NODE = "http://swift.im"; -static boost::shared_ptr eventLoop; -static boost::shared_ptr networkFactories; +static std::shared_ptr eventLoop; +static std::shared_ptr networkFactories; BoostRandomGenerator randGen; @@ -50,12 +50,12 @@ enum Candidate { class FileTransferTest { public: FileTransferTest(int senderCandidates, int receiverCandidates) : senderCandidates_(senderCandidates), senderError_(FileTransferError::UnknownError), senderIsDone_(false), receiverCandidates_(receiverCandidates), receiverError_(FileTransferError::UnknownError), receiverIsDone_(false) { - sender_ = boost::make_shared(JID(getenv("SWIFT_FILETRANSFERTEST_JID")), getenv("SWIFT_FILETRANSFERTEST_PASS"), networkFactories.get()); + sender_ = std::make_shared(JID(getenv("SWIFT_FILETRANSFERTEST_JID")), getenv("SWIFT_FILETRANSFERTEST_PASS"), networkFactories.get()); sender_->onDisconnected.connect(boost::bind(&FileTransferTest::handleSenderDisconnected, this, _1)); sender_->onConnected.connect(boost::bind(&FileTransferTest::handleSenderConnected, this)); sender_->getEntityCapsProvider()->onCapsChanged.connect(boost::bind(&FileTransferTest::handleSenderCapsChanged, this, _1)); - receiver_ = boost::make_shared(JID(getenv("SWIFT_FILETRANSFERTEST2_JID")), getenv("SWIFT_FILETRANSFERTEST2_PASS"), networkFactories.get()); + receiver_ = std::make_shared(JID(getenv("SWIFT_FILETRANSFERTEST2_JID")), getenv("SWIFT_FILETRANSFERTEST2_PASS"), networkFactories.get()); receiver_->onConnected.connect(boost::bind(&FileTransferTest::handleReceiverConnected, this)); receiver_->onDisconnected.connect(boost::bind(&FileTransferTest::handleReceiverDisconnected, this, _1)); @@ -145,7 +145,7 @@ class FileTransferTest { void handleReceiverIncomingFileTransfer(IncomingFileTransfer::ref transfer) { incomingFileTransfers_.push_back(transfer); - boost::shared_ptr out = boost::make_shared(receiveFilePath_.native()); + std::shared_ptr out = std::make_shared(receiveFilePath_.native()); transfer->onFinished.connect(boost::bind(&FileTransferTest::handleReceiverFileTransferFinished, this, _1, out)); FileTransferOptions options; @@ -164,7 +164,7 @@ class FileTransferTest { void handleSenderCapsChanged(const JID &jid) { if (receiver_ && (receiver_->getJID().toBare() == jid.toBare())) { - boost::shared_ptr fileStream = boost::make_shared(sendFilePath_); + std::shared_ptr fileStream = std::make_shared(sendFilePath_); FileTransferOptions options; options = options.withInBandAllowed(senderCandidates_ & InBandBytestream); @@ -191,7 +191,7 @@ class FileTransferTest { } } - void handleReceiverFileTransferFinished(const boost::optional& error, boost::shared_ptr out) { + void handleReceiverFileTransferFinished(const boost::optional& error, std::shared_ptr out) { out->close(); receiverError_ = error; receiverIsDone_ = true; @@ -276,7 +276,7 @@ class FileTransferTest { private: int senderCandidates_; - boost::shared_ptr sender_; + std::shared_ptr sender_; ClientXMLTracer* senderTracer_; ByteArray sendData_; OutgoingFileTransfer::ref outgoingFileTransfer_; @@ -285,7 +285,7 @@ class FileTransferTest { bool senderIsDone_; int receiverCandidates_; - boost::shared_ptr receiver_; + std::shared_ptr receiver_; ClientXMLTracer* receiverTracer_; ByteArray receiveData_; std::vector incomingFileTransfers_; @@ -302,10 +302,10 @@ static bool runTest(int senderCandidates, int receiverCandidates) { std::cout << "senderCandidates: " << senderCandidates << ", receiverCandidates: " << receiverCandidates << std::endl; bool expectSuccess = (senderCandidates & receiverCandidates) > 0; - eventLoop = boost::make_shared(); - networkFactories = boost::make_shared(eventLoop.get()); + eventLoop = std::make_shared(); + networkFactories = std::make_shared(eventLoop.get()); - boost::shared_ptr testRun = boost::make_shared(senderCandidates, receiverCandidates); + std::shared_ptr testRun = std::make_shared(senderCandidates, receiverCandidates); testRun->run(); diff --git a/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp b/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp index a415a0f..11b0eb5 100644 --- a/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp +++ b/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp @@ -1,13 +1,12 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ +#include #include -#include - #include #include @@ -194,7 +193,7 @@ class BoostConnectionServerTest : public CppUnit::TestFixture { stoppedError_ = e; } - void handleNewConnection(boost::shared_ptr connection) { + void handleNewConnection(std::shared_ptr connection) { receivedNewConnection_ = true; remoteAddress_ = connection->getRemoteAddress(); } diff --git a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp index f09e1a7..12c4a77 100755 --- a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp +++ b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp @@ -4,11 +4,10 @@ * See the COPYING file for more information. */ +#include #include #include -#include -#include #include #include @@ -38,7 +37,7 @@ class BoostConnectionTest : public CppUnit::TestFixture { void setUp() { eventLoop_ = new DummyEventLoop(); boostIOServiceThread_ = new BoostIOServiceThread(); - boostIOService_ = boost::make_shared(); + boostIOService_ = std::make_shared(); disconnected_ = false; connectFinished_ = false; } @@ -145,7 +144,7 @@ class BoostConnectionTest : public CppUnit::TestFixture { connection->write(createSafeByteArray("\r\n\r\n")); // Temporarily, while we don't have an xmpp server running on ipv6 } - void handleDataRead(boost::shared_ptr data) { + void handleDataRead(std::shared_ptr data) { append(receivedData_, *data); } @@ -159,7 +158,7 @@ class BoostConnectionTest : public CppUnit::TestFixture { private: BoostIOServiceThread* boostIOServiceThread_; - boost::shared_ptr boostIOService_; + std::shared_ptr boostIOService_; DummyEventLoop* eventLoop_; ByteArray receivedData_; bool disconnected_; diff --git a/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp b/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp index 05dd3a1..d45d118 100644 --- a/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp +++ b/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp @@ -67,7 +67,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture { void setUp() { ioServiceThread = new BoostIOServiceThread(); eventLoop = new DummyEventLoop(); - idnConverter = boost::shared_ptr(PlatformIDNConverter::create()); + idnConverter = std::shared_ptr(PlatformIDNConverter::create()); #ifdef USE_UNBOUND resolver = new UnboundDomainNameResolver(idnConverter.get(), ioServiceThread->getIOService(), eventLoop); #else @@ -83,7 +83,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture { } void testResolveAddress() { - boost::shared_ptr query(createAddressQuery("xmpp.test.swift.im")); + std::shared_ptr query(createAddressQuery("xmpp.test.swift.im")); query->run(); waitForResults(); @@ -94,7 +94,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture { } void testResolveAddress_Error() { - boost::shared_ptr query(createAddressQuery("invalid.test.swift.im")); + std::shared_ptr query(createAddressQuery("invalid.test.swift.im")); query->run(); waitForResults(); @@ -103,7 +103,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture { } void testResolveAddress_IPv6() { - boost::shared_ptr query(createAddressQuery("xmpp-ipv6.test.swift.im")); + std::shared_ptr query(createAddressQuery("xmpp-ipv6.test.swift.im")); query->run(); waitForResults(); @@ -113,7 +113,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture { } void testResolveAddress_IPv4and6() { - boost::shared_ptr query(createAddressQuery("xmpp-ipv46.test.swift.im")); + std::shared_ptr query(createAddressQuery("xmpp-ipv46.test.swift.im")); query->run(); waitForResults(); @@ -125,7 +125,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture { } void testResolveAddress_International() { - boost::shared_ptr query(createAddressQuery("tron\xc3\xa7on.test.swift.im")); + std::shared_ptr query(createAddressQuery("tron\xc3\xa7on.test.swift.im")); query->run(); waitForResults(); @@ -136,7 +136,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture { } void testResolveAddress_Localhost() { - boost::shared_ptr query(createAddressQuery("localhost")); + std::shared_ptr query(createAddressQuery("localhost")); query->run(); waitForResults(); @@ -172,7 +172,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture { } void testResolveService() { - boost::shared_ptr query(createServiceQuery("_xmpp-client._tcp.", "xmpp-srv.test.swift.im")); + std::shared_ptr query(createServiceQuery("_xmpp-client._tcp.", "xmpp-srv.test.swift.im")); query->run(); waitForResults(); @@ -200,8 +200,8 @@ class DomainNameResolverTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createAddressQuery(const std::string& domain) { - boost::shared_ptr result = resolver->createAddressQuery(domain); + std::shared_ptr createAddressQuery(const std::string& domain) { + std::shared_ptr result = resolver->createAddressQuery(domain); result->onResult.connect(boost::bind(&DomainNameResolverTest::handleAddressQueryResult, this, _1, _2)); return result; } @@ -214,8 +214,8 @@ class DomainNameResolverTest : public CppUnit::TestFixture { resultsAvailable = true; } - boost::shared_ptr createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) { - boost::shared_ptr result = resolver->createServiceQuery(serviceLookupPrefix, domain); + std::shared_ptr createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) { + std::shared_ptr result = resolver->createServiceQuery(serviceLookupPrefix, domain); result->onResult.connect(boost::bind(&DomainNameResolverTest::handleServiceQueryResult, this, _1)); return result; } @@ -241,8 +241,8 @@ class DomainNameResolverTest : public CppUnit::TestFixture { private: BoostIOServiceThread* ioServiceThread; DummyEventLoop* eventLoop; - boost::shared_ptr idnConverter; - boost::shared_ptr timerFactory; + std::shared_ptr idnConverter; + std::shared_ptr timerFactory; bool resultsAvailable; std::vector addressQueryResult; std::vector allAddressQueryResults; diff --git a/Swiften/QA/ReconnectTest/ReconnectTest.cpp b/Swiften/QA/ReconnectTest/ReconnectTest.cpp index 611c846..27c7e23 100644 --- a/Swiften/QA/ReconnectTest/ReconnectTest.cpp +++ b/Swiften/QA/ReconnectTest/ReconnectTest.cpp @@ -25,7 +25,7 @@ Client* client_; SimpleEventLoop eventLoop_; int count = 0; -void handleTick(boost::shared_ptr timer) { +void handleTick(std::shared_ptr timer) { std::cout << "Count " << count++ << std::endl; if (timer) { timer->stop(); @@ -43,7 +43,7 @@ void handleTick(boost::shared_ptr timer) { int delay = 500; // int delay = 0; - boost::shared_ptr newTimer(BoostTimer::create(delay, &MainBoostIOServiceThread::getInstance().getIOService())); + std::shared_ptr newTimer(BoostTimer::create(delay, &MainBoostIOServiceThread::getInstance().getIOService())); newTimer->onTick.connect(boost::bind(&handleTick, timer)); newTimer->start(); } @@ -64,7 +64,7 @@ int main(int, char**) { std::string pass(passChars); client_ = new Swift::Client(jid, pass); - handleTick(boost::shared_ptr()); + handleTick(std::shared_ptr()); eventLoop_.run(); delete client_; diff --git a/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp b/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp index 5b3867c..e601de9 100644 --- a/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp +++ b/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp @@ -32,24 +32,24 @@ class FileReadBytestreamTest : public CppUnit::TestFixture { } void testRead() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); - boost::shared_ptr< std::vector > result = testling->read(10); + std::shared_ptr< std::vector > result = testling->read(10); CPPUNIT_ASSERT(createByteArray("/*\n * Copy") == *result.get()); } void testRead_Twice() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); testling->read(10); - boost::shared_ptr< std::vector > result = testling->read(10); + std::shared_ptr< std::vector > result = testling->read(10); CPPUNIT_ASSERT_EQUAL(std::string("right (c) "), byteArrayToString(*result)); } void testIsFinished_NotFinished() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); testling->read(10); @@ -57,7 +57,7 @@ class FileReadBytestreamTest : public CppUnit::TestFixture { } void testIsFinished_IsFinished() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); testling->read(4096); diff --git a/Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp b/Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp index e847c28..d6963a4 100644 --- a/Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp +++ b/Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp @@ -29,7 +29,7 @@ class FileWriteBytestreamTest : public CppUnit::TestFixture { void testSuccessfulWrite() { boost::filesystem::path filename = boost::filesystem::unique_path("write_file_bytestream_test_%%%%%%%%%%%%%%%%.bin"); - boost::shared_ptr writeBytestream = boost::make_shared(filename.string()); + std::shared_ptr writeBytestream = std::make_shared(filename.string()); writeBytestream->onWrite.connect(boost::bind(&FileWriteBytestreamTest::handleOnWrite, this, _1)); CPPUNIT_ASSERT_EQUAL(true, writeBytestream->write(createByteArray("Some data."))); @@ -39,7 +39,7 @@ class FileWriteBytestreamTest : public CppUnit::TestFixture { } void testFailingWrite() { - boost::shared_ptr writeBytestream = boost::make_shared(""); + std::shared_ptr writeBytestream = std::make_shared(""); writeBytestream->onWrite.connect(boost::bind(&FileWriteBytestreamTest::handleOnWrite, this, _1)); CPPUNIT_ASSERT_EQUAL(false, writeBytestream->write(createByteArray("Some data."))); diff --git a/Swiften/QA/StorageTest/VCardFileStorageTest.cpp b/Swiften/QA/StorageTest/VCardFileStorageTest.cpp index 69e5917..0dae2f3 100644 --- a/Swiften/QA/StorageTest/VCardFileStorageTest.cpp +++ b/Swiften/QA/StorageTest/VCardFileStorageTest.cpp @@ -43,7 +43,7 @@ class VCardFileStorageTest : public CppUnit::TestFixture { } void testSetVCard() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); VCard::ref vcard(new VCard()); vcard->setFullName("Alice In Wonderland"); @@ -73,7 +73,7 @@ class VCardFileStorageTest : public CppUnit::TestFixture { } void testGetVCard() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); VCard::ref vcard(new VCard()); vcard->setFullName("Alice In Wonderland"); testling->setVCard(JID("alice@wonderland.lit"), vcard); @@ -99,7 +99,7 @@ class VCardFileStorageTest : public CppUnit::TestFixture { } void testGetVCard_FileDoesNotExist() { - boost::shared_ptr testling(createTestling()); + std::shared_ptr testling(createTestling()); VCard::ref result = testling->getVCard(JID("alice@wonderland.lit")); CPPUNIT_ASSERT(!result); } diff --git a/Swiften/QA/TLSTest/CertificateErrorTest.cpp b/Swiften/QA/TLSTest/CertificateErrorTest.cpp index b928a3f..abd004e 100644 --- a/Swiften/QA/TLSTest/CertificateErrorTest.cpp +++ b/Swiften/QA/TLSTest/CertificateErrorTest.cpp @@ -50,7 +50,7 @@ class CertificateErrorTest : public CppUnit::TestFixture { void setUp() { eventLoop_ = new DummyEventLoop(); boostIOServiceThread_ = new BoostIOServiceThread(); - boostIOService_ = boost::make_shared(); + boostIOService_ = std::make_shared(); connectionFactory_ = new BoostConnectionFactory(boostIOServiceThread_->getIOService(), eventLoop_); idnConverter_ = PlatformIDNConverter::create(); domainNameResolver_ = new PlatformDomainNameResolver(idnConverter_, eventLoop_); @@ -81,7 +81,7 @@ class CertificateErrorTest : public CppUnit::TestFixture { } HostAddress resolveName(const std::string& name) { - boost::shared_ptr query = domainNameResolver_->createAddressQuery(name); + std::shared_ptr query = domainNameResolver_->createAddressQuery(name); query->onResult.connect(boost::bind(&CertificateErrorTest::handleAddressQueryResult, this, _1, _2)); lastResoverResult_ = HostAddress(); resolvingDone_ = false; @@ -94,7 +94,7 @@ class CertificateErrorTest : public CppUnit::TestFixture { return lastResoverResult_; } - void connectToServer(boost::shared_ptr connection, const std::string& hostname, int port) { + void connectToServer(std::shared_ptr connection, const std::string& hostname, int port) { connection->onConnectFinished.connect(boost::bind(&CertificateErrorTest::handleConnectFinished, this, _1)); HostAddress address = resolveName(hostname); @@ -107,7 +107,7 @@ class CertificateErrorTest : public CppUnit::TestFixture { } void testTLS_O_MaticTrusted() { - boost::shared_ptr connection = boost::dynamic_pointer_cast(tlsConnectionFactory_->createConnection()); + std::shared_ptr connection = std::dynamic_pointer_cast(tlsConnectionFactory_->createConnection()); TLSContext* context = connection->getTLSContext(); connectToServer(connection, "test1.tls-o-matic.com", 443); @@ -117,7 +117,7 @@ class CertificateErrorTest : public CppUnit::TestFixture { } void testTLS_O_MaticCertificateFromTheFuture() { - boost::shared_ptr connection = boost::dynamic_pointer_cast(tlsConnectionFactory_->createConnection()); + std::shared_ptr connection = std::dynamic_pointer_cast(tlsConnectionFactory_->createConnection()); TLSContext* context = connection->getTLSContext(); connectToServer(connection, "test5.tls-o-matic.com", 405); @@ -133,7 +133,7 @@ class CertificateErrorTest : public CppUnit::TestFixture { } void testTLS_O_MaticCertificateFromThePast() { - boost::shared_ptr connection = boost::dynamic_pointer_cast(tlsConnectionFactory_->createConnection()); + std::shared_ptr connection = std::dynamic_pointer_cast(tlsConnectionFactory_->createConnection()); TLSContext* context = connection->getTLSContext(); connectToServer(connection, "test6.tls-o-matic.com", 406); @@ -144,7 +144,7 @@ class CertificateErrorTest : public CppUnit::TestFixture { } void testTLS_O_MaticCertificateFromUnknownCA() { - boost::shared_ptr connection = boost::dynamic_pointer_cast(tlsConnectionFactory_->createConnection()); + std::shared_ptr connection = std::dynamic_pointer_cast(tlsConnectionFactory_->createConnection()); TLSContext* context = connection->getTLSContext(); connectToServer(connection, "test7.tls-o-matic.com", 407); @@ -156,7 +156,7 @@ class CertificateErrorTest : public CppUnit::TestFixture { // test14.tls-o-matic.com:414 void testTLS_O_MaticCertificateWrongPurpose() { - boost::shared_ptr connection = boost::dynamic_pointer_cast(tlsConnectionFactory_->createConnection()); + std::shared_ptr connection = std::dynamic_pointer_cast(tlsConnectionFactory_->createConnection()); TLSContext* context = connection->getTLSContext(); connectToServer(connection, "test14.tls-o-matic.com", 414); @@ -168,7 +168,7 @@ class CertificateErrorTest : public CppUnit::TestFixture { void testRevokedCertificateRevocationDisabled() { tlsContextFactory_->setCheckCertificateRevocation(false); - boost::shared_ptr connection = boost::dynamic_pointer_cast(tlsConnectionFactory_->createConnection()); + std::shared_ptr connection = std::dynamic_pointer_cast(tlsConnectionFactory_->createConnection()); TLSContext* context = connection->getTLSContext(); connectToServer(connection, "revoked.grc.com", 443); @@ -179,7 +179,7 @@ class CertificateErrorTest : public CppUnit::TestFixture { void testRevokedCertificateRevocationEnabled() { tlsContextFactory_->setCheckCertificateRevocation(true); - boost::shared_ptr connection = boost::dynamic_pointer_cast(tlsConnectionFactory_->createConnection()); + std::shared_ptr connection = std::dynamic_pointer_cast(tlsConnectionFactory_->createConnection()); TLSContext* context = connection->getTLSContext(); connectToServer(connection, "revoked.grc.com", 443); @@ -204,7 +204,7 @@ class CertificateErrorTest : public CppUnit::TestFixture { private: BoostIOServiceThread* boostIOServiceThread_; - boost::shared_ptr boostIOService_; + std::shared_ptr boostIOService_; DummyEventLoop* eventLoop_; ConnectionFactory* connectionFactory_; PlatformTLSFactories* tlsFactories_; diff --git a/Swiften/Queries/DummyIQChannel.h b/Swiften/Queries/DummyIQChannel.h index 3f896e0..5ec68ca 100644 --- a/Swiften/Queries/DummyIQChannel.h +++ b/Swiften/Queries/DummyIQChannel.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -15,7 +15,7 @@ namespace Swift { public: DummyIQChannel() {} - virtual void sendIQ(boost::shared_ptr iq) { + virtual void sendIQ(std::shared_ptr iq) { iqs_.push_back(iq); } @@ -27,6 +27,6 @@ namespace Swift { return true; } - std::vector > iqs_; + std::vector > iqs_; }; } diff --git a/Swiften/Queries/GenericRequest.h b/Swiften/Queries/GenericRequest.h index ad3ec19..2795a54 100644 --- a/Swiften/Queries/GenericRequest.h +++ b/Swiften/Queries/GenericRequest.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -23,7 +23,7 @@ namespace Swift { template class SWIFTEN_API GenericRequest : public Request { public: - typedef boost::shared_ptr > ref; + typedef std::shared_ptr > ref; public: /** @@ -36,7 +36,7 @@ namespace Swift { GenericRequest( IQ::Type type, const JID& receiver, - boost::shared_ptr payload, + std::shared_ptr payload, IQRouter* router) : Request(type, receiver, payload, router) { } @@ -53,7 +53,7 @@ namespace Swift { IQ::Type type, const JID& sender, const JID& receiver, - boost::shared_ptr payload, + std::shared_ptr payload, IQRouter* router) : Request(type, sender, receiver, payload, router) { } @@ -61,19 +61,19 @@ namespace Swift { /** * Internal method, do not use. */ - virtual void handleResponse(boost::shared_ptr payload, ErrorPayload::ref error) { - onResponse(boost::dynamic_pointer_cast(payload), error); + virtual void handleResponse(std::shared_ptr payload, ErrorPayload::ref error) { + onResponse(std::dynamic_pointer_cast(payload), error); } public: - boost::shared_ptr getPayloadGeneric() const { - return boost::dynamic_pointer_cast(getPayload()); + std::shared_ptr getPayloadGeneric() const { + return std::dynamic_pointer_cast(getPayload()); } public: /** * Signal emitted when a reply to the iq has been received. Contains a payload if one was present, and an error if one was present. */ - boost::signal, ErrorPayload::ref)> onResponse; + boost::signal, ErrorPayload::ref)> onResponse; }; } diff --git a/Swiften/Queries/GetResponder.h b/Swiften/Queries/GetResponder.h index cda23d6..18dd694 100644 --- a/Swiften/Queries/GetResponder.h +++ b/Swiften/Queries/GetResponder.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -16,6 +16,6 @@ namespace Swift { GetResponder(IQRouter* router) : Responder(router) {} private: - virtual bool handleSetRequest(const JID&, const JID&, const std::string&, boost::shared_ptr) { return false; } + virtual bool handleSetRequest(const JID&, const JID&, const std::string&, std::shared_ptr) { return false; } }; } diff --git a/Swiften/Queries/IQChannel.h b/Swiften/Queries/IQChannel.h index d762847..2974ecc 100644 --- a/Swiften/Queries/IQChannel.h +++ b/Swiften/Queries/IQChannel.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -19,11 +18,11 @@ namespace Swift { public: virtual ~IQChannel(); - virtual void sendIQ(boost::shared_ptr) = 0; + virtual void sendIQ(std::shared_ptr) = 0; virtual std::string getNewIQID() = 0; virtual bool isAvailable() const = 0; - boost::signal)> onIQReceived; + boost::signal)> onIQReceived; }; } diff --git a/Swiften/Queries/IQHandler.h b/Swiften/Queries/IQHandler.h index 3581b85..1bfdf0f 100644 --- a/Swiften/Queries/IQHandler.h +++ b/Swiften/Queries/IQHandler.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -18,6 +18,6 @@ namespace Swift { public: virtual ~IQHandler(); - virtual bool handleIQ(boost::shared_ptr) = 0; + virtual bool handleIQ(std::shared_ptr) = 0; }; } diff --git a/Swiften/Queries/IQRouter.cpp b/Swiften/Queries/IQRouter.cpp index b32cdf1..e28c2f4 100644 --- a/Swiften/Queries/IQRouter.cpp +++ b/Swiften/Queries/IQRouter.cpp @@ -30,13 +30,13 @@ bool IQRouter::isAvailable() { return channel_->isAvailable(); } -void IQRouter::handleIQ(boost::shared_ptr iq) { +void IQRouter::handleIQ(std::shared_ptr iq) { queueRemoves_ = true; bool handled = false; // Go through the handlers in reverse order, to give precedence to the last added handler - std::vector >::const_reverse_iterator i = handlers_.rbegin(); - std::vector >::const_reverse_iterator rend = handlers_.rend(); + std::vector >::const_reverse_iterator i = handlers_.rbegin(); + std::vector >::const_reverse_iterator rend = handlers_.rend(); for (; i != rend; ++i) { handled |= (*i)->handleIQ(iq); if (handled) { @@ -53,25 +53,25 @@ void IQRouter::handleIQ(boost::shared_ptr iq) { } void IQRouter::processPendingRemoves() { - foreach(boost::shared_ptr handler, queuedRemoves_) { + foreach(std::shared_ptr handler, queuedRemoves_) { erase(handlers_, handler); } queuedRemoves_.clear(); } void IQRouter::addHandler(IQHandler* handler) { - addHandler(boost::shared_ptr(handler, noop)); + addHandler(std::shared_ptr(handler, noop)); } void IQRouter::removeHandler(IQHandler* handler) { - removeHandler(boost::shared_ptr(handler, noop)); + removeHandler(std::shared_ptr(handler, noop)); } -void IQRouter::addHandler(boost::shared_ptr handler) { +void IQRouter::addHandler(std::shared_ptr handler) { handlers_.push_back(handler); } -void IQRouter::removeHandler(boost::shared_ptr handler) { +void IQRouter::removeHandler(std::shared_ptr handler) { if (queueRemoves_) { queuedRemoves_.push_back(handler); } @@ -80,7 +80,7 @@ void IQRouter::removeHandler(boost::shared_ptr handler) { } } -void IQRouter::sendIQ(boost::shared_ptr iq) { +void IQRouter::sendIQ(std::shared_ptr iq) { if (from_.isValid() && !iq->getFrom().isValid()) { iq->setFrom(from_); } diff --git a/Swiften/Queries/IQRouter.h b/Swiften/Queries/IQRouter.h index 376fb08..eda7cfb 100644 --- a/Swiften/Queries/IQRouter.h +++ b/Swiften/Queries/IQRouter.h @@ -6,11 +6,10 @@ #pragma once +#include #include #include -#include - #include #include @@ -50,8 +49,8 @@ namespace Swift { void addHandler(IQHandler* handler); void removeHandler(IQHandler* handler); - void addHandler(boost::shared_ptr handler); - void removeHandler(boost::shared_ptr handler); + void addHandler(std::shared_ptr handler); + void removeHandler(std::shared_ptr handler); /** * Sends an IQ stanza. @@ -60,7 +59,7 @@ namespace Swift { * be set as the 'from' address on iq before sending * it. */ - void sendIQ(boost::shared_ptr iq); + void sendIQ(std::shared_ptr iq); std::string getNewIQID(); bool isAvailable(); @@ -76,15 +75,15 @@ namespace Swift { } private: - void handleIQ(boost::shared_ptr iq); + void handleIQ(std::shared_ptr iq); void processPendingRemoves(); private: IQChannel* channel_; JID jid_; JID from_; - std::vector< boost::shared_ptr > handlers_; - std::vector< boost::shared_ptr > queuedRemoves_; + std::vector< std::shared_ptr > handlers_; + std::vector< std::shared_ptr > queuedRemoves_; bool queueRemoves_; }; } diff --git a/Swiften/Queries/PubSubRequest.h b/Swiften/Queries/PubSubRequest.h index 7218f83..888b531 100644 --- a/Swiften/Queries/PubSubRequest.h +++ b/Swiften/Queries/PubSubRequest.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -56,10 +56,10 @@ namespace Swift { PubSubRequest( IQ::Type type, const JID& receiver, - boost::shared_ptr payload, + std::shared_ptr payload, IQRouter* router) : Request(type, receiver, router) { - boost::shared_ptr wrapper = boost::make_shared(); + std::shared_ptr wrapper = std::make_shared(); wrapper->setPayload(payload); setPayload(wrapper); } @@ -68,24 +68,24 @@ namespace Swift { IQ::Type type, const JID& sender, const JID& receiver, - boost::shared_ptr payload, + std::shared_ptr payload, IQRouter* router) : Request(type, sender, receiver, router) { - boost::shared_ptr wrapper = boost::make_shared(); + std::shared_ptr wrapper = std::make_shared(); wrapper->setPayload(payload); setPayload(wrapper); } virtual void handleResponse( - boost::shared_ptr payload, ErrorPayload::ref error) { - boost::shared_ptr result; - if (boost::shared_ptr container = boost::dynamic_pointer_cast(payload)) { - result = boost::dynamic_pointer_cast(container->getPayload()); + std::shared_ptr payload, ErrorPayload::ref error) { + std::shared_ptr result; + if (std::shared_ptr container = std::dynamic_pointer_cast(payload)) { + result = std::dynamic_pointer_cast(container->getPayload()); } onResponse(result, error); } public: - boost::signal, ErrorPayload::ref)> onResponse; + boost::signal, ErrorPayload::ref)> onResponse; }; } diff --git a/Swiften/Queries/RawRequest.h b/Swiften/Queries/RawRequest.h index c4ab85c..90290e8 100644 --- a/Swiften/Queries/RawRequest.h +++ b/Swiften/Queries/RawRequest.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -22,7 +21,7 @@ namespace Swift { class SWIFTEN_API RawRequest : public Request { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static ref create(IQ::Type type, const JID& recipient, const std::string& data, IQRouter* router) { return ref(new RawRequest(type, recipient, data, router)); @@ -31,10 +30,10 @@ namespace Swift { boost::signal onResponse; private: - RawRequest(IQ::Type type, const JID& receiver, const std::string& data, IQRouter* router) : Request(type, receiver, boost::make_shared(data), router) { + RawRequest(IQ::Type type, const JID& receiver, const std::string& data, IQRouter* router) : Request(type, receiver, std::make_shared(data), router) { } - virtual void handleResponse(boost::shared_ptr payload, ErrorPayload::ref error) { + virtual void handleResponse(std::shared_ptr payload, ErrorPayload::ref error) { if (error) { onResponse(ErrorSerializer(&serializers).serializePayload(error)); } diff --git a/Swiften/Queries/Request.cpp b/Swiften/Queries/Request.cpp index a8dff24..12eaae5 100644 --- a/Swiften/Queries/Request.cpp +++ b/Swiften/Queries/Request.cpp @@ -12,13 +12,13 @@ namespace Swift { -Request::Request(IQ::Type type, const JID& receiver, boost::shared_ptr payload, IQRouter* router) : router_(router), type_(type), receiver_(receiver), payload_(payload), sent_(false) { +Request::Request(IQ::Type type, const JID& receiver, std::shared_ptr payload, IQRouter* router) : router_(router), type_(type), receiver_(receiver), payload_(payload), sent_(false) { } Request::Request(IQ::Type type, const JID& receiver, IQRouter* router) : router_(router), type_(type), receiver_(receiver), sent_(false) { } -Request::Request(IQ::Type type, const JID& sender, const JID& receiver, boost::shared_ptr payload, IQRouter* router) : router_(router), type_(type), sender_(sender), receiver_(receiver), payload_(payload), sent_(false) { +Request::Request(IQ::Type type, const JID& sender, const JID& receiver, std::shared_ptr payload, IQRouter* router) : router_(router), type_(type), sender_(sender), receiver_(receiver), payload_(payload), sent_(false) { } Request::Request(IQ::Type type, const JID& sender, const JID& receiver, IQRouter* router) : router_(router), type_(type), sender_(sender), receiver_(receiver), sent_(false) { @@ -29,7 +29,7 @@ std::string Request::send() { assert(!sent_); sent_ = true; - boost::shared_ptr iq(new IQ(type_)); + std::shared_ptr iq(new IQ(type_)); iq->setTo(receiver_); iq->setFrom(sender_); iq->addPayload(payload_); @@ -47,14 +47,14 @@ std::string Request::send() { return id_; } -bool Request::handleIQ(boost::shared_ptr iq) { +bool Request::handleIQ(std::shared_ptr iq) { bool handled = false; if (iq->getType() == IQ::Result || iq->getType() == IQ::Error) { if (sent_ && iq->getID() == id_) { if (isCorrectSender(iq->getFrom())) { if (iq->getType() == IQ::Result) { - boost::shared_ptr payload = iq->getPayloadOfSameType(payload_); - if (!payload && boost::dynamic_pointer_cast(payload_) && !iq->getPayloads().empty()) { + std::shared_ptr payload = iq->getPayloadOfSameType(payload_); + if (!payload && std::dynamic_pointer_cast(payload_) && !iq->getPayloads().empty()) { payload = iq->getPayloads().front(); } handleResponse(payload, ErrorPayload::ref()); @@ -62,10 +62,10 @@ bool Request::handleIQ(boost::shared_ptr iq) { else { ErrorPayload::ref errorPayload = iq->getPayload(); if (errorPayload) { - handleResponse(boost::shared_ptr(), errorPayload); + handleResponse(std::shared_ptr(), errorPayload); } else { - handleResponse(boost::shared_ptr(), ErrorPayload::ref(new ErrorPayload(ErrorPayload::UndefinedCondition))); + handleResponse(std::shared_ptr(), ErrorPayload::ref(new ErrorPayload(ErrorPayload::UndefinedCondition))); } } router_->removeHandler(this); diff --git a/Swiften/Queries/Request.h b/Swiften/Queries/Request.h index 7ad0dd6..a62c103 100644 --- a/Swiften/Queries/Request.h +++ b/Swiften/Queries/Request.h @@ -6,11 +6,10 @@ #pragma once +#include #include -#include #include -#include #include #include @@ -23,7 +22,7 @@ namespace Swift { /** * An IQ get/set request query. */ - class SWIFTEN_API Request : public IQHandler, public boost::enable_shared_from_this { + class SWIFTEN_API Request : public IQHandler, public std::enable_shared_from_this { public: std::string send(); @@ -48,7 +47,7 @@ namespace Swift { Request( IQ::Type type, const JID& receiver, - boost::shared_ptr payload, + std::shared_ptr payload, IQRouter* router); /** @@ -59,7 +58,7 @@ namespace Swift { IQ::Type type, const JID& sender, const JID& receiver, - boost::shared_ptr payload, + std::shared_ptr payload, IQRouter* router); @@ -81,18 +80,18 @@ namespace Swift { IQRouter* router); - virtual void setPayload(boost::shared_ptr payload) { + virtual void setPayload(std::shared_ptr payload) { payload_ = payload; } - boost::shared_ptr getPayload() const { + std::shared_ptr getPayload() const { return payload_; } - virtual void handleResponse(boost::shared_ptr, boost::shared_ptr) = 0; + virtual void handleResponse(std::shared_ptr, std::shared_ptr) = 0; private: - bool handleIQ(boost::shared_ptr); + bool handleIQ(std::shared_ptr); bool isCorrectSender(const JID& jid); private: @@ -100,7 +99,7 @@ namespace Swift { IQ::Type type_; JID sender_; JID receiver_; - boost::shared_ptr payload_; + std::shared_ptr payload_; std::string id_; bool sent_; }; diff --git a/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h b/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h index ad4caf7..b187fa5 100644 --- a/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h +++ b/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h @@ -13,7 +13,7 @@ namespace Swift { class SWIFTEN_API GetInBandRegistrationFormRequest : public GenericRequest { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static ref create(const JID& to, IQRouter* router) { return ref(new GetInBandRegistrationFormRequest(to, router)); diff --git a/Swiften/Queries/Requests/GetPrivateStorageRequest.h b/Swiften/Queries/Requests/GetPrivateStorageRequest.h index eecd4d4..e5904fe 100644 --- a/Swiften/Queries/Requests/GetPrivateStorageRequest.h +++ b/Swiften/Queries/Requests/GetPrivateStorageRequest.h @@ -6,8 +6,7 @@ #pragma once -#include -#include +#include #include #include @@ -19,27 +18,27 @@ namespace Swift { template class SWIFTEN_API GetPrivateStorageRequest : public Request { public: - typedef boost::shared_ptr > ref; + typedef std::shared_ptr > ref; static ref create(IQRouter* router) { return ref(new GetPrivateStorageRequest(router)); } private: - GetPrivateStorageRequest(IQRouter* router) : Request(IQ::Get, JID(), boost::make_shared(boost::shared_ptr(new PAYLOAD_TYPE())), router) { + GetPrivateStorageRequest(IQRouter* router) : Request(IQ::Get, JID(), std::make_shared(std::make_shared()), router) { } - virtual void handleResponse(boost::shared_ptr payload, ErrorPayload::ref error) { - boost::shared_ptr storage = boost::dynamic_pointer_cast(payload); + virtual void handleResponse(std::shared_ptr payload, ErrorPayload::ref error) { + std::shared_ptr storage = std::dynamic_pointer_cast(payload); if (storage) { - onResponse(boost::dynamic_pointer_cast(storage->getPayload()), error); + onResponse(std::dynamic_pointer_cast(storage->getPayload()), error); } else { - onResponse(boost::shared_ptr(), error); + onResponse(std::shared_ptr(), error); } } public: - boost::signal, ErrorPayload::ref)> onResponse; + boost::signal, ErrorPayload::ref)> onResponse; }; } diff --git a/Swiften/Queries/Requests/GetSecurityLabelsCatalogRequest.h b/Swiften/Queries/Requests/GetSecurityLabelsCatalogRequest.h index a474be5..0a3502f 100644 --- a/Swiften/Queries/Requests/GetSecurityLabelsCatalogRequest.h +++ b/Swiften/Queries/Requests/GetSecurityLabelsCatalogRequest.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -15,7 +15,7 @@ namespace Swift { class SWIFTEN_API GetSecurityLabelsCatalogRequest : public GenericRequest { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static ref create(const JID& recipient, IQRouter* router) { return ref(new GetSecurityLabelsCatalogRequest(recipient, router)); @@ -26,7 +26,7 @@ namespace Swift { const JID& recipient, IQRouter* router) : GenericRequest( - IQ::Get, JID(), boost::make_shared(recipient), router) { + IQ::Get, JID(), std::make_shared(recipient), router) { } }; } diff --git a/Swiften/Queries/Requests/GetSoftwareVersionRequest.h b/Swiften/Queries/Requests/GetSoftwareVersionRequest.h index 9533651..5660dd8 100644 --- a/Swiften/Queries/Requests/GetSoftwareVersionRequest.h +++ b/Swiften/Queries/Requests/GetSoftwareVersionRequest.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -15,7 +15,7 @@ namespace Swift { class SWIFTEN_API GetSoftwareVersionRequest : public GenericRequest { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static ref create(const JID& recipient, IQRouter* router) { return ref(new GetSoftwareVersionRequest(recipient, router)); @@ -26,7 +26,7 @@ namespace Swift { const JID& recipient, IQRouter* router) : GenericRequest( - IQ::Get, recipient, boost::make_shared(), router) { + IQ::Get, recipient, std::make_shared(), router) { } }; } diff --git a/Swiften/Queries/Requests/SetPrivateStorageRequest.h b/Swiften/Queries/Requests/SetPrivateStorageRequest.h index 703b749..7cc47fb 100644 --- a/Swiften/Queries/Requests/SetPrivateStorageRequest.h +++ b/Swiften/Queries/Requests/SetPrivateStorageRequest.h @@ -6,8 +6,7 @@ #pragma once -#include -#include +#include #include #include @@ -19,17 +18,17 @@ namespace Swift { template class SWIFTEN_API SetPrivateStorageRequest : public Request { public: - typedef boost::shared_ptr > ref; + typedef std::shared_ptr > ref; - static ref create(boost::shared_ptr payload, IQRouter* router) { + static ref create(std::shared_ptr payload, IQRouter* router) { return ref(new SetPrivateStorageRequest(payload, router)); } private: - SetPrivateStorageRequest(boost::shared_ptr payload, IQRouter* router) : Request(IQ::Set, JID(), boost::make_shared(payload), router) { + SetPrivateStorageRequest(std::shared_ptr payload, IQRouter* router) : Request(IQ::Set, JID(), std::make_shared(payload), router) { } - virtual void handleResponse(boost::shared_ptr, ErrorPayload::ref error) { + virtual void handleResponse(std::shared_ptr, ErrorPayload::ref error) { onResponse(error); } diff --git a/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h b/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h index 94a497b..e2ed751 100644 --- a/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h +++ b/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -16,7 +16,7 @@ namespace Swift { class SWIFTEN_API SetInBandRegistrationRequest : public Request { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static ref create(const JID& to, InBandRegistrationPayload::ref payload, IQRouter* router) { return ref(new SetInBandRegistrationRequest(to, payload, router)); @@ -26,11 +26,11 @@ namespace Swift { SetInBandRegistrationRequest(const JID& to, InBandRegistrationPayload::ref payload, IQRouter* router) : Request(IQ::Set, to, InBandRegistrationPayload::ref(payload), router) { } - virtual void handleResponse(boost::shared_ptr payload, ErrorPayload::ref error) { + virtual void handleResponse(std::shared_ptr payload, ErrorPayload::ref error) { onResponse(payload, error); } public: - boost::signal, ErrorPayload::ref)> onResponse; + boost::signal, ErrorPayload::ref)> onResponse; }; } diff --git a/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp b/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp index 1efe523..6c4c495 100644 --- a/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp +++ b/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp @@ -4,8 +4,9 @@ * See the COPYING file for more information. */ +#include + #include -#include #include #include @@ -49,9 +50,9 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(channel->iqs_.size())); CPPUNIT_ASSERT_EQUAL(JID(), channel->iqs_[0]->getTo()); CPPUNIT_ASSERT_EQUAL(IQ::Get, channel->iqs_[0]->getType()); - boost::shared_ptr storage = channel->iqs_[0]->getPayload(); + std::shared_ptr storage = channel->iqs_[0]->getPayload(); CPPUNIT_ASSERT(storage); - boost::shared_ptr payload = boost::dynamic_pointer_cast(storage->getPayload()); + std::shared_ptr payload = std::dynamic_pointer_cast(storage->getPayload()); CPPUNIT_ASSERT(payload); } @@ -62,7 +63,7 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture { channel->onIQReceived(createResponse("test-id", "foo")); CPPUNIT_ASSERT_EQUAL(1, static_cast(responses.size())); - CPPUNIT_ASSERT_EQUAL(std::string("foo"), boost::dynamic_pointer_cast(responses[0])->text); + CPPUNIT_ASSERT_EQUAL(std::string("foo"), std::dynamic_pointer_cast(responses[0])->text); } void testHandleResponse_Error() { @@ -76,7 +77,7 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture { } private: - void handleResponse(boost::shared_ptr p, ErrorPayload::ref e) { + void handleResponse(std::shared_ptr p, ErrorPayload::ref e) { if (e) { errors.push_back(*e); } @@ -85,17 +86,17 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture { } } - boost::shared_ptr createResponse(const std::string& id, const std::string& text) { - boost::shared_ptr iq(new IQ(IQ::Result)); - boost::shared_ptr storage(new PrivateStorage()); - storage->setPayload(boost::shared_ptr(new MyPayload(text))); + std::shared_ptr createResponse(const std::string& id, const std::string& text) { + std::shared_ptr iq(new IQ(IQ::Result)); + std::shared_ptr storage(new PrivateStorage()); + storage->setPayload(std::make_shared(text)); iq->addPayload(storage); iq->setID(id); return iq; } - boost::shared_ptr createError(const std::string& id) { - boost::shared_ptr iq(new IQ(IQ::Error)); + std::shared_ptr createError(const std::string& id) { + std::shared_ptr iq(new IQ(IQ::Error)); iq->setID(id); return iq; } @@ -104,7 +105,7 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture { IQRouter* router; DummyIQChannel* channel; std::vector< ErrorPayload > errors; - std::vector< boost::shared_ptr > responses; + std::vector< std::shared_ptr > responses; }; CPPUNIT_TEST_SUITE_REGISTRATION(GetPrivateStorageRequestTest); diff --git a/Swiften/Queries/Responder.h b/Swiften/Queries/Responder.h index 94195f8..0974adf 100644 --- a/Swiften/Queries/Responder.h +++ b/Swiften/Queries/Responder.h @@ -58,26 +58,26 @@ namespace Swift { * * This method is implemented in the concrete subclasses. */ - virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr payload) = 0; + virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr payload) = 0; /** * Handle an incoming IQ-Set request containing a payload of class PAYLOAD_TYPE. * * This method is implemented in the concrete subclasses. */ - virtual bool handleSetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr payload) = 0; + virtual bool handleSetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr payload) = 0; /** * Convenience function for sending an IQ response. */ - void sendResponse(const JID& to, const std::string& id, boost::shared_ptr payload) { + void sendResponse(const JID& to, const std::string& id, std::shared_ptr payload) { router_->sendIQ(IQ::createResult(to, id, payload)); } /** * Convenience function for sending an IQ response, with a specific from address. */ - void sendResponse(const JID& to, const JID& from, const std::string& id, boost::shared_ptr payload) { + void sendResponse(const JID& to, const JID& from, const std::string& id, std::shared_ptr payload) { router_->sendIQ(IQ::createResult(to, from, id, payload)); } @@ -104,9 +104,9 @@ namespace Swift { } private: - virtual bool handleIQ(boost::shared_ptr iq) { + virtual bool handleIQ(std::shared_ptr iq) { if (iq->getType() == IQ::Set || iq->getType() == IQ::Get) { - boost::shared_ptr payload(iq->getPayload()); + std::shared_ptr payload(iq->getPayload()); if (payload) { bool result; if (iq->getType() == IQ::Set) { diff --git a/Swiften/Queries/Responders/SoftwareVersionResponder.cpp b/Swiften/Queries/Responders/SoftwareVersionResponder.cpp index df73dc6..5071f6e 100644 --- a/Swiften/Queries/Responders/SoftwareVersionResponder.cpp +++ b/Swiften/Queries/Responders/SoftwareVersionResponder.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include @@ -21,8 +21,8 @@ void SoftwareVersionResponder::setVersion(const std::string& client, const std:: this->os = os; } -bool SoftwareVersionResponder::handleGetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr) { - sendResponse(from, id, boost::make_shared(client, version, os)); +bool SoftwareVersionResponder::handleGetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr) { + sendResponse(from, id, std::make_shared(client, version, os)); return true; } diff --git a/Swiften/Queries/Responders/SoftwareVersionResponder.h b/Swiften/Queries/Responders/SoftwareVersionResponder.h index e336341..4bb3425 100644 --- a/Swiften/Queries/Responders/SoftwareVersionResponder.h +++ b/Swiften/Queries/Responders/SoftwareVersionResponder.h @@ -20,7 +20,7 @@ namespace Swift { void setVersion(const std::string& client, const std::string& version, const std::string& os = ""); private: - virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr payload); + virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr payload); private: std::string client; diff --git a/Swiften/Queries/SetResponder.h b/Swiften/Queries/SetResponder.h index 44d5b66..e2842f4 100644 --- a/Swiften/Queries/SetResponder.h +++ b/Swiften/Queries/SetResponder.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -16,6 +16,6 @@ namespace Swift { SetResponder(IQRouter* router) : Responder(router) {} private: - virtual bool handleGetRequest(const JID&, const JID&, const std::string&, boost::shared_ptr) { return false; } + virtual bool handleGetRequest(const JID&, const JID&, const std::string&, std::shared_ptr) { return false; } }; } diff --git a/Swiften/Queries/UnitTest/IQRouterTest.cpp b/Swiften/Queries/UnitTest/IQRouterTest.cpp index d0d4911..0acb87b 100644 --- a/Swiften/Queries/UnitTest/IQRouterTest.cpp +++ b/Swiften/Queries/UnitTest/IQRouterTest.cpp @@ -4,9 +4,9 @@ * See the COPYING file for more information. */ +#include + #include -#include -#include #include #include @@ -45,7 +45,7 @@ class IQRouterTest : public CppUnit::TestFixture { DummyIQHandler handler2(true, &testling); testling.removeHandler(&handler1); - channel_->onIQReceived(boost::make_shared()); + channel_->onIQReceived(std::make_shared()); CPPUNIT_ASSERT_EQUAL(0, handler1.called); CPPUNIT_ASSERT_EQUAL(1, handler2.called); @@ -56,9 +56,9 @@ class IQRouterTest : public CppUnit::TestFixture { DummyIQHandler handler2(true, &testling); DummyIQHandler handler1(true, &testling); - channel_->onIQReceived(boost::make_shared()); + channel_->onIQReceived(std::make_shared()); testling.removeHandler(&handler1); - channel_->onIQReceived(boost::make_shared()); + channel_->onIQReceived(std::make_shared()); CPPUNIT_ASSERT_EQUAL(1, handler1.called); CPPUNIT_ASSERT_EQUAL(1, handler2.called); @@ -69,7 +69,7 @@ class IQRouterTest : public CppUnit::TestFixture { DummyIQHandler handler2(false, &testling); DummyIQHandler handler1(true, &testling); - channel_->onIQReceived(boost::make_shared()); + channel_->onIQReceived(std::make_shared()); CPPUNIT_ASSERT_EQUAL(1, handler1.called); CPPUNIT_ASSERT_EQUAL(0, handler2.called); @@ -81,7 +81,7 @@ class IQRouterTest : public CppUnit::TestFixture { DummyIQHandler handler2(true, &testling); DummyIQHandler handler1(false, &testling); - channel_->onIQReceived(boost::make_shared()); + channel_->onIQReceived(std::make_shared()); CPPUNIT_ASSERT_EQUAL(1, handler1.called); CPPUNIT_ASSERT_EQUAL(1, handler2.called); @@ -92,7 +92,7 @@ class IQRouterTest : public CppUnit::TestFixture { IQRouter testling(channel_); DummyIQHandler handler(false, &testling); - channel_->onIQReceived(boost::make_shared()); + channel_->onIQReceived(std::make_shared()); CPPUNIT_ASSERT_EQUAL(1, static_cast(channel_->iqs_.size())); CPPUNIT_ASSERT(channel_->iqs_[0]->getPayload()); @@ -104,8 +104,8 @@ class IQRouterTest : public CppUnit::TestFixture { DummyIQHandler handler2(true, &testling); RemovingIQHandler handler1(&testling); - channel_->onIQReceived(boost::make_shared()); - channel_->onIQReceived(boost::make_shared()); + channel_->onIQReceived(std::make_shared()); + channel_->onIQReceived(std::make_shared()); CPPUNIT_ASSERT_EQUAL(1, handler1.called); CPPUNIT_ASSERT_EQUAL(2, handler2.called); @@ -115,7 +115,7 @@ class IQRouterTest : public CppUnit::TestFixture { IQRouter testling(channel_); testling.setFrom(JID("foo@bar.com/baz")); - testling.sendIQ(boost::make_shared()); + testling.sendIQ(std::make_shared()); CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), channel_->iqs_[0]->getFrom()); } @@ -123,7 +123,7 @@ class IQRouterTest : public CppUnit::TestFixture { void testSendIQ_WithoutFrom() { IQRouter testling(channel_); - testling.sendIQ(boost::make_shared()); + testling.sendIQ(std::make_shared()); CPPUNIT_ASSERT_EQUAL(JID(), channel_->iqs_[0]->getFrom()); } @@ -133,7 +133,7 @@ class IQRouterTest : public CppUnit::TestFixture { testling.setFrom(JID("foo@bar.com/baz")); DummyIQHandler handler(false, &testling); - channel_->onIQReceived(boost::make_shared()); + channel_->onIQReceived(std::make_shared()); CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), channel_->iqs_[0]->getFrom()); } @@ -148,7 +148,7 @@ class IQRouterTest : public CppUnit::TestFixture { router->removeHandler(this); } - virtual bool handleIQ(boost::shared_ptr) { + virtual bool handleIQ(std::shared_ptr) { called++; return handle; } @@ -162,7 +162,7 @@ class IQRouterTest : public CppUnit::TestFixture { router->addHandler(this); } - virtual bool handleIQ(boost::shared_ptr) { + virtual bool handleIQ(std::shared_ptr) { called++; router->removeHandler(this); return false; diff --git a/Swiften/Queries/UnitTest/RequestTest.cpp b/Swiften/Queries/UnitTest/RequestTest.cpp index 93aa9b1..56daffa 100644 --- a/Swiften/Queries/UnitTest/RequestTest.cpp +++ b/Swiften/Queries/UnitTest/RequestTest.cpp @@ -4,9 +4,9 @@ * See the COPYING file for more information. */ +#include + #include -#include -#include #include #include @@ -56,25 +56,25 @@ class RequestTest : public CppUnit::TestFixture { MyRequest( IQ::Type type, const JID& receiver, - boost::shared_ptr payload, + std::shared_ptr payload, IQRouter* router) : Request(type, receiver, payload, router) { } - virtual void handleResponse(boost::shared_ptr payload, ErrorPayload::ref error) { + virtual void handleResponse(std::shared_ptr payload, ErrorPayload::ref error) { onResponse(payload, error); } public: - boost::signal, ErrorPayload::ref)> onResponse; + boost::signal, ErrorPayload::ref)> onResponse; }; public: void setUp() { channel_ = new DummyIQChannel(); router_ = new IQRouter(channel_); - payload_ = boost::shared_ptr(new MyPayload("foo")); - responsePayload_ = boost::shared_ptr(new MyPayload("bar")); + payload_ = std::make_shared("foo"); + responsePayload_ = std::make_shared("bar"); responsesReceived_ = 0; } @@ -131,8 +131,8 @@ class RequestTest : public CppUnit::TestFixture { testling.onResponse.connect(boost::bind(&RequestTest::handleResponse, this, _1, _2)); testling.send(); - boost::shared_ptr error = createError(JID("foo@bar.com/baz"),"test-id"); - boost::shared_ptr errorPayload = boost::make_shared(ErrorPayload::InternalServerError); + std::shared_ptr error = createError(JID("foo@bar.com/baz"),"test-id"); + std::shared_ptr errorPayload = std::make_shared(ErrorPayload::InternalServerError); error->addPayload(errorPayload); channel_->onIQReceived(error); @@ -170,7 +170,7 @@ class RequestTest : public CppUnit::TestFixture { testling.onResponse.connect(boost::bind(&RequestTest::handleDifferentResponse, this, _1, _2)); testling.send(); - responsePayload_ = boost::make_shared(); + responsePayload_ = std::make_shared(); channel_->onIQReceived(createResponse(JID("foo@bar.com/baz"),"test-id")); CPPUNIT_ASSERT_EQUAL(1, responsesReceived_); @@ -179,12 +179,12 @@ class RequestTest : public CppUnit::TestFixture { } void testHandleIQ_RawXMLPayload() { - payload_ = boost::make_shared(""); + payload_ = std::make_shared(""); MyRequest testling(IQ::Get, JID("foo@bar.com/baz"), payload_, router_); testling.onResponse.connect(boost::bind(&RequestTest::handleRawXMLResponse, this, _1, _2)); testling.send(); - responsePayload_ = boost::make_shared(); + responsePayload_ = std::make_shared(); channel_->onIQReceived(createResponse(JID("foo@bar.com/baz"),"test-id")); CPPUNIT_ASSERT_EQUAL(1, responsesReceived_); @@ -197,7 +197,7 @@ class RequestTest : public CppUnit::TestFixture { testling.onResponse.connect(boost::bind(&RequestTest::handleResponse, this, _1, _2)); testling.send(); - boost::shared_ptr response = createResponse(JID("foo@bar.com/baz"),"test-id"); + std::shared_ptr response = createResponse(JID("foo@bar.com/baz"),"test-id"); response->setType(IQ::Get); channel_->onIQReceived(response); @@ -211,7 +211,7 @@ class RequestTest : public CppUnit::TestFixture { testling.onResponse.connect(boost::bind(&RequestTest::handleResponse, this, _1, _2)); testling.send(); - boost::shared_ptr response = createResponse(JID("foo@bar.com/baz"), "test-id"); + std::shared_ptr response = createResponse(JID("foo@bar.com/baz"), "test-id"); response->setType(IQ::Set); channel_->onIQReceived(response); @@ -315,41 +315,41 @@ class RequestTest : public CppUnit::TestFixture { private: - void handleResponse(boost::shared_ptr p, ErrorPayload::ref e) { + void handleResponse(std::shared_ptr p, ErrorPayload::ref e) { if (e) { receivedErrors.push_back(*e); } else { - boost::shared_ptr payload(boost::dynamic_pointer_cast(p)); + std::shared_ptr payload(std::dynamic_pointer_cast(p)); CPPUNIT_ASSERT(payload); CPPUNIT_ASSERT_EQUAL(std::string("bar"), payload->text_); ++responsesReceived_; } } - void handleDifferentResponse(boost::shared_ptr p, ErrorPayload::ref e) { + void handleDifferentResponse(std::shared_ptr p, ErrorPayload::ref e) { CPPUNIT_ASSERT(!e); CPPUNIT_ASSERT(!p); ++responsesReceived_; } - void handleRawXMLResponse(boost::shared_ptr p, ErrorPayload::ref e) { + void handleRawXMLResponse(std::shared_ptr p, ErrorPayload::ref e) { CPPUNIT_ASSERT(!e); CPPUNIT_ASSERT(p); - CPPUNIT_ASSERT(boost::dynamic_pointer_cast(p)); + CPPUNIT_ASSERT(std::dynamic_pointer_cast(p)); ++responsesReceived_; } - boost::shared_ptr createResponse(const JID& from, const std::string& id) { - boost::shared_ptr iq(new IQ(IQ::Result)); + std::shared_ptr createResponse(const JID& from, const std::string& id) { + std::shared_ptr iq(new IQ(IQ::Result)); iq->setFrom(from); iq->addPayload(responsePayload_); iq->setID(id); return iq; } - boost::shared_ptr createError(const JID& from, const std::string& id) { - boost::shared_ptr iq(new IQ(IQ::Error)); + std::shared_ptr createError(const JID& from, const std::string& id) { + std::shared_ptr iq(new IQ(IQ::Error)); iq->setFrom(from); iq->setID(id); return iq; @@ -358,8 +358,8 @@ class RequestTest : public CppUnit::TestFixture { private: IQRouter* router_; DummyIQChannel* channel_; - boost::shared_ptr payload_; - boost::shared_ptr responsePayload_; + std::shared_ptr payload_; + std::shared_ptr responsePayload_; int responsesReceived_; std::vector receivedErrors; }; diff --git a/Swiften/Queries/UnitTest/ResponderTest.cpp b/Swiften/Queries/UnitTest/ResponderTest.cpp index c3474f2..98c1448 100644 --- a/Swiften/Queries/UnitTest/ResponderTest.cpp +++ b/Swiften/Queries/UnitTest/ResponderTest.cpp @@ -4,9 +4,9 @@ * See the COPYING file for more information. */ +#include + #include -#include -#include #include #include @@ -34,7 +34,7 @@ class ResponderTest : public CppUnit::TestFixture { void setUp() { channel_ = new DummyIQChannel(); router_ = new IQRouter(channel_); - payload_ = boost::make_shared("foo"); + payload_ = std::make_shared("foo"); } void tearDown() { @@ -110,15 +110,15 @@ class ResponderTest : public CppUnit::TestFixture { void testHandleIQ_NoPayload() { MyResponder testling(router_); - CPPUNIT_ASSERT(!dynamic_cast(&testling)->handleIQ(boost::make_shared(IQ::Get))); + CPPUNIT_ASSERT(!dynamic_cast(&testling)->handleIQ(std::make_shared(IQ::Get))); CPPUNIT_ASSERT_EQUAL(0, static_cast(testling.getPayloads_.size())); CPPUNIT_ASSERT_EQUAL(0, static_cast(testling.setPayloads_.size())); } private: - boost::shared_ptr createRequest(IQ::Type type) { - boost::shared_ptr iq(new IQ(type)); + std::shared_ptr createRequest(IQ::Type type) { + std::shared_ptr iq(new IQ(type)); iq->addPayload(payload_); iq->setID("myid"); iq->setFrom(JID("foo@bar.com/baz")); @@ -130,13 +130,13 @@ class ResponderTest : public CppUnit::TestFixture { public: MyResponder(IQRouter* router) : Responder(router), getRequestResponse_(true), setRequestResponse_(true) {} - virtual bool handleGetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr payload) { + virtual bool handleGetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr payload) { CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), from); CPPUNIT_ASSERT_EQUAL(std::string("myid"), id); getPayloads_.push_back(payload); return getRequestResponse_; } - virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr payload) { + virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr payload) { CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), from); CPPUNIT_ASSERT_EQUAL(std::string("myid"), id); setPayloads_.push_back(payload); @@ -145,14 +145,14 @@ class ResponderTest : public CppUnit::TestFixture { bool getRequestResponse_; bool setRequestResponse_; - std::vector > getPayloads_; - std::vector > setPayloads_; + std::vector > getPayloads_; + std::vector > setPayloads_; }; private: IQRouter* router_; DummyIQChannel* channel_; - boost::shared_ptr payload_; + std::shared_ptr payload_; }; CPPUNIT_TEST_SUITE_REGISTRATION(ResponderTest); diff --git a/Swiften/Roster/GetRosterRequest.h b/Swiften/Roster/GetRosterRequest.h index 6ca16cb..1a0499f 100644 --- a/Swiften/Roster/GetRosterRequest.h +++ b/Swiften/Roster/GetRosterRequest.h @@ -13,7 +13,7 @@ namespace Swift { class SWIFTEN_API GetRosterRequest : public GenericRequest { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static ref create(IQRouter* router) { return ref(new GetRosterRequest(router)); @@ -27,7 +27,7 @@ namespace Swift { private: GetRosterRequest(IQRouter* router) : - GenericRequest(IQ::Get, JID(), boost::shared_ptr(new RosterPayload()), router) { + GenericRequest(IQ::Get, JID(), std::make_shared(), router) { } }; } diff --git a/Swiften/Roster/RosterMemoryStorage.cpp b/Swiften/Roster/RosterMemoryStorage.cpp index f187116..1b72a85 100644 --- a/Swiften/Roster/RosterMemoryStorage.cpp +++ b/Swiften/Roster/RosterMemoryStorage.cpp @@ -1,22 +1,22 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include +#include namespace Swift { RosterMemoryStorage::RosterMemoryStorage() { } -void RosterMemoryStorage::setRoster(boost::shared_ptr r) { +void RosterMemoryStorage::setRoster(std::shared_ptr r) { roster.reset(); if (r) { - roster = boost::make_shared(*r); + roster = std::make_shared(*r); } } diff --git a/Swiften/Roster/RosterMemoryStorage.h b/Swiften/Roster/RosterMemoryStorage.h index 4058f84..19e7802 100644 --- a/Swiften/Roster/RosterMemoryStorage.h +++ b/Swiften/Roster/RosterMemoryStorage.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -14,13 +14,13 @@ namespace Swift { public: RosterMemoryStorage(); - virtual boost::shared_ptr getRoster() const { + virtual std::shared_ptr getRoster() const { return roster; } - virtual void setRoster(boost::shared_ptr); + virtual void setRoster(std::shared_ptr); private: - boost::shared_ptr roster; + std::shared_ptr roster; }; } diff --git a/Swiften/Roster/RosterPushResponder.h b/Swiften/Roster/RosterPushResponder.h index 06ba797..10986f5 100644 --- a/Swiften/Roster/RosterPushResponder.h +++ b/Swiften/Roster/RosterPushResponder.h @@ -17,13 +17,13 @@ namespace Swift { RosterPushResponder(IQRouter* router) : SetResponder(router) {} public: - boost::signal)> onRosterReceived; + boost::signal)> onRosterReceived; private: - virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr payload) { + virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr payload) { if (getIQRouter()->isAccountJID(from)) { onRosterReceived(payload); - sendResponse(from, id, boost::shared_ptr()); + sendResponse(from, id, std::shared_ptr()); } else { sendError(from, id, ErrorPayload::NotAuthorized, ErrorPayload::Cancel); diff --git a/Swiften/Roster/RosterStorage.h b/Swiften/Roster/RosterStorage.h index 92c40f9..1c1461d 100644 --- a/Swiften/Roster/RosterStorage.h +++ b/Swiften/Roster/RosterStorage.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -16,7 +16,7 @@ namespace Swift { public: virtual ~RosterStorage(); - virtual boost::shared_ptr getRoster() const = 0; - virtual void setRoster(boost::shared_ptr) = 0; + virtual std::shared_ptr getRoster() const = 0; + virtual void setRoster(std::shared_ptr) = 0; }; } diff --git a/Swiften/Roster/SetRosterRequest.h b/Swiften/Roster/SetRosterRequest.h index 64c0984..7615abc 100644 --- a/Swiften/Roster/SetRosterRequest.h +++ b/Swiften/Roster/SetRosterRequest.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -16,7 +16,7 @@ namespace Swift { class SWIFTEN_API SetRosterRequest : public Request { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static ref create(RosterPayload::ref payload, IQRouter* router) { return ref(new SetRosterRequest(JID(), payload, router)); @@ -27,10 +27,10 @@ namespace Swift { } private: - SetRosterRequest(const JID& to, boost::shared_ptr payload, IQRouter* router) : Request(IQ::Set, to, boost::shared_ptr(payload), router) { + SetRosterRequest(const JID& to, std::shared_ptr payload, IQRouter* router) : Request(IQ::Set, to, std::shared_ptr(payload), router) { } - virtual void handleResponse(boost::shared_ptr /*payload*/, ErrorPayload::ref error) { + virtual void handleResponse(std::shared_ptr /*payload*/, ErrorPayload::ref error) { onResponse(error); } diff --git a/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp b/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp index 6850c21..b646aba 100644 --- a/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp +++ b/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -61,10 +61,10 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { } void testGet_Response() { - boost::shared_ptr testling(createController()); + std::shared_ptr testling(createController()); testling->requestRoster(); - boost::shared_ptr payload = boost::make_shared(); + std::shared_ptr payload = std::make_shared(); payload->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); payload->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), payload)); @@ -79,13 +79,13 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { controller.requestRoster(); - channel_->onIQReceived(IQ::createResult(JID("baz@fum.com/dum"), channel_->sentStanzas[0]->getID(), boost::shared_ptr())); + channel_->onIQReceived(IQ::createResult(JID("baz@fum.com/dum"), channel_->sentStanzas[0]->getID(), std::shared_ptr())); } void testAdd() { XMPPRosterController controller(router_, xmppRoster_, rosterStorage_); - boost::shared_ptr payload(new RosterPayload()); + std::shared_ptr payload(new RosterPayload()); payload->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "eou", payload)); @@ -97,65 +97,65 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { } void testGet_NoRosterInStorage() { - boost::shared_ptr testling(createController()); + std::shared_ptr testling(createController()); testling->setUseVersioning(true); testling->requestRoster(); - boost::shared_ptr roster = channel_->sentStanzas[0]->getPayload(); + std::shared_ptr roster = channel_->sentStanzas[0]->getPayload(); CPPUNIT_ASSERT(roster->getVersion()); CPPUNIT_ASSERT_EQUAL(std::string(""), *roster->getVersion()); } void testGet_NoVersionInStorage() { - boost::shared_ptr testling(createController()); + std::shared_ptr testling(createController()); testling->setUseVersioning(true); - rosterStorage_->setRoster(boost::make_shared()); + rosterStorage_->setRoster(std::make_shared()); testling->requestRoster(); - boost::shared_ptr roster = channel_->sentStanzas[0]->getPayload(); + std::shared_ptr roster = channel_->sentStanzas[0]->getPayload(); CPPUNIT_ASSERT(roster->getVersion()); CPPUNIT_ASSERT_EQUAL(std::string(""), *roster->getVersion()); } void testGet_VersionInStorage() { - boost::shared_ptr testling(createController()); + std::shared_ptr testling(createController()); testling->setUseVersioning(true); - boost::shared_ptr payload(new RosterPayload()); + std::shared_ptr payload(new RosterPayload()); payload->setVersion("foover"); rosterStorage_->setRoster(payload); testling->requestRoster(); - boost::shared_ptr roster = channel_->sentStanzas[0]->getPayload(); + std::shared_ptr roster = channel_->sentStanzas[0]->getPayload(); CPPUNIT_ASSERT(roster->getVersion()); CPPUNIT_ASSERT_EQUAL(std::string("foover"), *roster->getVersion()); } void testGet_ServerDoesNotSupportVersion() { - boost::shared_ptr testling(createController()); - boost::shared_ptr payload(new RosterPayload()); + std::shared_ptr testling(createController()); + std::shared_ptr payload(new RosterPayload()); payload->setVersion("foover"); rosterStorage_->setRoster(payload); testling->requestRoster(); - boost::shared_ptr roster = channel_->sentStanzas[0]->getPayload(); + std::shared_ptr roster = channel_->sentStanzas[0]->getPayload(); CPPUNIT_ASSERT(!roster->getVersion()); } void testGet_ResponseWithoutNewVersion() { - boost::shared_ptr testling(createController()); + std::shared_ptr testling(createController()); testling->setUseVersioning(true); - boost::shared_ptr storedRoster(new RosterPayload()); + std::shared_ptr storedRoster(new RosterPayload()); storedRoster->setVersion("version10"); storedRoster->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); storedRoster->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both)); rosterStorage_->setRoster(storedRoster); testling->requestRoster(); - channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), boost::shared_ptr())); + channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), std::shared_ptr())); CPPUNIT_ASSERT_EQUAL(2, handler_->getEventCount()); CPPUNIT_ASSERT(xmppRoster_->getItem(jid1_)); @@ -170,15 +170,15 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { } void testGet_ResponseWithNewVersion() { - boost::shared_ptr testling(createController()); + std::shared_ptr testling(createController()); testling->setUseVersioning(true); - boost::shared_ptr storedRoster(new RosterPayload()); + std::shared_ptr storedRoster(new RosterPayload()); storedRoster->setVersion("version10"); storedRoster->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); rosterStorage_->setRoster(storedRoster); testling->requestRoster(); - boost::shared_ptr serverRoster(new RosterPayload()); + std::shared_ptr serverRoster(new RosterPayload()); serverRoster->setVersion("version12"); serverRoster->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both)); std::vector groups; @@ -204,9 +204,9 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { } void testAddFromNonAccount() { - boost::shared_ptr testling(createController()); + std::shared_ptr testling(createController()); - boost::shared_ptr payload(new RosterPayload()); + std::shared_ptr payload(new RosterPayload()); payload->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); IQ::ref request = IQ::createRequest(IQ::Set, JID(), "eou", payload); request->setFrom(jid2_); @@ -217,7 +217,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { void testModify() { XMPPRosterController controller(router_, xmppRoster_, rosterStorage_); - boost::shared_ptr payload1(new RosterPayload()); + std::shared_ptr payload1(new RosterPayload()); payload1->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id1", payload1)); @@ -225,7 +225,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID()); handler_->reset(); - boost::shared_ptr payload2(new RosterPayload()); + std::shared_ptr payload2(new RosterPayload()); payload2->addItem(RosterItemPayload(jid1_, "Bob2", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id2", payload2)); @@ -237,7 +237,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { void testRemove() { XMPPRosterController controller(router_, xmppRoster_, rosterStorage_); - boost::shared_ptr payload1(new RosterPayload()); + std::shared_ptr payload1(new RosterPayload()); payload1->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id1", payload1)); @@ -245,7 +245,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID()); handler_->reset(); - boost::shared_ptr payload2(new RosterPayload()); + std::shared_ptr payload2(new RosterPayload()); payload2->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Remove)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id2", payload2)); CPPUNIT_ASSERT(!xmppRoster_->containsJID(jid1_)); @@ -255,17 +255,17 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { } void testRemove_RosterStorageUpdated() { - boost::shared_ptr testling(createController()); + std::shared_ptr testling(createController()); testling->setUseVersioning(true); - boost::shared_ptr storedRoster(new RosterPayload()); + std::shared_ptr storedRoster(new RosterPayload()); storedRoster->setVersion("version10"); storedRoster->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); storedRoster->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both)); rosterStorage_->setRoster(storedRoster); testling->requestRoster(); - channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), boost::shared_ptr())); + channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), std::shared_ptr())); - boost::shared_ptr payload2(new RosterPayload()); + std::shared_ptr payload2(new RosterPayload()); payload2->setVersion("version15"); payload2->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Remove)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id2", payload2)); @@ -279,7 +279,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { void testMany() { XMPPRosterController controller(router_, xmppRoster_, rosterStorage_); - boost::shared_ptr payload1(new RosterPayload()); + std::shared_ptr payload1(new RosterPayload()); payload1->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id1", payload1)); @@ -287,7 +287,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID()); handler_->reset(); - boost::shared_ptr payload2(new RosterPayload()); + std::shared_ptr payload2(new RosterPayload()); payload2->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id2", payload2)); @@ -295,7 +295,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(jid2_, handler_->getLastJID()); handler_->reset(); - boost::shared_ptr payload3(new RosterPayload()); + std::shared_ptr payload3(new RosterPayload()); payload3->addItem(RosterItemPayload(jid1_, "Ernie", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id3", payload3)); @@ -303,7 +303,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID()); handler_->reset(); - boost::shared_ptr payload4(new RosterPayload()); + std::shared_ptr payload4(new RosterPayload()); RosterItemPayload item(jid3_, "Jane", RosterItemPayload::Both); std::string janesGroup("Jane's Group"); item.addGroup(janesGroup); @@ -316,7 +316,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(janesGroup, xmppRoster_->getGroupsForJID(jid3_)[0]); handler_->reset(); - boost::shared_ptr payload5(new RosterPayload()); + std::shared_ptr payload5(new RosterPayload()); payload5->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Remove)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id5", payload5)); CPPUNIT_ASSERT(!xmppRoster_->containsJID(jid1_)); @@ -324,7 +324,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID()); handler_->reset(); - boost::shared_ptr payload6(new RosterPayload()); + std::shared_ptr payload6(new RosterPayload()); RosterItemPayload item2(jid2_, "Little Alice", RosterItemPayload::Both); std::string alicesGroup("Alice's Group"); item2.addGroup(alicesGroup); diff --git a/Swiften/Roster/UnitTest/XMPPRosterImplTest.cpp b/Swiften/Roster/UnitTest/XMPPRosterImplTest.cpp index f611fec..f0d92e9 100644 --- a/Swiften/Roster/UnitTest/XMPPRosterImplTest.cpp +++ b/Swiften/Roster/UnitTest/XMPPRosterImplTest.cpp @@ -4,8 +4,9 @@ * See the COPYING file for more information. */ +#include + #include -#include #include #include diff --git a/Swiften/Roster/UnitTest/XMPPRosterSignalHandler.h b/Swiften/Roster/UnitTest/XMPPRosterSignalHandler.h index 9c9afad..0535578 100644 --- a/Swiften/Roster/UnitTest/XMPPRosterSignalHandler.h +++ b/Swiften/Roster/UnitTest/XMPPRosterSignalHandler.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include enum XMPPRosterEvents {None, Add, Remove, Update}; diff --git a/Swiften/Roster/XMPPRosterController.cpp b/Swiften/Roster/XMPPRosterController.cpp index 10803f3..b5e72f5 100644 --- a/Swiften/Roster/XMPPRosterController.cpp +++ b/Swiften/Roster/XMPPRosterController.cpp @@ -23,7 +23,7 @@ namespace Swift { * The controller does not gain ownership of these parameters. */ XMPPRosterController::XMPPRosterController(IQRouter* iqRouter, XMPPRosterImpl* xmppRoster, RosterStorage* rosterStorage) : iqRouter_(iqRouter), rosterPushResponder_(iqRouter), xmppRoster_(xmppRoster), rosterStorage_(rosterStorage), useVersioning(false) { - rosterPushResponder_.onRosterReceived.connect(boost::bind(&XMPPRosterController::handleRosterReceived, this, _1, false, boost::shared_ptr())); + rosterPushResponder_.onRosterReceived.connect(boost::bind(&XMPPRosterController::handleRosterReceived, this, _1, false, std::shared_ptr())); rosterPushResponder_.start(); } @@ -34,7 +34,7 @@ XMPPRosterController::~XMPPRosterController() { void XMPPRosterController::requestRoster() { xmppRoster_->clear(); - boost::shared_ptr storedRoster = rosterStorage_->getRoster(); + std::shared_ptr storedRoster = rosterStorage_->getRoster(); GetRosterRequest::ref rosterRequest; if (useVersioning) { std::string version = ""; @@ -50,7 +50,7 @@ void XMPPRosterController::requestRoster() { rosterRequest->send(); } -void XMPPRosterController::handleRosterReceived(boost::shared_ptr rosterPayload, bool initial, boost::shared_ptr previousRoster) { +void XMPPRosterController::handleRosterReceived(std::shared_ptr rosterPayload, bool initial, std::shared_ptr previousRoster) { if (rosterPayload) { foreach(const RosterItemPayload& item, rosterPayload->getItems()) { //Don't worry about the updated case, the XMPPRoster sorts that out. @@ -82,7 +82,7 @@ void XMPPRosterController::handleRosterReceived(boost::shared_ptr void XMPPRosterController::saveRoster(const std::string& version) { std::vector items = xmppRoster_->getItems(); - boost::shared_ptr roster(new RosterPayload()); + std::shared_ptr roster(new RosterPayload()); roster->setVersion(version); foreach(const XMPPRosterItem& item, items) { roster->addItem(RosterItemPayload(item.getJID(), item.getName(), item.getSubscription(), item.getGroups())); diff --git a/Swiften/Roster/XMPPRosterController.h b/Swiften/Roster/XMPPRosterController.h index d40ba1e..3803cd5 100644 --- a/Swiften/Roster/XMPPRosterController.h +++ b/Swiften/Roster/XMPPRosterController.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -34,7 +33,7 @@ namespace Swift { } private: - void handleRosterReceived(boost::shared_ptr rosterPayload, bool initial, boost::shared_ptr previousRoster); + void handleRosterReceived(std::shared_ptr rosterPayload, bool initial, std::shared_ptr previousRoster); void saveRoster(const std::string& version); private: diff --git a/Swiften/SASL/UnitTest/DIGESTMD5ClientAuthenticatorTest.cpp b/Swiften/SASL/UnitTest/DIGESTMD5ClientAuthenticatorTest.cpp index 04e2df5..d29af59 100644 --- a/Swiften/SASL/UnitTest/DIGESTMD5ClientAuthenticatorTest.cpp +++ b/Swiften/SASL/UnitTest/DIGESTMD5ClientAuthenticatorTest.cpp @@ -26,7 +26,7 @@ class DIGESTMD5ClientAuthenticatorTest : public CppUnit::TestFixture { public: void setUp() { - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); } void testGetInitialResponse() { @@ -64,7 +64,7 @@ class DIGESTMD5ClientAuthenticatorTest : public CppUnit::TestFixture { } private: - boost::shared_ptr crypto; + std::shared_ptr crypto; }; CPPUNIT_TEST_SUITE_REGISTRATION(DIGESTMD5ClientAuthenticatorTest); diff --git a/Swiften/SASL/UnitTest/SCRAMSHA1ClientAuthenticatorTest.cpp b/Swiften/SASL/UnitTest/SCRAMSHA1ClientAuthenticatorTest.cpp index 3d5d161..7f408c6 100644 --- a/Swiften/SASL/UnitTest/SCRAMSHA1ClientAuthenticatorTest.cpp +++ b/Swiften/SASL/UnitTest/SCRAMSHA1ClientAuthenticatorTest.cpp @@ -43,8 +43,8 @@ class SCRAMSHA1ClientAuthenticatorTest : public CppUnit::TestFixture { public: void setUp() { - idnConverter = boost::shared_ptr(PlatformIDNConverter::create()); - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + idnConverter = std::shared_ptr(PlatformIDNConverter::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); } void testGetInitialResponse() { @@ -226,8 +226,8 @@ class SCRAMSHA1ClientAuthenticatorTest : public CppUnit::TestFixture { CPPUNIT_ASSERT(!testling.getResponse()); } - boost::shared_ptr idnConverter; - boost::shared_ptr crypto; + std::shared_ptr idnConverter; + std::shared_ptr crypto; }; CPPUNIT_TEST_SUITE_REGISTRATION(SCRAMSHA1ClientAuthenticatorTest); diff --git a/Swiften/SASL/WindowsAuthentication.cpp b/Swiften/SASL/WindowsAuthentication.cpp index 5917b66..b86381b 100644 --- a/Swiften/SASL/WindowsAuthentication.cpp +++ b/Swiften/SASL/WindowsAuthentication.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -15,7 +15,7 @@ #define ASSIGN_ERROR(status, errorCode) \ { \ - errorCode = boost::make_shared(status, boost::system::system_category()); \ + errorCode = std::make_shared(status, boost::system::system_category()); \ SWIFT_LOG(debug) << std::hex << "status: 0x" << status << ": " << errorCode->message() << std::endl; \ } @@ -32,11 +32,11 @@ namespace Swift { -boost::shared_ptr getUserNameEx(std::string& userName, std::string& clientName, std::string& serverName) { +std::shared_ptr getUserNameEx(std::string& userName, std::string& clientName, std::string& serverName) { ULONG length = 512; DWORD status = ERROR_MORE_DATA; bool firstCall = true; - boost::shared_ptr errorCode; + std::shared_ptr errorCode; while (status == ERROR_MORE_DATA) { std::vector value(length); @@ -70,9 +70,9 @@ boost::shared_ptr getUserNameEx(std::string& userName return errorCode; } -boost::shared_ptr acquireCredentialsHandle(PCredHandle credentialsHandle) { +std::shared_ptr acquireCredentialsHandle(PCredHandle credentialsHandle) { SECURITY_STATUS status; - boost::shared_ptr errorCode; + std::shared_ptr errorCode; TimeStamp validity; status = AcquireCredentialsHandle( @@ -90,9 +90,9 @@ boost::shared_ptr acquireCredentialsHandle(PCredHandl return errorCode; } -boost::shared_ptr freeCredentialsHandle(PCredHandle credentialsHandle) { +std::shared_ptr freeCredentialsHandle(PCredHandle credentialsHandle) { SECURITY_STATUS status; - boost::shared_ptr errorCode; + std::shared_ptr errorCode; status = FreeCredentialsHandle(credentialsHandle); ASSIGN_SEC_ERROR(status, errorCode); @@ -100,9 +100,9 @@ boost::shared_ptr freeCredentialsHandle(PCredHandle c return errorCode; } -boost::shared_ptr initializeSecurityContext(const boost::optional& inputToken, const std::string& servicePrincipalNameString, const PCredHandle credentialsHandle, bool haveContextHandle, PCtxtHandle contextHandle, ULONG contextRequested, ULONG* contextSupported, bool* haveCompleteContext, SafeByteArray& outputToken) { +std::shared_ptr initializeSecurityContext(const boost::optional& inputToken, const std::string& servicePrincipalNameString, const PCredHandle credentialsHandle, bool haveContextHandle, PCtxtHandle contextHandle, ULONG contextRequested, ULONG* contextSupported, bool* haveCompleteContext, SafeByteArray& outputToken) { SECURITY_STATUS status; - boost::shared_ptr errorCode; + std::shared_ptr errorCode; SecBufferDesc input; SecBufferDesc output; SecBuffer inputTokenBuffer; @@ -164,15 +164,15 @@ boost::shared_ptr initializeSecurityContext(const boo SWIFT_LOG(debug) << "outputToken.size(): " << outputToken.size() << std::endl; freeContextBuffer(outputTokenBuffer.pvBuffer); - return boost::shared_ptr(); /* success */ + return std::shared_ptr(); /* success */ } return errorCode; } -boost::shared_ptr deleteSecurityContext(PCtxtHandle contextHandle) { +std::shared_ptr deleteSecurityContext(PCtxtHandle contextHandle) { SECURITY_STATUS status; - boost::shared_ptr errorCode; + std::shared_ptr errorCode; status = DeleteSecurityContext(contextHandle); ASSIGN_SEC_ERROR(status, errorCode); @@ -180,9 +180,9 @@ boost::shared_ptr deleteSecurityContext(PCtxtHandle c return errorCode; } -boost::shared_ptr completeAuthToken(const PCtxtHandle contextHandle, PSecBufferDesc token) { +std::shared_ptr completeAuthToken(const PCtxtHandle contextHandle, PSecBufferDesc token) { SECURITY_STATUS status; - boost::shared_ptr errorCode; + std::shared_ptr errorCode; status = CompleteAuthToken( contextHandle, /* partial context */ @@ -192,9 +192,9 @@ boost::shared_ptr completeAuthToken(const PCtxtHandle return errorCode; } -boost::shared_ptr freeContextBuffer(PVOID contextBuffer) { +std::shared_ptr freeContextBuffer(PVOID contextBuffer) { SECURITY_STATUS status; - boost::shared_ptr errorCode; + std::shared_ptr errorCode; if (contextBuffer == NULL) { return errorCode; @@ -206,11 +206,11 @@ boost::shared_ptr freeContextBuffer(PVOID contextBuff return errorCode; } -boost::shared_ptr decryptMessage(const PCtxtHandle contextHandle, const ByteArray& message, SafeByteArray& decrypted) { +std::shared_ptr decryptMessage(const PCtxtHandle contextHandle, const ByteArray& message, SafeByteArray& decrypted) { /* Following https://msdn.microsoft.com/en-us/library/windows/desktop/aa380496%28v=vs.85%29.aspx */ SECURITY_STATUS status; - boost::shared_ptr errorCode; + std::shared_ptr errorCode; SecBufferDesc inOut; SecBuffer messageBuffer[2]; SafeByteArray inputMessage; @@ -253,11 +253,11 @@ boost::shared_ptr decryptMessage(const PCtxtHandle co return errorCode; } -boost::shared_ptr encryptMessage(const PCtxtHandle contextHandle, const SecPkgContext_Sizes& sizes, const SafeByteArray& message, SafeByteArray& output) { +std::shared_ptr encryptMessage(const PCtxtHandle contextHandle, const SecPkgContext_Sizes& sizes, const SafeByteArray& message, SafeByteArray& output) { /* Following https://msdn.microsoft.com/en-us/library/windows/desktop/aa380496%28v=vs.85%29.aspx */ SECURITY_STATUS status; - boost::shared_ptr errorCode; + std::shared_ptr errorCode; SecBufferDesc inOut; SecBuffer messageBuffer[3]; SafeByteArray securityTrailer(sizes.cbSecurityTrailer); @@ -311,9 +311,9 @@ boost::shared_ptr encryptMessage(const PCtxtHandle co return errorCode; } -boost::shared_ptr queryContextAttributes(const PCtxtHandle contextHandle, ULONG attribute, PVOID buffer) { +std::shared_ptr queryContextAttributes(const PCtxtHandle contextHandle, ULONG attribute, PVOID buffer) { SECURITY_STATUS status; - boost::shared_ptr errorCode; + std::shared_ptr errorCode; status = QueryContextAttributes( contextHandle, diff --git a/Swiften/SASL/WindowsAuthentication.h b/Swiften/SASL/WindowsAuthentication.h index e0cf4bc..e5705a3 100644 --- a/Swiften/SASL/WindowsAuthentication.h +++ b/Swiften/SASL/WindowsAuthentication.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -28,7 +28,7 @@ namespace Swift { * @return NULL for success, otherwise the error code returned by * Windows. */ - SWIFTEN_API boost::shared_ptr getUserNameEx(std::string& userName, std::string& clientName, std::string& serverName); + SWIFTEN_API std::shared_ptr getUserNameEx(std::string& userName, std::string& clientName, std::string& serverName); /** * Retrieves the handle to preexisting client credentials for the @@ -42,7 +42,7 @@ namespace Swift { * @return NULL for success, otherwise the error code returned by * Windows. */ - SWIFTEN_API boost::shared_ptr acquireCredentialsHandle(PCredHandle credentialsHandle); + SWIFTEN_API std::shared_ptr acquireCredentialsHandle(PCredHandle credentialsHandle); /** * Releases the credentials handle obtained by the @@ -55,7 +55,7 @@ namespace Swift { * @return NULL for success, otherwise the error code returned by * Windows. */ - SWIFTEN_API boost::shared_ptr freeCredentialsHandle(PCredHandle credentialsHandle); + SWIFTEN_API std::shared_ptr freeCredentialsHandle(PCredHandle credentialsHandle); /** * Builds the security context between the client and remote peer. @@ -87,7 +87,7 @@ namespace Swift { * @return NULL for success, otherwise the error code returned by * Windows. */ - SWIFTEN_API boost::shared_ptr initializeSecurityContext(const boost::optional& inputToken, const std::string& servicePrincipalNameString, const PCredHandle credentialsHandle, bool haveContextHandle, PCtxtHandle contextHandle, ULONG contextRequested, ULONG* contextSupported, bool* haveCompleteContext, SafeByteArray& outputToken); + SWIFTEN_API std::shared_ptr initializeSecurityContext(const boost::optional& inputToken, const std::string& servicePrincipalNameString, const PCredHandle credentialsHandle, bool haveContextHandle, PCtxtHandle contextHandle, ULONG contextRequested, ULONG* contextSupported, bool* haveCompleteContext, SafeByteArray& outputToken); /** * Releases the context handle obtained by the @@ -100,7 +100,7 @@ namespace Swift { * @return NULL for success, otherwise the error code returned by * Windows. */ - SWIFTEN_API boost::shared_ptr deleteSecurityContext(PCtxtHandle contextHandle); + SWIFTEN_API std::shared_ptr deleteSecurityContext(PCtxtHandle contextHandle); /** * Completes an authentication token for a partial security context. @@ -111,7 +111,7 @@ namespace Swift { * @return NULL for success, otherwise the error code returned by * Windows. */ - SWIFTEN_API boost::shared_ptr completeAuthToken(const PCtxtHandle contextHandle, PSecBufferDesc token); + SWIFTEN_API std::shared_ptr completeAuthToken(const PCtxtHandle contextHandle, PSecBufferDesc token); /** * Frees a memory buffer allocated by the security package. @@ -121,7 +121,7 @@ namespace Swift { * @return NULL for success, otherwise the error code returned by * Windows. */ - SWIFTEN_API boost::shared_ptr freeContextBuffer(PVOID contextBuffer); + SWIFTEN_API std::shared_ptr freeContextBuffer(PVOID contextBuffer); /** * Decrypt message (assumes that sequence numbers are not maintained). @@ -133,7 +133,7 @@ namespace Swift { * @return NULL for success, otherwise the error code returned by * Windows. */ - SWIFTEN_API boost::shared_ptr decryptMessage(const PCtxtHandle contextHandle, const ByteArray& message, SafeByteArray& decrypted); + SWIFTEN_API std::shared_ptr decryptMessage(const PCtxtHandle contextHandle, const ByteArray& message, SafeByteArray& decrypted); /** * Produces a header or trailer for the message but does not encrypt it @@ -147,7 +147,7 @@ namespace Swift { * @return NULL for success, otherwise the error code returned by * Windows. */ - SWIFTEN_API boost::shared_ptr encryptMessage(const PCtxtHandle contextHandle, const SecPkgContext_Sizes& sizes, const SafeByteArray& message, SafeByteArray& output); + SWIFTEN_API std::shared_ptr encryptMessage(const PCtxtHandle contextHandle, const SecPkgContext_Sizes& sizes, const SafeByteArray& message, SafeByteArray& output); /** * Queries the security package for attributes of the security context. @@ -165,6 +165,6 @@ namespace Swift { * @return NULL for success, otherwise the error code returned by * Windows. */ - SWIFTEN_API boost::shared_ptr queryContextAttributes(const PCtxtHandle contextHandle, ULONG attribute, PVOID buffer); + SWIFTEN_API std::shared_ptr queryContextAttributes(const PCtxtHandle contextHandle, ULONG attribute, PVOID buffer); } diff --git a/Swiften/SASL/WindowsGSSAPIClientAuthenticator.h b/Swiften/SASL/WindowsGSSAPIClientAuthenticator.h index c48d4dc..72616ed 100644 --- a/Swiften/SASL/WindowsGSSAPIClientAuthenticator.h +++ b/Swiften/SASL/WindowsGSSAPIClientAuthenticator.h @@ -88,7 +88,7 @@ namespace Swift { * * @return Error details. */ - boost::shared_ptr getErrorCode() { + std::shared_ptr getErrorCode() { return errorCode_; } @@ -102,7 +102,7 @@ namespace Swift { ServerAuthenticated } step_; bool error_; - boost::shared_ptr errorCode_; + std::shared_ptr errorCode_; std::string servicePrincipalNameString_; bool haveCredentialsHandle_; bool haveContextHandle_; diff --git a/Swiften/Serializer/AuthChallengeSerializer.cpp b/Swiften/Serializer/AuthChallengeSerializer.cpp index 2796a2d..8f963ff 100644 --- a/Swiften/Serializer/AuthChallengeSerializer.cpp +++ b/Swiften/Serializer/AuthChallengeSerializer.cpp @@ -15,8 +15,8 @@ namespace Swift { AuthChallengeSerializer::AuthChallengeSerializer() { } -SafeByteArray AuthChallengeSerializer::serialize(boost::shared_ptr element) const { - boost::shared_ptr authChallenge(boost::dynamic_pointer_cast(element)); +SafeByteArray AuthChallengeSerializer::serialize(std::shared_ptr element) const { + std::shared_ptr authChallenge(std::dynamic_pointer_cast(element)); std::string value; boost::optional > message = authChallenge->getValue(); if (message) { diff --git a/Swiften/Serializer/AuthChallengeSerializer.h b/Swiften/Serializer/AuthChallengeSerializer.h index 6c88d0a..9bcf68b 100644 --- a/Swiften/Serializer/AuthChallengeSerializer.h +++ b/Swiften/Serializer/AuthChallengeSerializer.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -17,6 +17,6 @@ namespace Swift { public: AuthChallengeSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(std::shared_ptr element) const; }; } diff --git a/Swiften/Serializer/AuthFailureSerializer.h b/Swiften/Serializer/AuthFailureSerializer.h index fe85d2c..a410e8c 100644 --- a/Swiften/Serializer/AuthFailureSerializer.h +++ b/Swiften/Serializer/AuthFailureSerializer.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 +#include #include #include @@ -19,7 +19,7 @@ namespace Swift { AuthFailureSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(std::shared_ptr) const { return createSafeByteArray(XMLElement("failure", "urn:ietf:params:xml:ns:xmpp-sasl").serialize()); } }; diff --git a/Swiften/Serializer/AuthRequestSerializer.cpp b/Swiften/Serializer/AuthRequestSerializer.cpp index f479eac..2c9a4dd 100644 --- a/Swiften/Serializer/AuthRequestSerializer.cpp +++ b/Swiften/Serializer/AuthRequestSerializer.cpp @@ -16,8 +16,8 @@ namespace Swift { AuthRequestSerializer::AuthRequestSerializer() { } -SafeByteArray AuthRequestSerializer::serialize(boost::shared_ptr element) const { - boost::shared_ptr authRequest(boost::dynamic_pointer_cast(element)); +SafeByteArray AuthRequestSerializer::serialize(std::shared_ptr element) const { + std::shared_ptr authRequest(std::dynamic_pointer_cast(element)); SafeByteArray value; boost::optional message = authRequest->getMessage(); if (message) { diff --git a/Swiften/Serializer/AuthRequestSerializer.h b/Swiften/Serializer/AuthRequestSerializer.h index 8522c35..ae85cf6 100644 --- a/Swiften/Serializer/AuthRequestSerializer.h +++ b/Swiften/Serializer/AuthRequestSerializer.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -17,6 +17,6 @@ namespace Swift { public: AuthRequestSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(std::shared_ptr element) const; }; } diff --git a/Swiften/Serializer/AuthResponseSerializer.cpp b/Swiften/Serializer/AuthResponseSerializer.cpp index b4be521..9d3e2e0 100644 --- a/Swiften/Serializer/AuthResponseSerializer.cpp +++ b/Swiften/Serializer/AuthResponseSerializer.cpp @@ -16,8 +16,8 @@ namespace Swift { AuthResponseSerializer::AuthResponseSerializer() { } -SafeByteArray AuthResponseSerializer::serialize(boost::shared_ptr element) const { - boost::shared_ptr authResponse(boost::dynamic_pointer_cast(element)); +SafeByteArray AuthResponseSerializer::serialize(std::shared_ptr element) const { + std::shared_ptr authResponse(std::dynamic_pointer_cast(element)); SafeByteArray value; boost::optional message = authResponse->getValue(); if (message) { diff --git a/Swiften/Serializer/AuthResponseSerializer.h b/Swiften/Serializer/AuthResponseSerializer.h index 2017f75..25ffbbb 100644 --- a/Swiften/Serializer/AuthResponseSerializer.h +++ b/Swiften/Serializer/AuthResponseSerializer.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -17,6 +17,6 @@ namespace Swift { public: AuthResponseSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(std::shared_ptr element) const; }; } diff --git a/Swiften/Serializer/AuthSuccessSerializer.cpp b/Swiften/Serializer/AuthSuccessSerializer.cpp index 78fe6a1..48d512b 100644 --- a/Swiften/Serializer/AuthSuccessSerializer.cpp +++ b/Swiften/Serializer/AuthSuccessSerializer.cpp @@ -15,8 +15,8 @@ namespace Swift { AuthSuccessSerializer::AuthSuccessSerializer() { } -SafeByteArray AuthSuccessSerializer::serialize(boost::shared_ptr element) const { - boost::shared_ptr authSuccess(boost::dynamic_pointer_cast(element)); +SafeByteArray AuthSuccessSerializer::serialize(std::shared_ptr element) const { + std::shared_ptr authSuccess(std::dynamic_pointer_cast(element)); std::string value; boost::optional > message = authSuccess->getValue(); if (message) { diff --git a/Swiften/Serializer/AuthSuccessSerializer.h b/Swiften/Serializer/AuthSuccessSerializer.h index 99133fa..102e6a0 100644 --- a/Swiften/Serializer/AuthSuccessSerializer.h +++ b/Swiften/Serializer/AuthSuccessSerializer.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -17,6 +17,6 @@ namespace Swift { public: AuthSuccessSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(std::shared_ptr element) const; }; } diff --git a/Swiften/Serializer/ComponentHandshakeSerializer.cpp b/Swiften/Serializer/ComponentHandshakeSerializer.cpp index 1ac1ce7..0e94917 100644 --- a/Swiften/Serializer/ComponentHandshakeSerializer.cpp +++ b/Swiften/Serializer/ComponentHandshakeSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -13,8 +13,8 @@ namespace Swift { ComponentHandshakeSerializer::ComponentHandshakeSerializer() { } -SafeByteArray ComponentHandshakeSerializer::serialize(boost::shared_ptr element) const { - boost::shared_ptr handshake(boost::dynamic_pointer_cast(element)); +SafeByteArray ComponentHandshakeSerializer::serialize(std::shared_ptr element) const { + std::shared_ptr handshake(std::dynamic_pointer_cast(element)); return createSafeByteArray("" + handshake->getData() + ""); } diff --git a/Swiften/Serializer/ComponentHandshakeSerializer.h b/Swiften/Serializer/ComponentHandshakeSerializer.h index 651903f..d6ee156 100644 --- a/Swiften/Serializer/ComponentHandshakeSerializer.h +++ b/Swiften/Serializer/ComponentHandshakeSerializer.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 +#include #include #include @@ -17,6 +17,6 @@ namespace Swift { public: ComponentHandshakeSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(std::shared_ptr element) const; }; } diff --git a/Swiften/Serializer/CompressFailureSerializer.h b/Swiften/Serializer/CompressFailureSerializer.h index 154f167..045c7d2 100644 --- a/Swiften/Serializer/CompressFailureSerializer.h +++ b/Swiften/Serializer/CompressFailureSerializer.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 +#include #include #include @@ -19,7 +19,7 @@ namespace Swift { CompressFailureSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(std::shared_ptr) const { return createSafeByteArray(XMLElement("failure", "http://jabber.org/protocol/compress").serialize()); } }; diff --git a/Swiften/Serializer/CompressRequestSerializer.cpp b/Swiften/Serializer/CompressRequestSerializer.cpp index e6bc4ff..9deb702 100644 --- a/Swiften/Serializer/CompressRequestSerializer.cpp +++ b/Swiften/Serializer/CompressRequestSerializer.cpp @@ -13,13 +13,13 @@ namespace Swift { CompressRequestSerializer::CompressRequestSerializer() { } -SafeByteArray CompressRequestSerializer::serialize(boost::shared_ptr element) const { - boost::shared_ptr compressRequest(boost::dynamic_pointer_cast(element)); +SafeByteArray CompressRequestSerializer::serialize(std::shared_ptr element) const { + std::shared_ptr compressRequest(std::dynamic_pointer_cast(element)); return createSafeByteArray("" + compressRequest->getMethod() + ""); } -bool CompressRequestSerializer::canSerialize(boost::shared_ptr element) const { - return boost::dynamic_pointer_cast(element) != nullptr; +bool CompressRequestSerializer::canSerialize(std::shared_ptr element) const { + return std::dynamic_pointer_cast(element) != nullptr; } } diff --git a/Swiften/Serializer/CompressRequestSerializer.h b/Swiften/Serializer/CompressRequestSerializer.h index 1472a81..d768023 100644 --- a/Swiften/Serializer/CompressRequestSerializer.h +++ b/Swiften/Serializer/CompressRequestSerializer.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 +#include #include #include @@ -16,7 +16,7 @@ namespace Swift { public: CompressRequestSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const; - virtual bool canSerialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(std::shared_ptr element) const; + virtual bool canSerialize(std::shared_ptr element) const; }; } diff --git a/Swiften/Serializer/ElementSerializer.h b/Swiften/Serializer/ElementSerializer.h index 15f69da..3bef58b 100644 --- a/Swiften/Serializer/ElementSerializer.h +++ b/Swiften/Serializer/ElementSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -16,7 +16,7 @@ namespace Swift { public: virtual ~ElementSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const = 0; - virtual bool canSerialize(boost::shared_ptr element) const = 0; + virtual SafeByteArray serialize(std::shared_ptr element) const = 0; + virtual bool canSerialize(std::shared_ptr element) const = 0; }; } diff --git a/Swiften/Serializer/EnableStreamManagementSerializer.h b/Swiften/Serializer/EnableStreamManagementSerializer.h index ffbcf8b..ba92843 100644 --- a/Swiften/Serializer/EnableStreamManagementSerializer.h +++ b/Swiften/Serializer/EnableStreamManagementSerializer.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 +#include #include #include @@ -19,7 +19,7 @@ namespace Swift { EnableStreamManagementSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(std::shared_ptr) const { return createSafeByteArray(XMLElement("enable", "urn:xmpp:sm:2").serialize()); } }; diff --git a/Swiften/Serializer/GenericElementSerializer.h b/Swiften/Serializer/GenericElementSerializer.h index 053a163..b5f4119 100644 --- a/Swiften/Serializer/GenericElementSerializer.h +++ b/Swiften/Serializer/GenericElementSerializer.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 +#include #include #include @@ -15,10 +15,10 @@ namespace Swift { template class SWIFTEN_API GenericElementSerializer : public ElementSerializer { public: - virtual SafeByteArray serialize(boost::shared_ptr element) const = 0; + virtual SafeByteArray serialize(std::shared_ptr element) const = 0; - virtual bool canSerialize(boost::shared_ptr element) const { - return !!boost::dynamic_pointer_cast(element); + virtual bool canSerialize(std::shared_ptr element) const { + return !!std::dynamic_pointer_cast(element); } }; } diff --git a/Swiften/Serializer/GenericPayloadSerializer.h b/Swiften/Serializer/GenericPayloadSerializer.h index 080d04b..804ccaf 100644 --- a/Swiften/Serializer/GenericPayloadSerializer.h +++ b/Swiften/Serializer/GenericPayloadSerializer.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 +#include #include #include @@ -15,14 +15,14 @@ namespace Swift { template class GenericPayloadSerializer : public PayloadSerializer { public: - virtual std::string serialize(boost::shared_ptr element) const { - return serializePayload(boost::dynamic_pointer_cast(element)); + virtual std::string serialize(std::shared_ptr element) const { + return serializePayload(std::dynamic_pointer_cast(element)); } - virtual bool canSerialize(boost::shared_ptr element) const { - return !!boost::dynamic_pointer_cast(element); + virtual bool canSerialize(std::shared_ptr element) const { + return !!std::dynamic_pointer_cast(element); } - virtual std::string serializePayload(boost::shared_ptr) const = 0; + virtual std::string serializePayload(std::shared_ptr) const = 0; }; } diff --git a/Swiften/Serializer/GenericStanzaSerializer.h b/Swiften/Serializer/GenericStanzaSerializer.h index 32fcbe9..badd55c 100644 --- a/Swiften/Serializer/GenericStanzaSerializer.h +++ b/Swiften/Serializer/GenericStanzaSerializer.h @@ -15,19 +15,19 @@ namespace Swift { public: GenericStanzaSerializer(const std::string& tag, PayloadSerializerCollection* payloadSerializers, const boost::optional& explicitNS = boost::optional()) : StanzaSerializer(tag, payloadSerializers, explicitNS) {} - virtual bool canSerialize(boost::shared_ptr element) const { + virtual bool canSerialize(std::shared_ptr element) const { return dynamic_cast(element.get()) != nullptr; } virtual void setStanzaSpecificAttributes( - boost::shared_ptr stanza, + std::shared_ptr stanza, XMLElement& element) const { setStanzaSpecificAttributesGeneric( - boost::dynamic_pointer_cast(stanza), element); + std::dynamic_pointer_cast(stanza), element); } virtual void setStanzaSpecificAttributesGeneric( - boost::shared_ptr, + std::shared_ptr, XMLElement&) const = 0; }; } diff --git a/Swiften/Serializer/IQSerializer.h b/Swiften/Serializer/IQSerializer.h index db052fb..1bdbb07 100644 --- a/Swiften/Serializer/IQSerializer.h +++ b/Swiften/Serializer/IQSerializer.h @@ -22,7 +22,7 @@ namespace Swift { private: virtual void setStanzaSpecificAttributesGeneric( - boost::shared_ptr iq, + std::shared_ptr iq, XMLElement& element) const { switch (iq->getType()) { case IQ::Get: element.setAttribute("type","get"); break; diff --git a/Swiften/Serializer/MessageSerializer.cpp b/Swiften/Serializer/MessageSerializer.cpp index fb16393..774d9a3 100644 --- a/Swiften/Serializer/MessageSerializer.cpp +++ b/Swiften/Serializer/MessageSerializer.cpp @@ -15,7 +15,7 @@ MessageSerializer::MessageSerializer(PayloadSerializerCollection* payloadSeriali } void MessageSerializer::setStanzaSpecificAttributesGeneric( - boost::shared_ptr message, + std::shared_ptr message, XMLElement& element) const { if (message->getType() == Message::Chat) { element.setAttribute("type", "chat"); diff --git a/Swiften/Serializer/MessageSerializer.h b/Swiften/Serializer/MessageSerializer.h index 50df353..812b647 100644 --- a/Swiften/Serializer/MessageSerializer.h +++ b/Swiften/Serializer/MessageSerializer.h @@ -21,7 +21,7 @@ namespace Swift { private: void setStanzaSpecificAttributesGeneric( - boost::shared_ptr message, + std::shared_ptr message, XMLElement& element) const; }; } diff --git a/Swiften/Serializer/PayloadSerializer.h b/Swiften/Serializer/PayloadSerializer.h index 642247d..fe14e3d 100644 --- a/Swiften/Serializer/PayloadSerializer.h +++ b/Swiften/Serializer/PayloadSerializer.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include namespace Swift { @@ -19,7 +18,7 @@ namespace Swift { public: virtual ~PayloadSerializer(); - virtual bool canSerialize(boost::shared_ptr) const = 0; - virtual std::string serialize(boost::shared_ptr) const = 0; + virtual bool canSerialize(std::shared_ptr) const = 0; + virtual std::string serialize(std::shared_ptr) const = 0; }; } diff --git a/Swiften/Serializer/PayloadSerializerCollection.cpp b/Swiften/Serializer/PayloadSerializerCollection.cpp index 05fe445..dd20364 100644 --- a/Swiften/Serializer/PayloadSerializerCollection.cpp +++ b/Swiften/Serializer/PayloadSerializerCollection.cpp @@ -25,7 +25,7 @@ void PayloadSerializerCollection::removeSerializer(PayloadSerializer* serializer serializers_.erase(std::remove(serializers_.begin(), serializers_.end(), serializer), serializers_.end()); } -PayloadSerializer* PayloadSerializerCollection::getPayloadSerializer(boost::shared_ptr payload) const { +PayloadSerializer* PayloadSerializerCollection::getPayloadSerializer(std::shared_ptr payload) const { std::vector::const_iterator i = std::find_if( serializers_.begin(), serializers_.end(), boost::bind(&PayloadSerializer::canSerialize, _1, payload)); diff --git a/Swiften/Serializer/PayloadSerializerCollection.h b/Swiften/Serializer/PayloadSerializerCollection.h index 47ba6a1..a0fe2ea 100644 --- a/Swiften/Serializer/PayloadSerializerCollection.h +++ b/Swiften/Serializer/PayloadSerializerCollection.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include @@ -23,7 +22,7 @@ namespace Swift { void addSerializer(PayloadSerializer* factory); void removeSerializer(PayloadSerializer* factory); - PayloadSerializer* getPayloadSerializer(boost::shared_ptr) const; + PayloadSerializer* getPayloadSerializer(std::shared_ptr) const; private: std::vector serializers_; diff --git a/Swiften/Serializer/PayloadSerializers/BlockSerializer.h b/Swiften/Serializer/PayloadSerializers/BlockSerializer.h index 7490e4f..86aa321 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 +#include #include #include @@ -20,11 +20,11 @@ namespace Swift { BlockSerializer(std::string tag) : GenericPayloadSerializer(), tag(tag) { } - virtual std::string serializePayload(boost::shared_ptr payload) const { + virtual std::string serializePayload(std::shared_ptr payload) const { XMLElement element(tag, "urn:xmpp:blocking"); const std::vector& items = payload->getItems(); for (std::vector::const_iterator i = items.begin(); i != items.end(); ++i) { - boost::shared_ptr item = boost::make_shared("item"); + std::shared_ptr item = std::make_shared("item"); item->setAttribute("jid", *i); element.addNode(item); } diff --git a/Swiften/Serializer/PayloadSerializers/BodySerializer.h b/Swiften/Serializer/PayloadSerializers/BodySerializer.h index f2d7a8d..faad411 100644 --- a/Swiften/Serializer/PayloadSerializers/BodySerializer.h +++ b/Swiften/Serializer/PayloadSerializers/BodySerializer.h @@ -16,7 +16,7 @@ namespace Swift { public: BodySerializer() : GenericPayloadSerializer() {} - virtual std::string serializePayload(boost::shared_ptr body) const { + virtual std::string serializePayload(std::shared_ptr body) const { XMLTextNode textNode(body->getText()); return "" + textNode.serialize() + ""; } diff --git a/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp index b5218ee..93eab75 100644 --- a/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -18,11 +19,11 @@ namespace Swift { BytestreamsSerializer::BytestreamsSerializer() { } -std::string BytestreamsSerializer::serializePayload(boost::shared_ptr bytestreams) const { +std::string BytestreamsSerializer::serializePayload(std::shared_ptr bytestreams) const { XMLElement queryElement("query", "http://jabber.org/protocol/bytestreams"); queryElement.setAttribute("sid", bytestreams->getStreamID()); foreach(const Bytestreams::StreamHost& streamHost, bytestreams->getStreamHosts()) { - boost::shared_ptr streamHostElement(new XMLElement("streamhost")); + std::shared_ptr streamHostElement(new XMLElement("streamhost")); streamHostElement->setAttribute("host", streamHost.host); streamHostElement->setAttribute("jid", streamHost.jid.toString()); streamHostElement->setAttribute("port", boost::lexical_cast(streamHost.port)); @@ -30,7 +31,7 @@ std::string BytestreamsSerializer::serializePayload(boost::shared_ptrgetUsedStreamHost()) { - boost::shared_ptr streamHostElement(new XMLElement("streamhost-used")); + std::shared_ptr streamHostElement(new XMLElement("streamhost-used")); streamHostElement->setAttribute("jid", *bytestreams->getUsedStreamHost()); queryElement.addNode(streamHostElement); } diff --git a/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h b/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h index 6056cad..533be61 100644 --- a/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h @@ -17,6 +17,6 @@ namespace Swift { public: BytestreamsSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp index 799e662..19f8a27 100644 --- a/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include +#include #include @@ -15,7 +15,7 @@ namespace Swift { CapsInfoSerializer::CapsInfoSerializer() : GenericPayloadSerializer() { } -std::string CapsInfoSerializer::serializePayload(boost::shared_ptr capsInfo) const { +std::string CapsInfoSerializer::serializePayload(std::shared_ptr capsInfo) const { XMLElement capsElement("c", "http://jabber.org/protocol/caps"); capsElement.setAttribute("node", capsInfo->getNode()); capsElement.setAttribute("hash", capsInfo->getHash()); diff --git a/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h b/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h index bbf4c09..ac168e4 100644 --- a/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h @@ -15,6 +15,6 @@ namespace Swift { public: CapsInfoSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.cpp index 406fdbc..9938bd9 100644 --- a/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -17,7 +17,7 @@ namespace Swift { } - std::string CarbonsDisableSerializer::serializePayload(boost::shared_ptr) const { + std::string CarbonsDisableSerializer::serializePayload(std::shared_ptr) const { XMLElement element("disable", "urn:xmpp:carbons:2"); return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.h b/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.h index da01ead..a6bf16f 100644 --- a/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -16,6 +16,6 @@ namespace Swift { CarbonsDisableSerializer(); virtual ~CarbonsDisableSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.cpp index a2520f9..424c6fc 100644 --- a/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -16,7 +16,7 @@ namespace Swift { } - std::string CarbonsEnableSerializer::serializePayload(boost::shared_ptr) const { + std::string CarbonsEnableSerializer::serializePayload(std::shared_ptr) const { XMLElement element("enable", "urn:xmpp:carbons:2"); return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.h b/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.h index 8b26901..eb0f6fa 100644 --- a/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -17,6 +17,6 @@ namespace Swift { CarbonsEnableSerializer(); virtual ~CarbonsEnableSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.cpp index 6fbfc26..fb92017 100644 --- a/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -16,7 +16,7 @@ namespace Swift { } - std::string CarbonsPrivateSerializer::serializePayload(boost::shared_ptr) const { + std::string CarbonsPrivateSerializer::serializePayload(std::shared_ptr) const { XMLElement element("private", "urn:xmpp:carbons:2"); return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.h b/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.h index a93d87f..d148a26 100644 --- a/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -17,6 +17,6 @@ namespace Swift { CarbonsPrivateSerializer(); virtual ~CarbonsPrivateSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.cpp index 981421b..cc87929 100644 --- a/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.cpp @@ -1,12 +1,12 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include +#include namespace Swift { CarbonsReceivedSerializer::CarbonsReceivedSerializer(PayloadSerializerCollection* serializers) : GenericPayloadSerializer(), serializers_(serializers) { @@ -15,10 +15,10 @@ namespace Swift { CarbonsReceivedSerializer::~CarbonsReceivedSerializer() { } - std::string CarbonsReceivedSerializer::serializePayload(boost::shared_ptr received) const { + std::string CarbonsReceivedSerializer::serializePayload(std::shared_ptr received) const { XMLElement element("received", "urn:xmpp:carbons:2"); if (received->getForwarded()) { - element.addNode(boost::make_shared(ForwardedSerializer(serializers_).serialize(received->getForwarded()))); + element.addNode(std::make_shared(ForwardedSerializer(serializers_).serialize(received->getForwarded()))); } return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.h b/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.h index 719e84a..017b187 100644 --- a/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.h @@ -20,7 +20,7 @@ namespace Swift { CarbonsReceivedSerializer(PayloadSerializerCollection* serializers); virtual ~CarbonsReceivedSerializer(); - virtual std::string serializePayload(boost::shared_ptr received) const; + virtual std::string serializePayload(std::shared_ptr received) const; private: PayloadSerializerCollection* serializers_; diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.cpp index f71208f..986edcb 100644 --- a/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -13,10 +13,10 @@ namespace Swift { CarbonsSentSerializer::~CarbonsSentSerializer() { } - std::string CarbonsSentSerializer::serializePayload(boost::shared_ptr sent) const { + std::string CarbonsSentSerializer::serializePayload(std::shared_ptr sent) const { XMLElement element("sent", "urn:xmpp:carbons:2"); if (sent->getForwarded()) { - element.addNode(boost::make_shared(ForwardedSerializer(serializers_).serialize(sent->getForwarded()))); + element.addNode(std::make_shared(ForwardedSerializer(serializers_).serialize(sent->getForwarded()))); } return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.h b/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.h index cecb3b8..16db398 100644 --- a/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -22,7 +22,7 @@ namespace Swift { CarbonsSentSerializer(PayloadSerializerCollection* serializers); virtual ~CarbonsSentSerializer(); - virtual std::string serializePayload(boost::shared_ptr sent) const; + virtual std::string serializePayload(std::shared_ptr sent) const; private: PayloadSerializerCollection* serializers_; diff --git a/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.cpp index 325215a..17f8be0 100644 --- a/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -11,7 +11,7 @@ namespace Swift { ChatStateSerializer::ChatStateSerializer() : GenericPayloadSerializer() { } -std::string ChatStateSerializer::serializePayload(boost::shared_ptr chatState) const { +std::string ChatStateSerializer::serializePayload(std::shared_ptr chatState) const { std::string result("<"); switch (chatState->getChatState()) { case ChatState::Active: result += "active"; break; diff --git a/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.h b/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.h index cfdaf83..3b9f315 100644 --- a/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.h @@ -15,6 +15,6 @@ namespace Swift { public: ChatStateSerializer(); - virtual std::string serializePayload(boost::shared_ptr error) const; + virtual std::string serializePayload(std::shared_ptr error) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/CommandSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CommandSerializer.cpp index 9ed17dc..e1dd6ed 100644 --- a/Swiften/Serializer/PayloadSerializers/CommandSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/CommandSerializer.cpp @@ -6,8 +6,7 @@ #include -#include -#include +#include #include #include @@ -20,7 +19,7 @@ namespace Swift { CommandSerializer::CommandSerializer() { } -std::string CommandSerializer::serializePayload(boost::shared_ptr command) const { +std::string CommandSerializer::serializePayload(std::shared_ptr command) const { XMLElement commandElement("command", "http://jabber.org/protocol/commands"); commandElement.setAttribute("node", command->getNode()); @@ -55,11 +54,11 @@ std::string CommandSerializer::serializePayload(boost::shared_ptr comma actions += "<" + actionToString(action) + "/>"; } actions += ""; - commandElement.addNode(boost::make_shared(actions)); + commandElement.addNode(std::make_shared(actions)); } foreach (Command::Note note, command->getNotes()) { - boost::shared_ptr noteElement(new XMLElement("note")); + std::shared_ptr noteElement(new XMLElement("note")); std::string type; switch (note.type) { case Command::Note::Info: type = "info"; break; @@ -69,13 +68,13 @@ std::string CommandSerializer::serializePayload(boost::shared_ptr comma if (!type.empty()) { noteElement->setAttribute("type", type); } - noteElement->addNode(boost::make_shared(note.note)); + noteElement->addNode(std::make_shared(note.note)); commandElement.addNode(noteElement); } Form::ref form = command->getForm(); if (form) { - commandElement.addNode(boost::make_shared(FormSerializer().serialize(form))); + commandElement.addNode(std::make_shared(FormSerializer().serialize(form))); } return commandElement.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/CommandSerializer.h b/Swiften/Serializer/PayloadSerializers/CommandSerializer.h index bc3642d..e1f0b24 100644 --- a/Swiften/Serializer/PayloadSerializers/CommandSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/CommandSerializer.h @@ -15,7 +15,7 @@ namespace Swift { public: CommandSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; private: std::string actionToString(Command::Action action) const; diff --git a/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp b/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp index 428b565..b168fdc 100644 --- a/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -18,7 +19,7 @@ namespace Swift { DelaySerializer::DelaySerializer() : GenericPayloadSerializer() { } -std::string DelaySerializer::serializePayload(boost::shared_ptr delay) const { +std::string DelaySerializer::serializePayload(std::shared_ptr delay) const { XMLElement delayElement("delay", "urn:xmpp:delay"); if (delay->getFrom() && delay->getFrom()->isValid()) { delayElement.setAttribute("from", delay->getFrom()->toString()); diff --git a/Swiften/Serializer/PayloadSerializers/DelaySerializer.h b/Swiften/Serializer/PayloadSerializers/DelaySerializer.h index 71039f2..86fde42 100644 --- a/Swiften/Serializer/PayloadSerializers/DelaySerializer.h +++ b/Swiften/Serializer/PayloadSerializers/DelaySerializer.h @@ -15,7 +15,7 @@ namespace Swift { public: DelaySerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.cpp b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.cpp index 887502a..8183b7f 100644 --- a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.cpp @@ -20,7 +20,7 @@ namespace Swift { DeliveryReceiptRequestSerializer::DeliveryReceiptRequestSerializer() : GenericPayloadSerializer() { } -std::string DeliveryReceiptRequestSerializer::serializePayload(boost::shared_ptr /* request*/) const { +std::string DeliveryReceiptRequestSerializer::serializePayload(std::shared_ptr /* request*/) const { XMLElement requestXML("request", "urn:xmpp:receipts"); return requestXML.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.h b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.h index 97377d6..a3e76eb 100644 --- a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.h @@ -21,6 +21,6 @@ namespace Swift { public: DeliveryReceiptRequestSerializer(); - virtual std::string serializePayload(boost::shared_ptr request) const; + virtual std::string serializePayload(std::shared_ptr request) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.cpp b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.cpp index d3e1480..d392d17 100644 --- a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.cpp @@ -19,7 +19,7 @@ namespace Swift { DeliveryReceiptSerializer::DeliveryReceiptSerializer() : GenericPayloadSerializer() { } -std::string DeliveryReceiptSerializer::serializePayload(boost::shared_ptr receipt) const { +std::string DeliveryReceiptSerializer::serializePayload(std::shared_ptr receipt) const { XMLElement received("received", "urn:xmpp:receipts"); received.setAttribute("id", receipt->getReceivedID()); return received.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.h b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.h index 943f4b9..6153de1 100644 --- a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.h @@ -21,6 +21,6 @@ namespace Swift { public: DeliveryReceiptSerializer(); - virtual std::string serializePayload(boost::shared_ptr receipt) const; + virtual std::string serializePayload(std::shared_ptr receipt) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp index e57fd12..73e2585 100644 --- a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp @@ -6,8 +6,7 @@ #include -#include -#include +#include #include #include @@ -19,13 +18,13 @@ namespace Swift { DiscoInfoSerializer::DiscoInfoSerializer() : GenericPayloadSerializer() { } -std::string DiscoInfoSerializer::serializePayload(boost::shared_ptr discoInfo) const { +std::string DiscoInfoSerializer::serializePayload(std::shared_ptr discoInfo) const { XMLElement queryElement("query", "http://jabber.org/protocol/disco#info"); if (!discoInfo->getNode().empty()) { queryElement.setAttribute("node", discoInfo->getNode()); } foreach(const DiscoInfo::Identity& identity, discoInfo->getIdentities()) { - boost::shared_ptr identityElement(new XMLElement("identity")); + std::shared_ptr identityElement(new XMLElement("identity")); if (!identity.getLanguage().empty()) { identityElement->setAttribute("xml:lang", identity.getLanguage()); } @@ -35,12 +34,12 @@ std::string DiscoInfoSerializer::serializePayload(boost::shared_ptr d queryElement.addNode(identityElement); } foreach(const std::string& feature, discoInfo->getFeatures()) { - boost::shared_ptr featureElement(new XMLElement("feature")); + std::shared_ptr featureElement(new XMLElement("feature")); featureElement->setAttribute("var", feature); queryElement.addNode(featureElement); } foreach(const Form::ref extension, discoInfo->getExtensions()) { - queryElement.addNode(boost::make_shared(FormSerializer().serialize(extension))); + queryElement.addNode(std::make_shared(FormSerializer().serialize(extension))); } return queryElement.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h index 9850714..21648d6 100644 --- a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h @@ -15,6 +15,6 @@ namespace Swift { public: DiscoInfoSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.cpp index f537f40..1b734dc 100644 --- a/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.cpp @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include +#include #include #include @@ -16,13 +16,13 @@ namespace Swift { DiscoItemsSerializer::DiscoItemsSerializer() : GenericPayloadSerializer() { } -std::string DiscoItemsSerializer::serializePayload(boost::shared_ptr discoItems) const { +std::string DiscoItemsSerializer::serializePayload(std::shared_ptr discoItems) const { XMLElement queryElement("query", "http://jabber.org/protocol/disco#items"); if (!discoItems->getNode().empty()) { queryElement.setAttribute("node", discoItems->getNode()); } foreach(const DiscoItems::Item& item, discoItems->getItems()) { - boost::shared_ptr itemElement(new XMLElement("item")); + std::shared_ptr itemElement(new XMLElement("item")); itemElement->setAttribute("name", item.getName()); itemElement->setAttribute("jid", item.getJID()); if (!item.getNode().empty()) { diff --git a/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h b/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h index acc5a7b..ca88cb0 100644 --- a/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h @@ -15,7 +15,7 @@ namespace Swift { public: DiscoItemsSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/ErrorSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ErrorSerializer.cpp index 1ed60d1..26686f0 100644 --- a/Swiften/Serializer/PayloadSerializers/ErrorSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/ErrorSerializer.cpp @@ -14,7 +14,7 @@ namespace Swift { ErrorSerializer::ErrorSerializer(PayloadSerializerCollection* serializers) : GenericPayloadSerializer(), serializers(serializers) { } -std::string ErrorSerializer::serializePayload(boost::shared_ptr error) const { +std::string ErrorSerializer::serializePayload(std::shared_ptr error) const { std::string result("getType()) { case ErrorPayload::Continue: result += "continue"; break; diff --git a/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h b/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h index 2ccd5df..df7791e 100644 --- a/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h @@ -17,7 +17,7 @@ namespace Swift { public: ErrorSerializer(PayloadSerializerCollection* serializers); - virtual std::string serializePayload(boost::shared_ptr error) const; + virtual std::string serializePayload(std::shared_ptr error) const; private: PayloadSerializerCollection* serializers; diff --git a/Swiften/Serializer/PayloadSerializers/FormSerializer.cpp b/Swiften/Serializer/PayloadSerializers/FormSerializer.cpp index cc6339c..9a05431 100644 --- a/Swiften/Serializer/PayloadSerializers/FormSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/FormSerializer.cpp @@ -7,11 +7,9 @@ #include #include +#include #include -#include -#include - #include #include #include @@ -21,10 +19,10 @@ using namespace Swift; namespace { - template void serializeValueAsString(boost::shared_ptr field, boost::shared_ptr parent) { - std::string value = boost::dynamic_pointer_cast(field)->getValue(); + template void serializeValueAsString(std::shared_ptr field, std::shared_ptr parent) { + std::string value = std::dynamic_pointer_cast(field)->getValue(); if (!value.empty()) { - boost::shared_ptr valueElement(new XMLElement("value")); + std::shared_ptr valueElement(new XMLElement("value")); valueElement->addNode(XMLTextNode::create(value)); parent->addNode(valueElement); } @@ -35,12 +33,12 @@ namespace Swift { FormSerializer::FormSerializer() : GenericPayloadSerializer() {} -std::string FormSerializer::serializePayload(boost::shared_ptr form) const { +std::string FormSerializer::serializePayload(std::shared_ptr form) const { if (!form) { return ""; } - boost::shared_ptr formElement(new XMLElement("x", "jabber:x:data")); + std::shared_ptr formElement(new XMLElement("x", "jabber:x:data")); std::string type; switch (form->getType()) { case Form::FormType: type = "form"; break; @@ -55,14 +53,14 @@ std::string FormSerializer::serializePayload(boost::shared_ptr form) cons if (!form->getInstructions().empty()) { multiLineify(form->getInstructions(), "instructions", formElement); } - foreach(boost::shared_ptr page, form->getPages()) { + foreach(std::shared_ptr page, form->getPages()) { formElement->addNode(pageToXML(page)); } - foreach(boost::shared_ptr field, form->getFields()) { + foreach(std::shared_ptr field, form->getFields()) { formElement->addNode(fieldToXML(field, true)); } if (!form->getReportedFields().empty()) { - boost::shared_ptr reportedElement(new XMLElement("reported")); + std::shared_ptr reportedElement(new XMLElement("reported")); foreach(FormField::ref field, form->getReportedFields()) { reportedElement->addNode(fieldToXML(field, true)); } @@ -70,7 +68,7 @@ std::string FormSerializer::serializePayload(boost::shared_ptr form) cons } foreach(Form::FormItem item, form->getItems()) { - boost::shared_ptr itemElement(new XMLElement("item")); + std::shared_ptr itemElement(new XMLElement("item")); foreach(FormField::ref field, item) { itemElement->addNode(fieldToXML(field, false)); } @@ -81,27 +79,27 @@ std::string FormSerializer::serializePayload(boost::shared_ptr form) cons formElement->addNode(textToXML(text)); } - foreach (boost::shared_ptr field, fields_) { + foreach (std::shared_ptr field, fields_) { formElement->addNode(fieldToXML(field,true)); } return formElement->serialize(); } -boost::shared_ptr FormSerializer::textToXML(boost::shared_ptr text) const { - boost::shared_ptr textElement (new XMLElement("text")); - textElement->addNode(boost::make_shared(text->getTextString())); +std::shared_ptr FormSerializer::textToXML(std::shared_ptr text) const { + std::shared_ptr textElement (new XMLElement("text")); + textElement->addNode(std::make_shared(text->getTextString())); return textElement; } -boost::shared_ptr FormSerializer::fieldRefToXML(const std::string& ref) const { - boost::shared_ptr fieldRefElement(new XMLElement("fieldref")); +std::shared_ptr FormSerializer::fieldRefToXML(const std::string& ref) const { + std::shared_ptr fieldRefElement(new XMLElement("fieldref")); fieldRefElement->setAttribute("var", ref); return fieldRefElement; } -boost::shared_ptr FormSerializer::pageToXML(boost::shared_ptr page) const { - boost::shared_ptr pageElement(new XMLElement("page")); +std::shared_ptr FormSerializer::pageToXML(std::shared_ptr page) const { + std::shared_ptr pageElement(new XMLElement("page")); pageElement->setAttribute("xmlns", "http://jabber.org/protocol/xdata-layout"); if (!page->getLabel().empty()) { pageElement->setAttribute("label", page->getLabel()); @@ -109,12 +107,12 @@ boost::shared_ptr FormSerializer::pageToXML(boost::shared_ptrgetTextElements()) { pageElement->addNode(textToXML(text)); } - foreach (const boost::shared_ptr field, page->getFields()) { + foreach (const std::shared_ptr field, page->getFields()) { pageElement->addNode(fieldRefToXML(field->getName())); fields_.push_back(field); } foreach(const FormReportedRef::ref reportedRef, page->getReportedRefs()) { - pageElement->addNode(boost::make_shared("reportedref")); + pageElement->addNode(std::make_shared("reportedref")); } foreach(const FormSection::section section, page->getChildSections()) { pageElement->addNode(sectionToXML(section)); @@ -122,20 +120,20 @@ boost::shared_ptr FormSerializer::pageToXML(boost::shared_ptr FormSerializer::sectionToXML(boost::shared_ptr section) const { - boost::shared_ptr sectionElement(new XMLElement("section")); +std::shared_ptr FormSerializer::sectionToXML(std::shared_ptr section) const { + std::shared_ptr sectionElement(new XMLElement("section")); if (!section->getLabel().empty()) { sectionElement->setAttribute("label", section->getLabel()); } foreach(const FormText::text text, section->getTextElements()) { sectionElement->addNode(textToXML(text)); } - foreach(const boost::shared_ptr field, section->getFields()) { + foreach(const std::shared_ptr field, section->getFields()) { sectionElement->addNode(fieldRefToXML(field->getName())); fields_.push_back(field); } foreach(const FormReportedRef::ref reportedRef, section->getReportedRefs()) { - sectionElement->addNode(boost::make_shared("reportedref")); + sectionElement->addNode(std::make_shared("reportedref")); } foreach(const FormSection::section childSection, section->getChildSections()) { sectionElement->addNode(sectionToXML(childSection)); @@ -143,8 +141,8 @@ boost::shared_ptr FormSerializer::sectionToXML(boost::shared_ptr FormSerializer::fieldToXML(boost::shared_ptr field, bool withTypeAttribute) const { - boost::shared_ptr fieldElement(new XMLElement("field")); +std::shared_ptr FormSerializer::fieldToXML(std::shared_ptr field, bool withTypeAttribute) const { + std::shared_ptr fieldElement(new XMLElement("field")); if (!field->getName().empty()) { fieldElement->setAttribute("var", field->getName()); } @@ -152,11 +150,11 @@ boost::shared_ptr FormSerializer::fieldToXML(boost::shared_ptrsetAttribute("label", field->getLabel()); } if (field->getRequired()) { - fieldElement->addNode(boost::make_shared("required")); + fieldElement->addNode(std::make_shared("required")); } if (!field->getDescription().empty()) { - boost::shared_ptr descriptionElement(new XMLElement("desc")); - descriptionElement->addNode(boost::make_shared(field->getDescription())); + std::shared_ptr descriptionElement(new XMLElement("desc")); + descriptionElement->addNode(std::make_shared(field->getDescription())); fieldElement->addNode(descriptionElement); } @@ -179,18 +177,18 @@ boost::shared_ptr FormSerializer::fieldToXML(boost::shared_ptrsetAttribute("type", fieldType); } foreach (const std::string& value, field->getValues()) { - boost::shared_ptr valueElement = boost::make_shared("value"); - valueElement->addNode(boost::make_shared(value)); + std::shared_ptr valueElement = std::make_shared("value"); + valueElement->addNode(std::make_shared(value)); fieldElement->addNode(valueElement); } foreach (const FormField::Option& option, field->getOptions()) { - boost::shared_ptr optionElement(new XMLElement("option")); + std::shared_ptr optionElement(new XMLElement("option")); if (!option.label.empty()) { optionElement->setAttribute("label", option.label); } - boost::shared_ptr valueElement(new XMLElement("value")); + std::shared_ptr valueElement(new XMLElement("value")); valueElement->addNode(XMLTextNode::create(option.value)); optionElement->addNode(valueElement); fieldElement->addNode(optionElement); @@ -198,13 +196,13 @@ boost::shared_ptr FormSerializer::fieldToXML(boost::shared_ptr element) const { +void FormSerializer::multiLineify(const std::string& text, const std::string& elementName, std::shared_ptr element) const { std::string unRdText(text); erase(unRdText, '\r'); std::vector lines = String::split(unRdText, '\n'); foreach (std::string line, lines) { - boost::shared_ptr lineElement(new XMLElement(elementName)); - lineElement->addNode(boost::make_shared(line)); + std::shared_ptr lineElement(new XMLElement(elementName)); + lineElement->addNode(std::make_shared(line)); element->addNode(lineElement); } } diff --git a/Swiften/Serializer/PayloadSerializers/FormSerializer.h b/Swiften/Serializer/PayloadSerializers/FormSerializer.h index 62f6484..590fce4 100644 --- a/Swiften/Serializer/PayloadSerializers/FormSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/FormSerializer.h @@ -18,16 +18,16 @@ namespace Swift { class SWIFTEN_API FormSerializer : public GenericPayloadSerializer { public: FormSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; private: - boost::shared_ptr textToXML(boost::shared_ptr textElement) const; - boost::shared_ptr fieldRefToXML(const std::string& ref) const; - boost::shared_ptr reportedRefToXML(boost::shared_ptr reportedRef) const; - boost::shared_ptr pageToXML(boost::shared_ptr page) const; - boost::shared_ptr sectionToXML(boost::shared_ptr section) const; - boost::shared_ptr fieldToXML(boost::shared_ptr field, bool withTypeAttribute) const; - void multiLineify(const std::string& text, const std::string& elementName, boost::shared_ptr parent) const; - mutable std::vector > fields_; + std::shared_ptr textToXML(std::shared_ptr textElement) const; + std::shared_ptr fieldRefToXML(const std::string& ref) const; + std::shared_ptr reportedRefToXML(std::shared_ptr reportedRef) const; + std::shared_ptr pageToXML(std::shared_ptr page) const; + std::shared_ptr sectionToXML(std::shared_ptr section) const; + std::shared_ptr fieldToXML(std::shared_ptr field, bool withTypeAttribute) const; + void multiLineify(const std::string& text, const std::string& elementName, std::shared_ptr parent) const; + mutable std::vector > fields_; }; } diff --git a/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.cpp index 8df5793..58660d7 100644 --- a/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -30,7 +31,7 @@ ForwardedSerializer::ForwardedSerializer(PayloadSerializerCollection* serializer ForwardedSerializer::~ForwardedSerializer() { } -std::string ForwardedSerializer::serializePayload(boost::shared_ptr payload) const { +std::string ForwardedSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } @@ -38,20 +39,20 @@ std::string ForwardedSerializer::serializePayload(boost::shared_ptr p XMLElement element("forwarded", "urn:xmpp:forward:0"); if (payload->getDelay()) { - element.addNode(boost::make_shared(DelaySerializer().serialize(payload->getDelay()))); + element.addNode(std::make_shared(DelaySerializer().serialize(payload->getDelay()))); } if (payload->getStanza()) { /* find out what type of stanza we are dealing with and branch into the correct serializer*/ - boost::shared_ptr iq; - boost::shared_ptr message; - boost::shared_ptr presence; + std::shared_ptr iq; + std::shared_ptr message; + std::shared_ptr presence; const std::string ns = "jabber:client"; - if ((iq = boost::dynamic_pointer_cast(payload->getStanza()))) { - element.addNode(boost::make_shared(safeByteArrayToString(IQSerializer(serializers_).serialize(iq, ns)))); - } else if ((message = boost::dynamic_pointer_cast(payload->getStanza()))) { - element.addNode(boost::make_shared(safeByteArrayToString(MessageSerializer(serializers_).serialize(message, ns)))); - } else if ((presence = boost::dynamic_pointer_cast(payload->getStanza()))) { - element.addNode(boost::make_shared(safeByteArrayToString(PresenceSerializer(serializers_).serialize(presence, ns)))); + if ((iq = std::dynamic_pointer_cast(payload->getStanza()))) { + element.addNode(std::make_shared(safeByteArrayToString(IQSerializer(serializers_).serialize(iq, ns)))); + } else if ((message = std::dynamic_pointer_cast(payload->getStanza()))) { + element.addNode(std::make_shared(safeByteArrayToString(MessageSerializer(serializers_).serialize(message, ns)))); + } else if ((presence = std::dynamic_pointer_cast(payload->getStanza()))) { + element.addNode(std::make_shared(safeByteArrayToString(PresenceSerializer(serializers_).serialize(presence, ns)))); } } diff --git a/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.h b/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.h index 08b82b9..f3eb6fb 100644 --- a/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { ForwardedSerializer(PayloadSerializerCollection* serializers); virtual ~ForwardedSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: PayloadSerializerCollection* serializers_; diff --git a/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp b/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp index 53ae0d2..36d82a2 100644 --- a/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp @@ -7,10 +7,9 @@ #include #include +#include #include -#include -#include #include #include @@ -22,7 +21,7 @@ namespace Swift { IBBSerializer::IBBSerializer() { } -std::string IBBSerializer::serializePayload(boost::shared_ptr ibb) const { +std::string IBBSerializer::serializePayload(std::shared_ptr ibb) const { switch(ibb->getAction()) { case IBB::Data: { XMLElement ibbElement("data", "http://jabber.org/protocol/ibb"); @@ -30,7 +29,7 @@ std::string IBBSerializer::serializePayload(boost::shared_ptr ibb) const { if (ibb->getSequenceNumber() >= 0) { ibbElement.setAttribute("seq", boost::lexical_cast(ibb->getSequenceNumber())); } - ibbElement.addNode(boost::make_shared(Base64::encode(ibb->getData()))); + ibbElement.addNode(std::make_shared(Base64::encode(ibb->getData()))); return ibbElement.serialize(); } case IBB::Open: { diff --git a/Swiften/Serializer/PayloadSerializers/IBBSerializer.h b/Swiften/Serializer/PayloadSerializers/IBBSerializer.h index fe45eac..0ef1680 100644 --- a/Swiften/Serializer/PayloadSerializers/IBBSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/IBBSerializer.h @@ -15,6 +15,6 @@ namespace Swift { public: IBBSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/IdleSerializer.h b/Swiften/Serializer/PayloadSerializers/IdleSerializer.h index 1a832a1..4e1a953 100644 --- a/Swiften/Serializer/PayloadSerializers/IdleSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/IdleSerializer.h @@ -22,7 +22,7 @@ namespace Swift { public: IdleSerializer() : GenericPayloadSerializer() {} - virtual std::string serializePayload(boost::shared_ptr idle) const { + virtual std::string serializePayload(std::shared_ptr idle) const { return ""; } }; diff --git a/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.cpp index 5f275f1..31b023f 100644 --- a/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.cpp @@ -6,8 +6,7 @@ #include -#include -#include +#include #include #include @@ -19,7 +18,7 @@ namespace Swift { InBandRegistrationPayloadSerializer::InBandRegistrationPayloadSerializer() { } -std::string InBandRegistrationPayloadSerializer::serializePayload(boost::shared_ptr registration) const { +std::string InBandRegistrationPayloadSerializer::serializePayload(std::shared_ptr registration) const { XMLElement registerElement("query", "jabber:iq:register"); if (registration->isRegistered()) { @@ -104,7 +103,7 @@ std::string InBandRegistrationPayloadSerializer::serializePayload(boost::shared_ } if (Form::ref form = registration->getForm()) { - registerElement.addNode(boost::make_shared(FormSerializer().serialize(form))); + registerElement.addNode(std::make_shared(FormSerializer().serialize(form))); } return registerElement.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h index 45eb2f5..d5f6cce 100644 --- a/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h @@ -16,6 +16,6 @@ namespace Swift { public: InBandRegistrationPayloadSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.cpp b/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.cpp index 243ebc0..000c1bf 100644 --- a/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -21,12 +21,12 @@ IsodeIQDelegationSerializer::IsodeIQDelegationSerializer(PayloadSerializerCollec IsodeIQDelegationSerializer::~IsodeIQDelegationSerializer() { } -std::string IsodeIQDelegationSerializer::serializePayload(boost::shared_ptr payload) const { +std::string IsodeIQDelegationSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("delegate", "http://isode.com/iq_delegation"); - element.addNode(boost::make_shared(serializers->getPayloadSerializer(payload->getForward())->serialize(payload->getForward()))); + element.addNode(std::make_shared(serializers->getPayloadSerializer(payload->getForward())->serialize(payload->getForward()))); return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.h b/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.h index 47a9ddc..e7cfef9 100644 --- a/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { IsodeIQDelegationSerializer(PayloadSerializerCollection* serializers); virtual ~IsodeIQDelegationSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.cpp index c006a93..02e0f2a 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.cpp @@ -12,9 +12,7 @@ #include -#include -#include -#include +#include #include #include @@ -30,7 +28,7 @@ namespace Swift { JingleContentPayloadSerializer::JingleContentPayloadSerializer() { } -std::string JingleContentPayloadSerializer::serializePayload(boost::shared_ptr payload) const { +std::string JingleContentPayloadSerializer::serializePayload(std::shared_ptr payload) const { XMLElement payloadXML("content"); payloadXML.setAttribute("creator", creatorToString(payload->getCreator())); payloadXML.setAttribute("name", payload->getName()); @@ -41,8 +39,8 @@ std::string JingleContentPayloadSerializer::serializePayload(boost::shared_ptrgetDescriptions()) { - if ((filetransfer = boost::dynamic_pointer_cast(desc))) { - payloadXML.addNode(boost::make_shared(ftSerializer.serializePayload(filetransfer))); + if ((filetransfer = std::dynamic_pointer_cast(desc))) { + payloadXML.addNode(std::make_shared(ftSerializer.serializePayload(filetransfer))); } } } @@ -57,10 +55,10 @@ std::string JingleContentPayloadSerializer::serializePayload(boost::shared_ptrgetTransports()) { - if ((ibb = boost::dynamic_pointer_cast(transport))) { - payloadXML.addNode(boost::make_shared(ibbSerializer.serializePayload(ibb))); - } else if ((s5b = boost::dynamic_pointer_cast(transport))) { - payloadXML.addNode(boost::make_shared(s5bSerializer.serializePayload(s5b))); + if ((ibb = std::dynamic_pointer_cast(transport))) { + payloadXML.addNode(std::make_shared(ibbSerializer.serializePayload(ibb))); + } else if ((s5b = std::dynamic_pointer_cast(transport))) { + payloadXML.addNode(std::make_shared(s5bSerializer.serializePayload(s5b))); } } } diff --git a/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.h index ff0185e..825a67c 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.h @@ -24,7 +24,7 @@ namespace Swift { public: JingleContentPayloadSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; private: std::string creatorToString(JingleContentPayload::Creator creator) const; diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.cpp index b0bb78d..b002482 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.cpp @@ -12,9 +12,9 @@ #include +#include + #include -#include -#include #include #include @@ -29,11 +29,11 @@ namespace Swift { JingleFileTransferDescriptionSerializer::JingleFileTransferDescriptionSerializer() { } -std::string JingleFileTransferDescriptionSerializer::serializePayload(boost::shared_ptr payload) const { +std::string JingleFileTransferDescriptionSerializer::serializePayload(std::shared_ptr payload) const { XMLElement description("description", "urn:xmpp:jingle:apps:file-transfer:4"); JingleFileTransferFileInfoSerializer fileInfoSerializer; - boost::shared_ptr fileInfoXML = boost::make_shared(fileInfoSerializer.serialize(boost::make_shared(payload->getFileInfo()))); + std::shared_ptr fileInfoXML = std::make_shared(fileInfoSerializer.serialize(std::make_shared(payload->getFileInfo()))); description.addNode(fileInfoXML); return description.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.h b/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.h index 53199f6..65e757b 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.h @@ -25,6 +25,6 @@ namespace Swift { public: JingleFileTransferDescriptionSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.cpp index 7fcf452..d78d7df 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.cpp @@ -6,9 +6,9 @@ #include +#include + #include -#include -#include #include #include @@ -22,28 +22,28 @@ namespace Swift { JingleFileTransferFileInfoSerializer::JingleFileTransferFileInfoSerializer() { } -std::string JingleFileTransferFileInfoSerializer::serializePayload(boost::shared_ptr fileInfo) const { +std::string JingleFileTransferFileInfoSerializer::serializePayload(std::shared_ptr fileInfo) const { XMLElement fileElement("file", ""); if (fileInfo->getDate() != stringToDateTime("")) { - fileElement.addNode(boost::make_shared("date", "", dateTimeToString(fileInfo->getDate()))); + fileElement.addNode(std::make_shared("date", "", dateTimeToString(fileInfo->getDate()))); } if (!fileInfo->getDescription().empty()) { - fileElement.addNode(boost::make_shared("desc", "", fileInfo->getDescription())); + fileElement.addNode(std::make_shared("desc", "", fileInfo->getDescription())); } if (!fileInfo->getMediaType().empty()) { - fileElement.addNode(boost::make_shared("media-type", "", fileInfo->getMediaType())); + fileElement.addNode(std::make_shared("media-type", "", fileInfo->getMediaType())); } if (!fileInfo->getName().empty()) { - fileElement.addNode(boost::make_shared("name", "", fileInfo->getName())); + fileElement.addNode(std::make_shared("name", "", fileInfo->getName())); } if (fileInfo->getSupportsRangeRequests()) { - boost::shared_ptr range = boost::make_shared("range"); + std::shared_ptr range = std::make_shared("range"); if (fileInfo->getRangeOffset() != 0) { range->setAttribute("offset", boost::lexical_cast(fileInfo->getRangeOffset())); } @@ -51,11 +51,11 @@ std::string JingleFileTransferFileInfoSerializer::serializePayload(boost::shared } if (fileInfo->getSize() > 0) { - fileElement.addNode(boost::make_shared("size", "", boost::lexical_cast(fileInfo->getSize()))); + fileElement.addNode(std::make_shared("size", "", boost::lexical_cast(fileInfo->getSize()))); } foreach (JingleFileTransferFileInfo::HashElementMap::value_type hashElement, fileInfo->getHashes()) { - boost::shared_ptr hash = boost::make_shared("hash", "urn:xmpp:hashes:1", Base64::encode(hashElement.second)); + std::shared_ptr hash = std::make_shared("hash", "urn:xmpp:hashes:1", Base64::encode(hashElement.second)); hash->setAttribute("algo", hashElement.first); fileElement.addNode(hash); } diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.h b/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.h index bd4d8cd..6b80235 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.h @@ -18,6 +18,6 @@ namespace Swift { public: JingleFileTransferFileInfoSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.cpp index 4db5f0c..1f6ead7 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.cpp @@ -13,11 +13,9 @@ #include #include +#include #include -#include -#include - #include #include #include @@ -29,7 +27,7 @@ namespace Swift { JingleFileTransferHashSerializer::JingleFileTransferHashSerializer() { } -std::string JingleFileTransferHashSerializer::serializePayload(boost::shared_ptr payload) const { +std::string JingleFileTransferHashSerializer::serializePayload(std::shared_ptr payload) const { // code for version urn:xmpp:jingle:apps:file-transfer:2 //XMLElement hash("hash", "urn:xmpp:jingle:apps:file-transfer:info:2", payload->getHash()); @@ -38,7 +36,7 @@ std::string JingleFileTransferHashSerializer::serializePayload(boost::shared_ptr JingleFileTransferFileInfoSerializer fileSerializer; - boost::shared_ptr file = boost::make_shared(fileSerializer.serialize(boost::make_shared(payload->getFileInfo()))); + std::shared_ptr file = std::make_shared(fileSerializer.serialize(std::make_shared(payload->getFileInfo()))); checksum.addNode(file); diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.h b/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.h index 5434c17..bb6eabc 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.h @@ -25,6 +25,6 @@ namespace Swift { public: JingleFileTransferHashSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.cpp index 0574ea7..52e6c16 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.cpp @@ -12,9 +12,9 @@ #include +#include + #include -#include -#include #include #include @@ -26,7 +26,7 @@ namespace Swift { JingleIBBTransportPayloadSerializer::JingleIBBTransportPayloadSerializer() { } -std::string JingleIBBTransportPayloadSerializer::serializePayload(boost::shared_ptr payload) const { +std::string JingleIBBTransportPayloadSerializer::serializePayload(std::shared_ptr payload) const { XMLElement payloadXML("transport", "urn:xmpp:jingle:transports:ibb:1"); if (payload->getBlockSize()) { payloadXML.setAttribute("block-size", boost::lexical_cast(*payload->getBlockSize())); diff --git a/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.h index 1b77666..e94fb52 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.h @@ -25,6 +25,6 @@ namespace Swift { public: JingleIBBTransportPayloadSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp index a5bd60a..8b37929 100644 --- a/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp @@ -12,9 +12,7 @@ #include -#include -#include -#include +#include #include #include @@ -35,27 +33,27 @@ namespace Swift { JinglePayloadSerializer::JinglePayloadSerializer(PayloadSerializerCollection* serializers) : serializers(serializers) { } -std::string JinglePayloadSerializer::serializePayload(boost::shared_ptr payload) const { +std::string JinglePayloadSerializer::serializePayload(std::shared_ptr payload) const { XMLElement jinglePayload("jingle", "urn:xmpp:jingle:1"); jinglePayload.setAttribute("action", actionToString(payload->getAction())); jinglePayload.setAttribute("initiator", payload->getInitiator()); jinglePayload.setAttribute("sid", payload->getSessionID()); - std::vector > payloads = payload->getPayloads(); + std::vector > payloads = payload->getPayloads(); if (!payloads.empty()) { - foreach(boost::shared_ptr subPayload, payloads) { + foreach(std::shared_ptr subPayload, payloads) { PayloadSerializer* serializer = serializers->getPayloadSerializer(subPayload); if (serializer) { - jinglePayload.addNode(boost::make_shared(serializer->serialize(subPayload))); + jinglePayload.addNode(std::make_shared(serializer->serialize(subPayload))); } } } if (payload->getReason().is_initialized()) { - boost::shared_ptr reason = boost::make_shared("reason"); - reason->addNode(boost::make_shared(reasonTypeToString(payload->getReason()->type))); + std::shared_ptr reason = std::make_shared("reason"); + reason->addNode(std::make_shared(reasonTypeToString(payload->getReason()->type))); if (!payload->getReason()->text.empty()) { - reason->addNode(boost::make_shared("desc", "", payload->getReason()->text)); + reason->addNode(std::make_shared("desc", "", payload->getReason()->text)); } jinglePayload.addNode(reason); } diff --git a/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.h index 9b36626..a846ebe 100644 --- a/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.h @@ -25,7 +25,7 @@ namespace Swift { public: JinglePayloadSerializer(PayloadSerializerCollection*); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; private: std::string actionToString(JinglePayload::Action action) const; diff --git a/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp index 66e6515..61447cd 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp @@ -12,9 +12,9 @@ #include +#include + #include -#include -#include #include #include @@ -27,7 +27,7 @@ namespace Swift { JingleS5BTransportPayloadSerializer::JingleS5BTransportPayloadSerializer() { } -std::string JingleS5BTransportPayloadSerializer::serializePayload(boost::shared_ptr payload) const { +std::string JingleS5BTransportPayloadSerializer::serializePayload(std::shared_ptr payload) const { XMLElement payloadXML("transport", "urn:xmpp:jingle:transports:s5b:1"); payloadXML.setAttribute("sid", payload->getSessionID()); payloadXML.setAttribute("mode", modeToString(payload->getMode())); @@ -36,7 +36,7 @@ std::string JingleS5BTransportPayloadSerializer::serializePayload(boost::shared_ } foreach(JingleS5BTransportPayload::Candidate candidate, payload->getCandidates()) { - boost::shared_ptr candidateXML = boost::make_shared("candidate"); + std::shared_ptr candidateXML = std::make_shared("candidate"); candidateXML->setAttribute("cid", candidate.cid); candidateXML->setAttribute("host", candidate.hostPort.getAddress().toString()); candidateXML->setAttribute("jid", candidate.jid.toString()); @@ -47,19 +47,19 @@ std::string JingleS5BTransportPayloadSerializer::serializePayload(boost::shared_ } if (payload->hasCandidateError()) { - payloadXML.addNode(boost::make_shared("candidate-error")); + payloadXML.addNode(std::make_shared("candidate-error")); } if (payload->hasProxyError()) { - payloadXML.addNode(boost::make_shared("proxy-error")); + payloadXML.addNode(std::make_shared("proxy-error")); } if (!payload->getActivated().empty()) { - boost::shared_ptr activatedXML = boost::make_shared("activated"); + std::shared_ptr activatedXML = std::make_shared("activated"); activatedXML->setAttribute("cid", payload->getActivated()); payloadXML.addNode(activatedXML); } if (!payload->getCandidateUsed().empty()) { - boost::shared_ptr candusedXML = boost::make_shared("candidate-used"); + std::shared_ptr candusedXML = std::make_shared("candidate-used"); candusedXML->setAttribute("cid", payload->getCandidateUsed()); payloadXML.addNode(candusedXML); } diff --git a/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.h index 684423e..cca2f4e 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.h @@ -25,7 +25,7 @@ namespace Swift { public: JingleS5BTransportPayloadSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; private: std::string modeToString(JingleS5BTransportPayload::Mode) const; diff --git a/Swiften/Serializer/PayloadSerializers/LastSerializer.h b/Swiften/Serializer/PayloadSerializers/LastSerializer.h index 6c831eb..1710bc0 100644 --- a/Swiften/Serializer/PayloadSerializers/LastSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/LastSerializer.h @@ -17,7 +17,7 @@ namespace Swift { public: LastSerializer() : GenericPayloadSerializer() {} - virtual std::string serializePayload(boost::shared_ptr last) const { + virtual std::string serializePayload(std::shared_ptr last) const { return ""; } }; diff --git a/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp index d15038c..6f40277 100644 --- a/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -22,7 +23,7 @@ MAMFinSerializer::MAMFinSerializer() { MAMFinSerializer::~MAMFinSerializer() { } -std::string MAMFinSerializer::serializePayload(boost::shared_ptr payload) const { +std::string MAMFinSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } @@ -42,7 +43,7 @@ std::string MAMFinSerializer::serializePayload(boost::shared_ptr payload } if (payload->getResultSet()) { - element.addNode(boost::make_shared(ResultSetSerializer().serialize(payload->getResultSet()))); + element.addNode(std::make_shared(ResultSetSerializer().serialize(payload->getResultSet()))); } return element.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.h b/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.h index 2be6981..7e2a7c7 100644 --- a/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,6 +21,6 @@ namespace Swift { MAMFinSerializer(); virtual ~MAMFinSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; }; } diff --git a/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp b/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp index d503d0b..0b61c04 100644 --- a/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -24,7 +25,7 @@ MAMQuerySerializer::MAMQuerySerializer() { MAMQuerySerializer::~MAMQuerySerializer() { } -std::string MAMQuerySerializer::serializePayload(boost::shared_ptr payload) const { +std::string MAMQuerySerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } @@ -40,11 +41,11 @@ std::string MAMQuerySerializer::serializePayload(boost::shared_ptr pay } if (payload->getForm()) { - element.addNode(boost::make_shared(FormSerializer().serialize(payload->getForm()))); + element.addNode(std::make_shared(FormSerializer().serialize(payload->getForm()))); } if (payload->getResultSet()) { - element.addNode(boost::make_shared(ResultSetSerializer().serialize(payload->getResultSet()))); + element.addNode(std::make_shared(ResultSetSerializer().serialize(payload->getResultSet()))); } return element.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.h b/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.h index 8b5e270..6af979b 100644 --- a/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.h +++ b/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,6 +21,6 @@ namespace Swift { MAMQuerySerializer(); virtual ~MAMQuerySerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; }; } diff --git a/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.cpp index 4bf25c6..7ef2102 100644 --- a/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -22,7 +23,7 @@ MAMResultSerializer::MAMResultSerializer(PayloadSerializerCollection* serializer MAMResultSerializer::~MAMResultSerializer() { } -std::string MAMResultSerializer::serializePayload(boost::shared_ptr payload) const { +std::string MAMResultSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } @@ -35,7 +36,7 @@ std::string MAMResultSerializer::serializePayload(boost::shared_ptr p element.setAttribute("queryid", *payload->getQueryID()); } - element.addNode(boost::make_shared(ForwardedSerializer(serializers_).serialize(payload->getPayload()))); + element.addNode(std::make_shared(ForwardedSerializer(serializers_).serialize(payload->getPayload()))); return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.h b/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.h index 4d8168c..f4fc054 100644 --- a/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { MAMResultSerializer(PayloadSerializerCollection* serializers); virtual ~MAMResultSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: PayloadSerializerCollection* serializers_; diff --git a/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.cpp index 5bd4b01..385c181 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.cpp @@ -6,11 +6,9 @@ #include +#include #include -#include -#include - #include #include #include @@ -21,7 +19,7 @@ namespace Swift { MUCAdminPayloadSerializer::MUCAdminPayloadSerializer() : GenericPayloadSerializer() { } -std::string MUCAdminPayloadSerializer::serializePayload(boost::shared_ptr payload) const { +std::string MUCAdminPayloadSerializer::serializePayload(std::shared_ptr payload) const { XMLElement mucElement("query", "http://jabber.org/protocol/muc#admin"); foreach (const MUCItem& item, payload->getItems()) { mucElement.addNode(MUCItemSerializer::itemToElement(item)); diff --git a/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.h index b1e1ed1..c077d2e 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.h @@ -17,7 +17,7 @@ namespace Swift { std::string affiliationToString(MUCOccupant::Affiliation affiliation) const; std::string roleToString(MUCOccupant::Role role) const; - virtual std::string serializePayload(boost::shared_ptr version) const; + virtual std::string serializePayload(std::shared_ptr version) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.cpp index 86d684e..3d807be 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.cpp @@ -1,13 +1,12 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include -#include +#include #include #include @@ -18,11 +17,11 @@ namespace Swift { MUCDestroyPayloadSerializer::MUCDestroyPayloadSerializer() : GenericPayloadSerializer() { } -std::string MUCDestroyPayloadSerializer::serializePayload(boost::shared_ptr payload) const { +std::string MUCDestroyPayloadSerializer::serializePayload(std::shared_ptr payload) const { XMLElement mucElement("destroy", ""); if (!payload->getReason().empty()) { - XMLElement::ref reason = boost::make_shared("reason", ""); - reason->addNode(boost::make_shared(payload->getReason())); + XMLElement::ref reason = std::make_shared("reason", ""); + reason->addNode(std::make_shared(payload->getReason())); mucElement.addNode(reason); } if (payload->getNewVenue().isValid()) { diff --git a/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.h index c6175fb..2ce8ccc 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.h @@ -15,7 +15,7 @@ namespace Swift { class SWIFTEN_API MUCDestroyPayloadSerializer : public GenericPayloadSerializer { public: MUCDestroyPayloadSerializer(); - virtual std::string serializePayload(boost::shared_ptr version) const; + virtual std::string serializePayload(std::shared_ptr version) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.cpp index 4695f63..4b978af 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.cpp @@ -6,8 +6,7 @@ #include -#include -#include +#include #include #include @@ -19,7 +18,7 @@ namespace Swift { MUCInvitationPayloadSerializer::MUCInvitationPayloadSerializer() : GenericPayloadSerializer() { } -std::string MUCInvitationPayloadSerializer::serializePayload(boost::shared_ptr payload) const { +std::string MUCInvitationPayloadSerializer::serializePayload(std::shared_ptr payload) const { XMLElement mucElement("x", "jabber:x:conference"); if (payload->getIsContinuation()) { mucElement.setAttribute("continue", "true"); @@ -37,7 +36,7 @@ std::string MUCInvitationPayloadSerializer::serializePayload(boost::shared_ptrgetThread()); } if (payload->getIsImpromptu()) { - mucElement.addNode(boost::make_shared("impromptu", "http://swift.im/impromptu")); + mucElement.addNode(std::make_shared("impromptu", "http://swift.im/impromptu")); } return mucElement.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.h index a2d27b0..be21177 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.h @@ -15,7 +15,7 @@ namespace Swift { public: MUCInvitationPayloadSerializer(); - virtual std::string serializePayload(boost::shared_ptr version) const; + virtual std::string serializePayload(std::shared_ptr version) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/MUCItemSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCItemSerializer.h index 016caf4..22f7859 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCItemSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/MUCItemSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -40,8 +40,8 @@ namespace Swift { } - static boost::shared_ptr itemToElement(const MUCItem& item) { - boost::shared_ptr itemElement(new XMLElement("item")); + static std::shared_ptr itemToElement(const MUCItem& item) { + std::shared_ptr itemElement(new XMLElement("item")); if (item.affiliation) { itemElement->setAttribute("affiliation", affiliationToString(item.affiliation.get())); } @@ -55,13 +55,13 @@ namespace Swift { itemElement->setAttribute("nick", item.nick.get()); } if (item.actor) { - boost::shared_ptr actorElement(new XMLElement("actor")); + std::shared_ptr actorElement(new XMLElement("actor")); actorElement->setAttribute("jid", item.actor->toString()); itemElement->addNode(actorElement); } if (item.reason) { - boost::shared_ptr reasonElement(new XMLElement("reason")); - reasonElement->addNode(boost::make_shared(*item.reason)); + std::shared_ptr reasonElement(new XMLElement("reason")); + reasonElement->addNode(std::make_shared(*item.reason)); itemElement->addNode(reasonElement); } return itemElement; diff --git a/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.cpp index 348f9f5..f385e91 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.cpp @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include +#include #include #include @@ -17,13 +17,13 @@ namespace Swift { MUCOwnerPayloadSerializer::MUCOwnerPayloadSerializer(PayloadSerializerCollection* serializers) : GenericPayloadSerializer(), serializers(serializers) { } -std::string MUCOwnerPayloadSerializer::serializePayload(boost::shared_ptr mucOwner) const { +std::string MUCOwnerPayloadSerializer::serializePayload(std::shared_ptr mucOwner) const { XMLElement mucElement("query", "http://jabber.org/protocol/muc#owner"); - boost::shared_ptr payload = mucOwner->getPayload(); + std::shared_ptr payload = mucOwner->getPayload(); if (payload) { PayloadSerializer* serializer = serializers->getPayloadSerializer(payload); if (serializer) { - mucElement.addNode(boost::make_shared(serializer->serialize(payload))); + mucElement.addNode(std::make_shared(serializer->serialize(payload))); } } return mucElement.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h index bbe919a..8e2e856 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h @@ -15,7 +15,7 @@ namespace Swift { class SWIFTEN_API MUCOwnerPayloadSerializer : public GenericPayloadSerializer { public: MUCOwnerPayloadSerializer(PayloadSerializerCollection* serializers); - virtual std::string serializePayload(boost::shared_ptr version) const; + virtual std::string serializePayload(std::shared_ptr version) const; private: PayloadSerializerCollection* serializers; }; diff --git a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp index 9af2f15..4f0f637 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp @@ -6,9 +6,10 @@ #include +#include + #include #include -#include #include #include @@ -19,9 +20,9 @@ namespace Swift { MUCPayloadSerializer::MUCPayloadSerializer() : GenericPayloadSerializer() { } -std::string MUCPayloadSerializer::serializePayload(boost::shared_ptr muc) const { +std::string MUCPayloadSerializer::serializePayload(std::shared_ptr muc) const { XMLElement mucElement("x", "http://jabber.org/protocol/muc"); - boost::shared_ptr historyElement(new XMLElement("history")); + std::shared_ptr historyElement(new XMLElement("history")); bool history = false; if (muc->getMaxChars() >= 0) { historyElement->setAttribute("maxchars", boost::lexical_cast(muc->getMaxChars())); @@ -44,8 +45,8 @@ std::string MUCPayloadSerializer::serializePayload(boost::shared_ptr } if (muc->getPassword()) { std::string password = *muc->getPassword(); - boost::shared_ptr passwordElement(new XMLElement("password")); - passwordElement->addNode(boost::make_shared(password)); + std::shared_ptr passwordElement(new XMLElement("password")); + passwordElement->addNode(std::make_shared(password)); mucElement.addNode(passwordElement); } if (history) { diff --git a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h index fa3a11c..6b0247d 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h @@ -14,7 +14,7 @@ namespace Swift { class SWIFTEN_API MUCPayloadSerializer : public GenericPayloadSerializer { public: MUCPayloadSerializer(); - virtual std::string serializePayload(boost::shared_ptr version) const; + virtual std::string serializePayload(std::shared_ptr version) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp index d0c3b2b..52ab489 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp @@ -6,11 +6,9 @@ #include +#include #include -#include -#include - #include #include #include @@ -23,10 +21,10 @@ namespace Swift { MUCUserPayloadSerializer::MUCUserPayloadSerializer(PayloadSerializerCollection* serializers) : GenericPayloadSerializer(), serializers(serializers) { } -std::string MUCUserPayloadSerializer::serializePayload(boost::shared_ptr payload) const { +std::string MUCUserPayloadSerializer::serializePayload(std::shared_ptr payload) const { XMLElement mucElement("x", "http://jabber.org/protocol/muc#user"); foreach (const MUCUserPayload::StatusCode statusCode, payload->getStatusCodes()) { - boost::shared_ptr statusElement(new XMLElement("status")); + std::shared_ptr statusElement(new XMLElement("status")); std::ostringstream code; code << statusCode.code; statusElement->setAttribute("code", code.str()); @@ -37,13 +35,13 @@ std::string MUCUserPayloadSerializer::serializePayload(boost::shared_ptrgetPassword()) { - boost::shared_ptr passwordElement = boost::make_shared("password"); - passwordElement->addNode(boost::make_shared(*payload->getPassword())); + std::shared_ptr passwordElement = std::make_shared("password"); + passwordElement->addNode(std::make_shared(*payload->getPassword())); } if (payload->getInvite()) { MUCUserPayload::Invite invite = *payload->getInvite(); - boost::shared_ptr inviteElement = boost::make_shared("invite"); + std::shared_ptr inviteElement = std::make_shared("invite"); if (invite.to.isValid()) { inviteElement->setAttribute("to", invite.to.toString()); } @@ -51,17 +49,17 @@ std::string MUCUserPayloadSerializer::serializePayload(boost::shared_ptrsetAttribute("from", invite.from.toString()); } if (!invite.reason.empty()) { - boost::shared_ptr reasonElement = boost::make_shared("reason"); - reasonElement->addNode(boost::make_shared(invite.reason)); + std::shared_ptr reasonElement = std::make_shared("reason"); + reasonElement->addNode(std::make_shared(invite.reason)); } mucElement.addNode(inviteElement); } - boost::shared_ptr childPayload = payload->getPayload(); + std::shared_ptr childPayload = payload->getPayload(); if (childPayload) { PayloadSerializer* serializer = serializers->getPayloadSerializer(childPayload); if (serializer) { - mucElement.addNode(boost::make_shared(serializer->serialize(childPayload))); + mucElement.addNode(std::make_shared(serializer->serialize(childPayload))); } } return mucElement.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h index 91b2ae6..ea4b74b 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h @@ -16,7 +16,7 @@ namespace Swift { public: MUCUserPayloadSerializer(PayloadSerializerCollection* serializers); - virtual std::string serializePayload(boost::shared_ptr version) const; + virtual std::string serializePayload(std::shared_ptr version) const; private: PayloadSerializerCollection* serializers; }; diff --git a/Swiften/Serializer/PayloadSerializers/NicknameSerializer.cpp b/Swiften/Serializer/PayloadSerializers/NicknameSerializer.cpp index 3b927f4..7bd8931 100644 --- a/Swiften/Serializer/PayloadSerializers/NicknameSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/NicknameSerializer.cpp @@ -1,13 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include -#include +#include #include #include @@ -17,9 +16,9 @@ namespace Swift { NicknameSerializer::NicknameSerializer() : GenericPayloadSerializer() { } -std::string NicknameSerializer::serializePayload(boost::shared_ptr nick) const { +std::string NicknameSerializer::serializePayload(std::shared_ptr nick) const { XMLElement nickElement("nick", "http://jabber.org/protocol/nick"); - nickElement.addNode(boost::make_shared(nick->getNickname())); + nickElement.addNode(std::make_shared(nick->getNickname())); return nickElement.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/NicknameSerializer.h b/Swiften/Serializer/PayloadSerializers/NicknameSerializer.h index d1b6e81..efea9c2 100644 --- a/Swiften/Serializer/PayloadSerializers/NicknameSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/NicknameSerializer.h @@ -15,7 +15,7 @@ namespace Swift { public: NicknameSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h b/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h index d7f0957..687d07f 100644 --- a/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h @@ -17,7 +17,7 @@ namespace Swift { public: PrioritySerializer() : GenericPayloadSerializer() {} - virtual std::string serializePayload(boost::shared_ptr priority) const { + virtual std::string serializePayload(std::shared_ptr priority) const { return "" + boost::lexical_cast(priority->getPriority()) + ""; } }; diff --git a/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.cpp index 2d03e1b..87a2eeb 100644 --- a/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.cpp @@ -6,8 +6,7 @@ #include -#include -#include +#include #include #include @@ -20,13 +19,13 @@ namespace Swift { PrivateStorageSerializer::PrivateStorageSerializer(PayloadSerializerCollection* serializers) : serializers(serializers) { } -std::string PrivateStorageSerializer::serializePayload(boost::shared_ptr storage) const { +std::string PrivateStorageSerializer::serializePayload(std::shared_ptr storage) const { XMLElement storageElement("query", "jabber:iq:private"); - boost::shared_ptr payload = storage->getPayload(); + std::shared_ptr payload = storage->getPayload(); if (payload) { PayloadSerializer* serializer = serializers->getPayloadSerializer(payload); if (serializer) { - storageElement.addNode(boost::make_shared(serializer->serialize(payload))); + storageElement.addNode(std::make_shared(serializer->serialize(payload))); } } return storageElement.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h b/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h index a014e52..f2f9d90 100644 --- a/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h @@ -17,7 +17,7 @@ namespace Swift { public: PrivateStorageSerializer(PayloadSerializerCollection* serializers); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; private: PayloadSerializerCollection* serializers; diff --git a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.cpp index 8e58ff5..4814c59 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubAffiliationSerializer::PubSubAffiliationSerializer(PayloadSerializerCollec PubSubAffiliationSerializer::~PubSubAffiliationSerializer() { } -std::string PubSubAffiliationSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubAffiliationSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.h index d451745..622db09 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubAffiliationSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubAffiliationSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: static std::string serializeType(PubSubAffiliation::Type); diff --git a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.cpp index eba96aa..9673710 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ PubSubAffiliationsSerializer::PubSubAffiliationsSerializer(PayloadSerializerColl PubSubAffiliationsSerializer::~PubSubAffiliationsSerializer() { } -std::string PubSubAffiliationsSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubAffiliationsSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } @@ -31,8 +31,8 @@ std::string PubSubAffiliationsSerializer::serializePayload(boost::shared_ptrgetNode()) { element.setAttribute("node", *payload->getNode()); } - foreach(boost::shared_ptr item, payload->getAffiliations()) { - element.addNode(boost::make_shared(PubSubAffiliationSerializer(serializers).serialize(item))); + foreach(std::shared_ptr item, payload->getAffiliations()) { + element.addNode(std::make_shared(PubSubAffiliationSerializer(serializers).serialize(item))); } return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.h index 211d957..c51d70e 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubAffiliationsSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubAffiliationsSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.cpp index 1853c1c..6ae4711 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -22,12 +22,12 @@ PubSubConfigureSerializer::PubSubConfigureSerializer(PayloadSerializerCollection PubSubConfigureSerializer::~PubSubConfigureSerializer() { } -std::string PubSubConfigureSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubConfigureSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("configure", "http://jabber.org/protocol/pubsub"); - element.addNode(boost::make_shared(FormSerializer().serialize(payload->getData()))); + element.addNode(std::make_shared(FormSerializer().serialize(payload->getData()))); return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.h index 3d800d8..fa0aecf 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubConfigureSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubConfigureSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.cpp index 8b38fc1..e5c0e67 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubCreateSerializer::PubSubCreateSerializer(PayloadSerializerCollection* seri PubSubCreateSerializer::~PubSubCreateSerializer() { } -std::string PubSubCreateSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubCreateSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.h index 67b19bf..92965f2 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubCreateSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubCreateSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.cpp index aba1cae..3681dd0 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubDefaultSerializer::PubSubDefaultSerializer(PayloadSerializerCollection* se PubSubDefaultSerializer::~PubSubDefaultSerializer() { } -std::string PubSubDefaultSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubDefaultSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.h index 5dc774f..1ec20c7 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubDefaultSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubDefaultSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: static std::string serializeType(PubSubDefault::Type); diff --git a/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.cpp index d14db49..5f85fd5 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.cpp @@ -17,7 +17,7 @@ PubSubErrorSerializer::PubSubErrorSerializer() { PubSubErrorSerializer::~PubSubErrorSerializer() { } -std::string PubSubErrorSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubErrorSerializer::serializePayload(std::shared_ptr payload) const { if (payload->getType() == PubSubError::UnknownType) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.h index b6750e9..6b0882e 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.h @@ -19,7 +19,7 @@ namespace Swift { PubSubErrorSerializer(); virtual ~PubSubErrorSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: static std::string serializeType(PubSubError::Type); diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.cpp index c855977..25d57fe 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubEventAssociateSerializer::PubSubEventAssociateSerializer(PayloadSerializer PubSubEventAssociateSerializer::~PubSubEventAssociateSerializer() { } -std::string PubSubEventAssociateSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubEventAssociateSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.h index 03025fb..5056c63 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubEventAssociateSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubEventAssociateSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.cpp index df255d2..da9feb8 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ PubSubEventCollectionSerializer::PubSubEventCollectionSerializer(PayloadSerializ PubSubEventCollectionSerializer::~PubSubEventCollectionSerializer() { } -std::string PubSubEventCollectionSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubEventCollectionSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } @@ -31,8 +31,8 @@ std::string PubSubEventCollectionSerializer::serializePayload(boost::shared_ptr< if (payload->getNode()) { element.setAttribute("node", *payload->getNode()); } - element.addNode(boost::make_shared(PubSubEventDisassociateSerializer(serializers).serialize(payload->getDisassociate()))); - element.addNode(boost::make_shared(PubSubEventAssociateSerializer(serializers).serialize(payload->getAssociate()))); + element.addNode(std::make_shared(PubSubEventDisassociateSerializer(serializers).serialize(payload->getDisassociate()))); + element.addNode(std::make_shared(PubSubEventAssociateSerializer(serializers).serialize(payload->getAssociate()))); return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.h index 6e6817d..33144e9 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubEventCollectionSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubEventCollectionSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.cpp index 3e2d18b..a758ce6 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -22,13 +22,13 @@ PubSubEventConfigurationSerializer::PubSubEventConfigurationSerializer(PayloadSe PubSubEventConfigurationSerializer::~PubSubEventConfigurationSerializer() { } -std::string PubSubEventConfigurationSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubEventConfigurationSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("configuration", "http://jabber.org/protocol/pubsub#event"); element.setAttribute("node", payload->getNode()); - element.addNode(boost::make_shared(FormSerializer().serialize(payload->getData()))); + element.addNode(std::make_shared(FormSerializer().serialize(payload->getData()))); return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.h index 6309e04..9823292 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubEventConfigurationSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubEventConfigurationSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.cpp index 4dcd734..cd8fc53 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -22,13 +22,13 @@ PubSubEventDeleteSerializer::PubSubEventDeleteSerializer(PayloadSerializerCollec PubSubEventDeleteSerializer::~PubSubEventDeleteSerializer() { } -std::string PubSubEventDeleteSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubEventDeleteSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("delete", "http://jabber.org/protocol/pubsub#event"); element.setAttribute("node", payload->getNode()); - element.addNode(boost::make_shared(PubSubEventRedirectSerializer(serializers).serialize(payload->getRedirects()))); + element.addNode(std::make_shared(PubSubEventRedirectSerializer(serializers).serialize(payload->getRedirects()))); return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.h index 6d937aa..e02d44c 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubEventDeleteSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubEventDeleteSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.cpp index 0818dee..8ef62bd 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubEventDisassociateSerializer::PubSubEventDisassociateSerializer(PayloadSeri PubSubEventDisassociateSerializer::~PubSubEventDisassociateSerializer() { } -std::string PubSubEventDisassociateSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubEventDisassociateSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.h index 9313ab2..77ca55d 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubEventDisassociateSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubEventDisassociateSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.cpp index 4bc8815..3d1a9cb 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -22,7 +22,7 @@ PubSubEventItemSerializer::PubSubEventItemSerializer(PayloadSerializerCollection PubSubEventItemSerializer::~PubSubEventItemSerializer() { } -std::string PubSubEventItemSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubEventItemSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } @@ -33,8 +33,8 @@ std::string PubSubEventItemSerializer::serializePayload(boost::shared_ptrgetPublisher()) { element.setAttribute("publisher", *payload->getPublisher()); } - foreach(boost::shared_ptr item, payload->getData()) { - element.addNode(boost::make_shared(serializers->getPayloadSerializer(item)->serialize(item))); + foreach(std::shared_ptr item, payload->getData()) { + element.addNode(std::make_shared(serializers->getPayloadSerializer(item)->serialize(item))); } if (payload->getID()) { element.setAttribute("id", *payload->getID()); diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.h index 6666c6b..f292a53 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubEventItemSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubEventItemSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.cpp index 7128314..2e0799b 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -24,17 +24,17 @@ PubSubEventItemsSerializer::PubSubEventItemsSerializer(PayloadSerializerCollecti PubSubEventItemsSerializer::~PubSubEventItemsSerializer() { } -std::string PubSubEventItemsSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubEventItemsSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("items", "http://jabber.org/protocol/pubsub#event"); element.setAttribute("node", payload->getNode()); - foreach(boost::shared_ptr item, payload->getItems()) { - element.addNode(boost::make_shared(PubSubEventItemSerializer(serializers).serialize(item))); + foreach(std::shared_ptr item, payload->getItems()) { + element.addNode(std::make_shared(PubSubEventItemSerializer(serializers).serialize(item))); } - foreach(boost::shared_ptr item, payload->getRetracts()) { - element.addNode(boost::make_shared(PubSubEventRetractSerializer(serializers).serialize(item))); + foreach(std::shared_ptr item, payload->getRetracts()) { + element.addNode(std::make_shared(PubSubEventRetractSerializer(serializers).serialize(item))); } return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.h index d174f30..7220fde 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubEventItemsSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubEventItemsSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.cpp index 86c7635..e0153ec 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubEventPurgeSerializer::PubSubEventPurgeSerializer(PayloadSerializerCollecti PubSubEventPurgeSerializer::~PubSubEventPurgeSerializer() { } -std::string PubSubEventPurgeSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubEventPurgeSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.h index c80c703..991f2c6 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubEventPurgeSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubEventPurgeSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.cpp index a7fcd20..8169205 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubEventRedirectSerializer::PubSubEventRedirectSerializer(PayloadSerializerCo PubSubEventRedirectSerializer::~PubSubEventRedirectSerializer() { } -std::string PubSubEventRedirectSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubEventRedirectSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.h index fe0f16e..26b6246 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubEventRedirectSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubEventRedirectSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.cpp index 6a132cc..0147648 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubEventRetractSerializer::PubSubEventRetractSerializer(PayloadSerializerColl PubSubEventRetractSerializer::~PubSubEventRetractSerializer() { } -std::string PubSubEventRetractSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubEventRetractSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.h index 2c393c2..088c263 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubEventRetractSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubEventRetractSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.cpp index 7305d29..c084a36 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -23,26 +23,26 @@ using namespace Swift; PubSubEventSerializer::PubSubEventSerializer(PayloadSerializerCollection* serializers) : serializers(serializers) { - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); } PubSubEventSerializer::~PubSubEventSerializer() { } -std::string PubSubEventSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubEventSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("event", "http://jabber.org/protocol/pubsub#event"); - boost::shared_ptr p = payload->getPayload(); - foreach(boost::shared_ptr serializer, pubsubSerializers) { + std::shared_ptr p = payload->getPayload(); + foreach(std::shared_ptr serializer, pubsubSerializers) { if (serializer->canSerialize(p)) { - element.addNode(boost::make_shared(serializer->serialize(p))); + element.addNode(std::make_shared(serializer->serialize(p))); } } return element.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.h index 2b50e95..5d2d5d7 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -23,13 +22,13 @@ namespace Swift { PubSubEventSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubEventSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: private: PayloadSerializerCollection* serializers; - std::vector< boost::shared_ptr > pubsubSerializers; + std::vector< std::shared_ptr > pubsubSerializers; }; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp index 322b482..212d9ca 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubEventSubscriptionSerializer::PubSubEventSubscriptionSerializer(PayloadSeri PubSubEventSubscriptionSerializer::~PubSubEventSubscriptionSerializer() { } -std::string PubSubEventSubscriptionSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubEventSubscriptionSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.h index 74e3062..2b13ee2 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubEventSubscriptionSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubEventSubscriptionSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: static std::string serializeSubscriptionType(PubSubEventSubscription::SubscriptionType); diff --git a/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp index e32f17a..4b9176e 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -22,13 +22,13 @@ PubSubItemSerializer::PubSubItemSerializer(PayloadSerializerCollection* serializ PubSubItemSerializer::~PubSubItemSerializer() { } -std::string PubSubItemSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubItemSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("item", "http://jabber.org/protocol/pubsub"); - foreach(boost::shared_ptr item, payload->getData()) { - element.addNode(boost::make_shared(serializers->getPayloadSerializer(item)->serialize(item))); + foreach(std::shared_ptr item, payload->getData()) { + element.addNode(std::make_shared(serializers->getPayloadSerializer(item)->serialize(item))); } if (!payload->getID().empty()) { element.setAttribute("id", payload->getID()); diff --git a/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.h index e6dbb83..866d09b 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubItemSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubItemSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.cpp index 75d32f5..bde7315 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include @@ -25,7 +25,7 @@ PubSubItemsSerializer::PubSubItemsSerializer(PayloadSerializerCollection* serial PubSubItemsSerializer::~PubSubItemsSerializer() { } -std::string PubSubItemsSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubItemsSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } @@ -34,8 +34,8 @@ std::string PubSubItemsSerializer::serializePayload(boost::shared_ptrgetNode()); - foreach(boost::shared_ptr item, payload->getItems()) { - element.addNode(boost::make_shared(PubSubItemSerializer(serializers).serialize(item))); + foreach(std::shared_ptr item, payload->getItems()) { + element.addNode(std::make_shared(PubSubItemSerializer(serializers).serialize(item))); } if (payload->getMaximumItems()) { element.setAttribute("max_items", boost::lexical_cast(*payload->getMaximumItems())); diff --git a/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.h index 28b923f..51b0578 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubItemsSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubItemsSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp index 09f72ef..c291866 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -22,14 +22,14 @@ PubSubOptionsSerializer::PubSubOptionsSerializer(PayloadSerializerCollection* se PubSubOptionsSerializer::~PubSubOptionsSerializer() { } -std::string PubSubOptionsSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubOptionsSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("options", "http://jabber.org/protocol/pubsub"); element.setAttribute("node", payload->getNode()); element.setAttribute("jid", payload->getJID()); - element.addNode(boost::make_shared(FormSerializer().serialize(payload->getData()))); + element.addNode(std::make_shared(FormSerializer().serialize(payload->getData()))); if (payload->getSubscriptionID()) { element.setAttribute("subid", *payload->getSubscriptionID()); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.h index 91dabab..3e0fde0 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubOptionsSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubOptionsSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.cpp index 82980ff..602eb34 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubOwnerAffiliationSerializer::PubSubOwnerAffiliationSerializer(PayloadSerial PubSubOwnerAffiliationSerializer::~PubSubOwnerAffiliationSerializer() { } -std::string PubSubOwnerAffiliationSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubOwnerAffiliationSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.h index ef0decf..ad1c963 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubOwnerAffiliationSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubOwnerAffiliationSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: static std::string serializeType(PubSubOwnerAffiliation::Type); diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.cpp index 12873e5..3df3686 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -23,14 +23,14 @@ PubSubOwnerAffiliationsSerializer::PubSubOwnerAffiliationsSerializer(PayloadSeri PubSubOwnerAffiliationsSerializer::~PubSubOwnerAffiliationsSerializer() { } -std::string PubSubOwnerAffiliationsSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubOwnerAffiliationsSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("affiliations", "http://jabber.org/protocol/pubsub#owner"); element.setAttribute("node", payload->getNode()); - foreach(boost::shared_ptr item, payload->getAffiliations()) { - element.addNode(boost::make_shared(PubSubOwnerAffiliationSerializer(serializers).serialize(item))); + foreach(std::shared_ptr item, payload->getAffiliations()) { + element.addNode(std::make_shared(PubSubOwnerAffiliationSerializer(serializers).serialize(item))); } return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.h index 70ba66f..6c53189 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubOwnerAffiliationsSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubOwnerAffiliationsSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.cpp index 94e6860..51e302e 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -22,7 +22,7 @@ PubSubOwnerConfigureSerializer::PubSubOwnerConfigureSerializer(PayloadSerializer PubSubOwnerConfigureSerializer::~PubSubOwnerConfigureSerializer() { } -std::string PubSubOwnerConfigureSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubOwnerConfigureSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } @@ -30,7 +30,7 @@ std::string PubSubOwnerConfigureSerializer::serializePayload(boost::shared_ptr

getNode()) { element.setAttribute("node", *payload->getNode()); } - element.addNode(boost::make_shared(FormSerializer().serialize(payload->getData()))); + element.addNode(std::make_shared(FormSerializer().serialize(payload->getData()))); return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.h index be75a00..c5cac8d 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubOwnerConfigureSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubOwnerConfigureSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.cpp index 4b91a81..01e370b 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -22,12 +22,12 @@ PubSubOwnerDefaultSerializer::PubSubOwnerDefaultSerializer(PayloadSerializerColl PubSubOwnerDefaultSerializer::~PubSubOwnerDefaultSerializer() { } -std::string PubSubOwnerDefaultSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubOwnerDefaultSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("default", "http://jabber.org/protocol/pubsub#owner"); - element.addNode(boost::make_shared(FormSerializer().serialize(payload->getData()))); + element.addNode(std::make_shared(FormSerializer().serialize(payload->getData()))); return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.h index 9d2916f..09703e1 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubOwnerDefaultSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubOwnerDefaultSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.cpp index fbf9a24..faf991c 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -22,13 +22,13 @@ PubSubOwnerDeleteSerializer::PubSubOwnerDeleteSerializer(PayloadSerializerCollec PubSubOwnerDeleteSerializer::~PubSubOwnerDeleteSerializer() { } -std::string PubSubOwnerDeleteSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubOwnerDeleteSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("delete", "http://jabber.org/protocol/pubsub#owner"); element.setAttribute("node", payload->getNode()); - element.addNode(boost::make_shared(PubSubOwnerRedirectSerializer(serializers).serialize(payload->getRedirect()))); + element.addNode(std::make_shared(PubSubOwnerRedirectSerializer(serializers).serialize(payload->getRedirect()))); return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.h index 3a96e80..c06a916 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubOwnerDeleteSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubOwnerDeleteSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.cpp index 25b38d0..f1dc2ae 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -23,26 +23,26 @@ using namespace Swift; PubSubOwnerPubSubSerializer::PubSubOwnerPubSubSerializer(PayloadSerializerCollection* serializers) : serializers(serializers) { - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); } PubSubOwnerPubSubSerializer::~PubSubOwnerPubSubSerializer() { } -std::string PubSubOwnerPubSubSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubOwnerPubSubSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("pubsub", "http://jabber.org/protocol/pubsub#owner"); - boost::shared_ptr p = payload->getPayload(); - foreach(boost::shared_ptr serializer, pubsubSerializers) { + std::shared_ptr p = payload->getPayload(); + foreach(std::shared_ptr serializer, pubsubSerializers) { if (serializer->canSerialize(p)) { - element.addNode(boost::make_shared(serializer->serialize(p))); + element.addNode(std::make_shared(serializer->serialize(p))); } } return element.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.h index 2dd8400..c93eb04 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include @@ -23,13 +22,13 @@ namespace Swift { PubSubOwnerPubSubSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubOwnerPubSubSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: private: PayloadSerializerCollection* serializers; - std::vector< boost::shared_ptr > pubsubSerializers; + std::vector< std::shared_ptr > pubsubSerializers; }; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.cpp index f934c4e..8bc19e9 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubOwnerPurgeSerializer::PubSubOwnerPurgeSerializer(PayloadSerializerCollecti PubSubOwnerPurgeSerializer::~PubSubOwnerPurgeSerializer() { } -std::string PubSubOwnerPurgeSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubOwnerPurgeSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.h index 64be235..31f8c52 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubOwnerPurgeSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubOwnerPurgeSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.cpp index f933a06..cdd101f 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubOwnerRedirectSerializer::PubSubOwnerRedirectSerializer(PayloadSerializerCo PubSubOwnerRedirectSerializer::~PubSubOwnerRedirectSerializer() { } -std::string PubSubOwnerRedirectSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubOwnerRedirectSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.h index b183f46..826ebbe 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubOwnerRedirectSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubOwnerRedirectSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.cpp index 923c160..5f6b505 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubOwnerSubscriptionSerializer::PubSubOwnerSubscriptionSerializer(PayloadSeri PubSubOwnerSubscriptionSerializer::~PubSubOwnerSubscriptionSerializer() { } -std::string PubSubOwnerSubscriptionSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubOwnerSubscriptionSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.h index 1bba67f..df025e0 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubOwnerSubscriptionSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubOwnerSubscriptionSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: static std::string serializeSubscriptionType(PubSubOwnerSubscription::SubscriptionType); diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.cpp index 088f6c2..106efaa 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -23,14 +23,14 @@ PubSubOwnerSubscriptionsSerializer::PubSubOwnerSubscriptionsSerializer(PayloadSe PubSubOwnerSubscriptionsSerializer::~PubSubOwnerSubscriptionsSerializer() { } -std::string PubSubOwnerSubscriptionsSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubOwnerSubscriptionsSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("subscriptions", "http://jabber.org/protocol/pubsub#owner"); element.setAttribute("node", payload->getNode()); - foreach(boost::shared_ptr item, payload->getSubscriptions()) { - element.addNode(boost::make_shared(PubSubOwnerSubscriptionSerializer(serializers).serialize(item))); + foreach(std::shared_ptr item, payload->getSubscriptions()) { + element.addNode(std::make_shared(PubSubOwnerSubscriptionSerializer(serializers).serialize(item))); } return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.h index 70ea7b2..0c282b4 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubOwnerSubscriptionsSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubOwnerSubscriptionsSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.cpp index efae018..0b30849 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -23,14 +23,14 @@ PubSubPublishSerializer::PubSubPublishSerializer(PayloadSerializerCollection* se PubSubPublishSerializer::~PubSubPublishSerializer() { } -std::string PubSubPublishSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubPublishSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("publish", "http://jabber.org/protocol/pubsub"); element.setAttribute("node", payload->getNode()); - foreach(boost::shared_ptr item, payload->getItems()) { - element.addNode(boost::make_shared(PubSubItemSerializer(serializers).serialize(item))); + foreach(std::shared_ptr item, payload->getItems()) { + element.addNode(std::make_shared(PubSubItemSerializer(serializers).serialize(item))); } return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.h index c576225..fb1af2e 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubPublishSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubPublishSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.cpp index 9a84959..752c234 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -23,14 +23,14 @@ PubSubRetractSerializer::PubSubRetractSerializer(PayloadSerializerCollection* se PubSubRetractSerializer::~PubSubRetractSerializer() { } -std::string PubSubRetractSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubRetractSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("retract", "http://jabber.org/protocol/pubsub"); element.setAttribute("node", payload->getNode()); - foreach(boost::shared_ptr item, payload->getItems()) { - element.addNode(boost::make_shared(PubSubItemSerializer(serializers).serialize(item))); + foreach(std::shared_ptr item, payload->getItems()) { + element.addNode(std::make_shared(PubSubItemSerializer(serializers).serialize(item))); } element.setAttribute("notify", payload->isNotify() ? "true" : "false"); return element.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.h index 60acb6e..0cb12e4 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubRetractSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubRetractSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubSerializer.cpp index 9562edb..6c110e2 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -30,36 +30,36 @@ using namespace Swift; PubSubSerializer::PubSubSerializer(PayloadSerializerCollection* serializers) : serializers(serializers) { - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); - pubsubSerializers.push_back(boost::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); + pubsubSerializers.push_back(std::make_shared(serializers)); } PubSubSerializer::~PubSubSerializer() { } -std::string PubSubSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("pubsub", "http://jabber.org/protocol/pubsub"); - boost::shared_ptr p = payload->getPayload(); - foreach(boost::shared_ptr serializer, pubsubSerializers) { + std::shared_ptr p = payload->getPayload(); + foreach(std::shared_ptr serializer, pubsubSerializers) { if (serializer->canSerialize(p)) { - element.addNode(boost::make_shared(serializer->serialize(p))); - if (boost::shared_ptr create = boost::dynamic_pointer_cast(p)) { - element.addNode(boost::make_shared(boost::make_shared(serializers)->serialize(create->getConfigure()))); + element.addNode(std::make_shared(serializer->serialize(p))); + if (std::shared_ptr create = std::dynamic_pointer_cast(p)) { + element.addNode(std::make_shared(std::make_shared(serializers)->serialize(create->getConfigure()))); } - if (boost::shared_ptr subscribe = boost::dynamic_pointer_cast(p)) { - element.addNode(boost::make_shared(boost::make_shared(serializers)->serialize(subscribe->getOptions()))); + if (std::shared_ptr subscribe = std::dynamic_pointer_cast(p)) { + element.addNode(std::make_shared(std::make_shared(serializers)->serialize(subscribe->getOptions()))); } } } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubSerializer.h index 0721d13..829f827 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,10 +21,10 @@ namespace Swift { PubSubSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: - std::vector< boost::shared_ptr > pubsubSerializers; + std::vector< std::shared_ptr > pubsubSerializers; PayloadSerializerCollection* serializers; }; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.cpp index 2e3987e..3fba52e 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -21,12 +21,12 @@ PubSubSubscribeOptionsSerializer::PubSubSubscribeOptionsSerializer(PayloadSerial PubSubSubscribeOptionsSerializer::~PubSubSubscribeOptionsSerializer() { } -std::string PubSubSubscribeOptionsSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubSubscribeOptionsSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("subscribe-options", "http://jabber.org/protocol/pubsub"); - element.addNode(payload->isRequired() ? boost::make_shared("required", "") : boost::shared_ptr()); + element.addNode(payload->isRequired() ? std::make_shared("required", "") : std::shared_ptr()); return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.h index 663d91b..dc9b55a 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubSubscribeOptionsSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubSubscribeOptionsSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.cpp index dcc7ab1..81fc71d 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubSubscribeSerializer::PubSubSubscribeSerializer(PayloadSerializerCollection PubSubSubscribeSerializer::~PubSubSubscribeSerializer() { } -std::string PubSubSubscribeSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubSubscribeSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.h index c655464..1c8bfaa 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubSubscribeSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubSubscribeSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.cpp index cadfce9..644ac07 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -22,7 +22,7 @@ PubSubSubscriptionSerializer::PubSubSubscriptionSerializer(PayloadSerializerColl PubSubSubscriptionSerializer::~PubSubSubscriptionSerializer() { } -std::string PubSubSubscriptionSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubSubscriptionSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } @@ -34,7 +34,7 @@ std::string PubSubSubscriptionSerializer::serializePayload(boost::shared_ptrgetSubscriptionID()); } element.setAttribute("jid", payload->getJID()); - element.addNode(boost::make_shared(PubSubSubscribeOptionsSerializer(serializers).serialize(payload->getOptions()))); + element.addNode(std::make_shared(PubSubSubscribeOptionsSerializer(serializers).serialize(payload->getOptions()))); element.setAttribute("subscription", serializeSubscriptionType(payload->getSubscription())); return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.h index 7d96a06..5a5f847 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubSubscriptionSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubSubscriptionSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: static std::string serializeSubscriptionType(PubSubSubscription::SubscriptionType); diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.cpp index 3347187..511c8e8 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ PubSubSubscriptionsSerializer::PubSubSubscriptionsSerializer(PayloadSerializerCo PubSubSubscriptionsSerializer::~PubSubSubscriptionsSerializer() { } -std::string PubSubSubscriptionsSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubSubscriptionsSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } @@ -31,8 +31,8 @@ std::string PubSubSubscriptionsSerializer::serializePayload(boost::shared_ptrgetNode()) { element.setAttribute("node", *payload->getNode()); } - foreach(boost::shared_ptr item, payload->getSubscriptions()) { - element.addNode(boost::make_shared(PubSubSubscriptionSerializer(serializers).serialize(item))); + foreach(std::shared_ptr item, payload->getSubscriptions()) { + element.addNode(std::make_shared(PubSubSubscriptionSerializer(serializers).serialize(item))); } return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.h index cc64483..caeb3ef 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubSubscriptionsSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubSubscriptionsSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.cpp index e9a16d6..6296d9e 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,7 +21,7 @@ PubSubUnsubscribeSerializer::PubSubUnsubscribeSerializer(PayloadSerializerCollec PubSubUnsubscribeSerializer::~PubSubUnsubscribeSerializer() { } -std::string PubSubUnsubscribeSerializer::serializePayload(boost::shared_ptr payload) const { +std::string PubSubUnsubscribeSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.h index ab9a053..cc98cf5 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { PubSubUnsubscribeSerializer(PayloadSerializerCollection* serializers); virtual ~PubSubUnsubscribeSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h index 21ca59f..1f07e37 100644 --- a/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h @@ -15,7 +15,7 @@ namespace Swift { public: RawXMLPayloadSerializer() : GenericPayloadSerializer() {} - virtual std::string serializePayload(boost::shared_ptr p) const { + virtual std::string serializePayload(std::shared_ptr p) const { return p->getRawXML(); } }; diff --git a/Swiften/Serializer/PayloadSerializers/ReplaceSerializer.h b/Swiften/Serializer/PayloadSerializers/ReplaceSerializer.h index a16f52b..3487b16 100644 --- a/Swiften/Serializer/PayloadSerializers/ReplaceSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/ReplaceSerializer.h @@ -22,7 +22,7 @@ namespace Swift { public: ReplaceSerializer() : GenericPayloadSerializer() {} - virtual std::string serializePayload(boost::shared_ptr replace) const { + virtual std::string serializePayload(std::shared_ptr replace) const { return ""; } }; diff --git a/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp index c737102..95a0084 100644 --- a/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp @@ -1,13 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include -#include +#include #include #include @@ -17,16 +16,16 @@ namespace Swift { ResourceBindSerializer::ResourceBindSerializer() : GenericPayloadSerializer() { } -std::string ResourceBindSerializer::serializePayload(boost::shared_ptr resourceBind) const { +std::string ResourceBindSerializer::serializePayload(std::shared_ptr resourceBind) const { XMLElement bindElement("bind", "urn:ietf:params:xml:ns:xmpp-bind"); if (resourceBind->getJID().isValid()) { - boost::shared_ptr jidNode(new XMLElement("jid")); - jidNode->addNode(boost::make_shared(resourceBind->getJID().toString())); + std::shared_ptr jidNode(new XMLElement("jid")); + jidNode->addNode(std::make_shared(resourceBind->getJID().toString())); bindElement.addNode(jidNode); } else if (!resourceBind->getResource().empty()) { - boost::shared_ptr resourceNode(new XMLElement("resource")); - resourceNode->addNode(boost::make_shared(resourceBind->getResource())); + std::shared_ptr resourceNode(new XMLElement("resource")); + resourceNode->addNode(std::make_shared(resourceBind->getResource())); bindElement.addNode(resourceNode); } return bindElement.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h b/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h index 2878c34..bea3ff1 100644 --- a/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h @@ -15,6 +15,6 @@ namespace Swift { public: ResourceBindSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp index 205d9e0..3302863 100644 --- a/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -20,7 +21,7 @@ ResultSetSerializer::ResultSetSerializer() { ResultSetSerializer::~ResultSetSerializer() { } -std::string ResultSetSerializer::serializePayload(boost::shared_ptr payload) const { +std::string ResultSetSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } @@ -28,19 +29,19 @@ std::string ResultSetSerializer::serializePayload(boost::shared_ptr p XMLElement element("set", "http://jabber.org/protocol/rsm"); if (payload->getMaxItems()) { - element.addNode(boost::make_shared("max", "", boost::lexical_cast(*payload->getMaxItems()))); + element.addNode(std::make_shared("max", "", boost::lexical_cast(*payload->getMaxItems()))); } if (payload->getCount()) { - element.addNode(boost::make_shared("count", "", boost::lexical_cast(*payload->getCount()))); + element.addNode(std::make_shared("count", "", boost::lexical_cast(*payload->getCount()))); } if (payload->getIndex()) { - element.addNode(boost::make_shared("index", "", boost::lexical_cast(*payload->getIndex()))); + element.addNode(std::make_shared("index", "", boost::lexical_cast(*payload->getIndex()))); } if (payload->getFirstID()) { - boost::shared_ptr firstElement = boost::make_shared("first", "", *payload->getFirstID()); + std::shared_ptr firstElement = std::make_shared("first", "", *payload->getFirstID()); if (payload->getFirstIDIndex()) { firstElement->setAttribute("index", boost::lexical_cast(*payload->getFirstIDIndex())); } @@ -48,15 +49,15 @@ std::string ResultSetSerializer::serializePayload(boost::shared_ptr p } if (payload->getLastID()) { - element.addNode(boost::make_shared("last", "", *payload->getLastID())); + element.addNode(std::make_shared("last", "", *payload->getLastID())); } if (payload->getBefore()) { - element.addNode(boost::make_shared("before", "", *payload->getBefore())); + element.addNode(std::make_shared("before", "", *payload->getBefore())); } if (payload->getAfter()) { - element.addNode(boost::make_shared("after", "", *payload->getAfter())); + element.addNode(std::make_shared("after", "", *payload->getAfter())); } return element.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.h b/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.h index 9d8e24d..e75b443 100644 --- a/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,6 +21,6 @@ namespace Swift { ResultSetSerializer(); virtual ~ResultSetSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; }; } diff --git a/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.cpp b/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.cpp index f0b19e1..24cc301 100644 --- a/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.cpp @@ -12,8 +12,7 @@ #include -#include -#include +#include #include #include @@ -25,10 +24,10 @@ namespace Swift { RosterItemExchangeSerializer::RosterItemExchangeSerializer() : GenericPayloadSerializer() { } -std::string RosterItemExchangeSerializer::serializePayload(boost::shared_ptr roster) const { +std::string RosterItemExchangeSerializer::serializePayload(std::shared_ptr roster) const { XMLElement queryElement("x", "http://jabber.org/protocol/rosterx"); foreach(const RosterItemExchangePayload::Item& item, roster->getItems()) { - boost::shared_ptr itemElement(new XMLElement("item")); + std::shared_ptr itemElement(new XMLElement("item")); itemElement->setAttribute("jid", item.getJID()); itemElement->setAttribute("name", item.getName()); @@ -39,8 +38,8 @@ std::string RosterItemExchangeSerializer::serializePayload(boost::shared_ptr groupElement(new XMLElement("group")); - groupElement->addNode(boost::make_shared(group)); + std::shared_ptr groupElement(new XMLElement("group")); + groupElement->addNode(std::make_shared(group)); itemElement->addNode(groupElement); } diff --git a/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.h b/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.h index ec4e81e..6212998 100644 --- a/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.h @@ -21,6 +21,6 @@ namespace Swift { public: RosterItemExchangeSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/RosterSerializer.cpp b/Swiften/Serializer/PayloadSerializers/RosterSerializer.cpp index 1094f2d..8c857ab 100644 --- a/Swiften/Serializer/PayloadSerializers/RosterSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/RosterSerializer.cpp @@ -6,8 +6,7 @@ #include -#include -#include +#include #include #include @@ -19,13 +18,13 @@ namespace Swift { RosterSerializer::RosterSerializer() : GenericPayloadSerializer() { } -std::string RosterSerializer::serializePayload(boost::shared_ptr roster) const { +std::string RosterSerializer::serializePayload(std::shared_ptr roster) const { XMLElement queryElement("query", "jabber:iq:roster"); if (roster->getVersion()) { queryElement.setAttribute("ver", *roster->getVersion()); } foreach(const RosterItemPayload& item, roster->getItems()) { - boost::shared_ptr itemElement(new XMLElement("item")); + std::shared_ptr itemElement(new XMLElement("item")); itemElement->setAttribute("jid", item.getJID()); itemElement->setAttribute("name", item.getName()); @@ -42,13 +41,13 @@ std::string RosterSerializer::serializePayload(boost::shared_ptr } foreach(const std::string& group, item.getGroups()) { - boost::shared_ptr groupElement(new XMLElement("group")); - groupElement->addNode(boost::make_shared(group)); + std::shared_ptr groupElement(new XMLElement("group")); + groupElement->addNode(std::make_shared(group)); itemElement->addNode(groupElement); } if (!item.getUnknownContent().empty()) { - itemElement->addNode(boost::make_shared(item.getUnknownContent())); + itemElement->addNode(std::make_shared(item.getUnknownContent())); } diff --git a/Swiften/Serializer/PayloadSerializers/RosterSerializer.h b/Swiften/Serializer/PayloadSerializers/RosterSerializer.h index 799d88f..834f723 100644 --- a/Swiften/Serializer/PayloadSerializers/RosterSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/RosterSerializer.h @@ -15,6 +15,6 @@ namespace Swift { public: RosterSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/S5BProxyRequestSerializer.h b/Swiften/Serializer/PayloadSerializers/S5BProxyRequestSerializer.h index f10bcfc..7058ac1 100644 --- a/Swiften/Serializer/PayloadSerializers/S5BProxyRequestSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/S5BProxyRequestSerializer.h @@ -5,15 +5,16 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include + #include -#include #include #include @@ -25,17 +26,17 @@ namespace Swift { class SWIFTEN_API S5BProxyRequestSerializer : public GenericPayloadSerializer { public: - virtual std::string serializePayload(boost::shared_ptr s5bProxyRequest) const { + virtual std::string serializePayload(std::shared_ptr s5bProxyRequest) const { XMLElement queryElement("query", "http://jabber.org/protocol/bytestreams"); if (s5bProxyRequest && s5bProxyRequest->getStreamHost()) { - boost::shared_ptr streamHost = boost::make_shared("streamhost"); + std::shared_ptr streamHost = std::make_shared("streamhost"); streamHost->setAttribute("host", s5bProxyRequest->getStreamHost().get().host); streamHost->setAttribute("port", boost::lexical_cast(s5bProxyRequest->getStreamHost().get().port)); streamHost->setAttribute("jid", s5bProxyRequest->getStreamHost().get().jid.toString()); queryElement.addNode(streamHost); } else if (s5bProxyRequest && s5bProxyRequest->getActivate()) { queryElement.setAttribute("sid", s5bProxyRequest->getSID()); - boost::shared_ptr activate = boost::make_shared("activate", "", s5bProxyRequest->getActivate().get().toString()); + std::shared_ptr activate = std::make_shared("activate", "", s5bProxyRequest->getActivate().get().toString()); queryElement.addNode(activate); } return queryElement.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.cpp index de036df..6e55f46 100644 --- a/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.cpp @@ -6,8 +6,7 @@ #include -#include -#include +#include #include #include @@ -19,7 +18,7 @@ namespace Swift { SearchPayloadSerializer::SearchPayloadSerializer() { } -std::string SearchPayloadSerializer::serializePayload(boost::shared_ptr searchPayload) const { +std::string SearchPayloadSerializer::serializePayload(std::shared_ptr searchPayload) const { XMLElement searchElement("query", "jabber:iq:search"); if (searchPayload->getInstructions()) { @@ -54,7 +53,7 @@ std::string SearchPayloadSerializer::serializePayload(boost::shared_ptrgetForm()) { - searchElement.addNode(boost::make_shared(FormSerializer().serialize(form))); + searchElement.addNode(std::make_shared(FormSerializer().serialize(form))); } return searchElement.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h index 594e5d7..51f4227 100644 --- a/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h @@ -18,6 +18,6 @@ namespace Swift { public: SearchPayloadSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp b/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp index 9b35952..97c5411 100644 --- a/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include #include @@ -18,27 +18,27 @@ namespace Swift { SecurityLabelSerializer::SecurityLabelSerializer() : GenericPayloadSerializer() { } -std::string SecurityLabelSerializer::serializePayload(boost::shared_ptr label) const { +std::string SecurityLabelSerializer::serializePayload(std::shared_ptr label) const { XMLElement element("securitylabel", "urn:xmpp:sec-label:0"); if (!label->getDisplayMarking().empty()) { - boost::shared_ptr displayMarking(new XMLElement("displaymarking")); + std::shared_ptr displayMarking(new XMLElement("displaymarking")); if (!label->getForegroundColor().empty()) { displayMarking->setAttribute("fgcolor", label->getForegroundColor()); } if (!label->getBackgroundColor().empty()) { displayMarking->setAttribute("bgcolor", label->getBackgroundColor()); } - displayMarking->addNode(boost::make_shared(label->getDisplayMarking())); + displayMarking->addNode(std::make_shared(label->getDisplayMarking())); element.addNode(displayMarking); } - boost::shared_ptr labelElement(new XMLElement("label")); - labelElement->addNode(boost::make_shared(label->getLabel())); + std::shared_ptr labelElement(new XMLElement("label")); + labelElement->addNode(std::make_shared(label->getLabel())); element.addNode(labelElement); foreach(const std::string& equivalentLabel, label->getEquivalentLabels()) { - boost::shared_ptr equivalentLabelElement(new XMLElement("equivalentlabel")); - equivalentLabelElement->addNode(boost::make_shared(equivalentLabel)); + std::shared_ptr equivalentLabelElement(new XMLElement("equivalentlabel")); + equivalentLabelElement->addNode(std::make_shared(equivalentLabel)); element.addNode(equivalentLabelElement); } return element.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h b/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h index 23f50f4..b1eaaed 100644 --- a/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h @@ -15,6 +15,6 @@ namespace Swift { public: SecurityLabelSerializer(); - virtual std::string serializePayload(boost::shared_ptr version) const; + virtual std::string serializePayload(std::shared_ptr version) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp b/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp index 2bf6bbb..e8d2a1b 100644 --- a/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include #include @@ -18,7 +18,7 @@ namespace Swift { SecurityLabelsCatalogSerializer::SecurityLabelsCatalogSerializer() : GenericPayloadSerializer() { } -std::string SecurityLabelsCatalogSerializer::serializePayload(boost::shared_ptr catalog) const { +std::string SecurityLabelsCatalogSerializer::serializePayload(std::shared_ptr catalog) const { XMLElement element("catalog", "urn:xmpp:sec-label:catalog:2"); if (!catalog->getName().empty()) { element.setAttribute("name", catalog->getName()); @@ -30,14 +30,14 @@ std::string SecurityLabelsCatalogSerializer::serializePayload(boost::shared_ptr< element.setAttribute("desc", catalog->getDescription()); } foreach (const SecurityLabelsCatalog::Item& item, catalog->getItems()) { - boost::shared_ptr itemElement(new XMLElement("item")); + std::shared_ptr itemElement(new XMLElement("item")); itemElement->setAttribute("selector", item.getSelector()); if (item.getIsDefault()) { itemElement->setAttribute("default", "true"); } if (item.getLabel()) { std::string serializedLabel = SecurityLabelSerializer().serialize(item.getLabel()); - itemElement->addNode(boost::make_shared(serializedLabel)); + itemElement->addNode(std::make_shared(serializedLabel)); } element.addNode(itemElement); } diff --git a/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h b/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h index da3b7f3..c3efc1e 100644 --- a/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h @@ -15,6 +15,6 @@ namespace Swift { public: SecurityLabelsCatalogSerializer(); - virtual std::string serializePayload(boost::shared_ptr version) const; + virtual std::string serializePayload(std::shared_ptr version) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp index 05beaae..2245030 100644 --- a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -11,7 +11,7 @@ namespace Swift { SoftwareVersionSerializer::SoftwareVersionSerializer() : GenericPayloadSerializer() { } -std::string SoftwareVersionSerializer::serializePayload(boost::shared_ptr version) const { +std::string SoftwareVersionSerializer::serializePayload(std::shared_ptr version) const { std::string result(""); if (!version->getName().empty()) { result += "" + version->getName() + ""; diff --git a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h index 6c03c84..7f0875b 100644 --- a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h @@ -15,6 +15,6 @@ namespace Swift { public: SoftwareVersionSerializer(); - virtual std::string serializePayload(boost::shared_ptr version) const; + virtual std::string serializePayload(std::shared_ptr version) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h b/Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h index 086652f..12e6994 100644 --- a/Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -18,7 +18,7 @@ namespace Swift { public: StartSessionSerializer() : GenericPayloadSerializer() {} - virtual std::string serializePayload(boost::shared_ptr) const { + virtual std::string serializePayload(std::shared_ptr) const { return XMLElement("session", "urn:ietf:params:xml:ns:xmpp-session").serialize(); } }; diff --git a/Swiften/Serializer/PayloadSerializers/StatusSerializer.h b/Swiften/Serializer/PayloadSerializers/StatusSerializer.h index 8247e28..0e81a26 100644 --- a/Swiften/Serializer/PayloadSerializers/StatusSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/StatusSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -19,9 +19,9 @@ namespace Swift { public: StatusSerializer() : GenericPayloadSerializer() {} - virtual std::string serializePayload(boost::shared_ptr status) const { + virtual std::string serializePayload(std::shared_ptr status) const { XMLElement element("status"); - element.addNode(boost::make_shared(status->getText())); + element.addNode(std::make_shared(status->getText())); return element.serialize(); } }; diff --git a/Swiften/Serializer/PayloadSerializers/StatusShowSerializer.h b/Swiften/Serializer/PayloadSerializers/StatusShowSerializer.h index 24fbe1b..155b645 100644 --- a/Swiften/Serializer/PayloadSerializers/StatusShowSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/StatusShowSerializer.h @@ -15,7 +15,7 @@ namespace Swift { public: StatusShowSerializer() : GenericPayloadSerializer() {} - virtual std::string serializePayload(boost::shared_ptr statusShow) const { + virtual std::string serializePayload(std::shared_ptr statusShow) const { if (statusShow->getType () == StatusShow::Online || statusShow->getType() == StatusShow::None) { return ""; } diff --git a/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp b/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp index 64ea62c..31720f7 100644 --- a/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp @@ -1,13 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include -#include +#include #include #include @@ -18,29 +17,29 @@ namespace Swift { StorageSerializer::StorageSerializer() : GenericPayloadSerializer() { } -std::string StorageSerializer::serializePayload(boost::shared_ptr storage) const { +std::string StorageSerializer::serializePayload(std::shared_ptr storage) const { XMLElement storageElement("storage", "storage:bookmarks"); foreach(const Storage::Room& room, storage->getRooms()) { - boost::shared_ptr conferenceElement(new XMLElement("conference")); + std::shared_ptr conferenceElement(new XMLElement("conference")); conferenceElement->setAttribute("name", room.name); conferenceElement->setAttribute("jid", room.jid); conferenceElement->setAttribute("autojoin", room.autoJoin ? "1" : "0"); if (!room.nick.empty()) { - boost::shared_ptr nickElement(new XMLElement("nick")); - nickElement->addNode(boost::make_shared(room.nick)); + std::shared_ptr nickElement(new XMLElement("nick")); + nickElement->addNode(std::make_shared(room.nick)); conferenceElement->addNode(nickElement); } if (room.password) { - boost::shared_ptr passwordElement(new XMLElement("password")); - passwordElement->addNode(boost::make_shared(*room.password)); + std::shared_ptr passwordElement(new XMLElement("password")); + passwordElement->addNode(std::make_shared(*room.password)); conferenceElement->addNode(passwordElement); } storageElement.addNode(conferenceElement); } foreach(const Storage::URL& url, storage->getURLs()) { - boost::shared_ptr urlElement(new XMLElement("url")); + std::shared_ptr urlElement(new XMLElement("url")); urlElement->setAttribute("name", url.name); urlElement->setAttribute("url", url.url); storageElement.addNode(urlElement); diff --git a/Swiften/Serializer/PayloadSerializers/StorageSerializer.h b/Swiften/Serializer/PayloadSerializers/StorageSerializer.h index a3a55f4..9f88fa1 100644 --- a/Swiften/Serializer/PayloadSerializers/StorageSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/StorageSerializer.h @@ -15,6 +15,6 @@ namespace Swift { public: StorageSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.cpp b/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.cpp index a64d7ae..e15ab77 100644 --- a/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.cpp @@ -12,9 +12,9 @@ #include +#include + #include -#include -#include #include #include @@ -27,7 +27,7 @@ namespace Swift { StreamInitiationFileInfoSerializer::StreamInitiationFileInfoSerializer() { } -std::string StreamInitiationFileInfoSerializer::serializePayload(boost::shared_ptr fileInfo) const { +std::string StreamInitiationFileInfoSerializer::serializePayload(std::shared_ptr fileInfo) const { XMLElement fileElement("file", "http://jabber.org/protocol/si/profile/file-transfer"); if (fileInfo->getDate() != stringToDateTime("")) { @@ -44,11 +44,11 @@ std::string StreamInitiationFileInfoSerializer::serializePayload(boost::shared_p fileElement.setAttribute("size", boost::lexical_cast(fileInfo->getSize())); } if (!fileInfo->getDescription().empty()) { - boost::shared_ptr desc = boost::make_shared("desc", "", fileInfo->getDescription()); + std::shared_ptr desc = std::make_shared("desc", "", fileInfo->getDescription()); fileElement.addNode(desc); } if (fileInfo->getSupportsRangeRequests()) { - boost::shared_ptr range = boost::make_shared("range"); + std::shared_ptr range = std::make_shared("range"); if (fileInfo->getRangeOffset() != 0) { range->setAttribute("offset", boost::lexical_cast(fileInfo->getRangeOffset())); } diff --git a/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.h b/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.h index e7714f0..de54313 100644 --- a/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.h @@ -25,6 +25,6 @@ namespace Swift { public: StreamInitiationFileInfoSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp b/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp index 824569a..fcfb063 100644 --- a/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp @@ -1,13 +1,13 @@ /* - * Copyright (c) 2010-2013 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include -#include +#include +#include #include #include @@ -25,7 +25,7 @@ namespace Swift { StreamInitiationSerializer::StreamInitiationSerializer() { } -std::string StreamInitiationSerializer::serializePayload(boost::shared_ptr streamInitiation) const { +std::string StreamInitiationSerializer::serializePayload(std::shared_ptr streamInitiation) const { assert(streamInitiation->getIsFileTransfer()); XMLElement siElement("si", "http://jabber.org/protocol/si"); @@ -36,37 +36,37 @@ std::string StreamInitiationSerializer::serializePayload(boost::shared_ptrgetFileInfo()) { StreamInitiationFileInfo file = *streamInitiation->getFileInfo(); - boost::shared_ptr fileElement(new XMLElement("file", "http://jabber.org/protocol/si/profile/file-transfer")); + std::shared_ptr fileElement(new XMLElement("file", "http://jabber.org/protocol/si/profile/file-transfer")); fileElement->setAttribute("name", file.getName()); if (file.getSize() != 0) { fileElement->setAttribute("size", boost::lexical_cast(file.getSize())); } if (!file.getDescription().empty()) { - boost::shared_ptr descElement(new XMLElement("desc")); - descElement->addNode(boost::make_shared(file.getDescription())); + std::shared_ptr descElement(new XMLElement("desc")); + descElement->addNode(std::make_shared(file.getDescription())); fileElement->addNode(descElement); } siElement.addNode(fileElement); } - boost::shared_ptr featureElement(new XMLElement("feature", FEATURE_NEG_NS)); + std::shared_ptr featureElement(new XMLElement("feature", FEATURE_NEG_NS)); if (streamInitiation->getProvidedMethods().size() > 0) { Form::ref form(new Form(Form::FormType)); - FormField::ref field = boost::make_shared(FormField::ListSingleType); + FormField::ref field = std::make_shared(FormField::ListSingleType); field->setName("stream-method"); foreach(const std::string& method, streamInitiation->getProvidedMethods()) { field->addOption(FormField::Option("", method)); } form->addField(field); - featureElement->addNode(boost::make_shared(FormSerializer().serialize(form))); + featureElement->addNode(std::make_shared(FormSerializer().serialize(form))); } else if (!streamInitiation->getRequestedMethod().empty()) { Form::ref form(new Form(Form::SubmitType)); - FormField::ref field = boost::make_shared(FormField::ListSingleType); + FormField::ref field = std::make_shared(FormField::ListSingleType); field->addValue(streamInitiation->getRequestedMethod()); field->setName("stream-method"); form->addField(field); - featureElement->addNode(boost::make_shared(FormSerializer().serialize(form))); + featureElement->addNode(std::make_shared(FormSerializer().serialize(form))); } siElement.addNode(featureElement); return siElement.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h b/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h index 056806e..73dbc39 100644 --- a/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h @@ -15,6 +15,6 @@ namespace Swift { public: StreamInitiationSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h b/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h index 9f90ce0..20f95fd 100644 --- a/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h @@ -16,7 +16,7 @@ namespace Swift { public: SubjectSerializer() : GenericPayloadSerializer() {} - virtual std::string serializePayload(boost::shared_ptr subject) const { + virtual std::string serializePayload(std::shared_ptr subject) const { XMLTextNode textNode(subject->getText()); return "" + textNode.serialize() + ""; } diff --git a/Swiften/Serializer/PayloadSerializers/ThreadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ThreadSerializer.cpp index 61b91ae..5914cf2 100644 --- a/Swiften/Serializer/PayloadSerializers/ThreadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/ThreadSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -15,7 +15,7 @@ namespace Swift { ThreadSerializer::~ThreadSerializer() { } - std::string ThreadSerializer::serializePayload(boost::shared_ptr thread) const { + std::string ThreadSerializer::serializePayload(std::shared_ptr thread) const { XMLElement threadNode("thread", "", thread->getText()); if (!thread->getParent().empty()) { threadNode.setAttribute("parent", thread->getParent()); diff --git a/Swiften/Serializer/PayloadSerializers/ThreadSerializer.h b/Swiften/Serializer/PayloadSerializers/ThreadSerializer.h index 264faba..07ecb82 100644 --- a/Swiften/Serializer/PayloadSerializers/ThreadSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/ThreadSerializer.h @@ -17,6 +17,6 @@ namespace Swift { ThreadSerializer(); virtual ~ThreadSerializer(); - virtual std::string serializePayload(boost::shared_ptr thread) const; + virtual std::string serializePayload(std::shared_ptr thread) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp index 1dc97f8..9b9e00d 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp @@ -34,7 +34,7 @@ class BlockSerializerTest : public CppUnit::TestFixture void testExample4() { BlockSerializer testling("blocklist"); - boost::shared_ptr blocklist = boost::make_shared(); + std::shared_ptr blocklist = std::make_shared(); blocklist->addItem(JID("romeo@montague.net")); blocklist->addItem(JID("iago@shakespeare.lit")); @@ -43,7 +43,7 @@ class BlockSerializerTest : public CppUnit::TestFixture void testExample6() { BlockSerializer testling("block"); - boost::shared_ptr block = boost::make_shared(); + std::shared_ptr block = std::make_shared(); block->addItem(JID("romeo@montague.net")); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(block)); @@ -51,7 +51,7 @@ class BlockSerializerTest : public CppUnit::TestFixture void testExample10() { BlockSerializer testling("unblock"); - boost::shared_ptr unblock = boost::make_shared(); + std::shared_ptr unblock = std::make_shared(); unblock->addItem(JID("romeo@montague.net")); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(unblock)); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp index 517e98b..c4e3ad8 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -22,7 +22,7 @@ class CapsInfoSerializerTest : public CppUnit::TestFixture void testSerialize() { CapsInfoSerializer testling; - boost::shared_ptr priority(new CapsInfo("http://swift.im", "myversion", "sha-1")); + std::shared_ptr priority(new CapsInfo("http://swift.im", "myversion", "sha-1")); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(priority)); } diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/CarbonsSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/CarbonsSerializerTest.cpp index a0c49a6..9ac8416 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/CarbonsSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/CarbonsSerializerTest.cpp @@ -43,7 +43,7 @@ class CarbonsSerializerTest : public CppUnit::TestFixture { void testSerializeExample3() { CarbonsEnableSerializer testling; - CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(boost::make_shared())); + CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(std::make_shared())); } /* @@ -52,7 +52,7 @@ class CarbonsSerializerTest : public CppUnit::TestFixture { void testSerializeExample6() { CarbonsDisableSerializer testling; - CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(boost::make_shared())); + CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(std::make_shared())); } /* @@ -61,15 +61,15 @@ class CarbonsSerializerTest : public CppUnit::TestFixture { void testSerializeExample12() { CarbonsReceivedSerializer testling(&serializers); - CarbonsReceived::ref received = boost::make_shared(); + CarbonsReceived::ref received = std::make_shared(); - boost::shared_ptr forwarded = boost::make_shared(); + std::shared_ptr forwarded = std::make_shared(); - Message::ref message = boost::make_shared(); + Message::ref message = std::make_shared(); message->setFrom(JID("juliet@capulet.example/balcony")); message->setTo(JID("romeo@montague.example/garden")); message->setBody("What man art thou that, thus bescreen'd in night, so stumblest on my counsel?"); - message->addPayload(boost::make_shared("0e3141cd80894871a68e6fe6b1ec56fa")); + message->addPayload(std::make_shared("0e3141cd80894871a68e6fe6b1ec56fa")); forwarded->setStanza(message); received->setForwarded(forwarded); @@ -94,15 +94,15 @@ class CarbonsSerializerTest : public CppUnit::TestFixture { void testSerializeExample14() { CarbonsSentSerializer testling(&serializers); - CarbonsSent::ref sent = boost::make_shared(); + CarbonsSent::ref sent = std::make_shared(); - boost::shared_ptr forwarded = boost::make_shared(); + std::shared_ptr forwarded = std::make_shared(); - Message::ref message = boost::make_shared(); + Message::ref message = std::make_shared(); message->setTo(JID("juliet@capulet.example/balcony")); message->setFrom(JID("romeo@montague.example/home")); message->setBody("Neither, fair saint, if either thee dislike."); - message->addPayload(boost::make_shared("0e3141cd80894871a68e6fe6b1ec56fa")); + message->addPayload(std::make_shared("0e3141cd80894871a68e6fe6b1ec56fa")); forwarded->setStanza(message); sent->setForwarded(forwarded); @@ -127,7 +127,7 @@ class CarbonsSerializerTest : public CppUnit::TestFixture { void testSerializeExample15() { CarbonsPrivateSerializer testling; - CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(boost::make_shared())); + CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(std::make_shared())); } private: FullPayloadSerializerCollection serializers; diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ChatStateSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ChatStateSerializerTest.cpp index 85b067f..018d2cc 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/ChatStateSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ChatStateSerializerTest.cpp @@ -4,6 +4,12 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #include #include @@ -26,27 +32,27 @@ class ChatStateSerializerTest : public CppUnit::TestFixture ChatStateSerializer testling; void testSerialize_ActiveState() { - boost::shared_ptr priority(new ChatState(ChatState::Active)); + std::shared_ptr priority(new ChatState(ChatState::Active)); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(priority)); } void testSerialize_GoneState() { - boost::shared_ptr priority(new ChatState(ChatState::Gone)); + std::shared_ptr priority(new ChatState(ChatState::Gone)); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(priority)); } void testSerialize_ComposingState() { - boost::shared_ptr priority(new ChatState(ChatState::Composing)); + std::shared_ptr priority(new ChatState(ChatState::Composing)); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(priority)); } void testSerialize_PausedState() { - boost::shared_ptr priority(new ChatState(ChatState::Paused)); + std::shared_ptr priority(new ChatState(ChatState::Paused)); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(priority)); } void testSerialize_InacativeState() { - boost::shared_ptr priority(new ChatState(ChatState::Inactive)); + std::shared_ptr priority(new ChatState(ChatState::Inactive)); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(priority)); } }; diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp index bda9ab7..7ed9421 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp @@ -10,8 +10,7 @@ * See the COPYING file for more information. */ -#include -#include +#include #include #include @@ -31,18 +30,18 @@ class DeliveryReceiptSerializerTest : public CppUnit::TestFixture { void testSerialize_XEP0184Example3() { std::string expected = ""; - DeliveryReceiptRequest::ref receipt = boost::make_shared(); + DeliveryReceiptRequest::ref receipt = std::make_shared(); - boost::shared_ptr serializer = boost::make_shared(); + std::shared_ptr serializer = std::make_shared(); CPPUNIT_ASSERT_EQUAL(expected, serializer->serializePayload(receipt)); } void testSerialize_XEP0184Example4() { std::string expected = ""; - DeliveryReceipt::ref receipt = boost::make_shared("richard2-4.1.247"); + DeliveryReceipt::ref receipt = std::make_shared("richard2-4.1.247"); - boost::shared_ptr serializer = boost::make_shared(); + std::shared_ptr serializer = std::make_shared(); CPPUNIT_ASSERT_EQUAL(expected, serializer->serializePayload(receipt)); } }; diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp index 14b1a34..318c3d7 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -23,7 +23,7 @@ class DiscoInfoSerializerTest : public CppUnit::TestFixture void testSerialize() { DiscoInfoSerializer testling; - boost::shared_ptr discoInfo(new DiscoInfo()); + std::shared_ptr discoInfo(new DiscoInfo()); discoInfo->addIdentity(DiscoInfo::Identity("Swift", "client", "pc")); discoInfo->addIdentity(DiscoInfo::Identity("Vlug", "client", "pc", "nl")); discoInfo->addFeature("http://jabber.org/protocol/caps"); @@ -43,10 +43,10 @@ class DiscoInfoSerializerTest : public CppUnit::TestFixture void testSerialize_Form() { DiscoInfoSerializer testling; - boost::shared_ptr discoInfo(new DiscoInfo()); + std::shared_ptr discoInfo(new DiscoInfo()); discoInfo->addFeature("http://jabber.org/protocol/caps"); discoInfo->addFeature("http://jabber.org/protocol/disco#info"); - boost::shared_ptr form(new Form(Form::FormType)); + std::shared_ptr form(new Form(Form::FormType)); form->setTitle("Bot Configuration"); discoInfo->addExtension(form); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp index 13d9e3c..68a72b8 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -24,15 +24,15 @@ class ErrorSerializerTest : public CppUnit::TestFixture { public: void testSerialize() { ErrorSerializer testling(&serializers); - boost::shared_ptr error(new ErrorPayload(ErrorPayload::BadRequest, ErrorPayload::Cancel, "My Error")); + std::shared_ptr error(new ErrorPayload(ErrorPayload::BadRequest, ErrorPayload::Cancel, "My Error")); CPPUNIT_ASSERT_EQUAL(std::string("My Error"), testling.serialize(error)); } void testSerialize_Payload() { ErrorSerializer testling(&serializers); - boost::shared_ptr error = boost::make_shared(); - error->setPayload(boost::make_shared()); + std::shared_ptr error = std::make_shared(); + error->setPayload(std::make_shared()); CPPUNIT_ASSERT_EQUAL(std::string( "" diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp index 8bd16cd..6534dce 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -22,7 +22,7 @@ class FormSerializerTest : public CppUnit::TestFixture { public: void testSerializeFormInformation() { FormSerializer testling; - boost::shared_ptr form(new Form(Form::FormType)); + std::shared_ptr form(new Form(Form::FormType)); form->setTitle("Bot Configuration"); form->setInstructions("Hello!\nFill out this form to configure your new bot!"); @@ -36,39 +36,39 @@ class FormSerializerTest : public CppUnit::TestFixture { void testSerializeLayout() { FormSerializer testling; - boost::shared_ptr form(new Form(Form::FormType)); + std::shared_ptr form(new Form(Form::FormType)); - FormPage::page page = boost::make_shared(); + FormPage::page page = std::make_shared(); page->setLabel("P1"); - FormReportedRef::ref reportedRef = boost::make_shared(); + FormReportedRef::ref reportedRef = std::make_shared(); page->addReportedRef(reportedRef); - FormText::text formText = boost::make_shared(); + FormText::text formText = std::make_shared(); formText->setTextString("P1T1"); page->addTextElement(formText); - FormField::ref field = boost::make_shared(FormField::TextSingleType); + FormField::ref field = std::make_shared(FormField::TextSingleType); field->setName("P1F1"); field->setLabel("field one"); page->addField(field); - FormSection::section section = boost::make_shared(); + FormSection::section section = std::make_shared(); section->setLabel("P1S1"); - formText = boost::make_shared(); + formText = std::make_shared(); formText->setTextString("P1S1T1"); section->addTextElement(formText); - field = boost::make_shared(FormField::TextSingleType); + field = std::make_shared(FormField::TextSingleType); field->setName("P1S1F1"); field->setLabel("field two"); section->addField(field); page->addChildSection(section); form->addPage(page); - page = boost::make_shared(); + page = std::make_shared(); page->setLabel("P2"); - section = boost::make_shared(); + section = std::make_shared(); section->setLabel("P2S1"); - FormSection::section subSection = boost::make_shared(); + FormSection::section subSection = std::make_shared(); subSection->setLabel("P2S2"); - FormSection::section subSection2 = boost::make_shared(); + FormSection::section subSection2 = std::make_shared(); subSection2->setLabel("P2S3"); subSection->addChildSection(subSection2); section->addChildSection(subSection); @@ -101,37 +101,37 @@ class FormSerializerTest : public CppUnit::TestFixture { void testSerializeFields() { FormSerializer testling; - boost::shared_ptr form(new Form(Form::FormType)); + std::shared_ptr form(new Form(Form::FormType)); - FormField::ref field = boost::make_shared(FormField::HiddenType, "jabber:bot"); + FormField::ref field = std::make_shared(FormField::HiddenType, "jabber:bot"); field->setName("FORM_TYPE"); form->addField(field); - form->addField(boost::make_shared(FormField::FixedType, "Section 1: Bot Info")); + form->addField(std::make_shared(FormField::FixedType, "Section 1: Bot Info")); - field = boost::make_shared(FormField::TextSingleType); + field = std::make_shared(FormField::TextSingleType); field->setName("botname"); field->setLabel("The name of your bot"); form->addField(field); - field = boost::make_shared(FormField::TextMultiType); + field = std::make_shared(FormField::TextMultiType); field->setTextMultiValue("This is a bot.\nA quite good one actually"); field->setName("description"); field->setLabel("Helpful description of your bot"); form->addField(field); - field = boost::make_shared(FormField::BooleanType, "1"); + field = std::make_shared(FormField::BooleanType, "1"); field->setName("public"); field->setLabel("Public bot?"); field->setRequired(true); form->addField(field); - field = boost::make_shared(FormField::TextPrivateType); + field = std::make_shared(FormField::TextPrivateType); field->setName("password"); field->setLabel("Password for special access"); form->addField(field); - field = boost::make_shared(FormField::ListMultiType); + field = std::make_shared(FormField::ListMultiType); field->addValue("news"); field->addValue("search"); field->setName("features"); @@ -143,7 +143,7 @@ class FormSerializerTest : public CppUnit::TestFixture { field->addOption(FormField::Option("Search", "search")); form->addField(field); - field = boost::make_shared(FormField::ListSingleType, "20"); + field = std::make_shared(FormField::ListSingleType, "20"); field->setName("maxsubs"); field->setLabel("Maximum number of subscribers"); field->addOption(FormField::Option("10", "10")); @@ -155,7 +155,7 @@ class FormSerializerTest : public CppUnit::TestFixture { form->addField(field); std::vector jids; - field = boost::make_shared(FormField::JIDMultiType); + field = std::make_shared(FormField::JIDMultiType); field->addValue("foo@bar.com"); field->addValue("baz@fum.org"); field->setName("invitelist"); @@ -204,64 +204,64 @@ class FormSerializerTest : public CppUnit::TestFixture { void testSerializeFormItems() { FormSerializer testling; - boost::shared_ptr form(new Form(Form::ResultType)); + std::shared_ptr form(new Form(Form::ResultType)); - FormField::ref field = boost::make_shared(FormField::HiddenType, "jabber:iq:search"); + FormField::ref field = std::make_shared(FormField::HiddenType, "jabber:iq:search"); field->setName("FORM_TYPE"); form->addField(field); // reported fields - field = boost::make_shared(FormField::TextSingleType); + field = std::make_shared(FormField::TextSingleType); field->setName("first"); field->setLabel("Given Name"); form->addReportedField(field); - field = boost::make_shared(FormField::TextSingleType); + field = std::make_shared(FormField::TextSingleType); field->setName("last"); field->setLabel("Family Name"); form->addReportedField(field); - field = boost::make_shared(FormField::JIDSingleType); + field = std::make_shared(FormField::JIDSingleType); field->setName("jid"); field->setLabel("Jabber ID"); form->addReportedField(field); - field = boost::make_shared(FormField::ListSingleType); + field = std::make_shared(FormField::ListSingleType); field->setName("x-gender"); field->setLabel("Gender"); form->addReportedField(field); Form::FormItem firstItem; - field = boost::make_shared(FormField::TextSingleType, "Benvolio"); + field = std::make_shared(FormField::TextSingleType, "Benvolio"); field->setName("first"); firstItem.push_back(field); - field = boost::make_shared(FormField::TextSingleType, "Montague"); + field = std::make_shared(FormField::TextSingleType, "Montague"); field->setName("last"); firstItem.push_back(field); - field = boost::make_shared(FormField::JIDSingleType, JID("benvolio@montague.net")); + field = std::make_shared(FormField::JIDSingleType, JID("benvolio@montague.net")); field->setName("jid"); firstItem.push_back(field); - field = boost::make_shared(FormField::ListSingleType, "male"); + field = std::make_shared(FormField::ListSingleType, "male"); field->setName("x-gender"); firstItem.push_back(field); Form::FormItem secondItem; - field = boost::make_shared(FormField::TextSingleType, "Romeo"); + field = std::make_shared(FormField::TextSingleType, "Romeo"); field->setName("first"); secondItem.push_back(field); - field = boost::make_shared(FormField::TextSingleType, "Montague"); + field = std::make_shared(FormField::TextSingleType, "Montague"); field->setName("last"); secondItem.push_back(field); - field = boost::make_shared(FormField::JIDSingleType, JID("romeo@montague.net")); + field = std::make_shared(FormField::JIDSingleType, JID("romeo@montague.net")); field->setName("jid"); secondItem.push_back(field); - field = boost::make_shared(FormField::ListSingleType, "male"); + field = std::make_shared(FormField::ListSingleType, "male"); field->setName("x-gender"); secondItem.push_back(field); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp index d7aed26..b0f41d4 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp @@ -1,10 +1,10 @@ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ -#include +#include #include #include @@ -32,11 +32,11 @@ class ForwardedSerializerTest : public CppUnit::TestFixture { void testSerializeIQ() { ForwardedSerializer serializer(&serializers); - boost::shared_ptr iq = IQ::createResult(JID("juliet@capulet.lit/balcony"), JID("romeo@montague.lit/orchard"), "id0"); + std::shared_ptr iq = IQ::createResult(JID("juliet@capulet.lit/balcony"), JID("romeo@montague.lit/orchard"), "id0"); - boost::shared_ptr forwarded(boost::make_shared()); + std::shared_ptr forwarded(std::make_shared()); forwarded->setStanza(iq); - forwarded->setDelay(boost::make_shared(stringToDateTime(std::string("2010-07-10T23:08:25Z")))); + forwarded->setDelay(std::make_shared(stringToDateTime(std::string("2010-07-10T23:08:25Z")))); std::string expectedResult = "" @@ -50,15 +50,15 @@ class ForwardedSerializerTest : public CppUnit::TestFixture { void testSerializeMessage() { ForwardedSerializer serializer(&serializers); - boost::shared_ptr message(boost::make_shared()); + std::shared_ptr message(std::make_shared()); message->setType(Message::Chat); message->setTo(JID("juliet@capulet.lit/balcony")); message->setFrom(JID("romeo@montague.lit/orchard")); message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo."); - boost::shared_ptr forwarded(boost::make_shared()); + std::shared_ptr forwarded(std::make_shared()); forwarded->setStanza(message); - forwarded->setDelay(boost::make_shared(stringToDateTime(std::string("2010-07-10T23:08:25Z")))); + forwarded->setDelay(std::make_shared(stringToDateTime(std::string("2010-07-10T23:08:25Z")))); std::string expectedResult = "" @@ -74,13 +74,13 @@ class ForwardedSerializerTest : public CppUnit::TestFixture { void testSerializeMessageNoDelay() { ForwardedSerializer serializer(&serializers); - boost::shared_ptr message(boost::make_shared()); + std::shared_ptr message(std::make_shared()); message->setType(Message::Chat); message->setTo(JID("juliet@capulet.lit/balcony")); message->setFrom(JID("romeo@montague.lit/orchard")); message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo."); - boost::shared_ptr forwarded(boost::make_shared()); + std::shared_ptr forwarded(std::make_shared()); forwarded->setStanza(message); std::string expectedResult = @@ -96,12 +96,12 @@ class ForwardedSerializerTest : public CppUnit::TestFixture { void testSerializePresence() { ForwardedSerializer serializer(&serializers); - boost::shared_ptr presence(boost::make_shared()); + std::shared_ptr presence(std::make_shared()); presence->setType(Presence::Subscribe); - boost::shared_ptr forwarded(boost::make_shared()); + std::shared_ptr forwarded(std::make_shared()); forwarded->setStanza(presence); - forwarded->setDelay(boost::make_shared(stringToDateTime(std::string("2010-07-10T23:08:25Z")))); + forwarded->setDelay(std::make_shared(stringToDateTime(std::string("2010-07-10T23:08:25Z")))); std::string expectedResult = "" diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/IBBSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/IBBSerializerTest.cpp index 45badea..84412c9 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/IBBSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/IBBSerializerTest.cpp @@ -30,7 +30,7 @@ class IBBSerializerTest : public CppUnit::TestFixture void testSerialize_data() { IBBSerializer testling; - boost::shared_ptr ibb = boost::make_shared(); + std::shared_ptr ibb = std::make_shared(); ibb->setAction(IBB::Data); ibb->setData(createByteArray("abcdefgihjklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\x0a")); ibb->setSequenceNumber(4); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp index 147c7be..46598da 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp @@ -10,7 +10,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -29,7 +29,7 @@ class IdleSerializerTest : public CppUnit::TestFixture { void testSerialize() { IdleSerializer testling; - Idle::ref idle = boost::make_shared(stringToDateTime("1969-07-21T02:56:15Z")); + Idle::ref idle = std::make_shared(stringToDateTime("1969-07-21T02:56:15Z")); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(idle)); } diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp index b1b0c45..44ac7a1 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -22,7 +22,7 @@ class InBandRegistrationPayloadSerializerTest : public CppUnit::TestFixture { public: void testSerialize() { InBandRegistrationPayloadSerializer testling; - boost::shared_ptr registration(new InBandRegistrationPayload()); + std::shared_ptr registration(new InBandRegistrationPayload()); registration->setRegistered(true); std::string expectedResult = @@ -34,13 +34,13 @@ class InBandRegistrationPayloadSerializerTest : public CppUnit::TestFixture { } void testSerialize_Form() { InBandRegistrationPayloadSerializer testling; - boost::shared_ptr registration(new InBandRegistrationPayload()); + std::shared_ptr registration(new InBandRegistrationPayload()); registration->setInstructions("Use the enclosed form to register."); - boost::shared_ptr form(new Form(Form::FormType)); + std::shared_ptr form(new Form(Form::FormType)); form->setTitle("Contest Registration"); - FormField::ref field = boost::make_shared(FormField::HiddenType, "jabber:iq:register"); + FormField::ref field = std::make_shared(FormField::HiddenType, "jabber:iq:register"); field->setName("FORM_TYPE"); form->addField(field); registration->setForm(form); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/IsodeIQDelegationSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/IsodeIQDelegationSerializerTest.cpp index 8f46ca8..4a466ba 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/IsodeIQDelegationSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/IsodeIQDelegationSerializerTest.cpp @@ -41,13 +41,13 @@ class IsodeIQDelegationSerializerTest : public CppUnit::TestFixture void testSerialize_Forwarded_IQ() { IsodeIQDelegationSerializer testling(&serializers); - boost::shared_ptr isodeIQDelegation = boost::make_shared(); + std::shared_ptr isodeIQDelegation = std::make_shared(); - boost::shared_ptr iq = IQ::createResult(JID("juliet@capulet.lit/balcony"), JID("romeo@montague.lit/orchard"), "id0", boost::make_shared("text")); + std::shared_ptr iq = IQ::createResult(JID("juliet@capulet.lit/balcony"), JID("romeo@montague.lit/orchard"), "id0", std::make_shared("text")); - boost::shared_ptr forwarded(boost::make_shared()); + std::shared_ptr forwarded(std::make_shared()); forwarded->setStanza(iq); - forwarded->setDelay(boost::make_shared(stringToDateTime(std::string("2010-07-10T23:08:25Z")))); + forwarded->setDelay(std::make_shared(stringToDateTime(std::string("2010-07-10T23:08:25Z")))); isodeIQDelegation->setForward(forwarded); CPPUNIT_ASSERT_EQUAL(std::string("" @@ -60,17 +60,17 @@ class IsodeIQDelegationSerializerTest : public CppUnit::TestFixture void testSerialize_Forwarded_Message() { IsodeIQDelegationSerializer testling(&serializers); - boost::shared_ptr isodeIQDelegation = boost::make_shared(); + std::shared_ptr isodeIQDelegation = std::make_shared(); - boost::shared_ptr message(boost::make_shared()); + std::shared_ptr message(std::make_shared()); message->setType(Message::Chat); message->setTo(JID("juliet@capulet.lit/balcony")); message->setFrom(JID("romeo@montague.lit/orchard")); message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo."); - boost::shared_ptr forwarded(boost::make_shared()); + std::shared_ptr forwarded(std::make_shared()); forwarded->setStanza(message); - forwarded->setDelay(boost::make_shared(stringToDateTime(std::string("2010-07-10T23:08:25Z")))); + forwarded->setDelay(std::make_shared(stringToDateTime(std::string("2010-07-10T23:08:25Z")))); isodeIQDelegation->setForward(forwarded); CPPUNIT_ASSERT_EQUAL(std::string("" @@ -85,15 +85,15 @@ class IsodeIQDelegationSerializerTest : public CppUnit::TestFixture void testSerialize_Forwarded_MessageNoDelay() { IsodeIQDelegationSerializer testling(&serializers); - boost::shared_ptr isodeIQDelegation = boost::make_shared(); + std::shared_ptr isodeIQDelegation = std::make_shared(); - boost::shared_ptr message(boost::make_shared()); + std::shared_ptr message(std::make_shared()); message->setType(Message::Chat); message->setTo(JID("juliet@capulet.lit/balcony")); message->setFrom(JID("romeo@montague.lit/orchard")); message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo."); - boost::shared_ptr forwarded(boost::make_shared()); + std::shared_ptr forwarded(std::make_shared()); forwarded->setStanza(message); isodeIQDelegation->setForward(forwarded); @@ -108,14 +108,14 @@ class IsodeIQDelegationSerializerTest : public CppUnit::TestFixture void testSerialize_Forwarded_Presence() { IsodeIQDelegationSerializer testling(&serializers); - boost::shared_ptr isodeIQDelegation = boost::make_shared(); + std::shared_ptr isodeIQDelegation = std::make_shared(); - boost::shared_ptr presence(boost::make_shared()); + std::shared_ptr presence(std::make_shared()); presence->setType(Presence::Subscribe); - boost::shared_ptr forwarded(boost::make_shared()); + std::shared_ptr forwarded(std::make_shared()); forwarded->setStanza(presence); - forwarded->setDelay(boost::make_shared(stringToDateTime(std::string("2010-07-10T23:08:25Z")))); + forwarded->setDelay(std::make_shared(stringToDateTime(std::string("2010-07-10T23:08:25Z")))); isodeIQDelegation->setForward(forwarded); CPPUNIT_ASSERT_EQUAL(std::string("" diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp index ecb68cd..00d79b3 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp @@ -10,8 +10,7 @@ * See the COPYING file for more information. */ -#include -#include +#include #include #include @@ -49,8 +48,8 @@ class JingleSerializersTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE_END(); - boost::shared_ptr createTestling() { - return boost::make_shared(&collection); + std::shared_ptr createTestling() { + return std::make_shared(&collection); } @@ -66,7 +65,7 @@ class JingleSerializersTest : public CppUnit::TestFixture { "" ""; - StreamInitiationFileInfo::ref fileInfo = boost::make_shared(); + StreamInitiationFileInfo::ref fileInfo = std::make_shared(); fileInfo->setDate(stringToDateTime("1969-07-21T02:56:15Z")); fileInfo->setHash("552da749930852c69ae5d2141d3766b1"); fileInfo->setSize(1022); @@ -74,7 +73,7 @@ class JingleSerializersTest : public CppUnit::TestFixture { fileInfo->setDescription("This is a test. If this were a real file..."); fileInfo->setSupportsRangeRequests(true); - boost::shared_ptr serializer = boost::make_shared(); + std::shared_ptr serializer = std::make_shared(); CPPUNIT_ASSERT_EQUAL(expected, serializer->serializePayload(fileInfo)); } @@ -84,12 +83,12 @@ class JingleSerializersTest : public CppUnit::TestFixture { "" ""; - StreamInitiationFileInfo::ref fileInfo = boost::make_shared(); + StreamInitiationFileInfo::ref fileInfo = std::make_shared(); fileInfo->setHash("552da749930852c69ae5d2141d3766b1"); fileInfo->setSupportsRangeRequests(true); fileInfo->setRangeOffset(270336); - boost::shared_ptr serializer = boost::make_shared(); + std::shared_ptr serializer = std::make_shared(); CPPUNIT_ASSERT_EQUAL(expected, serializer->serializePayload(fileInfo)); } @@ -110,16 +109,16 @@ class JingleSerializersTest : public CppUnit::TestFixture { "" ""; - JinglePayload::ref payload = boost::make_shared(); + JinglePayload::ref payload = std::make_shared(); payload->setAction(JinglePayload::SessionInitiate); payload->setSessionID("a73sjjvkla37jfea"); payload->setInitiator(JID("romeo@montague.lit/orchard")); - JingleIBBTransportPayload::ref transport = boost::make_shared(); + JingleIBBTransportPayload::ref transport = std::make_shared(); transport->setBlockSize(4096); transport->setSessionID("ch3d9s71"); - JingleContentPayload::ref content = boost::make_shared(); + JingleContentPayload::ref content = std::make_shared(); content->setCreator(JingleContentPayload::InitiatorCreator); content->setName("ex"); content->addTransport(transport); @@ -143,16 +142,16 @@ class JingleSerializersTest : public CppUnit::TestFixture { "" ""; - JinglePayload::ref payload = boost::make_shared(); + JinglePayload::ref payload = std::make_shared(); payload->setAction(JinglePayload::TransportInfo); payload->setInitiator(JID("romeo@montague.lit/orchard")); payload->setSessionID("a73sjjvkla37jfea"); - JingleContentPayload::ref content = boost::make_shared(); + JingleContentPayload::ref content = std::make_shared(); content->setCreator(JingleContentPayload::InitiatorCreator); content->setName("ex"); - JingleIBBTransportPayload::ref transport = boost::make_shared(); + JingleIBBTransportPayload::ref transport = std::make_shared(); transport->setBlockSize(2048); transport->setSessionID("bt8a71h6"); @@ -172,7 +171,7 @@ class JingleSerializersTest : public CppUnit::TestFixture { "" ""; - JinglePayload::ref payload = boost::make_shared(); + JinglePayload::ref payload = std::make_shared(); payload->setAction(JinglePayload::SessionTerminate); payload->setInitiator(JID("romeo@montague.lit/orchard")); payload->setSessionID("a73sjjvkla37jfea"); @@ -193,7 +192,7 @@ class JingleSerializersTest : public CppUnit::TestFixture { "VS2nSZMIUsaa5dIUHTdmsQ==" "" ""; - JingleFileTransferDescription::ref desc = boost::make_shared(); + JingleFileTransferDescription::ref desc = std::make_shared(); JingleFileTransferFileInfo fileInfo; fileInfo.setDate(stringToDateTime("1969-07-21T02:56:15Z")); @@ -205,7 +204,7 @@ class JingleSerializersTest : public CppUnit::TestFixture { desc->setFileInfo(fileInfo); - CPPUNIT_ASSERT_EQUAL(expected, boost::make_shared()->serialize(desc)); + CPPUNIT_ASSERT_EQUAL(expected, std::make_shared()->serialize(desc)); } // http://xmpp.org/extensions/xep-0234.html#example-3 @@ -251,16 +250,16 @@ class JingleSerializersTest : public CppUnit::TestFixture { "" ""; - JinglePayload::ref payload = boost::make_shared(); + JinglePayload::ref payload = std::make_shared(); payload->setAction(JinglePayload::SessionAccept); payload->setInitiator(JID("romeo@montague.lit/orchard")); payload->setSessionID("851ba2"); - JingleContentPayload::ref content = boost::make_shared(); + JingleContentPayload::ref content = std::make_shared(); content->setCreator(JingleContentPayload::InitiatorCreator); content->setName("a-file-offer"); - JingleFileTransferDescription::ref description = boost::make_shared(); + JingleFileTransferDescription::ref description = std::make_shared(); JingleFileTransferFileInfo fileInfo; fileInfo.setName("test.txt"); fileInfo.setSize(1022); @@ -293,12 +292,12 @@ class JingleSerializersTest : public CppUnit::TestFixture { //"" ""; - JinglePayload::ref payload = boost::make_shared(); + JinglePayload::ref payload = std::make_shared(); payload->setAction(JinglePayload::TransportInfo); payload->setInitiator(JID("romeo@montague.lit/orchard")); payload->setSessionID("a73sjjvkla37jfea"); - JingleContentPayload::ref content = boost::make_shared(); + JingleContentPayload::ref content = std::make_shared(); content->setCreator(JingleContentPayload::InitiatorCreator); content->setName("ex"); payload->addPayload(content); @@ -321,12 +320,12 @@ class JingleSerializersTest : public CppUnit::TestFixture { "" ""; - JinglePayload::ref payload = boost::make_shared(); + JinglePayload::ref payload = std::make_shared(); payload->setAction(JinglePayload::SessionInfo); payload->setInitiator(JID("romeo@montague.lit/orchard")); payload->setSessionID("a73sjjvkla37jfea"); - JingleFileTransferHash::ref hash = boost::make_shared(); + JingleFileTransferHash::ref hash = std::make_shared(); hash->getFileInfo().addHash(HashElement("sha-1", Base64::decode("VS2nSZMIUsaa5dIUHTdmsQ=="))); payload->addPayload(hash); @@ -364,16 +363,16 @@ class JingleSerializersTest : public CppUnit::TestFixture { "" ""; - JinglePayload::ref payload = boost::make_shared(); + JinglePayload::ref payload = std::make_shared(); payload->setAction(JinglePayload::SessionInitiate); payload->setInitiator(JID("romeo@montague.lit/orchard")); payload->setSessionID("a73sjjvkla37jfea"); - JingleContentPayload::ref content = boost::make_shared(); + JingleContentPayload::ref content = std::make_shared(); content->setCreator(JingleContentPayload::InitiatorCreator); content->setName("ex"); - JingleS5BTransportPayload::ref transport = boost::make_shared(); + JingleS5BTransportPayload::ref transport = std::make_shared(); transport->setMode(JingleS5BTransportPayload::TCPMode); transport->setDstAddr("1a12fb7bc625e55f3ed5b29a53dbe0e4aa7d80ba"); transport->setSessionID("vj3hs98y"); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMFinSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMFinSerializerTest.cpp index 0eda01c..198f73c 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMFinSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMFinSerializerTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -24,7 +24,7 @@ class MAMFinSerializerTest : public CppUnit::TestFixture { void testSerialize_XEP0313_Exmaple1() { MAMFinSerializer serializer; - boost::shared_ptr fin = boost::make_shared(); + std::shared_ptr fin = std::make_shared(); fin->setQueryID("f27"); std::string expectedResult = @@ -35,10 +35,10 @@ class MAMFinSerializerTest : public CppUnit::TestFixture { void testSerialize_XEP0313_Exmaple9() { MAMFinSerializer serializer; - boost::shared_ptr fin = boost::make_shared(); + std::shared_ptr fin = std::make_shared(); fin->setComplete(true); - boost::shared_ptr set = boost::make_shared(); + std::shared_ptr set = std::make_shared(); set->setFirstID(std::string("23452-4534-1")); set->setFirstIDIndex(0); set->setLastID(std::string("390-2342-22")); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp index faf788d..cc46ef9 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -27,22 +27,22 @@ class MAMQuerySerializerTest : public CppUnit::TestFixture { void testSerialize() { MAMQuerySerializer serializer; - boost::shared_ptr parameters(boost::make_shared()); + std::shared_ptr parameters(std::make_shared()); - boost::shared_ptr fieldType = boost::make_shared(FormField::TextSingleType); + std::shared_ptr fieldType = std::make_shared(FormField::TextSingleType); fieldType->setName("FORM_TYPE"); fieldType->addValue("urn:xmpp:mam:0"); parameters->addField(fieldType); - boost::shared_ptr fieldStart = boost::make_shared(FormField::TextSingleType); + std::shared_ptr fieldStart = std::make_shared(FormField::TextSingleType); fieldStart->setName("start"); fieldStart->addValue("2010-08-07T00:00:00Z"); parameters->addField(fieldStart); - boost::shared_ptr set = boost::make_shared(); + std::shared_ptr set = std::make_shared(); set->setMaxItems(10); - boost::shared_ptr query(boost::make_shared()); + std::shared_ptr query(std::make_shared()); query->setQueryID(std::string("id0")); query->setNode(std::string("node1")); query->setForm(parameters); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp index 40ca27d..09bec39 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -27,17 +27,17 @@ class MAMResultSerializerTest : public CppUnit::TestFixture { void testSerialize() { MAMResultSerializer serializer(&serializers); - boost::shared_ptr message(boost::make_shared()); + std::shared_ptr message(std::make_shared()); message->setType(Message::Chat); message->setTo(JID("juliet@capulet.lit/balcony")); message->setFrom(JID("romeo@montague.lit/orchard")); message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo."); - boost::shared_ptr forwarded(boost::make_shared()); + std::shared_ptr forwarded(std::make_shared()); forwarded->setStanza(message); - forwarded->setDelay(boost::make_shared(stringToDateTime(std::string("2010-07-10T23:08:25Z")))); + forwarded->setDelay(std::make_shared(stringToDateTime(std::string("2010-07-10T23:08:25Z")))); - boost::shared_ptr result(boost::make_shared()); + std::shared_ptr result(std::make_shared()); result->setID("28482-98726-73623"); result->setQueryID(std::string("f27")); result->setPayload(forwarded); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/MUCAdminPayloadSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/MUCAdminPayloadSerializerTest.cpp index fc6b346..5aeb9dd 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/MUCAdminPayloadSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/MUCAdminPayloadSerializerTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -24,7 +24,7 @@ class MUCAdminPayloadSerializerTest : public CppUnit::TestFixture void testSerialize() { MUCAdminPayloadSerializer testling; - boost::shared_ptr admin = boost::make_shared(); + std::shared_ptr admin = std::make_shared(); MUCItem item; item.affiliation = MUCOccupant::Owner; item.role = MUCOccupant::Visitor; diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp index 223e7d9..d34ea38 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -12,7 +12,7 @@ namespace Swift { -std::string PayloadsSerializer::serialize(boost::shared_ptr payload) { +std::string PayloadsSerializer::serialize(std::shared_ptr payload) { PayloadSerializer* serializer = serializers.getPayloadSerializer(payload); if (serializer) { return serializer->serialize(payload); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h index 827e9da..5e0f0c5 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h @@ -6,17 +6,16 @@ #pragma once +#include #include -#include - #include #include namespace Swift { class PayloadsSerializer { public: - std::string serialize(boost::shared_ptr payload); + std::string serialize(std::shared_ptr payload); private: FullPayloadSerializerCollection serializers; diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp index 19971c2..87d7d0f 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -22,7 +22,7 @@ class PrioritySerializerTest : public CppUnit::TestFixture void testSerialize() { PrioritySerializer testling; - boost::shared_ptr priority(new Priority(-113)); + std::shared_ptr priority(new Priority(-113)); CPPUNIT_ASSERT_EQUAL(std::string("-113"), testling.serialize(priority)); } diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp index 3b115b3..4e77e7d 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp @@ -24,8 +24,8 @@ class PrivateStorageSerializerTest : public CppUnit::TestFixture { void testSerialize() { PayloadsSerializer serializer; - boost::shared_ptr privateStorage(new PrivateStorage()); - boost::shared_ptr storage(new Storage()); + std::shared_ptr privateStorage(new PrivateStorage()); + std::shared_ptr storage(new Storage()); Storage::Room room; room.name = "Swift"; room.jid = JID("swift@rooms.swift.im"); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp index b835421..e8673b9 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -26,10 +26,10 @@ class PubSubItemSerializerTest : public CppUnit::TestFixture { void testSerialize() { PubSubItemSerializer serializer(&serializers); - boost::shared_ptr payload(boost::make_shared()); + std::shared_ptr payload(std::make_shared()); payload->setRawXML(""); - boost::shared_ptr item(boost::make_shared()); + std::shared_ptr item(std::make_shared()); item->addData(payload); item->setID("pubsub-item-1"); @@ -44,7 +44,7 @@ class PubSubItemSerializerTest : public CppUnit::TestFixture { void testSerializeEmptyID() { PubSubItemSerializer serializer(&serializers); - boost::shared_ptr item(boost::make_shared()); + std::shared_ptr item(std::make_shared()); std::string expectedResult = ""; diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp index fa99202..0194553 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -26,21 +26,21 @@ class PubSubItemsSerializerTest : public CppUnit::TestFixture { void testSerialize() { PubSubItemsSerializer serializer(&serializers); - boost::shared_ptr payload1(boost::make_shared()); + std::shared_ptr payload1(std::make_shared()); payload1->setRawXML(""); - boost::shared_ptr item1(boost::make_shared()); + std::shared_ptr item1(std::make_shared()); item1->addData(payload1); item1->setID("pubsub-item-1"); - boost::shared_ptr payload2(boost::make_shared()); + std::shared_ptr payload2(std::make_shared()); payload2->setRawXML(""); - boost::shared_ptr item2(boost::make_shared()); + std::shared_ptr item2(std::make_shared()); item2->addData(payload2); item2->setID("pubsub-item-2"); - boost::shared_ptr items(boost::make_shared()); + std::shared_ptr items(std::make_shared()); items->setNode("test-node"); items->setSubscriptionID(std::string("sub-id")); items->addItem(item1); @@ -62,7 +62,7 @@ class PubSubItemsSerializerTest : public CppUnit::TestFixture { void testSerializeEmptyItems() { PubSubItemsSerializer serializer(&serializers); - boost::shared_ptr items(boost::make_shared()); + std::shared_ptr items(std::make_shared()); std::string expectedResult = ""; diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ReplaceSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ReplaceSerializerTest.cpp index 1f40b26..4aab334 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/ReplaceSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ReplaceSerializerTest.cpp @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2012 Isode Limited. + * Copyright (c) 2012-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -27,7 +27,7 @@ class ReplaceSerializerTest: public CppUnit::TestFixture { void testSerialize() { ReplaceSerializer testling; - boost::shared_ptr replace(new Replace()); + std::shared_ptr replace(new Replace()); replace->setID("bad1"); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(replace)); } diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp index 9bc637f..30cd6e7 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -24,7 +24,7 @@ class ResourceBindSerializerTest : public CppUnit::TestFixture void testSerialize_JID() { ResourceBindSerializer testling; - boost::shared_ptr resourceBind(new ResourceBind()); + std::shared_ptr resourceBind(new ResourceBind()); resourceBind->setJID(JID("somenode@example.com/someresource")); CPPUNIT_ASSERT_EQUAL(std::string( @@ -35,7 +35,7 @@ class ResourceBindSerializerTest : public CppUnit::TestFixture void testSerialize_Resource() { ResourceBindSerializer testling; - boost::shared_ptr resourceBind(new ResourceBind()); + std::shared_ptr resourceBind(new ResourceBind()); resourceBind->setResource("someresource"); CPPUNIT_ASSERT_EQUAL(std::string( @@ -46,7 +46,7 @@ class ResourceBindSerializerTest : public CppUnit::TestFixture void testSerialize_Empty() { ResourceBindSerializer testling; - boost::shared_ptr resourceBind(new ResourceBind()); + std::shared_ptr resourceBind(new ResourceBind()); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(resourceBind)); } diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp index 0b0163e..fecd3c5 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -28,7 +28,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture { void testSerializeFull() { ResultSetSerializer serializer; - boost::shared_ptr resultSet(boost::make_shared()); + std::shared_ptr resultSet(std::make_shared()); resultSet->setMaxItems(100); resultSet->setCount(800); @@ -56,7 +56,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture { void testSerializeMaxItems() { ResultSetSerializer serializer; - boost::shared_ptr resultSet(boost::make_shared()); + std::shared_ptr resultSet(std::make_shared()); resultSet->setMaxItems(100); @@ -71,7 +71,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture { void testSerializeEmptyBefore() { ResultSetSerializer serializer; - boost::shared_ptr resultSet(boost::make_shared()); + std::shared_ptr resultSet(std::make_shared()); resultSet->setBefore(std::string()); @@ -86,7 +86,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture { void testSerializeFirst() { ResultSetSerializer serializer; - boost::shared_ptr resultSet(boost::make_shared()); + std::shared_ptr resultSet(std::make_shared()); resultSet->setFirstID(std::string("stpeter@jabber.org")); @@ -101,7 +101,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture { void testSerializeFirstWithIndex() { ResultSetSerializer serializer; - boost::shared_ptr resultSet(boost::make_shared()); + std::shared_ptr resultSet(std::make_shared()); resultSet->setFirstID(std::string("stpeter@jabber.org")); resultSet->setFirstIDIndex(123); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterItemExchangeSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterItemExchangeSerializerTest.cpp index 65922f7..652becb 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterItemExchangeSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterItemExchangeSerializerTest.cpp @@ -4,6 +4,12 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #include #include @@ -22,7 +28,7 @@ class RosterItemExchangeSerializerTest : public CppUnit::TestFixture void testSerialize() { RosterItemExchangeSerializer testling; - boost::shared_ptr roster(new RosterItemExchangePayload()); + std::shared_ptr roster(new RosterItemExchangePayload()); RosterItemExchangePayload::Item item1; item1.setJID("foo@bar.com"); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp index 6670bb8..0c576d2 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -22,7 +22,7 @@ class RosterSerializerTest : public CppUnit::TestFixture { public: void testSerialize() { RosterSerializer testling; - boost::shared_ptr roster(new RosterPayload()); + std::shared_ptr roster(new RosterPayload()); RosterItemPayload item1; item1.setJID(JID("foo@bar.com")); @@ -52,7 +52,7 @@ class RosterSerializerTest : public CppUnit::TestFixture { void testSerialize_ItemWithUnknownContent() { RosterSerializer testling; - boost::shared_ptr roster(new RosterPayload()); + std::shared_ptr roster(new RosterPayload()); RosterItemPayload item; item.setJID(JID("baz@blo.com")); @@ -79,7 +79,7 @@ class RosterSerializerTest : public CppUnit::TestFixture { void testSerialize_WithVersion() { RosterSerializer testling; - boost::shared_ptr roster(new RosterPayload()); + std::shared_ptr roster(new RosterPayload()); roster->setVersion("ver20"); std::string expectedResult = ""; @@ -89,7 +89,7 @@ class RosterSerializerTest : public CppUnit::TestFixture { void testSerialize_WithEmptyVersion() { RosterSerializer testling; - boost::shared_ptr roster(new RosterPayload()); + std::shared_ptr roster(new RosterPayload()); roster->setVersion(""); std::string expectedResult = ""; diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp index 0dfe0b0..3deca11 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -78,64 +78,64 @@ class SearchPayloadSerializerTest : public CppUnit::TestFixture { SearchPayloadSerializer testling; SearchPayload::ref payload(new SearchPayload()); - boost::shared_ptr form(new Form(Form::ResultType)); + std::shared_ptr form(new Form(Form::ResultType)); - FormField::ref field = boost::make_shared(FormField::HiddenType, "jabber:iq:search"); + FormField::ref field = std::make_shared(FormField::HiddenType, "jabber:iq:search"); field->setName("FORM_TYPE"); form->addField(field); // reported fields - field = boost::make_shared(FormField::TextSingleType); + field = std::make_shared(FormField::TextSingleType); field->setName("first"); field->setLabel("Given Name"); form->addReportedField(field); - field = boost::make_shared(FormField::TextSingleType); + field = std::make_shared(FormField::TextSingleType); field->setName("last"); field->setLabel("Family Name"); form->addReportedField(field); - field = boost::make_shared(FormField::JIDSingleType); + field = std::make_shared(FormField::JIDSingleType); field->setName("jid"); field->setLabel("Jabber ID"); form->addReportedField(field); - field = boost::make_shared(FormField::ListSingleType); + field = std::make_shared(FormField::ListSingleType); field->setName("x-gender"); field->setLabel("Gender"); form->addReportedField(field); Form::FormItem firstItem; - field = boost::make_shared(FormField::TextSingleType, "Benvolio"); + field = std::make_shared(FormField::TextSingleType, "Benvolio"); field->setName("first"); firstItem.push_back(field); - field = boost::make_shared(FormField::TextSingleType, "Montague"); + field = std::make_shared(FormField::TextSingleType, "Montague"); field->setName("last"); firstItem.push_back(field); - field = boost::make_shared(FormField::TextSingleType, "benvolio@montague.net"); + field = std::make_shared(FormField::TextSingleType, "benvolio@montague.net"); field->setName("jid"); firstItem.push_back(field); - field = boost::make_shared(FormField::ListSingleType, "male"); + field = std::make_shared(FormField::ListSingleType, "male"); field->setName("x-gender"); firstItem.push_back(field); Form::FormItem secondItem; - field = boost::make_shared(FormField::TextSingleType, "Romeo"); + field = std::make_shared(FormField::TextSingleType, "Romeo"); field->setName("first"); secondItem.push_back(field); - field = boost::make_shared(FormField::TextSingleType, "Montague"); + field = std::make_shared(FormField::TextSingleType, "Montague"); field->setName("last"); secondItem.push_back(field); - field = boost::make_shared(FormField::TextSingleType, "romeo@montague.net"); + field = std::make_shared(FormField::TextSingleType, "romeo@montague.net"); field->setName("jid"); secondItem.push_back(field); - field = boost::make_shared(FormField::ListSingleType, "male"); + field = std::make_shared(FormField::ListSingleType, "male"); field->setName("x-gender"); secondItem.push_back(field); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp index db482ff..6b65fd4 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -20,7 +20,7 @@ class SecurityLabelSerializerTest : public CppUnit::TestFixture { public: void testSerialize() { SecurityLabelSerializer testling; - boost::shared_ptr securityLabel(new SecurityLabel()); + std::shared_ptr securityLabel(new SecurityLabel()); securityLabel->setDisplayMarking("SECRET"); securityLabel->setForegroundColor("black"); securityLabel->setBackgroundColor("red"); @@ -45,7 +45,7 @@ class SecurityLabelSerializerTest : public CppUnit::TestFixture { void testSerialize_EmptyLabel() { SecurityLabelSerializer testling; - boost::shared_ptr securityLabel(new SecurityLabel()); + std::shared_ptr securityLabel(new SecurityLabel()); securityLabel->setDisplayMarking("SECRET"); securityLabel->setLabel(""); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp index 51c98c1..c3a72a5 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -22,13 +22,13 @@ class SecurityLabelsCatalogSerializerTest : public CppUnit::TestFixture void testSerialize() { SecurityLabelsCatalogSerializer testling; - boost::shared_ptr catalog(new SecurityLabelsCatalog()); + std::shared_ptr catalog(new SecurityLabelsCatalog()); catalog->setTo(JID("example.com")); catalog->setName("Default"); catalog->setDescription("an example set of labels"); SecurityLabelsCatalog::Item item1; - boost::shared_ptr securityLabel1(new SecurityLabel()); + std::shared_ptr securityLabel1(new SecurityLabel()); item1.setLabel(securityLabel1); securityLabel1->setDisplayMarking("SECRET"); securityLabel1->setForegroundColor("black"); @@ -39,7 +39,7 @@ class SecurityLabelsCatalogSerializerTest : public CppUnit::TestFixture catalog->addItem(item1); SecurityLabelsCatalog::Item item2; - boost::shared_ptr securityLabel2(new SecurityLabel()); + std::shared_ptr securityLabel2(new SecurityLabel()); item2.setLabel(securityLabel2); securityLabel2->setDisplayMarking("CONFIDENTIAL"); securityLabel2->setForegroundColor("black"); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp index 5643e1e..a20efb7 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -22,7 +22,7 @@ class SoftwareVersionSerializerTest : public CppUnit::TestFixture void testSerialize() { SoftwareVersionSerializer testling; - boost::shared_ptr softwareVersion(new SoftwareVersion("Swift", "0.1", "Mac OS X")); + std::shared_ptr softwareVersion(new SoftwareVersion("Swift", "0.1", "Mac OS X")); CPPUNIT_ASSERT_EQUAL(std::string("Swift0.1Mac OS X"), testling.serialize(softwareVersion)); } diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp index c8c2156..03a3ef5 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -22,7 +22,7 @@ class StatusSerializerTest : public CppUnit::TestFixture void testSerialize() { StatusSerializer testling; - boost::shared_ptr status(new Status("I am away")); + std::shared_ptr status(new Status("I am away")); CPPUNIT_ASSERT_EQUAL(std::string("I am away"), testling.serialize(status)); } diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp index 9fda49e..eb3b221 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -26,37 +26,37 @@ class StatusShowSerializerTest : public CppUnit::TestFixture void testSerialize_Online() { StatusShowSerializer testling; - boost::shared_ptr statusShow(new StatusShow(StatusShow::Online)); + std::shared_ptr statusShow(new StatusShow(StatusShow::Online)); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(statusShow)); } void testSerialize_Away() { StatusShowSerializer testling; - boost::shared_ptr statusShow(new StatusShow(StatusShow::Away)); + std::shared_ptr statusShow(new StatusShow(StatusShow::Away)); CPPUNIT_ASSERT_EQUAL(std::string("away"), testling.serialize(statusShow)); } void testSerialize_FFC() { StatusShowSerializer testling; - boost::shared_ptr statusShow(new StatusShow(StatusShow::FFC)); + std::shared_ptr statusShow(new StatusShow(StatusShow::FFC)); CPPUNIT_ASSERT_EQUAL(std::string("chat"), testling.serialize(statusShow)); } void testSerialize_XA() { StatusShowSerializer testling; - boost::shared_ptr statusShow(new StatusShow(StatusShow::XA)); + std::shared_ptr statusShow(new StatusShow(StatusShow::XA)); CPPUNIT_ASSERT_EQUAL(std::string("xa"), testling.serialize(statusShow)); } void testSerialize_DND() { StatusShowSerializer testling; - boost::shared_ptr statusShow(new StatusShow(StatusShow::DND)); + std::shared_ptr statusShow(new StatusShow(StatusShow::DND)); CPPUNIT_ASSERT_EQUAL(std::string("dnd"), testling.serialize(statusShow)); } void testSerialize_None() { StatusShowSerializer testling; - boost::shared_ptr statusShow(new StatusShow(StatusShow::None)); + std::shared_ptr statusShow(new StatusShow(StatusShow::None)); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(statusShow)); } }; diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp index e98ee3a..33c63cb 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp @@ -23,7 +23,7 @@ class StorageSerializerTest : public CppUnit::TestFixture { void testSerialize() { PayloadsSerializer serializer; - boost::shared_ptr storage(new Storage()); + std::shared_ptr storage(new Storage()); Storage::Room room; room.name = "Council of Oberon"; room.autoJoin = true; @@ -51,7 +51,7 @@ class StorageSerializerTest : public CppUnit::TestFixture { void testSerialize_NoNickOrPassword() { PayloadsSerializer serializer; - boost::shared_ptr storage(new Storage()); + std::shared_ptr storage(new Storage()); Storage::Room room; room.name = "Council of Oberon"; room.autoJoin = true; diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp index ada65a9..a38295c 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -20,7 +20,7 @@ class StreamInitiationSerializerTest : public CppUnit::TestFixture{ public: void testSerialize_Request() { StreamInitiationSerializer testling; - boost::shared_ptr streamInitiation(new StreamInitiation()); + std::shared_ptr streamInitiation(new StreamInitiation()); StreamInitiationFileInfo fileInfo("test.txt", "This is info about the file.", 1022); streamInitiation->setID("a0"); streamInitiation->setFileInfo(fileInfo); @@ -48,7 +48,7 @@ class StreamInitiationSerializerTest : public CppUnit::TestFixture{ void testSerialize_Response() { StreamInitiationSerializer testling; - boost::shared_ptr streamInitiation(new StreamInitiation()); + std::shared_ptr streamInitiation(new StreamInitiation()); streamInitiation->setRequestedMethod("http://jabber.org/protocol/bytestreams"); CPPUNIT_ASSERT_EQUAL(std::string( diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/UserLocationSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/UserLocationSerializerTest.cpp index 3aed450..4c2121f 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/UserLocationSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/UserLocationSerializerTest.cpp @@ -10,7 +10,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -31,7 +31,7 @@ class UserLocationSerializerTest : public CppUnit::TestFixture { public: void testSerialize_withAllVariablesSet() { UserLocationSerializer testling(&serializers); - boost::shared_ptr userLocation(new UserLocation()); + std::shared_ptr userLocation(new UserLocation()); userLocation->setArea(boost::optional("Barbaric")); userLocation->setAltitude(5.75F); userLocation->setLocality(boost::optional("Near")); @@ -70,7 +70,7 @@ class UserLocationSerializerTest : public CppUnit::TestFixture { void testSerialize_withSomeVariablesSet() { UserLocationSerializer testling(&serializers); - boost::shared_ptr userLocation(new UserLocation()); + std::shared_ptr userLocation(new UserLocation()); userLocation->setArea(boost::optional("Barbaric")); userLocation->setAltitude(5.75F); userLocation->setLocality(boost::optional("Near")); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/UserTuneSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/UserTuneSerializerTest.cpp index 50f2a54..df79f0d 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/UserTuneSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/UserTuneSerializerTest.cpp @@ -10,7 +10,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -31,7 +31,7 @@ class UserTuneSerializerTest : public CppUnit::TestFixture { public: void testSerialize_withAllVariablesSet() { UserTuneSerializer testling(&serializers); - boost::shared_ptr userTune(new UserTune()); + std::shared_ptr userTune(new UserTune()); userTune->setRating(5); userTune->setTitle(boost::optional("Minion")); userTune->setTrack(boost::optional("Yellow")); @@ -49,7 +49,7 @@ class UserTuneSerializerTest : public CppUnit::TestFixture { void testSerialize_withSomeVariablesSet() { UserTuneSerializer testling(&serializers); - boost::shared_ptr userTune(new UserTune()); + std::shared_ptr userTune(new UserTune()); userTune->setTitle(boost::optional("Minion")); userTune->setTrack(boost::optional("Yellow")); userTune->setArtist(boost::optional("Ice")); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp index c4a8156..49402ec 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -20,7 +20,7 @@ class VCardSerializerTest : public CppUnit::TestFixture public: void testSerialize() { VCardSerializer testling; - boost::shared_ptr vcard(new VCard()); + std::shared_ptr vcard(new VCard()); vcard->setVersion("2.0"); vcard->setFullName("Alice In Wonderland"); vcard->setPrefix("Mrs"); diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp index ed0500a..e3fc5ff 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -22,7 +22,7 @@ class VCardUpdateSerializerTest : public CppUnit::TestFixture void testSerialize() { VCardUpdateSerializer testling; - boost::shared_ptr update(new VCardUpdate()); + std::shared_ptr update(new VCardUpdate()); update->setPhotoHash("sha1-hash-of-image"); std::string expectedResult = diff --git a/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.cpp b/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.cpp index 2383cc8..c53342c 100644 --- a/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -23,76 +23,76 @@ UserLocationSerializer::UserLocationSerializer(PayloadSerializerCollection* seri UserLocationSerializer::~UserLocationSerializer() { } -std::string UserLocationSerializer::serializePayload(boost::shared_ptr payload) const { +std::string UserLocationSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("geoloc", "http://jabber.org/protocol/geoloc"); if (payload->getArea()) { - element.addNode(boost::make_shared("area", "", *payload->getArea())); + element.addNode(std::make_shared("area", "", *payload->getArea())); } if (payload->getAltitude()) { - element.addNode(boost::make_shared("alt", "", boost::lexical_cast(*payload->getAltitude()))); + element.addNode(std::make_shared("alt", "", boost::lexical_cast(*payload->getAltitude()))); } if (payload->getLocality()) { - element.addNode(boost::make_shared("locality", "", *payload->getLocality())); + element.addNode(std::make_shared("locality", "", *payload->getLocality())); } if (payload->getLatitude()) { - element.addNode(boost::make_shared("lat", "", boost::lexical_cast(*payload->getLatitude()))); + element.addNode(std::make_shared("lat", "", boost::lexical_cast(*payload->getLatitude()))); } if (payload->getAccuracy()) { - element.addNode(boost::make_shared("accuracy", "", boost::lexical_cast(*payload->getAccuracy()))); + element.addNode(std::make_shared("accuracy", "", boost::lexical_cast(*payload->getAccuracy()))); } if (payload->getDescription()) { - element.addNode(boost::make_shared("description", "", *payload->getDescription())); + element.addNode(std::make_shared("description", "", *payload->getDescription())); } if (payload->getCountryCode()) { - element.addNode(boost::make_shared("countrycode", "", *payload->getCountryCode())); + element.addNode(std::make_shared("countrycode", "", *payload->getCountryCode())); } if (payload->getTimestamp()) { - element.addNode(boost::make_shared("timestamp", "", dateTimeToString(*payload->getTimestamp()))); + element.addNode(std::make_shared("timestamp", "", dateTimeToString(*payload->getTimestamp()))); } if (payload->getFloor()) { - element.addNode(boost::make_shared("floor", "", *payload->getFloor())); + element.addNode(std::make_shared("floor", "", *payload->getFloor())); } if (payload->getBuilding()) { - element.addNode(boost::make_shared("building", "", *payload->getBuilding())); + element.addNode(std::make_shared("building", "", *payload->getBuilding())); } if (payload->getRoom()) { - element.addNode(boost::make_shared("room", "", *payload->getRoom())); + element.addNode(std::make_shared("room", "", *payload->getRoom())); } if (payload->getCountry()) { - element.addNode(boost::make_shared("country", "", *payload->getCountry())); + element.addNode(std::make_shared("country", "", *payload->getCountry())); } if (payload->getRegion()) { - element.addNode(boost::make_shared("region", "", *payload->getRegion())); + element.addNode(std::make_shared("region", "", *payload->getRegion())); } if (payload->getURI()) { - element.addNode(boost::make_shared("uri", "", *payload->getURI())); + element.addNode(std::make_shared("uri", "", *payload->getURI())); } if (payload->getLongitude()) { - element.addNode(boost::make_shared("lon", "", boost::lexical_cast(*payload->getLongitude()))); + element.addNode(std::make_shared("lon", "", boost::lexical_cast(*payload->getLongitude()))); } if (payload->getError()) { - element.addNode(boost::make_shared("error", "", boost::lexical_cast(*payload->getError()))); + element.addNode(std::make_shared("error", "", boost::lexical_cast(*payload->getError()))); } if (payload->getPostalCode()) { - element.addNode(boost::make_shared("postalcode", "", *payload->getPostalCode())); + element.addNode(std::make_shared("postalcode", "", *payload->getPostalCode())); } if (payload->getBearing()) { - element.addNode(boost::make_shared("bearing", "", boost::lexical_cast(*payload->getBearing()))); + element.addNode(std::make_shared("bearing", "", boost::lexical_cast(*payload->getBearing()))); } if (payload->getText()) { - element.addNode(boost::make_shared("text", "", *payload->getText())); + element.addNode(std::make_shared("text", "", *payload->getText())); } if (payload->getDatum()) { - element.addNode(boost::make_shared("datum", "", *payload->getDatum())); + element.addNode(std::make_shared("datum", "", *payload->getDatum())); } if (payload->getStreet()) { - element.addNode(boost::make_shared("street", "", *payload->getStreet())); + element.addNode(std::make_shared("street", "", *payload->getStreet())); } if (payload->getSpeed()) { - element.addNode(boost::make_shared("speed", "", boost::lexical_cast(*payload->getSpeed()))); + element.addNode(std::make_shared("speed", "", boost::lexical_cast(*payload->getSpeed()))); } return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.h b/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.h index 4b17628..a7ed772 100644 --- a/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { UserLocationSerializer(PayloadSerializerCollection* serializers); virtual ~UserLocationSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp b/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp index eeab2b7..bbae0a3 100644 --- a/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include @@ -22,31 +22,31 @@ UserTuneSerializer::UserTuneSerializer(PayloadSerializerCollection* serializers) UserTuneSerializer::~UserTuneSerializer() { } -std::string UserTuneSerializer::serializePayload(boost::shared_ptr payload) const { +std::string UserTuneSerializer::serializePayload(std::shared_ptr payload) const { if (!payload) { return ""; } XMLElement element("tune", "http://jabber.org/protocol/tune"); if (payload->getRating()) { - element.addNode(boost::make_shared("rating", "", boost::lexical_cast(*payload->getRating()))); + element.addNode(std::make_shared("rating", "", boost::lexical_cast(*payload->getRating()))); } if (payload->getTitle()) { - element.addNode(boost::make_shared("title", "", *payload->getTitle())); + element.addNode(std::make_shared("title", "", *payload->getTitle())); } if (payload->getTrack()) { - element.addNode(boost::make_shared("track", "", *payload->getTrack())); + element.addNode(std::make_shared("track", "", *payload->getTrack())); } if (payload->getArtist()) { - element.addNode(boost::make_shared("artist", "", *payload->getArtist())); + element.addNode(std::make_shared("artist", "", *payload->getArtist())); } if (payload->getURI()) { - element.addNode(boost::make_shared("uri", "", *payload->getURI())); + element.addNode(std::make_shared("uri", "", *payload->getURI())); } if (payload->getSource()) { - element.addNode(boost::make_shared("source", "", *payload->getSource())); + element.addNode(std::make_shared("source", "", *payload->getSource())); } if (payload->getLength()) { - element.addNode(boost::make_shared("length", "", boost::lexical_cast(*payload->getLength()))); + element.addNode(std::make_shared("length", "", boost::lexical_cast(*payload->getLength()))); } return element.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.h b/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.h index 1d3c76b..565bd71 100644 --- a/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { UserTuneSerializer(PayloadSerializerCollection* serializers); virtual ~UserTuneSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const SWIFTEN_OVERRIDE; + virtual std::string serializePayload(std::shared_ptr) const SWIFTEN_OVERRIDE; private: diff --git a/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp b/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp index 98597e4..a1393cb 100644 --- a/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp @@ -6,8 +6,7 @@ #include -#include -#include +#include #include #include @@ -21,229 +20,229 @@ namespace Swift { VCardSerializer::VCardSerializer() : GenericPayloadSerializer() { } -std::string VCardSerializer::serializePayload(boost::shared_ptr vcard) const { +std::string VCardSerializer::serializePayload(std::shared_ptr vcard) const { XMLElement queryElement("vCard", "vcard-temp"); if (!vcard->getVersion().empty()) { - queryElement.addNode(boost::make_shared("VERSION", "", vcard->getVersion())); + queryElement.addNode(std::make_shared("VERSION", "", vcard->getVersion())); } if (!vcard->getFullName().empty()) { - queryElement.addNode(boost::make_shared("FN", "", vcard->getFullName())); + queryElement.addNode(std::make_shared("FN", "", vcard->getFullName())); } if (!vcard->getGivenName().empty() || !vcard->getFamilyName().empty() || !vcard->getMiddleName().empty() || !vcard->getPrefix().empty() || !vcard->getSuffix().empty()) { - boost::shared_ptr nameElement(new XMLElement("N")); + std::shared_ptr nameElement(new XMLElement("N")); if (!vcard->getFamilyName().empty()) { - nameElement->addNode(boost::make_shared("FAMILY", "", vcard->getFamilyName())); + nameElement->addNode(std::make_shared("FAMILY", "", vcard->getFamilyName())); } if (!vcard->getGivenName().empty()) { - nameElement->addNode(boost::make_shared("GIVEN", "", vcard->getGivenName())); + nameElement->addNode(std::make_shared("GIVEN", "", vcard->getGivenName())); } if (!vcard->getMiddleName().empty()) { - nameElement->addNode(boost::make_shared("MIDDLE", "", vcard->getMiddleName())); + nameElement->addNode(std::make_shared("MIDDLE", "", vcard->getMiddleName())); } if (!vcard->getPrefix().empty()) { - nameElement->addNode(boost::make_shared("PREFIX", "", vcard->getPrefix())); + nameElement->addNode(std::make_shared("PREFIX", "", vcard->getPrefix())); } if (!vcard->getSuffix().empty()) { - nameElement->addNode(boost::make_shared("SUFFIX", "", vcard->getSuffix())); + nameElement->addNode(std::make_shared("SUFFIX", "", vcard->getSuffix())); } queryElement.addNode(nameElement); } foreach(const VCard::EMailAddress& emailAddress, vcard->getEMailAddresses()) { - boost::shared_ptr emailElement(new XMLElement("EMAIL")); - emailElement->addNode(boost::make_shared("USERID", "", emailAddress.address)); + std::shared_ptr emailElement(new XMLElement("EMAIL")); + emailElement->addNode(std::make_shared("USERID", "", emailAddress.address)); if (emailAddress.isHome) { - emailElement->addNode(boost::make_shared("HOME")); + emailElement->addNode(std::make_shared("HOME")); } if (emailAddress.isWork) { - emailElement->addNode(boost::make_shared("WORK")); + emailElement->addNode(std::make_shared("WORK")); } if (emailAddress.isInternet) { - emailElement->addNode(boost::make_shared("INTERNET")); + emailElement->addNode(std::make_shared("INTERNET")); } if (emailAddress.isPreferred) { - emailElement->addNode(boost::make_shared("PREF")); + emailElement->addNode(std::make_shared("PREF")); } if (emailAddress.isX400) { - emailElement->addNode(boost::make_shared("X400")); + emailElement->addNode(std::make_shared("X400")); } queryElement.addNode(emailElement); } if (!vcard->getNickname().empty()) { - queryElement.addNode(boost::make_shared("NICKNAME", "", vcard->getNickname())); + queryElement.addNode(std::make_shared("NICKNAME", "", vcard->getNickname())); } if (!vcard->getPhoto().empty() || !vcard->getPhotoType().empty()) { XMLElement::ref photoElement(new XMLElement("PHOTO")); if (!vcard->getPhotoType().empty()) { - photoElement->addNode(boost::make_shared("TYPE", "", vcard->getPhotoType())); + photoElement->addNode(std::make_shared("TYPE", "", vcard->getPhotoType())); } if (!vcard->getPhoto().empty()) { - photoElement->addNode(boost::make_shared("BINVAL", "", Base64::encode(vcard->getPhoto()))); + photoElement->addNode(std::make_shared("BINVAL", "", Base64::encode(vcard->getPhoto()))); } queryElement.addNode(photoElement); } if (!vcard->getBirthday().is_not_a_date_time()) { - queryElement.addNode(boost::make_shared("BDAY", "", dateTimeToString(vcard->getBirthday()))); + queryElement.addNode(std::make_shared("BDAY", "", dateTimeToString(vcard->getBirthday()))); } foreach(const VCard::Telephone& telephone, vcard->getTelephones()) { - boost::shared_ptr telElement(new XMLElement("TEL")); - telElement->addNode(boost::make_shared("NUMBER", "", telephone.number)); + std::shared_ptr telElement(new XMLElement("TEL")); + telElement->addNode(std::make_shared("NUMBER", "", telephone.number)); if (telephone.isHome) { - telElement->addNode(boost::make_shared("HOME")); + telElement->addNode(std::make_shared("HOME")); } if (telephone.isWork) { - telElement->addNode(boost::make_shared("WORK")); + telElement->addNode(std::make_shared("WORK")); } if (telephone.isVoice) { - telElement->addNode(boost::make_shared("VOICE")); + telElement->addNode(std::make_shared("VOICE")); } if (telephone.isFax) { - telElement->addNode(boost::make_shared("FAX")); + telElement->addNode(std::make_shared("FAX")); } if (telephone.isPager) { - telElement->addNode(boost::make_shared("PAGER")); + telElement->addNode(std::make_shared("PAGER")); } if (telephone.isMSG) { - telElement->addNode(boost::make_shared("MSG")); + telElement->addNode(std::make_shared("MSG")); } if (telephone.isCell) { - telElement->addNode(boost::make_shared("CELL")); + telElement->addNode(std::make_shared("CELL")); } if (telephone.isVideo) { - telElement->addNode(boost::make_shared("VIDEO")); + telElement->addNode(std::make_shared("VIDEO")); } if (telephone.isBBS) { - telElement->addNode(boost::make_shared("BBS")); + telElement->addNode(std::make_shared("BBS")); } if (telephone.isModem) { - telElement->addNode(boost::make_shared("MODEM")); + telElement->addNode(std::make_shared("MODEM")); } if (telephone.isISDN) { - telElement->addNode(boost::make_shared("ISDN")); + telElement->addNode(std::make_shared("ISDN")); } if (telephone.isPCS) { - telElement->addNode(boost::make_shared("PCS")); + telElement->addNode(std::make_shared("PCS")); } if (telephone.isPreferred) { - telElement->addNode(boost::make_shared("PREF")); + telElement->addNode(std::make_shared("PREF")); } queryElement.addNode(telElement); } foreach(const VCard::Address& address, vcard->getAddresses()) { - boost::shared_ptr adrElement = boost::make_shared("ADR"); + std::shared_ptr adrElement = std::make_shared("ADR"); if (!address.poBox.empty()) { - adrElement->addNode(boost::make_shared("POBOX", "", address.poBox)); + adrElement->addNode(std::make_shared("POBOX", "", address.poBox)); } if (!address.addressExtension.empty()) { - adrElement->addNode(boost::make_shared("EXTADD", "", address.addressExtension)); + adrElement->addNode(std::make_shared("EXTADD", "", address.addressExtension)); } if (!address.street.empty()) { - adrElement->addNode(boost::make_shared("STREET", "", address.street)); + adrElement->addNode(std::make_shared("STREET", "", address.street)); } if (!address.locality.empty()) { - adrElement->addNode(boost::make_shared("LOCALITY", "", address.locality)); + adrElement->addNode(std::make_shared("LOCALITY", "", address.locality)); } if (!address.region.empty()) { - adrElement->addNode(boost::make_shared("REGION", "", address.region)); + adrElement->addNode(std::make_shared("REGION", "", address.region)); } if (!address.postalCode.empty()) { - adrElement->addNode(boost::make_shared("PCODE", "", address.postalCode)); + adrElement->addNode(std::make_shared("PCODE", "", address.postalCode)); } if (!address.country.empty()) { - adrElement->addNode(boost::make_shared("CTRY", "", address.country)); + adrElement->addNode(std::make_shared("CTRY", "", address.country)); } if (address.isHome) { - adrElement->addNode(boost::make_shared("HOME")); + adrElement->addNode(std::make_shared("HOME")); } if (address.isWork) { - adrElement->addNode(boost::make_shared("WORK")); + adrElement->addNode(std::make_shared("WORK")); } if (address.isPostal) { - adrElement->addNode(boost::make_shared("POSTAL")); + adrElement->addNode(std::make_shared("POSTAL")); } if (address.isParcel) { - adrElement->addNode(boost::make_shared("PARCEL")); + adrElement->addNode(std::make_shared("PARCEL")); } if (address.deliveryType == VCard::DomesticDelivery) { - adrElement->addNode(boost::make_shared("DOM")); + adrElement->addNode(std::make_shared("DOM")); } if (address.deliveryType == VCard::InternationalDelivery) { - adrElement->addNode(boost::make_shared("INTL")); + adrElement->addNode(std::make_shared("INTL")); } if (address.isPreferred) { - adrElement->addNode(boost::make_shared("PREF")); + adrElement->addNode(std::make_shared("PREF")); } queryElement.addNode(adrElement); } foreach(const VCard::AddressLabel& addressLabel, vcard->getAddressLabels()) { - boost::shared_ptr labelElement = boost::make_shared("LABEL"); + std::shared_ptr labelElement = std::make_shared("LABEL"); foreach(const std::string& line, addressLabel.lines) { - labelElement->addNode(boost::make_shared("LINE", "", line)); + labelElement->addNode(std::make_shared("LINE", "", line)); } if (addressLabel.isHome) { - labelElement->addNode(boost::make_shared("HOME")); + labelElement->addNode(std::make_shared("HOME")); } if (addressLabel.isWork) { - labelElement->addNode(boost::make_shared("WORK")); + labelElement->addNode(std::make_shared("WORK")); } if (addressLabel.isPostal) { - labelElement->addNode(boost::make_shared("POSTAL")); + labelElement->addNode(std::make_shared("POSTAL")); } if (addressLabel.isParcel) { - labelElement->addNode(boost::make_shared("PARCEL")); + labelElement->addNode(std::make_shared("PARCEL")); } if (addressLabel.deliveryType == VCard::DomesticDelivery) { - labelElement->addNode(boost::make_shared("DOM")); + labelElement->addNode(std::make_shared("DOM")); } if (addressLabel.deliveryType == VCard::InternationalDelivery) { - labelElement->addNode(boost::make_shared("INTL")); + labelElement->addNode(std::make_shared("INTL")); } if (addressLabel.isPreferred) { - labelElement->addNode(boost::make_shared("PREF")); + labelElement->addNode(std::make_shared("PREF")); } queryElement.addNode(labelElement); } foreach(const JID& jid, vcard->getJIDs()) { - queryElement.addNode(boost::make_shared("JID", "", jid.toString())); + queryElement.addNode(std::make_shared("JID", "", jid.toString())); } if (!vcard->getDescription().empty()) { - queryElement.addNode(boost::make_shared("DESC", "", vcard->getDescription())); + queryElement.addNode(std::make_shared("DESC", "", vcard->getDescription())); } foreach(const VCard::Organization& org, vcard->getOrganizations()) { - boost::shared_ptr orgElement = boost::make_shared("ORG"); + std::shared_ptr orgElement = std::make_shared("ORG"); if (!org.name.empty()) { - orgElement->addNode(boost::make_shared("ORGNAME", "", org.name)); + orgElement->addNode(std::make_shared("ORGNAME", "", org.name)); } if (!org.units.empty()) { foreach(const std::string& unit, org.units) { - orgElement->addNode(boost::make_shared("ORGUNIT", "", unit)); + orgElement->addNode(std::make_shared("ORGUNIT", "", unit)); } } queryElement.addNode(orgElement); } foreach(const std::string& title, vcard->getTitles()) { - queryElement.addNode(boost::make_shared("TITLE", "", title)); + queryElement.addNode(std::make_shared("TITLE", "", title)); } foreach(const std::string& role, vcard->getRoles()) { - queryElement.addNode(boost::make_shared("ROLE", "", role)); + queryElement.addNode(std::make_shared("ROLE", "", role)); } foreach(const std::string& url, vcard->getURLs()) { - queryElement.addNode(boost::make_shared("URL", "", url)); + queryElement.addNode(std::make_shared("URL", "", url)); } if (!vcard->getUnknownContent().empty()) { - queryElement.addNode(boost::make_shared(vcard->getUnknownContent())); + queryElement.addNode(std::make_shared(vcard->getUnknownContent())); } return queryElement.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/VCardSerializer.h b/Swiften/Serializer/PayloadSerializers/VCardSerializer.h index e84252d..ad83f9a 100644 --- a/Swiften/Serializer/PayloadSerializers/VCardSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/VCardSerializer.h @@ -15,6 +15,6 @@ namespace Swift { public: VCardSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.cpp b/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.cpp index 8fb1e3f..607cf72 100644 --- a/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.cpp @@ -1,13 +1,12 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include -#include +#include #include #include @@ -17,10 +16,10 @@ namespace Swift { VCardUpdateSerializer::VCardUpdateSerializer() : GenericPayloadSerializer() { } -std::string VCardUpdateSerializer::serializePayload(boost::shared_ptr vcardUpdate) const { +std::string VCardUpdateSerializer::serializePayload(std::shared_ptr vcardUpdate) const { XMLElement updateElement("x", "vcard-temp:x:update"); - boost::shared_ptr photoElement(new XMLElement("photo")); - photoElement->addNode(boost::make_shared(vcardUpdate->getPhotoHash())); + std::shared_ptr photoElement(new XMLElement("photo")); + photoElement->addNode(std::make_shared(vcardUpdate->getPhotoHash())); updateElement.addNode(photoElement); return updateElement.serialize(); } diff --git a/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h b/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h index 777da3e..cea8ebd 100644 --- a/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h @@ -15,6 +15,6 @@ namespace Swift { public: VCardUpdateSerializer(); - virtual std::string serializePayload(boost::shared_ptr) const; + virtual std::string serializePayload(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp index 27d3f57..5aebca3 100644 --- a/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp @@ -13,9 +13,9 @@ #include #include +#include #include -#include #include #include @@ -24,7 +24,7 @@ namespace Swift { void WhiteboardElementSerializingVisitor::visit(WhiteboardLineElement& line) { - element = boost::make_shared("line"); + element = std::make_shared("line"); try { element->setAttribute("x1", boost::lexical_cast(line.x1())); element->setAttribute("y1", boost::lexical_cast(line.y1())); @@ -39,7 +39,7 @@ namespace Swift { } void WhiteboardElementSerializingVisitor::visit(WhiteboardFreehandPathElement& path) { - element = boost::make_shared("path"); + element = std::make_shared("path"); element->setAttribute("id", path.getID()); element->setAttribute("stroke", path.getColor().toHex()); try { @@ -59,7 +59,7 @@ namespace Swift { } void WhiteboardElementSerializingVisitor::visit(WhiteboardRectElement& rect) { - element = boost::make_shared("rect"); + element = std::make_shared("rect"); try { element->setAttribute("x", boost::lexical_cast(rect.getX())); element->setAttribute("y", boost::lexical_cast(rect.getY())); @@ -76,7 +76,7 @@ namespace Swift { } void WhiteboardElementSerializingVisitor::visit(WhiteboardPolygonElement& polygon) { - element = boost::make_shared("polygon"); + element = std::make_shared("polygon"); try { element->setAttribute("id", polygon.getID()); element->setAttribute("stroke", polygon.getPenColor().toHex()); @@ -95,7 +95,7 @@ namespace Swift { } void WhiteboardElementSerializingVisitor::visit(WhiteboardTextElement& text) { - element = boost::make_shared("text"); + element = std::make_shared("text"); try { element->setAttribute("x", boost::lexical_cast(text.getX())); element->setAttribute("y", boost::lexical_cast(text.getY())); @@ -103,13 +103,13 @@ namespace Swift { element->setAttribute("id", text.getID()); element->setAttribute("fill", text.getColor().toHex()); element->setAttribute("opacity", alphaToOpacity(text.getColor().getAlpha())); - element->addNode(boost::make_shared(text.getText())); + element->addNode(std::make_shared(text.getText())); } catch (boost::bad_lexical_cast&) { } } void WhiteboardElementSerializingVisitor::visit(WhiteboardEllipseElement& ellipse) { - element = boost::make_shared("ellipse"); + element = std::make_shared("ellipse"); try { element->setAttribute("cx", boost::lexical_cast(ellipse.getCX())); element->setAttribute("cy", boost::lexical_cast(ellipse.getCY())); @@ -138,13 +138,13 @@ namespace Swift { } } - std::string WhiteboardSerializer::serializePayload(boost::shared_ptr payload) const { + std::string WhiteboardSerializer::serializePayload(std::shared_ptr payload) const { XMLElement element("wb", "http://swift.im/whiteboard"); if (payload->getType() == WhiteboardPayload::Data) { - XMLElement::ref operationNode = boost::make_shared("operation"); + XMLElement::ref operationNode = std::make_shared("operation"); WhiteboardElementSerializingVisitor visitor; // payload->getElement()->accept(visitor); - WhiteboardInsertOperation::ref insertOp = boost::dynamic_pointer_cast(payload->getOperation()); + WhiteboardInsertOperation::ref insertOp = std::dynamic_pointer_cast(payload->getOperation()); if (insertOp) { try { operationNode->setAttribute("type", "insert"); @@ -156,7 +156,7 @@ namespace Swift { insertOp->getElement()->accept(visitor); operationNode->addNode(visitor.getResult()); } - WhiteboardUpdateOperation::ref updateOp = boost::dynamic_pointer_cast(payload->getOperation()); + WhiteboardUpdateOperation::ref updateOp = std::dynamic_pointer_cast(payload->getOperation()); if (updateOp) { try { operationNode->setAttribute("type", "update"); @@ -171,7 +171,7 @@ namespace Swift { } - WhiteboardDeleteOperation::ref deleteOp = boost::dynamic_pointer_cast(payload->getOperation()); + WhiteboardDeleteOperation::ref deleteOp = std::dynamic_pointer_cast(payload->getOperation()); if (deleteOp) { try { operationNode->setAttribute("type", "delete"); diff --git a/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h index 70aef1e..1fde636 100644 --- a/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h @@ -43,7 +43,7 @@ namespace Swift { class SWIFTEN_API WhiteboardSerializer : public GenericPayloadSerializer { public: - std::string serializePayload(boost::shared_ptr payload) const; + std::string serializePayload(std::shared_ptr payload) const; private: std::string typeToString(WhiteboardPayload::Type type) const; diff --git a/Swiften/Serializer/PresenceSerializer.cpp b/Swiften/Serializer/PresenceSerializer.cpp index 24c4365..fc398a4 100644 --- a/Swiften/Serializer/PresenceSerializer.cpp +++ b/Swiften/Serializer/PresenceSerializer.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include #include @@ -19,7 +19,7 @@ PresenceSerializer::PresenceSerializer(PayloadSerializerCollection* payloadSeria } void PresenceSerializer::setStanzaSpecificAttributesGeneric( - boost::shared_ptr presence, + std::shared_ptr presence, XMLElement& element) const { switch (presence->getType()) { case Presence::Unavailable: element.setAttribute("type","unavailable"); break; diff --git a/Swiften/Serializer/PresenceSerializer.h b/Swiften/Serializer/PresenceSerializer.h index e40b9c2..b0e1a4f 100644 --- a/Swiften/Serializer/PresenceSerializer.h +++ b/Swiften/Serializer/PresenceSerializer.h @@ -20,7 +20,7 @@ namespace Swift { private: virtual void setStanzaSpecificAttributesGeneric( - boost::shared_ptr presence, + std::shared_ptr presence, XMLElement& element) const; }; } diff --git a/Swiften/Serializer/StanzaAckRequestSerializer.h b/Swiften/Serializer/StanzaAckRequestSerializer.h index b178db1..f738231 100644 --- a/Swiften/Serializer/StanzaAckRequestSerializer.h +++ b/Swiften/Serializer/StanzaAckRequestSerializer.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 +#include #include #include @@ -19,7 +19,7 @@ namespace Swift { StanzaAckRequestSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(std::shared_ptr) const { return createSafeByteArray(XMLElement("r", "urn:xmpp:sm:2").serialize()); } }; diff --git a/Swiften/Serializer/StanzaAckSerializer.h b/Swiften/Serializer/StanzaAckSerializer.h index 7ca6ab8..f5a27dc 100644 --- a/Swiften/Serializer/StanzaAckSerializer.h +++ b/Swiften/Serializer/StanzaAckSerializer.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include #include @@ -20,8 +21,8 @@ namespace Swift { StanzaAckSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr element) const { - StanzaAck::ref stanzaAck(boost::dynamic_pointer_cast(element)); + virtual SafeByteArray serialize(std::shared_ptr element) const { + StanzaAck::ref stanzaAck(std::dynamic_pointer_cast(element)); assert(stanzaAck->isValid()); XMLElement result("a", "urn:xmpp:sm:2"); result.setAttribute("h", std::string(boost::lexical_cast(stanzaAck->getHandledStanzasCount()))); diff --git a/Swiften/Serializer/StanzaSerializer.cpp b/Swiften/Serializer/StanzaSerializer.cpp index 002f2c3..de1e8f1 100644 --- a/Swiften/Serializer/StanzaSerializer.cpp +++ b/Swiften/Serializer/StanzaSerializer.cpp @@ -22,7 +22,7 @@ namespace Swift { StanzaSerializer::StanzaSerializer(const std::string& tag, PayloadSerializerCollection* payloadSerializers, const boost::optional& explicitNS) : tag_(tag), payloadSerializers_(payloadSerializers), explicitDefaultNS_(explicitNS) { } -SafeByteArray StanzaSerializer::serialize(boost::shared_ptr element) const { +SafeByteArray StanzaSerializer::serialize(std::shared_ptr element) const { if (explicitDefaultNS_) { return serialize(element, explicitDefaultNS_.get()); } @@ -31,8 +31,8 @@ SafeByteArray StanzaSerializer::serialize(boost::shared_ptr ele } } -SafeByteArray StanzaSerializer::serialize(boost::shared_ptr element, const std::string& xmlns) const { - boost::shared_ptr stanza(boost::dynamic_pointer_cast(element)); +SafeByteArray StanzaSerializer::serialize(std::shared_ptr element, const std::string& xmlns) const { + std::shared_ptr stanza(std::dynamic_pointer_cast(element)); XMLElement stanzaElement(tag_, explicitDefaultNS_ ? explicitDefaultNS_.get() : xmlns); if (stanza->getFrom().isValid()) { @@ -47,7 +47,7 @@ SafeByteArray StanzaSerializer::serialize(boost::shared_ptr ele setStanzaSpecificAttributes(stanza, stanzaElement); std::string serializedPayloads; - foreach (const boost::shared_ptr& payload, stanza->getPayloads()) { + foreach (const std::shared_ptr& payload, stanza->getPayloads()) { PayloadSerializer* serializer = payloadSerializers_->getPayloadSerializer(payload); if (serializer) { serializedPayloads += serializer->serialize(payload); @@ -57,7 +57,7 @@ SafeByteArray StanzaSerializer::serialize(boost::shared_ptr ele } } if (!serializedPayloads.empty()) { - stanzaElement.addNode(boost::shared_ptr(new XMLRawTextNode(serializedPayloads))); + stanzaElement.addNode(std::make_shared(serializedPayloads)); } return createSafeByteArray(stanzaElement.serialize()); diff --git a/Swiften/Serializer/StanzaSerializer.h b/Swiften/Serializer/StanzaSerializer.h index 34aab9e..b2e051c 100644 --- a/Swiften/Serializer/StanzaSerializer.h +++ b/Swiften/Serializer/StanzaSerializer.h @@ -22,9 +22,9 @@ namespace Swift { public: StanzaSerializer(const std::string& tag, PayloadSerializerCollection* payloadSerializers, const boost::optional& explicitNS = boost::optional()); - virtual SafeByteArray serialize(boost::shared_ptr element) const; - virtual SafeByteArray serialize(boost::shared_ptr element, const std::string& xmlns) const; - virtual void setStanzaSpecificAttributes(boost::shared_ptr, XMLElement&) const = 0; + virtual SafeByteArray serialize(std::shared_ptr element) const; + virtual SafeByteArray serialize(std::shared_ptr element, const std::string& xmlns) const; + virtual void setStanzaSpecificAttributes(std::shared_ptr, XMLElement&) const = 0; private: std::string tag_; diff --git a/Swiften/Serializer/StartTLSFailureSerializer.h b/Swiften/Serializer/StartTLSFailureSerializer.h index f7f7296..77f904c 100644 --- a/Swiften/Serializer/StartTLSFailureSerializer.h +++ b/Swiften/Serializer/StartTLSFailureSerializer.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 +#include #include #include @@ -19,7 +19,7 @@ namespace Swift { StartTLSFailureSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(std::shared_ptr) const { return createSafeByteArray(XMLElement("failure", "urn:ietf:params:xml:ns:xmpp-tls").serialize()); } }; diff --git a/Swiften/Serializer/StartTLSRequestSerializer.h b/Swiften/Serializer/StartTLSRequestSerializer.h index cc8e3d5..ee2a76f 100644 --- a/Swiften/Serializer/StartTLSRequestSerializer.h +++ b/Swiften/Serializer/StartTLSRequestSerializer.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 +#include #include #include @@ -19,7 +19,7 @@ namespace Swift { StartTLSRequestSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(std::shared_ptr) const { return createSafeByteArray(XMLElement("starttls", "urn:ietf:params:xml:ns:xmpp-tls").serialize()); } }; diff --git a/Swiften/Serializer/StreamErrorSerializer.cpp b/Swiften/Serializer/StreamErrorSerializer.cpp index 3cad478..66a71ca 100644 --- a/Swiften/Serializer/StreamErrorSerializer.cpp +++ b/Swiften/Serializer/StreamErrorSerializer.cpp @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include +#include #include @@ -15,8 +15,8 @@ namespace Swift { StreamErrorSerializer::StreamErrorSerializer() : GenericElementSerializer() { } -SafeByteArray StreamErrorSerializer::serialize(boost::shared_ptr element) const { - StreamError::ref error = boost::dynamic_pointer_cast(element); +SafeByteArray StreamErrorSerializer::serialize(std::shared_ptr element) const { + StreamError::ref error = std::dynamic_pointer_cast(element); XMLElement errorElement("error", "http://etherx.jabber.org/streams"); std::string typeTag; @@ -47,10 +47,10 @@ SafeByteArray StreamErrorSerializer::serialize(boost::shared_ptr(typeTag, "urn:ietf:params:xml:ns:xmpp-streams")); + errorElement.addNode(std::make_shared(typeTag, "urn:ietf:params:xml:ns:xmpp-streams")); if (!error->getText().empty()) { - errorElement.addNode(boost::make_shared("text", "urn:ietf:params:xml:ns:xmpp-streams", error->getText())); + errorElement.addNode(std::make_shared("text", "urn:ietf:params:xml:ns:xmpp-streams", error->getText())); } return createSafeByteArray(errorElement.serialize()); diff --git a/Swiften/Serializer/StreamErrorSerializer.h b/Swiften/Serializer/StreamErrorSerializer.h index f578005..7277903 100644 --- a/Swiften/Serializer/StreamErrorSerializer.h +++ b/Swiften/Serializer/StreamErrorSerializer.h @@ -15,6 +15,6 @@ namespace Swift { public: StreamErrorSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr error) const; + virtual SafeByteArray serialize(std::shared_ptr error) const; }; } diff --git a/Swiften/Serializer/StreamFeaturesSerializer.cpp b/Swiften/Serializer/StreamFeaturesSerializer.cpp index ed042ec..820b96c 100644 --- a/Swiften/Serializer/StreamFeaturesSerializer.cpp +++ b/Swiften/Serializer/StreamFeaturesSerializer.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include #include @@ -17,42 +17,42 @@ namespace Swift { StreamFeaturesSerializer::StreamFeaturesSerializer() { } -SafeByteArray StreamFeaturesSerializer::serialize(boost::shared_ptr element) const { - boost::shared_ptr streamFeatures(boost::dynamic_pointer_cast(element)); +SafeByteArray StreamFeaturesSerializer::serialize(std::shared_ptr element) const { + std::shared_ptr streamFeatures(std::dynamic_pointer_cast(element)); XMLElement streamFeaturesElement("stream:features"); if (streamFeatures->hasStartTLS()) { - streamFeaturesElement.addNode(boost::make_shared("starttls", "urn:ietf:params:xml:ns:xmpp-tls")); + streamFeaturesElement.addNode(std::make_shared("starttls", "urn:ietf:params:xml:ns:xmpp-tls")); } if (!streamFeatures->getCompressionMethods().empty()) { - boost::shared_ptr compressionElement(new XMLElement("compression", "http://jabber.org/features/compress")); + std::shared_ptr compressionElement(new XMLElement("compression", "http://jabber.org/features/compress")); foreach(const std::string& method, streamFeatures->getCompressionMethods()) { - boost::shared_ptr methodElement(new XMLElement("method")); - methodElement->addNode(boost::make_shared(method)); + std::shared_ptr methodElement(new XMLElement("method")); + methodElement->addNode(std::make_shared(method)); compressionElement->addNode(methodElement); } streamFeaturesElement.addNode(compressionElement); } if (!streamFeatures->getAuthenticationMechanisms().empty()) { - boost::shared_ptr mechanismsElement(new XMLElement("mechanisms", "urn:ietf:params:xml:ns:xmpp-sasl")); + std::shared_ptr mechanismsElement(new XMLElement("mechanisms", "urn:ietf:params:xml:ns:xmpp-sasl")); foreach(const std::string& mechanism, streamFeatures->getAuthenticationMechanisms()) { - boost::shared_ptr mechanismElement(new XMLElement("mechanism")); - mechanismElement->addNode(boost::make_shared(mechanism)); + std::shared_ptr mechanismElement(new XMLElement("mechanism")); + mechanismElement->addNode(std::make_shared(mechanism)); mechanismsElement->addNode(mechanismElement); } streamFeaturesElement.addNode(mechanismsElement); } if (streamFeatures->hasResourceBind()) { - streamFeaturesElement.addNode(boost::make_shared("bind", "urn:ietf:params:xml:ns:xmpp-bind")); + streamFeaturesElement.addNode(std::make_shared("bind", "urn:ietf:params:xml:ns:xmpp-bind")); } if (streamFeatures->hasSession()) { - streamFeaturesElement.addNode(boost::make_shared("session", "urn:ietf:params:xml:ns:xmpp-session")); + streamFeaturesElement.addNode(std::make_shared("session", "urn:ietf:params:xml:ns:xmpp-session")); } if (streamFeatures->hasStreamManagement()) { - streamFeaturesElement.addNode(boost::make_shared("sm", "urn:xmpp:sm:2")); + streamFeaturesElement.addNode(std::make_shared("sm", "urn:xmpp:sm:2")); } if (streamFeatures->hasRosterVersioning()) { - streamFeaturesElement.addNode(boost::make_shared("ver", "urn:xmpp:features:rosterver")); + streamFeaturesElement.addNode(std::make_shared("ver", "urn:xmpp:features:rosterver")); } return createSafeByteArray(streamFeaturesElement.serialize()); } diff --git a/Swiften/Serializer/StreamFeaturesSerializer.h b/Swiften/Serializer/StreamFeaturesSerializer.h index f2328a5..b1cc2f7 100644 --- a/Swiften/Serializer/StreamFeaturesSerializer.h +++ b/Swiften/Serializer/StreamFeaturesSerializer.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -17,6 +17,6 @@ namespace Swift { public: StreamFeaturesSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(std::shared_ptr element) const; }; } diff --git a/Swiften/Serializer/StreamManagementEnabledSerializer.cpp b/Swiften/Serializer/StreamManagementEnabledSerializer.cpp index b03196c..4f4ca2e 100644 --- a/Swiften/Serializer/StreamManagementEnabledSerializer.cpp +++ b/Swiften/Serializer/StreamManagementEnabledSerializer.cpp @@ -1,12 +1,12 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include -#include +#include #include #include @@ -16,8 +16,8 @@ using namespace Swift; StreamManagementEnabledSerializer::StreamManagementEnabledSerializer() : GenericElementSerializer() { } -SafeByteArray StreamManagementEnabledSerializer::serialize(boost::shared_ptr el) const { - boost::shared_ptr e(boost::dynamic_pointer_cast(el)); +SafeByteArray StreamManagementEnabledSerializer::serialize(std::shared_ptr el) const { + std::shared_ptr e(std::dynamic_pointer_cast(el)); XMLElement element("enabled", "urn:xmpp:sm:2"); if (!e->getResumeID().empty()) { element.setAttribute("id", e->getResumeID()); diff --git a/Swiften/Serializer/StreamManagementEnabledSerializer.h b/Swiften/Serializer/StreamManagementEnabledSerializer.h index 9ffe233..f139dc8 100644 --- a/Swiften/Serializer/StreamManagementEnabledSerializer.h +++ b/Swiften/Serializer/StreamManagementEnabledSerializer.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 +#include #include #include @@ -17,6 +17,6 @@ namespace Swift { public: StreamManagementEnabledSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr) const; + virtual SafeByteArray serialize(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/StreamManagementFailedSerializer.h b/Swiften/Serializer/StreamManagementFailedSerializer.h index b189bd8..29dd0ab 100644 --- a/Swiften/Serializer/StreamManagementFailedSerializer.h +++ b/Swiften/Serializer/StreamManagementFailedSerializer.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 +#include #include #include @@ -19,7 +19,7 @@ namespace Swift { StreamManagementFailedSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(std::shared_ptr) const { return createSafeByteArray(XMLElement("failed", "urn:xmpp:sm:2").serialize()); } }; diff --git a/Swiften/Serializer/StreamResumeSerializer.cpp b/Swiften/Serializer/StreamResumeSerializer.cpp index c660083..619ac9c 100644 --- a/Swiften/Serializer/StreamResumeSerializer.cpp +++ b/Swiften/Serializer/StreamResumeSerializer.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -17,8 +18,8 @@ using namespace Swift; StreamResumeSerializer::StreamResumeSerializer() : GenericElementSerializer() { } -SafeByteArray StreamResumeSerializer::serialize(boost::shared_ptr el) const { - boost::shared_ptr e(boost::dynamic_pointer_cast(el)); +SafeByteArray StreamResumeSerializer::serialize(std::shared_ptr el) const { + std::shared_ptr e(std::dynamic_pointer_cast(el)); XMLElement element("resume", "urn:xmpp:sm:2"); element.setAttribute("previd", e->getResumeID()); if (e->getHandledStanzasCount()) { diff --git a/Swiften/Serializer/StreamResumeSerializer.h b/Swiften/Serializer/StreamResumeSerializer.h index 5e7c58d..ad13b2b 100644 --- a/Swiften/Serializer/StreamResumeSerializer.h +++ b/Swiften/Serializer/StreamResumeSerializer.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -17,6 +17,6 @@ namespace Swift { public: StreamResumeSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr) const; + virtual SafeByteArray serialize(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/StreamResumedSerializer.cpp b/Swiften/Serializer/StreamResumedSerializer.cpp index 9778338..5b88ded 100644 --- a/Swiften/Serializer/StreamResumedSerializer.cpp +++ b/Swiften/Serializer/StreamResumedSerializer.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -17,8 +18,8 @@ using namespace Swift; StreamResumedSerializer::StreamResumedSerializer() : GenericElementSerializer() { } -SafeByteArray StreamResumedSerializer::serialize(boost::shared_ptr el) const { - boost::shared_ptr e(boost::dynamic_pointer_cast(el)); +SafeByteArray StreamResumedSerializer::serialize(std::shared_ptr el) const { + std::shared_ptr e(std::dynamic_pointer_cast(el)); XMLElement element("resumed", "urn:xmpp:sm:2"); element.setAttribute("previd", e->getResumeID()); if (e->getHandledStanzasCount()) { diff --git a/Swiften/Serializer/StreamResumedSerializer.h b/Swiften/Serializer/StreamResumedSerializer.h index 82a66d7..324282b 100644 --- a/Swiften/Serializer/StreamResumedSerializer.h +++ b/Swiften/Serializer/StreamResumedSerializer.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -17,6 +17,6 @@ namespace Swift { public: StreamResumedSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr) const; + virtual SafeByteArray serialize(std::shared_ptr) const; }; } diff --git a/Swiften/Serializer/TLSProceedSerializer.h b/Swiften/Serializer/TLSProceedSerializer.h index e9af0a2..f99aefd 100644 --- a/Swiften/Serializer/TLSProceedSerializer.h +++ b/Swiften/Serializer/TLSProceedSerializer.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 +#include #include #include @@ -19,7 +19,7 @@ namespace Swift { TLSProceedSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(std::shared_ptr) const { return createSafeByteArray(XMLElement("proceed", "urn:ietf:params:xml:ns:xmpp-tls").serialize()); } }; diff --git a/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp index 1d41e81..d313b42 100644 --- a/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp @@ -24,7 +24,7 @@ class AuthChallengeSerializerTest : public CppUnit::TestFixture { public: void testSerialize() { AuthChallengeSerializer testling; - boost::shared_ptr authChallenge(new AuthChallenge()); + std::shared_ptr authChallenge(new AuthChallenge()); authChallenge->setValue(createByteArray("foo")); CPPUNIT_ASSERT_EQUAL(createSafeByteArray( @@ -35,7 +35,7 @@ class AuthChallengeSerializerTest : public CppUnit::TestFixture { void testSerialize_NoMessage() { AuthChallengeSerializer testling; - boost::shared_ptr authChallenge(new AuthChallenge()); + std::shared_ptr authChallenge(new AuthChallenge()); CPPUNIT_ASSERT_EQUAL(createSafeByteArray( "" @@ -44,7 +44,7 @@ class AuthChallengeSerializerTest : public CppUnit::TestFixture { void testSerialize_EmptyMessage() { AuthChallengeSerializer testling; - boost::shared_ptr authChallenge(new AuthChallenge()); + std::shared_ptr authChallenge(new AuthChallenge()); authChallenge->setValue(std::vector()); CPPUNIT_ASSERT_EQUAL(createSafeByteArray( diff --git a/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp index 95460b2..2dc71fb 100644 --- a/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp @@ -24,7 +24,7 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture { public: void testSerialize() { AuthRequestSerializer testling; - boost::shared_ptr authRequest(new AuthRequest("PLAIN")); + std::shared_ptr authRequest(new AuthRequest("PLAIN")); authRequest->setMessage(createSafeByteArray("foo")); CPPUNIT_ASSERT_EQUAL(createSafeByteArray( @@ -35,7 +35,7 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture { void testSerialize_NoMessage() { AuthRequestSerializer testling; - boost::shared_ptr authRequest(new AuthRequest("PLAIN")); + std::shared_ptr authRequest(new AuthRequest("PLAIN")); CPPUNIT_ASSERT_EQUAL(createSafeByteArray( "" @@ -44,7 +44,7 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture { void testSerialize_EmptyMessage() { AuthRequestSerializer testling; - boost::shared_ptr authRequest(new AuthRequest("PLAIN")); + std::shared_ptr authRequest(new AuthRequest("PLAIN")); authRequest->setMessage(SafeByteArray()); CPPUNIT_ASSERT_EQUAL(createSafeByteArray( diff --git a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp index 67c6f16..1ee4b62 100644 --- a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp @@ -24,7 +24,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture { public: void testSerialize() { AuthResponseSerializer testling; - boost::shared_ptr authResponse(new AuthResponse()); + std::shared_ptr authResponse(new AuthResponse()); authResponse->setValue(createSafeByteArray("foo")); CPPUNIT_ASSERT_EQUAL(createSafeByteArray( @@ -35,7 +35,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture { void testSerialize_NoMessage() { AuthResponseSerializer testling; - boost::shared_ptr authResponse(new AuthResponse()); + std::shared_ptr authResponse(new AuthResponse()); CPPUNIT_ASSERT_EQUAL(createSafeByteArray( "" @@ -44,7 +44,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture { void testSerialize_EmptyMessage() { AuthResponseSerializer testling; - boost::shared_ptr authResponse(new AuthResponse()); + std::shared_ptr authResponse(new AuthResponse()); authResponse->setValue(SafeByteArray()); CPPUNIT_ASSERT_EQUAL(createSafeByteArray( diff --git a/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp index 228bd9b..3c4bb1b 100644 --- a/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp @@ -24,7 +24,7 @@ class AuthSuccessSerializerTest : public CppUnit::TestFixture { public: void testSerialize() { AuthSuccessSerializer testling; - boost::shared_ptr authSuccess(new AuthSuccess()); + std::shared_ptr authSuccess(new AuthSuccess()); authSuccess->setValue(createByteArray("foo")); CPPUNIT_ASSERT_EQUAL(createSafeByteArray( @@ -35,7 +35,7 @@ class AuthSuccessSerializerTest : public CppUnit::TestFixture { void testSerialize_NoMessage() { AuthSuccessSerializer testling; - boost::shared_ptr authSuccess(new AuthSuccess()); + std::shared_ptr authSuccess(new AuthSuccess()); CPPUNIT_ASSERT_EQUAL(createSafeByteArray( "" @@ -44,7 +44,7 @@ class AuthSuccessSerializerTest : public CppUnit::TestFixture { void testSerialize_EmptyMessage() { AuthSuccessSerializer testling; - boost::shared_ptr authSuccess(new AuthSuccess()); + std::shared_ptr authSuccess(new AuthSuccess()); authSuccess->setValue(std::vector()); CPPUNIT_ASSERT_EQUAL(createSafeByteArray( diff --git a/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp b/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp index 5f4f821..dd3d6c3 100644 --- a/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp @@ -24,7 +24,7 @@ class StreamFeaturesSerializerTest : public CppUnit::TestFixture void testSerialize() { StreamFeaturesSerializer testling; - boost::shared_ptr streamFeatures(new StreamFeatures()); + std::shared_ptr streamFeatures(new StreamFeatures()); streamFeatures->setHasStartTLS(); streamFeatures->addCompressionMethod("zlib"); streamFeatures->addCompressionMethod("lzw"); diff --git a/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp b/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp index 3eaeef0..93205fc 100644 --- a/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp +++ b/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp @@ -31,7 +31,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture { } void testSerializeHeader_Client() { - boost::shared_ptr testling(createSerializer(ClientStreamType)); + std::shared_ptr testling(createSerializer(ClientStreamType)); ProtocolHeader protocolHeader; protocolHeader.setFrom("bla@foo.com"); protocolHeader.setTo("foo.com"); @@ -42,7 +42,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture { } void testSerializeHeader_Component() { - boost::shared_ptr testling(createSerializer(ComponentStreamType)); + std::shared_ptr testling(createSerializer(ComponentStreamType)); ProtocolHeader protocolHeader; protocolHeader.setFrom("bla@foo.com"); protocolHeader.setTo("foo.com"); @@ -53,7 +53,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture { } void testSerializeHeader_Server() { - boost::shared_ptr testling(createSerializer(ServerStreamType)); + std::shared_ptr testling(createSerializer(ServerStreamType)); ProtocolHeader protocolHeader; protocolHeader.setFrom("bla@foo.com"); protocolHeader.setTo("foo.com"); diff --git a/Swiften/Serializer/XML/UnitTest/XMLElementTest.cpp b/Swiften/Serializer/XML/UnitTest/XMLElementTest.cpp index edd1b0e..ed3f8ab 100644 --- a/Swiften/Serializer/XML/UnitTest/XMLElementTest.cpp +++ b/Swiften/Serializer/XML/UnitTest/XMLElementTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -29,11 +29,11 @@ class XMLElementTest : public CppUnit::TestFixture void testSerialize() { XMLElement testling("foo", "http://example.com"); testling.setAttribute("myatt", "myval"); - boost::shared_ptr barElement(new XMLElement("bar")); - barElement->addNode(boost::make_shared("Blo")); + std::shared_ptr barElement(new XMLElement("bar")); + barElement->addNode(std::make_shared("Blo")); testling.addNode(barElement); - boost::shared_ptr bazElement(new XMLElement("baz")); - bazElement->addNode(boost::make_shared("Bli&")); + std::shared_ptr bazElement(new XMLElement("baz")); + bazElement->addNode(std::make_shared("Bli&")); testling.addNode(bazElement); std::string result = testling.serialize(); diff --git a/Swiften/Serializer/XML/XMLElement.cpp b/Swiften/Serializer/XML/XMLElement.cpp index fc5e470..4a874ab 100644 --- a/Swiften/Serializer/XML/XMLElement.cpp +++ b/Swiften/Serializer/XML/XMLElement.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -30,7 +30,7 @@ std::string XMLElement::serialize() { if (!childNodes_.empty()) { result += ">"; - foreach (boost::shared_ptr node, childNodes_) { + foreach (std::shared_ptr node, childNodes_) { result += node->serialize(); } result += ""; @@ -51,7 +51,7 @@ void XMLElement::setAttribute(const std::string& attribute, const std::string& v attributes_[attribute] = escapedValue; } -void XMLElement::addNode(boost::shared_ptr node) { +void XMLElement::addNode(std::shared_ptr node) { if (node) { childNodes_.push_back(node); } diff --git a/Swiften/Serializer/XML/XMLElement.h b/Swiften/Serializer/XML/XMLElement.h index e7507f2..54de041 100644 --- a/Swiften/Serializer/XML/XMLElement.h +++ b/Swiften/Serializer/XML/XMLElement.h @@ -7,29 +7,28 @@ #pragma once #include +#include #include #include -#include - #include #include namespace Swift { class SWIFTEN_API XMLElement : public XMLNode { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; XMLElement(const std::string& tag, const std::string& xmlns = "", const std::string& text = ""); void setAttribute(const std::string& attribute, const std::string& value); - void addNode(boost::shared_ptr node); + void addNode(std::shared_ptr node); virtual std::string serialize(); private: std::string tag_; std::map attributes_; - std::vector< boost::shared_ptr > childNodes_; + std::vector< std::shared_ptr > childNodes_; }; } diff --git a/Swiften/Serializer/XML/XMLTextNode.h b/Swiften/Serializer/XML/XMLTextNode.h index b0f8d01..44970bf 100644 --- a/Swiften/Serializer/XML/XMLTextNode.h +++ b/Swiften/Serializer/XML/XMLTextNode.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 +#include #include #include @@ -15,7 +15,7 @@ namespace Swift { class SWIFTEN_API XMLTextNode : public XMLNode { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; XMLTextNode(const std::string& text) : text_(text) { String::replaceAll(text_, '&', "&"); // Should come first diff --git a/Swiften/Serializer/XMPPSerializer.cpp b/Swiften/Serializer/XMPPSerializer.cpp index b17e31b..8b2fd5c 100644 --- a/Swiften/Serializer/XMPPSerializer.cpp +++ b/Swiften/Serializer/XMPPSerializer.cpp @@ -8,9 +8,9 @@ #include #include +#include #include -#include #include #include @@ -41,29 +41,29 @@ namespace Swift { XMPPSerializer::XMPPSerializer(PayloadSerializerCollection* payloadSerializers, StreamType type, bool setExplictNSonTopLevelElements) : type_(type) { - serializers_.push_back(boost::make_shared(payloadSerializers, setExplictNSonTopLevelElements ? getDefaultNamespace() : boost::optional())); - serializers_.push_back(boost::make_shared(payloadSerializers, setExplictNSonTopLevelElements ? getDefaultNamespace() : boost::optional())); - serializers_.push_back(boost::make_shared(payloadSerializers, setExplictNSonTopLevelElements ? getDefaultNamespace() : boost::optional())); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); - serializers_.push_back(boost::make_shared()); + serializers_.push_back(std::make_shared(payloadSerializers, setExplictNSonTopLevelElements ? getDefaultNamespace() : boost::optional())); + serializers_.push_back(std::make_shared(payloadSerializers, setExplictNSonTopLevelElements ? getDefaultNamespace() : boost::optional())); + serializers_.push_back(std::make_shared(payloadSerializers, setExplictNSonTopLevelElements ? getDefaultNamespace() : boost::optional())); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); + serializers_.push_back(std::make_shared()); } std::string XMPPSerializer::serializeHeader(const ProtocolHeader& header) const { @@ -84,8 +84,8 @@ std::string XMPPSerializer::serializeHeader(const ProtocolHeader& header) const return result; } -SafeByteArray XMPPSerializer::serializeElement(boost::shared_ptr element) const { - std::vector< boost::shared_ptr >::const_iterator i = std::find_if(serializers_.begin(), serializers_.end(), boost::bind(&ElementSerializer::canSerialize, _1, element)); +SafeByteArray XMPPSerializer::serializeElement(std::shared_ptr element) const { + std::vector< std::shared_ptr >::const_iterator i = std::find_if(serializers_.begin(), serializers_.end(), boost::bind(&ElementSerializer::canSerialize, _1, element)); if (i != serializers_.end()) { return (*i)->serialize(element); } diff --git a/Swiften/Serializer/XMPPSerializer.h b/Swiften/Serializer/XMPPSerializer.h index a771fdd..8c182e3 100644 --- a/Swiften/Serializer/XMPPSerializer.h +++ b/Swiften/Serializer/XMPPSerializer.h @@ -6,11 +6,10 @@ #pragma once +#include #include #include -#include - #include #include #include @@ -26,7 +25,7 @@ namespace Swift { XMPPSerializer(PayloadSerializerCollection*, StreamType type, bool setExplictNSonTopLevelElements); std::string serializeHeader(const ProtocolHeader&) const; - SafeByteArray serializeElement(boost::shared_ptr stanza) const; + SafeByteArray serializeElement(std::shared_ptr stanza) const; std::string serializeFooter() const; private: @@ -34,6 +33,6 @@ namespace Swift { private: StreamType type_; - std::vector< boost::shared_ptr > serializers_; + std::vector< std::shared_ptr > serializers_; }; } diff --git a/Swiften/Session/BOSHSessionStream.cpp b/Swiften/Session/BOSHSessionStream.cpp index dd6e83a..635fd69 100644 --- a/Swiften/Session/BOSHSessionStream.cpp +++ b/Swiften/Session/BOSHSessionStream.cpp @@ -40,7 +40,7 @@ BOSHSessionStream::BOSHSessionStream(const URL& boshURL, const SafeString& boshHTTPConnectProxyAuthID, const SafeString& boshHTTPConnectProxyAuthPassword, const TLSOptions& tlsOptions, - boost::shared_ptr trafficFilter) : + std::shared_ptr trafficFilter) : available(false), eventLoop(eventLoop), firstHeader(true) { @@ -92,7 +92,7 @@ void BOSHSessionStream::handlePoolXMPPDataRead(const SafeByteArray& data) { xmppLayer->handleDataRead(data); } -void BOSHSessionStream::writeElement(boost::shared_ptr element) { +void BOSHSessionStream::writeElement(std::shared_ptr element) { assert(available); xmppLayer->writeElement(element); } @@ -134,7 +134,7 @@ std::vector BOSHSessionStream::getPeerCertificateChain() const return connectionPool->getPeerCertificateChain(); } -boost::shared_ptr BOSHSessionStream::getPeerCertificateVerificationError() const { +std::shared_ptr BOSHSessionStream::getPeerCertificateVerificationError() const { return connectionPool->getPeerCertificateVerificationError(); } @@ -162,13 +162,13 @@ void BOSHSessionStream::handleStreamStartReceived(const ProtocolHeader& header) onStreamStartReceived(header); } -void BOSHSessionStream::handleElementReceived(boost::shared_ptr element) { +void BOSHSessionStream::handleElementReceived(std::shared_ptr element) { onElementReceived(element); } void BOSHSessionStream::handleXMPPError() { available = false; - onClosed(boost::make_shared(SessionStreamError::ParseError)); + onClosed(std::make_shared(SessionStreamError::ParseError)); } void BOSHSessionStream::handlePoolSessionStarted() { diff --git a/Swiften/Session/BOSHSessionStream.h b/Swiften/Session/BOSHSessionStream.h index 17292f4..0c26848 100644 --- a/Swiften/Session/BOSHSessionStream.h +++ b/Swiften/Session/BOSHSessionStream.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include #include #include @@ -30,7 +30,7 @@ namespace Swift { class XMLParserFactory; class XMPPLayer; - class SWIFTEN_API BOSHSessionStream : public SessionStream, public EventOwner, public boost::enable_shared_from_this { + class SWIFTEN_API BOSHSessionStream : public SessionStream, public EventOwner, public std::enable_shared_from_this { public: BOSHSessionStream( const URL& boshURL, @@ -47,7 +47,7 @@ namespace Swift { const SafeString& boshHTTPConnectProxyAuthID, const SafeString& boshHTTPConnectProxyAuthPassword, const TLSOptions& tlsOptions, - boost::shared_ptr trafficFilter + std::shared_ptr trafficFilter ); virtual ~BOSHSessionStream(); @@ -56,7 +56,7 @@ namespace Swift { virtual bool isOpen(); virtual void writeHeader(const ProtocolHeader& header); - virtual void writeElement(boost::shared_ptr); + virtual void writeElement(std::shared_ptr); virtual void writeFooter(); virtual void writeData(const std::string& data); @@ -68,7 +68,7 @@ namespace Swift { virtual bool isTLSEncrypted(); virtual Certificate::ref getPeerCertificate() const; virtual std::vector getPeerCertificateChain() const; - virtual boost::shared_ptr getPeerCertificateVerificationError() const; + virtual std::shared_ptr getPeerCertificateVerificationError() const; virtual ByteArray getTLSFinishMessage() const; virtual void setWhitespacePingEnabled(bool); @@ -78,7 +78,7 @@ namespace Swift { private: void handleXMPPError(); void handleStreamStartReceived(const ProtocolHeader&); - void handleElementReceived(boost::shared_ptr); + void handleElementReceived(std::shared_ptr); void handlePoolXMPPDataRead(const SafeByteArray& data); void handleXMPPLayerDataWritten(const SafeByteArray& data); void handlePoolSessionStarted(); diff --git a/Swiften/Session/BasicSessionStream.cpp b/Swiften/Session/BasicSessionStream.cpp index a6f1421..402f642 100644 --- a/Swiften/Session/BasicSessionStream.cpp +++ b/Swiften/Session/BasicSessionStream.cpp @@ -6,8 +6,9 @@ #include +#include + #include -#include #include #include @@ -22,7 +23,7 @@ namespace Swift { BasicSessionStream::BasicSessionStream( StreamType streamType, - boost::shared_ptr connection, + std::shared_ptr connection, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers, TLSContextFactory* tlsContextFactory, @@ -79,7 +80,7 @@ void BasicSessionStream::writeHeader(const ProtocolHeader& header) { xmppLayer->writeHeader(header); } -void BasicSessionStream::writeElement(boost::shared_ptr element) { +void BasicSessionStream::writeElement(std::shared_ptr element) { assert(available); xmppLayer->writeElement(element); } @@ -110,7 +111,7 @@ void BasicSessionStream::addTLSEncryption() { assert(available); tlsLayer = new TLSLayer(tlsContextFactory, tlsOptions_); if (hasTLSCertificate() && !tlsLayer->setClientCertificate(getTLSCertificate())) { - onClosed(boost::make_shared(SessionStreamError::InvalidTLSCertificateError)); + onClosed(std::make_shared(SessionStreamError::InvalidTLSCertificateError)); } else { streamStack->addLayer(tlsLayer); @@ -132,7 +133,7 @@ std::vector BasicSessionStream::getPeerCertificateChain() cons return tlsLayer->getPeerCertificateChain(); } -boost::shared_ptr BasicSessionStream::getPeerCertificateVerificationError() const { +std::shared_ptr BasicSessionStream::getPeerCertificateVerificationError() const { return tlsLayer->getPeerCertificateVerificationError(); } @@ -170,20 +171,20 @@ void BasicSessionStream::handleStreamStartReceived(const ProtocolHeader& header) onStreamStartReceived(header); } -void BasicSessionStream::handleElementReceived(boost::shared_ptr element) { +void BasicSessionStream::handleElementReceived(std::shared_ptr element) { onElementReceived(element); } void BasicSessionStream::handleXMPPError() { available = false; - onClosed(boost::make_shared(SessionStreamError::ParseError)); + onClosed(std::make_shared(SessionStreamError::ParseError)); } void BasicSessionStream::handleTLSConnected() { onTLSEncrypted(); } -void BasicSessionStream::handleTLSError(boost::shared_ptr error) { +void BasicSessionStream::handleTLSError(std::shared_ptr error) { available = false; onClosed(error); } @@ -191,13 +192,13 @@ void BasicSessionStream::handleTLSError(boost::shared_ptr error) { void BasicSessionStream::handleConnectionFinished(const boost::optional& error) { available = false; if (error == Connection::ReadError) { - onClosed(boost::make_shared(SessionStreamError::ConnectionReadError)); + onClosed(std::make_shared(SessionStreamError::ConnectionReadError)); } else if (error) { - onClosed(boost::make_shared(SessionStreamError::ConnectionWriteError)); + onClosed(std::make_shared(SessionStreamError::ConnectionWriteError)); } else { - onClosed(boost::shared_ptr()); + onClosed(std::shared_ptr()); } } diff --git a/Swiften/Session/BasicSessionStream.h b/Swiften/Session/BasicSessionStream.h index db4a7e0..1806cef 100644 --- a/Swiften/Session/BasicSessionStream.h +++ b/Swiften/Session/BasicSessionStream.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -33,7 +33,7 @@ namespace Swift { public: BasicSessionStream( StreamType streamType, - boost::shared_ptr connection, + std::shared_ptr connection, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers, TLSContextFactory* tlsContextFactory, @@ -47,7 +47,7 @@ namespace Swift { virtual bool isOpen(); virtual void writeHeader(const ProtocolHeader& header); - virtual void writeElement(boost::shared_ptr); + virtual void writeElement(std::shared_ptr); virtual void writeFooter(); virtual void writeData(const std::string& data); @@ -60,7 +60,7 @@ namespace Swift { virtual Certificate::ref getPeerCertificate() const; virtual std::vector getPeerCertificateChain() const; - virtual boost::shared_ptr getPeerCertificateVerificationError() const; + virtual std::shared_ptr getPeerCertificateVerificationError() const; virtual ByteArray getTLSFinishMessage() const; virtual void setWhitespacePingEnabled(bool); @@ -71,15 +71,15 @@ namespace Swift { void handleConnectionFinished(const boost::optional& error); void handleXMPPError(); void handleTLSConnected(); - void handleTLSError(boost::shared_ptr); + void handleTLSError(std::shared_ptr); void handleStreamStartReceived(const ProtocolHeader&); - void handleElementReceived(boost::shared_ptr); + void handleElementReceived(std::shared_ptr); void handleDataRead(const SafeByteArray& data); void handleDataWritten(const SafeByteArray& data); private: bool available; - boost::shared_ptr connection; + std::shared_ptr connection; TLSContextFactory* tlsContextFactory; TimerFactory* timerFactory; XMPPLayer* xmppLayer; diff --git a/Swiften/Session/Session.cpp b/Swiften/Session/Session.cpp index 82514c1..ebdb5d1 100644 --- a/Swiften/Session/Session.cpp +++ b/Swiften/Session/Session.cpp @@ -14,7 +14,7 @@ namespace Swift { Session::Session( - boost::shared_ptr connection, + std::shared_ptr connection, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers, XMLParserFactory* xmlParserFactory) : @@ -76,7 +76,7 @@ void Session::initializeStreamStack() { streamStack = new StreamStack(xmppLayer, connectionLayer); } -void Session::sendElement(boost::shared_ptr stanza) { +void Session::sendElement(std::shared_ptr stanza) { xmppLayer->writeElement(stanza); } diff --git a/Swiften/Session/Session.h b/Swiften/Session/Session.h index d01833d..911bd34 100644 --- a/Swiften/Session/Session.h +++ b/Swiften/Session/Session.h @@ -6,9 +6,9 @@ #pragma once -#include +#include + #include -#include #include #include @@ -28,7 +28,7 @@ namespace Swift { class XMPPLayer; class XMLParserFactory; - class SWIFTEN_API Session : public boost::enable_shared_from_this { + class SWIFTEN_API Session : public std::enable_shared_from_this { public: enum SessionError { ConnectionReadError, @@ -45,7 +45,7 @@ namespace Swift { }; Session( - boost::shared_ptr connection, + std::shared_ptr connection, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers, XMLParserFactory* xmlParserFactory); @@ -54,7 +54,7 @@ namespace Swift { void startSession(); void finishSession(); - void sendElement(boost::shared_ptr); + void sendElement(std::shared_ptr); const JID& getLocalJID() const { return localJID; @@ -64,7 +64,7 @@ namespace Swift { return remoteJID; } - boost::signal)> onElementReceived; + boost::signal)> onElementReceived; boost::signal&)> onSessionFinished; boost::signal onDataWritten; boost::signal onDataRead; @@ -82,7 +82,7 @@ namespace Swift { virtual void handleSessionStarted() {} virtual void handleSessionFinished(const boost::optional&) {} - virtual void handleElement(boost::shared_ptr) = 0; + virtual void handleElement(std::shared_ptr) = 0; virtual void handleStreamStart(const ProtocolHeader&) = 0; void initializeStreamStack(); @@ -103,7 +103,7 @@ namespace Swift { private: JID localJID; JID remoteJID; - boost::shared_ptr connection; + std::shared_ptr connection; PayloadParserFactoryCollection* payloadParserFactories; PayloadSerializerCollection* payloadSerializers; XMLParserFactory* xmlParserFactory; diff --git a/Swiften/Session/SessionStream.h b/Swiften/Session/SessionStream.h index 18404c6..4b86cee 100644 --- a/Swiften/Session/SessionStream.h +++ b/Swiften/Session/SessionStream.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include #include @@ -46,7 +47,7 @@ namespace Swift { virtual void writeHeader(const ProtocolHeader& header) = 0; virtual void writeFooter() = 0; - virtual void writeElement(boost::shared_ptr) = 0; + virtual void writeElement(std::shared_ptr) = 0; virtual void writeData(const std::string& data) = 0; virtual bool supportsZLibCompression() = 0; @@ -69,13 +70,13 @@ namespace Swift { virtual Certificate::ref getPeerCertificate() const = 0; virtual std::vector getPeerCertificateChain() const = 0; - virtual boost::shared_ptr getPeerCertificateVerificationError() const = 0; + virtual std::shared_ptr getPeerCertificateVerificationError() const = 0; virtual ByteArray getTLSFinishMessage() const = 0; boost::signal onStreamStartReceived; - boost::signal)> onElementReceived; - boost::signal)> onClosed; + boost::signal)> onElementReceived; + boost::signal)> onClosed; boost::signal onTLSEncrypted; boost::signal onDataRead; boost::signal onDataWritten; diff --git a/Swiften/Session/SessionTracer.cpp b/Swiften/Session/SessionTracer.cpp index aa44b9c..49b369d 100644 --- a/Swiften/Session/SessionTracer.cpp +++ b/Swiften/Session/SessionTracer.cpp @@ -12,7 +12,7 @@ namespace Swift { -SessionTracer::SessionTracer(boost::shared_ptr session) : session(session) { +SessionTracer::SessionTracer(std::shared_ptr session) : session(session) { session->onDataRead.connect(boost::bind(&SessionTracer::printData, this, '<', _1)); session->onDataWritten.connect(boost::bind(&SessionTracer::printData, this, '>', _1)); } diff --git a/Swiften/Session/SessionTracer.h b/Swiften/Session/SessionTracer.h index 3993a87..8e73c16 100644 --- a/Swiften/Session/SessionTracer.h +++ b/Swiften/Session/SessionTracer.h @@ -15,11 +15,11 @@ namespace Swift { class SWIFTEN_API SessionTracer { public: - SessionTracer(boost::shared_ptr session); + SessionTracer(std::shared_ptr session); private: void printData(char direction, const SafeByteArray& data); - boost::shared_ptr session; + std::shared_ptr session; }; } diff --git a/Swiften/StreamManagement/StanzaAckRequester.cpp b/Swiften/StreamManagement/StanzaAckRequester.cpp index ceafe28..8e9e7f3 100644 --- a/Swiften/StreamManagement/StanzaAckRequester.cpp +++ b/Swiften/StreamManagement/StanzaAckRequester.cpp @@ -20,9 +20,9 @@ StanzaAckRequester::StanzaAckRequester() : lastHandledStanzasCount(0) { } -void StanzaAckRequester::handleStanzaSent(boost::shared_ptr stanza) { +void StanzaAckRequester::handleStanzaSent(std::shared_ptr stanza) { unackedStanzas.push_back(stanza); - if (boost::dynamic_pointer_cast(stanza)) { + if (std::dynamic_pointer_cast(stanza)) { onRequestAck(); } } @@ -34,7 +34,7 @@ void StanzaAckRequester::handleAckReceived(unsigned int handledStanzasCount) { std::cerr << "Warning: Server acked more stanzas than we sent" << std::endl; break; } - boost::shared_ptr ackedStanza = unackedStanzas.front(); + std::shared_ptr ackedStanza = unackedStanzas.front(); unackedStanzas.pop_front(); onStanzaAcked(ackedStanza); i = (i == MAX_HANDLED_STANZA_COUNT ? 0 : i + 1); diff --git a/Swiften/StreamManagement/StanzaAckRequester.h b/Swiften/StreamManagement/StanzaAckRequester.h index 4d913bb..dda1395 100644 --- a/Swiften/StreamManagement/StanzaAckRequester.h +++ b/Swiften/StreamManagement/StanzaAckRequester.h @@ -7,8 +7,7 @@ #pragma once #include - -#include +#include #include #include @@ -19,17 +18,17 @@ namespace Swift { public: StanzaAckRequester(); - void handleStanzaSent(boost::shared_ptr stanza); + void handleStanzaSent(std::shared_ptr stanza); void handleAckReceived(unsigned int handledStanzasCount); public: boost::signal onRequestAck; - boost::signal)> onStanzaAcked; + boost::signal)> onStanzaAcked; private: friend class StanzaAckRequesterTest; unsigned int lastHandledStanzasCount; - std::deque > unackedStanzas; + std::deque > unackedStanzas; }; } diff --git a/Swiften/StreamManagement/StanzaAckResponder.h b/Swiften/StreamManagement/StanzaAckResponder.h index 16c8825..389606e 100644 --- a/Swiften/StreamManagement/StanzaAckResponder.h +++ b/Swiften/StreamManagement/StanzaAckResponder.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include diff --git a/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp b/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp index 55e6012..b1bc7c2 100644 --- a/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp +++ b/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp @@ -37,28 +37,28 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture { } void testHandleStanzaSent_MessageRequestsAck() { - boost::shared_ptr testling(createRequester()); + std::shared_ptr testling(createRequester()); testling->handleStanzaSent(createMessage("m1")); CPPUNIT_ASSERT_EQUAL(1, acksRequested); } void testHandleStanzaSent_IQDoesNotRequestAck() { - boost::shared_ptr testling(createRequester()); + std::shared_ptr testling(createRequester()); testling->handleStanzaSent(createIQ("iq1")); CPPUNIT_ASSERT_EQUAL(0, acksRequested); } void testHandleStanzaSent_PresenceDoesNotRequestAck() { - boost::shared_ptr testling(createRequester()); + std::shared_ptr testling(createRequester()); testling->handleStanzaSent(createPresence("p1")); CPPUNIT_ASSERT_EQUAL(0, acksRequested); } void testHandleAckReceived_AcksStanza() { - boost::shared_ptr testling(createRequester()); + std::shared_ptr testling(createRequester()); testling->handleStanzaSent(createMessage("m1")); testling->handleAckReceived(1); @@ -68,7 +68,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture { } void testHandleAckReceived_AcksMultipleMessages() { - boost::shared_ptr testling(createRequester()); + std::shared_ptr testling(createRequester()); testling->handleStanzaSent(createMessage("m1")); testling->handleStanzaSent(createMessage("m2")); @@ -80,7 +80,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture { } void testHandleAckReceived_AcksMultipleStanzas() { - boost::shared_ptr testling(createRequester()); + std::shared_ptr testling(createRequester()); testling->handleStanzaSent(createIQ("iq1")); testling->handleStanzaSent(createPresence("p1")); testling->handleStanzaSent(createMessage("m1")); @@ -94,7 +94,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture { } void testHandleAckReceived_MultipleAcks() { - boost::shared_ptr testling(createRequester()); + std::shared_ptr testling(createRequester()); testling->handleStanzaSent(createMessage("m1")); testling->handleAckReceived(1); @@ -110,7 +110,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture { // Handle stanza ack count wrapping, as per the XEP void testHandleAckReceived_WrapAround() { - boost::shared_ptr testling(createRequester()); + std::shared_ptr testling(createRequester()); testling->lastHandledStanzasCount = boost::numeric_cast((1ULL<<32) - 1); testling->handleStanzaSent(createMessage("m1")); testling->handleStanzaSent(createMessage("m2")); @@ -152,13 +152,13 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture { acksRequested++; } - void handleStanzaAcked(boost::shared_ptr stanza) { + void handleStanzaAcked(std::shared_ptr stanza) { ackedStanzas.push_back(stanza); } private: int acksRequested; - std::vector< boost::shared_ptr > ackedStanzas; + std::vector< std::shared_ptr > ackedStanzas; }; } diff --git a/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp b/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp index 70cd8fc..ffdabe9 100644 --- a/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp +++ b/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp @@ -27,7 +27,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture { public: void testHandleAckRequestReceived_AcksStanza() { - boost::shared_ptr testling(createResponder()); + std::shared_ptr testling(createResponder()); testling->handleStanzaReceived(); testling->handleAckRequestReceived(); @@ -37,7 +37,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture { } void testHandleAckRequestReceived_AcksMultipleStanzas() { - boost::shared_ptr testling(createResponder()); + std::shared_ptr testling(createResponder()); testling->handleStanzaReceived(); testling->handleStanzaReceived(); @@ -48,7 +48,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture { } void testHandleAckRequestReceived_MultipleAcks() { - boost::shared_ptr testling(createResponder()); + std::shared_ptr testling(createResponder()); testling->handleStanzaReceived(); testling->handleAckRequestReceived(); @@ -62,7 +62,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture { // Handle stanza ack count wrapping, as per the XEP void testHandleAckRequestReceived_WrapAround() { - boost::shared_ptr testling(createResponder()); + std::shared_ptr testling(createResponder()); testling->handledStanzasCount = boost::numeric_cast((1ULL<<32) - 1); testling->handleStanzaReceived(); testling->handleStanzaReceived(); diff --git a/Swiften/StreamStack/ConnectionLayer.cpp b/Swiften/StreamStack/ConnectionLayer.cpp index 09b6f87..b0c4deb 100644 --- a/Swiften/StreamStack/ConnectionLayer.cpp +++ b/Swiften/StreamStack/ConnectionLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -10,7 +10,7 @@ namespace Swift { -ConnectionLayer::ConnectionLayer(boost::shared_ptr connection) : connection(connection) { +ConnectionLayer::ConnectionLayer(std::shared_ptr connection) : connection(connection) { connection->onDataRead.connect(boost::bind(&ConnectionLayer::handleDataRead, this, _1)); } @@ -18,7 +18,7 @@ ConnectionLayer::~ConnectionLayer() { connection->onDataRead.disconnect(boost::bind(&ConnectionLayer::handleDataRead, this, _1)); } -void ConnectionLayer::handleDataRead(boost::shared_ptr data) { +void ConnectionLayer::handleDataRead(std::shared_ptr data) { writeDataToParentLayer(*data); } diff --git a/Swiften/StreamStack/ConnectionLayer.h b/Swiften/StreamStack/ConnectionLayer.h index c2d0fde..d1775ee 100644 --- a/Swiften/StreamStack/ConnectionLayer.h +++ b/Swiften/StreamStack/ConnectionLayer.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 +#include #include #include @@ -15,7 +15,7 @@ namespace Swift { class SWIFTEN_API ConnectionLayer : public LowLayer { public: - ConnectionLayer(boost::shared_ptr connection); + ConnectionLayer(std::shared_ptr connection); virtual ~ConnectionLayer(); void writeData(const SafeByteArray& data) { @@ -23,9 +23,9 @@ namespace Swift { } private: - void handleDataRead(boost::shared_ptr); + void handleDataRead(std::shared_ptr); private: - boost::shared_ptr connection; + std::shared_ptr connection; }; } diff --git a/Swiften/StreamStack/StreamStack.h b/Swiften/StreamStack/StreamStack.h index 74b92d7..718aa32 100644 --- a/Swiften/StreamStack/StreamStack.h +++ b/Swiften/StreamStack/StreamStack.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include diff --git a/Swiften/StreamStack/TLSLayer.cpp b/Swiften/StreamStack/TLSLayer.cpp index 3ab885a..ced879e 100644 --- a/Swiften/StreamStack/TLSLayer.cpp +++ b/Swiften/StreamStack/TLSLayer.cpp @@ -49,7 +49,7 @@ std::vector TLSLayer::getPeerCertificateChain() const { return context->getPeerCertificateChain(); } -boost::shared_ptr TLSLayer::getPeerCertificateVerificationError() const { +std::shared_ptr TLSLayer::getPeerCertificateVerificationError() const { return context->getPeerCertificateVerificationError(); } diff --git a/Swiften/StreamStack/TLSLayer.h b/Swiften/StreamStack/TLSLayer.h index b9072f3..8782753 100644 --- a/Swiften/StreamStack/TLSLayer.h +++ b/Swiften/StreamStack/TLSLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -30,7 +30,7 @@ namespace Swift { Certificate::ref getPeerCertificate() const; std::vector getPeerCertificateChain() const; - boost::shared_ptr getPeerCertificateVerificationError() const; + std::shared_ptr getPeerCertificateVerificationError() const; void writeData(const SafeByteArray& data); void handleDataRead(const SafeByteArray& data); @@ -40,7 +40,7 @@ namespace Swift { } public: - boost::signal)> onError; + boost::signal)> onError; boost::signal onConnected; private: diff --git a/Swiften/StreamStack/UnitTest/StreamStackTest.cpp b/Swiften/StreamStack/UnitTest/StreamStackTest.cpp index 7044ad9..6d50b77 100644 --- a/Swiften/StreamStack/UnitTest/StreamStackTest.cpp +++ b/Swiften/StreamStack/UnitTest/StreamStackTest.cpp @@ -61,7 +61,7 @@ class StreamStackTest : public CppUnit::TestFixture { void testWriteData_OneIntermediateStream() { StreamStack testling(xmppStream_, physicalStream_); - boost::shared_ptr xStream(new MyStreamLayer("X")); + std::shared_ptr xStream(new MyStreamLayer("X")); testling.addLayer(xStream.get()); xmppStream_->writeData("foo"); @@ -72,8 +72,8 @@ class StreamStackTest : public CppUnit::TestFixture { void testWriteData_TwoIntermediateStreamStack() { StreamStack testling(xmppStream_, physicalStream_); - boost::shared_ptr xStream(new MyStreamLayer("X")); - boost::shared_ptr yStream(new MyStreamLayer("Y")); + std::shared_ptr xStream(new MyStreamLayer("X")); + std::shared_ptr yStream(new MyStreamLayer("Y")); testling.addLayer(xStream.get()); testling.addLayer(yStream.get()); @@ -95,7 +95,7 @@ class StreamStackTest : public CppUnit::TestFixture { void testReadData_OneIntermediateStream() { StreamStack testling(xmppStream_, physicalStream_); xmppStream_->onElement.connect(boost::bind(&StreamStackTest::handleElement, this, _1)); - boost::shared_ptr xStream(new MyStreamLayer("<")); + std::shared_ptr xStream(new MyStreamLayer("<")); testling.addLayer(xStream.get()); physicalStream_->onDataRead(createSafeByteArray("stream:stream xmlns:stream='http://etherx.jabber.org/streams'>")); @@ -106,8 +106,8 @@ class StreamStackTest : public CppUnit::TestFixture { void testReadData_TwoIntermediateStreamStack() { StreamStack testling(xmppStream_, physicalStream_); xmppStream_->onElement.connect(boost::bind(&StreamStackTest::handleElement, this, _1)); - boost::shared_ptr xStream(new MyStreamLayer("s")); - boost::shared_ptr yStream(new MyStreamLayer("<")); + std::shared_ptr xStream(new MyStreamLayer("s")); + std::shared_ptr yStream(new MyStreamLayer("<")); testling.addLayer(xStream.get()); testling.addLayer(yStream.get()); @@ -119,7 +119,7 @@ class StreamStackTest : public CppUnit::TestFixture { void testAddLayer_ExistingOnWriteDataSlot() { StreamStack testling(xmppStream_, physicalStream_); xmppStream_->onWriteData.connect(boost::bind(&StreamStackTest::handleWriteData, this, _1)); - boost::shared_ptr xStream(new MyStreamLayer("X")); + std::shared_ptr xStream(new MyStreamLayer("X")); testling.addLayer(xStream.get()); xmppStream_->writeData("foo"); @@ -127,7 +127,7 @@ class StreamStackTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, dataWriteReceived_); } - void handleElement(boost::shared_ptr) { + void handleElement(std::shared_ptr) { ++elementsReceived_; } diff --git a/Swiften/StreamStack/UnitTest/XMPPLayerTest.cpp b/Swiften/StreamStack/UnitTest/XMPPLayerTest.cpp index 86e02ba..6d1d537 100644 --- a/Swiften/StreamStack/UnitTest/XMPPLayerTest.cpp +++ b/Swiften/StreamStack/UnitTest/XMPPLayerTest.cpp @@ -85,7 +85,7 @@ class XMPPLayerTest : public CppUnit::TestFixture { } void testWriteElement() { - testling_->writeElement(boost::make_shared()); + testling_->writeElement(std::make_shared()); CPPUNIT_ASSERT_EQUAL(std::string(""), lowLayer_->writtenData); } @@ -96,11 +96,11 @@ class XMPPLayerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(std::string(""), lowLayer_->writtenData); } - void handleElement(boost::shared_ptr) { + void handleElement(std::shared_ptr) { ++elementsReceived_; } - void handleElementAndReset(boost::shared_ptr) { + void handleElementAndReset(std::shared_ptr) { ++elementsReceived_; testling_->resetParser(); } diff --git a/Swiften/StreamStack/WhitespacePingLayer.h b/Swiften/StreamStack/WhitespacePingLayer.h index 41189ba..c9ffe92 100644 --- a/Swiften/StreamStack/WhitespacePingLayer.h +++ b/Swiften/StreamStack/WhitespacePingLayer.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include #include @@ -35,6 +36,6 @@ namespace Swift { private: bool isActive; - boost::shared_ptr timer; + std::shared_ptr timer; }; } diff --git a/Swiften/StreamStack/XMPPLayer.cpp b/Swiften/StreamStack/XMPPLayer.cpp index e0d683c..2eed906 100644 --- a/Swiften/StreamStack/XMPPLayer.cpp +++ b/Swiften/StreamStack/XMPPLayer.cpp @@ -41,7 +41,7 @@ void XMPPLayer::writeFooter() { writeDataInternal(createSafeByteArray(xmppSerializer_->serializeFooter())); } -void XMPPLayer::writeElement(boost::shared_ptr element) { +void XMPPLayer::writeElement(std::shared_ptr element) { writeDataInternal(xmppSerializer_->serializeElement(element)); } @@ -81,7 +81,7 @@ void XMPPLayer::handleStreamStart(const ProtocolHeader& header) { onStreamStart(header); } -void XMPPLayer::handleElement(boost::shared_ptr stanza) { +void XMPPLayer::handleElement(std::shared_ptr stanza) { onElement(stanza); } diff --git a/Swiften/StreamStack/XMPPLayer.h b/Swiften/StreamStack/XMPPLayer.h index 25d48bf..74ea519 100644 --- a/Swiften/StreamStack/XMPPLayer.h +++ b/Swiften/StreamStack/XMPPLayer.h @@ -6,8 +6,9 @@ #pragma once +#include + #include -#include #include #include @@ -39,7 +40,7 @@ namespace Swift { void writeHeader(const ProtocolHeader& header); void writeFooter(); - void writeElement(boost::shared_ptr); + void writeElement(std::shared_ptr); void writeData(const std::string& data); void resetParser(); @@ -50,14 +51,14 @@ namespace Swift { public: boost::signal onStreamStart; - boost::signal)> onElement; + boost::signal)> onElement; boost::signal onWriteData; boost::signal onDataRead; boost::signal onError; private: void handleStreamStart(const ProtocolHeader&); - void handleElement(boost::shared_ptr); + void handleElement(std::shared_ptr); void handleStreamEnd(); void doResetParser(); diff --git a/Swiften/StringCodecs/UnitTest/PBKDF2Test.cpp b/Swiften/StringCodecs/UnitTest/PBKDF2Test.cpp index 343c170..43866cb 100644 --- a/Swiften/StringCodecs/UnitTest/PBKDF2Test.cpp +++ b/Swiften/StringCodecs/UnitTest/PBKDF2Test.cpp @@ -25,7 +25,7 @@ class PBKDF2Test : public CppUnit::TestFixture { public: void setUp() { - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); } void testGetResult_I1() { @@ -47,7 +47,7 @@ class PBKDF2Test : public CppUnit::TestFixture { } private: - boost::shared_ptr crypto; + std::shared_ptr crypto; }; CPPUNIT_TEST_SUITE_REGISTRATION(PBKDF2Test); diff --git a/Swiften/TLS/CAPICertificate.cpp b/Swiften/TLS/CAPICertificate.cpp index 29bb338..a46b9f6 100644 --- a/Swiften/TLS/CAPICertificate.cpp +++ b/Swiften/TLS/CAPICertificate.cpp @@ -20,7 +20,7 @@ #define DEBUG_SCARD_STATUS(function, status) \ { \ - boost::shared_ptr errorCode = boost::make_shared(status, boost::system::system_category()); \ + std::shared_ptr errorCode = std::make_shared(status, boost::system::system_category()); \ SWIFT_LOG(debug) << std::hex << function << ": status: 0x" << status << ": " << errorCode->message() << std::endl; \ } diff --git a/Swiften/TLS/CAPICertificate.h b/Swiften/TLS/CAPICertificate.h index e0b5488..5322a03 100644 --- a/Swiften/TLS/CAPICertificate.h +++ b/Swiften/TLS/CAPICertificate.h @@ -4,6 +4,12 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once #include @@ -58,7 +64,7 @@ namespace Swift { std::string certStore_; std::string certName_; std::string smartCardReaderName_; - boost::shared_ptr smartCardTimer_; + std::shared_ptr smartCardTimer_; TimerFactory* timerFactory_; bool lastPollingResult_; diff --git a/Swiften/TLS/Certificate.h b/Swiften/TLS/Certificate.h index 0b45479..dbc61ad 100644 --- a/Swiften/TLS/Certificate.h +++ b/Swiften/TLS/Certificate.h @@ -1,16 +1,15 @@ /* - * 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 #include #include -#include - #include #include @@ -19,7 +18,7 @@ namespace Swift { class SWIFTEN_API Certificate { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; virtual ~Certificate(); diff --git a/Swiften/TLS/CertificateTrustChecker.h b/Swiften/TLS/CertificateTrustChecker.h index bf2b891..dd2b3ec 100644 --- a/Swiften/TLS/CertificateTrustChecker.h +++ b/Swiften/TLS/CertificateTrustChecker.h @@ -6,11 +6,10 @@ #pragma once +#include #include #include -#include - #include #include diff --git a/Swiften/TLS/CertificateVerificationError.h b/Swiften/TLS/CertificateVerificationError.h index 0079e4f..02b4cca 100644 --- a/Swiften/TLS/CertificateVerificationError.h +++ b/Swiften/TLS/CertificateVerificationError.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -14,7 +14,7 @@ namespace Swift { class SWIFTEN_API CertificateVerificationError : public Error { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum Type { UnknownError, diff --git a/Swiften/TLS/CertificateWithKey.h b/Swiften/TLS/CertificateWithKey.h index 3d95e5b..8414938 100644 --- a/Swiften/TLS/CertificateWithKey.h +++ b/Swiften/TLS/CertificateWithKey.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -12,7 +12,7 @@ namespace Swift { class SWIFTEN_API CertificateWithKey { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; CertificateWithKey() {} virtual ~CertificateWithKey() {} diff --git a/Swiften/TLS/OpenSSL/OpenSSLCertificate.cpp b/Swiften/TLS/OpenSSL/OpenSSLCertificate.cpp index 3110813..17ac8cc 100644 --- a/Swiften/TLS/OpenSSL/OpenSSLCertificate.cpp +++ b/Swiften/TLS/OpenSSL/OpenSSLCertificate.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -19,7 +19,7 @@ namespace Swift { -OpenSSLCertificate::OpenSSLCertificate(boost::shared_ptr cert) : cert(cert) { +OpenSSLCertificate::OpenSSLCertificate(std::shared_ptr cert) : cert(cert) { parse(); } @@ -30,7 +30,7 @@ OpenSSLCertificate::OpenSSLCertificate(const ByteArray& der) { #else const unsigned char* p = vecptr(der); #endif - cert = boost::shared_ptr(d2i_X509(NULL, &p, der.size()), X509_free); + cert = std::shared_ptr(d2i_X509(NULL, &p, der.size()), X509_free); if (!cert) { SWIFT_LOG(warning) << "Error creating certificate from DER data" << std::endl; } @@ -75,9 +75,9 @@ void OpenSSLCertificate::parse() { int subjectAltNameLoc = X509_get_ext_by_NID(cert.get(), NID_subject_alt_name, -1); if(subjectAltNameLoc != -1) { X509_EXTENSION* extension = X509_get_ext(cert.get(), subjectAltNameLoc); - boost::shared_ptr generalNames(reinterpret_cast(X509V3_EXT_d2i(extension)), GENERAL_NAMES_free); - boost::shared_ptr xmppAddrObject(OBJ_txt2obj(ID_ON_XMPPADDR_OID, 1), ASN1_OBJECT_free); - boost::shared_ptr dnsSRVObject(OBJ_txt2obj(ID_ON_DNSSRV_OID, 1), ASN1_OBJECT_free); + std::shared_ptr generalNames(reinterpret_cast(X509V3_EXT_d2i(extension)), GENERAL_NAMES_free); + std::shared_ptr xmppAddrObject(OBJ_txt2obj(ID_ON_XMPPADDR_OID, 1), ASN1_OBJECT_free); + std::shared_ptr dnsSRVObject(OBJ_txt2obj(ID_ON_DNSSRV_OID, 1), ASN1_OBJECT_free); for (int i = 0; i < sk_GENERAL_NAME_num(generalNames.get()); ++i) { GENERAL_NAME* generalName = sk_GENERAL_NAME_value(generalNames.get(), i); if (generalName->type == GEN_OTHERNAME) { diff --git a/Swiften/TLS/OpenSSL/OpenSSLCertificate.h b/Swiften/TLS/OpenSSL/OpenSSLCertificate.h index 4b8b32c..186caea 100644 --- a/Swiften/TLS/OpenSSL/OpenSSLCertificate.h +++ b/Swiften/TLS/OpenSSL/OpenSSLCertificate.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include @@ -17,7 +16,7 @@ namespace Swift { class OpenSSLCertificate : public Certificate { public: - OpenSSLCertificate(boost::shared_ptr); + OpenSSLCertificate(std::shared_ptr); OpenSSLCertificate(const ByteArray& der); std::string getSubjectName() const { @@ -42,7 +41,7 @@ namespace Swift { ByteArray toDER() const; - boost::shared_ptr getInternalX509() const { + std::shared_ptr getInternalX509() const { return cert; } @@ -62,7 +61,7 @@ namespace Swift { } private: - boost::shared_ptr cert; + std::shared_ptr cert; std::string subjectName; std::vector commonNames; std::vector dnsNames; diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp index cc420e6..b7496a0 100644 --- a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp +++ b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -13,7 +13,7 @@ #include #include #include -#include +#include #if defined(SWIFTEN_PLATFORM_MACOSX) #include @@ -147,7 +147,7 @@ void OpenSSLContext::doConnect() { break; default: state_ = Error; - onError(boost::make_shared()); + onError(std::make_shared()); } } @@ -181,7 +181,7 @@ void OpenSSLContext::handleDataFromApplication(const SafeByteArray& data) { } else { state_ = Error; - onError(boost::make_shared()); + onError(std::make_shared()); } } @@ -197,12 +197,12 @@ void OpenSSLContext::sendPendingDataToApplication() { } if (ret < 0 && SSL_get_error(handle_, ret) != SSL_ERROR_WANT_READ) { state_ = Error; - onError(boost::make_shared()); + onError(std::make_shared()); } } bool OpenSSLContext::setClientCertificate(CertificateWithKey::ref certificate) { - boost::shared_ptr pkcs12Certificate = boost::dynamic_pointer_cast(certificate); + std::shared_ptr pkcs12Certificate = std::dynamic_pointer_cast(certificate); if (!pkcs12Certificate || pkcs12Certificate->isNull()) { return false; } @@ -210,7 +210,7 @@ bool OpenSSLContext::setClientCertificate(CertificateWithKey::ref certificate) { // Create a PKCS12 structure BIO* bio = BIO_new(BIO_s_mem()); BIO_write(bio, vecptr(pkcs12Certificate->getData()), pkcs12Certificate->getData().size()); - boost::shared_ptr pkcs12(d2i_PKCS12_bio(bio, NULL), PKCS12_free); + std::shared_ptr pkcs12(d2i_PKCS12_bio(bio, NULL), PKCS12_free); BIO_free(bio); if (!pkcs12) { return false; @@ -226,9 +226,9 @@ bool OpenSSLContext::setClientCertificate(CertificateWithKey::ref certificate) { if (result != 1) { return false; } - boost::shared_ptr cert(certPtr, X509_free); - boost::shared_ptr privateKey(privateKeyPtr, EVP_PKEY_free); - boost::shared_ptr caCerts(caCertsPtr, freeX509Stack); + std::shared_ptr cert(certPtr, X509_free); + std::shared_ptr privateKey(privateKeyPtr, EVP_PKEY_free); + std::shared_ptr caCerts(caCertsPtr, freeX509Stack); // Use the key & certificates if (SSL_CTX_use_certificate(context_, cert.get()) != 1) { @@ -247,21 +247,21 @@ std::vector OpenSSLContext::getPeerCertificateChain() const { std::vector result; STACK_OF(X509)* chain = SSL_get_peer_cert_chain(handle_); for (int i = 0; i < sk_X509_num(chain); ++i) { - boost::shared_ptr x509Cert(X509_dup(sk_X509_value(chain, i)), X509_free); + std::shared_ptr x509Cert(X509_dup(sk_X509_value(chain, i)), X509_free); - Certificate::ref cert = boost::make_shared(x509Cert); + Certificate::ref cert = std::make_shared(x509Cert); result.push_back(cert); } return result; } -boost::shared_ptr OpenSSLContext::getPeerCertificateVerificationError() const { +std::shared_ptr OpenSSLContext::getPeerCertificateVerificationError() const { int verifyResult = SSL_get_verify_result(handle_); if (verifyResult != X509_V_OK) { - return boost::make_shared(getVerificationErrorTypeForResult(verifyResult)); + return std::make_shared(getVerificationErrorTypeForResult(verifyResult)); } else { - return boost::shared_ptr(); + return std::shared_ptr(); } } diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.h b/Swiften/TLS/OpenSSL/OpenSSLContext.h index 7fd5af7..54a8dcb 100644 --- a/Swiften/TLS/OpenSSL/OpenSSLContext.h +++ b/Swiften/TLS/OpenSSL/OpenSSLContext.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -29,7 +29,7 @@ namespace Swift { void handleDataFromApplication(const SafeByteArray&); std::vector getPeerCertificateChain() const; - boost::shared_ptr getPeerCertificateVerificationError() const; + std::shared_ptr getPeerCertificateVerificationError() const; virtual ByteArray getFinishMessage() const; diff --git a/Swiften/TLS/Schannel/SchannelCertificate.cpp b/Swiften/TLS/Schannel/SchannelCertificate.cpp index 68dd0cf..23c2479 100644 --- a/Swiften/TLS/Schannel/SchannelCertificate.cpp +++ b/Swiften/TLS/Schannel/SchannelCertificate.cpp @@ -4,6 +4,12 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #include "Swiften/TLS/Schannel/SchannelCertificate.h" #include "Swiften/Base/ByteArray.h" @@ -160,9 +166,9 @@ void SchannelCertificate::parse() // int subjectAltNameLoc = X509_get_ext_by_NID(cert.get(), NID_subject_alt_name, -1); // if(subjectAltNameLoc != -1) { // X509_EXTENSION* extension = X509_get_ext(cert.get(), subjectAltNameLoc); - // boost::shared_ptr generalNames(reinterpret_cast(X509V3_EXT_d2i(extension)), GENERAL_NAMES_free); - // boost::shared_ptr xmppAddrObject(OBJ_txt2obj(ID_ON_XMPPADDR_OID, 1), ASN1_OBJECT_free); - // boost::shared_ptr dnsSRVObject(OBJ_txt2obj(ID_ON_DNSSRV_OID, 1), ASN1_OBJECT_free); + // std::shared_ptr generalNames(reinterpret_cast(X509V3_EXT_d2i(extension)), GENERAL_NAMES_free); + // std::shared_ptr xmppAddrObject(OBJ_txt2obj(ID_ON_XMPPADDR_OID, 1), ASN1_OBJECT_free); + // std::shared_ptr dnsSRVObject(OBJ_txt2obj(ID_ON_DNSSRV_OID, 1), ASN1_OBJECT_free); // for (int i = 0; i < sk_GENERAL_NAME_num(generalNames.get()); ++i) { // GENERAL_NAME* generalName = sk_GENERAL_NAME_value(generalNames.get(), i); // if (generalName->type == GEN_OTHERNAME) { diff --git a/Swiften/TLS/Schannel/SchannelCertificate.h b/Swiften/TLS/Schannel/SchannelCertificate.h index 814f344..d3bd66c 100644 --- a/Swiften/TLS/Schannel/SchannelCertificate.h +++ b/Swiften/TLS/Schannel/SchannelCertificate.h @@ -12,7 +12,7 @@ #pragma once -#include +#include #include #include @@ -23,7 +23,7 @@ namespace Swift class SchannelCertificate : public Certificate { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: SchannelCertificate(const ScopedCertContext& certCtxt); diff --git a/Swiften/TLS/Schannel/SchannelContext.cpp b/Swiften/TLS/Schannel/SchannelContext.cpp index 7b67f4c..5799157 100644 --- a/Swiften/TLS/Schannel/SchannelContext.cpp +++ b/Swiften/TLS/Schannel/SchannelContext.cpp @@ -61,14 +61,14 @@ void SchannelContext::connect() { if (myCertStore_ == NULL) { myCertStore_ = CertOpenSystemStore(0, certStoreName_.c_str()); if (!myCertStore_) { - indicateError(boost::make_shared(TLSError::UnknownError)); + indicateError(std::make_shared(TLSError::UnknownError)); return; } } pCertContext = findCertificateInStore( myCertStore_, certName_ ); if (pCertContext == NULL) { - indicateError(boost::make_shared(TLSError::UnknownError)); + indicateError(std::make_shared(TLSError::UnknownError)); return; } } @@ -115,7 +115,7 @@ void SchannelContext::connect() { if (status != SEC_E_OK) { // We failed to obtain the credentials handle - indicateError(boost::make_shared(TLSError::UnknownError)); + indicateError(std::make_shared(TLSError::UnknownError)); return; } @@ -158,7 +158,7 @@ void SchannelContext::connect() { if (status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) { // We failed to initialize the security context handleCertError(status); - indicateError(boost::make_shared(TLSError::UnknownError)); + indicateError(std::make_shared(TLSError::UnknownError)); return; } @@ -181,7 +181,7 @@ void SchannelContext::connect() { //------------------------------------------------------------------------ SECURITY_STATUS SchannelContext::validateServerCertificate() { - SchannelCertificate::ref pServerCert = boost::dynamic_pointer_cast( getPeerCertificate() ); + SchannelCertificate::ref pServerCert = std::dynamic_pointer_cast( getPeerCertificate() ); if (!pServerCert) { return SEC_E_WRONG_PRINCIPAL; } @@ -359,7 +359,7 @@ void SchannelContext::continueHandshake(const SafeByteArray& data) { else { // We failed to initialize the security context handleCertError(status); - indicateError(boost::make_shared(TLSError::UnknownError)); + indicateError(std::make_shared(TLSError::UnknownError)); return; } } @@ -459,7 +459,7 @@ void SchannelContext::handleDataFromNetwork(const SafeByteArray& data) { //------------------------------------------------------------------------ -void SchannelContext::indicateError(boost::shared_ptr error) { +void SchannelContext::indicateError(std::shared_ptr error) { state_ = Error; receivedData_.clear(); onError(error); @@ -505,15 +505,15 @@ void SchannelContext::decryptAndProcessData(const SafeByteArray& data) { } else if (status == SEC_I_RENEGOTIATE) { // TODO: Handle renegotiation scenarios - indicateError(boost::make_shared(TLSError::UnknownError)); + indicateError(std::make_shared(TLSError::UnknownError)); break; } else if (status == SEC_I_CONTEXT_EXPIRED) { - indicateError(boost::make_shared(TLSError::UnknownError)); + indicateError(std::make_shared(TLSError::UnknownError)); break; } else if (status != SEC_E_OK) { - indicateError(boost::make_shared(TLSError::UnknownError)); + indicateError(std::make_shared(TLSError::UnknownError)); break; } @@ -596,7 +596,7 @@ void SchannelContext::encryptAndSendData(const SafeByteArray& data) { SECURITY_STATUS status = EncryptMessage(contextHandle_, 0, &outBufferDesc, 0); if (status != SEC_E_OK) { - indicateError(boost::make_shared(TLSError::UnknownError)); + indicateError(std::make_shared(TLSError::UnknownError)); return; } @@ -609,7 +609,7 @@ void SchannelContext::encryptAndSendData(const SafeByteArray& data) { //------------------------------------------------------------------------ bool SchannelContext::setClientCertificate(CertificateWithKey::ref certificate) { - boost::shared_ptr capiCertificate = boost::dynamic_pointer_cast(certificate); + std::shared_ptr capiCertificate = std::dynamic_pointer_cast(certificate); if (!capiCertificate || capiCertificate->isNull()) { return false; } @@ -631,7 +631,7 @@ bool SchannelContext::setClientCertificate(CertificateWithKey::ref certificate) //------------------------------------------------------------------------ void SchannelContext::handleCertificateCardRemoved() { if (disconnectOnCardRemoval_) { - indicateError(boost::make_shared(TLSError::CertificateCardRemoved)); + indicateError(std::make_shared(TLSError::CertificateCardRemoved)); } } @@ -647,7 +647,7 @@ std::vector SchannelContext::getPeerCertificateChain() const { if (status != SEC_E_OK) { return certificateChain; } - certificateChain.push_back(boost::make_shared(pServerCert)); + certificateChain.push_back(std::make_shared(pServerCert)); pCurrentCert = pServerCert; while(pCurrentCert.GetPointer()) { @@ -656,7 +656,7 @@ std::vector SchannelContext::getPeerCertificateChain() const { if (!(*pIssuerCert.GetPointer())) { break; } - certificateChain.push_back(boost::make_shared(pIssuerCert)); + certificateChain.push_back(std::make_shared(pIssuerCert)); pCurrentCert = pIssuerCert; pIssuerCert = NULL; @@ -667,7 +667,7 @@ std::vector SchannelContext::getPeerCertificateChain() const { //------------------------------------------------------------------------ CertificateVerificationError::ref SchannelContext::getPeerCertificateVerificationError() const { - return verificationError_ ? boost::make_shared(*verificationError_) : CertificateVerificationError::ref(); + return verificationError_ ? std::make_shared(*verificationError_) : CertificateVerificationError::ref(); } //------------------------------------------------------------------------ diff --git a/Swiften/TLS/Schannel/SchannelContext.h b/Swiften/TLS/Schannel/SchannelContext.h index 2c6a3ff..4cb086e 100644 --- a/Swiften/TLS/Schannel/SchannelContext.h +++ b/Swiften/TLS/Schannel/SchannelContext.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2012-2015 Isode Limited. + * Copyright (c) 2012-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -34,7 +34,7 @@ namespace Swift class SchannelContext : public TLSContext, boost::noncopyable { public: - typedef boost::shared_ptr sp_t; + typedef std::shared_ptr sp_t; public: SchannelContext(bool tls1_0Workaround); @@ -62,9 +62,9 @@ namespace Swift private: void determineStreamSizes(); void continueHandshake(const SafeByteArray& data); - void indicateError(boost::shared_ptr error); + void indicateError(std::shared_ptr error); //FIXME: Remove - void indicateError() {indicateError(boost::make_shared());} + void indicateError() {indicateError(std::make_shared());} void handleCertError(SECURITY_STATUS status) ; void sendDataOnNetwork(const void* pData, size_t dataSize); @@ -104,7 +104,7 @@ namespace Swift std::string certName_; ////Not needed, most likely std::string smartCardReader_; //Can be empty string for non SmartCard certificates - boost::shared_ptr userCertificate_; + std::shared_ptr userCertificate_; bool checkCertificateRevocation_; bool tls1_0Workaround_; bool disconnectOnCardRemoval_; diff --git a/Swiften/TLS/Schannel/SchannelUtil.h b/Swiften/TLS/Schannel/SchannelUtil.h index 194ec35..ec71d9d 100644 --- a/Swiften/TLS/Schannel/SchannelUtil.h +++ b/Swiften/TLS/Schannel/SchannelUtil.h @@ -4,6 +4,12 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once #define SECURITY_WIN32 @@ -92,7 +98,7 @@ namespace Swift } private: - boost::shared_ptr m_pHandle; + std::shared_ptr m_pHandle; }; //------------------------------------------------------------------------ @@ -168,7 +174,7 @@ namespace Swift } private: - boost::shared_ptr m_pHandle; + std::shared_ptr m_pHandle; }; //------------------------------------------------------------------------ @@ -303,7 +309,7 @@ namespace Swift } private: - boost::shared_ptr m_pHandle; + std::shared_ptr m_pHandle; }; //------------------------------------------------------------------------ @@ -420,6 +426,6 @@ namespace Swift } private: - boost::shared_ptr m_pHandle; + std::shared_ptr m_pHandle; }; } diff --git a/Swiften/TLS/SecureTransport/SecureTransportCertificate.h b/Swiften/TLS/SecureTransport/SecureTransportCertificate.h index 625c2ae..7faf3be 100644 --- a/Swiften/TLS/SecureTransport/SecureTransportCertificate.h +++ b/Swiften/TLS/SecureTransport/SecureTransportCertificate.h @@ -1,12 +1,13 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include +#include + #include #include @@ -34,7 +35,7 @@ private: typedef boost::remove_pointer::type SecCertificate; private: - boost::shared_ptr certificateHandle_; + std::shared_ptr certificateHandle_; std::string subjectName_; std::vector commonNames_; std::vector srvNames_; diff --git a/Swiften/TLS/SecureTransport/SecureTransportCertificate.mm b/Swiften/TLS/SecureTransport/SecureTransportCertificate.mm index ed47f56..db0af89 100644 --- a/Swiften/TLS/SecureTransport/SecureTransportCertificate.mm +++ b/Swiften/TLS/SecureTransport/SecureTransportCertificate.mm @@ -43,7 +43,7 @@ namespace Swift { SecureTransportCertificate::SecureTransportCertificate(SecCertificateRef certificate) { assert(certificate); CFRetain(certificate); - certificateHandle_ = boost::shared_ptr(certificate, CFRelease); + certificateHandle_ = std::shared_ptr(certificate, CFRelease); parse(); } @@ -53,7 +53,7 @@ SecureTransportCertificate::SecureTransportCertificate(const ByteArray& der) { // certificate will take ownership of derData and free it on its release. SecCertificateRef certificate = SecCertificateCreateWithData(nullptr, derData); if (certificate) { - certificateHandle_ = boost::shared_ptr(certificate, CFRelease); + certificateHandle_ = std::shared_ptr(certificate, CFRelease); parse(); } } diff --git a/Swiften/TLS/SecureTransport/SecureTransportContext.h b/Swiften/TLS/SecureTransport/SecureTransportContext.h index 4d45f52..3942904 100644 --- a/Swiften/TLS/SecureTransport/SecureTransportContext.h +++ b/Swiften/TLS/SecureTransport/SecureTransportContext.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -38,16 +38,16 @@ class SecureTransportContext : public TLSContext { static std::string stateToString(State state); void setState(State newState); - static boost::shared_ptr nativeToTLSError(OSStatus error); - boost::shared_ptr CSSMErrorToVerificationError(OSStatus resultCode); + static std::shared_ptr nativeToTLSError(OSStatus error); + std::shared_ptr CSSMErrorToVerificationError(OSStatus resultCode); void processHandshake(); void verifyServerCertificate(); - void fatalError(boost::shared_ptr error, boost::shared_ptr certificateError); + void fatalError(std::shared_ptr error, std::shared_ptr certificateError); private: - boost::shared_ptr sslContext_; + std::shared_ptr sslContext_; SafeByteArray readingBuffer_; State state_; CertificateVerificationError::ref verificationError_; diff --git a/Swiften/TLS/SecureTransport/SecureTransportContext.mm b/Swiften/TLS/SecureTransport/SecureTransportContext.mm index 1c5e3ab..970d270 100644 --- a/Swiften/TLS/SecureTransport/SecureTransportContext.mm +++ b/Swiften/TLS/SecureTransport/SecureTransportContext.mm @@ -39,7 +39,7 @@ namespace { CFArrayRef CreateClientCertificateChainAsCFArrayRef(CertificateWithKey::ref key) { - boost::shared_ptr pkcs12 = boost::dynamic_pointer_cast(key); + std::shared_ptr pkcs12 = std::dynamic_pointer_cast(key); if (!key) { return nullptr; } @@ -104,7 +104,7 @@ CFArrayRef CreateClientCertificateChainAsCFArrayRef(CertificateWithKey::ref key) } SecureTransportContext::SecureTransportContext(bool checkCertificateRevocation) : state_(None), checkCertificateRevocation_(checkCertificateRevocation) { - sslContext_ = boost::shared_ptr(SSLCreateContext(nullptr, kSSLClientSide, kSSLStreamType), CFRelease); + sslContext_ = std::shared_ptr(SSLCreateContext(nullptr, kSSLClientSide, kSSLStreamType), CFRelease); OSStatus error = noErr; // set IO callbacks @@ -163,7 +163,7 @@ void SecureTransportContext::connect() { if (clientCertificate_) { CFArrayRef certs = CreateClientCertificateChainAsCFArrayRef(clientCertificate_); if (certs) { - boost::shared_ptr certRefs(certs, CFRelease); + std::shared_ptr certRefs(certs, CFRelease); OSStatus result = SSLSetCertificate(sslContext_.get(), certRefs.get()); if (result != noErr) { SWIFT_LOG(error) << "SSLSetCertificate failed with error " << result << "." << std::endl; @@ -191,7 +191,7 @@ void SecureTransportContext::processHandshake() { } else { SWIFT_LOG(debug) << "Error returned from SSLHandshake call is " << error << "." << std::endl; - fatalError(nativeToTLSError(error), boost::make_shared()); + fatalError(nativeToTLSError(error), std::make_shared()); } } @@ -203,15 +203,15 @@ void SecureTransportContext::verifyServerCertificate() { SecTrustRef trust = nullptr; OSStatus error = SSLCopyPeerTrust(sslContext_.get(), &trust); if (error != noErr) { - fatalError(boost::make_shared(), boost::make_shared()); + fatalError(std::make_shared(), std::make_shared()); return; } - boost::shared_ptr trustRef = boost::shared_ptr(trust, CFRelease); + std::shared_ptr trustRef = std::shared_ptr(trust, CFRelease); if (checkCertificateRevocation_) { error = SecTrustSetOptions(trust, kSecTrustOptionRequireRevPerCert | kSecTrustOptionFetchIssuerFromNet); if (error != noErr) { - fatalError(boost::make_shared(), boost::make_shared()); + fatalError(std::make_shared(), std::make_shared()); return; } } @@ -219,7 +219,7 @@ void SecureTransportContext::verifyServerCertificate() { SecTrustResultType trustResult; error = SecTrustEvaluate(trust, &trustResult); if (error != errSecSuccess) { - fatalError(boost::make_shared(), boost::make_shared()); + fatalError(std::make_shared(), std::make_shared()); return; } @@ -242,7 +242,7 @@ void SecureTransportContext::verifyServerCertificate() { CSSM_TP_APPLE_EVIDENCE_INFO* statusChain; error = SecTrustGetResult(trustRef.get(), &trustResult, &certChain, &statusChain); if (error == errSecSuccess) { - boost::shared_ptr certChainRef = boost::shared_ptr(certChain, CFRelease); + std::shared_ptr certChainRef = std::shared_ptr(certChain, CFRelease); for (CFIndex index = 0; index < CFArrayGetCount(certChainRef.get()); index++) { for (CFIndex n = 0; n < statusChain[index].NumStatusCodes; n++) { // Even though Secure Transport reported CSSMERR_APPLETP_INCOMPLETE_REVOCATION_CHECK on the whole certificate @@ -259,11 +259,11 @@ void SecureTransportContext::verifyServerCertificate() { } } else { - verificationError_ = boost::make_shared(CertificateVerificationError::UnknownError); + verificationError_ = std::make_shared(CertificateVerificationError::UnknownError); } break; case kSecTrustResultOtherError: - verificationError_ = boost::make_shared(CertificateVerificationError::UnknownError); + verificationError_ = std::make_shared(CertificateVerificationError::UnknownError); break; default: SWIFT_LOG(warning) << "Unhandled trust result " << trustResult << "." << std::endl; @@ -321,7 +321,7 @@ void SecureTransportContext::handleDataFromNetwork(const SafeByteArray& data) { } else { SWIFT_LOG(error) << "SSLRead failed with error " << error << ", read bytes: " << bytesRead << "." << std::endl; - fatalError(boost::make_shared(), boost::make_shared()); + fatalError(std::make_shared(), std::make_shared()); return; } @@ -353,7 +353,7 @@ void SecureTransportContext::handleDataFromApplication(const SafeByteArray& data return; default: SWIFT_LOG(warning) << "SSLWrite returned error code: " << error << ", processed bytes: " << processedBytes << std::endl; - fatalError(boost::make_shared(), boost::shared_ptr()); + fatalError(std::make_shared(), std::shared_ptr()); } } @@ -362,18 +362,18 @@ std::vector SecureTransportContext::getPeerCertificateChain() if (sslContext_) { typedef boost::remove_pointer::type SecTrust; - boost::shared_ptr securityTrust; + std::shared_ptr securityTrust; SecTrustRef secTrust = nullptr;; OSStatus error = SSLCopyPeerTrust(sslContext_.get(), &secTrust); if (error == noErr) { - securityTrust = boost::shared_ptr(secTrust, CFRelease); + securityTrust = std::shared_ptr(secTrust, CFRelease); CFIndex chainSize = SecTrustGetCertificateCount(securityTrust.get()); for (CFIndex n = 0; n < chainSize; n++) { SecCertificateRef certificate = SecTrustGetCertificateAtIndex(securityTrust.get(), n); if (certificate) { - peerCertificateChain.push_back(boost::make_shared(certificate)); + peerCertificateChain.push_back(std::make_shared(certificate)); } } } @@ -431,30 +431,30 @@ OSStatus SecureTransportContext::SSLSocketWriteCallback(SSLConnectionRef connect return retValue; } -boost::shared_ptr SecureTransportContext::nativeToTLSError(OSStatus /* error */) { - boost::shared_ptr swiftenError; - swiftenError = boost::make_shared(); +std::shared_ptr SecureTransportContext::nativeToTLSError(OSStatus /* error */) { + std::shared_ptr swiftenError; + swiftenError = std::make_shared(); return swiftenError; } -boost::shared_ptr SecureTransportContext::CSSMErrorToVerificationError(OSStatus resultCode) { - boost::shared_ptr error; +std::shared_ptr SecureTransportContext::CSSMErrorToVerificationError(OSStatus resultCode) { + std::shared_ptr error; switch(resultCode) { case CSSMERR_TP_NOT_TRUSTED: SWIFT_LOG(debug) << "CSSM result code: CSSMERR_TP_NOT_TRUSTED" << std::endl; - error = boost::make_shared(CertificateVerificationError::Untrusted); + error = std::make_shared(CertificateVerificationError::Untrusted); break; case CSSMERR_TP_CERT_NOT_VALID_YET: SWIFT_LOG(debug) << "CSSM result code: CSSMERR_TP_CERT_NOT_VALID_YET" << std::endl; - error = boost::make_shared(CertificateVerificationError::NotYetValid); + error = std::make_shared(CertificateVerificationError::NotYetValid); break; case CSSMERR_TP_CERT_EXPIRED: SWIFT_LOG(debug) << "CSSM result code: CSSMERR_TP_CERT_EXPIRED" << std::endl; - error = boost::make_shared(CertificateVerificationError::Expired); + error = std::make_shared(CertificateVerificationError::Expired); break; case CSSMERR_TP_CERT_REVOKED: SWIFT_LOG(debug) << "CSSM result code: CSSMERR_TP_CERT_REVOKED" << std::endl; - error = boost::make_shared(CertificateVerificationError::Revoked); + error = std::make_shared(CertificateVerificationError::Revoked); break; case CSSMERR_TP_VERIFY_ACTION_FAILED: SWIFT_LOG(debug) << "CSSM result code: CSSMERR_TP_VERIFY_ACTION_FAILED" << std::endl; @@ -462,28 +462,28 @@ boost::shared_ptr SecureTransportContext::CSSMErro case CSSMERR_APPLETP_INCOMPLETE_REVOCATION_CHECK: SWIFT_LOG(debug) << "CSSM result code: CSSMERR_APPLETP_INCOMPLETE_REVOCATION_CHECK" << std::endl; if (checkCertificateRevocation_) { - error = boost::make_shared(CertificateVerificationError::RevocationCheckFailed); + error = std::make_shared(CertificateVerificationError::RevocationCheckFailed); } break; case CSSMERR_APPLETP_OCSP_UNAVAILABLE: SWIFT_LOG(debug) << "CSSM result code: CSSMERR_APPLETP_OCSP_UNAVAILABLE" << std::endl; if (checkCertificateRevocation_) { - error = boost::make_shared(CertificateVerificationError::RevocationCheckFailed); + error = std::make_shared(CertificateVerificationError::RevocationCheckFailed); } break; case CSSMERR_APPLETP_SSL_BAD_EXT_KEY_USE: SWIFT_LOG(debug) << "CSSM result code: CSSMERR_APPLETP_SSL_BAD_EXT_KEY_USE" << std::endl; - error = boost::make_shared(CertificateVerificationError::InvalidPurpose); + error = std::make_shared(CertificateVerificationError::InvalidPurpose); break; default: SWIFT_LOG(warning) << "unhandled CSSM error: " << resultCode << ", CSSM_TP_BASE_TP_ERROR: " << CSSM_TP_BASE_TP_ERROR << std::endl; - error = boost::make_shared(CertificateVerificationError::UnknownError); + error = std::make_shared(CertificateVerificationError::UnknownError); break; } return error; } -void SecureTransportContext::fatalError(boost::shared_ptr error, boost::shared_ptr certificateError) { +void SecureTransportContext::fatalError(std::shared_ptr error, std::shared_ptr certificateError) { setState(Error); if (sslContext_) { SSLClose(sslContext_.get()); diff --git a/Swiften/TLS/ServerIdentityVerifier.h b/Swiften/TLS/ServerIdentityVerifier.h index ca92180..f40c683 100644 --- a/Swiften/TLS/ServerIdentityVerifier.h +++ b/Swiften/TLS/ServerIdentityVerifier.h @@ -6,10 +6,9 @@ #pragma once +#include #include -#include - #include #include #include diff --git a/Swiften/TLS/SimpleCertificate.h b/Swiften/TLS/SimpleCertificate.h index 4dbf847..08cf1e3 100644 --- a/Swiften/TLS/SimpleCertificate.h +++ b/Swiften/TLS/SimpleCertificate.h @@ -14,7 +14,7 @@ namespace Swift { class SWIFTEN_API SimpleCertificate : public Certificate { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; void setSubjectName(const std::string& name) { subjectName = name; diff --git a/Swiften/TLS/TLSContext.h b/Swiften/TLS/TLSContext.h index d7b33d4..b0d9296 100644 --- a/Swiften/TLS/TLSContext.h +++ b/Swiften/TLS/TLSContext.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -38,7 +38,7 @@ namespace Swift { public: boost::signal onDataForNetwork; boost::signal onDataForApplication; - boost::signal)> onError; + boost::signal)> onError; boost::signal onConnected; }; } diff --git a/Swiften/TLS/TLSError.h b/Swiften/TLS/TLSError.h index bed5be9..ae775e6 100644 --- a/Swiften/TLS/TLSError.h +++ b/Swiften/TLS/TLSError.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -14,7 +14,7 @@ namespace Swift { class SWIFTEN_API TLSError : public Error { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; enum Type { UnknownError, diff --git a/Swiften/TLS/UnitTest/CertificateTest.cpp b/Swiften/TLS/UnitTest/CertificateTest.cpp index f7bb93e..2483dae 100644 --- a/Swiften/TLS/UnitTest/CertificateTest.cpp +++ b/Swiften/TLS/UnitTest/CertificateTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include +#include #include #include @@ -24,10 +24,10 @@ class CertificateTest : public CppUnit::TestFixture { public: void testGetSHA1Fingerprint() { - SimpleCertificate::ref testling = boost::make_shared(); + SimpleCertificate::ref testling = std::make_shared(); testling->setDER(createByteArray("abcdefg")); - CPPUNIT_ASSERT_EQUAL(std::string("2f:b5:e1:34:19:fc:89:24:68:65:e7:a3:24:f4:76:ec:62:4e:87:40"), Certificate::getSHA1Fingerprint(testling, boost::shared_ptr(PlatformCryptoProvider::create()).get())); + CPPUNIT_ASSERT_EQUAL(std::string("2f:b5:e1:34:19:fc:89:24:68:65:e7:a3:24:f4:76:ec:62:4e:87:40"), Certificate::getSHA1Fingerprint(testling, std::shared_ptr(PlatformCryptoProvider::create()).get())); } }; diff --git a/Swiften/TLS/UnitTest/ServerIdentityVerifierTest.cpp b/Swiften/TLS/UnitTest/ServerIdentityVerifierTest.cpp index 1fe936d..30fe423 100644 --- a/Swiften/TLS/UnitTest/ServerIdentityVerifierTest.cpp +++ b/Swiften/TLS/UnitTest/ServerIdentityVerifierTest.cpp @@ -39,7 +39,7 @@ class ServerIdentityVerifierTest : public CppUnit::TestFixture { public: void setUp() { - idnConverter = boost::shared_ptr(PlatformIDNConverter::create()); + idnConverter = std::shared_ptr(PlatformIDNConverter::create()); } void testCertificateVerifies_WithoutMatchingDNSName() { @@ -172,7 +172,7 @@ class ServerIdentityVerifierTest : public CppUnit::TestFixture { CPPUNIT_ASSERT(!testling.certificateVerifies(certificate)); } - boost::shared_ptr idnConverter; + std::shared_ptr idnConverter; }; CPPUNIT_TEST_SUITE_REGISTRATION(ServerIdentityVerifierTest); diff --git a/Swiften/VCards/GetVCardRequest.h b/Swiften/VCards/GetVCardRequest.h index 5d6fc17..1b575c0 100644 --- a/Swiften/VCards/GetVCardRequest.h +++ b/Swiften/VCards/GetVCardRequest.h @@ -13,14 +13,14 @@ namespace Swift { class SWIFTEN_API GetVCardRequest : public GenericRequest { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static ref create(const JID& jid, IQRouter* router) { return ref(new GetVCardRequest(jid, router)); } private: - GetVCardRequest(const JID& jid, IQRouter* router) : GenericRequest(IQ::Get, jid, boost::shared_ptr(new VCard()), router) { + GetVCardRequest(const JID& jid, IQRouter* router) : GenericRequest(IQ::Get, jid, std::make_shared(), router) { } }; } diff --git a/Swiften/VCards/SetVCardRequest.h b/Swiften/VCards/SetVCardRequest.h index b9621ab..15cc78b 100644 --- a/Swiften/VCards/SetVCardRequest.h +++ b/Swiften/VCards/SetVCardRequest.h @@ -13,7 +13,7 @@ namespace Swift { class SWIFTEN_API SetVCardRequest : public GenericRequest { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; static ref create(VCard::ref vcard, IQRouter* router) { return ref(new SetVCardRequest(vcard, router)); diff --git a/Swiften/VCards/UnitTest/VCardManagerTest.cpp b/Swiften/VCards/UnitTest/VCardManagerTest.cpp index 3784c6c..3d5338d 100644 --- a/Swiften/VCards/UnitTest/VCardManagerTest.cpp +++ b/Swiften/VCards/UnitTest/VCardManagerTest.cpp @@ -1,13 +1,13 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ +#include #include #include -#include #include #include @@ -41,7 +41,7 @@ class VCardManagerTest : public CppUnit::TestFixture { changes.clear(); ownChanges.clear(); ownJID = JID("baz@fum.com/dum"); - crypto = boost::shared_ptr(PlatformCryptoProvider::create()); + crypto = std::shared_ptr(PlatformCryptoProvider::create()); stanzaChannel = new DummyStanzaChannel(); iqRouter = new IQRouter(stanzaChannel); vcardStorage = new VCardMemoryStorage(crypto.get()); @@ -54,7 +54,7 @@ class VCardManagerTest : public CppUnit::TestFixture { } void testGet_NewVCardRequestsVCard() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); VCard::ref result = testling->getVCardAndRequestWhenNeeded(JID("foo@bar.com/baz")); CPPUNIT_ASSERT(!result); @@ -63,7 +63,7 @@ class VCardManagerTest : public CppUnit::TestFixture { } void testGet_ExistingVCard() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); VCard::ref vcard(new VCard()); vcard->setFullName("Foo Bar"); vcardStorage->setVCard(JID("foo@bar.com/baz"), vcard); @@ -75,7 +75,7 @@ class VCardManagerTest : public CppUnit::TestFixture { } void testRequest_RequestsVCard() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); testling->requestVCard(JID("foo@bar.com/baz")); CPPUNIT_ASSERT_EQUAL(1, static_cast(stanzaChannel->sentStanzas.size())); @@ -83,7 +83,7 @@ class VCardManagerTest : public CppUnit::TestFixture { } void testRequest_ReceiveEmitsNotification() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); testling->requestVCard(JID("foo@bar.com/baz")); stanzaChannel->onIQReceived(createVCardResult()); @@ -96,7 +96,7 @@ class VCardManagerTest : public CppUnit::TestFixture { } void testRequest_Error() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); testling->requestVCard(JID("foo@bar.com/baz")); stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID())); @@ -105,7 +105,7 @@ class VCardManagerTest : public CppUnit::TestFixture { } void testRequest_VCardAlreadyRequested() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); testling->requestVCard(JID("foo@bar.com/baz")); VCard::ref result = testling->getVCardAndRequestWhenNeeded(JID("foo@bar.com/baz")); @@ -114,7 +114,7 @@ class VCardManagerTest : public CppUnit::TestFixture { } void testRequest_AfterPreviousRequest() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); testling->requestVCard(JID("foo@bar.com/baz")); stanzaChannel->onIQReceived(createVCardResult()); testling->requestVCard(JID("foo@bar.com/baz")); @@ -124,7 +124,7 @@ class VCardManagerTest : public CppUnit::TestFixture { } void testRequestOwnVCard() { - boost::shared_ptr testling = createManager(); + std::shared_ptr testling = createManager(); testling->requestVCard(ownJID); stanzaChannel->onIQReceived(createOwnVCardResult()); @@ -140,8 +140,8 @@ class VCardManagerTest : public CppUnit::TestFixture { } void testCreateSetVCardRequest() { - boost::shared_ptr testling = createManager(); - VCard::ref vcard = boost::make_shared(); + std::shared_ptr testling = createManager(); + VCard::ref vcard = std::make_shared(); vcard->setFullName("New Name"); SetVCardRequest::ref request = testling->createSetVCardRequest(vcard); request->send(); @@ -154,8 +154,8 @@ class VCardManagerTest : public CppUnit::TestFixture { } void testCreateSetVCardRequest_Error() { - boost::shared_ptr testling = createManager(); - VCard::ref vcard = boost::make_shared(); + std::shared_ptr testling = createManager(); + VCard::ref vcard = std::make_shared(); vcard->setFullName("New Name"); SetVCardRequest::ref request = testling->createSetVCardRequest(vcard); request->send(); @@ -166,8 +166,8 @@ class VCardManagerTest : public CppUnit::TestFixture { } private: - boost::shared_ptr createManager() { - boost::shared_ptr manager(new VCardManager(ownJID, iqRouter, vcardStorage)); + std::shared_ptr createManager() { + std::shared_ptr manager(new VCardManager(ownJID, iqRouter, vcardStorage)); manager->onVCardChanged.connect(boost::bind(&VCardManagerTest::handleVCardChanged, this, _1, _2)); manager->onOwnVCardChanged.connect(boost::bind(&VCardManagerTest::handleOwnVCardChanged, this, _1)); return manager; @@ -205,7 +205,7 @@ class VCardManagerTest : public CppUnit::TestFixture { VCardMemoryStorage* vcardStorage; std::vector< std::pair > changes; std::vector ownChanges; - boost::shared_ptr crypto; + std::shared_ptr crypto; }; CPPUNIT_TEST_SUITE_REGISTRATION(VCardManagerTest); diff --git a/Swiften/VCards/VCardMemoryStorage.h b/Swiften/VCards/VCardMemoryStorage.h index d4df639..9a79edc 100644 --- a/Swiften/VCards/VCardMemoryStorage.h +++ b/Swiften/VCards/VCardMemoryStorage.h @@ -7,8 +7,7 @@ #pragma once #include - -#include +#include #include #include diff --git a/Swiften/VCards/VCardStorage.h b/Swiften/VCards/VCardStorage.h index 7314559..632e9e3 100644 --- a/Swiften/VCards/VCardStorage.h +++ b/Swiften/VCards/VCardStorage.h @@ -6,10 +6,10 @@ #pragma once +#include #include #include -#include #include #include diff --git a/Swiften/Whiteboard/IncomingWhiteboardSession.cpp b/Swiften/Whiteboard/IncomingWhiteboardSession.cpp index 206e10b..462bf21 100644 --- a/Swiften/Whiteboard/IncomingWhiteboardSession.cpp +++ b/Swiften/Whiteboard/IncomingWhiteboardSession.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include @@ -27,8 +27,8 @@ namespace Swift { } void IncomingWhiteboardSession::accept() { - boost::shared_ptr payload = boost::make_shared(WhiteboardPayload::SessionAccept); - boost::shared_ptr > request = boost::make_shared >(IQ::Set, toJID_, payload, router_); + std::shared_ptr payload = std::make_shared(WhiteboardPayload::SessionAccept); + std::shared_ptr > request = std::make_shared >(IQ::Set, toJID_, payload, router_); request->send(); onRequestAccepted(toJID_); } @@ -43,7 +43,7 @@ namespace Swift { } if (pairResult.server) { - WhiteboardPayload::ref payload = boost::make_shared(); + WhiteboardPayload::ref payload = std::make_shared(); payload->setOperation(pairResult.server); sendPayload(payload); } @@ -57,7 +57,7 @@ namespace Swift { WhiteboardOperation::ref result = client.handleLocalOperationReceived(operation); if (result) { - WhiteboardPayload::ref payload = boost::make_shared(); + WhiteboardPayload::ref payload = std::make_shared(); payload->setOperation(result); sendPayload(payload); } diff --git a/Swiften/Whiteboard/IncomingWhiteboardSession.h b/Swiften/Whiteboard/IncomingWhiteboardSession.h index f6c1f49..0f43cea 100644 --- a/Swiften/Whiteboard/IncomingWhiteboardSession.h +++ b/Swiften/Whiteboard/IncomingWhiteboardSession.h @@ -12,7 +12,7 @@ #pragma once -#include +#include #include #include @@ -21,7 +21,7 @@ namespace Swift { class SWIFTEN_API IncomingWhiteboardSession : public WhiteboardSession { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: IncomingWhiteboardSession(const JID& jid, IQRouter* router); diff --git a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp index 2bfc434..49f48aa 100644 --- a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp +++ b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp @@ -12,8 +12,9 @@ #include +#include + #include -#include #include #include @@ -28,13 +29,13 @@ namespace Swift { } void OutgoingWhiteboardSession::startSession() { - boost::shared_ptr payload = boost::make_shared(WhiteboardPayload::SessionRequest); - boost::shared_ptr > request = boost::make_shared >(IQ::Set, toJID_, payload, router_); + std::shared_ptr payload = std::make_shared(WhiteboardPayload::SessionRequest); + std::shared_ptr > request = std::make_shared >(IQ::Set, toJID_, payload, router_); request->onResponse.connect(boost::bind(&OutgoingWhiteboardSession::handleRequestResponse, this, _1, _2)); request->send(); } - void OutgoingWhiteboardSession::handleRequestResponse(boost::shared_ptr /*payload*/, ErrorPayload::ref error) { + void OutgoingWhiteboardSession::handleRequestResponse(std::shared_ptr /*payload*/, ErrorPayload::ref error) { if (error) { onRequestRejected(toJID_); } @@ -47,7 +48,7 @@ namespace Swift { } lastOpID = op->getID(); - WhiteboardPayload::ref payload = boost::make_shared(); + WhiteboardPayload::ref payload = std::make_shared(); payload->setOperation(op); sendPayload(payload); } @@ -58,7 +59,7 @@ namespace Swift { lastOpID = operation->getID(); server.handleLocalOperationReceived(operation); - WhiteboardPayload::ref payload = boost::make_shared(); + WhiteboardPayload::ref payload = std::make_shared(); payload->setOperation(operation); sendPayload(payload); } diff --git a/Swiften/Whiteboard/OutgoingWhiteboardSession.h b/Swiften/Whiteboard/OutgoingWhiteboardSession.h index dd8623a..52fb1db 100644 --- a/Swiften/Whiteboard/OutgoingWhiteboardSession.h +++ b/Swiften/Whiteboard/OutgoingWhiteboardSession.h @@ -12,7 +12,7 @@ #pragma once -#include +#include #include #include @@ -22,7 +22,7 @@ namespace Swift { class SWIFTEN_API OutgoingWhiteboardSession : public WhiteboardSession { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: OutgoingWhiteboardSession(const JID& jid, IQRouter* router); @@ -30,7 +30,7 @@ namespace Swift { void startSession(); private: - void handleRequestResponse(boost::shared_ptr /*payload*/, ErrorPayload::ref error); + void handleRequestResponse(std::shared_ptr /*payload*/, ErrorPayload::ref error); void handleIncomingOperation(WhiteboardOperation::ref operation); void sendOperation(WhiteboardOperation::ref operation); diff --git a/Swiften/Whiteboard/UnitTest/WhiteboardClientTest.cpp b/Swiften/Whiteboard/UnitTest/WhiteboardClientTest.cpp index 9534c60..fd26825 100644 --- a/Swiften/Whiteboard/UnitTest/WhiteboardClientTest.cpp +++ b/Swiften/Whiteboard/UnitTest/WhiteboardClientTest.cpp @@ -11,7 +11,7 @@ */ -#include +#include #include #include @@ -46,7 +46,7 @@ public: WhiteboardInsertOperation::ref serverOp; serverOp = createInsertOperation("0", "", 0); WhiteboardClient::Result pairResult = client.handleServerOperationReceived(serverOp); - CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast(pairResult.client)); + CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast(pairResult.client)); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server); //Client receives first local operation, because it's parented off "0" which exists @@ -54,7 +54,7 @@ public: //so this operation could be send WhiteboardInsertOperation::ref clientOp; clientOp = createInsertOperation("a", "0", 1); - WhiteboardEllipseElement::ref aElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref aElement = std::make_shared(0,0,0,0); clientOp->setElement(aElement); WhiteboardInsertOperation::ref result; checkOperation(client.handleLocalOperationReceived(clientOp), "a", "0", 1, aElement); @@ -63,7 +63,7 @@ public: //so it have to be transformed against local operations and then transformed value can //be returned to draw serverOp = createInsertOperation("b", "0", 1); - WhiteboardEllipseElement::ref bElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref bElement = std::make_shared(0,0,0,0); serverOp->setElement(bElement); pairResult = client.handleServerOperationReceived(serverOp); checkOperation(pairResult.client, "b", "a", 2, bElement); @@ -82,7 +82,7 @@ public: //but operation returned to send to the server should be parented off last server //operation, which is "b" clientOp = createInsertOperation("c", "b", 3); - WhiteboardEllipseElement::ref cElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref cElement = std::make_shared(0,0,0,0); clientOp->setElement(cElement); checkOperation(client.handleLocalOperationReceived(clientOp), "c", "a", 3, cElement); @@ -123,21 +123,21 @@ public: WhiteboardInsertOperation::ref serverOp; serverOp = createInsertOperation("0", "", 0); WhiteboardClient::Result pairResult = client.handleServerOperationReceived(serverOp); - CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast(pairResult.client)); + CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast(pairResult.client)); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server); //Client receives first local operation, because it's parented off "0" which exists //in server history and client doesn't wait for any operation ack from server, //so this operation could be send WhiteboardInsertOperation::ref clientOp = createInsertOperation("c", "0", 1); - WhiteboardEllipseElement::ref cElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref cElement = std::make_shared(0,0,0,0); clientOp->setElement(cElement); checkOperation(client.handleLocalOperationReceived(clientOp), "c", "0", 1, cElement); //Client receives second local operation, client didn't receive ack about previous //operation from the server so it can't be send. clientOp = createInsertOperation("d", "c", 2); - WhiteboardEllipseElement::ref dElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref dElement = std::make_shared(0,0,0,0); clientOp->setElement(dElement); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), client.handleLocalOperationReceived(clientOp)); @@ -162,11 +162,11 @@ public: //the end of local history so it doesn't have to be transformed, so operation //to pass to window should be the same serverOp = createInsertOperation("e", "d", 3); - WhiteboardEllipseElement::ref eElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref eElement = std::make_shared(0,0,0,0); serverOp->setElement(eElement); pairResult = client.handleServerOperationReceived(serverOp); - WhiteboardInsertOperation::ref result = boost::dynamic_pointer_cast(pairResult.client); - CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast(pairResult.client)); + WhiteboardInsertOperation::ref result = std::dynamic_pointer_cast(pairResult.client); + CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast(pairResult.client)); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server); @@ -196,7 +196,7 @@ public: WhiteboardInsertOperation::ref serverOp; serverOp = createInsertOperation("0", "", 0); WhiteboardClient::Result pairResult = client.handleServerOperationReceived(serverOp); - CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast(pairResult.client)); + CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast(pairResult.client)); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server); //Client receives first local operation, because it's parented off "0" which exists @@ -204,14 +204,14 @@ public: //so this operation could be send WhiteboardInsertOperation::ref clientOp; clientOp = createInsertOperation("a", "0", 1); - WhiteboardEllipseElement::ref aElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref aElement = std::make_shared(0,0,0,0); clientOp->setElement(aElement); checkOperation(client.handleLocalOperationReceived(clientOp), "a", "0", 1, aElement); //Client receives second local operation, client didn't receive ack about previous //operation from the server so it can't be send. clientOp = createInsertOperation("b", "a", 2); - WhiteboardEllipseElement::ref bElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref bElement = std::make_shared(0,0,0,0); clientOp->setElement(bElement); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), client.handleLocalOperationReceived(clientOp)); @@ -219,7 +219,7 @@ public: //"a" and "b" before adding to local operations history because it's parented off "0". //Because client is waiting for ack of "a", there is no operation to send to server serverOp = createInsertOperation("c", "0", 1); - WhiteboardEllipseElement::ref cElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref cElement = std::make_shared(0,0,0,0); serverOp->setElement(cElement); pairResult = client.handleServerOperationReceived(serverOp); checkOperation(pairResult.client, "c", "b", 3, cElement); @@ -230,7 +230,7 @@ public: //"c" existing in local history. //Because client is waiting for ack of "a", there is no operation to send to server serverOp = createInsertOperation("d", "c", 2); - WhiteboardEllipseElement::ref dElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref dElement = std::make_shared(0,0,0,0); serverOp->setElement(dElement); pairResult = client.handleServerOperationReceived(serverOp); checkOperation(pairResult.client, "d", "c", 4, dElement); @@ -282,7 +282,7 @@ public: WhiteboardInsertOperation::ref serverOp; serverOp = createInsertOperation("0", "", 0); WhiteboardClient::Result pairResult = client.handleServerOperationReceived(serverOp); - CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast(pairResult.client)); + CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast(pairResult.client)); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server); //Client receives first local operation, because it's parented off "0" which exists @@ -290,14 +290,14 @@ public: //so this operation could be send WhiteboardInsertOperation::ref clientOp; clientOp = createInsertOperation("a", "0", 1); - WhiteboardEllipseElement::ref aElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref aElement = std::make_shared(0,0,0,0); clientOp->setElement(aElement); checkOperation(client.handleLocalOperationReceived(clientOp), "a", "0", 1, aElement); //Client receives second local operation, client didn't receive ack about previous //operation from the server so it can't be send. clientOp = createInsertOperation("b", "a", 2); - WhiteboardEllipseElement::ref bElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref bElement = std::make_shared(0,0,0,0); clientOp->setElement(bElement); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), client.handleLocalOperationReceived(clientOp)); @@ -305,7 +305,7 @@ public: //"a" and "b" before adding to local operations history because it's parented off "0". //Because client is waiting for ack of "a", there is no operation to send to server serverOp = createInsertOperation("c", "0", 1); - WhiteboardEllipseElement::ref cElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref cElement = std::make_shared(0,0,0,0); serverOp->setElement(cElement); pairResult = client.handleServerOperationReceived(serverOp); checkOperation(pairResult.client, "c", "b", 3, cElement); @@ -314,7 +314,7 @@ public: //Client receives new local operation, client is still waiting for ack so, it //should return nothing clientOp = createInsertOperation("e", "a", 4); - WhiteboardEllipseElement::ref eElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref eElement = std::make_shared(0,0,0,0); clientOp->setElement(eElement); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), client.handleLocalOperationReceived(clientOp)); @@ -322,7 +322,7 @@ public: //against result of previous transformations and operation "e", returned operation should //be parented off "e", which was last local operation serverOp = createInsertOperation("d", "c", 2); - WhiteboardEllipseElement::ref dElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref dElement = std::make_shared(0,0,0,0); serverOp->setElement(dElement); pairResult = client.handleServerOperationReceived(serverOp); checkOperation(pairResult.client, "d", "e", 5, dElement); @@ -383,7 +383,7 @@ public: WhiteboardInsertOperation::ref serverOp; serverOp = createInsertOperation("0", "", 0); WhiteboardClient::Result pairResult = client.handleServerOperationReceived(serverOp); - CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast(pairResult.client)); + CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast(pairResult.client)); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server); //Client receives first local operation, because it's parented off "0" which exists @@ -391,14 +391,14 @@ public: //so this operation could be send WhiteboardInsertOperation::ref clientOp; clientOp = createInsertOperation("a", "0", 1); - WhiteboardEllipseElement::ref aElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref aElement = std::make_shared(0,0,0,0); clientOp->setElement(aElement); checkOperation(client.handleLocalOperationReceived(clientOp), "a", "0", 1, aElement); //Client receives second local operation, client didn't receive ack about previous //operation from the server so it can't be send. clientOp = createInsertOperation("b", "a", 2); - WhiteboardEllipseElement::ref bElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref bElement = std::make_shared(0,0,0,0); clientOp->setElement(bElement); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), client.handleLocalOperationReceived(clientOp)); @@ -406,7 +406,7 @@ public: //"a" and "b" before adding to local operations history because it's parented off "0". //Because client is waiting for ack of "a", there is no operation to send to server serverOp = createInsertOperation("c", "0", 1); - WhiteboardEllipseElement::ref cElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref cElement = std::make_shared(0,0,0,0); serverOp->setElement(cElement); pairResult = client.handleServerOperationReceived(serverOp); checkOperation(pairResult.client, "c", "b", 3, cElement); @@ -425,7 +425,7 @@ public: //against result of previous transformation(but only with transformation of "b"), returned //operation should be parented off "c", which was last local operation serverOp = createInsertOperation("d", "a", 3); - WhiteboardEllipseElement::ref dElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref dElement = std::make_shared(0,0,0,0); serverOp->setElement(dElement); pairResult = client.handleServerOperationReceived(serverOp); checkOperation(pairResult.client, "d", "c", 4, dElement); @@ -471,7 +471,7 @@ public: WhiteboardInsertOperation::ref serverOp; serverOp = createInsertOperation("0", "", 0); WhiteboardClient::Result pairResult = client.handleServerOperationReceived(serverOp); - CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast(pairResult.client)); + CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast(pairResult.client)); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server); //Client receives first local operation, because it's parented off "0" which exists @@ -479,14 +479,14 @@ public: //so this operation could be send WhiteboardInsertOperation::ref clientOp; clientOp = createInsertOperation("a", "0", 1); - WhiteboardEllipseElement::ref aElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref aElement = std::make_shared(0,0,0,0); clientOp->setElement(aElement); checkOperation(client.handleLocalOperationReceived(clientOp), "a", "0", 1, aElement); //Client receives second local operation, client didn't receive ack about previous //operation from the server so it can't be send. WhiteboardUpdateOperation::ref clientUpdateOp = createUpdateOperation("b", "a", 0); - WhiteboardEllipseElement::ref bElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref bElement = std::make_shared(0,0,0,0); clientUpdateOp->setElement(bElement); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), client.handleLocalOperationReceived(clientUpdateOp)); @@ -494,7 +494,7 @@ public: //"a" and "b" before adding to local operations history because it's parented off "0". //Because client is waiting for ack of "a", there is no operation to send to server WhiteboardUpdateOperation::ref serverUpdateOp = createUpdateOperation("c", "0", 0); - WhiteboardEllipseElement::ref cElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref cElement = std::make_shared(0,0,0,0); serverUpdateOp->setElement(cElement); pairResult = client.handleServerOperationReceived(serverUpdateOp); checkOperation(pairResult.client, "c", "b", 0, cElement); @@ -505,7 +505,7 @@ public: //"c" existing in local history. //Because client is waiting for ack of "a", there is no operation to send to server serverOp = createInsertOperation("d", "c", 1); - WhiteboardEllipseElement::ref dElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref dElement = std::make_shared(0,0,0,0); serverOp->setElement(dElement); pairResult = client.handleServerOperationReceived(serverOp); checkOperation(pairResult.client, "d", "c", 2, dElement); @@ -556,12 +556,12 @@ public: WhiteboardInsertOperation::ref serverOp; serverOp = createInsertOperation("0", "", 0); WhiteboardClient::Result pairResult = client.handleServerOperationReceived(serverOp); - CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast(pairResult.client)); + CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast(pairResult.client)); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server); serverOp = createInsertOperation("1", "0", 1); pairResult = client.handleServerOperationReceived(serverOp); - CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast(pairResult.client)); + CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast(pairResult.client)); CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server); //Client receives first local operation, because it's parented off "0" which exists //in server history and client doesn't wait for any operation ack from server, @@ -570,7 +570,7 @@ public: WhiteboardUpdateOperation::ref clientUpdateOp; WhiteboardDeleteOperation::ref clientDeleteOp; clientUpdateOp = createUpdateOperation("a", "1", 0); - WhiteboardEllipseElement::ref aElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref aElement = std::make_shared(0,0,0,0); clientUpdateOp->setElement(aElement); checkOperation(client.handleLocalOperationReceived(clientUpdateOp), "a", "1", 0, aElement); @@ -583,7 +583,7 @@ public: //"a" and "b" before adding to local operations history because it's parented off "0". //Because client is waiting for ack of "a", there is no operation to send to server serverOp = createInsertOperation("c", "1", 2); - WhiteboardEllipseElement::ref cElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref cElement = std::make_shared(0,0,0,0); serverOp->setElement(cElement); pairResult = client.handleServerOperationReceived(serverOp); checkOperation(pairResult.client, "c", "b", 1, cElement); @@ -594,7 +594,7 @@ public: //"c" existing in local history. //Because client is waiting for ack of "a", there is no operation to send to server WhiteboardUpdateOperation::ref serverUpdateOp = createUpdateOperation("d", "c", 0); - WhiteboardEllipseElement::ref dElement = boost::make_shared(0,0,0,0); + WhiteboardEllipseElement::ref dElement = std::make_shared(0,0,0,0); serverUpdateOp->setElement(dElement); pairResult = client.handleServerOperationReceived(serverUpdateOp); checkOperation(pairResult.client, "d", "c", 0, dElement); @@ -636,7 +636,7 @@ public: WhiteboardInsertOperation::ref createInsertOperation(std::string id, std::string parent, int pos) { - WhiteboardInsertOperation::ref operation = boost::make_shared(); + WhiteboardInsertOperation::ref operation = std::make_shared(); operation->setParentID(parent); operation->setID(id); operation->setPos(pos); @@ -644,7 +644,7 @@ public: } WhiteboardUpdateOperation::ref createUpdateOperation(std::string id, std::string parent, int pos) { - WhiteboardUpdateOperation::ref operation = boost::make_shared(); + WhiteboardUpdateOperation::ref operation = std::make_shared(); operation->setParentID(parent); operation->setID(id); operation->setPos(pos); @@ -652,7 +652,7 @@ public: } WhiteboardDeleteOperation::ref createDeleteOperation(std::string id, std::string parent, int pos) { - WhiteboardDeleteOperation::ref operation = boost::make_shared(); + WhiteboardDeleteOperation::ref operation = std::make_shared(); operation->setParentID(parent); operation->setID(id); operation->setPos(pos); @@ -667,12 +667,12 @@ public: } if (element) { - WhiteboardInsertOperation::ref insertOp = boost::dynamic_pointer_cast(operation); + WhiteboardInsertOperation::ref insertOp = std::dynamic_pointer_cast(operation); if (insertOp) { CPPUNIT_ASSERT_EQUAL(element, insertOp->getElement()); } - WhiteboardUpdateOperation::ref updateOp = boost::dynamic_pointer_cast(operation); + WhiteboardUpdateOperation::ref updateOp = std::dynamic_pointer_cast(operation); if (updateOp) { CPPUNIT_ASSERT_EQUAL(element, updateOp->getElement()); } diff --git a/Swiften/Whiteboard/UnitTest/WhiteboardServerTest.cpp b/Swiften/Whiteboard/UnitTest/WhiteboardServerTest.cpp index 58b8c19..e868968 100644 --- a/Swiften/Whiteboard/UnitTest/WhiteboardServerTest.cpp +++ b/Swiften/Whiteboard/UnitTest/WhiteboardServerTest.cpp @@ -11,7 +11,7 @@ */ -#include +#include #include #include @@ -34,44 +34,44 @@ class WhiteboardServerTest : public CppUnit::TestFixture { public: void testSimpleOp() { WhiteboardServer server; - WhiteboardInsertOperation::ref firstOp = boost::make_shared(); + WhiteboardInsertOperation::ref firstOp = std::make_shared(); firstOp->setID("0"); server.handleLocalOperationReceived(firstOp); - WhiteboardInsertOperation::ref serverOp = boost::make_shared(); + WhiteboardInsertOperation::ref serverOp = std::make_shared(); serverOp->setID("b"); serverOp->setParentID("0"); serverOp->setPos(1); server.handleLocalOperationReceived(serverOp); - WhiteboardInsertOperation::ref clientOp = boost::make_shared(); - WhiteboardEllipseElement::ref clientElement = boost::make_shared(0,0,0,0); + WhiteboardInsertOperation::ref clientOp = std::make_shared(); + WhiteboardEllipseElement::ref clientElement = std::make_shared(0,0,0,0); clientOp->setID("a"); clientOp->setParentID("0"); clientOp->setPos(1); clientOp->setElement(clientElement); - WhiteboardInsertOperation::ref op = boost::dynamic_pointer_cast(server.handleClientOperationReceived(clientOp)); + WhiteboardInsertOperation::ref op = std::dynamic_pointer_cast(server.handleClientOperationReceived(clientOp)); CPPUNIT_ASSERT_EQUAL(std::string("b"), op->getParentID()); CPPUNIT_ASSERT_EQUAL(std::string("a"), op->getID()); CPPUNIT_ASSERT_EQUAL(1, op->getPos()); - CPPUNIT_ASSERT_EQUAL(clientElement, boost::dynamic_pointer_cast(op->getElement())); + CPPUNIT_ASSERT_EQUAL(clientElement, std::dynamic_pointer_cast(op->getElement())); } void testSimpleOp1() { WhiteboardServer server; - WhiteboardInsertOperation::ref firstOp = boost::make_shared(); + WhiteboardInsertOperation::ref firstOp = std::make_shared(); firstOp->setID("0"); server.handleLocalOperationReceived(firstOp); - WhiteboardDeleteOperation::ref serverOp = boost::make_shared(); + WhiteboardDeleteOperation::ref serverOp = std::make_shared(); serverOp->setID("b"); serverOp->setParentID("0"); serverOp->setPos(1); server.handleLocalOperationReceived(serverOp); - WhiteboardUpdateOperation::ref clientOp = boost::make_shared(); - WhiteboardEllipseElement::ref clientElement = boost::make_shared(0,0,0,0); + WhiteboardUpdateOperation::ref clientOp = std::make_shared(); + WhiteboardEllipseElement::ref clientElement = std::make_shared(0,0,0,0); clientOp->setID("a"); clientOp->setParentID("0"); clientOp->setPos(1); clientOp->setElement(clientElement); - WhiteboardDeleteOperation::ref op = boost::dynamic_pointer_cast(server.handleClientOperationReceived(clientOp)); + WhiteboardDeleteOperation::ref op = std::dynamic_pointer_cast(server.handleClientOperationReceived(clientOp)); CPPUNIT_ASSERT_EQUAL(std::string("b"), op->getParentID()); CPPUNIT_ASSERT_EQUAL(std::string("a"), op->getID()); CPPUNIT_ASSERT_EQUAL(-1, op->getPos()); @@ -79,19 +79,19 @@ public: void testSimpleOp2() { WhiteboardServer server; - WhiteboardInsertOperation::ref firstOp = boost::make_shared(); + WhiteboardInsertOperation::ref firstOp = std::make_shared(); firstOp->setID("0"); server.handleLocalOperationReceived(firstOp); - WhiteboardUpdateOperation::ref serverOp = boost::make_shared(); + WhiteboardUpdateOperation::ref serverOp = std::make_shared(); serverOp->setID("b"); serverOp->setParentID("0"); serverOp->setPos(1); server.handleLocalOperationReceived(serverOp); - WhiteboardDeleteOperation::ref clientOp = boost::make_shared(); + WhiteboardDeleteOperation::ref clientOp = std::make_shared(); clientOp->setID("a"); clientOp->setParentID("0"); clientOp->setPos(1); - WhiteboardDeleteOperation::ref op = boost::dynamic_pointer_cast(server.handleClientOperationReceived(clientOp)); + WhiteboardDeleteOperation::ref op = std::dynamic_pointer_cast(server.handleClientOperationReceived(clientOp)); CPPUNIT_ASSERT_EQUAL(std::string("b"), op->getParentID()); CPPUNIT_ASSERT_EQUAL(std::string("a"), op->getID()); CPPUNIT_ASSERT_EQUAL(1, op->getPos()); @@ -100,35 +100,35 @@ public: void testFewSimpleOps() { WhiteboardServer server; - WhiteboardInsertOperation::ref firstOp = boost::make_shared(); + WhiteboardInsertOperation::ref firstOp = std::make_shared(); firstOp->setID("0"); server.handleLocalOperationReceived(firstOp); - WhiteboardInsertOperation::ref serverOp = boost::make_shared(); + WhiteboardInsertOperation::ref serverOp = std::make_shared(); serverOp->setID("a"); serverOp->setParentID("0"); serverOp->setPos(1); server.handleLocalOperationReceived(serverOp); - serverOp = boost::make_shared(); + serverOp = std::make_shared(); serverOp->setID("b"); serverOp->setParentID("a"); serverOp->setPos(2); server.handleLocalOperationReceived(serverOp); - serverOp = boost::make_shared(); + serverOp = std::make_shared(); serverOp->setID("c"); serverOp->setParentID("b"); serverOp->setPos(3); server.handleLocalOperationReceived(serverOp); - WhiteboardInsertOperation::ref clientOp = boost::make_shared(); - WhiteboardEllipseElement::ref clientElement = boost::make_shared(0,0,0,0); + WhiteboardInsertOperation::ref clientOp = std::make_shared(); + WhiteboardEllipseElement::ref clientElement = std::make_shared(0,0,0,0); clientOp->setID("d"); clientOp->setParentID("0"); clientOp->setPos(1); clientOp->setElement(clientElement); - WhiteboardInsertOperation::ref op = boost::dynamic_pointer_cast(server.handleClientOperationReceived(clientOp)); + WhiteboardInsertOperation::ref op = std::dynamic_pointer_cast(server.handleClientOperationReceived(clientOp)); CPPUNIT_ASSERT_EQUAL(std::string("c"), op->getParentID()); CPPUNIT_ASSERT_EQUAL(std::string("d"), op->getID()); CPPUNIT_ASSERT_EQUAL(1, op->getPos()); - CPPUNIT_ASSERT_EQUAL(clientElement, boost::dynamic_pointer_cast(op->getElement())); + CPPUNIT_ASSERT_EQUAL(clientElement, std::dynamic_pointer_cast(op->getElement())); } }; diff --git a/Swiften/Whiteboard/WhiteboardClient.cpp b/Swiften/Whiteboard/WhiteboardClient.cpp index f272a8c..d7ed3ad 100644 --- a/Swiften/Whiteboard/WhiteboardClient.cpp +++ b/Swiften/Whiteboard/WhiteboardClient.cpp @@ -13,8 +13,7 @@ #include #include - -#include +#include #include @@ -23,17 +22,17 @@ namespace Swift { localOperations_.push_back(operation); WhiteboardOperation::ref op; - WhiteboardInsertOperation::ref insertOp = boost::dynamic_pointer_cast(operation); + WhiteboardInsertOperation::ref insertOp = std::dynamic_pointer_cast(operation); if (insertOp) { - op = boost::make_shared(*insertOp); + op = std::make_shared(*insertOp); } - WhiteboardUpdateOperation::ref updateOp = boost::dynamic_pointer_cast(operation); + WhiteboardUpdateOperation::ref updateOp = std::dynamic_pointer_cast(operation); if (updateOp) { - op = boost::make_shared(*updateOp); + op = std::make_shared(*updateOp); } - WhiteboardDeleteOperation::ref deleteOp = boost::dynamic_pointer_cast(operation); + WhiteboardDeleteOperation::ref deleteOp = std::dynamic_pointer_cast(operation); if (deleteOp) { - op = boost::make_shared(*deleteOp); + op = std::make_shared(*deleteOp); } if (!bridge_.empty()) { @@ -43,17 +42,17 @@ namespace Swift { if (lastSentOperationID_.empty()) { - WhiteboardInsertOperation::ref insertOp = boost::dynamic_pointer_cast(operation); + WhiteboardInsertOperation::ref insertOp = std::dynamic_pointer_cast(operation); if (insertOp) { - op = boost::make_shared(*insertOp); + op = std::make_shared(*insertOp); } - WhiteboardUpdateOperation::ref updateOp = boost::dynamic_pointer_cast(operation); + WhiteboardUpdateOperation::ref updateOp = std::dynamic_pointer_cast(operation); if (updateOp) { - op = boost::make_shared(*updateOp); + op = std::make_shared(*updateOp); } - WhiteboardDeleteOperation::ref deleteOp = boost::dynamic_pointer_cast(operation); + WhiteboardDeleteOperation::ref deleteOp = std::dynamic_pointer_cast(operation); if (deleteOp) { - op = boost::make_shared(*deleteOp); + op = std::make_shared(*deleteOp); } diff --git a/Swiften/Whiteboard/WhiteboardResponder.cpp b/Swiften/Whiteboard/WhiteboardResponder.cpp index b0b3e6c..f9df709 100644 --- a/Swiften/Whiteboard/WhiteboardResponder.cpp +++ b/Swiften/Whiteboard/WhiteboardResponder.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include @@ -23,17 +23,17 @@ namespace Swift { WhiteboardResponder::WhiteboardResponder(WhiteboardSessionManager* sessionManager, IQRouter* router) : SetResponder(router), sessionManager_(sessionManager), router_(router) { } - bool WhiteboardResponder::handleSetRequest(const JID& from, const JID& /*to*/, const std::string& id, boost::shared_ptr payload) { + bool WhiteboardResponder::handleSetRequest(const JID& from, const JID& /*to*/, const std::string& id, std::shared_ptr payload) { if (payload->getType() == WhiteboardPayload::SessionRequest) { if (sessionManager_->getSession(from)) { sendError(from, id, ErrorPayload::Conflict, ErrorPayload::Cancel); } else { - sendResponse(from, id, boost::shared_ptr()); - IncomingWhiteboardSession::ref session = boost::make_shared(from, router_); + sendResponse(from, id, std::shared_ptr()); + IncomingWhiteboardSession::ref session = std::make_shared(from, router_); sessionManager_->handleIncomingSession(session); } } else { - sendResponse(from, id, boost::shared_ptr()); + sendResponse(from, id, std::shared_ptr()); WhiteboardSession::ref session = sessionManager_->getSession(from); if (session != nullptr) { session->handleIncomingAction(payload); diff --git a/Swiften/Whiteboard/WhiteboardResponder.h b/Swiften/Whiteboard/WhiteboardResponder.h index 0821a9f..ac44664 100644 --- a/Swiften/Whiteboard/WhiteboardResponder.h +++ b/Swiften/Whiteboard/WhiteboardResponder.h @@ -23,7 +23,7 @@ namespace Swift { class SWIFTEN_API WhiteboardResponder : public SetResponder { public: WhiteboardResponder(WhiteboardSessionManager* sessionManager, IQRouter* router); - bool handleSetRequest(const JID& from, const JID& /*to*/, const std::string& id, boost::shared_ptr payload); + bool handleSetRequest(const JID& from, const JID& /*to*/, const std::string& id, std::shared_ptr payload); private: WhiteboardSessionManager* sessionManager_; diff --git a/Swiften/Whiteboard/WhiteboardSession.cpp b/Swiften/Whiteboard/WhiteboardSession.cpp index 23ca312..befef4f 100644 --- a/Swiften/Whiteboard/WhiteboardSession.cpp +++ b/Swiften/Whiteboard/WhiteboardSession.cpp @@ -13,8 +13,7 @@ #include #include - -#include +#include #include #include @@ -27,7 +26,7 @@ namespace Swift { WhiteboardSession::~WhiteboardSession() { } - void WhiteboardSession::handleIncomingAction(boost::shared_ptr payload) { + void WhiteboardSession::handleIncomingAction(std::shared_ptr payload) { switch (payload->getType()) { case WhiteboardPayload::Data: handleIncomingOperation(payload->getOperation()); @@ -48,21 +47,21 @@ namespace Swift { } void WhiteboardSession::sendElement(const WhiteboardElement::ref element) { - boost::shared_ptr payload = boost::make_shared(); + std::shared_ptr payload = std::make_shared(); payload->setElement(element); - boost::shared_ptr > request = boost::make_shared >(IQ::Set, toJID_, payload, router_); + std::shared_ptr > request = std::make_shared >(IQ::Set, toJID_, payload, router_); request->send(); } - void WhiteboardSession::sendPayload(boost::shared_ptr payload) { - boost::shared_ptr > request = boost::make_shared >(IQ::Set, toJID_, payload, router_); + void WhiteboardSession::sendPayload(std::shared_ptr payload) { + std::shared_ptr > request = std::make_shared >(IQ::Set, toJID_, payload, router_); request->send(); } void WhiteboardSession::cancel() { if (router_->isAvailable()) { - boost::shared_ptr payload = boost::make_shared(WhiteboardPayload::SessionTerminate); - boost::shared_ptr > request = boost::make_shared >(IQ::Set, toJID_, payload, router_); + std::shared_ptr payload = std::make_shared(WhiteboardPayload::SessionTerminate); + std::shared_ptr > request = std::make_shared >(IQ::Set, toJID_, payload, router_); request->send(); } onSessionTerminated(toJID_); diff --git a/Swiften/Whiteboard/WhiteboardSession.h b/Swiften/Whiteboard/WhiteboardSession.h index da927b3..63d9670 100644 --- a/Swiften/Whiteboard/WhiteboardSession.h +++ b/Swiften/Whiteboard/WhiteboardSession.h @@ -12,7 +12,7 @@ #pragma once -#include +#include #include #include @@ -29,12 +29,12 @@ namespace Swift { class SWIFTEN_API WhiteboardSession { public: - typedef boost::shared_ptr ref; + typedef std::shared_ptr ref; public: WhiteboardSession(const JID& jid, IQRouter* router); virtual ~WhiteboardSession(); - void handleIncomingAction(boost::shared_ptr payload); + void handleIncomingAction(std::shared_ptr payload); void sendElement(const WhiteboardElement::ref element); virtual void sendOperation(WhiteboardOperation::ref operation) = 0; void cancel(); @@ -51,7 +51,7 @@ namespace Swift { virtual void handleIncomingOperation(WhiteboardOperation::ref operation) = 0; protected: - void sendPayload(boost::shared_ptr payload); + void sendPayload(std::shared_ptr payload); JID toJID_; IQRouter* router_; diff --git a/Swiften/Whiteboard/WhiteboardSessionManager.cpp b/Swiften/Whiteboard/WhiteboardSessionManager.cpp index 36f02cc..66b5ef8 100644 --- a/Swiften/Whiteboard/WhiteboardSessionManager.cpp +++ b/Swiften/Whiteboard/WhiteboardSessionManager.cpp @@ -13,8 +13,9 @@ #include +#include + #include -#include #include #include @@ -37,7 +38,7 @@ namespace Swift { WhiteboardSession::ref WhiteboardSessionManager::getSession(const JID& to) { if (sessions_.find(to) == sessions_.end()) { - return boost::shared_ptr(); + return std::shared_ptr(); } return sessions_[to]; } @@ -47,7 +48,7 @@ namespace Swift { if (fullJID.isBare()) { fullJID = getFullJID(fullJID); } - OutgoingWhiteboardSession::ref session = boost::make_shared(fullJID, router_); + OutgoingWhiteboardSession::ref session = std::make_shared(fullJID, router_); sessions_[fullJID] = session; session->onSessionTerminated.connect(boost::bind(&WhiteboardSessionManager::deleteSessionEntry, this, _1)); session->onRequestRejected.connect(boost::bind(&WhiteboardSessionManager::deleteSessionEntry, this, _1)); diff --git a/Swiften/Whiteboard/WhiteboardSessionManager.h b/Swiften/Whiteboard/WhiteboardSessionManager.h index 44ec087..44ce14a 100644 --- a/Swiften/Whiteboard/WhiteboardSessionManager.h +++ b/Swiften/Whiteboard/WhiteboardSessionManager.h @@ -50,7 +50,7 @@ namespace Swift { void deleteSessionEntry(const JID& contact); private: - std::map > sessions_; + std::map > sessions_; IQRouter* router_; StanzaChannel* stanzaChannel_; PresenceOracle* presenceOracle_; diff --git a/Swiften/Whiteboard/WhiteboardTransformer.cpp b/Swiften/Whiteboard/WhiteboardTransformer.cpp index 40e364b..1d519f4 100644 --- a/Swiften/Whiteboard/WhiteboardTransformer.cpp +++ b/Swiften/Whiteboard/WhiteboardTransformer.cpp @@ -12,16 +12,16 @@ #include -#include +#include namespace Swift { std::pair WhiteboardTransformer::transform(WhiteboardOperation::ref clientOp, WhiteboardOperation::ref serverOp) { - WhiteboardInsertOperation::ref clientInsert = boost::dynamic_pointer_cast(clientOp); - WhiteboardInsertOperation::ref serverInsert = boost::dynamic_pointer_cast(serverOp); - WhiteboardUpdateOperation::ref clientUpdate = boost::dynamic_pointer_cast(clientOp); - WhiteboardUpdateOperation::ref serverUpdate = boost::dynamic_pointer_cast(serverOp); - WhiteboardDeleteOperation::ref clientDelete = boost::dynamic_pointer_cast(clientOp); - WhiteboardDeleteOperation::ref serverDelete = boost::dynamic_pointer_cast(serverOp); + WhiteboardInsertOperation::ref clientInsert = std::dynamic_pointer_cast(clientOp); + WhiteboardInsertOperation::ref serverInsert = std::dynamic_pointer_cast(serverOp); + WhiteboardUpdateOperation::ref clientUpdate = std::dynamic_pointer_cast(clientOp); + WhiteboardUpdateOperation::ref serverUpdate = std::dynamic_pointer_cast(serverOp); + WhiteboardDeleteOperation::ref clientDelete = std::dynamic_pointer_cast(clientOp); + WhiteboardDeleteOperation::ref serverDelete = std::dynamic_pointer_cast(serverOp); if (clientInsert && serverInsert) { return transform(clientInsert, serverInsert); } else if (clientUpdate && serverUpdate) { @@ -47,9 +47,9 @@ namespace Swift { std::pair WhiteboardTransformer::transform(WhiteboardInsertOperation::ref clientOp, WhiteboardInsertOperation::ref serverOp) { std::pair result; - result.first = boost::make_shared(*serverOp); + result.first = std::make_shared(*serverOp); result.first->setParentID(clientOp->getID()); - result.second = boost::make_shared(*clientOp); + result.second = std::make_shared(*clientOp); result.second->setParentID(serverOp->getID()); if (clientOp->getPos() <= serverOp->getPos()) { result.first->setPos(result.first->getPos()+1); @@ -61,15 +61,15 @@ namespace Swift { std::pair WhiteboardTransformer::transform(WhiteboardUpdateOperation::ref clientOp, WhiteboardUpdateOperation::ref serverOp) { std::pair result; - result.first = boost::make_shared(*serverOp); + result.first = std::make_shared(*serverOp); result.first->setParentID(clientOp->getID()); if (clientOp->getPos() == serverOp->getPos()) { - result.second = boost::make_shared(*serverOp); + result.second = std::make_shared(*serverOp); result.second->setID(clientOp->getID()); result.second->setParentID(serverOp->getID()); } else { - result.second = boost::make_shared(*clientOp); + result.second = std::make_shared(*clientOp); result.second->setParentID(serverOp->getID()); } @@ -95,9 +95,9 @@ namespace Swift { std::pair WhiteboardTransformer::transform(WhiteboardUpdateOperation::ref clientOp, WhiteboardInsertOperation::ref serverOp) { std::pair result; - result.first = boost::make_shared(*serverOp); + result.first = std::make_shared(*serverOp); result.first->setParentID(clientOp->getID()); - result.second = boost::make_shared(*clientOp); + result.second = std::make_shared(*clientOp); result.second->setParentID(serverOp->getID()); if (serverOp->getPos() <= clientOp->getPos()) { result.second->setPos(result.second->getPos()+1); @@ -107,9 +107,9 @@ namespace Swift { std::pair WhiteboardTransformer::transform(WhiteboardInsertOperation::ref clientOp, WhiteboardUpdateOperation::ref serverOp) { std::pair result; - result.first = boost::make_shared(*serverOp); + result.first = std::make_shared(*serverOp); result.first->setParentID(clientOp->getID()); - result.second = boost::make_shared(*clientOp); + result.second = std::make_shared(*clientOp); result.second->setParentID(serverOp->getID()); if (serverOp->getPos() >= clientOp->getPos()) { result.first->setPos(result.first->getPos()+1); @@ -119,9 +119,9 @@ namespace Swift { std::pair WhiteboardTransformer::transform(WhiteboardDeleteOperation::ref clientOp, WhiteboardDeleteOperation::ref serverOp) { std::pair result; - result.first = boost::make_shared(*serverOp); + result.first = std::make_shared(*serverOp); result.first->setParentID(clientOp->getID()); - result.second = boost::make_shared(*clientOp); + result.second = std::make_shared(*clientOp); result.second->setParentID(serverOp->getID()); if (clientOp->getPos() == -1) { result.second->setPos(-1); @@ -142,9 +142,9 @@ namespace Swift { std::pair WhiteboardTransformer::transform(WhiteboardInsertOperation::ref clientOp, WhiteboardDeleteOperation::ref serverOp) { std::pair result; - result.first = boost::make_shared(*serverOp); + result.first = std::make_shared(*serverOp); result.first->setParentID(clientOp->getID()); - result.second = boost::make_shared(*clientOp); + result.second = std::make_shared(*clientOp); result.second->setParentID(serverOp->getID()); if (clientOp->getPos() <= serverOp->getPos()) { result.first->setPos(result.first->getPos()+1); @@ -156,9 +156,9 @@ namespace Swift { std::pair WhiteboardTransformer::transform(WhiteboardDeleteOperation::ref clientOp, WhiteboardInsertOperation::ref serverOp) { std::pair result; - result.first = boost::make_shared(*serverOp); + result.first = std::make_shared(*serverOp); result.first->setParentID(clientOp->getID()); - result.second = boost::make_shared(*clientOp); + result.second = std::make_shared(*clientOp); result.second->setParentID(serverOp->getID()); if (serverOp->getPos() <= clientOp->getPos()) { result.second->setPos(result.second->getPos()+1); @@ -170,13 +170,13 @@ namespace Swift { std::pair WhiteboardTransformer::transform(WhiteboardUpdateOperation::ref clientOp, WhiteboardDeleteOperation::ref serverOp) { std::pair result; - result.first = boost::make_shared(*serverOp); + result.first = std::make_shared(*serverOp); result.first->setParentID(clientOp->getID()); - WhiteboardUpdateOperation::ref updateOp = boost::make_shared(*clientOp); + WhiteboardUpdateOperation::ref updateOp = std::make_shared(*clientOp); result.second = updateOp; result.second->setParentID(serverOp->getID()); if (clientOp->getPos() == serverOp->getPos()) { - WhiteboardDeleteOperation::ref deleteOp = boost::make_shared(); + WhiteboardDeleteOperation::ref deleteOp = std::make_shared(); result.second = deleteOp; result.second->setPos(-1); result.second->setID(clientOp->getID()); @@ -195,13 +195,13 @@ namespace Swift { std::pair WhiteboardTransformer::transform(WhiteboardDeleteOperation::ref clientOp, WhiteboardUpdateOperation::ref serverOp) { std::pair result; - WhiteboardUpdateOperation::ref updateOp = boost::make_shared(*serverOp); + WhiteboardUpdateOperation::ref updateOp = std::make_shared(*serverOp); result.first = updateOp; result.first->setParentID(clientOp->getID()); - result.second = boost::make_shared(*clientOp); + result.second = std::make_shared(*clientOp); result.second->setParentID(serverOp->getID()); if (clientOp->getPos() == serverOp->getPos()) { - WhiteboardDeleteOperation::ref deleteOp = boost::make_shared(); + WhiteboardDeleteOperation::ref deleteOp = std::make_shared(); result.first = deleteOp; result.first->setPos(-1); result.first->setID(serverOp->getID()); -- cgit v0.10.2-6-g49f6