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 << "Inva