summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-04-01 17:23:49 (GMT)
committerTobias Markmann <tm@ayena.de>2016-04-04 08:28:23 (GMT)
commit741c45b74d5f634622eb5f757c49323274fb8937 (patch)
treeb9cfa6c2fe2e79e03cc8cb7c1ca1e9cf45aa5328
parenteddd92ed76ae68cb1e202602fd3ebd11b69191a2 (diff)
downloadswift-741c45b74d5f634622eb5f757c49323274fb8937.zip
swift-741c45b74d5f634622eb5f757c49323274fb8937.tar.bz2
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 <boost\/shared_ptr\.hpp>/\#include <memory>/g' 's/\#include <boost\/enable_shared_from_this\.hpp>/\#include <memory>/g' 's/\#include <boost\/smart_ptr\/make_shared\.hpp>/\#include <memory>/g' 's/\#include <boost\/make_shared\.hpp>/\#include <memory>/g' 's/\#include <boost\/weak_ptr\.hpp>/\#include <memory>/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
-rw-r--r--Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp4
-rw-r--r--Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoPayloadSerializer.h7
-rw-r--r--Limber/Server/ServerFromClientSession.cpp21
-rw-r--r--Limber/Server/ServerFromClientSession.h8
-rw-r--r--Limber/Server/ServerSession.h6
-rw-r--r--Limber/Server/ServerStanzaRouter.cpp2
-rw-r--r--Limber/Server/ServerStanzaRouter.h5
-rw-r--r--Limber/Server/UnitTest/ServerStanzaRouterTest.cpp8
-rw-r--r--Limber/main.cpp22
-rw-r--r--Slimber/FileVCardCollection.cpp11
-rw-r--r--Slimber/FileVCardCollection.h7
-rw-r--r--Slimber/LinkLocalPresenceManager.cpp16
-rw-r--r--Slimber/LinkLocalPresenceManager.h13
-rw-r--r--Slimber/MainController.h5
-rw-r--r--Slimber/Server.cpp72
-rw-r--r--Slimber/Server.h42
-rw-r--r--Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp46
-rw-r--r--Slimber/VCardCollection.h8
-rw-r--r--Sluift/ElementConvertors/BodyConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/BodyConvertor.h4
-rw-r--r--Sluift/ElementConvertors/CommandConvertor.cpp11
-rw-r--r--Sluift/ElementConvertors/CommandConvertor.h4
-rw-r--r--Sluift/ElementConvertors/DOMElementConvertor.cpp19
-rw-r--r--Sluift/ElementConvertors/DOMElementConvertor.h4
-rw-r--r--Sluift/ElementConvertors/DefaultElementConvertor.cpp6
-rw-r--r--Sluift/ElementConvertors/DefaultElementConvertor.h6
-rw-r--r--Sluift/ElementConvertors/DelayConvertor.cpp9
-rw-r--r--Sluift/ElementConvertors/DelayConvertor.h4
-rw-r--r--Sluift/ElementConvertors/DiscoInfoConvertor.cpp9
-rw-r--r--Sluift/ElementConvertors/DiscoInfoConvertor.h4
-rw-r--r--Sluift/ElementConvertors/DiscoItemsConvertor.cpp9
-rw-r--r--Sluift/ElementConvertors/DiscoItemsConvertor.h4
-rw-r--r--Sluift/ElementConvertors/ElementConvertors.ipp78
-rw-r--r--Sluift/ElementConvertors/FormConvertor.cpp36
-rw-r--r--Sluift/ElementConvertors/FormConvertor.h4
-rw-r--r--Sluift/ElementConvertors/ForwardedConvertor.cpp15
-rw-r--r--Sluift/ElementConvertors/ForwardedConvertor.h4
-rw-r--r--Sluift/ElementConvertors/IQConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/IQConvertor.h4
-rw-r--r--Sluift/ElementConvertors/IsodeIQDelegationConvertor.cpp10
-rw-r--r--Sluift/ElementConvertors/IsodeIQDelegationConvertor.h4
-rw-r--r--Sluift/ElementConvertors/MAMFinConvertor.cpp11
-rw-r--r--Sluift/ElementConvertors/MAMFinConvertor.h4
-rw-r--r--Sluift/ElementConvertors/MAMQueryConvertor.cpp13
-rw-r--r--Sluift/ElementConvertors/MAMQueryConvertor.h4
-rw-r--r--Sluift/ElementConvertors/MAMResultConvertor.cpp11
-rw-r--r--Sluift/ElementConvertors/MAMResultConvertor.h4
-rw-r--r--Sluift/ElementConvertors/MessageConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/MessageConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PresenceConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PresenceConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubAffiliationConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PubSubAffiliationConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubAffiliationsConvertor.cpp15
-rw-r--r--Sluift/ElementConvertors/PubSubAffiliationsConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubConfigureConvertor.cpp10
-rw-r--r--Sluift/ElementConvertors/PubSubConfigureConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubCreateConvertor.cpp10
-rw-r--r--Sluift/ElementConvertors/PubSubCreateConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubDefaultConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PubSubDefaultConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubEventAssociateConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PubSubEventAssociateConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubEventCollectionConvertor.cpp12
-rw-r--r--Sluift/ElementConvertors/PubSubEventCollectionConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubEventConfigurationConvertor.cpp10
-rw-r--r--Sluift/ElementConvertors/PubSubEventConfigurationConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubEventConvertor.cpp10
-rw-r--r--Sluift/ElementConvertors/PubSubEventConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubEventDeleteConvertor.cpp10
-rw-r--r--Sluift/ElementConvertors/PubSubEventDeleteConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubEventDisassociateConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PubSubEventDisassociateConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubEventItemConvertor.cpp15
-rw-r--r--Sluift/ElementConvertors/PubSubEventItemConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubEventItemsConvertor.cpp21
-rw-r--r--Sluift/ElementConvertors/PubSubEventItemsConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubEventPurgeConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PubSubEventPurgeConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubEventRedirectConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PubSubEventRedirectConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubEventRetractConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PubSubEventRetractConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubItemConvertor.cpp15
-rw-r--r--Sluift/ElementConvertors/PubSubItemConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubItemsConvertor.cpp15
-rw-r--r--Sluift/ElementConvertors/PubSubItemsConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubOptionsConvertor.cpp10
-rw-r--r--Sluift/ElementConvertors/PubSubOptionsConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.cpp15
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.cpp10
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.cpp10
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.cpp10
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.cpp15
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubPublishConvertor.cpp15
-rw-r--r--Sluift/ElementConvertors/PubSubPublishConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubRetractConvertor.cpp15
-rw-r--r--Sluift/ElementConvertors/PubSubRetractConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubSubscribeConvertor.cpp10
-rw-r--r--Sluift/ElementConvertors/PubSubSubscribeConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubSubscriptionConvertor.cpp10
-rw-r--r--Sluift/ElementConvertors/PubSubSubscriptionConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubSubscriptionsConvertor.cpp15
-rw-r--r--Sluift/ElementConvertors/PubSubSubscriptionsConvertor.h4
-rw-r--r--Sluift/ElementConvertors/PubSubUnsubscribeConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/PubSubUnsubscribeConvertor.h4
-rw-r--r--Sluift/ElementConvertors/RawXMLElementConvertor.cpp13
-rw-r--r--Sluift/ElementConvertors/RawXMLElementConvertor.h4
-rw-r--r--Sluift/ElementConvertors/ResultSetConvertor.cpp9
-rw-r--r--Sluift/ElementConvertors/ResultSetConvertor.h4
-rw-r--r--Sluift/ElementConvertors/SecurityLabelConvertor.cpp9
-rw-r--r--Sluift/ElementConvertors/SecurityLabelConvertor.h4
-rw-r--r--Sluift/ElementConvertors/SoftwareVersionConvertor.cpp9
-rw-r--r--Sluift/ElementConvertors/SoftwareVersionConvertor.h4
-rw-r--r--Sluift/ElementConvertors/StanzaConvertor.h10
-rw-r--r--Sluift/ElementConvertors/StatusConvertor.cpp9
-rw-r--r--Sluift/ElementConvertors/StatusConvertor.h4
-rw-r--r--Sluift/ElementConvertors/StatusShowConvertor.cpp9
-rw-r--r--Sluift/ElementConvertors/StatusShowConvertor.h4
-rw-r--r--Sluift/ElementConvertors/SubjectConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/SubjectConvertor.h4
-rw-r--r--Sluift/ElementConvertors/UserLocationConvertor.cpp9
-rw-r--r--Sluift/ElementConvertors/UserLocationConvertor.h4
-rw-r--r--Sluift/ElementConvertors/UserTuneConvertor.cpp9
-rw-r--r--Sluift/ElementConvertors/UserTuneConvertor.h4
-rw-r--r--Sluift/ElementConvertors/VCardConvertor.cpp9
-rw-r--r--Sluift/ElementConvertors/VCardConvertor.h4
-rw-r--r--Sluift/ElementConvertors/VCardUpdateConvertor.cpp9
-rw-r--r--Sluift/ElementConvertors/VCardUpdateConvertor.h4
-rw-r--r--Sluift/GenericLuaElementConvertor.h14
-rw-r--r--Sluift/ITunesInterface.h6
-rw-r--r--Sluift/ITunesInterface.mm4
-rw-r--r--Sluift/Lua/Value.cpp4
-rw-r--r--Sluift/Lua/Value.h31
-rw-r--r--Sluift/LuaElementConvertor.h6
-rw-r--r--Sluift/LuaElementConvertors.cpp68
-rw-r--r--Sluift/LuaElementConvertors.h16
-rw-r--r--Sluift/Response.cpp2
-rw-r--r--Sluift/Response.h14
-rw-r--r--Sluift/SluiftClient.cpp12
-rw-r--r--Sluift/SluiftClient.h28
-rw-r--r--Sluift/SluiftComponent.cpp10
-rw-r--r--Sluift/SluiftComponent.h20
-rw-r--r--Sluift/client.cpp86
-rw-r--r--Sluift/component.cpp54
-rw-r--r--Sluift/sluift.cpp6
-rw-r--r--SwifTools/CrashReporter.cpp12
-rw-r--r--SwifTools/CrashReporter.h4
-rw-r--r--SwifTools/Idle/ActualIdleDetector.h6
-rw-r--r--SwifTools/Idle/IdleDetector.h2
-rw-r--r--SwifTools/Idle/UnitTest/ActualIdleDetectorTest.cpp8
-rw-r--r--SwifTools/Notifier/GrowlNotifier.h4
-rw-r--r--SwifTools/Notifier/GrowlNotifier.mm4
-rw-r--r--SwifTools/Notifier/NotificationCenterNotifier.h4
-rw-r--r--SwifTools/Notifier/NotificationCenterNotifier.mm8
-rw-r--r--Swift/Controllers/AdHocController.cpp2
-rw-r--r--Swift/Controllers/AdHocController.h4
-rw-r--r--Swift/Controllers/AdHocManager.cpp26
-rw-r--r--Swift/Controllers/AdHocManager.h12
-rw-r--r--Swift/Controllers/BlockListController.cpp14
-rw-r--r--Swift/Controllers/BlockListController.h8
-rw-r--r--Swift/Controllers/Chat/ChatController.cpp73
-rw-r--r--Swift/Controllers/Chat/ChatController.h26
-rw-r--r--Swift/Controllers/Chat/ChatControllerBase.cpp45
-rw-r--r--Swift/Controllers/Chat/ChatControllerBase.h36
-rw-r--r--Swift/Controllers/Chat/ChatMessageParser.cpp30
-rw-r--r--Swift/Controllers/Chat/ChatsManager.cpp51
-rw-r--r--Swift/Controllers/Chat/ChatsManager.h17
-rw-r--r--Swift/Controllers/Chat/MUCController.cpp66
-rw-r--r--Swift/Controllers/Chat/MUCController.h30
-rw-r--r--Swift/Controllers/Chat/MUCSearchController.cpp6
-rw-r--r--Swift/Controllers/Chat/MUCSearchController.h7
-rw-r--r--Swift/Controllers/Chat/UnitTest/ChatMessageParserTest.cpp28
-rw-r--r--Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp126
-rw-r--r--Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp84
-rw-r--r--Swift/Controllers/Chat/UserSearchController.cpp28
-rw-r--r--Swift/Controllers/Chat/UserSearchController.h15
-rw-r--r--Swift/Controllers/Contact.h9
-rw-r--r--Swift/Controllers/ContactEditController.cpp7
-rw-r--r--Swift/Controllers/ContactsFromXMPPRoster.cpp4
-rw-r--r--Swift/Controllers/EventNotifier.cpp10
-rw-r--r--Swift/Controllers/EventNotifier.h4
-rw-r--r--Swift/Controllers/EventWindowController.cpp8
-rw-r--r--Swift/Controllers/EventWindowController.h4
-rw-r--r--Swift/Controllers/FileTransfer/FileTransferController.cpp9
-rw-r--r--Swift/Controllers/FileTransfer/FileTransferController.h8
-rw-r--r--Swift/Controllers/FileTransferListController.cpp4
-rw-r--r--Swift/Controllers/FileTransferListController.h4
-rw-r--r--Swift/Controllers/HighlightEditorController.cpp4
-rw-r--r--Swift/Controllers/HighlightEditorController.h7
-rw-r--r--Swift/Controllers/HighlightManager.cpp2
-rw-r--r--Swift/Controllers/HighlightManager.h6
-rw-r--r--Swift/Controllers/HistoryViewController.cpp8
-rw-r--r--Swift/Controllers/HistoryViewController.h4
-rw-r--r--Swift/Controllers/MainController.cpp26
-rw-r--r--Swift/Controllers/MainController.h11
-rw-r--r--Swift/Controllers/PresenceNotifier.cpp2
-rw-r--r--Swift/Controllers/PresenceNotifier.h7
-rw-r--r--Swift/Controllers/ProfileController.cpp4
-rw-r--r--Swift/Controllers/Roster/ContactRosterItem.cpp6
-rw-r--r--Swift/Controllers/Roster/ContactRosterItem.h8
-rw-r--r--Swift/Controllers/Roster/Roster.h5
-rw-r--r--Swift/Controllers/Roster/RosterController.cpp37
-rw-r--r--Swift/Controllers/Roster/RosterController.h15
-rw-r--r--Swift/Controllers/Roster/RosterItem.h3
-rw-r--r--Swift/Controllers/Roster/TableRoster.h2
-rw-r--r--Swift/Controllers/Roster/UnitTest/RosterControllerTest.cpp4
-rw-r--r--Swift/Controllers/Roster/UnitTest/RosterTest.cpp8
-rw-r--r--Swift/Controllers/Roster/UnitTest/TableRosterTest.cpp6
-rw-r--r--Swift/Controllers/ShowProfileController.cpp2
-rw-r--r--Swift/Controllers/SoundEventController.cpp6
-rw-r--r--Swift/Controllers/SoundEventController.h4
-rw-r--r--Swift/Controllers/StatusTracker.cpp16
-rw-r--r--Swift/Controllers/StatusTracker.h9
-rw-r--r--Swift/Controllers/Storages/RosterFileStorage.cpp4
-rw-r--r--Swift/Controllers/Storages/RosterFileStorage.h6
-rw-r--r--Swift/Controllers/Storages/VCardFileStorage.cpp4
-rw-r--r--Swift/Controllers/Storages/VCardFileStorage.h2
-rw-r--r--Swift/Controllers/SystemTrayController.cpp2
-rw-r--r--Swift/Controllers/UIEvents/AcceptWhiteboardSessionUIEvent.h10
-rw-r--r--Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h2
-rw-r--r--Swift/Controllers/UIEvents/CancelWhiteboardSessionUIEvent.h10
-rw-r--r--Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h2
-rw-r--r--Swift/Controllers/UIEvents/InviteToMUCUIEvent.h5
-rw-r--r--Swift/Controllers/UIEvents/JoinMUCUIEvent.h4
-rw-r--r--Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h2
-rw-r--r--Swift/Controllers/UIEvents/RenameRosterItemUIEvent.h2
-rw-r--r--Swift/Controllers/UIEvents/RequestContactEditorUIEvent.h2
-rw-r--r--Swift/Controllers/UIEvents/RequestInviteToMUCUIEvent.h5
-rw-r--r--Swift/Controllers/UIEvents/RequestJoinMUCUIEvent.h5
-rw-r--r--Swift/Controllers/UIEvents/SendFileUIEvent.h2
-rw-r--r--Swift/Controllers/UIEvents/ShowProfileForRosterItemUIEvent.h2
-rw-r--r--Swift/Controllers/UIEvents/UIEvent.h6
-rw-r--r--Swift/Controllers/UIEvents/UIEventStream.h6
-rw-r--r--Swift/Controllers/UIInterfaces/AdHocCommandWindowFactory.h2
-rw-r--r--Swift/Controllers/UIInterfaces/ChatListWindow.h2
-rw-r--r--Swift/Controllers/UIInterfaces/ChatWindow.h17
-rw-r--r--Swift/Controllers/UIInterfaces/ContactEditWindow.h3
-rw-r--r--Swift/Controllers/UIInterfaces/EventWindow.h6
-rw-r--r--Swift/Controllers/UIInterfaces/LoginWindow.h3
-rw-r--r--Swift/Controllers/UIInterfaces/MainWindow.h5
-rw-r--r--Swift/Controllers/UIInterfaces/ProfileWindow.h2
-rw-r--r--Swift/Controllers/UIInterfaces/UserSearchWindow.h4
-rw-r--r--Swift/Controllers/UIInterfaces/WhiteboardWindow.h2
-rw-r--r--Swift/Controllers/UIInterfaces/WhiteboardWindowFactory.h8
-rw-r--r--Swift/Controllers/UnitTest/ContactSuggesterTest.cpp5
-rw-r--r--Swift/Controllers/UnitTest/MockChatWindow.h12
-rw-r--r--Swift/Controllers/UnitTest/MockMainWindow.h2
-rw-r--r--Swift/Controllers/UnitTest/PresenceNotifierTest.cpp46
-rw-r--r--Swift/Controllers/WhiteboardManager.cpp12
-rw-r--r--Swift/Controllers/WhiteboardManager.h5
-rw-r--r--Swift/Controllers/XMLConsoleController.cpp4
-rw-r--r--Swift/Controllers/XMLConsoleController.h5
-rw-r--r--Swift/Controllers/XMPPEvents/ErrorEvent.h3
-rw-r--r--Swift/Controllers/XMPPEvents/EventController.cpp22
-rw-r--r--Swift/Controllers/XMPPEvents/EventController.h13
-rw-r--r--Swift/Controllers/XMPPEvents/IncomingFileTransferEvent.h6
-rw-r--r--Swift/Controllers/XMPPEvents/MUCInviteEvent.h7
-rw-r--r--Swift/Controllers/XMPPEvents/MessageEvent.h11
-rw-r--r--Swift/Controllers/XMPPEvents/StanzaEvent.h3
-rw-r--r--Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h3
-rw-r--r--Swift/Controllers/XMPPURIController.cpp7
-rw-r--r--Swift/QtUI/ChatList/ChatListMUCItem.h2
-rw-r--r--Swift/QtUI/ChatList/ChatListRecentItem.h2
-rw-r--r--Swift/QtUI/ChatList/ChatListWhiteboardItem.h2
-rw-r--r--Swift/QtUI/ChatList/QtChatListWindow.cpp6
-rw-r--r--Swift/QtUI/ChatSnippet.cpp8
-rw-r--r--Swift/QtUI/ChatSnippet.h8
-rw-r--r--Swift/QtUI/CocoaUIHelpers.mm6
-rw-r--r--Swift/QtUI/EventViewer/EventDelegate.cpp14
-rw-r--r--Swift/QtUI/EventViewer/EventDelegate.h4
-rw-r--r--Swift/QtUI/EventViewer/EventModel.cpp4
-rw-r--r--Swift/QtUI/EventViewer/EventModel.h6
-rw-r--r--Swift/QtUI/EventViewer/QtEvent.cpp22
-rw-r--r--Swift/QtUI/EventViewer/QtEvent.h8
-rw-r--r--Swift/QtUI/EventViewer/QtEventWindow.cpp24
-rw-r--r--Swift/QtUI/EventViewer/QtEventWindow.h6
-rw-r--r--Swift/QtUI/EventViewer/main.cpp10
-rw-r--r--Swift/QtUI/MUCSearch/MUCSearchModel.h2
-rw-r--r--Swift/QtUI/MessageSnippet.cpp2
-rw-r--r--Swift/QtUI/QtAdHocCommandWindow.cpp2
-rw-r--r--Swift/QtUI/QtAdHocCommandWindow.h6
-rw-r--r--Swift/QtUI/QtAdHocCommandWithJIDWindow.cpp4
-rw-r--r--Swift/QtUI/QtAddBookmarkWindow.cpp2
-rw-r--r--Swift/QtUI/QtChatView.h6
-rw-r--r--Swift/QtUI/QtChatWindow.cpp9
-rw-r--r--Swift/QtUI/QtChatWindow.h6
-rw-r--r--Swift/QtUI/QtContactEditWidget.h3
-rw-r--r--Swift/QtUI/QtEditBookmarkWindow.cpp2
-rw-r--r--Swift/QtUI/QtFormWidget.cpp9
-rw-r--r--Swift/QtUI/QtHistoryWindow.cpp7
-rw-r--r--Swift/QtUI/QtJoinMUCWindow.cpp6
-rw-r--r--Swift/QtUI/QtLoginWindow.cpp14
-rw-r--r--Swift/QtUI/QtMainWindow.cpp20
-rw-r--r--Swift/QtUI/QtMainWindow.h2
-rw-r--r--Swift/QtUI/QtPlainChatView.cpp24
-rw-r--r--Swift/QtUI/QtPlainChatView.h8
-rw-r--r--Swift/QtUI/QtRosterHeader.cpp2
-rw-r--r--Swift/QtUI/QtRosterHeader.h4
-rw-r--r--Swift/QtUI/QtSubscriptionRequestWindow.cpp6
-rw-r--r--Swift/QtUI/QtSubscriptionRequestWindow.h10
-rw-r--r--Swift/QtUI/QtUIFactory.cpp4
-rw-r--r--Swift/QtUI/QtUIFactory.h6
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp30
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardWidget.h8
-rw-r--r--Swift/QtUI/QtWebKitChatView.cpp48
-rw-r--r--Swift/QtUI/QtWebKitChatView.h14
-rw-r--r--Swift/QtUI/Roster/QtFilterWidget.cpp2
-rw-r--r--Swift/QtUI/Roster/QtRosterWidget.cpp20
-rw-r--r--Swift/QtUI/Roster/QtTreeWidget.cpp7
-rw-r--r--Swift/QtUI/SystemMessageSnippet.cpp2
-rw-r--r--Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp4
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchWindow.cpp19
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchWindow.h2
-rw-r--r--Swift/QtUI/UserSearch/UserSearchModel.h2
-rw-r--r--Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp26
-rw-r--r--Swift/QtUI/WinUIHelpers.cpp4
-rw-r--r--Swiften/AdHoc/OutgoingAdHocCommandSession.cpp11
-rw-r--r--Swiften/AdHoc/OutgoingAdHocCommandSession.h5
-rw-r--r--Swiften/Avatars/UnitTest/AvatarManagerImplTest.cpp50
-rw-r--r--Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp46
-rw-r--r--Swiften/Avatars/UnitTest/VCardAvatarManagerTest.cpp20
-rw-r--r--Swiften/Avatars/UnitTest/VCardUpdateAvatarManagerTest.cpp28
-rw-r--r--Swiften/Avatars/VCardUpdateAvatarManager.cpp4
-rw-r--r--Swiften/Avatars/VCardUpdateAvatarManager.h5
-rw-r--r--Swiften/Base/Debug.cpp11
-rw-r--r--Swiften/Base/SafeByteArray.h15
-rw-r--r--Swiften/Chat/ChatStateNotifier.cpp9
-rw-r--r--Swiften/Chat/ChatStateNotifier.h2
-rw-r--r--Swiften/Chat/ChatStateTracker.cpp8
-rw-r--r--Swiften/Chat/ChatStateTracker.h6
-rw-r--r--Swiften/Chat/UnitTest/ChatStateNotifierTest.cpp12
-rw-r--r--Swiften/Client/Client.h6
-rw-r--r--Swiften/Client/ClientBlockListManager.cpp42
-rw-r--r--Swiften/Client/ClientBlockListManager.h14
-rw-r--r--Swiften/Client/ClientError.h11
-rw-r--r--Swiften/Client/ClientOptions.h4
-rw-r--r--Swiften/Client/ClientSession.cpp78
-rw-r--r--Swiften/Client/ClientSession.h40
-rw-r--r--Swiften/Client/ClientSessionStanzaChannel.cpp24
-rw-r--r--Swiften/Client/ClientSessionStanzaChannel.h22
-rw-r--r--Swiften/Client/CoreClient.cpp29
-rw-r--r--Swiften/Client/CoreClient.h33
-rw-r--r--Swiften/Client/DummyStanzaChannel.h24
-rw-r--r--Swiften/Client/NickResolver.cpp3
-rw-r--r--Swiften/Client/NickResolver.h3
-rw-r--r--Swiften/Client/StanzaChannel.h12
-rw-r--r--Swiften/Client/UnitTest/BlockListImplTest.cpp6
-rw-r--r--Swiften/Client/UnitTest/ClientBlockListManagerTest.cpp18
-rw-r--r--Swiften/Client/UnitTest/ClientSessionTest.cpp152
-rw-r--r--Swiften/Client/UnitTest/NickResolverTest.cpp4
-rw-r--r--Swiften/Component/ComponentConnector.cpp10
-rw-r--r--Swiften/Component/ComponentConnector.h17
-rw-r--r--Swiften/Component/ComponentSession.cpp23
-rw-r--r--Swiften/Component/ComponentSession.h28
-rw-r--r--Swiften/Component/ComponentSessionStanzaChannel.cpp20
-rw-r--r--Swiften/Component/ComponentSessionStanzaChannel.h18
-rw-r--r--Swiften/Component/CoreComponent.cpp14
-rw-r--r--Swiften/Component/CoreComponent.h21
-rw-r--r--Swiften/Component/UnitTest/ComponentConnectorTest.cpp12
-rw-r--r--Swiften/Component/UnitTest/ComponentHandshakeGeneratorTest.cpp6
-rw-r--r--Swiften/Component/UnitTest/ComponentSessionTest.cpp38
-rw-r--r--Swiften/Compress/ZLibCodecompressor.cpp2
-rw-r--r--Swiften/Compress/ZLibCodecompressor.h4
-rw-r--r--Swiften/Crypto/CryptoProvider.cpp4
-rw-r--r--Swiften/Crypto/CryptoProvider.h6
-rw-r--r--Swiften/Crypto/UnitTest/CryptoProviderTest.cpp10
-rw-r--r--Swiften/Crypto/WindowsCryptoProvider.cpp4
-rw-r--r--Swiften/Crypto/WindowsCryptoProvider.h5
-rw-r--r--Swiften/Disco/CapsManager.cpp4
-rw-r--r--Swiften/Disco/CapsManager.h2
-rw-r--r--Swiften/Disco/CapsMemoryStorage.h3
-rw-r--r--Swiften/Disco/CapsStorage.h2
-rw-r--r--Swiften/Disco/DiscoInfoResponder.cpp8
-rw-r--r--Swiften/Disco/DiscoInfoResponder.h2
-rw-r--r--Swiften/Disco/DiscoServiceWalker.cpp6
-rw-r--r--Swiften/Disco/DiscoServiceWalker.h9
-rw-r--r--Swiften/Disco/EntityCapsManager.cpp4
-rw-r--r--Swiften/Disco/EntityCapsManager.h2
-rw-r--r--Swiften/Disco/FeatureOracle.cpp4
-rw-r--r--Swiften/Disco/GetDiscoInfoRequest.h8
-rw-r--r--Swiften/Disco/GetDiscoItemsRequest.h8
-rw-r--r--Swiften/Disco/JIDDiscoInfoResponder.cpp8
-rw-r--r--Swiften/Disco/JIDDiscoInfoResponder.h2
-rw-r--r--Swiften/Disco/UnitTest/CapsInfoGeneratorTest.cpp16
-rw-r--r--Swiften/Disco/UnitTest/CapsManagerTest.cpp84
-rw-r--r--Swiften/Disco/UnitTest/DiscoInfoResponderTest.cpp12
-rw-r--r--Swiften/Disco/UnitTest/EntityCapsManagerTest.cpp52
-rw-r--r--Swiften/Disco/UnitTest/JIDDiscoInfoResponderTest.cpp16
-rw-r--r--Swiften/Elements/AuthFailure.h6
-rw-r--r--Swiften/Elements/Bytestreams.h4
-rw-r--r--Swiften/Elements/CapsInfo.h5
-rw-r--r--Swiften/Elements/CarbonsDisable.h6
-rw-r--r--Swiften/Elements/CarbonsEnable.h6
-rw-r--r--Swiften/Elements/CarbonsPrivate.h6
-rw-r--r--Swiften/Elements/CarbonsReceived.cpp6
-rw-r--r--Swiften/Elements/CarbonsReceived.h12
-rw-r--r--Swiften/Elements/CarbonsSent.cpp6
-rw-r--r--Swiften/Elements/CarbonsSent.h12
-rw-r--r--Swiften/Elements/ChatState.h4
-rw-r--r--Swiften/Elements/Command.h5
-rw-r--r--Swiften/Elements/ComponentHandshake.h5
-rw-r--r--Swiften/Elements/ContainerPayload.h11
-rw-r--r--Swiften/Elements/DeliveryReceipt.h4
-rw-r--r--Swiften/Elements/DeliveryReceiptRequest.h4
-rw-r--r--Swiften/Elements/DiscoInfo.h2
-rw-r--r--Swiften/Elements/ErrorPayload.h11
-rw-r--r--Swiften/Elements/Form.h30
-rw-r--r--Swiften/Elements/FormField.h5
-rw-r--r--Swiften/Elements/FormPage.cpp18
-rw-r--r--Swiften/Elements/FormPage.h29
-rw-r--r--Swiften/Elements/FormReportedRef.h6
-rw-r--r--Swiften/Elements/FormSection.cpp18
-rw-r--r--Swiften/Elements/FormSection.h29
-rw-r--r--Swiften/Elements/FormText.h5
-rw-r--r--Swiften/Elements/Forwarded.h12
-rw-r--r--Swiften/Elements/IBB.h12
-rw-r--r--Swiften/Elements/IQ.cpp30
-rw-r--r--Swiften/Elements/IQ.h24
-rw-r--r--Swiften/Elements/Idle.h5
-rw-r--r--Swiften/Elements/InBandRegistrationPayload.h4
-rw-r--r--Swiften/Elements/IsodeIQDelegation.h8
-rw-r--r--Swiften/Elements/JingleContentPayload.h20
-rw-r--r--Swiften/Elements/JingleDescription.h6
-rw-r--r--Swiften/Elements/JingleFileTransferDescription.h5
-rw-r--r--Swiften/Elements/JingleFileTransferFileInfo.h4
-rw-r--r--Swiften/Elements/JingleFileTransferHash.h5
-rw-r--r--Swiften/Elements/JingleIBBTransportPayload.h4
-rw-r--r--Swiften/Elements/JinglePayload.h26
-rw-r--r--Swiften/Elements/JingleS5BTransportPayload.h5
-rw-r--r--Swiften/Elements/JingleTransportPayload.h6
-rw-r--r--Swiften/Elements/MAMFin.h8
-rw-r--r--Swiften/Elements/MAMQuery.h14
-rw-r--r--Swiften/Elements/MUCAdminPayload.h4
-rw-r--r--Swiften/Elements/MUCDestroyPayload.h4
-rw-r--r--Swiften/Elements/MUCInvitationPayload.h4
-rw-r--r--Swiften/Elements/MUCOwnerPayload.h10
-rw-r--r--Swiften/Elements/MUCPayload.h2
-rw-r--r--Swiften/Elements/MUCUserPayload.h10
-rw-r--r--Swiften/Elements/Message.h17
-rw-r--r--Swiften/Elements/Payload.h6
-rw-r--r--Swiften/Elements/Presence.cpp10
-rw-r--r--Swiften/Elements/Presence.h18
-rw-r--r--Swiften/Elements/PrivateStorage.h12
-rw-r--r--Swiften/Elements/PubSubAffiliations.h10
-rw-r--r--Swiften/Elements/PubSubConfigure.h8
-rw-r--r--Swiften/Elements/PubSubCreate.h9
-rw-r--r--Swiften/Elements/PubSubEvent.h2
-rw-r--r--Swiften/Elements/PubSubEventCollection.h14
-rw-r--r--Swiften/Elements/PubSubEventConfiguration.h9
-rw-r--r--Swiften/Elements/PubSubEventDelete.h9
-rw-r--r--Swiften/Elements/PubSubEventItem.h10
-rw-r--r--Swiften/Elements/PubSubEventItems.h19
-rw-r--r--Swiften/Elements/PubSubItem.h11
-rw-r--r--Swiften/Elements/PubSubItems.h10
-rw-r--r--Swiften/Elements/PubSubOptions.h8
-rw-r--r--Swiften/Elements/PubSubOwnerAffiliations.h11
-rw-r--r--Swiften/Elements/PubSubOwnerConfigure.h8
-rw-r--r--Swiften/Elements/PubSubOwnerDefault.h8
-rw-r--r--Swiften/Elements/PubSubOwnerDelete.h9
-rw-r--r--Swiften/Elements/PubSubOwnerSubscriptions.h11
-rw-r--r--Swiften/Elements/PubSubPublish.h11
-rw-r--r--Swiften/Elements/PubSubRetract.h11
-rw-r--r--Swiften/Elements/PubSubSubscribe.h8
-rw-r--r--Swiften/Elements/PubSubSubscription.h8
-rw-r--r--Swiften/Elements/PubSubSubscriptions.h10
-rw-r--r--Swiften/Elements/Replace.h5
-rw-r--r--Swiften/Elements/ResultSet.h2
-rw-r--r--Swiften/Elements/RosterItemExchangePayload.h5
-rw-r--r--Swiften/Elements/RosterPayload.h4
-rw-r--r--Swiften/Elements/S5BProxyRequest.h4
-rw-r--r--Swiften/Elements/SearchPayload.h4
-rw-r--r--Swiften/Elements/SecurityLabelsCatalog.h11
-rw-r--r--Swiften/Elements/SoftwareVersion.h5
-rw-r--r--Swiften/Elements/Stanza.cpp18
-rw-r--r--Swiften/Elements/Stanza.h28
-rw-r--r--Swiften/Elements/StanzaAck.h6
-rw-r--r--Swiften/Elements/StreamError.h5
-rw-r--r--Swiften/Elements/StreamFeatures.h4
-rw-r--r--Swiften/Elements/StreamInitiation.h4
-rw-r--r--Swiften/Elements/StreamInitiationFileInfo.h4
-rw-r--r--Swiften/Elements/UnitTest/FormTest.cpp13
-rw-r--r--Swiften/Elements/UnitTest/IQTest.cpp12
-rw-r--r--Swiften/Elements/UnitTest/StanzaTest.cpp81
-rw-r--r--Swiften/Elements/VCard.h4
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h2
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardElement.h5
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h2
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h2
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h2
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardLineElement.h2
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardOperation.h2
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h4
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardRectElement.h2
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardTextElement.h2
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h2
-rw-r--r--Swiften/Elements/WhiteboardPayload.h4
-rw-r--r--Swiften/Entity/GenericPayloadPersister.h6
-rw-r--r--Swiften/Entity/PayloadPersister.cpp8
-rw-r--r--Swiften/Entity/PayloadPersister.h7
-rw-r--r--Swiften/EventLoop/BoostASIOEventLoop.cpp4
-rw-r--r--Swiften/EventLoop/BoostASIOEventLoop.h9
-rw-r--r--Swiften/EventLoop/Event.h7
-rw-r--r--Swiften/EventLoop/EventLoop.cpp4
-rw-r--r--Swiften/EventLoop/EventLoop.h4
-rw-r--r--Swiften/EventLoop/UnitTest/EventLoopTest.cpp8
-rw-r--r--Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp2
-rw-r--r--Swiften/Examples/LinkLocalTool/main.cpp6
-rw-r--r--Swiften/Examples/MUCListAndJoin/MUCListAndJoin.cpp10
-rw-r--r--Swiften/Examples/NetworkTool/main.cpp6
-rw-r--r--Swiften/Examples/ParserTester/ParserTester.cpp2
-rw-r--r--Swiften/Examples/SendFile/ReceiveFile.cpp6
-rw-r--r--Swiften/Examples/SendFile/SendFile.cpp2
-rw-r--r--Swiften/Examples/SendMessage/SendMessage.cpp2
-rw-r--r--Swiften/FileTransfer/ByteArrayReadBytestream.cpp7
-rw-r--r--Swiften/FileTransfer/ByteArrayReadBytestream.h2
-rw-r--r--Swiften/FileTransfer/BytestreamsRequest.h12
-rw-r--r--Swiften/FileTransfer/DefaultFileTransferTransporter.cpp79
-rw-r--r--Swiften/FileTransfer/DefaultFileTransferTransporter.h30
-rw-r--r--Swiften/FileTransfer/FileReadBytestream.cpp6
-rw-r--r--Swiften/FileTransfer/FileReadBytestream.h2
-rw-r--r--Swiften/FileTransfer/FileTransfer.h7
-rw-r--r--Swiften/FileTransfer/FileTransferManager.h4
-rw-r--r--Swiften/FileTransfer/FileTransferManagerImpl.cpp4
-rw-r--r--Swiften/FileTransfer/FileTransferManagerImpl.h6
-rw-r--r--Swiften/FileTransfer/FileTransferTransporter.h26
-rw-r--r--Swiften/FileTransfer/IBBReceiveSession.cpp2
-rw-r--r--Swiften/FileTransfer/IBBReceiveSession.h7
-rw-r--r--Swiften/FileTransfer/IBBReceiveTransportSession.cpp2
-rw-r--r--Swiften/FileTransfer/IBBReceiveTransportSession.h4
-rw-r--r--Swiften/FileTransfer/IBBRequest.h6
-rw-r--r--Swiften/FileTransfer/IBBSendSession.cpp6
-rw-r--r--Swiften/FileTransfer/IBBSendSession.h11
-rw-r--r--Swiften/FileTransfer/IBBSendTransportSession.cpp2
-rw-r--r--Swiften/FileTransfer/IBBSendTransportSession.h4
-rw-r--r--Swiften/FileTransfer/IncomingFileTransfer.h8
-rw-r--r--Swiften/FileTransfer/IncomingFileTransferManager.cpp4
-rw-r--r--Swiften/FileTransfer/IncomingFileTransferManager.h4
-rw-r--r--Swiften/FileTransfer/IncomingJingleFileTransfer.cpp14
-rw-r--r--Swiften/FileTransfer/IncomingJingleFileTransfer.h28
-rw-r--r--Swiften/FileTransfer/JingleFileTransfer.cpp10
-rw-r--r--Swiften/FileTransfer/JingleFileTransfer.h17
-rw-r--r--Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp5
-rw-r--r--Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.h6
-rw-r--r--Swiften/FileTransfer/OutgoingFileTransfer.h6
-rw-r--r--Swiften/FileTransfer/OutgoingFileTransferManager.cpp10
-rw-r--r--Swiften/FileTransfer/OutgoingFileTransferManager.h8
-rw-r--r--Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp29
-rw-r--r--Swiften/FileTransfer/OutgoingJingleFileTransfer.h23
-rw-r--r--Swiften/FileTransfer/ReadBytestream.h5
-rw-r--r--Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp9
-rw-r--r--Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.h7
-rw-r--r--Swiften/FileTransfer/S5BTransportSession.h16
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp10
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamClientSession.h21
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp29
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.h14
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.cpp17
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.h14
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamRegistry.cpp4
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamServer.cpp18
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamServer.h15
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp15
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamServerManager.h20
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp8
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamServerSession.h18
-rw-r--r--Swiften/FileTransfer/StreamInitiationRequest.h10
-rw-r--r--Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h6
-rw-r--r--Swiften/FileTransfer/UnitTest/DummyFileTransferTransporterFactory.h36
-rw-r--r--Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp22
-rw-r--r--Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp32
-rw-r--r--Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp58
-rw-r--r--Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp46
-rw-r--r--Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp35
-rw-r--r--Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp24
-rw-r--r--Swiften/FileTransfer/WriteBytestream.h5
-rw-r--r--Swiften/History/UnitTest/SQLiteHistoryManagerTest.cpp16
-rw-r--r--Swiften/IDN/ICUConverter.cpp4
-rw-r--r--Swiften/IDN/LibIDNConverter.cpp2
-rw-r--r--Swiften/IDN/UnitTest/IDNConverterTest.cpp6
-rw-r--r--Swiften/JID/JID.cpp4
-rw-r--r--Swiften/Jingle/AbstractJingleSessionListener.cpp14
-rw-r--r--Swiften/Jingle/AbstractJingleSessionListener.h14
-rw-r--r--Swiften/Jingle/FakeJingleSession.cpp6
-rw-r--r--Swiften/Jingle/FakeJingleSession.h20
-rw-r--r--Swiften/Jingle/JingleResponder.cpp10
-rw-r--r--Swiften/Jingle/JingleResponder.h2
-rw-r--r--Swiften/Jingle/JingleSession.cpp2
-rw-r--r--Swiften/Jingle/JingleSession.h6
-rw-r--r--Swiften/Jingle/JingleSessionImpl.cpp26
-rw-r--r--Swiften/Jingle/JingleSessionImpl.h9
-rw-r--r--Swiften/Jingle/JingleSessionListener.h16
-rw-r--r--Swiften/Jingle/JingleSessionManager.h3
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp16
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h13
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.cpp2
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h9
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp2
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp24
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.h19
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.cpp2
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h10
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourRegisterQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveServiceQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/DNSSDQuerier.h12
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDBrowseQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp42
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h32
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.cpp2
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.h9
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDRegisterQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveHostnameQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveServiceQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp10
-rw-r--r--Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h6
-rw-r--r--Swiften/LinkLocal/IncomingLinkLocalSession.cpp11
-rw-r--r--Swiften/LinkLocal/IncomingLinkLocalSession.h6
-rw-r--r--Swiften/LinkLocal/LinkLocalConnector.cpp8
-rw-r--r--Swiften/LinkLocal/LinkLocalConnector.h24
-rw-r--r--Swiften/LinkLocal/LinkLocalServiceBrowser.cpp6
-rw-r--r--Swiften/LinkLocal/LinkLocalServiceBrowser.h14
-rw-r--r--Swiften/LinkLocal/OutgoingLinkLocalSession.cpp8
-rw-r--r--Swiften/LinkLocal/OutgoingLinkLocalSession.h12
-rw-r--r--Swiften/LinkLocal/UnitTest/LinkLocalConnectorTest.cpp22
-rw-r--r--Swiften/LinkLocal/UnitTest/LinkLocalServiceBrowserTest.cpp42
-rw-r--r--Swiften/MUC/MUC.h4
-rw-r--r--Swiften/MUC/MUCBookmarkManager.cpp6
-rw-r--r--Swiften/MUC/MUCBookmarkManager.h6
-rw-r--r--Swiften/MUC/MUCImpl.cpp50
-rw-r--r--Swiften/MUC/MUCImpl.h4
-rw-r--r--Swiften/MUC/MUCManager.cpp2
-rw-r--r--Swiften/MUC/UnitTest/MUCTest.cpp26
-rw-r--r--Swiften/MUC/UnitTest/MockMUC.h4
-rw-r--r--Swiften/Network/BOSHConnection.cpp16
-rw-r--r--Swiften/Network/BOSHConnection.h22
-rw-r--r--Swiften/Network/BOSHConnectionPool.cpp16
-rw-r--r--Swiften/Network/BOSHConnectionPool.h10
-rw-r--r--Swiften/Network/BoostConnection.cpp8
-rw-r--r--Swiften/Network/BoostConnection.h17
-rw-r--r--Swiften/Network/BoostConnectionFactory.cpp4
-rw-r--r--Swiften/Network/BoostConnectionFactory.h6
-rw-r--r--Swiften/Network/BoostConnectionServer.cpp6
-rw-r--r--Swiften/Network/BoostConnectionServer.h20
-rw-r--r--Swiften/Network/BoostConnectionServerFactory.cpp6
-rw-r--r--Swiften/Network/BoostConnectionServerFactory.h8
-rw-r--r--Swiften/Network/BoostIOServiceThread.cpp6
-rw-r--r--Swiften/Network/BoostIOServiceThread.h9
-rw-r--r--Swiften/Network/BoostNetworkFactories.cpp4
-rw-r--r--Swiften/Network/BoostNetworkFactories.h4
-rw-r--r--Swiften/Network/BoostTimer.cpp4
-rw-r--r--Swiften/Network/BoostTimer.h15
-rw-r--r--Swiften/Network/BoostTimerFactory.cpp4
-rw-r--r--Swiften/Network/BoostTimerFactory.h6
-rw-r--r--Swiften/Network/CachingDomainNameResolver.cpp4
-rw-r--r--Swiften/Network/CachingDomainNameResolver.h4
-rw-r--r--Swiften/Network/ChainedConnector.cpp10
-rw-r--r--Swiften/Network/ChainedConnector.h14
-rw-r--r--Swiften/Network/Connection.h8
-rw-r--r--Swiften/Network/ConnectionFactory.h6
-rw-r--r--Swiften/Network/ConnectionServer.h5
-rw-r--r--Swiften/Network/ConnectionServerFactory.h6
-rw-r--r--Swiften/Network/Connector.cpp8
-rw-r--r--Swiften/Network/Connector.h18
-rw-r--r--Swiften/Network/DomainNameAddressQuery.h5
-rw-r--r--Swiften/Network/DomainNameResolver.h7
-rw-r--r--Swiften/Network/DomainNameServiceQuery.h4
-rw-r--r--Swiften/Network/DummyConnection.cpp4
-rw-r--r--Swiften/Network/DummyConnection.h6
-rw-r--r--Swiften/Network/DummyConnectionFactory.h12
-rw-r--r--Swiften/Network/DummyConnectionServer.h4
-rw-r--r--Swiften/Network/DummyConnectionServerFactory.h12
-rw-r--r--Swiften/Network/DummyTimerFactory.cpp8
-rw-r--r--Swiften/Network/DummyTimerFactory.h6
-rw-r--r--Swiften/Network/FakeConnection.h6
-rw-r--r--Swiften/Network/HTTPConnectProxiedConnection.cpp6
-rw-r--r--Swiften/Network/HTTPConnectProxiedConnection.h12
-rw-r--r--Swiften/Network/HTTPConnectProxiedConnectionFactory.cpp8
-rw-r--r--Swiften/Network/HTTPConnectProxiedConnectionFactory.h8
-rw-r--r--Swiften/Network/MiniUPnPInterface.cpp5
-rw-r--r--Swiften/Network/MiniUPnPInterface.h5
-rw-r--r--Swiften/Network/NATPMPInterface.cpp5
-rw-r--r--Swiften/Network/NATPMPInterface.h5
-rw-r--r--Swiften/Network/NATTraverser.h10
-rw-r--r--Swiften/Network/NullNATTraverser.cpp15
-rw-r--r--Swiften/Network/NullNATTraverser.h8
-rw-r--r--Swiften/Network/PlatformDomainNameAddressQuery.h6
-rw-r--r--Swiften/Network/PlatformDomainNameQuery.h6
-rw-r--r--Swiften/Network/PlatformDomainNameResolver.cpp12
-rw-r--r--Swiften/Network/PlatformDomainNameServiceQuery.h7
-rw-r--r--Swiften/Network/PlatformNATTraversalWorker.cpp22
-rw-r--r--Swiften/Network/PlatformNATTraversalWorker.h10
-rw-r--r--Swiften/Network/ProxiedConnection.cpp2
-rw-r--r--Swiften/Network/ProxiedConnection.h12
-rw-r--r--Swiften/Network/SOCKS5ProxiedConnection.cpp2
-rw-r--r--Swiften/Network/SOCKS5ProxiedConnection.h6
-rw-r--r--Swiften/Network/SOCKS5ProxiedConnectionFactory.cpp8
-rw-r--r--Swiften/Network/SOCKS5ProxiedConnectionFactory.h4
-rw-r--r--Swiften/Network/StaticDomainNameResolver.cpp20
-rw-r--r--Swiften/Network/StaticDomainNameResolver.h7
-rw-r--r--Swiften/Network/TLSConnection.cpp6
-rw-r--r--Swiften/Network/TLSConnection.h7
-rw-r--r--Swiften/Network/TLSConnectionFactory.cpp8
-rw-r--r--Swiften/Network/TLSConnectionFactory.h6
-rw-r--r--Swiften/Network/Timer.h2
-rw-r--r--Swiften/Network/TimerFactory.h4
-rwxr-xr-xSwiften/Network/UnboundDomainNameResolver.cpp25
-rwxr-xr-xSwiften/Network/UnboundDomainNameResolver.h18
-rw-r--r--Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp28
-rw-r--r--Swiften/Network/UnitTest/BOSHConnectionTest.cpp28
-rw-r--r--Swiften/Network/UnitTest/ChainedConnectorTest.cpp43
-rw-r--r--Swiften/Network/UnitTest/ConnectorTest.cpp44
-rw-r--r--Swiften/Network/UnitTest/HTTPConnectProxiedConnectionTest.cpp20
-rw-r--r--Swiften/Parser/BOSHBodyExtractor.cpp5
-rw-r--r--Swiften/Parser/ElementParser.h5
-rw-r--r--Swiften/Parser/ExpatParser.h7
-rw-r--r--Swiften/Parser/GenericElementParser.h13
-rw-r--r--Swiften/Parser/GenericPayloadParser.h13
-rw-r--r--Swiften/Parser/GenericPayloadTreeParser.h8
-rw-r--r--Swiften/Parser/GenericStanzaParser.h13
-rw-r--r--Swiften/Parser/LibXMLParser.h5
-rw-r--r--Swiften/Parser/PayloadParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/CarbonsReceivedParser.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/CarbonsReceivedParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/CarbonsSentParser.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/CarbonsSentParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/CommandParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/ErrorParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/FormParser.cpp14
-rw-r--r--Swiften/Parser/PayloadParsers/FormParser.h8
-rw-r--r--Swiften/Parser/PayloadParsers/ForwardedParser.cpp10
-rw-r--r--Swiften/Parser/PayloadParsers/ForwardedParser.h6
-rw-r--r--Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp154
-rw-r--r--Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h5
-rw-r--r--Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/JingleContentPayloadParser.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/JingleContentPayloadParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.cpp7
-rw-r--r--Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/JingleParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/JingleParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/MAMFinParser.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/MAMFinParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/MAMQueryParser.cpp8
-rw-r--r--Swiften/Parser/PayloadParsers/MAMQueryParser.h7
-rw-r--r--Swiften/Parser/PayloadParsers/MAMResultParser.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/MAMResultParser.h5
-rw-r--r--Swiften/Parser/PayloadParsers/MUCInvitationPayloadParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/MUCOwnerPayloadParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PrivateStorageParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubAffiliationParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubConfigureParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubConfigureParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubCreateParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubDefaultParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubErrorParser.h2
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventAssociateParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.cpp10
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventDisassociateParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventItemParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventItemsParser.cpp10
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventItemsParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventParser.cpp16
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventPurgeParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventRedirectParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventRetractParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubEventSubscriptionParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubItemParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubItemsParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubItemsParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOptionsParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOptionsParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.cpp16
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerPurgeParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerRedirectParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubParser.cpp36
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubParser.h8
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubPublishParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubPublishParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubRetractParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubRetractParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubSubscribeOptionsParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubSubscribeParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/PubSubUnsubscribeParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/ResultSetParser.h2
-rw-r--r--Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/SecurityLabelParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h4
-rw-r--r--Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/CarbonsParserTest.cpp10
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/DeliveryReceiptParserTest.cpp10
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp8
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/DiscoItemsParserTest.cpp8
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/ForwardedParserTest.cpp16
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/MAMFinParserTest.cpp8
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/MAMQueryParserTest.cpp16
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/MAMResultParserTest.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/MUCAdminPayloadParserTest.cpp4
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/MUCUserPayloadParserTest.cpp10
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h8
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/PriorityParserTest.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp12
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/ReplaceTest.cpp10
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp6
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp2
-rw-r--r--Swiften/Parser/PayloadParsers/UserLocationParser.h3
-rw-r--r--Swiften/Parser/PayloadParsers/UserTuneParser.h3
-rw-r--r--Swiften/Parser/PayloadParsers/WhiteboardParser.cpp27
-rw-r--r--Swiften/Parser/SerializingParser.cpp6
-rw-r--r--Swiften/Parser/SerializingParser.h4
-rw-r--r--Swiften/Parser/StanzaParser.cpp2
-rw-r--r--Swiften/Parser/StanzaParser.h10
-rw-r--r--Swiften/Parser/Tree/NullParserElement.cpp4
-rw-r--r--Swiften/Parser/Tree/NullParserElement.h2
-rw-r--r--Swiften/Parser/Tree/ParserElement.cpp2
-rw-r--r--Swiften/Parser/Tree/ParserElement.h6
-rw-r--r--Swiften/Parser/Tree/TreeReparser.cpp4
-rw-r--r--Swiften/Parser/Tree/TreeReparser.h4
-rw-r--r--Swiften/Parser/UnitTest/StanzaParserTest.cpp6
-rw-r--r--Swiften/Parser/UnitTest/StreamFeaturesParserTest.cpp10
-rw-r--r--Swiften/Parser/UnitTest/StreamManagementEnabledParserTest.cpp4
-rw-r--r--Swiften/Parser/UnitTest/XMPPParserTest.cpp6
-rw-r--r--Swiften/Parser/UnknownPayloadParser.h8
-rw-r--r--Swiften/Parser/XMPPParser.h3
-rw-r--r--Swiften/Parser/XMPPParserClient.h6
-rw-r--r--Swiften/Presence/DirectedPresenceSender.cpp8
-rw-r--r--Swiften/Presence/PayloadAddingPresenceSender.cpp4
-rw-r--r--Swiften/Presence/PayloadAddingPresenceSender.h8
-rw-r--r--Swiften/Presence/UnitTest/DirectedPresenceSenderTest.cpp40
-rw-r--r--Swiften/Presence/UnitTest/PayloadAddingPresenceSenderTest.cpp20
-rw-r--r--Swiften/Presence/UnitTest/PresenceOracleTest.cpp23
-rw-r--r--Swiften/PubSub/PubSubManager.h8
-rw-r--r--Swiften/PubSub/PubSubManagerImpl.cpp6
-rw-r--r--Swiften/PubSub/PubSubManagerImpl.h10
-rw-r--r--Swiften/QA/ClientTest/ClientTest.cpp2
-rw-r--r--Swiften/QA/ConcurrentFileTransferTest/ConcurrentFileTransferTest.cpp8
-rw-r--r--Swiften/QA/DNSSDTest/DNSSDTest.cpp12
-rw-r--r--Swiften/QA/FileTransferTest/FileTransferTest.cpp24
-rw-r--r--Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp7
-rwxr-xr-xSwiften/QA/NetworkTest/BoostConnectionTest.cpp9
-rw-r--r--Swiften/QA/NetworkTest/DomainNameResolverTest.cpp28
-rw-r--r--Swiften/QA/ReconnectTest/ReconnectTest.cpp6
-rw-r--r--Swiften/QA/StorageTest/FileReadBytestreamTest.cpp12
-rw-r--r--Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp4
-rw-r--r--Swiften/QA/StorageTest/VCardFileStorageTest.cpp6
-rw-r--r--Swiften/QA/TLSTest/CertificateErrorTest.cpp22
-rw-r--r--Swiften/Queries/DummyIQChannel.h6
-rw-r--r--Swiften/Queries/GenericRequest.h18
-rw-r--r--Swiften/Queries/GetResponder.h4
-rw-r--r--Swiften/Queries/IQChannel.h7
-rw-r--r--Swiften/Queries/IQHandler.h6
-rw-r--r--Swiften/Queries/IQRouter.cpp18
-rw-r--r--Swiften/Queries/IQRouter.h15
-rw-r--r--Swiften/Queries/PubSubRequest.h20
-rw-r--r--Swiften/Queries/RawRequest.h9
-rw-r--r--Swiften/Queries/Request.cpp16
-rw-r--r--Swiften/Queries/Request.h19
-rw-r--r--Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h2
-rw-r--r--Swiften/Queries/Requests/GetPrivateStorageRequest.h17
-rw-r--r--Swiften/Queries/Requests/GetSecurityLabelsCatalogRequest.h6
-rw-r--r--Swiften/Queries/Requests/GetSoftwareVersionRequest.h6
-rw-r--r--Swiften/Queries/Requests/SetPrivateStorageRequest.h11
-rw-r--r--Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h8
-rw-r--r--Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp25
-rw-r--r--Swiften/Queries/Responder.h12
-rw-r--r--Swiften/Queries/Responders/SoftwareVersionResponder.cpp6
-rw-r--r--Swiften/Queries/Responders/SoftwareVersionResponder.h2
-rw-r--r--Swiften/Queries/SetResponder.h4
-rw-r--r--Swiften/Queries/UnitTest/IQRouterTest.cpp30
-rw-r--r--Swiften/Queries/UnitTest/RequestTest.cpp50
-rw-r--r--Swiften/Queries/UnitTest/ResponderTest.cpp22
-rw-r--r--Swiften/Roster/GetRosterRequest.h4
-rw-r--r--Swiften/Roster/RosterMemoryStorage.cpp8
-rw-r--r--Swiften/Roster/RosterMemoryStorage.h8
-rw-r--r--Swiften/Roster/RosterPushResponder.h6
-rw-r--r--Swiften/Roster/RosterStorage.h8
-rw-r--r--Swiften/Roster/SetRosterRequest.h8
-rw-r--r--Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp76
-rw-r--r--Swiften/Roster/UnitTest/XMPPRosterImplTest.cpp3
-rw-r--r--Swiften/Roster/UnitTest/XMPPRosterSignalHandler.h3
-rw-r--r--Swiften/Roster/XMPPRosterController.cpp8
-rw-r--r--Swiften/Roster/XMPPRosterController.h5
-rw-r--r--Swiften/SASL/UnitTest/DIGESTMD5ClientAuthenticatorTest.cpp4
-rw-r--r--Swiften/SASL/UnitTest/SCRAMSHA1ClientAuthenticatorTest.cpp8
-rw-r--r--Swiften/SASL/WindowsAuthentication.cpp46
-rw-r--r--Swiften/SASL/WindowsAuthentication.h22
-rw-r--r--Swiften/SASL/WindowsGSSAPIClientAuthenticator.h4
-rw-r--r--Swiften/Serializer/AuthChallengeSerializer.cpp4
-rw-r--r--Swiften/Serializer/AuthChallengeSerializer.h6
-rw-r--r--Swiften/Serializer/AuthFailureSerializer.h6
-rw-r--r--Swiften/Serializer/AuthRequestSerializer.cpp4
-rw-r--r--Swiften/Serializer/AuthRequestSerializer.h6
-rw-r--r--Swiften/Serializer/AuthResponseSerializer.cpp4
-rw-r--r--Swiften/Serializer/AuthResponseSerializer.h6
-rw-r--r--Swiften/Serializer/AuthSuccessSerializer.cpp4
-rw-r--r--Swiften/Serializer/AuthSuccessSerializer.h6
-rw-r--r--Swiften/Serializer/ComponentHandshakeSerializer.cpp6
-rw-r--r--Swiften/Serializer/ComponentHandshakeSerializer.h6
-rw-r--r--Swiften/Serializer/CompressFailureSerializer.h6
-rw-r--r--Swiften/Serializer/CompressRequestSerializer.cpp8
-rw-r--r--Swiften/Serializer/CompressRequestSerializer.h8
-rw-r--r--Swiften/Serializer/ElementSerializer.h6
-rw-r--r--Swiften/Serializer/EnableStreamManagementSerializer.h6
-rw-r--r--Swiften/Serializer/GenericElementSerializer.h10
-rw-r--r--Swiften/Serializer/GenericPayloadSerializer.h14
-rw-r--r--Swiften/Serializer/GenericStanzaSerializer.h8
-rw-r--r--Swiften/Serializer/IQSerializer.h2
-rw-r--r--Swiften/Serializer/MessageSerializer.cpp2
-rw-r--r--Swiften/Serializer/MessageSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializer.h7
-rw-r--r--Swiften/Serializer/PayloadSerializerCollection.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializerCollection.h5
-rw-r--r--Swiften/Serializer/PayloadSerializers/BlockSerializer.h8
-rw-r--r--Swiften/Serializer/PayloadSerializers/BodySerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp9
-rw-r--r--Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/ChatStateSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/ChatStateSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/CommandSerializer.cpp13
-rw-r--r--Swiften/Serializer/PayloadSerializers/CommandSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp5
-rw-r--r--Swiften/Serializer/PayloadSerializers/DelaySerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp11
-rw-r--r--Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/ErrorSerializer.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/ErrorSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/FormSerializer.cpp74
-rw-r--r--Swiften/Serializer/PayloadSerializers/FormSerializer.h18
-rw-r--r--Swiften/Serializer/PayloadSerializers/ForwardedSerializer.cpp25
-rw-r--r--Swiften/Serializer/PayloadSerializers/ForwardedSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp7
-rw-r--r--Swiften/Serializer/PayloadSerializers/IBBSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/IdleSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.cpp7
-rw-r--r--Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.cpp18
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.cpp20
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp18
-rw-r--r--Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp16
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/LastSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp7
-rw-r--r--Swiften/Serializer/PayloadSerializers/MAMFinSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp9
-rw-r--r--Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/MAMResultSerializer.cpp7
-rw-r--r--Swiften/Serializer/PayloadSerializers/MAMResultSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.cpp11
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.cpp7
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCItemSerializer.h12
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp11
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp22
-rw-r--r--Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/NicknameSerializer.cpp9
-rw-r--r--Swiften/Serializer/PayloadSerializers/NicknameSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/PrioritySerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.cpp9
-rw-r--r--Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.cpp14
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.cpp24
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.h7
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.cpp24
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.h7
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubSerializer.cpp42
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubSerializer.h6
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/ReplaceSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp15
-rw-r--r--Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp19
-rw-r--r--Swiften/Serializer/PayloadSerializers/ResultSetSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.cpp11
-rw-r--r--Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/RosterSerializer.cpp13
-rw-r--r--Swiften/Serializer/PayloadSerializers/RosterSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/S5BProxyRequestSerializer.h11
-rw-r--r--Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.cpp7
-rw-r--r--Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp16
-rw-r--r--Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/StatusSerializer.h6
-rw-r--r--Swiften/Serializer/PayloadSerializers/StatusShowSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp19
-rw-r--r--Swiften/Serializer/PayloadSerializers/StorageSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp24
-rw-r--r--Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/SubjectSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/ThreadSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/ThreadSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/CarbonsSerializerTest.cpp22
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ChatStateSerializerTest.cpp16
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp11
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp76
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp26
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/IBBSerializerTest.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/IsodeIQDelegationSerializerTest.cpp30
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp53
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/MAMFinSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp12
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/MUCAdminPayloadSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h5
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp14
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ReplaceSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp12
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/RosterItemExchangeSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp10
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp30
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp14
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/UserLocationSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/UserTuneSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UserLocationSerializer.cpp50
-rw-r--r--Swiften/Serializer/PayloadSerializers/UserLocationSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp20
-rw-r--r--Swiften/Serializer/PayloadSerializers/UserTuneSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp139
-rw-r--r--Swiften/Serializer/PayloadSerializers/VCardSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.cpp11
-rw-r--r--Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h2
-rw-r--r--Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp26
-rw-r--r--Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h2
-rw-r--r--Swiften/Serializer/PresenceSerializer.cpp4
-rw-r--r--Swiften/Serializer/PresenceSerializer.h2
-rw-r--r--Swiften/Serializer/StanzaAckRequestSerializer.h6
-rw-r--r--Swiften/Serializer/StanzaAckSerializer.h7
-rw-r--r--Swiften/Serializer/StanzaSerializer.cpp10
-rw-r--r--Swiften/Serializer/StanzaSerializer.h6
-rw-r--r--Swiften/Serializer/StartTLSFailureSerializer.h6
-rw-r--r--Swiften/Serializer/StartTLSRequestSerializer.h6
-rw-r--r--Swiften/Serializer/StreamErrorSerializer.cpp12
-rw-r--r--Swiften/Serializer/StreamErrorSerializer.h2
-rw-r--r--Swiften/Serializer/StreamFeaturesSerializer.cpp28
-rw-r--r--Swiften/Serializer/StreamFeaturesSerializer.h6
-rw-r--r--Swiften/Serializer/StreamManagementEnabledSerializer.cpp8
-rw-r--r--Swiften/Serializer/StreamManagementEnabledSerializer.h6
-rw-r--r--Swiften/Serializer/StreamManagementFailedSerializer.h6
-rw-r--r--Swiften/Serializer/StreamResumeSerializer.cpp7
-rw-r--r--Swiften/Serializer/StreamResumeSerializer.h6
-rw-r--r--Swiften/Serializer/StreamResumedSerializer.cpp7
-rw-r--r--Swiften/Serializer/StreamResumedSerializer.h6
-rw-r--r--Swiften/Serializer/TLSProceedSerializer.h6
-rw-r--r--Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp2
-rw-r--r--Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp6
-rw-r--r--Swiften/Serializer/XML/UnitTest/XMLElementTest.cpp10
-rw-r--r--Swiften/Serializer/XML/XMLElement.cpp6
-rw-r--r--Swiften/Serializer/XML/XMLElement.h9
-rw-r--r--Swiften/Serializer/XML/XMLTextNode.h6
-rw-r--r--Swiften/Serializer/XMPPSerializer.cpp52
-rw-r--r--Swiften/Serializer/XMPPSerializer.h7
-rw-r--r--Swiften/Session/BOSHSessionStream.cpp10
-rw-r--r--Swiften/Session/BOSHSessionStream.h14
-rw-r--r--Swiften/Session/BasicSessionStream.cpp23
-rw-r--r--Swiften/Session/BasicSessionStream.h14
-rw-r--r--Swiften/Session/Session.cpp4
-rw-r--r--Swiften/Session/Session.h16
-rw-r--r--Swiften/Session/SessionStream.h11
-rw-r--r--Swiften/Session/SessionTracer.cpp2
-rw-r--r--Swiften/Session/SessionTracer.h4
-rw-r--r--Swiften/StreamManagement/StanzaAckRequester.cpp6
-rw-r--r--Swiften/StreamManagement/StanzaAckRequester.h9
-rw-r--r--Swiften/StreamManagement/StanzaAckResponder.h2
-rw-r--r--Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp20
-rw-r--r--Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp8
-rw-r--r--Swiften/StreamStack/ConnectionLayer.cpp6
-rw-r--r--Swiften/StreamStack/ConnectionLayer.h10
-rw-r--r--Swiften/StreamStack/StreamStack.h3
-rw-r--r--Swiften/StreamStack/TLSLayer.cpp2
-rw-r--r--Swiften/StreamStack/TLSLayer.h6
-rw-r--r--Swiften/StreamStack/UnitTest/StreamStackTest.cpp16
-rw-r--r--Swiften/StreamStack/UnitTest/XMPPLayerTest.cpp6
-rw-r--r--Swiften/StreamStack/WhitespacePingLayer.h5
-rw-r--r--Swiften/StreamStack/XMPPLayer.cpp4
-rw-r--r--Swiften/StreamStack/XMPPLayer.h9
-rw-r--r--Swiften/StringCodecs/UnitTest/PBKDF2Test.cpp4
-rw-r--r--Swiften/TLS/CAPICertificate.cpp2
-rw-r--r--Swiften/TLS/CAPICertificate.h8
-rw-r--r--Swiften/TLS/Certificate.h7
-rw-r--r--Swiften/TLS/CertificateTrustChecker.h3
-rw-r--r--Swiften/TLS/CertificateVerificationError.h4
-rw-r--r--Swiften/TLS/CertificateWithKey.h4
-rw-r--r--Swiften/TLS/OpenSSL/OpenSSLCertificate.cpp12
-rw-r--r--Swiften/TLS/OpenSSL/OpenSSLCertificate.h9
-rw-r--r--Swiften/TLS/OpenSSL/OpenSSLContext.cpp30
-rw-r--r--Swiften/TLS/OpenSSL/OpenSSLContext.h4
-rw-r--r--Swiften/TLS/Schannel/SchannelCertificate.cpp12
-rw-r--r--Swiften/TLS/Schannel/SchannelCertificate.h4
-rw-r--r--Swiften/TLS/Schannel/SchannelContext.cpp32
-rw-r--r--Swiften/TLS/Schannel/SchannelContext.h10
-rw-r--r--Swiften/TLS/Schannel/SchannelUtil.h14
-rw-r--r--Swiften/TLS/SecureTransport/SecureTransportCertificate.h7
-rw-r--r--Swiften/TLS/SecureTransport/SecureTransportCertificate.mm4
-rw-r--r--Swiften/TLS/SecureTransport/SecureTransportContext.h10
-rw-r--r--Swiften/TLS/SecureTransport/SecureTransportContext.mm60
-rw-r--r--Swiften/TLS/ServerIdentityVerifier.h3
-rw-r--r--Swiften/TLS/SimpleCertificate.h2
-rw-r--r--Swiften/TLS/TLSContext.h4
-rw-r--r--Swiften/TLS/TLSError.h4
-rw-r--r--Swiften/TLS/UnitTest/CertificateTest.cpp6
-rw-r--r--Swiften/TLS/UnitTest/ServerIdentityVerifierTest.cpp4
-rw-r--r--Swiften/VCards/GetVCardRequest.h4
-rw-r--r--Swiften/VCards/SetVCardRequest.h2
-rw-r--r--Swiften/VCards/UnitTest/VCardManagerTest.cpp36
-rw-r--r--Swiften/VCards/VCardMemoryStorage.h3
-rw-r--r--Swiften/VCards/VCardStorage.h2
-rw-r--r--Swiften/Whiteboard/IncomingWhiteboardSession.cpp10
-rw-r--r--Swiften/Whiteboard/IncomingWhiteboardSession.h4
-rw-r--r--Swiften/Whiteboard/OutgoingWhiteboardSession.cpp13
-rw-r--r--Swiften/Whiteboard/OutgoingWhiteboardSession.h6
-rw-r--r--Swiften/Whiteboard/UnitTest/WhiteboardClientTest.cpp84
-rw-r--r--Swiften/Whiteboard/UnitTest/WhiteboardServerTest.cpp48
-rw-r--r--Swiften/Whiteboard/WhiteboardClient.cpp27
-rw-r--r--Swiften/Whiteboard/WhiteboardResponder.cpp10
-rw-r--r--Swiften/Whiteboard/WhiteboardResponder.h2
-rw-r--r--Swiften/Whiteboard/WhiteboardSession.cpp17
-rw-r--r--Swiften/Whiteboard/WhiteboardSession.h8
-rw-r--r--Swiften/Whiteboard/WhiteboardSessionManager.cpp7
-rw-r--r--Swiften/Whiteboard/WhiteboardSessionManager.h2
-rw-r--r--Swiften/Whiteboard/WhiteboardTransformer.cpp56
1308 files changed, 6684 insertions, 6659 deletions
diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp
index b1a1c37..e1d5528 100644
--- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp
+++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp
@@ -6,9 +6,9 @@
//...
#include <iostream>
+#include <memory>
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Swiften.h>
@@ -91,7 +91,7 @@ class EchoBot {
message->setFrom(JID());
//...
if (!message->getPayload<EchoPayload>()) {
- boost::shared_ptr<EchoPayload> echoPayload = boost::make_shared<EchoPayload>();
+ std::shared_ptr<EchoPayload> echoPayload = std::make_shared<EchoPayload>();
echoPayload->setMessage("This is an echoed message");
message->addPayload(echoPayload);
client->sendMessage(message);
diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoPayloadSerializer.h b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoPayloadSerializer.h
index 91440d0..faf1080 100644
--- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoPayloadSerializer.h
+++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoPayloadSerializer.h
@@ -1,17 +1,18 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Swiften.h>
#include "EchoPayload.h"
+#include <Swiften/Swiften.h>
+
class EchoPayloadSerializer : public Swift::GenericPayloadSerializer<EchoPayload> {
public:
- std::string serializePayload(boost::shared_ptr<EchoPayload> payload) const {
+ std::string serializePayload(std::shared_ptr<EchoPayload> payload) const {
XMLElement element("echo", "http://swift.im/protocol/echo");
element.addNode(XMLTextNode::ref(new XMLTextNode(payload->getMessage())));
return element.serialize();
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 <Limber/Server/ServerFromClientSession.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Elements/AuthFailure.h>
#include <Swiften/Elements/AuthRequest.h>
@@ -27,7 +28,7 @@ namespace Swift {
ServerFromClientSession::ServerFromClientSession(
const std::string& id,
- boost::shared_ptr<Connection> connection,
+ std::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
XMLParserFactory* xmlParserFactory,
@@ -41,7 +42,7 @@ ServerFromClientSession::ServerFromClientSession(
}
-void ServerFromClientSession::handleElement(boost::shared_ptr<ToplevelElement> element) {
+void ServerFromClientSession::handleElement(std::shared_ptr<ToplevelElement> element) {
if (isInitialized()) {
onElementReceived(element);
}
@@ -49,33 +50,33 @@ void ServerFromClientSession::handleElement(boost::shared_ptr<ToplevelElement> e
if (AuthRequest* authRequest = dynamic_cast<AuthRequest*>(element.get())) {
if (authRequest->getMechanism() == "PLAIN" || (allowSASLEXTERNAL && authRequest->getMechanism() == "EXTERNAL")) {
if (authRequest->getMechanism() == "EXTERNAL") {
- getXMPPLayer()->writeElement(boost::make_shared<AuthSuccess>());
+ getXMPPLayer()->writeElement(std::make_shared<AuthSuccess>());
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<AuthSuccess>());
+ getXMPPLayer()->writeElement(std::make_shared<AuthSuccess>());
user_ = plainMessage.getAuthenticationID();
authenticated_ = true;
getXMPPLayer()->resetParser();
}
else {
- getXMPPLayer()->writeElement(boost::shared_ptr<AuthFailure>(new AuthFailure));
+ getXMPPLayer()->writeElement(std::shared_ptr<AuthFailure>(new AuthFailure));
finishSession(AuthenticationFailedError);
}
}
}
else {
- getXMPPLayer()->writeElement(boost::shared_ptr<AuthFailure>(new AuthFailure));
+ getXMPPLayer()->writeElement(std::shared_ptr<AuthFailure>(new AuthFailure));
finishSession(NoSupportedAuthMechanismsError);
}
}
else if (IQ* iq = dynamic_cast<IQ*>(element.get())) {
- if (boost::shared_ptr<ResourceBind> resourceBind = iq->getPayload<ResourceBind>()) {
+ if (std::shared_ptr<ResourceBind> resourceBind = iq->getPayload<ResourceBind>()) {
setRemoteJID(JID(user_, getLocalJID().getDomain(), resourceBind->getResource()));
- boost::shared_ptr<ResourceBind> resultResourceBind(new ResourceBind());
+ std::shared_ptr<ResourceBind> 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<StreamFeatures> features(new StreamFeatures());
+ std::shared_ptr<StreamFeatures> 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 <memory>
#include <string>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/ByteArray.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/JID/JID.h>
@@ -34,7 +32,7 @@ namespace Swift {
public:
ServerFromClientSession(
const std::string& id,
- boost::shared_ptr<Connection> connection,
+ std::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
XMLParserFactory* xmlParserFactory,
@@ -44,7 +42,7 @@ namespace Swift {
void setAllowSASLEXTERNAL();
private:
- void handleElement(boost::shared_ptr<ToplevelElement>);
+ void handleElement(std::shared_ptr<ToplevelElement>);
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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Elements/Stanza.h>
@@ -18,6 +18,6 @@ namespace Swift {
virtual const JID& getJID() const = 0;
virtual int getPriority() const = 0;
- virtual void sendStanza(boost::shared_ptr<Stanza>) = 0;
+ virtual void sendStanza(std::shared_ptr<Stanza>) = 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> stanza) {
+bool ServerStanzaRouter::routeStanza(std::shared_ptr<Stanza> 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 <map>
-
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Elements/Stanza.h>
#include <Swiften/JID/JID.h>
@@ -20,7 +19,7 @@ namespace Swift {
public:
ServerStanzaRouter();
- bool routeStanza(boost::shared_ptr<Stanza>);
+ bool routeStanza(std::shared_ptr<Stanza>);
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<Message> createMessageTo(const std::string& recipient) {
- boost::shared_ptr<Message> message(new Message());
+ std::shared_ptr<Message> createMessageTo(const std::string& recipient) {
+ std::shared_ptr<Message> 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> stanza) {
+ virtual void sendStanza(std::shared_ptr<Stanza> stanza) {
sentStanzas.push_back(stanza);
}
JID jid;
int priority;
- std::vector< boost::shared_ptr<Stanza> > sentStanzas;
+ std::vector< std::shared_ptr<Stanza> > 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 <memory>
#include <string>
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/IDGenerator.h>
#include <Swiften/Elements/IQ.h>
@@ -39,20 +39,20 @@ class Server {
}
private:
- void handleNewConnection(boost::shared_ptr<Connection> c) {
- boost::shared_ptr<ServerFromClientSession> session(new ServerFromClientSession(idGenerator_.generateID(), c, &payloadParserFactories_, &payloadSerializers_, &xmlParserFactory, userRegistry_));
+ void handleNewConnection(std::shared_ptr<Connection> c) {
+ std::shared_ptr<ServerFromClientSession> 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<ServerFromClientSession> session) {
+ void handleSessionFinished(std::shared_ptr<ServerFromClientSession> session) {
serverFromClientSessions_.erase(std::remove(serverFromClientSessions_.begin(), serverFromClientSessions_.end(), session), serverFromClientSessions_.end());
}
- void handleElementReceived(boost::shared_ptr<ToplevelElement> element, boost::shared_ptr<ServerFromClientSession> session) {
- boost::shared_ptr<Stanza> stanza(boost::dynamic_pointer_cast<Stanza>(element));
+ void handleElementReceived(std::shared_ptr<ToplevelElement> element, std::shared_ptr<ServerFromClientSession> session) {
+ std::shared_ptr<Stanza> stanza(std::dynamic_pointer_cast<Stanza>(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> iq = boost::dynamic_pointer_cast<IQ>(stanza)) {
+ if (std::shared_ptr<IQ> iq = std::dynamic_pointer_cast<IQ>(stanza)) {
if (iq->getPayload<RosterPayload>()) {
- session->sendElement(IQ::createResult(iq->getFrom(), iq->getID(), boost::make_shared<RosterPayload>()));
+ session->sendElement(IQ::createResult(iq->getFrom(), iq->getID(), std::make_shared<RosterPayload>()));
}
if (iq->getPayload<VCard>()) {
if (iq->getType() == IQ::Get) {
- boost::shared_ptr<VCard> vcard(new VCard());
+ std::shared_ptr<VCard> 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<BoostConnectionServer> serverFromClientConnectionServer_;
- std::vector< boost::shared_ptr<ServerFromClientSession> > serverFromClientSessions_;
+ std::shared_ptr<BoostConnectionServer> serverFromClientConnectionServer_;
+ std::vector< std::shared_ptr<ServerFromClientSession> > 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 <Slimber/FileVCardCollection.h>
+#include <memory>
+
#include <boost/filesystem/fstream.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/ByteArray.h>
#include <Swiften/Elements/VCard.h>
@@ -20,7 +21,7 @@ namespace Swift {
FileVCardCollection::FileVCardCollection(boost::filesystem::path dir) : vcardsPath(dir) {
}
-boost::shared_ptr<VCard> FileVCardCollection::getOwnVCard() const {
+std::shared_ptr<VCard> 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<VCard> FileVCardCollection::getOwnVCard() const {
VCardParser parser;
PayloadParserTester tester(&parser);
tester.parse(byteArrayToString(data));
- return boost::dynamic_pointer_cast<VCard>(parser.getPayload());
+ return std::dynamic_pointer_cast<VCard>(parser.getPayload());
}
else {
- return boost::make_shared<VCard>();
+ return std::make_shared<VCard>();
}
}
-void FileVCardCollection::setOwnVCard(boost::shared_ptr<VCard> v) {
+void FileVCardCollection::setOwnVCard(std::shared_ptr<VCard> 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 <memory>
+
#include <boost/filesystem.hpp>
-#include <boost/shared_ptr.hpp>
#include <Slimber/VCardCollection.h>
@@ -16,8 +17,8 @@ namespace Swift {
public:
FileVCardCollection(boost::filesystem::path dir);
- boost::shared_ptr<VCard> getOwnVCard() const;
- void setOwnVCard(boost::shared_ptr<VCard> vcard);
+ std::shared_ptr<VCard> getOwnVCard() const;
+ void setOwnVCard(std::shared_ptr<VCard> 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<LinkLocalService> LinkLocalPresenceManager::getServiceForJID(con
}
void LinkLocalPresenceManager::handleServiceAdded(const LinkLocalService& service) {
- boost::shared_ptr<RosterPayload> roster(new RosterPayload());
+ std::shared_ptr<RosterPayload> 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<RosterPayload> roster(new RosterPayload());
+ std::shared_ptr<RosterPayload> roster(new RosterPayload());
roster->addItem(RosterItemPayload(service.getJID(), "", RosterItemPayload::Remove));
onRosterChanged(roster);
}
-boost::shared_ptr<RosterPayload> LinkLocalPresenceManager::getRoster() const {
- boost::shared_ptr<RosterPayload> roster(new RosterPayload());
+std::shared_ptr<RosterPayload> LinkLocalPresenceManager::getRoster() const {
+ std::shared_ptr<RosterPayload> roster(new RosterPayload());
foreach(const LinkLocalService& service, browser->getServices()) {
roster->addItem(getRosterItem(service));
}
return roster;
}
-std::vector<boost::shared_ptr<Presence> > LinkLocalPresenceManager::getAllPresence() const {
- std::vector<boost::shared_ptr<Presence> > result;
+std::vector<std::shared_ptr<Presence> > LinkLocalPresenceManager::getAllPresence() const {
+ std::vector<std::shared_ptr<Presence> > 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<Presence> LinkLocalPresenceManager::getPresence(const LinkLocalService& service) const {
- boost::shared_ptr<Presence> presence(new Presence());
+std::shared_ptr<Presence> LinkLocalPresenceManager::getPresence(const LinkLocalService& service) const {
+ std::shared_ptr<Presence> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/RosterItemPayload.h>
#include <Swiften/JID/JID.h>
@@ -24,13 +23,13 @@ namespace Swift {
public:
LinkLocalPresenceManager(LinkLocalServiceBrowser*);
- boost::shared_ptr<RosterPayload> getRoster() const;
- std::vector<boost::shared_ptr<Presence> > getAllPresence() const;
+ std::shared_ptr<RosterPayload> getRoster() const;
+ std::vector<std::shared_ptr<Presence> > getAllPresence() const;
boost::optional<LinkLocalService> getServiceForJID(const JID&) const;
- boost::signal<void (boost::shared_ptr<RosterPayload>)> onRosterChanged;
- boost::signal<void (boost::shared_ptr<Presence>)> onPresenceChanged;
+ boost::signal<void (std::shared_ptr<RosterPayload>)> onRosterChanged;
+ boost::signal<void (std::shared_ptr<Presence>)> 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<Presence> getPresence(const LinkLocalService& service) const;
+ std::shared_ptr<Presence> 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 <memory>
+
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Slimber/ServerError.h>
@@ -37,7 +38,7 @@ class MainController {
void stop();
private:
- boost::shared_ptr<Swift::DNSSDQuerier> dnsSDQuerier;
+ std::shared_ptr<Swift::DNSSDQuerier> 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<ServerError> e) {
serverFromClientSession->finishSession();
}
serverFromClientSession.reset();
- foreach(boost::shared_ptr<Session> session, linkLocalSessions) {
+ foreach(std::shared_ptr<Session> session, linkLocalSessions) {
session->finishSession();
}
linkLocalSessions.clear();
- foreach(boost::shared_ptr<LinkLocalConnector> connector, connectors) {
+ foreach(std::shared_ptr<LinkLocalConnector> connector, connectors) {
connector->cancel();
}
connectors.clear();
@@ -142,11 +142,11 @@ void Server::stop(boost::optional<ServerError> e) {
onStopped(e);
}
-void Server::handleNewClientConnection(boost::shared_ptr<Connection> connection) {
+void Server::handleNewClientConnection(std::shared_ptr<Connection> connection) {
if (serverFromClientSession) {
connection->disconnect();
}
- serverFromClientSession = boost::shared_ptr<ServerFromClientSession>(
+ serverFromClientSession = std::shared_ptr<ServerFromClientSession>(
new ServerFromClientSession(idGenerator.generateID(), connection,
&payloadParserFactories, &payloadSerializers, &xmlParserFactory, &userRegistry));
serverFromClientSession->setAllowSASLEXTERNAL();
@@ -158,7 +158,7 @@ void Server::handleNewClientConnection(boost::shared_ptr<Connection> connection)
serverFromClientSession->onSessionFinished.connect(
boost::bind(&Server::handleSessionFinished, this,
serverFromClientSession));
- //tracers.push_back(boost::shared_ptr<SessionTracer>(
+ //tracers.push_back(std::shared_ptr<SessionTracer>(
// new SessionTracer(serverFromClientSession)));
serverFromClientSession->startSession();
}
@@ -167,7 +167,7 @@ void Server::handleSessionStarted() {
onSelfConnected(true);
}
-void Server::handleSessionFinished(boost::shared_ptr<ServerFromClientSession>) {
+void Server::handleSessionFinished(std::shared_ptr<ServerFromClientSession>) {
serverFromClientSession.reset();
unregisterService();
selfJID = JID();
@@ -183,8 +183,8 @@ void Server::unregisterService() {
}
}
-void Server::handleElementReceived(boost::shared_ptr<ToplevelElement> element, boost::shared_ptr<ServerFromClientSession> session) {
- boost::shared_ptr<Stanza> stanza = boost::dynamic_pointer_cast<Stanza>(element);
+void Server::handleElementReceived(std::shared_ptr<ToplevelElement> element, std::shared_ptr<ServerFromClientSession> session) {
+ std::shared_ptr<Stanza> stanza = std::dynamic_pointer_cast<Stanza>(element);
if (!stanza) {
return;
}
@@ -194,7 +194,7 @@ void Server::handleElementReceived(boost::shared_ptr<ToplevelElement> element, b
stanza->setTo(session->getLocalJID());
}
- if (boost::shared_ptr<Presence> presence = boost::dynamic_pointer_cast<Presence>(stanza)) {
+ if (std::shared_ptr<Presence> presence = std::dynamic_pointer_cast<Presence>(stanza)) {
if (presence->getType() == Presence::Available) {
if (!linkLocalServiceRegistered) {
linkLocalServiceRegistered = true;
@@ -213,12 +213,12 @@ void Server::handleElementReceived(boost::shared_ptr<ToplevelElement> element, b
}
}
else if (!stanza->getTo().isValid() || stanza->getTo() == session->getLocalJID() || stanza->getTo() == session->getRemoteJID().toBare()) {
- if (boost::shared_ptr<IQ> iq = boost::dynamic_pointer_cast<IQ>(stanza)) {
+ if (std::shared_ptr<IQ> iq = std::dynamic_pointer_cast<IQ>(stanza)) {
if (iq->getPayload<RosterPayload>()) {
if (iq->getType() == IQ::Get) {
session->sendElement(IQ::createResult(iq->getFrom(), iq->getID(), presenceManager->getRoster()));
rosterRequested = true;
- foreach(const boost::shared_ptr<Presence> presence, presenceManager->getAllPresence()) {
+ foreach(const std::shared_ptr<Presence> presence, presenceManager->getAllPresence()) {
session->sendElement(presence);
}
}
@@ -226,7 +226,7 @@ void Server::handleElementReceived(boost::shared_ptr<ToplevelElement> element, b
session->sendElement(IQ::createError(iq->getFrom(), iq->getID(), ErrorPayload::Forbidden, ErrorPayload::Cancel));
}
}
- if (boost::shared_ptr<VCard> vcard = iq->getPayload<VCard>()) {
+ if (std::shared_ptr<VCard> vcard = iq->getPayload<VCard>()) {
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<ToplevelElement> element, b
}
else {
JID toJID = stanza->getTo();
- boost::shared_ptr<Session> outgoingSession =
+ std::shared_ptr<Session> outgoingSession =
getLinkLocalSessionForJID(toJID);
if (outgoingSession) {
outgoingSession->sendElement(stanza);
@@ -254,10 +254,10 @@ void Server::handleElementReceived(boost::shared_ptr<ToplevelElement> element, b
boost::optional<LinkLocalService> service =
presenceManager->getServiceForJID(toJID);
if (service) {
- boost::shared_ptr<LinkLocalConnector> connector =
+ std::shared_ptr<LinkLocalConnector> connector =
getLinkLocalConnectorForJID(toJID);
if (!connector) {
- connector = boost::shared_ptr<LinkLocalConnector>(
+ connector = std::shared_ptr<LinkLocalConnector>(
new LinkLocalConnector(
*service,
linkLocalServiceBrowser->getQuerier(),
@@ -278,23 +278,23 @@ void Server::handleElementReceived(boost::shared_ptr<ToplevelElement> element, b
}
}
-void Server::handleNewLinkLocalConnection(boost::shared_ptr<Connection> connection) {
- boost::shared_ptr<IncomingLinkLocalSession> session(
+void Server::handleNewLinkLocalConnection(std::shared_ptr<Connection> connection) {
+ std::shared_ptr<IncomingLinkLocalSession> session(
new IncomingLinkLocalSession(
selfJID, connection,
&payloadParserFactories, &payloadSerializers, &xmlParserFactory));
registerLinkLocalSession(session);
}
-void Server::handleLinkLocalSessionFinished(boost::shared_ptr<Session> session) {
+void Server::handleLinkLocalSessionFinished(std::shared_ptr<Session> 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<ToplevelElement> element, boost::shared_ptr<Session> session) {
- if (boost::shared_ptr<Stanza> stanza = boost::dynamic_pointer_cast<Stanza>(element)) {
+void Server::handleLinkLocalElementReceived(std::shared_ptr<ToplevelElement> element, std::shared_ptr<Session> session) {
+ if (std::shared_ptr<Stanza> stanza = std::dynamic_pointer_cast<Stanza>(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<ToplevelElement> e
}
}
-void Server::handleConnectFinished(boost::shared_ptr<LinkLocalConnector> connector, bool error) {
+void Server::handleConnectFinished(std::shared_ptr<LinkLocalConnector> connector, bool error) {
if (error) {
std::cerr << "Error connecting" << std::endl;
// TODO: Send back queued stanzas
}
else {
- boost::shared_ptr<OutgoingLinkLocalSession> outgoingSession(
+ std::shared_ptr<OutgoingLinkLocalSession> outgoingSession(
new OutgoingLinkLocalSession(
selfJID, connector->getService().getJID(), connector->getConnection(),
&payloadParserFactories, &payloadSerializers, &xmlParserFactory));
- foreach(const boost::shared_ptr<ToplevelElement> element, connector->getQueuedElements()) {
+ foreach(const std::shared_ptr<ToplevelElement> element, connector->getQueuedElements()) {
outgoingSession->queueElement(element);
}
registerLinkLocalSession(outgoingSession);
@@ -322,42 +322,42 @@ void Server::handleConnectFinished(boost::shared_ptr<LinkLocalConnector> connect
connectors.erase(std::remove(connectors.begin(), connectors.end(), connector), connectors.end());
}
-void Server::registerLinkLocalSession(boost::shared_ptr<Session> session) {
+void Server::registerLinkLocalSession(std::shared_ptr<Session> 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<SessionTracer>(session));
+ //tracers.push_back(std::make_shared<SessionTracer>(session));
session->startSession();
}
-boost::shared_ptr<Session> Server::getLinkLocalSessionForJID(const JID& jid) {
- foreach(const boost::shared_ptr<Session> session, linkLocalSessions) {
+std::shared_ptr<Session> Server::getLinkLocalSessionForJID(const JID& jid) {
+ foreach(const std::shared_ptr<Session> session, linkLocalSessions) {
if (session->getRemoteJID() == jid) {
return session;
}
}
- return boost::shared_ptr<Session>();
+ return std::shared_ptr<Session>();
}
-boost::shared_ptr<LinkLocalConnector> Server::getLinkLocalConnectorForJID(const JID& jid) {
- foreach(const boost::shared_ptr<LinkLocalConnector> connector, connectors) {
+std::shared_ptr<LinkLocalConnector> Server::getLinkLocalConnectorForJID(const JID& jid) {
+ foreach(const std::shared_ptr<LinkLocalConnector> connector, connectors) {
if (connector->getService().getJID() == jid) {
return connector;
}
}
- return boost::shared_ptr<LinkLocalConnector>();
+ return std::shared_ptr<LinkLocalConnector>();
}
void Server::handleServiceRegistered(const DNSSDServiceID& service) {
selfJID = JID(service.getName());
}
-void Server::handleRosterChanged(boost::shared_ptr<RosterPayload> roster) {
+void Server::handleRosterChanged(std::shared_ptr<RosterPayload> roster) {
if (rosterRequested) {
assert(serverFromClientSession);
- boost::shared_ptr<IQ> iq = IQ::createRequest(
+ std::shared_ptr<IQ> 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<RosterPayload> roster) {
}
}
-void Server::handlePresenceChanged(boost::shared_ptr<Presence> presence) {
+void Server::handlePresenceChanged(std::shared_ptr<Presence> presence) {
if (rosterRequested) {
serverFromClientSession->sendElement(presence);
}
@@ -399,9 +399,9 @@ void Server::handleLinkLocalConnectionServerStopped(boost::optional<BoostConnect
}
}
-LinkLocalServiceInfo Server::getLinkLocalServiceInfo(boost::shared_ptr<Presence> presence) {
+LinkLocalServiceInfo Server::getLinkLocalServiceInfo(std::shared_ptr<Presence> presence) {
LinkLocalServiceInfo info;
- boost::shared_ptr<VCard> vcard = vCardCollection->getOwnVCard();
+ std::shared_ptr<VCard> 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 <memory>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/IDGenerator.h>
#include <Swiften/JID/JID.h>
@@ -65,26 +65,26 @@ namespace Swift {
private:
void stop(boost::optional<ServerError>);
- void handleNewClientConnection(boost::shared_ptr<Connection> c);
+ void handleNewClientConnection(std::shared_ptr<Connection> c);
void handleSessionStarted();
- void handleSessionFinished(boost::shared_ptr<ServerFromClientSession>);
- void handleElementReceived(boost::shared_ptr<ToplevelElement> element, boost::shared_ptr<ServerFromClientSession> session);
- void handleRosterChanged(boost::shared_ptr<RosterPayload> roster);
- void handlePresenceChanged(boost::shared_ptr<Presence> presence);
+ void handleSessionFinished(std::shared_ptr<ServerFromClientSession>);
+ void handleElementReceived(std::shared_ptr<ToplevelElement> element, std::shared_ptr<ServerFromClientSession> session);
+ void handleRosterChanged(std::shared_ptr<RosterPayload> roster);
+ void handlePresenceChanged(std::shared_ptr<Presence> presence);
void handleServiceRegistered(const DNSSDServiceID& service);
- void handleNewLinkLocalConnection(boost::shared_ptr<Connection> connection);
- void handleLinkLocalSessionFinished(boost::shared_ptr<Session> session);
- void handleLinkLocalElementReceived(boost::shared_ptr<ToplevelElement> element, boost::shared_ptr<Session> session);
- void handleConnectFinished(boost::shared_ptr<LinkLocalConnector> connector, bool error);
+ void handleNewLinkLocalConnection(std::shared_ptr<Connection> connection);
+ void handleLinkLocalSessionFinished(std::shared_ptr<Session> session);
+ void handleLinkLocalElementReceived(std::shared_ptr<ToplevelElement> element, std::shared_ptr<Session> session);
+ void handleConnectFinished(std::shared_ptr<LinkLocalConnector> connector, bool error);
void handleClientConnectionServerStopped(
boost::optional<BoostConnectionServer::Error>);
void handleLinkLocalConnectionServerStopped(
boost::optional<BoostConnectionServer::Error>);
- boost::shared_ptr<Session> getLinkLocalSessionForJID(const JID& jid);
- boost::shared_ptr<LinkLocalConnector> getLinkLocalConnectorForJID(const JID& jid);
- void registerLinkLocalSession(boost::shared_ptr<Session> session);
+ std::shared_ptr<Session> getLinkLocalSessionForJID(const JID& jid);
+ std::shared_ptr<LinkLocalConnector> getLinkLocalConnectorForJID(const JID& jid);
+ void registerLinkLocalSession(std::shared_ptr<Session> session);
void unregisterService();
- LinkLocalServiceInfo getLinkLocalServiceInfo(boost::shared_ptr<Presence> presence);
+ LinkLocalServiceInfo getLinkLocalServiceInfo(std::shared_ptr<Presence> presence);
private:
class DummyUserRegistry : public UserRegistry {
@@ -112,15 +112,15 @@ namespace Swift {
EventLoop* eventLoop;
LinkLocalPresenceManager* presenceManager;
bool stopping;
- boost::shared_ptr<BoostConnectionServer> serverFromClientConnectionServer;
+ std::shared_ptr<BoostConnectionServer> serverFromClientConnectionServer;
std::vector<boost::bsignals::connection> serverFromClientConnectionServerSignalConnections;
- boost::shared_ptr<ServerFromClientSession> serverFromClientSession;
- boost::shared_ptr<Presence> lastPresence;
+ std::shared_ptr<ServerFromClientSession> serverFromClientSession;
+ std::shared_ptr<Presence> lastPresence;
JID selfJID;
- boost::shared_ptr<BoostConnectionServer> serverFromNetworkConnectionServer;
+ std::shared_ptr<BoostConnectionServer> serverFromNetworkConnectionServer;
std::vector<boost::bsignals::connection> serverFromNetworkConnectionServerSignalConnections;
- std::vector< boost::shared_ptr<Session> > linkLocalSessions;
- std::vector< boost::shared_ptr<LinkLocalConnector> > connectors;
- std::vector< boost::shared_ptr<SessionTracer> > tracers;
+ std::vector< std::shared_ptr<Session> > linkLocalSessions;
+ std::vector< std::shared_ptr<LinkLocalConnector> > connectors;
+ std::vector< std::shared_ptr<SessionTracer> > 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<FakeDNSSDQuerier>("wonderland.lit", eventLoop);
+ querier = std::make_shared<FakeDNSSDQuerier>("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<LinkLocalPresenceManager> testling(createTestling());
+ std::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(testling->getRoster()->getItems().size()));
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(testling->getAllPresence().size()));
}
void testServiceAdded() {
- boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
+ std::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "Alice");
@@ -82,7 +82,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testServiceRemoved() {
- boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
+ std::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
removeService("alice@wonderland");
@@ -95,7 +95,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testServiceChanged() {
- boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
+ std::shared_ptr<LinkLocalPresenceManager> 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<LinkLocalPresenceManager> testling(createTestling());
+ std::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
addService("rabbit@teaparty");
updateServicePresence("rabbit@teaparty", LinkLocalServiceInfo::Away, "Partying");
- std::vector<boost::shared_ptr<Presence> > presences = testling->getAllPresence();
+ std::vector<std::shared_ptr<Presence> > presences = testling->getAllPresence();
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(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<LinkLocalPresenceManager> testling(createTestling());
+ std::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "Alice");
addService("rabbit@teaparty", "Rabbit");
- boost::shared_ptr<RosterPayload> roster = testling->getRoster();
+ std::shared_ptr<RosterPayload> roster = testling->getRoster();
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(roster->getItems().size()));
boost::optional<RosterItemPayload> item;
item = roster->getItem(JID("alice@wonderland"));
@@ -143,7 +143,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_InfoWithNick() {
- boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
+ std::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "Alice", "Alice In", "Wonderland");
@@ -152,7 +152,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_InfoWithFirstName() {
- boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
+ std::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "", "Alice In", "");
@@ -161,7 +161,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_InfoWithLastName() {
- boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
+ std::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "", "", "Wonderland");
@@ -170,7 +170,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_InfoWithFirstAndLastName() {
- boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
+ std::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "", "Alice In", "Wonderland");
@@ -179,7 +179,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_NoInfo() {
- boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
+ std::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
@@ -188,7 +188,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetServiceForJID() {
- boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
+ std::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
addService("rabbit@teaparty");
@@ -200,7 +200,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetServiceForJID_NoMatch() {
- boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
+ std::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
addService("queen@garden");
@@ -209,8 +209,8 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<LinkLocalPresenceManager> createTestling() {
- boost::shared_ptr<LinkLocalPresenceManager> testling(
+ std::shared_ptr<LinkLocalPresenceManager> createTestling() {
+ std::shared_ptr<LinkLocalPresenceManager> 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<RosterPayload> payload) {
+ void handleRosterChanged(std::shared_ptr<RosterPayload> payload) {
rosterChanges.push_back(payload);
}
- void handlePresenceChanged(boost::shared_ptr<Presence> presence) {
+ void handlePresenceChanged(std::shared_ptr<Presence> presence) {
presenceChanges.push_back(presence);
}
private:
DummyEventLoop* eventLoop;
- boost::shared_ptr<FakeDNSSDQuerier> querier;
+ std::shared_ptr<FakeDNSSDQuerier> querier;
LinkLocalServiceBrowser* browser;
- std::vector< boost::shared_ptr<RosterPayload> > rosterChanges;
- std::vector< boost::shared_ptr<Presence> > presenceChanges;
+ std::vector< std::shared_ptr<RosterPayload> > rosterChanges;
+ std::vector< std::shared_ptr<Presence> > 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Elements/VCard.h>
@@ -15,7 +15,7 @@ namespace Swift {
public:
virtual ~VCardCollection();
- virtual boost::shared_ptr<VCard> getOwnVCard() const = 0;
- virtual void setOwnVCard(boost::shared_ptr<VCard> vcard) = 0;
+ virtual std::shared_ptr<VCard> getOwnVCard() const = 0;
+ virtual void setOwnVCard(std::shared_ptr<VCard> 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 <Sluift/ElementConvertors/BodyConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -20,15 +20,15 @@ BodyConvertor::BodyConvertor() : GenericLuaElementConvertor<Body>("body") {
BodyConvertor::~BodyConvertor() {
}
-boost::shared_ptr<Body> BodyConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<Body> result = boost::make_shared<Body>();
+std::shared_ptr<Body> BodyConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<Body> result = std::make_shared<Body>();
if (boost::optional<std::string> value = Lua::getStringField(L, -1, "text")) {
result->setText(*value);
}
return result;
}
-void BodyConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<Body> payload) {
+void BodyConvertor::doConvertToLua(lua_State* L, std::shared_ptr<Body> 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<Body> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<Body>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Body> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Body>) 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 <Sluift/ElementConvertors/CommandConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -49,8 +50,8 @@ CommandConvertor::CommandConvertor(LuaElementConvertors* convertors) :
CommandConvertor::~CommandConvertor() {
}
-boost::shared_ptr<Command> CommandConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<Command> result = boost::make_shared<Command>();
+std::shared_ptr<Command> CommandConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<Command> result = std::make_shared<Command>();
lua_getfield(L, -1, "node");
if (!lua_isnil(L, -1)) {
@@ -129,7 +130,7 @@ boost::shared_ptr<Command> CommandConvertor::doConvertFromLua(lua_State* L) {
lua_getfield(L, -1, "form");
if (!lua_isnil(L, -1)) {
- if (boost::shared_ptr<Form> form = boost::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form"))) {
+ if (std::shared_ptr<Form> form = std::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form"))) {
result->setForm(form);
}
}
@@ -138,7 +139,7 @@ boost::shared_ptr<Command> CommandConvertor::doConvertFromLua(lua_State* L) {
return result;
}
-void CommandConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<Command> payload) {
+void CommandConvertor::doConvertToLua(lua_State* L, std::shared_ptr<Command> 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<Command> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<Command>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Command> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Command>) 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 <Sluift/ElementConvertors/DOMElementConvertor.h>
#include <iostream>
-
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -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<XMLTextNode>(lua_tostring(L, -1)));
+ element.addNode(std::make_shared<XMLTextNode>(lua_tostring(L, -1)));
}
else if (lua_istable(L, -1)) {
- element.addNode(boost::make_shared<XMLRawTextNode>(serializeElement(L)));
+ element.addNode(std::make_shared<XMLRawTextNode>(serializeElement(L)));
}
lua_pop(L, 1); // value
}
@@ -165,17 +164,17 @@ DOMElementConvertor::DOMElementConvertor() {
DOMElementConvertor::~DOMElementConvertor() {
}
-boost::shared_ptr<Element> DOMElementConvertor::convertFromLua(lua_State* L, int index, const std::string& type) {
+std::shared_ptr<Element> DOMElementConvertor::convertFromLua(lua_State* L, int index, const std::string& type) {
if (!lua_istable(L, index) || type != "dom") {
- return boost::shared_ptr<Payload>();
+ return std::shared_ptr<Payload>();
}
- return boost::make_shared<RawXMLPayload>(serializeElement(L).c_str());
+ return std::make_shared<RawXMLPayload>(serializeElement(L).c_str());
}
boost::optional<std::string> DOMElementConvertor::convertToLua(
- lua_State* L, boost::shared_ptr<Element> element) {
+ lua_State* L, std::shared_ptr<Element> element) {
// Serialize payload to XML
- boost::shared_ptr<Payload> payload = boost::dynamic_pointer_cast<Payload>(element);
+ std::shared_ptr<Payload> payload = std::dynamic_pointer_cast<Payload>(element);
if (!payload) {
return boost::optional<std::string>();
}
@@ -188,7 +187,7 @@ boost::optional<std::string> DOMElementConvertor::convertToLua(
// Parse the payload again
ParserClient parserClient(L);
- boost::shared_ptr<XMLParser> parser(parsers.createXMLParser(&parserClient));
+ std::shared_ptr<XMLParser> 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<Element> convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE;
- virtual boost::optional<std::string> convertToLua(lua_State*, boost::shared_ptr<Element>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Element> convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE;
+ virtual boost::optional<std::string> convertToLua(lua_State*, std::shared_ptr<Element>) 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<Element> DefaultElementConvertor::convertFromLua(lua_State*, int, const std::string& type) {
+std::shared_ptr<Element> DefaultElementConvertor::convertFromLua(lua_State*, int, const std::string& type) {
std::cerr << "Warning: Unable to convert type '" << type << "'" << std::endl;
- return boost::shared_ptr<Element>();
+ return std::shared_ptr<Element>();
}
-boost::optional<std::string> DefaultElementConvertor::convertToLua(lua_State*, boost::shared_ptr<Element>) {
+boost::optional<std::string> DefaultElementConvertor::convertToLua(lua_State*, std::shared_ptr<Element>) {
// 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<Element> convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE;
- virtual boost::optional<std::string> convertToLua(lua_State*, boost::shared_ptr<Element>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Element> convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE;
+ virtual boost::optional<std::string> convertToLua(lua_State*, std::shared_ptr<Element>) 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 <Sluift/ElementConvertors/DelayConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -23,8 +24,8 @@ DelayConvertor::DelayConvertor() : GenericLuaElementConvertor<Delay>("delay") {
DelayConvertor::~DelayConvertor() {
}
-boost::shared_ptr<Delay> DelayConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<Delay> result = boost::make_shared<Delay>();
+std::shared_ptr<Delay> DelayConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<Delay> result = std::make_shared<Delay>();
lua_getfield(L, -1, "stamp");
if (lua_isstring(L, -1)) {
result->setStamp(stringToDateTime(lua_tostring(L, -1)));
@@ -39,7 +40,7 @@ boost::shared_ptr<Delay> DelayConvertor::doConvertFromLua(lua_State* L) {
return result;
}
-void DelayConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<Delay> payload) {
+void DelayConvertor::doConvertToLua(lua_State* L, std::shared_ptr<Delay> 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<Delay> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<Delay>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Delay> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Delay>) 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 <Sluift/ElementConvertors/DiscoInfoConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -21,8 +22,8 @@ DiscoInfoConvertor::DiscoInfoConvertor() : GenericLuaElementConvertor<DiscoInfo>
DiscoInfoConvertor::~DiscoInfoConvertor() {
}
-boost::shared_ptr<DiscoInfo> DiscoInfoConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<DiscoInfo> result = boost::make_shared<DiscoInfo>();
+std::shared_ptr<DiscoInfo> DiscoInfoConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<DiscoInfo> result = std::make_shared<DiscoInfo>();
if (boost::optional<std::string> value = Lua::getStringField(L, -1, "node")) {
result->setNode(*value);
}
@@ -56,7 +57,7 @@ boost::shared_ptr<DiscoInfo> DiscoInfoConvertor::doConvertFromLua(lua_State* L)
return result;
}
-void DiscoInfoConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<DiscoInfo> payload) {
+void DiscoInfoConvertor::doConvertToLua(lua_State* L, std::shared_ptr<DiscoInfo> 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<DiscoInfo> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<DiscoInfo>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<DiscoInfo> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<DiscoInfo>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/DiscoItemsConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -21,8 +22,8 @@ DiscoItemsConvertor::DiscoItemsConvertor() : GenericLuaElementConvertor<DiscoIte
DiscoItemsConvertor::~DiscoItemsConvertor() {
}
-boost::shared_ptr<DiscoItems> DiscoItemsConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<DiscoItems> result = boost::make_shared<DiscoItems>();
+std::shared_ptr<DiscoItems> DiscoItemsConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<DiscoItems> result = std::make_shared<DiscoItems>();
if (boost::optional<std::string> value = Lua::getStringField(L, -1, "node")) {
result->setNode(*value);
}
@@ -40,7 +41,7 @@ boost::shared_ptr<DiscoItems> DiscoItemsConvertor::doConvertFromLua(lua_State* L
return result;
}
-void DiscoItemsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<DiscoItems> payload) {
+void DiscoItemsConvertor::doConvertToLua(lua_State* L, std::shared_ptr<DiscoItems> 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<DiscoItems> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<DiscoItems>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<DiscoItems> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<DiscoItems>) 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 <Sluift/ElementConvertors/UserTuneConvertor.h>
void LuaElementConvertors::registerConvertors() {
- convertors.push_back(boost::make_shared<PubSubRetractConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubAffiliationsConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubPublishConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubItemsConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubOwnerRedirectConvertor>());
- convertors.push_back(boost::make_shared<PubSubEventRedirectConvertor>());
- convertors.push_back(boost::make_shared<UserTuneConvertor>());
- convertors.push_back(boost::make_shared<PubSubConfigureConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubEventDisassociateConvertor>());
- convertors.push_back(boost::make_shared<PubSubOwnerAffiliationsConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubOwnerConfigureConvertor>(this));
- convertors.push_back(boost::make_shared<UserLocationConvertor>());
- convertors.push_back(boost::make_shared<PubSubSubscribeOptionsConvertor>());
- convertors.push_back(boost::make_shared<PubSubOwnerSubscriptionsConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubDefaultConvertor>());
- convertors.push_back(boost::make_shared<PubSubEventCollectionConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubEventSubscriptionConvertor>());
- convertors.push_back(boost::make_shared<PubSubEventRetractConvertor>());
- convertors.push_back(boost::make_shared<PubSubItemConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubUnsubscribeConvertor>());
- convertors.push_back(boost::make_shared<PubSubEventDeleteConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubCreateConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubOwnerPurgeConvertor>());
- convertors.push_back(boost::make_shared<PubSubEventItemsConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubOptionsConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubEventItemConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubOwnerSubscriptionConvertor>());
- convertors.push_back(boost::make_shared<IsodeIQDelegationConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubOwnerAffiliationConvertor>());
- convertors.push_back(boost::make_shared<PubSubEventPurgeConvertor>());
- convertors.push_back(boost::make_shared<PubSubAffiliationConvertor>());
- convertors.push_back(boost::make_shared<PubSubSubscribeConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubOwnerDeleteConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubOwnerDefaultConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubSubscriptionsConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubEventAssociateConvertor>());
- convertors.push_back(boost::make_shared<PubSubSubscriptionConvertor>(this));
- convertors.push_back(boost::make_shared<SecurityLabelConvertor>());
- convertors.push_back(boost::make_shared<PubSubEventConfigurationConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubRetractConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubAffiliationsConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubPublishConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubItemsConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubOwnerRedirectConvertor>());
+ convertors.push_back(std::make_shared<PubSubEventRedirectConvertor>());
+ convertors.push_back(std::make_shared<UserTuneConvertor>());
+ convertors.push_back(std::make_shared<PubSubConfigureConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubEventDisassociateConvertor>());
+ convertors.push_back(std::make_shared<PubSubOwnerAffiliationsConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubOwnerConfigureConvertor>(this));
+ convertors.push_back(std::make_shared<UserLocationConvertor>());
+ convertors.push_back(std::make_shared<PubSubSubscribeOptionsConvertor>());
+ convertors.push_back(std::make_shared<PubSubOwnerSubscriptionsConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubDefaultConvertor>());
+ convertors.push_back(std::make_shared<PubSubEventCollectionConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubEventSubscriptionConvertor>());
+ convertors.push_back(std::make_shared<PubSubEventRetractConvertor>());
+ convertors.push_back(std::make_shared<PubSubItemConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubUnsubscribeConvertor>());
+ convertors.push_back(std::make_shared<PubSubEventDeleteConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubCreateConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubOwnerPurgeConvertor>());
+ convertors.push_back(std::make_shared<PubSubEventItemsConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubOptionsConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubEventItemConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubOwnerSubscriptionConvertor>());
+ convertors.push_back(std::make_shared<IsodeIQDelegationConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubOwnerAffiliationConvertor>());
+ convertors.push_back(std::make_shared<PubSubEventPurgeConvertor>());
+ convertors.push_back(std::make_shared<PubSubAffiliationConvertor>());
+ convertors.push_back(std::make_shared<PubSubSubscribeConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubOwnerDeleteConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubOwnerDefaultConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubSubscriptionsConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubEventAssociateConvertor>());
+ convertors.push_back(std::make_shared<PubSubSubscriptionConvertor>(this));
+ convertors.push_back(std::make_shared<SecurityLabelConvertor>());
+ convertors.push_back(std::make_shared<PubSubEventConfigurationConvertor>(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 <Sluift/ElementConvertors/FormConvertor.h>
+#include <memory>
#include <sstream>
#include <boost/assign/list_of.hpp>
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -66,7 +66,7 @@ namespace {
return 0;
}
- Lua::Table convertFieldToLua(boost::shared_ptr<FormField> field) {
+ Lua::Table convertFieldToLua(std::shared_ptr<FormField> 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<FormField> >& fieldList) {
+ Lua::Array convertFieldListToLua(const std::vector< std::shared_ptr<FormField> >& fieldList) {
Lua::Array fields;
- foreach(boost::shared_ptr<FormField> field, fieldList) {
+ foreach(std::shared_ptr<FormField> field, fieldList) {
fields.push_back(convertFieldToLua(field));
}
return fields;
}
- boost::shared_ptr<FormField> convertFieldFromLua(lua_State* L) {
- boost::shared_ptr<FormField> result = boost::make_shared<FormField>();
+ std::shared_ptr<FormField> convertFieldFromLua(lua_State* L) {
+ std::shared_ptr<FormField> result = std::make_shared<FormField>();
FormField::Type fieldType = FormField::UnknownType;
boost::optional<std::string> type = Lua::getStringField(L, -1, "type");
if (type) {
@@ -212,8 +212,8 @@ namespace {
return result;
}
- std::vector< boost::shared_ptr<FormField> > convertFieldListFromLua(lua_State* L) {
- std::vector< boost::shared_ptr<FormField> > result;
+ std::vector< std::shared_ptr<FormField> > convertFieldListFromLua(lua_State* L) {
+ std::vector< std::shared_ptr<FormField> > 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<Form> convertFormFromLua(lua_State* L) {
- boost::shared_ptr<Form> result = boost::make_shared<Form>();
+ std::shared_ptr<Form> convertFormFromLua(lua_State* L) {
+ std::shared_ptr<Form> result = std::make_shared<Form>();
if (boost::optional<std::string> 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> formField, convertFieldListFromLua(L)) {
+ foreach (std::shared_ptr<FormField> 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> formField, convertFieldListFromLua(L)) {
+ foreach (std::shared_ptr<FormField> formField, convertFieldListFromLua(L)) {
result->addReportedField(formField);
}
}
@@ -271,7 +271,7 @@ namespace {
return result;
}
- void convertFormToLua(lua_State* L, boost::shared_ptr<Form> payload) {
+ void convertFormToLua(lua_State* L, std::shared_ptr<Form> 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> form = convertFormFromLua(L);
+ std::shared_ptr<Form> form = convertFormFromLua(L);
// Remove all redundant elements
form->setInstructions("");
form->setTitle("");
form->clearItems();
form->clearReportedFields();
- std::vector< boost::shared_ptr<FormField> > fields(form->getFields());
+ std::vector< std::shared_ptr<FormField> > fields(form->getFields());
form->clearFields();
- foreach (boost::shared_ptr<FormField> field, fields) {
+ foreach (std::shared_ptr<FormField> field, fields) {
if (field->getType() == FormField::FixedType) {
continue;
}
@@ -350,11 +350,11 @@ FormConvertor::FormConvertor() : GenericLuaElementConvertor<Form>("form") {
FormConvertor::~FormConvertor() {
}
-boost::shared_ptr<Form> FormConvertor::doConvertFromLua(lua_State* L) {
+std::shared_ptr<Form> FormConvertor::doConvertFromLua(lua_State* L) {
return convertFormFromLua(L);
}
-void FormConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<Form> payload) {
+void FormConvertor::doConvertToLua(lua_State* L, std::shared_ptr<Form> 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<Form> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<Form>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Form> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Form>) 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 <Sluift/ElementConvertors/ForwardedConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -29,11 +30,11 @@ ForwardedConvertor::ForwardedConvertor(LuaElementConvertors* convertors) :
ForwardedConvertor::~ForwardedConvertor() {
}
-boost::shared_ptr<Forwarded> ForwardedConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<Forwarded> result = boost::make_shared<Forwarded>();
+std::shared_ptr<Forwarded> ForwardedConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<Forwarded> result = std::make_shared<Forwarded>();
lua_getfield(L, -1, "delay");
if (!lua_isnil(L, -1)) {
- boost::shared_ptr<Delay> delay = boost::dynamic_pointer_cast<Delay>(convertors->convertFromLuaUntyped(L, -1, "delay"));
+ std::shared_ptr<Delay> delay = std::dynamic_pointer_cast<Delay>(convertors->convertFromLuaUntyped(L, -1, "delay"));
if (!!delay) {
result->setDelay(delay);
}
@@ -41,7 +42,7 @@ boost::shared_ptr<Forwarded> ForwardedConvertor::doConvertFromLua(lua_State* L)
lua_pop(L, 1);
lua_getfield(L, -1, "stanza");
if (!lua_isnil(L, -1)) {
- boost::shared_ptr<Stanza> stanza = boost::dynamic_pointer_cast<Stanza>(convertors->convertFromLua(L, -1));
+ std::shared_ptr<Stanza> stanza = std::dynamic_pointer_cast<Stanza>(convertors->convertFromLua(L, -1));
if (!!stanza) {
result->setStanza(stanza);
}
@@ -51,12 +52,12 @@ boost::shared_ptr<Forwarded> ForwardedConvertor::doConvertFromLua(lua_State* L)
return result;
}
-void ForwardedConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<Forwarded> payload) {
+void ForwardedConvertor::doConvertToLua(lua_State* L, std::shared_ptr<Forwarded> payload) {
lua_createtable(L, 0, 0);
if (convertors->convertToLuaUntyped(L, payload->getDelay()) > 0) {
lua_setfield(L, -2, "delay");
}
- boost::shared_ptr<Stanza> stanza = payload->getStanza();
+ std::shared_ptr<Stanza> 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<Forwarded> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<Forwarded>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Forwarded> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Forwarded>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/IQConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,8 +22,8 @@ IQConvertor::IQConvertor(LuaElementConvertors* convertors) :
IQConvertor::~IQConvertor() {
}
-boost::shared_ptr<IQ> IQConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<IQ> result = getStanza(L, convertors);
+std::shared_ptr<IQ> IQConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<IQ> 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<IQ> IQConvertor::doConvertFromLua(lua_State* L) {
return result;
}
-void IQConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<IQ> stanza) {
+void IQConvertor::doConvertToLua(lua_State* L, std::shared_ptr<IQ> 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<IQ> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<IQ>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<IQ> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<IQ>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/IsodeIQDelegationConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,11 +22,11 @@ IsodeIQDelegationConvertor::IsodeIQDelegationConvertor(LuaElementConvertors* con
IsodeIQDelegationConvertor::~IsodeIQDelegationConvertor() {
}
-boost::shared_ptr<IsodeIQDelegation> IsodeIQDelegationConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<IsodeIQDelegation> result = boost::make_shared<IsodeIQDelegation>();
+std::shared_ptr<IsodeIQDelegation> IsodeIQDelegationConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<IsodeIQDelegation> result = std::make_shared<IsodeIQDelegation>();
lua_getfield(L, -1, "forward");
if (!lua_isnil(L, -1)) {
- if (boost::shared_ptr<Forwarded> payload = boost::dynamic_pointer_cast<Forwarded>(convertors->convertFromLuaUntyped(L, -1, "forwarded"))) {
+ if (std::shared_ptr<Forwarded> payload = std::dynamic_pointer_cast<Forwarded>(convertors->convertFromLuaUntyped(L, -1, "forwarded"))) {
result->setForward(payload);
}
}
@@ -34,7 +34,7 @@ boost::shared_ptr<IsodeIQDelegation> IsodeIQDelegationConvertor::doConvertFromLu
return result;
}
-void IsodeIQDelegationConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<IsodeIQDelegation> payload) {
+void IsodeIQDelegationConvertor::doConvertToLua(lua_State* L, std::shared_ptr<IsodeIQDelegation> 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<IsodeIQDelegation> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<IsodeIQDelegation>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<IsodeIQDelegation> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<IsodeIQDelegation>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/MAMFinConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -25,8 +26,8 @@ MAMFinConvertor::MAMFinConvertor(LuaElementConvertors* convertors) :
MAMFinConvertor::~MAMFinConvertor() {
}
-boost::shared_ptr<MAMFin> MAMFinConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<MAMFin> result = boost::make_shared<MAMFin>();
+std::shared_ptr<MAMFin> MAMFinConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<MAMFin> result = std::make_shared<MAMFin>();
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<MAMFin> MAMFinConvertor::doConvertFromLua(lua_State* L) {
lua_pop(L, 1);
lua_getfield(L, -1, "result_set");
if (!lua_isnil(L, -1)) {
- boost::shared_ptr<ResultSet> resultSet = boost::dynamic_pointer_cast<ResultSet>(convertors->convertFromLuaUntyped(L, -1, "result_set"));
+ std::shared_ptr<ResultSet> resultSet = std::dynamic_pointer_cast<ResultSet>(convertors->convertFromLuaUntyped(L, -1, "result_set"));
if (!!resultSet) {
result->setResultSet(resultSet);
}
@@ -53,7 +54,7 @@ boost::shared_ptr<MAMFin> MAMFinConvertor::doConvertFromLua(lua_State* L) {
return result;
}
-void MAMFinConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<MAMFin> payload) {
+void MAMFinConvertor::doConvertToLua(lua_State* L, std::shared_ptr<MAMFin> 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<MAMFin> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<MAMFin>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<MAMFin> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<MAMFin>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/MAMQueryConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -26,8 +27,8 @@ MAMQueryConvertor::MAMQueryConvertor(LuaElementConvertors* convertors) :
MAMQueryConvertor::~MAMQueryConvertor() {
}
-boost::shared_ptr<MAMQuery> MAMQueryConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<MAMQuery> result = boost::make_shared<MAMQuery>();
+std::shared_ptr<MAMQuery> MAMQueryConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<MAMQuery> result = std::make_shared<MAMQuery>();
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<MAMQuery> MAMQueryConvertor::doConvertFromLua(lua_State* L) {
lua_pop(L, 1);
lua_getfield(L, -1, "form");
if (!lua_isnil(L, -1)) {
- boost::shared_ptr<Form> form = boost::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form"));
+ std::shared_ptr<Form> form = std::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form"));
if (!!form) {
result->setForm(form);
}
@@ -48,7 +49,7 @@ boost::shared_ptr<MAMQuery> MAMQueryConvertor::doConvertFromLua(lua_State* L) {
lua_pop(L, 1);
lua_getfield(L, -1, "result_set");
if (!lua_isnil(L, -1)) {
- boost::shared_ptr<ResultSet> resultSet = boost::dynamic_pointer_cast<ResultSet>(convertors->convertFromLuaUntyped(L, -1, "result_set"));
+ std::shared_ptr<ResultSet> resultSet = std::dynamic_pointer_cast<ResultSet>(convertors->convertFromLuaUntyped(L, -1, "result_set"));
if (!!resultSet) {
result->setResultSet(resultSet);
}
@@ -57,7 +58,7 @@ boost::shared_ptr<MAMQuery> MAMQueryConvertor::doConvertFromLua(lua_State* L) {
return result;
}
-void MAMQueryConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<MAMQuery> payload) {
+void MAMQueryConvertor::doConvertToLua(lua_State* L, std::shared_ptr<MAMQuery> 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<MAMQuery> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<MAMQuery>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<MAMQuery> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<MAMQuery>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/MAMResultConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -25,11 +26,11 @@ MAMResultConvertor::MAMResultConvertor(LuaElementConvertors* convertors) :
MAMResultConvertor::~MAMResultConvertor() {
}
-boost::shared_ptr<MAMResult> MAMResultConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<MAMResult> result = boost::make_shared<MAMResult>();
+std::shared_ptr<MAMResult> MAMResultConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<MAMResult> result = std::make_shared<MAMResult>();
lua_getfield(L, -1, "payload");
if (!lua_isnil(L, -1)) {
- boost::shared_ptr<Forwarded> payload = boost::dynamic_pointer_cast<Forwarded>(convertors->convertFromLuaUntyped(L, -1, "payload"));
+ std::shared_ptr<Forwarded> payload = std::dynamic_pointer_cast<Forwarded>(convertors->convertFromLuaUntyped(L, -1, "payload"));
if (!!payload) {
result->setPayload(payload);
}
@@ -48,7 +49,7 @@ boost::shared_ptr<MAMResult> MAMResultConvertor::doConvertFromLua(lua_State* L)
return result;
}
-void MAMResultConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<MAMResult> payload) {
+void MAMResultConvertor::doConvertToLua(lua_State* L, std::shared_ptr<MAMResult> 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<MAMResult> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<MAMResult>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<MAMResult> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<MAMResult>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/MessageConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,8 +22,8 @@ MessageConvertor::MessageConvertor(LuaElementConvertors* convertors) :
MessageConvertor::~MessageConvertor() {
}
-boost::shared_ptr<Message> MessageConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<Message> result = getStanza(L, convertors);
+std::shared_ptr<Message> MessageConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<Message> 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<Message> MessageConvertor::doConvertFromLua(lua_State* L) {
return result;
}
-void MessageConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<Message> stanza) {
+void MessageConvertor::doConvertToLua(lua_State* L, std::shared_ptr<Message> 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<Message> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<Message>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Message> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Message>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PresenceConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,8 +22,8 @@ PresenceConvertor::PresenceConvertor(LuaElementConvertors* convertors) :
PresenceConvertor::~PresenceConvertor() {
}
-boost::shared_ptr<Presence> PresenceConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<Presence> result = getStanza(L, convertors);
+std::shared_ptr<Presence> PresenceConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<Presence> 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<Presence> PresenceConvertor::doConvertFromLua(lua_State* L) {
return result;
}
-void PresenceConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<Presence> stanza) {
+void PresenceConvertor::doConvertToLua(lua_State* L, std::shared_ptr<Presence> 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<Presence> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<Presence>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Presence> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Presence>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubAffiliationConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -19,8 +19,8 @@ PubSubAffiliationConvertor::PubSubAffiliationConvertor() :
PubSubAffiliationConvertor::~PubSubAffiliationConvertor() {
}
-boost::shared_ptr<PubSubAffiliation> PubSubAffiliationConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubAffiliation> result = boost::make_shared<PubSubAffiliation>();
+std::shared_ptr<PubSubAffiliation> PubSubAffiliationConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubAffiliation> result = std::make_shared<PubSubAffiliation>();
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<PubSubAffiliation> PubSubAffiliationConvertor::doConvertFromLu
return result;
}
-void PubSubAffiliationConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubAffiliation> payload) {
+void PubSubAffiliationConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubAffiliation> 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<PubSubAffiliation> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubAffiliation>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubAffiliation> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubAffiliation>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubAffiliationsConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -25,20 +26,20 @@ PubSubAffiliationsConvertor::PubSubAffiliationsConvertor(LuaElementConvertors* c
PubSubAffiliationsConvertor::~PubSubAffiliationsConvertor() {
}
-boost::shared_ptr<PubSubAffiliations> PubSubAffiliationsConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubAffiliations> result = boost::make_shared<PubSubAffiliations>();
+std::shared_ptr<PubSubAffiliations> PubSubAffiliationsConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubAffiliations> result = std::make_shared<PubSubAffiliations>();
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<PubSubAffiliation> > items;
+ std::vector< std::shared_ptr<PubSubAffiliation> > 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<PubSubAffiliation> payload = boost::dynamic_pointer_cast<PubSubAffiliation>(convertors->convertFromLuaUntyped(L, -1, "pubsub_affiliation"))) {
+ if (std::shared_ptr<PubSubAffiliation> payload = std::dynamic_pointer_cast<PubSubAffiliation>(convertors->convertFromLuaUntyped(L, -1, "pubsub_affiliation"))) {
items.push_back(payload);
}
}
@@ -50,7 +51,7 @@ boost::shared_ptr<PubSubAffiliations> PubSubAffiliationsConvertor::doConvertFrom
return result;
}
-void PubSubAffiliationsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubAffiliations> payload) {
+void PubSubAffiliationsConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubAffiliations> 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<PubSubAffiliation> item, payload->getAffiliations()) {
+ foreach(std::shared_ptr<PubSubAffiliation> item, payload->getAffiliations()) {
if (convertors->convertToLuaUntyped(L, item) > 0) {
lua_rawseti(L, -2, boost::numeric_cast<int>(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<PubSubAffiliations> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubAffiliations>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubAffiliations> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubAffiliations>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubConfigureConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,11 +22,11 @@ PubSubConfigureConvertor::PubSubConfigureConvertor(LuaElementConvertors* convert
PubSubConfigureConvertor::~PubSubConfigureConvertor() {
}
-boost::shared_ptr<PubSubConfigure> PubSubConfigureConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubConfigure> result = boost::make_shared<PubSubConfigure>();
+std::shared_ptr<PubSubConfigure> PubSubConfigureConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubConfigure> result = std::make_shared<PubSubConfigure>();
lua_getfield(L, -1, "data");
if (!lua_isnil(L, -1)) {
- if (boost::shared_ptr<Form> payload = boost::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form"))) {
+ if (std::shared_ptr<Form> payload = std::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form"))) {
result->setData(payload);
}
}
@@ -34,7 +34,7 @@ boost::shared_ptr<PubSubConfigure> PubSubConfigureConvertor::doConvertFromLua(lu
return result;
}
-void PubSubConfigureConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubConfigure> payload) {
+void PubSubConfigureConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubConfigure> 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<PubSubConfigure> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubConfigure>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubConfigure> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubConfigure>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubCreateConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,8 +22,8 @@ PubSubCreateConvertor::PubSubCreateConvertor(LuaElementConvertors* convertors) :
PubSubCreateConvertor::~PubSubCreateConvertor() {
}
-boost::shared_ptr<PubSubCreate> PubSubCreateConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubCreate> result = boost::make_shared<PubSubCreate>();
+std::shared_ptr<PubSubCreate> PubSubCreateConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubCreate> result = std::make_shared<PubSubCreate>();
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<PubSubCreate> PubSubCreateConvertor::doConvertFromLua(lua_Stat
lua_pop(L, 1);
lua_getfield(L, -1, "configure");
if (!lua_isnil(L, -1)) {
- if (boost::shared_ptr<PubSubConfigure> payload = boost::dynamic_pointer_cast<PubSubConfigure>(convertors->convertFromLuaUntyped(L, -1, "pubsub_configure"))) {
+ if (std::shared_ptr<PubSubConfigure> payload = std::dynamic_pointer_cast<PubSubConfigure>(convertors->convertFromLuaUntyped(L, -1, "pubsub_configure"))) {
result->setConfigure(payload);
}
}
@@ -39,7 +39,7 @@ boost::shared_ptr<PubSubCreate> PubSubCreateConvertor::doConvertFromLua(lua_Stat
return result;
}
-void PubSubCreateConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubCreate> payload) {
+void PubSubCreateConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubCreate> 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<PubSubCreate> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubCreate>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubCreate> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubCreate>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubDefaultConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -19,8 +19,8 @@ PubSubDefaultConvertor::PubSubDefaultConvertor() :
PubSubDefaultConvertor::~PubSubDefaultConvertor() {
}
-boost::shared_ptr<PubSubDefault> PubSubDefaultConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubDefault> result = boost::make_shared<PubSubDefault>();
+std::shared_ptr<PubSubDefault> PubSubDefaultConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubDefault> result = std::make_shared<PubSubDefault>();
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<PubSubDefault> PubSubDefaultConvertor::doConvertFromLua(lua_St
return result;
}
-void PubSubDefaultConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubDefault> payload) {
+void PubSubDefaultConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubDefault> 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<PubSubDefault> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubDefault>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubDefault> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubDefault>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubEventAssociateConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -19,8 +19,8 @@ PubSubEventAssociateConvertor::PubSubEventAssociateConvertor() :
PubSubEventAssociateConvertor::~PubSubEventAssociateConvertor() {
}
-boost::shared_ptr<PubSubEventAssociate> PubSubEventAssociateConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubEventAssociate> result = boost::make_shared<PubSubEventAssociate>();
+std::shared_ptr<PubSubEventAssociate> PubSubEventAssociateConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubEventAssociate> result = std::make_shared<PubSubEventAssociate>();
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<PubSubEventAssociate> PubSubEventAssociateConvertor::doConvert
return result;
}
-void PubSubEventAssociateConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubEventAssociate> payload) {
+void PubSubEventAssociateConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubEventAssociate> 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<PubSubEventAssociate> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubEventAssociate>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventAssociate> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventAssociate>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubEventCollectionConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,8 +22,8 @@ PubSubEventCollectionConvertor::PubSubEventCollectionConvertor(LuaElementConvert
PubSubEventCollectionConvertor::~PubSubEventCollectionConvertor() {
}
-boost::shared_ptr<PubSubEventCollection> PubSubEventCollectionConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubEventCollection> result = boost::make_shared<PubSubEventCollection>();
+std::shared_ptr<PubSubEventCollection> PubSubEventCollectionConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubEventCollection> result = std::make_shared<PubSubEventCollection>();
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<PubSubEventCollection> PubSubEventCollectionConvertor::doConve
lua_pop(L, 1);
lua_getfield(L, -1, "disassociate");
if (!lua_isnil(L, -1)) {
- if (boost::shared_ptr<PubSubEventDisassociate> payload = boost::dynamic_pointer_cast<PubSubEventDisassociate>(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_disassociate"))) {
+ if (std::shared_ptr<PubSubEventDisassociate> payload = std::dynamic_pointer_cast<PubSubEventDisassociate>(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<PubSubEventAssociate> payload = boost::dynamic_pointer_cast<PubSubEventAssociate>(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_associate"))) {
+ if (std::shared_ptr<PubSubEventAssociate> payload = std::dynamic_pointer_cast<PubSubEventAssociate>(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_associate"))) {
result->setAssociate(payload);
}
}
@@ -46,7 +46,7 @@ boost::shared_ptr<PubSubEventCollection> PubSubEventCollectionConvertor::doConve
return result;
}
-void PubSubEventCollectionConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubEventCollection> payload) {
+void PubSubEventCollectionConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubEventCollection> 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<PubSubEventCollection> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubEventCollection>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventCollection> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventCollection>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubEventConfigurationConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,8 +22,8 @@ PubSubEventConfigurationConvertor::PubSubEventConfigurationConvertor(LuaElementC
PubSubEventConfigurationConvertor::~PubSubEventConfigurationConvertor() {
}
-boost::shared_ptr<PubSubEventConfiguration> PubSubEventConfigurationConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubEventConfiguration> result = boost::make_shared<PubSubEventConfiguration>();
+std::shared_ptr<PubSubEventConfiguration> PubSubEventConfigurationConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubEventConfiguration> result = std::make_shared<PubSubEventConfiguration>();
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<PubSubEventConfiguration> PubSubEventConfigurationConvertor::d
lua_pop(L, 1);
lua_getfield(L, -1, "data");
if (!lua_isnil(L, -1)) {
- if (boost::shared_ptr<Form> payload = boost::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form"))) {
+ if (std::shared_ptr<Form> payload = std::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form"))) {
result->setData(payload);
}
}
@@ -39,7 +39,7 @@ boost::shared_ptr<PubSubEventConfiguration> PubSubEventConfigurationConvertor::d
return result;
}
-void PubSubEventConfigurationConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubEventConfiguration> payload) {
+void PubSubEventConfigurationConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubEventConfiguration> 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<PubSubEventConfiguration> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubEventConfiguration>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventConfiguration> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventConfiguration>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubEventConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,14 +22,14 @@ PubSubEventConvertor::PubSubEventConvertor(LuaElementConvertors* convertors) :
PubSubEventConvertor::~PubSubEventConvertor() {
}
-boost::shared_ptr<PubSubEvent> PubSubEventConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubEvent> result = boost::make_shared<PubSubEvent>();
- if (boost::shared_ptr<PubSubEventPayload> payload = boost::dynamic_pointer_cast<PubSubEventPayload>(convertors->convertFromLua(L, -1))) {
+std::shared_ptr<PubSubEvent> PubSubEventConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubEvent> result = std::make_shared<PubSubEvent>();
+ if (std::shared_ptr<PubSubEventPayload> payload = std::dynamic_pointer_cast<PubSubEventPayload>(convertors->convertFromLua(L, -1))) {
result->setPayload(payload);
}
return result;
}
-void PubSubEventConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubEvent> event) {
+void PubSubEventConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubEvent> 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<PubSubEvent> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubEvent>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEvent> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEvent>) 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 <Sluift/ElementConvertors/PubSubEventDeleteConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,8 +22,8 @@ PubSubEventDeleteConvertor::PubSubEventDeleteConvertor(LuaElementConvertors* con
PubSubEventDeleteConvertor::~PubSubEventDeleteConvertor() {
}
-boost::shared_ptr<PubSubEventDelete> PubSubEventDeleteConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubEventDelete> result = boost::make_shared<PubSubEventDelete>();
+std::shared_ptr<PubSubEventDelete> PubSubEventDeleteConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubEventDelete> result = std::make_shared<PubSubEventDelete>();
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<PubSubEventDelete> PubSubEventDeleteConvertor::doConvertFromLu
lua_pop(L, 1);
lua_getfield(L, -1, "redirects");
if (!lua_isnil(L, -1)) {
- if (boost::shared_ptr<PubSubEventRedirect> payload = boost::dynamic_pointer_cast<PubSubEventRedirect>(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_redirect"))) {
+ if (std::shared_ptr<PubSubEventRedirect> payload = std::dynamic_pointer_cast<PubSubEventRedirect>(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_redirect"))) {
result->setRedirects(payload);
}
}
@@ -39,7 +39,7 @@ boost::shared_ptr<PubSubEventDelete> PubSubEventDeleteConvertor::doConvertFromLu
return result;
}
-void PubSubEventDeleteConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubEventDelete> payload) {
+void PubSubEventDeleteConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubEventDelete> 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<PubSubEventDelete> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubEventDelete>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventDelete> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventDelete>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubEventDisassociateConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -19,8 +19,8 @@ PubSubEventDisassociateConvertor::PubSubEventDisassociateConvertor() :
PubSubEventDisassociateConvertor::~PubSubEventDisassociateConvertor() {
}
-boost::shared_ptr<PubSubEventDisassociate> PubSubEventDisassociateConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubEventDisassociate> result = boost::make_shared<PubSubEventDisassociate>();
+std::shared_ptr<PubSubEventDisassociate> PubSubEventDisassociateConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubEventDisassociate> result = std::make_shared<PubSubEventDisassociate>();
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<PubSubEventDisassociate> PubSubEventDisassociateConvertor::doC
return result;
}
-void PubSubEventDisassociateConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubEventDisassociate> payload) {
+void PubSubEventDisassociateConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubEventDisassociate> 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<PubSubEventDisassociate> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubEventDisassociate>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventDisassociate> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventDisassociate>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubEventItemConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -25,8 +26,8 @@ PubSubEventItemConvertor::PubSubEventItemConvertor(LuaElementConvertors* convert
PubSubEventItemConvertor::~PubSubEventItemConvertor() {
}
-boost::shared_ptr<PubSubEventItem> PubSubEventItemConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubEventItem> result = boost::make_shared<PubSubEventItem>();
+std::shared_ptr<PubSubEventItem> PubSubEventItemConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubEventItem> result = std::make_shared<PubSubEventItem>();
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<PubSubEventItem> PubSubEventItemConvertor::doConvertFromLua(lu
lua_pop(L, 1);
lua_getfield(L, -1, "data");
if (lua_type(L, -1) == LUA_TTABLE) {
- std::vector< boost::shared_ptr<Payload> > items;
+ std::vector< std::shared_ptr<Payload> > 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> payload = boost::dynamic_pointer_cast<Payload>(convertors->convertFromLua(L, -1))) {
+ if (std::shared_ptr<Payload> payload = std::dynamic_pointer_cast<Payload>(convertors->convertFromLua(L, -1))) {
items.push_back(payload);
}
}
@@ -62,7 +63,7 @@ boost::shared_ptr<PubSubEventItem> PubSubEventItemConvertor::doConvertFromLua(lu
return result;
}
-void PubSubEventItemConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubEventItem> payload) {
+void PubSubEventItemConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubEventItem> 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<Pu
lua_createtable(L, boost::numeric_cast<int>(payload->getData().size()), 0);
{
int i = 0;
- foreach(boost::shared_ptr<Payload> item, payload->getData()) {
+ foreach(std::shared_ptr<Payload> item, payload->getData()) {
if (convertors->convertToLua(L, item) > 0) {
lua_rawseti(L, -2, boost::numeric_cast<int>(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<PubSubEventItem> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubEventItem>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventItem> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventItem>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubEventItemsConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -25,8 +26,8 @@ PubSubEventItemsConvertor::PubSubEventItemsConvertor(LuaElementConvertors* conve
PubSubEventItemsConvertor::~PubSubEventItemsConvertor() {
}
-boost::shared_ptr<PubSubEventItems> PubSubEventItemsConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubEventItems> result = boost::make_shared<PubSubEventItems>();
+std::shared_ptr<PubSubEventItems> PubSubEventItemsConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubEventItems> result = std::make_shared<PubSubEventItems>();
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<PubSubEventItems> PubSubEventItemsConvertor::doConvertFromLua(
lua_pop(L, 1);
lua_getfield(L, -1, "items");
if (lua_type(L, -1) == LUA_TTABLE) {
- std::vector< boost::shared_ptr<PubSubEventItem> > items;
+ std::vector< std::shared_ptr<PubSubEventItem> > 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<PubSubEventItem> payload = boost::dynamic_pointer_cast<PubSubEventItem>(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_item"))) {
+ if (std::shared_ptr<PubSubEventItem> payload = std::dynamic_pointer_cast<PubSubEventItem>(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_item"))) {
items.push_back(payload);
}
}
@@ -51,12 +52,12 @@ boost::shared_ptr<PubSubEventItems> PubSubEventItemsConvertor::doConvertFromLua(
lua_pop(L, 1);
lua_getfield(L, -1, "retracts");
if (lua_type(L, -1) == LUA_TTABLE) {
- std::vector< boost::shared_ptr<PubSubEventRetract> > items;
+ std::vector< std::shared_ptr<PubSubEventRetract> > 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<PubSubEventRetract> payload = boost::dynamic_pointer_cast<PubSubEventRetract>(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_retract"))) {
+ if (std::shared_ptr<PubSubEventRetract> payload = std::dynamic_pointer_cast<PubSubEventRetract>(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_retract"))) {
items.push_back(payload);
}
}
@@ -69,7 +70,7 @@ boost::shared_ptr<PubSubEventItems> PubSubEventItemsConvertor::doConvertFromLua(
return result;
}
-void PubSubEventItemsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubEventItems> payload) {
+void PubSubEventItemsConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubEventItems> 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<P
lua_createtable(L, boost::numeric_cast<int>(payload->getItems().size()), 0);
{
int i = 0;
- foreach(boost::shared_ptr<PubSubEventItem> item, payload->getItems()) {
+ foreach(std::shared_ptr<PubSubEventItem> item, payload->getItems()) {
if (convertors->convertToLuaUntyped(L, item) > 0) {
lua_rawseti(L, -2, boost::numeric_cast<int>(i+1));
++i;
@@ -90,7 +91,7 @@ void PubSubEventItemsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<P
lua_createtable(L, boost::numeric_cast<int>(payload->getRetracts().size()), 0);
{
int i = 0;
- foreach(boost::shared_ptr<PubSubEventRetract> item, payload->getRetracts()) {
+ foreach(std::shared_ptr<PubSubEventRetract> item, payload->getRetracts()) {
if (convertors->convertToLuaUntyped(L, item) > 0) {
lua_rawseti(L, -2, boost::numeric_cast<int>(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<PubSubEventItems> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubEventItems>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventItems> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventItems>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubEventPurgeConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -19,8 +19,8 @@ PubSubEventPurgeConvertor::PubSubEventPurgeConvertor() :
PubSubEventPurgeConvertor::~PubSubEventPurgeConvertor() {
}
-boost::shared_ptr<PubSubEventPurge> PubSubEventPurgeConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubEventPurge> result = boost::make_shared<PubSubEventPurge>();
+std::shared_ptr<PubSubEventPurge> PubSubEventPurgeConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubEventPurge> result = std::make_shared<PubSubEventPurge>();
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<PubSubEventPurge> PubSubEventPurgeConvertor::doConvertFromLua(
return result;
}
-void PubSubEventPurgeConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubEventPurge> payload) {
+void PubSubEventPurgeConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubEventPurge> 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<PubSubEventPurge> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubEventPurge>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventPurge> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventPurge>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubEventRedirectConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -19,8 +19,8 @@ PubSubEventRedirectConvertor::PubSubEventRedirectConvertor() :
PubSubEventRedirectConvertor::~PubSubEventRedirectConvertor() {
}
-boost::shared_ptr<PubSubEventRedirect> PubSubEventRedirectConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubEventRedirect> result = boost::make_shared<PubSubEventRedirect>();
+std::shared_ptr<PubSubEventRedirect> PubSubEventRedirectConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubEventRedirect> result = std::make_shared<PubSubEventRedirect>();
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<PubSubEventRedirect> PubSubEventRedirectConvertor::doConvertFr
return result;
}
-void PubSubEventRedirectConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubEventRedirect> payload) {
+void PubSubEventRedirectConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubEventRedirect> 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<PubSubEventRedirect> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubEventRedirect>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventRedirect> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventRedirect>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubEventRetractConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -19,8 +19,8 @@ PubSubEventRetractConvertor::PubSubEventRetractConvertor() :
PubSubEventRetractConvertor::~PubSubEventRetractConvertor() {
}
-boost::shared_ptr<PubSubEventRetract> PubSubEventRetractConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubEventRetract> result = boost::make_shared<PubSubEventRetract>();
+std::shared_ptr<PubSubEventRetract> PubSubEventRetractConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubEventRetract> result = std::make_shared<PubSubEventRetract>();
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<PubSubEventRetract> PubSubEventRetractConvertor::doConvertFrom
return result;
}
-void PubSubEventRetractConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubEventRetract> payload) {
+void PubSubEventRetractConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubEventRetract> 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<PubSubEventRetract> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubEventRetract>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventRetract> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventRetract>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -21,8 +21,8 @@ PubSubEventSubscriptionConvertor::PubSubEventSubscriptionConvertor() :
PubSubEventSubscriptionConvertor::~PubSubEventSubscriptionConvertor() {
}
-boost::shared_ptr<PubSubEventSubscription> PubSubEventSubscriptionConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubEventSubscription> result = boost::make_shared<PubSubEventSubscription>();
+std::shared_ptr<PubSubEventSubscription> PubSubEventSubscriptionConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubEventSubscription> result = std::make_shared<PubSubEventSubscription>();
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<PubSubEventSubscription> PubSubEventSubscriptionConvertor::doC
return result;
}
-void PubSubEventSubscriptionConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubEventSubscription> payload) {
+void PubSubEventSubscriptionConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubEventSubscription> 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<PubSubEventSubscription> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubEventSubscription>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventSubscription> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventSubscription>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubItemConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -25,16 +26,16 @@ PubSubItemConvertor::PubSubItemConvertor(LuaElementConvertors* convertors) :
PubSubItemConvertor::~PubSubItemConvertor() {
}
-boost::shared_ptr<PubSubItem> PubSubItemConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubItem> result = boost::make_shared<PubSubItem>();
+std::shared_ptr<PubSubItem> PubSubItemConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubItem> result = std::make_shared<PubSubItem>();
lua_getfield(L, -1, "data");
if (lua_type(L, -1) == LUA_TTABLE) {
- std::vector< boost::shared_ptr<Payload> > items;
+ std::vector< std::shared_ptr<Payload> > 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> payload = boost::dynamic_pointer_cast<Payload>(convertors->convertFromLua(L, -1))) {
+ if (std::shared_ptr<Payload> payload = std::dynamic_pointer_cast<Payload>(convertors->convertFromLua(L, -1))) {
items.push_back(payload);
}
}
@@ -52,13 +53,13 @@ boost::shared_ptr<PubSubItem> PubSubItemConvertor::doConvertFromLua(lua_State* L
return result;
}
-void PubSubItemConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubItem> payload) {
+void PubSubItemConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubItem> payload) {
lua_createtable(L, 0, 0);
if (!payload->getData().empty()) {
lua_createtable(L, boost::numeric_cast<int>(payload->getData().size()), 0);
{
int i = 0;
- foreach(boost::shared_ptr<Payload> item, payload->getData()) {
+ foreach(std::shared_ptr<Payload> item, payload->getData()) {
if (convertors->convertToLua(L, item) > 0) {
lua_rawseti(L, -2, boost::numeric_cast<int>(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<PubSubItem> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubItem>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubItem> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubItem>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubItemsConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -25,20 +26,20 @@ PubSubItemsConvertor::PubSubItemsConvertor(LuaElementConvertors* convertors) :
PubSubItemsConvertor::~PubSubItemsConvertor() {
}
-boost::shared_ptr<PubSubItems> PubSubItemsConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubItems> result = boost::make_shared<PubSubItems>();
+std::shared_ptr<PubSubItems> PubSubItemsConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubItems> result = std::make_shared<PubSubItems>();
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<PubSubItem> > items;
+ std::vector< std::shared_ptr<PubSubItem> > 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<PubSubItem> payload = boost::dynamic_pointer_cast<PubSubItem>(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) {
+ if (std::shared_ptr<PubSubItem> payload = std::dynamic_pointer_cast<PubSubItem>(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) {
items.push_back(payload);
}
}
@@ -60,14 +61,14 @@ boost::shared_ptr<PubSubItems> PubSubItemsConvertor::doConvertFromLua(lua_State*
return result;
}
-void PubSubItemsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubItems> payload) {
+void PubSubItemsConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubItems> 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<PubSubItem> item, payload->getItems()) {
+ foreach(std::shared_ptr<PubSubItem> item, payload->getItems()) {
if (convertors->convertToLuaUntyped(L, item) > 0) {
lua_rawseti(L, -2, boost::numeric_cast<int>(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<PubSubItems> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubItems>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubItems> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubItems>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubOptionsConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,8 +22,8 @@ PubSubOptionsConvertor::PubSubOptionsConvertor(LuaElementConvertors* convertors)
PubSubOptionsConvertor::~PubSubOptionsConvertor() {
}
-boost::shared_ptr<PubSubOptions> PubSubOptionsConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubOptions> result = boost::make_shared<PubSubOptions>();
+std::shared_ptr<PubSubOptions> PubSubOptionsConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubOptions> result = std::make_shared<PubSubOptions>();
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<PubSubOptions> PubSubOptionsConvertor::doConvertFromLua(lua_St
lua_pop(L, 1);
lua_getfield(L, -1, "data");
if (!lua_isnil(L, -1)) {
- if (boost::shared_ptr<Form> payload = boost::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form"))) {
+ if (std::shared_ptr<Form> payload = std::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form"))) {
result->setData(payload);
}
}
@@ -49,7 +49,7 @@ boost::shared_ptr<PubSubOptions> PubSubOptionsConvertor::doConvertFromLua(lua_St
return result;
}
-void PubSubOptionsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubOptions> payload) {
+void PubSubOptionsConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubOptions> 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<PubSubOptions> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubOptions>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOptions> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOptions>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -19,8 +19,8 @@ PubSubOwnerAffiliationConvertor::PubSubOwnerAffiliationConvertor() :
PubSubOwnerAffiliationConvertor::~PubSubOwnerAffiliationConvertor() {
}
-boost::shared_ptr<PubSubOwnerAffiliation> PubSubOwnerAffiliationConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubOwnerAffiliation> result = boost::make_shared<PubSubOwnerAffiliation>();
+std::shared_ptr<PubSubOwnerAffiliation> PubSubOwnerAffiliationConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubOwnerAffiliation> result = std::make_shared<PubSubOwnerAffiliation>();
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<PubSubOwnerAffiliation> PubSubOwnerAffiliationConvertor::doCon
return result;
}
-void PubSubOwnerAffiliationConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubOwnerAffiliation> payload) {
+void PubSubOwnerAffiliationConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubOwnerAffiliation> 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<PubSubOwnerAffiliation> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubOwnerAffiliation>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerAffiliation> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerAffiliation>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -25,20 +26,20 @@ PubSubOwnerAffiliationsConvertor::PubSubOwnerAffiliationsConvertor(LuaElementCon
PubSubOwnerAffiliationsConvertor::~PubSubOwnerAffiliationsConvertor() {
}
-boost::shared_ptr<PubSubOwnerAffiliations> PubSubOwnerAffiliationsConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubOwnerAffiliations> result = boost::make_shared<PubSubOwnerAffiliations>();
+std::shared_ptr<PubSubOwnerAffiliations> PubSubOwnerAffiliationsConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubOwnerAffiliations> result = std::make_shared<PubSubOwnerAffiliations>();
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<PubSubOwnerAffiliation> > items;
+ std::vector< std::shared_ptr<PubSubOwnerAffiliation> > 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<PubSubOwnerAffiliation> payload = boost::dynamic_pointer_cast<PubSubOwnerAffiliation>(convertors->convertFromLuaUntyped(L, -1, "pubsub_owner_affiliation"))) {
+ if (std::shared_ptr<PubSubOwnerAffiliation> payload = std::dynamic_pointer_cast<PubSubOwnerAffiliation>(convertors->convertFromLuaUntyped(L, -1, "pubsub_owner_affiliation"))) {
items.push_back(payload);
}
}
@@ -50,14 +51,14 @@ boost::shared_ptr<PubSubOwnerAffiliations> PubSubOwnerAffiliationsConvertor::doC
return result;
}
-void PubSubOwnerAffiliationsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubOwnerAffiliations> payload) {
+void PubSubOwnerAffiliationsConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubOwnerAffiliations> 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<PubSubOwnerAffiliation> item, payload->getAffiliations()) {
+ foreach(std::shared_ptr<PubSubOwnerAffiliation> item, payload->getAffiliations()) {
if (convertors->convertToLuaUntyped(L, item) > 0) {
lua_rawseti(L, -2, boost::numeric_cast<int>(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<PubSubOwnerAffiliations> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubOwnerAffiliations>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerAffiliations> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerAffiliations>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,8 +22,8 @@ PubSubOwnerConfigureConvertor::PubSubOwnerConfigureConvertor(LuaElementConvertor
PubSubOwnerConfigureConvertor::~PubSubOwnerConfigureConvertor() {
}
-boost::shared_ptr<PubSubOwnerConfigure> PubSubOwnerConfigureConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubOwnerConfigure> result = boost::make_shared<PubSubOwnerConfigure>();
+std::shared_ptr<PubSubOwnerConfigure> PubSubOwnerConfigureConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubOwnerConfigure> result = std::make_shared<PubSubOwnerConfigure>();
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<PubSubOwnerConfigure> PubSubOwnerConfigureConvertor::doConvert
lua_pop(L, 1);
lua_getfield(L, -1, "data");
if (!lua_isnil(L, -1)) {
- if (boost::shared_ptr<Form> payload = boost::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form"))) {
+ if (std::shared_ptr<Form> payload = std::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form"))) {
result->setData(payload);
}
}
@@ -39,7 +39,7 @@ boost::shared_ptr<PubSubOwnerConfigure> PubSubOwnerConfigureConvertor::doConvert
return result;
}
-void PubSubOwnerConfigureConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubOwnerConfigure> payload) {
+void PubSubOwnerConfigureConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubOwnerConfigure> 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<PubSubOwnerConfigure> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubOwnerConfigure>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerConfigure> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerConfigure>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,11 +22,11 @@ PubSubOwnerDefaultConvertor::PubSubOwnerDefaultConvertor(LuaElementConvertors* c
PubSubOwnerDefaultConvertor::~PubSubOwnerDefaultConvertor() {
}
-boost::shared_ptr<PubSubOwnerDefault> PubSubOwnerDefaultConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubOwnerDefault> result = boost::make_shared<PubSubOwnerDefault>();
+std::shared_ptr<PubSubOwnerDefault> PubSubOwnerDefaultConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubOwnerDefault> result = std::make_shared<PubSubOwnerDefault>();
lua_getfield(L, -1, "data");
if (!lua_isnil(L, -1)) {
- if (boost::shared_ptr<Form> payload = boost::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form"))) {
+ if (std::shared_ptr<Form> payload = std::dynamic_pointer_cast<Form>(convertors->convertFromLuaUntyped(L, -1, "form"))) {
result->setData(payload);
}
}
@@ -34,7 +34,7 @@ boost::shared_ptr<PubSubOwnerDefault> PubSubOwnerDefaultConvertor::doConvertFrom
return result;
}
-void PubSubOwnerDefaultConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubOwnerDefault> payload) {
+void PubSubOwnerDefaultConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubOwnerDefault> 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<PubSubOwnerDefault> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubOwnerDefault>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerDefault> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerDefault>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,8 +22,8 @@ PubSubOwnerDeleteConvertor::PubSubOwnerDeleteConvertor(LuaElementConvertors* con
PubSubOwnerDeleteConvertor::~PubSubOwnerDeleteConvertor() {
}
-boost::shared_ptr<PubSubOwnerDelete> PubSubOwnerDeleteConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubOwnerDelete> result = boost::make_shared<PubSubOwnerDelete>();
+std::shared_ptr<PubSubOwnerDelete> PubSubOwnerDeleteConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubOwnerDelete> result = std::make_shared<PubSubOwnerDelete>();
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<PubSubOwnerDelete> PubSubOwnerDeleteConvertor::doConvertFromLu
lua_pop(L, 1);
lua_getfield(L, -1, "redirect");
if (!lua_isnil(L, -1)) {
- if (boost::shared_ptr<PubSubOwnerRedirect> payload = boost::dynamic_pointer_cast<PubSubOwnerRedirect>(convertors->convertFromLuaUntyped(L, -1, "pubsub_owner_redirect"))) {
+ if (std::shared_ptr<PubSubOwnerRedirect> payload = std::dynamic_pointer_cast<PubSubOwnerRedirect>(convertors->convertFromLuaUntyped(L, -1, "pubsub_owner_redirect"))) {
result->setRedirect(payload);
}
}
@@ -39,7 +39,7 @@ boost::shared_ptr<PubSubOwnerDelete> PubSubOwnerDeleteConvertor::doConvertFromLu
return result;
}
-void PubSubOwnerDeleteConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubOwnerDelete> payload) {
+void PubSubOwnerDeleteConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubOwnerDelete> 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<PubSubOwnerDelete> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubOwnerDelete>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerDelete> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerDelete>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -19,8 +19,8 @@ PubSubOwnerPurgeConvertor::PubSubOwnerPurgeConvertor() :
PubSubOwnerPurgeConvertor::~PubSubOwnerPurgeConvertor() {
}
-boost::shared_ptr<PubSubOwnerPurge> PubSubOwnerPurgeConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubOwnerPurge> result = boost::make_shared<PubSubOwnerPurge>();
+std::shared_ptr<PubSubOwnerPurge> PubSubOwnerPurgeConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubOwnerPurge> result = std::make_shared<PubSubOwnerPurge>();
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<PubSubOwnerPurge> PubSubOwnerPurgeConvertor::doConvertFromLua(
return result;
}
-void PubSubOwnerPurgeConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubOwnerPurge> payload) {
+void PubSubOwnerPurgeConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubOwnerPurge> 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<PubSubOwnerPurge> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubOwnerPurge>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerPurge> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerPurge>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -19,8 +19,8 @@ PubSubOwnerRedirectConvertor::PubSubOwnerRedirectConvertor() :
PubSubOwnerRedirectConvertor::~PubSubOwnerRedirectConvertor() {
}
-boost::shared_ptr<PubSubOwnerRedirect> PubSubOwnerRedirectConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubOwnerRedirect> result = boost::make_shared<PubSubOwnerRedirect>();
+std::shared_ptr<PubSubOwnerRedirect> PubSubOwnerRedirectConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubOwnerRedirect> result = std::make_shared<PubSubOwnerRedirect>();
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<PubSubOwnerRedirect> PubSubOwnerRedirectConvertor::doConvertFr
return result;
}
-void PubSubOwnerRedirectConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubOwnerRedirect> payload) {
+void PubSubOwnerRedirectConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubOwnerRedirect> 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<PubSubOwnerRedirect> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubOwnerRedirect>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerRedirect> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerRedirect>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -19,8 +19,8 @@ PubSubOwnerSubscriptionConvertor::PubSubOwnerSubscriptionConvertor() :
PubSubOwnerSubscriptionConvertor::~PubSubOwnerSubscriptionConvertor() {
}
-boost::shared_ptr<PubSubOwnerSubscription> PubSubOwnerSubscriptionConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubOwnerSubscription> result = boost::make_shared<PubSubOwnerSubscription>();
+std::shared_ptr<PubSubOwnerSubscription> PubSubOwnerSubscriptionConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubOwnerSubscription> result = std::make_shared<PubSubOwnerSubscription>();
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<PubSubOwnerSubscription> PubSubOwnerSubscriptionConvertor::doC
return result;
}
-void PubSubOwnerSubscriptionConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubOwnerSubscription> payload) {
+void PubSubOwnerSubscriptionConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubOwnerSubscription> 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<PubSubOwnerSubscription> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubOwnerSubscription>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerSubscription> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerSubscription>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -25,20 +26,20 @@ PubSubOwnerSubscriptionsConvertor::PubSubOwnerSubscriptionsConvertor(LuaElementC
PubSubOwnerSubscriptionsConvertor::~PubSubOwnerSubscriptionsConvertor() {
}
-boost::shared_ptr<PubSubOwnerSubscriptions> PubSubOwnerSubscriptionsConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubOwnerSubscriptions> result = boost::make_shared<PubSubOwnerSubscriptions>();
+std::shared_ptr<PubSubOwnerSubscriptions> PubSubOwnerSubscriptionsConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubOwnerSubscriptions> result = std::make_shared<PubSubOwnerSubscriptions>();
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<PubSubOwnerSubscription> > items;
+ std::vector< std::shared_ptr<PubSubOwnerSubscription> > 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<PubSubOwnerSubscription> payload = boost::dynamic_pointer_cast<PubSubOwnerSubscription>(convertors->convertFromLuaUntyped(L, -1, "pubsub_owner_subscription"))) {
+ if (std::shared_ptr<PubSubOwnerSubscription> payload = std::dynamic_pointer_cast<PubSubOwnerSubscription>(convertors->convertFromLuaUntyped(L, -1, "pubsub_owner_subscription"))) {
items.push_back(payload);
}
}
@@ -50,14 +51,14 @@ boost::shared_ptr<PubSubOwnerSubscriptions> PubSubOwnerSubscriptionsConvertor::d
return result;
}
-void PubSubOwnerSubscriptionsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubOwnerSubscriptions> payload) {
+void PubSubOwnerSubscriptionsConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubOwnerSubscriptions> 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<PubSubOwnerSubscription> item, payload->getSubscriptions()) {
+ foreach(std::shared_ptr<PubSubOwnerSubscription> item, payload->getSubscriptions()) {
if (convertors->convertToLuaUntyped(L, item) > 0) {
lua_rawseti(L, -2, boost::numeric_cast<int>(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<PubSubOwnerSubscriptions> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubOwnerSubscriptions>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerSubscriptions> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerSubscriptions>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubPublishConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -25,8 +26,8 @@ PubSubPublishConvertor::PubSubPublishConvertor(LuaElementConvertors* convertors)
PubSubPublishConvertor::~PubSubPublishConvertor() {
}
-boost::shared_ptr<PubSubPublish> PubSubPublishConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubPublish> result = boost::make_shared<PubSubPublish>();
+std::shared_ptr<PubSubPublish> PubSubPublishConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubPublish> result = std::make_shared<PubSubPublish>();
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<PubSubPublish> 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<PubSubItem> > items;
+ std::vector< std::shared_ptr<PubSubItem> > 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<PubSubItem> payload = boost::dynamic_pointer_cast<PubSubItem>(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) {
+ if (std::shared_ptr<PubSubItem> payload = std::dynamic_pointer_cast<PubSubItem>(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) {
items.push_back(payload);
}
}
@@ -52,7 +53,7 @@ boost::shared_ptr<PubSubPublish> PubSubPublishConvertor::doConvertFromLua(lua_St
return result;
}
-void PubSubPublishConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubPublish> payload) {
+void PubSubPublishConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubPublish> 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<PubS
lua_createtable(L, boost::numeric_cast<int>(payload->getItems().size()), 0);
{
int i = 0;
- foreach(boost::shared_ptr<PubSubItem> item, payload->getItems()) {
+ foreach(std::shared_ptr<PubSubItem> item, payload->getItems()) {
if (convertors->convertToLuaUntyped(L, item) > 0) {
lua_rawseti(L, -2, boost::numeric_cast<int>(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<PubSubPublish> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubPublish>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubPublish> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubPublish>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubRetractConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -25,8 +26,8 @@ PubSubRetractConvertor::PubSubRetractConvertor(LuaElementConvertors* convertors)
PubSubRetractConvertor::~PubSubRetractConvertor() {
}
-boost::shared_ptr<PubSubRetract> PubSubRetractConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubRetract> result = boost::make_shared<PubSubRetract>();
+std::shared_ptr<PubSubRetract> PubSubRetractConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubRetract> result = std::make_shared<PubSubRetract>();
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<PubSubRetract> 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<PubSubItem> > items;
+ std::vector< std::shared_ptr<PubSubItem> > 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<PubSubItem> payload = boost::dynamic_pointer_cast<PubSubItem>(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) {
+ if (std::shared_ptr<PubSubItem> payload = std::dynamic_pointer_cast<PubSubItem>(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) {
items.push_back(payload);
}
}
@@ -57,7 +58,7 @@ boost::shared_ptr<PubSubRetract> PubSubRetractConvertor::doConvertFromLua(lua_St
return result;
}
-void PubSubRetractConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubRetract> payload) {
+void PubSubRetractConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubRetract> 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<PubS
lua_createtable(L, boost::numeric_cast<int>(payload->getItems().size()), 0);
{
int i = 0;
- foreach(boost::shared_ptr<PubSubItem> item, payload->getItems()) {
+ foreach(std::shared_ptr<PubSubItem> item, payload->getItems()) {
if (convertors->convertToLuaUntyped(L, item) > 0) {
lua_rawseti(L, -2, boost::numeric_cast<int>(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<PubSubRetract> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubRetract>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubRetract> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubRetract>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubSubscribeConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,8 +22,8 @@ PubSubSubscribeConvertor::PubSubSubscribeConvertor(LuaElementConvertors* convert
PubSubSubscribeConvertor::~PubSubSubscribeConvertor() {
}
-boost::shared_ptr<PubSubSubscribe> PubSubSubscribeConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubSubscribe> result = boost::make_shared<PubSubSubscribe>();
+std::shared_ptr<PubSubSubscribe> PubSubSubscribeConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubSubscribe> result = std::make_shared<PubSubSubscribe>();
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<PubSubSubscribe> PubSubSubscribeConvertor::doConvertFromLua(lu
lua_pop(L, 1);
lua_getfield(L, -1, "options");
if (!lua_isnil(L, -1)) {
- if (boost::shared_ptr<PubSubOptions> payload = boost::dynamic_pointer_cast<PubSubOptions>(convertors->convertFromLuaUntyped(L, -1, "pubsub_options"))) {
+ if (std::shared_ptr<PubSubOptions> payload = std::dynamic_pointer_cast<PubSubOptions>(convertors->convertFromLuaUntyped(L, -1, "pubsub_options"))) {
result->setOptions(payload);
}
}
@@ -44,7 +44,7 @@ boost::shared_ptr<PubSubSubscribe> PubSubSubscribeConvertor::doConvertFromLua(lu
return result;
}
-void PubSubSubscribeConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubSubscribe> payload) {
+void PubSubSubscribeConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubSubscribe> 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<PubSubSubscribe> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubSubscribe>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubSubscribe> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubSubscribe>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -19,8 +19,8 @@ PubSubSubscribeOptionsConvertor::PubSubSubscribeOptionsConvertor() :
PubSubSubscribeOptionsConvertor::~PubSubSubscribeOptionsConvertor() {
}
-boost::shared_ptr<PubSubSubscribeOptions> PubSubSubscribeOptionsConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubSubscribeOptions> result = boost::make_shared<PubSubSubscribeOptions>();
+std::shared_ptr<PubSubSubscribeOptions> PubSubSubscribeOptionsConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubSubscribeOptions> result = std::make_shared<PubSubSubscribeOptions>();
lua_getfield(L, -1, "required");
if (lua_isboolean(L, -1)) {
result->setRequired(lua_toboolean(L, -1));
@@ -29,7 +29,7 @@ boost::shared_ptr<PubSubSubscribeOptions> PubSubSubscribeOptionsConvertor::doCon
return result;
}
-void PubSubSubscribeOptionsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubSubscribeOptions> payload) {
+void PubSubSubscribeOptionsConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubSubscribeOptions> 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<PubSubSubscribeOptions> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubSubscribeOptions>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubSubscribeOptions> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubSubscribeOptions>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubSubscriptionConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -22,8 +22,8 @@ PubSubSubscriptionConvertor::PubSubSubscriptionConvertor(LuaElementConvertors* c
PubSubSubscriptionConvertor::~PubSubSubscriptionConvertor() {
}
-boost::shared_ptr<PubSubSubscription> PubSubSubscriptionConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubSubscription> result = boost::make_shared<PubSubSubscription>();
+std::shared_ptr<PubSubSubscription> PubSubSubscriptionConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubSubscription> result = std::make_shared<PubSubSubscription>();
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<PubSubSubscription> PubSubSubscriptionConvertor::doConvertFrom
lua_pop(L, 1);
lua_getfield(L, -1, "options");
if (!lua_isnil(L, -1)) {
- if (boost::shared_ptr<PubSubSubscribeOptions> payload = boost::dynamic_pointer_cast<PubSubSubscribeOptions>(convertors->convertFromLuaUntyped(L, -1, "pubsub_subscribe_options"))) {
+ if (std::shared_ptr<PubSubSubscribeOptions> payload = std::dynamic_pointer_cast<PubSubSubscribeOptions>(convertors->convertFromLuaUntyped(L, -1, "pubsub_subscribe_options"))) {
result->setOptions(payload);
}
}
@@ -65,7 +65,7 @@ boost::shared_ptr<PubSubSubscription> PubSubSubscriptionConvertor::doConvertFrom
return result;
}
-void PubSubSubscriptionConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubSubscription> payload) {
+void PubSubSubscriptionConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubSubscription> 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<PubSubSubscription> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubSubscription>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubSubscription> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubSubscription>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubSubscriptionsConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -25,20 +26,20 @@ PubSubSubscriptionsConvertor::PubSubSubscriptionsConvertor(LuaElementConvertors*
PubSubSubscriptionsConvertor::~PubSubSubscriptionsConvertor() {
}
-boost::shared_ptr<PubSubSubscriptions> PubSubSubscriptionsConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubSubscriptions> result = boost::make_shared<PubSubSubscriptions>();
+std::shared_ptr<PubSubSubscriptions> PubSubSubscriptionsConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubSubscriptions> result = std::make_shared<PubSubSubscriptions>();
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<PubSubSubscription> > items;
+ std::vector< std::shared_ptr<PubSubSubscription> > 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<PubSubSubscription> payload = boost::dynamic_pointer_cast<PubSubSubscription>(convertors->convertFromLuaUntyped(L, -1, "pubsub_subscription"))) {
+ if (std::shared_ptr<PubSubSubscription> payload = std::dynamic_pointer_cast<PubSubSubscription>(convertors->convertFromLuaUntyped(L, -1, "pubsub_subscription"))) {
items.push_back(payload);
}
}
@@ -50,7 +51,7 @@ boost::shared_ptr<PubSubSubscriptions> PubSubSubscriptionsConvertor::doConvertFr
return result;
}
-void PubSubSubscriptionsConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubSubscriptions> payload) {
+void PubSubSubscriptionsConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubSubscriptions> 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<PubSubSubscription> item, payload->getSubscriptions()) {
+ foreach(std::shared_ptr<PubSubSubscription> item, payload->getSubscriptions()) {
if (convertors->convertToLuaUntyped(L, item) > 0) {
lua_rawseti(L, -2, boost::numeric_cast<int>(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<PubSubSubscriptions> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubSubscriptions>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubSubscriptions> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubSubscriptions>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/PubSubUnsubscribeConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -19,8 +19,8 @@ PubSubUnsubscribeConvertor::PubSubUnsubscribeConvertor() :
PubSubUnsubscribeConvertor::~PubSubUnsubscribeConvertor() {
}
-boost::shared_ptr<PubSubUnsubscribe> PubSubUnsubscribeConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<PubSubUnsubscribe> result = boost::make_shared<PubSubUnsubscribe>();
+std::shared_ptr<PubSubUnsubscribe> PubSubUnsubscribeConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<PubSubUnsubscribe> result = std::make_shared<PubSubUnsubscribe>();
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<PubSubUnsubscribe> PubSubUnsubscribeConvertor::doConvertFromLu
return result;
}
-void PubSubUnsubscribeConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<PubSubUnsubscribe> payload) {
+void PubSubUnsubscribeConvertor::doConvertToLua(lua_State* L, std::shared_ptr<PubSubUnsubscribe> 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<PubSubUnsubscribe> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<PubSubUnsubscribe>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubUnsubscribe> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubUnsubscribe>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/RawXMLElementConvertor.h>
#include <iostream>
-
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -25,15 +24,15 @@ RawXMLElementConvertor::RawXMLElementConvertor() {
RawXMLElementConvertor::~RawXMLElementConvertor() {
}
-boost::shared_ptr<Element> RawXMLElementConvertor::convertFromLua(lua_State* L, int index, const std::string& type) {
+std::shared_ptr<Element> RawXMLElementConvertor::convertFromLua(lua_State* L, int index, const std::string& type) {
if (type == "xml") {
- return boost::make_shared<RawXMLPayload>(std::string(Lua::checkString(L, index)));
+ return std::make_shared<RawXMLPayload>(std::string(Lua::checkString(L, index)));
}
- return boost::shared_ptr<Payload>();
+ return std::shared_ptr<Payload>();
}
-boost::optional<std::string> RawXMLElementConvertor::convertToLua(lua_State* L, boost::shared_ptr<Element> element) {
- boost::shared_ptr<Payload> payload = boost::dynamic_pointer_cast<Payload>(element);
+boost::optional<std::string> RawXMLElementConvertor::convertToLua(lua_State* L, std::shared_ptr<Element> element) {
+ std::shared_ptr<Payload> payload = std::dynamic_pointer_cast<Payload>(element);
if (!payload) {
return boost::optional<std::string>();
}
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<Element> convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE;
- virtual boost::optional<std::string> convertToLua(lua_State*, boost::shared_ptr<Element>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Element> convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE;
+ virtual boost::optional<std::string> convertToLua(lua_State*, std::shared_ptr<Element>) 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 <Sluift/ElementConvertors/ResultSetConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -20,8 +21,8 @@ ResultSetConvertor::ResultSetConvertor() :
ResultSetConvertor::~ResultSetConvertor() {
}
-boost::shared_ptr<ResultSet> ResultSetConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<ResultSet> result = boost::make_shared<ResultSet>();
+std::shared_ptr<ResultSet> ResultSetConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<ResultSet> result = std::make_shared<ResultSet>();
lua_getfield(L, -1, "max_items");
if (lua_isstring(L, -1)) {
result->setMaxItems(boost::numeric_cast<int>(lua_tonumber(L, -1)));
@@ -65,7 +66,7 @@ boost::shared_ptr<ResultSet> ResultSetConvertor::doConvertFromLua(lua_State* L)
return result;
}
-void ResultSetConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<ResultSet> payload) {
+void ResultSetConvertor::doConvertToLua(lua_State* L, std::shared_ptr<ResultSet> 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<ResultSet> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<ResultSet>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<ResultSet> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<ResultSet>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/SecurityLabelConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -22,8 +23,8 @@ SecurityLabelConvertor::SecurityLabelConvertor() :
SecurityLabelConvertor::~SecurityLabelConvertor() {
}
-boost::shared_ptr<SecurityLabel> SecurityLabelConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<SecurityLabel> result = boost::make_shared<SecurityLabel>();
+std::shared_ptr<SecurityLabel> SecurityLabelConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<SecurityLabel> result = std::make_shared<SecurityLabel>();
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<SecurityLabel> SecurityLabelConvertor::doConvertFromLua(lua_St
return result;
}
-void SecurityLabelConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<SecurityLabel> payload) {
+void SecurityLabelConvertor::doConvertToLua(lua_State* L, std::shared_ptr<SecurityLabel> payload) {
lua_createtable(L, 0, 0);
if (!payload->getEquivalentLabels().empty()) {
lua_createtable(L, boost::numeric_cast<int>(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<SecurityLabel> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<SecurityLabel>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<SecurityLabel> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<SecurityLabel>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/SoftwareVersionConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -21,8 +22,8 @@ SoftwareVersionConvertor::SoftwareVersionConvertor() : GenericLuaElementConverto
SoftwareVersionConvertor::~SoftwareVersionConvertor() {
}
-boost::shared_ptr<SoftwareVersion> SoftwareVersionConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<SoftwareVersion> result = boost::make_shared<SoftwareVersion>();
+std::shared_ptr<SoftwareVersion> SoftwareVersionConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<SoftwareVersion> result = std::make_shared<SoftwareVersion>();
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<SoftwareVersion> SoftwareVersionConvertor::doConvertFromLua(lu
return result;
}
-void SoftwareVersionConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<SoftwareVersion> payload) {
+void SoftwareVersionConvertor::doConvertToLua(lua_State* L, std::shared_ptr<SoftwareVersion> 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<SoftwareVersion> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<SoftwareVersion>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<SoftwareVersion> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<SoftwareVersion>) 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<T> getStanza(lua_State* L, LuaElementConvertors* convertors) {
- boost::shared_ptr<T> result = boost::make_shared<T>();
+ std::shared_ptr<T> getStanza(lua_State* L, LuaElementConvertors* convertors) {
+ std::shared_ptr<T> result = std::make_shared<T>();
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> payload = boost::dynamic_pointer_cast<Payload>(convertors->convertFromLua(L, -1));
+ std::shared_ptr<Payload> payload = std::dynamic_pointer_cast<Payload>(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<T> stanza, LuaElementConvertors* convertors) {
+ void pushStanza(lua_State* L, const std::shared_ptr<T> 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<int>(stanza->getPayloads().size()), 0);
{
int i = 0;
- foreach(const boost::shared_ptr<Payload> &item, stanza->getPayloads()) {
+ foreach(const std::shared_ptr<Payload> &item, stanza->getPayloads()) {
if (convertors->convertToLua(L, item) > 0) {
lua_rawseti(L, -2, boost::numeric_cast<int>(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 <Sluift/ElementConvertors/StatusConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -21,8 +22,8 @@ StatusConvertor::StatusConvertor() : GenericLuaElementConvertor<Status>("status"
StatusConvertor::~StatusConvertor() {
}
-boost::shared_ptr<Status> StatusConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<Status> result = boost::make_shared<Status>();
+std::shared_ptr<Status> StatusConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<Status> result = std::make_shared<Status>();
lua_getfield(L, -1, "text");
if (lua_isstring(L, -1)) {
result->setText(lua_tostring(L, -1));
@@ -31,7 +32,7 @@ boost::shared_ptr<Status> StatusConvertor::doConvertFromLua(lua_State* L) {
return result;
}
-void StatusConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<Status> payload) {
+void StatusConvertor::doConvertToLua(lua_State* L, std::shared_ptr<Status> 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<Status> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<Status>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Status> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Status>) 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 <Sluift/ElementConvertors/StatusShowConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -22,8 +23,8 @@ StatusShowConvertor::StatusShowConvertor() : GenericLuaElementConvertor<StatusSh
StatusShowConvertor::~StatusShowConvertor() {
}
-boost::shared_ptr<StatusShow> StatusShowConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<StatusShow> result = boost::make_shared<StatusShow>();
+std::shared_ptr<StatusShow> StatusShowConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<StatusShow> result = std::make_shared<StatusShow>();
lua_getfield(L, -1, "type");
if (lua_isstring(L, -1)) {
result->setType(convertStatusShowTypeFromString(lua_tostring(L, -1)));
@@ -32,7 +33,7 @@ boost::shared_ptr<StatusShow> StatusShowConvertor::doConvertFromLua(lua_State* L
return result;
}
-void StatusShowConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<StatusShow> payload) {
+void StatusShowConvertor::doConvertToLua(lua_State* L, std::shared_ptr<StatusShow> 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<StatusShow> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<StatusShow>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<StatusShow> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<StatusShow>) 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 <Sluift/ElementConvertors/SubjectConvertor.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <lua.hpp>
@@ -20,15 +20,15 @@ SubjectConvertor::SubjectConvertor() : GenericLuaElementConvertor<Subject>("subj
SubjectConvertor::~SubjectConvertor() {
}
-boost::shared_ptr<Subject> SubjectConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<Subject> result = boost::make_shared<Subject>();
+std::shared_ptr<Subject> SubjectConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<Subject> result = std::make_shared<Subject>();
if (boost::optional<std::string> value = Lua::getStringField(L, -1, "text")) {
result->setText(*value);
}
return result;
}
-void SubjectConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<Subject> payload) {
+void SubjectConvertor::doConvertToLua(lua_State* L, std::shared_ptr<Subject> 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<Subject> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<Subject>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Subject> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Subject>) 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 <Sluift/ElementConvertors/UserLocationConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -22,8 +23,8 @@ UserLocationConvertor::UserLocationConvertor() :
UserLocationConvertor::~UserLocationConvertor() {
}
-boost::shared_ptr<UserLocation> UserLocationConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<UserLocation> result = boost::make_shared<UserLocation>();
+std::shared_ptr<UserLocation> UserLocationConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<UserLocation> result = std::make_shared<UserLocation>();
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<UserLocation> UserLocationConvertor::doConvertFromLua(lua_Stat
return result;
}
-void UserLocationConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<UserLocation> payload) {
+void UserLocationConvertor::doConvertToLua(lua_State* L, std::shared_ptr<UserLocation> 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<UserLocation> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<UserLocation>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<UserLocation> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<UserLocation>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/UserTuneConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -20,8 +21,8 @@ UserTuneConvertor::UserTuneConvertor() :
UserTuneConvertor::~UserTuneConvertor() {
}
-boost::shared_ptr<UserTune> UserTuneConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<UserTune> result = boost::make_shared<UserTune>();
+std::shared_ptr<UserTune> UserTuneConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<UserTune> result = std::make_shared<UserTune>();
lua_getfield(L, -1, "rating");
if (lua_isnumber(L, -1)) {
result->setRating(boost::numeric_cast<unsigned int>(lua_tonumber(L, -1)));
@@ -60,7 +61,7 @@ boost::shared_ptr<UserTune> UserTuneConvertor::doConvertFromLua(lua_State* L) {
return result;
}
-void UserTuneConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<UserTune> payload) {
+void UserTuneConvertor::doConvertToLua(lua_State* L, std::shared_ptr<UserTune> 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<UserTune> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<UserTune>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<UserTune> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<UserTune>) SWIFTEN_OVERRIDE;
virtual boost::optional<Documentation> 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 <Sluift/ElementConvertors/VCardConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -24,8 +25,8 @@ VCardConvertor::VCardConvertor() : GenericLuaElementConvertor<VCard>("vcard") {
VCardConvertor::~VCardConvertor() {
}
-boost::shared_ptr<VCard> VCardConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<VCard> result = boost::make_shared<VCard>();
+std::shared_ptr<VCard> VCardConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<VCard> result = std::make_shared<VCard>();
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<VCard> VCardConvertor::doConvertFromLua(lua_State* L) {
return result;
}
-void VCardConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<VCard> payload) {
+void VCardConvertor::doConvertToLua(lua_State* L, std::shared_ptr<VCard> 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<VCard> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<VCard>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<VCard> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<VCard>) 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 <Sluift/ElementConvertors/VCardUpdateConvertor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <lua.hpp>
@@ -21,15 +22,15 @@ VCardUpdateConvertor::VCardUpdateConvertor() : GenericLuaElementConvertor<VCardU
VCardUpdateConvertor::~VCardUpdateConvertor() {
}
-boost::shared_ptr<VCardUpdate> VCardUpdateConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<VCardUpdate> result = boost::make_shared<VCardUpdate>();
+std::shared_ptr<VCardUpdate> VCardUpdateConvertor::doConvertFromLua(lua_State* L) {
+ std::shared_ptr<VCardUpdate> result = std::make_shared<VCardUpdate>();
if (boost::optional<std::string> value = Lua::getStringField(L, -1, "photo_hash")) {
result->setPhotoHash(*value);
}
return result;
}
-void VCardUpdateConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<VCardUpdate> payload) {
+void VCardUpdateConvertor::doConvertToLua(lua_State* L, std::shared_ptr<VCardUpdate> 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<VCardUpdate> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<VCardUpdate>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<VCardUpdate> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<VCardUpdate>) 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<Element> convertFromLua(lua_State* L, int index, const std::string& payloadType) SWIFTEN_OVERRIDE {
+ virtual std::shared_ptr<Element> 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<Element> result = doConvertFromLua(L);
+ std::shared_ptr<Element> result = doConvertFromLua(L);
lua_pop(L, 1);
return result;
}
- return boost::shared_ptr<Element>();
+ return std::shared_ptr<Element>();
}
virtual boost::optional<std::string> convertToLua(
- lua_State* L, boost::shared_ptr<Element> payload) SWIFTEN_OVERRIDE {
- if (boost::shared_ptr<T> actualPayload = boost::dynamic_pointer_cast<T>(payload)) {
+ lua_State* L, std::shared_ptr<Element> payload) SWIFTEN_OVERRIDE {
+ if (std::shared_ptr<T> actualPayload = std::dynamic_pointer_cast<T>(payload)) {
doConvertToLua(L, actualPayload);
assert(lua_type(L, -1) == LUA_TTABLE);
return type;
@@ -47,8 +47,8 @@ namespace Swift {
}
protected:
- virtual boost::shared_ptr<T> doConvertFromLua(lua_State*) = 0;
- virtual void doConvertToLua(lua_State*, boost::shared_ptr<T>) = 0;
+ virtual std::shared_ptr<T> doConvertFromLua(lua_State*) = 0;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<T>) = 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 <memory>
+#include <string>
+
#include <boost/optional/optional_fwd.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
@@ -33,6 +35,6 @@ namespace Swift {
private:
struct Private;
- boost::shared_ptr<Private> p;
+ std::shared_ptr<Private> 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 <ScriptingBridge/ScriptingBridge.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <boost/optional.hpp>
#include <SwifTools/Cocoa/CocoaUtil.h>
@@ -25,7 +25,7 @@ struct ITunesInterface::Private {
iTunesApplication* iTunes;
};
-ITunesInterface::ITunesInterface() : p(boost::make_shared<Private>()) {
+ITunesInterface::ITunesInterface() : p(std::make_shared<Private>()) {
}
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<std::string, boost::shared_ptr<Value> >& table) const {
+ void operator()(const std::map<std::string, std::shared_ptr<Value> >& table) const {
lua_createtable(state, 0, boost::numeric_cast<int>(table.size()));
- for(std::map<std::string, boost::shared_ptr<Value> >::const_iterator i = table.begin(); i != table.end(); ++i) {
+ for(std::map<std::string, std::shared_ptr<Value> >::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 <map>
+#include <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <boost/variant.hpp>
struct lua_State;
@@ -26,34 +25,34 @@ namespace Swift {
int,
std::string,
std::vector< boost::recursive_variant_ >,
- std::map<std::string, boost::shared_ptr<boost::recursive_variant_> >
+ std::map<std::string, std::shared_ptr<boost::recursive_variant_> >
>::type Value;
- typedef std::map<std::string, boost::shared_ptr<Value> > Table;
+ typedef std::map<std::string, std::shared_ptr<Value> > Table;
typedef std::vector<Value> Array;
- inline boost::shared_ptr<Value> nilRef() {
- return boost::make_shared<Value>(Nil());
+ inline std::shared_ptr<Value> nilRef() {
+ return std::make_shared<Value>(Nil());
}
- inline boost::shared_ptr<Value> valueRef(const std::string& value) {
- return boost::make_shared<Value>(value);
+ inline std::shared_ptr<Value> valueRef(const std::string& value) {
+ return std::make_shared<Value>(value);
}
- inline boost::shared_ptr<Value> intRef(int value) {
- return boost::make_shared<Value>(value);
+ inline std::shared_ptr<Value> intRef(int value) {
+ return std::make_shared<Value>(value);
}
- inline boost::shared_ptr<Value> boolRef(bool value) {
- return boost::make_shared<Value>(value);
+ inline std::shared_ptr<Value> boolRef(bool value) {
+ return std::make_shared<Value>(value);
}
- inline boost::shared_ptr<Value> valueRef(const Table& table) {
- return boost::make_shared<Value>(table);
+ inline std::shared_ptr<Value> valueRef(const Table& table) {
+ return std::make_shared<Value>(table);
}
- inline boost::shared_ptr<Value> valueRef(const Array& array) {
- return boost::make_shared<Value>(array);
+ inline std::shared_ptr<Value> valueRef(const Array& array) {
+ return std::make_shared<Value>(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 <memory>
#include <string>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/Override.h>
@@ -31,8 +31,8 @@ namespace Swift {
virtual ~LuaElementConvertor();
- virtual boost::shared_ptr<Element> convertFromLua(lua_State*, int index, const std::string& type) = 0;
- virtual boost::optional<std::string> convertToLua(lua_State*, boost::shared_ptr<Element>) = 0;
+ virtual std::shared_ptr<Element> convertFromLua(lua_State*, int index, const std::string& type) = 0;
+ virtual boost::optional<std::string> convertToLua(lua_State*, std::shared_ptr<Element>) = 0;
virtual boost::optional<Documentation> getDocumentation() const {
return boost::optional<Documentation>();
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 <Sluift/LuaElementConvertors.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
@@ -42,30 +42,30 @@ using namespace Swift;
LuaElementConvertors::LuaElementConvertors() {
registerConvertors();
- convertors.push_back(boost::make_shared<StatusConvertor>());
- convertors.push_back(boost::make_shared<StatusShowConvertor>());
- convertors.push_back(boost::make_shared<DelayConvertor>());
- convertors.push_back(boost::make_shared<CommandConvertor>(this));
- convertors.push_back(boost::make_shared<PubSubEventConvertor>(this));
- convertors.push_back(boost::make_shared<BodyConvertor>());
- convertors.push_back(boost::make_shared<SubjectConvertor>());
- convertors.push_back(boost::make_shared<VCardConvertor>());
- convertors.push_back(boost::make_shared<VCardUpdateConvertor>());
- convertors.push_back(boost::make_shared<FormConvertor>());
- convertors.push_back(boost::make_shared<SoftwareVersionConvertor>());
- convertors.push_back(boost::make_shared<DiscoInfoConvertor>());
- convertors.push_back(boost::make_shared<DiscoItemsConvertor>());
- convertors.push_back(boost::make_shared<IQConvertor>(this));
- convertors.push_back(boost::make_shared<PresenceConvertor>(this));
- convertors.push_back(boost::make_shared<MessageConvertor>(this));
- convertors.push_back(boost::make_shared<ResultSetConvertor>());
- convertors.push_back(boost::make_shared<ForwardedConvertor>(this));
- convertors.push_back(boost::make_shared<MAMResultConvertor>(this));
- convertors.push_back(boost::make_shared<MAMQueryConvertor>(this));
- convertors.push_back(boost::make_shared<MAMFinConvertor>(this));
- convertors.push_back(boost::make_shared<DOMElementConvertor>());
- convertors.push_back(boost::make_shared<RawXMLElementConvertor>());
- convertors.push_back(boost::make_shared<DefaultElementConvertor>());
+ convertors.push_back(std::make_shared<StatusConvertor>());
+ convertors.push_back(std::make_shared<StatusShowConvertor>());
+ convertors.push_back(std::make_shared<DelayConvertor>());
+ convertors.push_back(std::make_shared<CommandConvertor>(this));
+ convertors.push_back(std::make_shared<PubSubEventConvertor>(this));
+ convertors.push_back(std::make_shared<BodyConvertor>());
+ convertors.push_back(std::make_shared<SubjectConvertor>());
+ convertors.push_back(std::make_shared<VCardConvertor>());
+ convertors.push_back(std::make_shared<VCardUpdateConvertor>());
+ convertors.push_back(std::make_shared<FormConvertor>());
+ convertors.push_back(std::make_shared<SoftwareVersionConvertor>());
+ convertors.push_back(std::make_shared<DiscoInfoConvertor>());
+ convertors.push_back(std::make_shared<DiscoItemsConvertor>());
+ convertors.push_back(std::make_shared<IQConvertor>(this));
+ convertors.push_back(std::make_shared<PresenceConvertor>(this));
+ convertors.push_back(std::make_shared<MessageConvertor>(this));
+ convertors.push_back(std::make_shared<ResultSetConvertor>());
+ convertors.push_back(std::make_shared<ForwardedConvertor>(this));
+ convertors.push_back(std::make_shared<MAMResultConvertor>(this));
+ convertors.push_back(std::make_shared<MAMQueryConvertor>(this));
+ convertors.push_back(std::make_shared<MAMFinConvertor>(this));
+ convertors.push_back(std::make_shared<DOMElementConvertor>());
+ convertors.push_back(std::make_shared<RawXMLElementConvertor>());
+ convertors.push_back(std::make_shared<DefaultElementConvertor>());
}
LuaElementConvertors::~LuaElementConvertors() {
@@ -73,7 +73,7 @@ LuaElementConvertors::~LuaElementConvertors() {
#include <Sluift/ElementConvertors/ElementConvertors.ipp>
-boost::shared_ptr<Element> LuaElementConvertors::convertFromLua(lua_State* L, int index) {
+std::shared_ptr<Element> LuaElementConvertors::convertFromLua(lua_State* L, int index) {
if (lua_isstring(L, index)) {
return convertFromLuaUntyped(L, index, "xml");
}
@@ -89,18 +89,18 @@ boost::shared_ptr<Element> LuaElementConvertors::convertFromLua(lua_State* L, in
throw Lua::Exception("Unable to determine type");
}
-boost::shared_ptr<Element> LuaElementConvertors::convertFromLuaUntyped(lua_State* L, int index, const std::string& type) {
+std::shared_ptr<Element> LuaElementConvertors::convertFromLuaUntyped(lua_State* L, int index, const std::string& type) {
index = Lua::absoluteOffset(L, index);
- foreach (boost::shared_ptr<LuaElementConvertor> convertor, convertors) {
- if (boost::shared_ptr<Element> result = convertor->convertFromLua(L, index, type)) {
+ foreach (std::shared_ptr<LuaElementConvertor> convertor, convertors) {
+ if (std::shared_ptr<Element> result = convertor->convertFromLua(L, index, type)) {
return result;
}
}
- return boost::shared_ptr<Element>();
+ return std::shared_ptr<Element>();
}
-int LuaElementConvertors::convertToLua(lua_State* L, boost::shared_ptr<Element> payload) {
+int LuaElementConvertors::convertToLua(lua_State* L, std::shared_ptr<Element> payload) {
if (boost::optional<std::string> 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<Element>
return 0;
}
-int LuaElementConvertors::convertToLuaUntyped(lua_State* L, boost::shared_ptr<Element> payload) {
+int LuaElementConvertors::convertToLuaUntyped(lua_State* L, std::shared_ptr<Element> payload) {
if (doConvertToLuaUntyped(L, payload)) {
return 1;
}
@@ -123,11 +123,11 @@ int LuaElementConvertors::convertToLuaUntyped(lua_State* L, boost::shared_ptr<El
}
boost::optional<std::string> LuaElementConvertors::doConvertToLuaUntyped(
- lua_State* L, boost::shared_ptr<Element> payload) {
+ lua_State* L, std::shared_ptr<Element> payload) {
if (!payload) {
return LuaElementConvertor::NO_RESULT;
}
- foreach (boost::shared_ptr<LuaElementConvertor> convertor, convertors) {
+ foreach (std::shared_ptr<LuaElementConvertor> convertor, convertors) {
if (boost::optional<std::string> 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 <memory>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/Override.h>
@@ -24,29 +24,29 @@ namespace Swift {
LuaElementConvertors();
virtual ~LuaElementConvertors();
- boost::shared_ptr<Element> convertFromLua(lua_State*, int index);
- int convertToLua(lua_State*, boost::shared_ptr<Element>);
+ std::shared_ptr<Element> convertFromLua(lua_State*, int index);
+ int convertToLua(lua_State*, std::shared_ptr<Element>);
/**
* Adds a toplevel type+data table with the given type.
*/
- boost::shared_ptr<Element> convertFromLuaUntyped(lua_State*, int index, const std::string& type);
+ std::shared_ptr<Element> 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<Element>);
+ int convertToLuaUntyped(lua_State*, std::shared_ptr<Element>);
- const std::vector< boost::shared_ptr<LuaElementConvertor> >& getConvertors() const {
+ const std::vector< std::shared_ptr<LuaElementConvertor> >& getConvertors() const {
return convertors;
}
private:
- boost::optional<std::string> doConvertToLuaUntyped(lua_State*, boost::shared_ptr<Element>);
+ boost::optional<std::string> doConvertToLuaUntyped(lua_State*, std::shared_ptr<Element>);
void registerConvertors();
private:
- std::vector< boost::shared_ptr<LuaElementConvertor> > convertors;
+ std::vector< std::shared_ptr<LuaElementConvertor> > 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<ErrorPayload> error) {
+static std::string getErrorString(std::shared_ptr<ErrorPayload> 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<Payload> result, boost::shared_ptr<ErrorPayload> error) : result(result), error(error) {}
+ Response(std::shared_ptr<Payload> result, std::shared_ptr<ErrorPayload> error) : result(result), error(error) {}
SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Response)
~Response();
- static Response withResult(boost::shared_ptr<Payload> response) {
- return Response(response, boost::shared_ptr<ErrorPayload>());
+ static Response withResult(std::shared_ptr<Payload> response) {
+ return Response(response, std::shared_ptr<ErrorPayload>());
}
- static Response withError(boost::shared_ptr<ErrorPayload> error) {
- return Response(boost::shared_ptr<Payload>(), error);
+ static Response withError(std::shared_ptr<ErrorPayload> error) {
+ return Response(std::shared_ptr<Payload>(), error);
}
int convertToLuaResult(lua_State* L);
- boost::shared_ptr<Payload> result;
- boost::shared_ptr<ErrorPayload> error;
+ std::shared_ptr<Payload> result;
+ std::shared_ptr<ErrorPayload> 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<XMPPRosterItem> SluiftClient::getRoster(int timeout) {
return client->getRoster()->getItems();
}
-void SluiftClient::handleIncomingMessage(boost::shared_ptr<Message> stanza) {
+void SluiftClient::handleIncomingMessage(std::shared_ptr<Message> stanza) {
if (stanza->getPayload<PubSubEvent>()) {
// Already handled by pubsub manager
return;
@@ -153,11 +153,11 @@ void SluiftClient::handleIncomingMessage(boost::shared_ptr<Message> stanza) {
pendingEvents.push_back(Event(stanza));
}
-void SluiftClient::handleIncomingPresence(boost::shared_ptr<Presence> stanza) {
+void SluiftClient::handleIncomingPresence(std::shared_ptr<Presence> stanza) {
pendingEvents.push_back(Event(stanza));
}
-void SluiftClient::handleIncomingPubSubEvent(const JID& from, boost::shared_ptr<PubSubEventPayload> event) {
+void SluiftClient::handleIncomingPubSubEvent(const JID& from, std::shared_ptr<PubSubEventPayload> event) {
pendingEvents.push_back(Event(from, event));
}
@@ -165,7 +165,7 @@ void SluiftClient::handleInitialRosterPopulated() {
rosterReceived = true;
}
-void SluiftClient::handleRequestResponse(boost::shared_ptr<Payload> response, boost::shared_ptr<ErrorPayload> error) {
+void SluiftClient::handleRequestResponse(std::shared_ptr<Payload> response, std::shared_ptr<ErrorPayload> error) {
requestResponse = response;
requestError = error;
requestResponseReceived = true;
@@ -175,7 +175,7 @@ void SluiftClient::handleDisconnected(const boost::optional<ClientError>& error)
disconnectedError = error;
}
-Sluift::Response SluiftClient::doSendRequest(boost::shared_ptr<Request> request, int timeout) {
+Sluift::Response SluiftClient::doSendRequest(std::shared_ptr<Request> request, int timeout) {
requestResponse.reset();
requestError.reset();
requestResponseReceived = false;
@@ -186,5 +186,5 @@ Sluift::Response SluiftClient::doSendRequest(boost::shared_ptr<Request> request,
eventLoop->runUntilEvents();
}
return Sluift::Response(requestResponse, watchdog.getTimedOut() ?
- boost::make_shared<ErrorPayload>(ErrorPayload::RemoteServerTimeout) : requestError);
+ std::make_shared<ErrorPayload>(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<Message> stanza) : type(MessageType), stanza(stanza) {}
- Event(boost::shared_ptr<Presence> stanza) : type(PresenceType), stanza(stanza) {}
- Event(const JID& from, boost::shared_ptr<PubSubEventPayload> payload) : type(PubSubEventType), from(from), pubsubEvent(payload) {}
+ Event(std::shared_ptr<Message> stanza) : type(MessageType), stanza(stanza) {}
+ Event(std::shared_ptr<Presence> stanza) : type(PresenceType), stanza(stanza) {}
+ Event(const JID& from, std::shared_ptr<PubSubEventPayload> payload) : type(PubSubEventType), from(from), pubsubEvent(payload) {}
Type type;
// Message & Presence
- boost::shared_ptr<Stanza> stanza;
+ std::shared_ptr<Stanza> stanza;
// PubSubEvent
JID from;
- boost::shared_ptr<PubSubEventPayload> pubsubEvent;
+ std::shared_ptr<PubSubEventPayload> pubsubEvent;
};
SluiftClient(
@@ -82,7 +82,7 @@ namespace Swift {
template<typename T>
Sluift::Response sendPubSubRequest(
- IQ::Type type, const JID& jid, boost::shared_ptr<T> payload, int timeout) {
+ IQ::Type type, const JID& jid, std::shared_ptr<T> payload, int timeout) {
return sendRequest(client->getPubSubManager()->createRequest(
type, jid, payload), timeout);
}
@@ -97,7 +97,7 @@ namespace Swift {
template<typename REQUEST_TYPE>
Sluift::Response sendVoidRequest(REQUEST_TYPE request, int timeout) {
boost::signals::scoped_connection c = request->onResponse.connect(
- boost::bind(&SluiftClient::handleRequestResponse, this, boost::shared_ptr<Payload>(), _1));
+ boost::bind(&SluiftClient::handleRequestResponse, this, std::shared_ptr<Payload>(), _1));
return doSendRequest(request, timeout);
}
@@ -108,13 +108,13 @@ namespace Swift {
std::vector<XMPPRosterItem> getRoster(int timeout);
private:
- Sluift::Response doSendRequest(boost::shared_ptr<Request> request, int timeout);
+ Sluift::Response doSendRequest(std::shared_ptr<Request> request, int timeout);
- void handleIncomingMessage(boost::shared_ptr<Message> stanza);
- void handleIncomingPresence(boost::shared_ptr<Presence> stanza);
- void handleIncomingPubSubEvent(const JID& from, boost::shared_ptr<PubSubEventPayload> event);
+ void handleIncomingMessage(std::shared_ptr<Message> stanza);
+ void handleIncomingPresence(std::shared_ptr<Presence> stanza);
+ void handleIncomingPubSubEvent(const JID& from, std::shared_ptr<PubSubEventPayload> event);
void handleInitialRosterPopulated();
- void handleRequestResponse(boost::shared_ptr<Payload> response, boost::shared_ptr<ErrorPayload> error);
+ void handleRequestResponse(std::shared_ptr<Payload> response, std::shared_ptr<ErrorPayload> error);
void handleDisconnected(const boost::optional<ClientError>& error);
private:
@@ -127,7 +127,7 @@ namespace Swift {
std::deque<Event> pendingEvents;
boost::optional<ClientError> disconnectedError;
bool requestResponseReceived;
- boost::shared_ptr<Payload> requestResponse;
- boost::shared_ptr<ErrorPayload> requestError;
+ std::shared_ptr<Payload> requestResponse;
+ std::shared_ptr<ErrorPayload> 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::Event> SluiftComponent::getNextEvent(
}
}
-void SluiftComponent::handleIncomingMessage(boost::shared_ptr<Message> stanza) {
+void SluiftComponent::handleIncomingMessage(std::shared_ptr<Message> stanza) {
pendingEvents.push_back(Event(stanza));
}
-void SluiftComponent::handleIncomingPresence(boost::shared_ptr<Presence> stanza) {
+void SluiftComponent::handleIncomingPresence(std::shared_ptr<Presence> stanza) {
pendingEvents.push_back(Event(stanza));
}
-void SluiftComponent::handleRequestResponse(boost::shared_ptr<Payload> response, boost::shared_ptr<ErrorPayload> error) {
+void SluiftComponent::handleRequestResponse(std::shared_ptr<Payload> response, std::shared_ptr<ErrorPayload> error) {
requestResponse = response;
requestError = error;
requestResponseReceived = true;
@@ -131,7 +131,7 @@ void SluiftComponent::handleError(const boost::optional<ComponentError>& error)
disconnectedError = error;
}
-Sluift::Response SluiftComponent::doSendRequest(boost::shared_ptr<Request> request, int timeout) {
+Sluift::Response SluiftComponent::doSendRequest(std::shared_ptr<Request> request, int timeout) {
requestResponse.reset();
requestError.reset();
requestResponseReceived = false;
@@ -142,5 +142,5 @@ Sluift::Response SluiftComponent::doSendRequest(boost::shared_ptr<Request> reque
eventLoop->runUntilEvents();
}
return Sluift::Response(requestResponse, watchdog.getTimedOut() ?
- boost::make_shared<ErrorPayload>(ErrorPayload::RemoteServerTimeout) : requestError);
+ std::make_shared<ErrorPayload>(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<Message> stanza) : type(MessageType), stanza(stanza) {}
- Event(boost::shared_ptr<Presence> stanza) : type(PresenceType), stanza(stanza) {}
+ Event(std::shared_ptr<Message> stanza) : type(MessageType), stanza(stanza) {}
+ Event(std::shared_ptr<Presence> stanza) : type(PresenceType), stanza(stanza) {}
Type type;
// Message & Presence
- boost::shared_ptr<Stanza> stanza;
+ std::shared_ptr<Stanza> stanza;
};
SluiftComponent(
@@ -78,7 +78,7 @@ namespace Swift {
template<typename REQUEST_TYPE>
Sluift::Response sendVoidRequest(REQUEST_TYPE request, int timeout) {
boost::signals::scoped_connection c = request->onResponse.connect(
- boost::bind(&SluiftComponent::handleRequestResponse, this, boost::shared_ptr<Payload>(), _1));
+ boost::bind(&SluiftComponent::handleRequestResponse, this, std::shared_ptr<Payload>(), _1));
return doSendRequest(request, timeout);
}
@@ -88,11 +88,11 @@ namespace Swift {
boost::function<bool (const Event&)> condition = 0);
private:
- Sluift::Response doSendRequest(boost::shared_ptr<Request> request, int timeout);
+ Sluift::Response doSendRequest(std::shared_ptr<Request> request, int timeout);
- void handleIncomingMessage(boost::shared_ptr<Message> stanza);
- void handleIncomingPresence(boost::shared_ptr<Presence> stanza);
- void handleRequestResponse(boost::shared_ptr<Payload> response, boost::shared_ptr<ErrorPayload> error);
+ void handleIncomingMessage(std::shared_ptr<Message> stanza);
+ void handleIncomingPresence(std::shared_ptr<Presence> stanza);
+ void handleRequestResponse(std::shared_ptr<Payload> response, std::shared_ptr<ErrorPayload> error);
void handleError(const boost::optional<ComponentError>& error);
private:
@@ -103,7 +103,7 @@ namespace Swift {
std::deque<Event> pendingEvents;
boost::optional<ComponentError> disconnectedError;
bool requestResponseReceived;
- boost::shared_ptr<Payload> requestResponse;
- boost::shared_ptr<ErrorPayload> requestError;
+ std::shared_ptr<Payload> requestResponse;
+ std::shared_ptr<ErrorPayload> 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<boost::shared_ptr<Payload> >& payloads) {
+static void addPayloadsToTable(lua_State* L, const std::vector<std::shared_ptr<Payload> >& payloads) {
if (!payloads.empty()) {
lua_createtable(L, boost::numeric_cast<int>(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<boost::shared_ptr
}
}
-static boost::shared_ptr<Payload> getPayload(lua_State* L, int index) {
+static std::shared_ptr<Payload> getPayload(lua_State* L, int index) {
if (lua_type(L, index) == LUA_TTABLE) {
- return boost::dynamic_pointer_cast<Payload>(Sluift::globals.elementConvertor.convertFromLua(L, index));
+ return std::dynamic_pointer_cast<Payload>(Sluift::globals.elementConvertor.convertFromLua(L, index));
}
else if (lua_type(L, index) == LUA_TSTRING) {
- return boost::make_shared<RawXMLPayload>(Lua::checkString(L, index));
+ return std::make_shared<RawXMLPayload>(Lua::checkString(L, index));
}
else {
- return boost::shared_ptr<Payload>();
+ return std::shared_ptr<Payload>();
}
}
-static std::vector< boost::shared_ptr<Payload> > getPayloadsFromTable(lua_State* L, int index) {
+static std::vector< std::shared_ptr<Payload> > getPayloadsFromTable(lua_State* L, int index) {
index = Lua::absoluteOffset(L, index);
- std::vector< boost::shared_ptr<Payload> > result;
+ std::vector< std::shared_ptr<Payload> > 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> payload = getPayload(L, -1);
+ std::shared_ptr<Payload> 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<SoftwareVersion> version = boost::dynamic_pointer_cast<SoftwareVersion>(Sluift::globals.elementConvertor.convertFromLuaUntyped(L, 2, "software_version"))) {
+ if (std::shared_ptr<SoftwareVersion> version = std::dynamic_pointer_cast<SoftwareVersion>(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<Lua::Value>(item.getJID().toString()))
- ("name", boost::make_shared<Lua::Value>(item.getName()))
- ("subscription", boost::make_shared<Lua::Value>(subscription))
- ("groups", boost::make_shared<Lua::Value>(std::vector<Lua::Value>(item.getGroups().begin(), item.getGroups().end())));
- contactsTable[item.getJID().toString()] = boost::make_shared<Lua::Value>(itemTable);
+ ("jid", std::make_shared<Lua::Value>(item.getJID().toString()))
+ ("name", std::make_shared<Lua::Value>(item.getName()))
+ ("subscription", std::make_shared<Lua::Value>(subscription))
+ ("groups", std::make_shared<Lua::Value>(std::vector<Lua::Value>(item.getGroups().begin(), item.getGroups().end())));
+ contactsTable[item.getJID().toString()] = std::make_shared<Lua::Value>(itemTable);
}
pushValue(L, contactsTable);
Lua::registerTableToString(L, -1);
@@ -226,7 +226,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
JID to;
boost::optional<std::string> body;
boost::optional<std::string> subject;
- std::vector<boost::shared_ptr<Payload> > payloads;
+ std::vector<std::shared_ptr<Payload> > 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>();
+ Message::ref message = std::make_shared<Message>();
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> presence = boost::make_shared<Presence>();
+ std::shared_ptr<Presence> presence = std::make_shared<Presence>();
int index = 2;
if (lua_isstring(L, index)) {
@@ -315,7 +315,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
if (boost::optional<std::string> value = Lua::getStringField(L, index, "show")) {
presence->setShow(StatusShowConvertor::convertStatusShowTypeFromString(*value));
}
- std::vector< boost::shared_ptr<Payload> > payloads = getPayloadsFromTable(L, index);
+ std::vector< std::shared_ptr<Payload> > 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> payload;
+ std::shared_ptr<Payload> payload;
lua_getfield(L, 2, "query");
payload = getPayload(L, -1);
lua_pop(L, 1);
return client->sendRequest(
- boost::make_shared< GenericRequest<Payload> >(type, to, payload, client->getClient()->getIQRouter()), timeout).convertToLuaResult(L);
+ std::make_shared< GenericRequest<Payload> >(type, to, payload, client->getClient()->getIQRouter()), timeout).convertToLuaResult(L);
}
#define DISPATCH_PUBSUB_PAYLOAD(payloadType, container, response) \
- else if (boost::shared_ptr<payloadType> p = boost::dynamic_pointer_cast<payloadType>(payload)) { \
+ else if (std::shared_ptr<payloadType> p = std::dynamic_pointer_cast<payloadType>(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> payload = getPayload(L, -1);
+ std::shared_ptr<Payload> 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<Lua::Value>(client->getOptions().manualHostname))
- ("port", boost::make_shared<Lua::Value>(client->getOptions().manualPort))
- ("ack", boost::make_shared<Lua::Value>(client->getOptions().useAcks))
- ("compress", boost::make_shared<Lua::Value>(client->getOptions().useStreamCompression))
- ("tls", boost::make_shared<Lua::Value>(client->getOptions().useTLS == ClientOptions::NeverUseTLS ? false : true))
- ("bosh_url", boost::make_shared<Lua::Value>(client->getOptions().boshURL.toString()))
- ("allow_plain_without_tls", boost::make_shared<Lua::Value>(client->getOptions().allowPLAINWithoutTLS));
+ ("host", std::make_shared<Lua::Value>(client->getOptions().manualHostname))
+ ("port", std::make_shared<Lua::Value>(client->getOptions().manualPort))
+ ("ack", std::make_shared<Lua::Value>(client->getOptions().useAcks))
+ ("compress", std::make_shared<Lua::Value>(client->getOptions().useStreamCompression))
+ ("tls", std::make_shared<Lua::Value>(client->getOptions().useTLS == ClientOptions::NeverUseTLS ? false : true))
+ ("bosh_url", std::make_shared<Lua::Value>(client->getOptions().boshURL.toString()))
+ ("allow_plain_without_tls", std::make_shared<Lua::Value>(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<Message>(event.stanza);
+ Message::ref message = std::dynamic_pointer_cast<Message>(event.stanza);
Lua::Table result = boost::assign::map_list_of
- ("type", boost::make_shared<Lua::Value>(std::string("message")))
- ("from", boost::make_shared<Lua::Value>(message->getFrom().toString()))
- ("body", boost::make_shared<Lua::Value>(message->getBody().get_value_or("")))
- ("message_type", boost::make_shared<Lua::Value>(MessageConvertor::convertMessageTypeToString(message->getType())));
+ ("type", std::make_shared<Lua::Value>(std::string("message")))
+ ("from", std::make_shared<Lua::Value>(message->getFrom().toString()))
+ ("body", std::make_shared<Lua::Value>(message->getBody().get_value_or("")))
+ ("message_type", std::make_shared<Lua::Value>(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<Presence>(event.stanza);
+ Presence::ref presence = std::dynamic_pointer_cast<Presence>(event.stanza);
Lua::Table result = boost::assign::map_list_of
- ("type", boost::make_shared<Lua::Value>(std::string("presence")))
- ("from", boost::make_shared<Lua::Value>(presence->getFrom().toString()))
- ("status", boost::make_shared<Lua::Value>(presence->getStatus()))
- ("presence_type", boost::make_shared<Lua::Value>(PresenceConvertor::convertPresenceTypeToString(presence->getType())));
+ ("type", std::make_shared<Lua::Value>(std::string("presence")))
+ ("from", std::make_shared<Lua::Value>(presence->getFrom().toString()))
+ ("status", std::make_shared<Lua::Value>(presence->getStatus()))
+ ("presence_type", std::make_shared<Lua::Value>(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>();
+ RosterPayload::ref roster = std::make_shared<RosterPayload>();
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>();
+ RosterPayload::ref roster = std::make_shared<RosterPayload>();
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> discoInfo = boost::dynamic_pointer_cast<DiscoInfo>(Sluift::globals.elementConvertor.convertFromLuaUntyped(L, 2, "disco_info"))) {
+ if (std::shared_ptr<DiscoInfo> discoInfo = std::dynamic_pointer_cast<DiscoInfo>(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<PKCS12Certificate>(file, createSafeByteArray(pwd)));
+ getClient(L)->getClient()->setCertificate(std::make_shared<PKCS12Certificate>(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<boost::shared_ptr<Payload> >& payloads) {
+static void addPayloadsToTable(lua_State* L, const std::vector<std::shared_ptr<Payload> >& payloads) {
if (!payloads.empty()) {
lua_createtable(L, boost::numeric_cast<int>(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<boost::shared_ptr
}
}
-static boost::shared_ptr<Payload> getPayload(lua_State* L, int index) {
+static std::shared_ptr<Payload> getPayload(lua_State* L, int index) {
if (lua_type(L, index) == LUA_TTABLE) {
- return boost::dynamic_pointer_cast<Payload>(Sluift::globals.elementConvertor.convertFromLua(L, index));
+ return std::dynamic_pointer_cast<Payload>(Sluift::globals.elementConvertor.convertFromLua(L, index));
}
else if (lua_type(L, index) == LUA_TSTRING) {
- return boost::make_shared<RawXMLPayload>(Lua::checkString(L, index));
+ return std::make_shared<RawXMLPayload>(Lua::checkString(L, index));
}
else {
- return boost::shared_ptr<Payload>();
+ return std::shared_ptr<Payload>();
}
}
-static std::vector< boost::shared_ptr<Payload> > getPayloadsFromTable(lua_State* L, int index) {
+static std::vector< std::shared_ptr<Payload> > getPayloadsFromTable(lua_State* L, int index) {
index = Lua::absoluteOffset(L, index);
- std::vector< boost::shared_ptr<Payload> > result;
+ std::vector< std::shared_ptr<Payload> > 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> payload = getPayload(L, -1);
+ std::shared_ptr<Payload> 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<SoftwareVersion> version = boost::dynamic_pointer_cast<SoftwareVersion>(Sluift::globals.elementConvertor.convertFromLuaUntyped(L, 2, "software_version"))) {
+ if (std::shared_ptr<SoftwareVersion> version = std::dynamic_pointer_cast<SoftwareVersion>(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<std::string> from;
boost::optional<std::string> body;
boost::optional<std::string> subject;
- std::vector<boost::shared_ptr<Payload> > payloads;
+ std::vector<std::shared_ptr<Payload> > 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>();
+ Message::ref message = std::make_shared<Message>();
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> presence = boost::make_shared<Presence>();
+ std::shared_ptr<Presence> presence = std::make_shared<Presence>();
int index = 2;
if (lua_isstring(L, index)) {
@@ -294,7 +294,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
if (boost::optional<std::string> value = Lua::getStringField(L, index, "show")) {
presence->setShow(StatusShowConvertor::convertStatusShowTypeFromString(*value));
}
- std::vector< boost::shared_ptr<Payload> > payloads = getPayloadsFromTable(L, index);
+ std::vector< std::shared_ptr<Payload> > 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> payload;
+ std::shared_ptr<Payload> payload;
lua_getfield(L, 2, "query");
payload = getPayload(L, -1);
lua_pop(L, 1);
return component->sendRequest(
- boost::make_shared< GenericRequest<Payload> >(type, from, to, payload, component->getComponent()->getIQRouter()), timeout).convertToLuaResult(L);
+ std::make_shared< GenericRequest<Payload> >(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<Message>(event.stanza);
+ Message::ref message = std::dynamic_pointer_cast<Message>(event.stanza);
Lua::Table result = boost::assign::map_list_of
- ("type", boost::make_shared<Lua::Value>(std::string("message")))
- ("from", boost::make_shared<Lua::Value>(message->getFrom().toString()))
- ("to", boost::make_shared<Lua::Value>(message->getTo().toString()))
- ("body", boost::make_shared<Lua::Value>(message->getBody().get_value_or("")))
- ("message_type", boost::make_shared<Lua::Value>(MessageConvertor::convertMessageTypeToString(message->getType())));
+ ("type", std::make_shared<Lua::Value>(std::string("message")))
+ ("from", std::make_shared<Lua::Value>(message->getFrom().toString()))
+ ("to", std::make_shared<Lua::Value>(message->getTo().toString()))
+ ("body", std::make_shared<Lua::Value>(message->getBody().get_value_or("")))
+ ("message_type", std::make_shared<Lua::Value>(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<Presence>(event.stanza);
+ Presence::ref presence = std::dynamic_pointer_cast<Presence>(event.stanza);
Lua::Table result = boost::assign::map_list_of
- ("type", boost::make_shared<Lua::Value>(std::string("presence")))
- ("from", boost::make_shared<Lua::Value>(presence->getFrom().toString()))
- ("to", boost::make_shared<Lua::Value>(presence->getTo().toString()))
- ("status", boost::make_shared<Lua::Value>(presence->getStatus()))
- ("presence_type", boost::make_shared<Lua::Value>(PresenceConvertor::convertPresenceTypeToString(presence->getType())));
+ ("type", std::make_shared<Lua::Value>(std::string("presence")))
+ ("from", std::make_shared<Lua::Value>(presence->getFrom().toString()))
+ ("to", std::make_shared<Lua::Value>(presence->getTo().toString()))
+ ("status", std::make_shared<Lua::Value>(presence->getStatus()))
+ ("presence_type", std::make_shared<Lua::Value>(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<CryptoProvider> crypto(PlatformCryptoProvider::create());
+ static std::shared_ptr<CryptoProvider> 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> payload = boost::dynamic_pointer_cast<Payload>(Sluift::globals.elementConvertor.convertFromLua(L, 1));
+ std::shared_ptr<Payload> payload = std::dynamic_pointer_cast<Payload>(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<LuaElementConvertor> convertor, Sluift::globals.elementConvertor.getConvertors()) {
+ foreach (std::shared_ptr<LuaElementConvertor> convertor, Sluift::globals.elementConvertor.getConvertors()) {
boost::optional<LuaElementConvertor::Documentation> 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 <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#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<google_breakpad::ExceptionHandler> handler;
+ std::shared_ptr<google_breakpad::ExceptionHandler> handler;
};
CrashReporter::CrashReporter(const boost::filesystem::path& path) {
@@ -49,11 +49,11 @@ CrashReporter::CrashReporter(const boost::filesystem::path& path) {
}
}
- p = boost::make_shared<Private>();
+ p = std::make_shared<Private>();
#if defined(SWIFTEN_PLATFORM_WINDOWS)
// FIXME: Need UTF8 conversion from string to wstring
std::string pathString = pathToString(path);
- p->handler = boost::shared_ptr<google_breakpad::ExceptionHandler>(
+ p->handler = std::shared_ptr<google_breakpad::ExceptionHandler>(
// 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<google_breakpad::ExceptionHandler>(pathToString(path), (google_breakpad::ExceptionHandler::FilterCallback) 0, handleDump, (void*) 0, true, (const char*) 0);
+// p->handler = std::make_shared<google_breakpad::ExceptionHandler>(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 <memory>
#include <string>
#include <boost/filesystem.hpp>
-#include <boost/shared_ptr.hpp>
namespace Swift {
class CrashReporter {
@@ -18,6 +18,6 @@ namespace Swift {
private:
struct Private;
- boost::shared_ptr<Private> p;
+ std::shared_ptr<Private> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <SwifTools/Idle/IdleDetector.h>
@@ -25,6 +25,6 @@ namespace Swift {
private:
IdleQuerier* querier;
- boost::shared_ptr<Timer> timer;
+ std::shared_ptr<Timer> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/boost_bsignals.h>
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<MockTimer> timer, timers) {
+ foreach(std::shared_ptr<MockTimer> timer, timers) {
timer->updateTime(milliseconds);
}
}
- boost::shared_ptr<Timer> createTimer(int milliseconds) {
- boost::shared_ptr<MockTimer> timer(new MockTimer(milliseconds));
+ std::shared_ptr<Timer> createTimer(int milliseconds) {
+ std::shared_ptr<MockTimer> timer(new MockTimer(milliseconds));
timers.push_back(timer);
return timer;
}
- std::vector<boost::shared_ptr<MockTimer> > timers;
+ std::vector<std::shared_ptr<MockTimer> > 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<Private> p;
+ std::shared_ptr<Private> 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 <SwifTools/Notifier/GrowlNotifier.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <set>
#include <SwifTools/Notifier/GrowlNotifierDelegate.h>
@@ -33,7 +33,7 @@ class GrowlNotifier::Private {
};
GrowlNotifier::GrowlNotifier(const std::string& name) {
- p = boost::make_shared<Private>();
+ p = std::make_shared<Private>();
p->delegate = boost::intrusive_ptr<GrowlNotifierDelegate>([[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<Private> p;
+ std::shared_ptr<Private> 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 <map>
#include <string>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/Log.h>
@@ -35,12 +35,12 @@ namespace Swift {
class NotificationCenterNotifier::Private {
public:
- std::map<std::string, boost::shared_ptr<Context> > callbacksForNotifications;
+ std::map<std::string, std::shared_ptr<Context> > callbacksForNotifications;
boost::intrusive_ptr<NotificationCenterNotifierDelegate> delegate;
};
NotificationCenterNotifier::NotificationCenterNotifier() {
- p = boost::make_shared<Private>();
+ p = std::make_shared<Private>();
p->delegate = boost::intrusive_ptr<NotificationCenterNotifierDelegate>([[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<Context>(callback);
+ p->callbacksForNotifications[ns2StdString(notification.identifier)] = std::make_shared<Context>(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<OutgoingAdHocCommandSession> command) {
+AdHocController::AdHocController(AdHocCommandWindowFactory* factory, std::shared_ptr<OutgoingAdHocCommandSession> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/AdHoc/OutgoingAdHocCommandSession.h>
@@ -17,7 +17,7 @@ class AdHocCommandWindow;
class AdHocController {
public:
- AdHocController(AdHocCommandWindowFactory* factory, boost::shared_ptr<OutgoingAdHocCommandSession> command);
+ AdHocController(AdHocCommandWindowFactory* factory, std::shared_ptr<OutgoingAdHocCommandSession> command);
~AdHocController();
boost::signal<void ()> 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 <Swift/Controllers/AdHocManager.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/AdHoc/OutgoingAdHocCommandSession.h>
#include <Swiften/Base/foreach.h>
@@ -38,12 +38,12 @@ AdHocManager::~AdHocManager() {
}
}
-void AdHocManager::removeController(boost::shared_ptr<AdHocController> controller) {
+void AdHocManager::removeController(std::shared_ptr<AdHocController> 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<DiscoInfo> info) {
+void AdHocManager::setServerDiscoInfo(std::shared_ptr<DiscoInfo> 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<DiscoInfo> info) {
}
void AdHocManager::setOnline(bool online) {
- foreach (boost::shared_ptr<AdHocController> controller, controllers_) {
+ foreach (std::shared_ptr<AdHocController> controller, controllers_) {
controller->setOnline(online);
}
}
-void AdHocManager::handleServerDiscoItemsResponse(boost::shared_ptr<DiscoItems> items, ErrorPayload::ref error) {
+void AdHocManager::handleServerDiscoItemsResponse(std::shared_ptr<DiscoItems> items, ErrorPayload::ref error) {
std::vector<DiscoItems::Item> commands;
if (!error) {
foreach (DiscoItems::Item item, items->getItems()) {
@@ -75,18 +75,18 @@ void AdHocManager::handleServerDiscoItemsResponse(boost::shared_ptr<DiscoItems>
mainWindow_->setAvailableAdHocCommands(commands);
}
-void AdHocManager::handleUIEvent(boost::shared_ptr<UIEvent> event) {
- boost::shared_ptr<RequestAdHocUIEvent> adHocEvent = boost::dynamic_pointer_cast<RequestAdHocUIEvent>(event);
+void AdHocManager::handleUIEvent(std::shared_ptr<UIEvent> event) {
+ std::shared_ptr<RequestAdHocUIEvent> adHocEvent = std::dynamic_pointer_cast<RequestAdHocUIEvent>(event);
if (adHocEvent) {
- boost::shared_ptr<OutgoingAdHocCommandSession> command = boost::make_shared<OutgoingAdHocCommandSession>(adHocEvent->getCommand().getJID(), adHocEvent->getCommand().getNode(), iqRouter_);
- boost::shared_ptr<AdHocController> controller = boost::make_shared<AdHocController>(factory_, command);
+ std::shared_ptr<OutgoingAdHocCommandSession> command = std::make_shared<OutgoingAdHocCommandSession>(adHocEvent->getCommand().getJID(), adHocEvent->getCommand().getNode(), iqRouter_);
+ std::shared_ptr<AdHocController> controller = std::make_shared<AdHocController>(factory_, command);
controller->onDeleting.connect(boost::bind(&AdHocManager::removeController, this, controller));
controllers_.push_back(controller);
}
- boost::shared_ptr<RequestAdHocWithJIDUIEvent> adHocJIDEvent = boost::dynamic_pointer_cast<RequestAdHocWithJIDUIEvent>(event);
+ std::shared_ptr<RequestAdHocWithJIDUIEvent> adHocJIDEvent = std::dynamic_pointer_cast<RequestAdHocWithJIDUIEvent>(event);
if (!!adHocJIDEvent) {
- boost::shared_ptr<OutgoingAdHocCommandSession> command = boost::make_shared<OutgoingAdHocCommandSession>(adHocJIDEvent->getJID(), adHocJIDEvent->getNode(), iqRouter_);
- boost::shared_ptr<AdHocController> controller = boost::make_shared<AdHocController>(factory_, command);
+ std::shared_ptr<OutgoingAdHocCommandSession> command = std::make_shared<OutgoingAdHocCommandSession>(adHocJIDEvent->getJID(), adHocJIDEvent->getNode(), iqRouter_);
+ std::shared_ptr<AdHocController> controller = std::make_shared<AdHocController>(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<AdHocController> contoller);
- void setServerDiscoInfo(boost::shared_ptr<DiscoInfo> info);
+ void removeController(std::shared_ptr<AdHocController> contoller);
+ void setServerDiscoInfo(std::shared_ptr<DiscoInfo> info);
void setOnline(bool online);
private:
- void handleServerDiscoItemsResponse(boost::shared_ptr<DiscoItems>, ErrorPayload::ref error);
- void handleUIEvent(boost::shared_ptr<UIEvent> event);
+ void handleServerDiscoItemsResponse(std::shared_ptr<DiscoItems>, ErrorPayload::ref error);
+ void handleUIEvent(std::shared_ptr<UIEvent> event);
boost::signal<void (const AdHocController&)> onControllerComplete;
JID jid_;
IQRouter* iqRouter_;
@@ -38,7 +38,7 @@ private:
MainWindow* mainWindow_;
AdHocCommandWindowFactory* factory_;
GetDiscoItemsRequest::ref discoItemsRequest_;
- std::vector<boost::shared_ptr<AdHocController> > controllers_;
+ std::vector<std::shared_ptr<AdHocController> > 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<JID> &newBlockL
}
}
-void BlockListController::handleUIEvent(boost::shared_ptr<UIEvent> rawEvent) {
+void BlockListController::handleUIEvent(std::shared_ptr<UIEvent> rawEvent) {
// handle UI dialog
- boost::shared_ptr<RequestBlockListDialogUIEvent> requestDialogEvent = boost::dynamic_pointer_cast<RequestBlockListDialogUIEvent>(rawEvent);
+ std::shared_ptr<RequestBlockListDialogUIEvent> requestDialogEvent = std::dynamic_pointer_cast<RequestBlockListDialogUIEvent>(rawEvent);
if (requestDialogEvent != nullptr) {
if (blockListEditorWidget_ == nullptr) {
blockListEditorWidget_ = blockListEditorWidgetFactory_->createBlockListEditorWidget();
@@ -69,7 +69,7 @@ void BlockListController::handleUIEvent(boost::shared_ptr<UIEvent> rawEvent) {
}
// handle block state change
- boost::shared_ptr<RequestChangeBlockStateUIEvent> changeStateEvent = boost::dynamic_pointer_cast<RequestChangeBlockStateUIEvent>(rawEvent);
+ std::shared_ptr<RequestChangeBlockStateUIEvent> changeStateEvent = std::dynamic_pointer_cast<RequestChangeBlockStateUIEvent>(rawEvent);
if (changeStateEvent != nullptr) {
if (changeStateEvent->getBlockState() == RequestChangeBlockStateUIEvent::Blocked) {
GenericRequest<BlockPayload>::ref blockRequest = blockListManager_->createBlockJIDRequest(changeStateEvent->getContact());
@@ -84,7 +84,7 @@ void BlockListController::handleUIEvent(boost::shared_ptr<UIEvent> rawEvent) {
}
}
-void BlockListController::handleBlockResponse(GenericRequest<BlockPayload>::ref request, boost::shared_ptr<BlockPayload>, ErrorPayload::ref error, const std::vector<JID>& jids, bool originEditor) {
+void BlockListController::handleBlockResponse(GenericRequest<BlockPayload>::ref request, std::shared_ptr<BlockPayload>, ErrorPayload::ref error, const std::vector<JID>& 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<BlockPayload>::ref
blockListEditorWidget_->setBusy(false);
}
else {
- eventController_->handleIncomingEvent(boost::make_shared<ErrorEvent>(request->getReceiver(), errorMessage));
+ eventController_->handleIncomingEvent(std::make_shared<ErrorEvent>(request->getReceiver(), errorMessage));
}
}
if (originEditor) {
@@ -109,7 +109,7 @@ void BlockListController::handleBlockResponse(GenericRequest<BlockPayload>::ref
}
}
-void BlockListController::handleUnblockResponse(GenericRequest<UnblockPayload>::ref request, boost::shared_ptr<UnblockPayload>, ErrorPayload::ref error, const std::vector<JID>& jids, bool originEditor) {
+void BlockListController::handleUnblockResponse(GenericRequest<UnblockPayload>::ref request, std::shared_ptr<UnblockPayload>, ErrorPayload::ref error, const std::vector<JID>& 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<UnblockPayload>::
blockListEditorWidget_->setBusy(false);
}
else {
- eventController_->handleIncomingEvent(boost::make_shared<ErrorEvent>(request->getReceiver(), errorMessage));
+ eventController_->handleIncomingEvent(std::make_shared<ErrorEvent>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Queries/GenericRequest.h>
@@ -34,10 +34,10 @@ public:
private:
void blockListDifferences(const std::vector<JID> &newBlockList, std::vector<JID>& jidsToUnblock, std::vector<JID>& jidsToBlock) const;
- void handleUIEvent(boost::shared_ptr<UIEvent> event);
+ void handleUIEvent(std::shared_ptr<UIEvent> event);
- void handleBlockResponse(GenericRequest<BlockPayload>::ref, boost::shared_ptr<BlockPayload>, ErrorPayload::ref error, const std::vector<JID>& jids, bool originEditor);
- void handleUnblockResponse(GenericRequest<UnblockPayload>::ref, boost::shared_ptr<UnblockPayload>, ErrorPayload::ref error, const std::vector<JID>& jids, bool originEditor);
+ void handleBlockResponse(GenericRequest<BlockPayload>::ref, std::shared_ptr<BlockPayload>, ErrorPayload::ref error, const std::vector<JID>& jids, bool originEditor);
+ void handleUnblockResponse(GenericRequest<UnblockPayload>::ref, std::shared_ptr<UnblockPayload>, ErrorPayload::ref error, const std::vector<JID>& jids, bool originEditor);
void handleSetNewBlockList(const std::vector<JID>& 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 <Swift/Controllers/Chat/ChatController.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Avatars/AvatarManager.h>
#include <Swiften/Base/Algorithm.h>
@@ -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> 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> 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<DiscoInfo> info) {
+void ChatController::setAvailableServerFeatures(std::shared_ptr<DiscoInfo> info) {
ChatControllerBase::setAvailableServerFeatures(info);
if (iqRouter_->isAvailable() && info->hasFeature(DiscoInfo::BlockingCommandFeature)) {
- boost::shared_ptr<BlockList> blockList = clientBlockListManager_->getBlockList();
+ std::shared_ptr<BlockList> 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<DiscoInfo> inf
}
}
-bool ChatController::isIncomingMessageFromMe(boost::shared_ptr<Message>) {
+bool ChatController::isIncomingMessageFromMe(std::shared_ptr<Message>) {
return false;
}
-void ChatController::preHandleIncomingMessage(boost::shared_ptr<MessageEvent> messageEvent) {
+void ChatController::preHandleIncomingMessage(std::shared_ptr<MessageEvent> messageEvent) {
if (messageEvent->isReadable()) {
chatWindow_->flash();
lastWasPresence_ = false;
}
- boost::shared_ptr<Message> message = messageEvent->getStanza();
+ std::shared_ptr<Message> 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<MessageEvent> me
// handle XEP-0184 Message Receipts
// incomming receipts
- if (boost::shared_ptr<DeliveryReceipt> receipt = message->getPayload<DeliveryReceipt>()) {
+ if (std::shared_ptr<DeliveryReceipt> receipt = message->getPayload<DeliveryReceipt>()) {
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<MessageEvent> me
// incoming receipt requests
} else if (message->getPayload<DeliveryReceiptRequest>()) {
if (receivingPresenceFromUs_) {
- boost::shared_ptr<Message> receiptMessage = boost::make_shared<Message>();
+ std::shared_ptr<Message> receiptMessage = std::make_shared<Message>();
receiptMessage->setTo(toJID_);
- receiptMessage->addPayload(boost::make_shared<DeliveryReceipt>(message->getID()));
+ receiptMessage->addPayload(std::make_shared<DeliveryReceipt>(message->getID()));
stanzaChannel_->sendMessage(receiptMessage);
}
}
}
-void ChatController::postHandleIncomingMessage(boost::shared_ptr<MessageEvent> messageEvent, const ChatWindow::ChatMessage& chatMessage) {
+void ChatController::postHandleIncomingMessage(std::shared_ptr<MessageEvent> messageEvent, const ChatWindow::ChatMessage& chatMessage) {
eventController_->handleIncomingEvent(messageEvent);
if (!messageEvent->getConcluded()) {
handleHighlightActions(chatMessage);
@@ -216,10 +217,10 @@ void ChatController::postHandleIncomingMessage(boost::shared_ptr<MessageEvent> m
}
-void ChatController::preSendMessageRequest(boost::shared_ptr<Message> message) {
+void ChatController::preSendMessageRequest(std::shared_ptr<Message> message) {
chatStateNotifier_->addChatStateRequest(message);
if (userWantsReceipts_ && (contactSupportsReceipts_ != No) && message) {
- message->addPayload(boost::make_shared<DeliveryReceiptRequest>());
+ message->addPayload(std::make_shared<DeliveryReceiptRequest>());
}
}
@@ -255,7 +256,7 @@ void ChatController::checkForDisplayingDisplayReceiptsAlert() {
}
void ChatController::handleBlockingStateChanged() {
- boost::shared_ptr<BlockList> blockList = clientBlockListManager_->getBlockList();
+ std::shared_ptr<BlockList> 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>(RequestChangeBlockStateUIEvent::Blocked, toJID_));
+ eventStream_->send(std::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Blocked, toJID_));
} else {
- eventStream_->send(boost::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Blocked, toJID_.toBare()));
+ eventStream_->send(std::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Blocked, toJID_.toBare()));
}
}
void ChatController::handleUnblockUserRequest() {
if (isInMUC_) {
- eventStream_->send(boost::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Unblocked, toJID_));
+ eventStream_->send(std::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Unblocked, toJID_));
} else {
- eventStream_->send(boost::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Unblocked, toJID_.toBare()));
+ eventStream_->send(std::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Unblocked, toJID_.toBare()));
}
}
void ChatController::handleInviteToChat(const std::vector<JID>& droppedJIDs) {
- boost::shared_ptr<UIEvent> event(new RequestInviteToMUCUIEvent(toJID_.toBare(), droppedJIDs, RequestInviteToMUCUIEvent::Impromptu));
+ std::shared_ptr<UIEvent> 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<UIEvent> event) {
- boost::shared_ptr<InviteToMUCUIEvent> inviteEvent = boost::dynamic_pointer_cast<InviteToMUCUIEvent>(event);
+void ChatController::handleUIEvent(std::shared_ptr<UIEvent> event) {
+ std::shared_ptr<InviteToMUCUIEvent> inviteEvent = std::dynamic_pointer_cast<InviteToMUCUIEvent>(event);
if (inviteEvent && inviteEvent->getRoom() == toJID_.toBare()) {
onConvertToMUC(detachChatWindow(), inviteEvent->getInvites(), inviteEvent->getReason());
}
}
-void ChatController::postSendMessage(const std::string& body, boost::shared_ptr<Stanza> sentStanza) {
- boost::shared_ptr<Replace> replace = sentStanza->getPayload<Replace>();
+void ChatController::postSendMessage(const std::string& body, std::shared_ptr<Stanza> sentStanza) {
+ std::shared_ptr<Replace> replace = sentStanza->getPayload<Replace>();
if (replace) {
- eraseIf(unackedStanzas_, PairSecondEquals<boost::shared_ptr<Stanza>, std::string>(myLastMessageUIID_));
+ eraseIf(unackedStanzas_, PairSecondEquals<std::shared_ptr<Stanza>, 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<SecurityLabel>(), 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<SecurityLabel>(), 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> stanza) {
- std::map<boost::shared_ptr<Stanza>, std::string>::iterator unackedStanza = unackedStanzas_.find(stanza);
+void ChatController::handleStanzaAcked(std::shared_ptr<Stanza> stanza) {
+ std::map<std::shared_ptr<Stanza>, 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> stanza) {
void ChatController::setOnline(bool online) {
if (!online) {
- std::map<boost::shared_ptr<Stanza>, std::string>::iterator it = unackedStanzas_.begin();
+ std::map<std::shared_ptr<Stanza>, 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<SendFileUIEvent>(getToJID(), filename));
+ eventStream_->send(std::make_shared<SendFileUIEvent>(getToJID(), filename));
}
void ChatController::handleWhiteboardSessionAccept() {
- eventStream_->send(boost::make_shared<AcceptWhiteboardSessionUIEvent>(toJID_));
+ eventStream_->send(std::make_shared<AcceptWhiteboardSessionUIEvent>(toJID_));
}
void ChatController::handleWhiteboardSessionCancel() {
- eventStream_->send(boost::make_shared<CancelWhiteboardSessionUIEvent>(toJID_));
+ eventStream_->send(std::make_shared<CancelWhiteboardSessionUIEvent>(toJID_));
}
void ChatController::handleWhiteboardWindowShow() {
- eventStream_->send(boost::make_shared<ShowWhiteboardUIEvent>(toJID_));
+ eventStream_->send(std::make_shared<ShowWhiteboardUIEvent>(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> presence) {
+std::string ChatController::getStatusChangeString(std::shared_ptr<Presence> 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<Presence> pr
return response + ".";
}
-void ChatController::handlePresenceChange(boost::shared_ptr<Presence> newPresence) {
+void ChatController::handlePresenceChange(std::shared_ptr<Presence> newPresence) {
bool relevantPresence = false;
if (isInMUC_) {
@@ -487,7 +488,7 @@ void ChatController::handlePresenceChange(boost::shared_ptr<Presence> newPresenc
}
if (!newPresence) {
- newPresence = boost::make_shared<Presence>();
+ newPresence = std::make_shared<Presence>();
newPresence->setType(Presence::Unavailable);
}
lastShownStatus_ = newPresence->getShow();
@@ -506,7 +507,7 @@ void ChatController::handlePresenceChange(boost::shared_ptr<Presence> newPresenc
}
}
-boost::optional<boost::posix_time::ptime> ChatController::getMessageTimestamp(boost::shared_ptr<Message> message) const {
+boost::optional<boost::posix_time::ptime> ChatController::getMessageTimestamp(std::shared_ptr<Message> 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> 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> chatMessageParser, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider);
virtual ~ChatController();
virtual void setToJID(const JID& jid) SWIFTEN_OVERRIDE;
- virtual void setAvailableServerFeatures(boost::shared_ptr<DiscoInfo> info) SWIFTEN_OVERRIDE;
+ virtual void setAvailableServerFeatures(std::shared_ptr<DiscoInfo> 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<Presence> newPresence);
- std::string getStatusChangeString(boost::shared_ptr<Presence> presence);
- virtual bool isIncomingMessageFromMe(boost::shared_ptr<Message> message) SWIFTEN_OVERRIDE;
- virtual void postSendMessage(const std::string &body, boost::shared_ptr<Stanza> sentStanza) SWIFTEN_OVERRIDE;
- virtual void preHandleIncomingMessage(boost::shared_ptr<MessageEvent> messageEvent) SWIFTEN_OVERRIDE;
- virtual void postHandleIncomingMessage(boost::shared_ptr<MessageEvent> messageEvent, const ChatWindow::ChatMessage& chatMessage) SWIFTEN_OVERRIDE;
- virtual void preSendMessageRequest(boost::shared_ptr<Message>) SWIFTEN_OVERRIDE;
+ void handlePresenceChange(std::shared_ptr<Presence> newPresence);
+ std::string getStatusChangeString(std::shared_ptr<Presence> presence);
+ virtual bool isIncomingMessageFromMe(std::shared_ptr<Message> message) SWIFTEN_OVERRIDE;
+ virtual void postSendMessage(const std::string &body, std::shared_ptr<Stanza> sentStanza) SWIFTEN_OVERRIDE;
+ virtual void preHandleIncomingMessage(std::shared_ptr<MessageEvent> messageEvent) SWIFTEN_OVERRIDE;
+ virtual void postHandleIncomingMessage(std::shared_ptr<MessageEvent> messageEvent, const ChatWindow::ChatMessage& chatMessage) SWIFTEN_OVERRIDE;
+ virtual void preSendMessageRequest(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<boost::posix_time::ptime> getMessageTimestamp(boost::shared_ptr<Message>) const SWIFTEN_OVERRIDE;
- void handleStanzaAcked(boost::shared_ptr<Stanza> stanza);
+ virtual boost::optional<boost::posix_time::ptime> getMessageTimestamp(std::shared_ptr<Message>) const SWIFTEN_OVERRIDE;
+ void handleStanzaAcked(std::shared_ptr<Stanza> 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<UIEvent> event);
+ void handleUIEvent(std::shared_ptr<UIEvent> event);
private:
NickResolver* nickResolver_;
@@ -92,7 +92,7 @@ namespace Swift {
bool isInMUC_;
bool lastWasPresence_;
std::string lastStatusChangeString_;
- std::map<boost::shared_ptr<Stanza>, std::string> unackedStanzas_;
+ std::map<std::shared_ptr<Stanza>, std::string> unackedStanzas_;
std::map<std::string, std::string> 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 <Swift/Controllers/Chat/ChatControllerBase.h>
#include <map>
+#include <memory>
#include <sstream>
#include <boost/algorithm/string.hpp>
#include <boost/bind.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Avatars/AvatarManager.h>
#include <Swiften/Base/Path.h>
@@ -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> 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> 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<DiscoInfo> info) {
+void ChatControllerBase::setAvailableServerFeatures(std::shared_ptr<DiscoInfo> 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<DiscoInfo>
void ChatControllerBase::handleAllMessagesRead() {
if (!unreadMessages_.empty()) {
targetedUnreadMessages_.clear();
- foreach (boost::shared_ptr<StanzaEvent> stanzaEvent, unreadMessages_) {
+ foreach (std::shared_ptr<StanzaEvent> 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> message(new Message());
+ std::shared_ptr<Message> 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<Delay>(now, selfJID_));
+ message->addPayload(std::make_shared<Delay>(now, selfJID_));
}
if (isCorrectionMessage) {
- message->addPayload(boost::shared_ptr<Replace> (new Replace(lastSentMessageStanzaID_)));
+ message->addPayload(std::shared_ptr<Replace> (new Replace(lastSentMessageStanzaID_)));
}
message->setID(lastSentMessageStanzaID_ = idGenerator_.generateID());
stanzaChannel_->sendMessage(message);
- postSendMessage(message->getBody().get(), boost::dynamic_pointer_cast<Stanza>(message));
+ postSendMessage(message->getBody().get(), std::dynamic_pointer_cast<Stanza>(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<SecurityLabelsCatalog> catalog, ErrorPayload::ref error) {
+void ChatControllerBase::handleSecurityLabelsCatalogResponse(std::shared_ptr<SecurityLabelsCatalog> 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<ChatWindow::ChatMessagePart> part, chatMessage.getParts()) {
- boost::shared_ptr<ChatWindow::ChatHighlightingMessagePart> highlightMessage = boost::dynamic_pointer_cast<ChatWindow::ChatHighlightingMessagePart>(part);
+ foreach(std::shared_ptr<ChatWindow::ChatMessagePart> part, chatMessage.getParts()) {
+ std::shared_ptr<ChatWindow::ChatHighlightingMessagePart> highlightMessage = std::dynamic_pointer_cast<ChatWindow::ChatHighlightingMessagePart>(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<SecurityLabel> 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<SecurityLabel> 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> messageEvent) {
+void ChatControllerBase::handleIncomingMessage(std::shared_ptr<MessageEvent> messageEvent) {
preHandleIncomingMessage(messageEvent);
if (messageEvent->isReadable() && !messageEvent->getConcluded()) {
unreadMessages_.push_back(messageEvent);
@@ -268,7 +267,7 @@ void ChatControllerBase::handleIncomingMessage(boost::shared_ptr<MessageEvent> m
}
}
- boost::shared_ptr<Message> message = messageEvent->getStanza();
+ std::shared_ptr<Message> message = messageEvent->getStanza();
ChatWindow::ChatMessage chatMessage;
boost::optional<std::string> optionalBody = message->getBody();
std::string body = optionalBody.get_value_or("");
@@ -292,7 +291,7 @@ void ChatControllerBase::handleIncomingMessage(boost::shared_ptr<MessageEvent> m
}
showChatWindow();
JID from = message->getFrom();
- std::vector<boost::shared_ptr<Delay> > delayPayloads = message->getPayloads<Delay>();
+ std::vector<std::shared_ptr<Delay> > delayPayloads = message->getPayloads<Delay>();
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<MessageEvent> 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<SecurityLabel> label = message->getPayload<SecurityLabel>();
+ std::shared_ptr<SecurityLabel> label = message->getPayload<SecurityLabel>();
// 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<MessageEvent> m
fullMessageHighlight = highlighter_->findFirstFullMessageMatchAction(body, senderHighlightNameFromMessage(from));
}
- boost::shared_ptr<Replace> replace = message->getPayload<Replace>();
+ std::shared_ptr<Replace> replace = message->getPayload<Replace>();
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<MessageEvent> m
postHandleIncomingMessage(messageEvent, chatMessage);
}
-void ChatControllerBase::addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, boost::shared_ptr<SecurityLabel> label, const boost::posix_time::ptime& timeStamp) {
+void ChatControllerBase::addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, std::shared_ptr<SecurityLabel> 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<ErrorPayload> error) {
+std::string ChatControllerBase::getErrorMessage(std::shared_ptr<ErrorPayload> 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<MUCInvitationPayload>();
if (autoAcceptMUCInviteDecider_->isAutoAcceptedInvite(message->getFrom(), invite)) {
- eventStream_->send(boost::make_shared<JoinMUCUIEvent>(invite->getJID(), boost::optional<std::string>(), boost::optional<std::string>(), false, false, true));
+ eventStream_->send(std::make_shared<JoinMUCUIEvent>(invite->getJID(), boost::optional<std::string>(), boost::optional<std::string>(), false, false, true));
} else {
- MUCInviteEvent::ref inviteEvent = boost::make_shared<MUCInviteEvent>(toJID_, invite->getJID(), invite->getReason(), invite->getPassword(), true, invite->getIsImpromptu());
+ MUCInviteEvent::ref inviteEvent = std::make_shared<MUCInviteEvent>(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<MUCUserPayload>()->getPassword();
}
- MUCInviteEvent::ref inviteEvent = boost::make_shared<MUCInviteEvent>(invite.from, from, reason, password, false, false);
+ MUCInviteEvent::ref inviteEvent = std::make_shared<MUCInviteEvent>(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 <map>
+#include <memory>
#include <string>
#include <vector>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/IDGenerator.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -53,9 +53,9 @@ namespace Swift {
void showChatWindow();
void activateChatWindow();
bool hasOpenWindow() const;
- virtual void setAvailableServerFeatures(boost::shared_ptr<DiscoInfo> info);
- void handleIncomingMessage(boost::shared_ptr<MessageEvent> message);
- std::string addMessage(const ChatWindow::ChatMessage& chatMessage, const std::string& senderName, bool senderIsSelf, boost::shared_ptr<SecurityLabel> label, const boost::filesystem::path& avatarPath, const boost::posix_time::ptime& time);
+ virtual void setAvailableServerFeatures(std::shared_ptr<DiscoInfo> info);
+ void handleIncomingMessage(std::shared_ptr<MessageEvent> message);
+ std::string addMessage(const ChatWindow::ChatMessage& chatMessage, const std::string& senderName, bool senderIsSelf, std::shared_ptr<SecurityLabel> 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<void(ChatWindow* /*window to reuse*/, const std::vector<JID>& /*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> 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> chatMessageParser, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider);
/**
* Pass the Message appended, and the stanza used to send it.
*/
- virtual void postSendMessage(const std::string&, boost::shared_ptr<Stanza>) {}
+ virtual void postSendMessage(const std::string&, std::shared_ptr<Stanza>) {}
virtual std::string senderDisplayNameFromMessage(const JID& from) = 0;
virtual std::string senderHighlightNameFromMessage(const JID& from) = 0;
- virtual bool isIncomingMessageFromMe(boost::shared_ptr<Message>) = 0;
- virtual void preHandleIncomingMessage(boost::shared_ptr<MessageEvent>) {}
- virtual void addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, boost::shared_ptr<SecurityLabel> label, const boost::posix_time::ptime& time);
- virtual void postHandleIncomingMessage(boost::shared_ptr<MessageEvent>, const ChatWindow::ChatMessage&) {}
- virtual void preSendMessageRequest(boost::shared_ptr<Message>) {}
+ virtual bool isIncomingMessageFromMe(std::shared_ptr<Message>) = 0;
+ virtual void preHandleIncomingMessage(std::shared_ptr<MessageEvent>) {}
+ virtual void addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, std::shared_ptr<SecurityLabel> label, const boost::posix_time::ptime& time);
+ virtual void postHandleIncomingMessage(std::shared_ptr<MessageEvent>, const ChatWindow::ChatMessage&) {}
+ virtual void preSendMessageRequest(std::shared_ptr<Message>) {}
virtual bool isFromContact(const JID& from);
- virtual boost::optional<boost::posix_time::ptime> getMessageTimestamp(boost::shared_ptr<Message>) const = 0;
+ virtual boost::optional<boost::posix_time::ptime> getMessageTimestamp(std::shared_ptr<Message>) const = 0;
virtual void dayTicked() {}
virtual void handleBareJIDCapsChanged(const JID& jid) = 0;
- std::string getErrorMessage(boost::shared_ptr<ErrorPayload>);
+ std::string getErrorMessage(std::shared_ptr<ErrorPayload>);
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<SecurityLabelsCatalog>, ErrorPayload::ref error);
+ void handleSecurityLabelsCatalogResponse(std::shared_ptr<SecurityLabelsCatalog>, 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<boost::shared_ptr<StanzaEvent> > unreadMessages_;
- std::vector<boost::shared_ptr<StanzaEvent> > targetedUnreadMessages_;
+ std::vector<std::shared_ptr<StanzaEvent> > unreadMessages_;
+ std::vector<std::shared_ptr<StanzaEvent> > targetedUnreadMessages_;
StanzaChannel* stanzaChannel_;
IQRouter* iqRouter_;
ChatWindowFactory* chatWindowFactory_;
@@ -127,14 +127,14 @@ namespace Swift {
AvatarManager* avatarManager_;
bool useDelayForLatency_;
EventController* eventController_;
- boost::shared_ptr<Timer> dateChangeTimer_;
+ std::shared_ptr<Timer> dateChangeTimer_;
TimerFactory* timerFactory_;
EntityCapsProvider* entityCapsProvider_;
SecurityLabelsCatalog::Item lastLabel_;
HistoryController* historyController_;
MUCRegistry* mucRegistry_;
Highlighter* highlighter_;
- boost::shared_ptr<ChatMessageParser> chatMessageParser_;
+ std::shared_ptr<ChatMessageParser> 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 <Swift/Controllers/Chat/ChatMessageParser.h>
+#include <memory>
#include <utility>
#include <vector>
#include <boost/algorithm/string.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Regex.h>
#include <Swiften/Base/foreach.h>
@@ -42,10 +42,10 @@ namespace Swift {
else {
if (i == links.second) {
found = true;
- parsedMessage.append(boost::make_shared<ChatWindow::ChatURIMessagePart>(part));
+ parsedMessage.append(std::make_shared<ChatWindow::ChatURIMessagePart>(part));
}
else {
- parsedMessage.append(boost::make_shared<ChatWindow::ChatTextMessagePart>(part));
+ parsedMessage.append(std::make_shared<ChatWindow::ChatTextMessagePart>(part));
}
}
}
@@ -85,9 +85,9 @@ namespace Swift {
boost::regex emoticonRegex(regexString);
ChatWindow::ChatMessage newMessage;
- foreach (boost::shared_ptr<ChatWindow::ChatMessagePart> part, parsedMessage.getParts()) {
- boost::shared_ptr<ChatWindow::ChatTextMessagePart> textPart;
- if ((textPart = boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(part))) {
+ foreach (std::shared_ptr<ChatWindow::ChatMessagePart> part, parsedMessage.getParts()) {
+ std::shared_ptr<ChatWindow::ChatTextMessagePart> textPart;
+ if ((textPart = std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(part))) {
try {
boost::match_results<std::string::const_iterator> 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<ChatWindow::ChatTextMessagePart>(std::string(start, matchStart)));
+ newMessage.append(std::make_shared<ChatWindow::ChatTextMessagePart>(std::string(start, matchStart)));
}
- boost::shared_ptr<ChatWindow::ChatEmoticonMessagePart> emoticonPart = boost::make_shared<ChatWindow::ChatEmoticonMessagePart>();
+ std::shared_ptr<ChatWindow::ChatEmoticonMessagePart> emoticonPart = std::make_shared<ChatWindow::ChatEmoticonMessagePart>();
std::string matchString = match[matchIndex].str();
std::map<std::string, std::string>::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<ChatWindow::ChatTextMessagePart>(std::string(start, text.end())));
+ newMessage.append(std::make_shared<ChatWindow::ChatTextMessagePart>(std::string(start, text.end())));
}
}
@@ -153,9 +153,9 @@ namespace Swift {
const std::vector<boost::regex> keywordRegex = rule.getKeywordRegex(nick);
foreach(const boost::regex& regex, keywordRegex) {
ChatWindow::ChatMessage newMessage;
- foreach (boost::shared_ptr<ChatWindow::ChatMessagePart> part, parsedMessage.getParts()) {
- boost::shared_ptr<ChatWindow::ChatTextMessagePart> textPart;
- if ((textPart = boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(part))) {
+ foreach (std::shared_ptr<ChatWindow::ChatMessagePart> part, parsedMessage.getParts()) {
+ std::shared_ptr<ChatWindow::ChatTextMessagePart> textPart;
+ if ((textPart = std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(part))) {
try {
boost::match_results<std::string::const_iterator> 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<ChatWindow::ChatTextMessagePart>(std::string(start, matchStart)));
+ newMessage.append(std::make_shared<ChatWindow::ChatTextMessagePart>(std::string(start, matchStart)));
}
- boost::shared_ptr<ChatWindow::ChatHighlightingMessagePart> highlightPart = boost::make_shared<ChatWindow::ChatHighlightingMessagePart>();
+ std::shared_ptr<ChatWindow::ChatHighlightingMessagePart> highlightPart = std::make_shared<ChatWindow::ChatHighlightingMessagePart>();
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<ChatWindow::ChatTextMessagePart>(std::string(start, text.end())));
+ newMessage.append(std::make_shared<ChatWindow::ChatTextMessagePart>(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 <Swift/Controllers/Chat/ChatsManager.h>
+#include <memory>
+
#include <boost/algorithm/string.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
@@ -15,7 +17,6 @@
#include <boost/serialization/split_free.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/vector.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Avatars/AvatarManager.h>
#include <Swiften/Base/Log.h>
@@ -155,7 +156,7 @@ ChatsManager::ChatsManager(
nickResolver_ = nickResolver;
presenceOracle_ = presenceOracle;
avatarManager_ = nullptr;
- serverDiscoInfo_ = boost::make_shared<DiscoInfo>();
+ serverDiscoInfo_ = std::make_shared<DiscoInfo>();
presenceSender_ = presenceSender;
uiEventStream_ = uiEventStream;
mucBookmarkManager_ = nullptr;
@@ -544,24 +545,24 @@ void ChatsManager::finalizeImpromptuJoin(MUC::ref muc, const std::vector<JID>& j
}
}
-void ChatsManager::handleUIEvent(boost::shared_ptr<UIEvent> event) {
- boost::shared_ptr<RequestChatUIEvent> chatEvent = boost::dynamic_pointer_cast<RequestChatUIEvent>(event);
+void ChatsManager::handleUIEvent(std::shared_ptr<UIEvent> event) {
+ std::shared_ptr<RequestChatUIEvent> chatEvent = std::dynamic_pointer_cast<RequestChatUIEvent>(event);
if (chatEvent) {
handleChatRequest(chatEvent->getContact());
return;
}
- boost::shared_ptr<RemoveMUCBookmarkUIEvent> removeMUCBookmarkEvent = boost::dynamic_pointer_cast<RemoveMUCBookmarkUIEvent>(event);
+ std::shared_ptr<RemoveMUCBookmarkUIEvent> removeMUCBookmarkEvent = std::dynamic_pointer_cast<RemoveMUCBookmarkUIEvent>(event);
if (removeMUCBookmarkEvent) {
mucBookmarkManager_->removeBookmark(removeMUCBookmarkEvent->getBookmark());
return;
}
- boost::shared_ptr<AddMUCBookmarkUIEvent> addMUCBookmarkEvent = boost::dynamic_pointer_cast<AddMUCBookmarkUIEvent>(event);
+ std::shared_ptr<AddMUCBookmarkUIEvent> addMUCBookmarkEvent = std::dynamic_pointer_cast<AddMUCBookmarkUIEvent>(event);
if (addMUCBookmarkEvent) {
mucBookmarkManager_->addBookmark(addMUCBookmarkEvent->getBookmark());
return;
}
- boost::shared_ptr<CreateImpromptuMUCUIEvent> createImpromptuMUCEvent = boost::dynamic_pointer_cast<CreateImpromptuMUCUIEvent>(event);
+ std::shared_ptr<CreateImpromptuMUCUIEvent> createImpromptuMUCEvent = std::dynamic_pointer_cast<CreateImpromptuMUCUIEvent>(event);
if (createImpromptuMUCEvent) {
assert(!localMUCServiceJID_.toString().empty());
// create new muc
@@ -573,15 +574,15 @@ void ChatsManager::handleUIEvent(boost::shared_ptr<UIEvent> event) {
mucControllers_[roomJID]->activateChatWindow();
}
- boost::shared_ptr<EditMUCBookmarkUIEvent> editMUCBookmarkEvent = boost::dynamic_pointer_cast<EditMUCBookmarkUIEvent>(event);
+ std::shared_ptr<EditMUCBookmarkUIEvent> editMUCBookmarkEvent = std::dynamic_pointer_cast<EditMUCBookmarkUIEvent>(event);
if (editMUCBookmarkEvent) {
mucBookmarkManager_->replaceBookmark(editMUCBookmarkEvent->getOldBookmark(), editMUCBookmarkEvent->getNewBookmark());
}
- else if (JoinMUCUIEvent::ref joinEvent = boost::dynamic_pointer_cast<JoinMUCUIEvent>(event)) {
+ else if (JoinMUCUIEvent::ref joinEvent = std::dynamic_pointer_cast<JoinMUCUIEvent>(event)) {
handleJoinMUCRequest(joinEvent->getJID(), joinEvent->getPassword(), joinEvent->getNick(), joinEvent->getShouldJoinAutomatically(), joinEvent->getCreateAsReservedRoomIfNew(), joinEvent->isImpromptu());
mucControllers_[joinEvent->getJID()]->activateChatWindow();
}
- else if (boost::shared_ptr<RequestJoinMUCUIEvent> joinEvent = boost::dynamic_pointer_cast<RequestJoinMUCUIEvent>(event)) {
+ else if (std::shared_ptr<RequestJoinMUCUIEvent> joinEvent = std::dynamic_pointer_cast<RequestJoinMUCUIEvent>(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<Presence> newPresence) {
+void ChatsManager::handlePresenceChange(std::shared_ptr<Presence> 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<DiscoInfo> info) {
+void ChatsManager::setServerDiscoInfo(std::shared_ptr<DiscoInfo> 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<DiscoServiceWalker>(jid_.getDomain(), iqRouter_);
+ localMUCServiceFinderWalker_ = std::make_shared<DiscoServiceWalker>(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> chatMessageParser = boost::make_shared<ChatMessageParser>(emoticons_, highlightManager_->getRules(), false); /* a message parser that knows this is a chat (not a room/MUC) */
+ std::shared_ptr<ChatMessageParser> chatMessageParser = std::make_shared<ChatMessageParser>(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> chatMessageParser = boost::make_shared<ChatMessageParser>(emoticons_, highlightManager_->getRules(), true); /* a message parser that knows this is a room/MUC (not a chat) */
+ std::shared_ptr<ChatMessageParser> chatMessageParser = std::make_shared<ChatMessageParser>(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> message) {
+void ChatsManager::handleIncomingMessage(std::shared_ptr<Message> message) {
JID jid = message->getFrom();
- boost::shared_ptr<MessageEvent> event(new MessageEvent(message));
+ std::shared_ptr<MessageEvent> event(new MessageEvent(message));
bool isInvite = !!message->getPayload<MUCInvitationPayload>();
bool isMediatedInvite = (message->getPayload<MUCUserPayload>() && message->getPayload<MUCUserPayload>()->getInvite());
if (isMediatedInvite) {
@@ -937,7 +938,7 @@ void ChatsManager::handleMUCSelectedAfterSearch(const JID& muc) {
}
void ChatsManager::handleMUCBookmarkActivated(const MUCBookmark& mucBookmark) {
- uiEventStream_->send(boost::make_shared<JoinMUCUIEvent>(mucBookmark.getRoom(), mucBookmark.getPassword(), mucBookmark.getNick()));
+ uiEventStream_->send(std::make_shared<JoinMUCUIEvent>(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<IncomingFileTransferEvent>(ftc->getOtherParty()));
+ eventController_->handleIncomingEvent(std::make_shared<IncomingFileTransferEvent>(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<CreateImpromptuMUCUIEvent>(inviteJIDs, chat.jid, ""));
+ uiEventStream_->send(std::make_shared<CreateImpromptuMUCUIEvent>(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<JoinMUCUIEvent>(chat.jid, boost::optional<std::string>(), chat.nick));
+ uiEventStream_->send(std::make_shared<JoinMUCUIEvent>(chat.jid, boost::optional<std::string>(), chat.nick));
}
else {
- uiEventStream_->send(boost::make_shared<RequestChatUIEvent>(chat.jid));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(chat.jid));
}
}
-void ChatsManager::handleLocalServiceFound(const JID& service, boost::shared_ptr<DiscoInfo> info) {
+void ChatsManager::handleLocalServiceFound(const JID& service, std::shared_ptr<DiscoInfo> info) {
foreach (DiscoInfo::Identity identity, info->getIdentities()) {
if ((identity.getCategory() == "directory"
&& identity.getType() == "chatroom")
@@ -1023,7 +1024,7 @@ std::vector<Contact::ref> Swift::ChatsManager::getContacts(bool withMUCNicks) {
std::vector<Contact::ref> result;
foreach (ChatListWindow::Chat chat, recentChats_) {
if (!chat.isMUC) {
- result.push_back(boost::make_shared<Contact>(chat.chatName.empty() ? chat.jid.toString() : chat.chatName, chat.jid, chat.statusType, chat.avatarPath));
+ result.push_back(std::make_shared<Contact>(chat.chatName.empty() ? chat.jid.toString() : chat.chatName, chat.jid, chat.statusType, chat.avatarPath));
}
}
if (withMUCNicks) {
@@ -1037,7 +1038,7 @@ std::vector<Contact::ref> 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<Contact>(participant.first, JID(), presence->getShow(), avatar));
+ result.push_back(std::make_shared<Contact>(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 <map>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/IDGenerator.h>
#include <Swiften/Elements/DiscoInfo.h>
#include <Swiften/Elements/Message.h>
@@ -67,8 +66,8 @@ namespace Swift {
virtual ~ChatsManager();
void setAvatarManager(AvatarManager* avatarManager);
void setOnline(bool enabled);
- void setServerDiscoInfo(boost::shared_ptr<DiscoInfo> info);
- void handleIncomingMessage(boost::shared_ptr<Message> message);
+ void setServerDiscoInfo(std::shared_ptr<DiscoInfo> info);
+ void handleIncomingMessage(std::shared_ptr<Message> message);
std::vector<ChatListWindow::Chat> getRecentChats() const;
virtual std::vector<Contact::ref> 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<Presence> newPresence);
- void handleUIEvent(boost::shared_ptr<UIEvent> event);
+ void handlePresenceChange(std::shared_ptr<Presence> newPresence);
+ void handleUIEvent(std::shared_ptr<UIEvent> 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<JID>& jidsToInvite, const std::string& reason);
- void handleLocalServiceFound(const JID& service, boost::shared_ptr<DiscoInfo> info);
+ void handleLocalServiceFound(const JID& service, std::shared_ptr<DiscoInfo> info);
void handleLocalServiceWalkFinished();
void updatePresenceReceivingStateOnChatController(const JID&);
@@ -154,7 +153,7 @@ namespace Swift {
PresenceSender* presenceSender_;
UIEventStream* uiEventStream_;
MUCBookmarkManager* mucBookmarkManager_;
- boost::shared_ptr<DiscoInfo> serverDiscoInfo_;
+ std::shared_ptr<DiscoInfo> serverDiscoInfo_;
ChatListWindow* chatListWindow_;
JoinMUCWindow* joinMUCWindow_;
boost::bsignals::scoped_connection uiEventConnection_;
@@ -177,7 +176,7 @@ namespace Swift {
std::map<std::string, std::string> emoticons_;
ClientBlockListManager* clientBlockListManager_;
JID localMUCServiceJID_;
- boost::shared_ptr<DiscoServiceWalker> localMUCServiceFinderWalker_;
+ std::shared_ptr<DiscoServiceWalker> 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> chatMessageParser,
+ std::shared_ptr<ChatMessageParser> 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<Timer>(timerFactory->createTimer(MUC_JOIN_WARNING_TIMEOUT_MILLISECONDS));
+ loginCheckTimer_ = std::shared_ptr<Timer>(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<RequestAddUserDialogUIEvent>(realJID, occupant.getNick()));break;
- case ChatWindow::ShowProfile: events_->send(boost::make_shared<ShowProfileForRosterItemUIEvent>(mucJID));break;
+ case ChatWindow::AddContact: if (occupant.getRealJID()) events_->send(std::make_shared<RequestAddUserDialogUIEvent>(realJID, occupant.getNick()));break;
+ case ChatWindow::ShowProfile: events_->send(std::make_shared<ShowProfileForRosterItemUIEvent>(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<ErrorPayload> error) {
+void MUCController::handleJoinFailed(std::shared_ptr<ErrorPayload> 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> message) {
+bool MUCController::messageTargetsMe(std::shared_ptr<Message> 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> messageEvent) {
+void MUCController::preHandleIncomingMessage(std::shared_ptr<MessageEvent> messageEvent) {
if (messageEvent->getStanza()->getType() == Message::Groupchat) {
lastActivity_ = boost::posix_time::microsec_clock::universal_time();
}
clearPresenceQueue();
- boost::shared_ptr<Message> message = messageEvent->getStanza();
+ std::shared_ptr<Message> message = messageEvent->getStanza();
if (joined_ && messageEvent->getStanza()->getFrom().getResource() != nick_ && messageTargetsMe(message) && !message->getPayload<Delay>() && messageEvent->isReadable()) {
chatWindow_->flash();
}
@@ -576,7 +576,7 @@ void MUCController::preHandleIncomingMessage(boost::shared_ptr<MessageEvent> mes
}
}
-void MUCController::addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, boost::shared_ptr<SecurityLabel> label, const boost::posix_time::ptime& time) {
+void MUCController::addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, std::shared_ptr<SecurityLabel> 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> messageEvent, const ChatWindow::ChatMessage& chatMessage) {
- boost::shared_ptr<Message> message = messageEvent->getStanza();
+void MUCController::postHandleIncomingMessage(std::shared_ptr<MessageEvent> messageEvent, const ChatWindow::ChatMessage& chatMessage) {
+ std::shared_ptr<Message> message = messageEvent->getStanza();
if (joined_ && messageEvent->getStanza()->getFrom().getResource() != nick_ && !message->getPayload<Delay>()) {
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> blockList = clientBlockListManager_->getBlockList();
+ std::shared_ptr<BlockList> 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> presence) {
+void MUCController::handleOccupantPresenceChange(std::shared_ptr<Presence> presence) {
receivedActivity();
roster_->applyOnItems(SetPresence(presence, JID::WithResource));
}
-bool MUCController::isIncomingMessageFromMe(boost::shared_ptr<Message> message) {
+bool MUCController::isIncomingMessageFromMe(std::shared_ptr<Message> 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> message) {
+void MUCController::preSendMessageRequest(std::shared_ptr<Message> message) {
message->setType(Swift::Message::Groupchat);
}
-boost::optional<boost::posix_time::ptime> MUCController::getMessageTimestamp(boost::shared_ptr<Message> message) const {
+boost::optional<boost::posix_time::ptime> MUCController::getMessageTimestamp(std::shared_ptr<Message> message) const {
return message->getTimestampFrom(toJID_);
}
@@ -994,12 +994,12 @@ void MUCController::handleDestroyRoomRequest() {
void MUCController::handleInvitePersonToThisMUCRequest(const std::vector<JID>& jidsToInvite) {
RequestInviteToMUCUIEvent::ImpromptuMode mode = isImpromptu_ ? RequestInviteToMUCUIEvent::Impromptu : RequestInviteToMUCUIEvent::NotImpromptu;
- boost::shared_ptr<UIEvent> event(new RequestInviteToMUCUIEvent(muc_->getJID(), jidsToInvite, mode));
+ std::shared_ptr<UIEvent> event(new RequestInviteToMUCUIEvent(muc_->getJID(), jidsToInvite, mode));
eventStream_->send(event);
}
-void MUCController::handleUIEvent(boost::shared_ptr<UIEvent> event) {
- boost::shared_ptr<InviteToMUCUIEvent> inviteEvent = boost::dynamic_pointer_cast<InviteToMUCUIEvent>(event);
+void MUCController::handleUIEvent(std::shared_ptr<UIEvent> event) {
+ std::shared_ptr<InviteToMUCUIEvent> inviteEvent = std::dynamic_pointer_cast<InviteToMUCUIEvent>(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::vector<std::pair<
}
void MUCController::handleUnblockUserRequest() {
- eventStream_->send(boost::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Unblocked, muc_->getJID()));
+ eventStream_->send(std::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Unblocked, muc_->getJID()));
}
void MUCController::handleBlockingStateChanged() {
- boost::shared_ptr<BlockList> blockList = clientBlockListManager_->getBlockList();
+ std::shared_ptr<BlockList> 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<SecurityLabel>(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<SecurityLabel>(), avatarManager_->getAvatarPath(message.getFromJID()), message.getTime() - boost::posix_time::hours(message.getOffset()));
}
}
-void MUCController::checkDuplicates(boost::shared_ptr<Message> newMessage) {
+void MUCController::checkDuplicates(std::shared_ptr<Message> newMessage) {
std::string body = newMessage->getBody().get_value_or("");
JID jid = newMessage->getFrom();
boost::optional<boost::posix_time::ptime> 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>(Form::SubmitType);
+ Form::ref result = std::make_shared<Form>(Form::SubmitType);
std::string impromptuConfigs[] = { "muc#roomconfig_enablelogging", "muc#roomconfig_persistentroom", "muc#roomconfig_publicroom", "muc#roomconfig_whois"};
std::set<std::string> impromptuConfigsMissing(impromptuConfigs, impromptuConfigs + 4);
- foreach (boost::shared_ptr<FormField> field, roomConfigurationForm->getFields()) {
- boost::shared_ptr<FormField> resultField;
+ foreach (std::shared_ptr<FormField> field, roomConfigurationForm->getFields()) {
+ std::shared_ptr<FormField> resultField;
if (field->getName() == "muc#roomconfig_enablelogging") {
- resultField = boost::make_shared<FormField>(FormField::BooleanType, "0");
+ resultField = std::make_shared<FormField>(FormField::BooleanType, "0");
}
if (field->getName() == "muc#roomconfig_persistentroom") {
- resultField = boost::make_shared<FormField>(FormField::BooleanType, "0");
+ resultField = std::make_shared<FormField>(FormField::BooleanType, "0");
}
if (field->getName() == "muc#roomconfig_publicroom") {
- resultField = boost::make_shared<FormField>(FormField::BooleanType, "0");
+ resultField = std::make_shared<FormField>(FormField::BooleanType, "0");
}
if (field->getName() == "muc#roomconfig_whois") {
- resultField = boost::make_shared<FormField>(FormField::ListSingleType, "anyone");
+ resultField = std::make_shared<FormField>(FormField::ListSingleType, "anyone");
}
if (field->getName() == "FORM_TYPE") {
- resultField = boost::make_shared<FormField>(FormField::HiddenType, "http://jabber.org/protocol/muc#roomconfig");
+ resultField = std::make_shared<FormField>(FormField::HiddenType, "http://jabber.org/protocol/muc#roomconfig");
}
if (resultField) {
@@ -1177,10 +1177,10 @@ void MUCController::handleRoomUnlocked() {
}
}
-void MUCController::setAvailableServerFeatures(boost::shared_ptr<DiscoInfo> info) {
+void MUCController::setAvailableServerFeatures(std::shared_ptr<DiscoInfo> info) {
ChatControllerBase::setAvailableServerFeatures(info);
if (iqRouter_->isAvailable() && info->hasFeature(DiscoInfo::BlockingCommandFeature)) {
- boost::shared_ptr<BlockList> blockList = clientBlockListManager_->getBlockList();
+ std::shared_ptr<BlockList> 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 <map>
+#include <memory>
#include <set>
#include <string>
-#include <boost/shared_ptr.hpp>
#include <boost/signals/connection.hpp>
#include <Swiften/Base/Override.h>
@@ -54,14 +54,14 @@ namespace Swift {
class MUCController : public ChatControllerBase {
public:
- MUCController(const JID& self, MUC::ref muc, const boost::optional<std::string>& 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> chatMessageParser, bool isImpromptu, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider, VCardManager* vcardManager, MUCBookmarkManager* mucBookmarkManager);
+ MUCController(const JID& self, MUC::ref muc, const boost::optional<std::string>& 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> chatMessageParser, bool isImpromptu, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider, VCardManager* vcardManager, MUCBookmarkManager* mucBookmarkManager);
virtual ~MUCController();
boost::signal<void ()> onUserLeft;
boost::signal<void ()> onUserJoined;
boost::signal<void ()> onImpromptuConfigCompleted;
boost::signal<void (const std::string&, const std::string& )> onUserNicknameChanged;
virtual void setOnline(bool online) SWIFTEN_OVERRIDE;
- virtual void setAvailableServerFeatures(boost::shared_ptr<DiscoInfo> info) SWIFTEN_OVERRIDE;
+ virtual void setAvailableServerFeatures(std::shared_ptr<DiscoInfo> info) SWIFTEN_OVERRIDE;
void rejoin();
static void appendToJoinParts(std::vector<NickJoinPart>& joinParts, const NickJoinPart& newEvent);
static std::string generateJoinPartString(const std::vector<NickJoinPart>& joinParts, bool isImpromptu);
@@ -75,14 +75,14 @@ namespace Swift {
void sendInvites(const std::vector<JID>& jids, const std::string& reason) const;
protected:
- virtual void preSendMessageRequest(boost::shared_ptr<Message> message) SWIFTEN_OVERRIDE;
- virtual bool isIncomingMessageFromMe(boost::shared_ptr<Message> message) SWIFTEN_OVERRIDE;
+ virtual void preSendMessageRequest(std::shared_ptr<Message> message) SWIFTEN_OVERRIDE;
+ virtual bool isIncomingMessageFromMe(std::shared_ptr<Message> message) SWIFTEN_OVERRIDE;
virtual std::string senderHighlightNameFromMessage(const JID& from) SWIFTEN_OVERRIDE;
virtual std::string senderDisplayNameFromMessage(const JID& from) SWIFTEN_OVERRIDE;
- virtual boost::optional<boost::posix_time::ptime> getMessageTimestamp(boost::shared_ptr<Message> message) const SWIFTEN_OVERRIDE;
- virtual void preHandleIncomingMessage(boost::shared_ptr<MessageEvent>) SWIFTEN_OVERRIDE;
- virtual void addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, boost::shared_ptr<SecurityLabel> label, const boost::posix_time::ptime& time) SWIFTEN_OVERRIDE;
- virtual void postHandleIncomingMessage(boost::shared_ptr<MessageEvent>, const ChatWindow::ChatMessage& chatMessage) SWIFTEN_OVERRIDE;
+ virtual boost::optional<boost::posix_time::ptime> getMessageTimestamp(std::shared_ptr<Message> message) const SWIFTEN_OVERRIDE;
+ virtual void preHandleIncomingMessage(std::shared_ptr<MessageEvent>) SWIFTEN_OVERRIDE;
+ virtual void addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, std::shared_ptr<SecurityLabel> label, const boost::posix_time::ptime& time) SWIFTEN_OVERRIDE;
+ virtual void postHandleIncomingMessage(std::shared_ptr<MessageEvent>, 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> presence);
+ void handleOccupantPresenceChange(std::shared_ptr<Presence> 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<ErrorPayload> error);
+ void handleJoinFailed(std::shared_ptr<ErrorPayload> 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> message);
+ bool messageTargetsMe(std::shared_ptr<Message> message);
void updateJoinParts();
bool shouldUpdateJoinParts();
virtual void dayTicked() SWIFTEN_OVERRIDE { clearPresenceQueue(); }
@@ -128,9 +128,9 @@ namespace Swift {
void handleChangeAffiliationsRequest(const std::vector<std::pair<MUCOccupant::Affiliation, JID> >& changes);
void handleInviteToMUCWindowDismissed();
void handleInviteToMUCWindowCompleted();
- void handleUIEvent(boost::shared_ptr<UIEvent> event);
+ void handleUIEvent(std::shared_ptr<UIEvent> event);
void addRecentLogs();
- void checkDuplicates(boost::shared_ptr<Message> newMessage);
+ void checkDuplicates(std::shared_ptr<Message> 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<Timer> loginCheckTimer_;
+ std::shared_ptr<Timer> loginCheckTimer_;
std::set<std::string> currentOccupants_;
std::vector<NickJoinPart> 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 <Swift/Controllers/Chat/MUCSearchController.h>
#include <iostream>
+#include <memory>
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/Log.h>
#include <Swiften/Base/String.h>
@@ -101,7 +101,7 @@ void MUCSearchController::handleSearchService(const JID& jid) {
walker_->beginWalk();
}
-void MUCSearchController::handleDiscoServiceFound(const JID& jid, boost::shared_ptr<DiscoInfo> info) {
+void MUCSearchController::handleDiscoServiceFound(const JID& jid, std::shared_ptr<DiscoInfo> 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<DiscoItems> items, ErrorPayload::ref error, const JID& jid) {
+void MUCSearchController::handleRoomsItemsResponse(std::shared_ptr<DiscoItems> 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 <map>
+#include <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/DiscoInfo.h>
#include <Swiften/Elements/DiscoItems.h>
@@ -97,9 +96,9 @@ namespace Swift {
private:
void handleSearchService(const JID& jid);
- void handleRoomsItemsResponse(boost::shared_ptr<DiscoItems> items, ErrorPayload::ref error, const JID& jid);
+ void handleRoomsItemsResponse(std::shared_ptr<DiscoItems> items, ErrorPayload::ref error, const JID& jid);
void handleDiscoError(const JID& jid, ErrorPayload::ref error);
- void handleDiscoServiceFound(const JID&, boost::shared_ptr<DiscoInfo>);
+ void handleDiscoServiceFound(const JID&, std::shared_ptr<DiscoInfo>);
void handleDiscoWalkFinished();
void handleMUCSearchFinished(const boost::optional<JID>& 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<ChatWindow::ChatTextMessagePart> part = boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(result.getParts()[index]);
+ std::shared_ptr<ChatWindow::ChatTextMessagePart> part = std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(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<ChatWindow::ChatEmoticonMessagePart> part = boost::dynamic_pointer_cast<ChatWindow::ChatEmoticonMessagePart>(result.getParts()[index]);
+ std::shared_ptr<ChatWindow::ChatEmoticonMessagePart> part = std::dynamic_pointer_cast<ChatWindow::ChatEmoticonMessagePart>(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<ChatWindow::ChatHighlightingMessagePart> part = boost::dynamic_pointer_cast<ChatWindow::ChatHighlightingMessagePart>(RESULT.getParts()[INDEX]); \
+ std::shared_ptr<ChatWindow::ChatHighlightingMessagePart> part = std::dynamic_pointer_cast<ChatWindow::ChatHighlightingMessagePart>(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<ChatWindow::ChatURIMessagePart> part = boost::dynamic_pointer_cast<ChatWindow::ChatURIMessagePart>(result.getParts()[index]);
+ std::shared_ptr<ChatWindow::ChatURIMessagePart> part = std::dynamic_pointer_cast<ChatWindow::ChatURIMessagePart>(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<HighlightManager::HighlightRulesList> list = boost::make_shared<HighlightManager::HighlightRulesList>();
+ std::shared_ptr<HighlightManager::HighlightRulesList> list = std::make_shared<HighlightManager::HighlightRulesList>();
list->addRule(ruleFromKeyword(keyword, matchCase, matchWholeWord));
return list;
}
static const HighlightRulesListPtr ruleListFromKeywords(const HighlightRule &rule1, const HighlightRule &rule2)
{
- boost::shared_ptr<HighlightManager::HighlightRulesList> list = boost::make_shared<HighlightManager::HighlightRulesList>();
+ std::shared_ptr<HighlightManager::HighlightRulesList> list = std::make_shared<HighlightManager::HighlightRulesList>();
list->addRule(rule1);
list->addRule(rule2);
return list;
@@ -99,14 +99,14 @@ public:
if (withHighlightColour) {
rule.getAction().setTextBackground("white");
}
- boost::shared_ptr<HighlightManager::HighlightRulesList> list = boost::make_shared<HighlightManager::HighlightRulesList>();
+ std::shared_ptr<HighlightManager::HighlightRulesList> list = std::make_shared<HighlightManager::HighlightRulesList>();
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<HighlightManager::HighlightRulesList>());
+ ChatMessageParser testling(emoticons_, std::make_shared<HighlightManager::HighlightRulesList>());
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<HighlightManager::HighlightRulesList>());
+ ChatMessageParser testling(emoticons_, std::make_shared<HighlightManager::HighlightRulesList>());
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<HighlightManager::HighlightRulesList>());
+ ChatMessageParser testling(emoticons_, std::make_shared<HighlightManager::HighlightRulesList>());
ChatWindow::ChatMessage result = testling.parseMessageBody(":)");
assertEmoticon(result, 0, smile1_, smile1Path_);
}
void testHiddenEmoticon() {
- ChatMessageParser testling(emoticons_, boost::make_shared<HighlightManager::HighlightRulesList>());
+ ChatMessageParser testling(emoticons_, std::make_shared<HighlightManager::HighlightRulesList>());
ChatWindow::ChatMessage result = testling.parseMessageBody("b:)a");
assertText(result, 0, "b:)a");
}
void testEndlineEmoticon() {
- ChatMessageParser testling(emoticons_, boost::make_shared<HighlightManager::HighlightRulesList>());
+ ChatMessageParser testling(emoticons_, std::make_shared<HighlightManager::HighlightRulesList>());
ChatWindow::ChatMessage result = testling.parseMessageBody("Lazy:)");
assertText(result, 0, "Lazy");
assertEmoticon(result, 1, smile1_, smile1Path_);
}
void testBoundedEmoticons() {
- ChatMessageParser testling(emoticons_, boost::make_shared<HighlightManager::HighlightRulesList>());
+ ChatMessageParser testling(emoticons_, std::make_shared<HighlightManager::HighlightRulesList>());
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<HighlightManager::HighlightRulesList>());
+ ChatMessageParser testling(emoticons_, std::make_shared<HighlightManager::HighlightRulesList>());
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<DiscoInfo>();
+ serverDiscoInfo_ = std::make_shared<DiscoInfo>();
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> message(new Message());
+ std::shared_ptr<Message> 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<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID1, uiEventStream_).Return(window1);
- boost::shared_ptr<Message> message1(new Message());
+ std::shared_ptr<Message> 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<ChatWindow>();
//mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID2, uiEventStream_).Return(window2);
- boost::shared_ptr<Message> message2(new Message());
+ std::shared_ptr<Message> 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<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString), uiEventStream_).Return(window);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(messageJIDString))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(messageJIDString)));
}
@@ -217,9 +217,9 @@ public:
MockChatWindow* window = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(bareJIDString), uiEventStream_).Return(window);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(bareJIDString))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(bareJIDString)));
- boost::shared_ptr<Message> message(new Message());
+ std::shared_ptr<Message> 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<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString1), uiEventStream_).Return(window1);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(messageJIDString1))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(messageJIDString1)));
std::string messageJIDString2("testling2@test.com");
ChatWindow* window2 = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString2), uiEventStream_).Return(window2);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(messageJIDString2))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(messageJIDString2)));
}
/** Complete cycle.
@@ -253,23 +253,23 @@ public:
MockChatWindow* window = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(bareJIDString), uiEventStream_).Return(window);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(bareJIDString))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(bareJIDString)));
- boost::shared_ptr<Message> message1(new Message());
+ std::shared_ptr<Message> 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<Presence> jid1Online(new Presence());
+ std::shared_ptr<Presence> jid1Online(new Presence());
jid1Online->setFrom(JID(fullJIDString1));
- boost::shared_ptr<Presence> jid1Offline(new Presence());
+ std::shared_ptr<Presence> jid1Offline(new Presence());
jid1Offline->setFrom(JID(fullJIDString1));
jid1Offline->setType(Presence::Unavailable);
presenceOracle_->onPresenceChange(jid1Offline);
- boost::shared_ptr<Message> message2(new Message());
+ std::shared_ptr<Message> 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<JoinMUCUIEvent>(muc, std::string("nick")));
+ uiEventStream_->send(std::make_shared<JoinMUCUIEvent>(muc, std::string("nick")));
std::string messageJIDString1("testling@test.com/1");
ChatWindow* window1 = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString1), uiEventStream_).Return(window1);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(messageJIDString1))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(messageJIDString1)));
std::string messageJIDString2("testling@test.com/2");
ChatWindow* window2 = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString2), uiEventStream_).Return(window2);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(messageJIDString2))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(messageJIDString2)));
std::string messageJIDString3("testling@test.com/3");
ChatWindow* window3 = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(JID(messageJIDString3), uiEventStream_).Return(window3);
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(messageJIDString3))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(messageJIDString3)));
/* Refetch an earlier window */
/* We do not expect a new window to be created */
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(JID(messageJIDString1))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(JID(messageJIDString1)));
}
@@ -325,7 +325,7 @@ public:
MockChatWindow* window1 = new MockChatWindow();//mocks_->InterfaceMock<ChatWindow>();
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID1, uiEventStream_).Return(window1);
- boost::shared_ptr<Message> message1(new Message());
+ std::shared_ptr<Message> 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<ChatWindow>();
//mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(messageJID2, uiEventStream_).Return(window2);
- boost::shared_ptr<Message> message2(new Message());
+ std::shared_ptr<Message> message2(new Message());
message2->setFrom(messageJID2);
message2->setBody("This is a legible message2.");
manager_->handleIncomingMessage(message2);
- boost::shared_ptr<Presence> jid1Online(new Presence());
+ std::shared_ptr<Presence> jid1Online(new Presence());
jid1Online->setFrom(JID(messageJID1));
- boost::shared_ptr<Presence> jid1Offline(new Presence());
+ std::shared_ptr<Presence> jid1Offline(new Presence());
jid1Offline->setFrom(JID(messageJID1));
jid1Offline->setType(Presence::Unavailable);
presenceOracle_->onPresenceChange(jid1Offline);
- boost::shared_ptr<Presence> jid2Online(new Presence());
+ std::shared_ptr<Presence> jid2Online(new Presence());
jid2Online->setFrom(JID(messageJID2));
- boost::shared_ptr<Presence> jid2Offline(new Presence());
+ std::shared_ptr<Presence> jid2Offline(new Presence());
jid2Offline->setFrom(JID(messageJID2));
jid2Offline->setType(Presence::Unavailable);
presenceOracle_->onPresenceChange(jid2Offline);
JID messageJID3("testling@test.com/resource3");
- boost::shared_ptr<Message> message3(new Message());
+ std::shared_ptr<Message> 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<Message> message2b(new Message());
+ std::shared_ptr<Message> 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> message = makeDeliveryReceiptTestMessage(messageJID, "1");
+ std::shared_ptr<Message> message = makeDeliveryReceiptTestMessage(messageJID, "1");
manager_->handleIncomingMessage(message);
Stanza::ref stanzaContactOnRoster = stanzaChannel_->getStanzaAtIndex<Stanza>(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> message = makeDeliveryReceiptTestMessage(messageJID, "1");
+ std::shared_ptr<Message> 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<RequestChatUIEvent>(sender));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(sender));
foreach(const JID& senderJID, senderResource) {
// The sender supports delivery receipts.
- DiscoInfo::ref disco = boost::make_shared<DiscoInfo>();
+ DiscoInfo::ref disco = std::make_shared<DiscoInfo>();
disco->addFeature(DiscoInfo::MessageDeliveryReceiptsFeature);
entityCapsProvider_->caps[senderJID] = disco;
// The sender is online.
- Presence::ref senderPresence = boost::make_shared<Presence>();
+ Presence::ref senderPresence = std::make_shared<Presence>();
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>();
+ Message::ref receiptReply = std::make_shared<Message>();
receiptReply->setFrom(senderJID);
receiptReply->setTo(ownJID);
- boost::shared_ptr<DeliveryReceipt> receipt = boost::make_shared<DeliveryReceipt>();
+ std::shared_ptr<DeliveryReceipt> receipt = std::make_shared<DeliveryReceipt>();
receipt->setReceivedID(stanzaChannel_->getStanzaAtIndex<Message>(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>();
+ Message::ref receiptReply = std::make_shared<Message>();
receiptReply->setFrom(senderJID);
receiptReply->setTo(ownJID);
- boost::shared_ptr<DeliveryReceipt> receipt = boost::make_shared<DeliveryReceipt>();
+ std::shared_ptr<DeliveryReceipt> receipt = std::make_shared<DeliveryReceipt>();
receipt->setReceivedID(stanzaChannel_->getStanzaAtIndex<Message>(1)->getID());
receiptReply->addPayload(receipt);
manager_->handleIncomingMessage(receiptReply);
}
// Reply with a message including a body text.
- Message::ref reply = boost::make_shared<Message>();
+ Message::ref reply = std::make_shared<Message>();
reply->setFrom(senderResource[0]);
reply->setTo(ownJID);
reply->setBody("fine.");
@@ -517,11 +517,11 @@ public:
CPPUNIT_ASSERT(stanzaChannel_->getStanzaAtIndex<Message>(2)->getPayload<DeliveryReceiptRequest>());
// Receive random receipt from second sender resource.
- reply = boost::make_shared<Message>();
+ reply = std::make_shared<Message>();
reply->setFrom(senderResource[1]);
reply->setTo(ownJID);
- boost::shared_ptr<DeliveryReceipt> receipt = boost::make_shared<DeliveryReceipt>();
+ std::shared_ptr<DeliveryReceipt> receipt = std::make_shared<DeliveryReceipt>();
receipt->setReceivedID(stanzaChannel_->getStanzaAtIndex<Message>(2)->getID());
reply->addPayload(receipt);
manager_->handleIncomingMessage(reply);
@@ -534,7 +534,7 @@ public:
CPPUNIT_ASSERT(stanzaChannel_->getStanzaAtIndex<Message>(3)->getPayload<DeliveryReceiptRequest>());
// Reply with a message including a body text from second resource.
- reply = boost::make_shared<Message>();
+ reply = std::make_shared<Message>();
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<RequestChatUIEvent>(sender));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(sender));
foreach(const JID& senderJID, senderResource) {
// The sender supports delivery receipts.
- DiscoInfo::ref disco = boost::make_shared<DiscoInfo>();
+ DiscoInfo::ref disco = std::make_shared<DiscoInfo>();
disco->addFeature(DiscoInfo::MessageDeliveryReceiptsFeature);
entityCapsProvider_->caps[senderJID] = disco;
// The sender is online.
- Presence::ref senderPresence = boost::make_shared<Presence>();
+ Presence::ref senderPresence = std::make_shared<Presence>();
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>();
+ Message::ref reply = std::make_shared<Message>();
reply->setFrom(senderJID);
reply->setTo(ownJID);
- boost::shared_ptr<ChatState> csn = boost::make_shared<ChatState>();
+ std::shared_ptr<ChatState> csn = std::make_shared<ChatState>();
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>();
+ Message::ref receiptReply = std::make_shared<Message>();
receiptReply->setFrom(senderJID);
receiptReply->setTo(ownJID);
- boost::shared_ptr<DeliveryReceipt> receipt = boost::make_shared<DeliveryReceipt>();
+ std::shared_ptr<DeliveryReceipt> receipt = std::make_shared<DeliveryReceipt>();
receipt->setReceivedID(stanzaChannel_->getStanzaAtIndex<Message>(1)->getID());
receiptReply->addPayload(receipt);
manager_->handleIncomingMessage(receiptReply);
}
// Reply with a message including a CSN.
- Message::ref reply = boost::make_shared<Message>();
+ Message::ref reply = std::make_shared<Message>();
reply->setFrom(senderResource[0]);
reply->setTo(ownJID);
- boost::shared_ptr<ChatState> csn = boost::make_shared<ChatState>();
+ std::shared_ptr<ChatState> csn = std::make_shared<ChatState>();
csn->setChatState(ChatState::Composing);
reply->addPayload(csn);
manager_->handleIncomingMessage(reply);
@@ -635,11 +635,11 @@ public:
CPPUNIT_ASSERT(stanzaChannel_->getStanzaAtIndex<Message>(2)->getPayload<DeliveryReceiptRequest>());
// Reply with a message including a CSN from the other resource.
- reply = boost::make_shared<Message>();
+ reply = std::make_shared<Message>();
reply->setFrom(senderResource[1]);
reply->setTo(ownJID);
- csn = boost::make_shared<ChatState>();
+ csn = std::make_shared<ChatState>();
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<UIEvent>(new RequestChatUIEvent(JID(participantA))));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(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<RequestChatUIEvent>(sender));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(sender));
CPPUNIT_ASSERT_EQUAL(false, window->impromptuMUCSupported_);
- boost::shared_ptr<IQ> infoRequest= iqChannel_->iqs_[1];
- boost::shared_ptr<IQ> infoResponse = IQ::createResult(infoRequest->getFrom(), infoRequest->getTo(), infoRequest->getID());
+ std::shared_ptr<IQ> infoRequest= iqChannel_->iqs_[1];
+ std::shared_ptr<IQ> 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<DiscoInfo>(info));
+ infoResponse->addPayload(std::make_shared<DiscoInfo>(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> message = makeDeliveryReceiptTestMessage(messageJID, "1");
+ std::shared_ptr<Message> 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> message(new Message());
+ std::shared_ptr<Message> 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> message(new Message());
+ std::shared_ptr<Message> 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<Message> makeDeliveryReceiptTestMessage(const JID& from, const std::string& id) {
- boost::shared_ptr<Message> message = boost::make_shared<Message>();
+ std::shared_ptr<Message> makeDeliveryReceiptTestMessage(const JID& from, const std::string& id) {
+ std::shared_ptr<Message> message = std::make_shared<Message>();
message->setFrom(from);
message->setID(id);
message->setBody("This will cause the window to open");
- message->addPayload(boost::make_shared<DeliveryReceiptRequest>());
+ message->addPayload(std::make_shared<DeliveryReceiptRequest>());
return message;
}
@@ -836,7 +836,7 @@ private:
NickResolver* nickResolver_;
PresenceOracle* presenceOracle_;
AvatarManager* avatarManager_;
- boost::shared_ptr<DiscoInfo> serverDiscoInfo_;
+ std::shared_ptr<DiscoInfo> 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<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto_ = std::shared_ptr<CryptoProvider>(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<MockMUC>(mucJID_);
+ muc_ = std::make_shared<MockMUC>(mucJID_);
mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(muc_->getJID(), uiEventStream_).Return(window_);
- chatMessageParser_ = boost::make_shared<ChatMessageParser>(std::map<std::string, std::string>(), highlightManager_->getRules(), true);
+ chatMessageParser_ = std::make_shared<ChatMessageParser>(std::map<std::string, std::string>(), 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<DiscoInfo> features = boost::make_shared<DiscoInfo>();
+ std::shared_ptr<DiscoInfo> features = std::make_shared<DiscoInfo>();
features->addFeature(DiscoInfo::SecurityLabelsCatalogFeature);
controller_->setAvailableServerFeatures(features);
IQ::ref iq = iqChannel_->iqs_[iqChannel_->iqs_.size() - 1];
- SecurityLabelsCatalog::ref labelPayload = boost::make_shared<SecurityLabelsCatalog>();
+ SecurityLabelsCatalog::ref labelPayload = std::make_shared<SecurityLabelsCatalog>();
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<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- Message::ref message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ std::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
+ Message::ref message = std::dynamic_pointer_cast<Message>(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<SecurityLabel> label = boost::make_shared<SecurityLabel>();
+ std::shared_ptr<SecurityLabel> label = std::make_shared<SecurityLabel>();
label->setLabel("a");
SecurityLabelsCatalog::Item labelItem;
labelItem.setSelector("Bob");
labelItem.setLabel(label);
window_->label_ = labelItem;
- boost::shared_ptr<DiscoInfo> features = boost::make_shared<DiscoInfo>();
+ std::shared_ptr<DiscoInfo> features = std::make_shared<DiscoInfo>();
features->addFeature(DiscoInfo::SecurityLabelsCatalogFeature);
controller_->setAvailableServerFeatures(features);
IQ::ref iq = iqChannel_->iqs_[iqChannel_->iqs_.size() - 1];
- SecurityLabelsCatalog::ref labelPayload = boost::make_shared<SecurityLabelsCatalog>();
+ SecurityLabelsCatalog::ref labelPayload = std::make_shared<SecurityLabelsCatalog>();
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<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- Message::ref message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ std::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
+ Message::ref message = std::dynamic_pointer_cast<Message>(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<SecurityLabel> label = boost::make_shared<SecurityLabel>();
+ std::shared_ptr<SecurityLabel> label = std::make_shared<SecurityLabel>();
label->setLabel("a");
SecurityLabelsCatalog::Item labelItem;
labelItem.setSelector("Bob");
labelItem.setLabel(label);
- boost::shared_ptr<SecurityLabel> label2 = boost::make_shared<SecurityLabel>();
+ std::shared_ptr<SecurityLabel> label2 = std::make_shared<SecurityLabel>();
label->setLabel("b");
SecurityLabelsCatalog::Item labelItem2;
labelItem2.setSelector("Charlie");
labelItem2.setLabel(label2);
window_->label_ = labelItem;
- boost::shared_ptr<DiscoInfo> features = boost::make_shared<DiscoInfo>();
+ std::shared_ptr<DiscoInfo> features = std::make_shared<DiscoInfo>();
features->addFeature(DiscoInfo::SecurityLabelsCatalogFeature);
controller_->setAvailableServerFeatures(features);
IQ::ref iq = iqChannel_->iqs_[iqChannel_->iqs_.size() - 1];
- SecurityLabelsCatalog::ref labelPayload = boost::make_shared<SecurityLabelsCatalog>();
+ SecurityLabelsCatalog::ref labelPayload = std::make_shared<SecurityLabelsCatalog>();
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<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- Message::ref message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ std::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
+ Message::ref message = std::dynamic_pointer_cast<Message>(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<Message>(rawStanza);
+ message = std::dynamic_pointer_cast<Message>(rawStanza);
CPPUNIT_ASSERT_EQUAL(messageBody, message->getBody().get());
CPPUNIT_ASSERT_EQUAL(label, message->getPayload<SecurityLabel>());
}
@@ -406,22 +406,22 @@ public:
void testSubjectChangeCorrect() {
std::string messageBody("test message");
window_->onSendMessageRequest(messageBody, false);
- boost::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- Message::ref message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ std::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
+ Message::ref message = std::dynamic_pointer_cast<Message>(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>();
+ Message::ref message = std::make_shared<Message>();
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<MessageEvent>(message));
- CPPUNIT_ASSERT_EQUAL(std::string("The room subject is now: New Room Subject"), boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
+ controller_->handleIncomingMessage(std::make_shared<MessageEvent>(message));
+ CPPUNIT_ASSERT_EQUAL(std::string("The room subject is now: New Room Subject"), std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
}
}
@@ -431,14 +431,14 @@ public:
void testSubjectChangeIncorrectA() {
std::string messageBody("test message");
window_->onSendMessageRequest(messageBody, false);
- boost::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- Message::ref message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ std::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
+ Message::ref message = std::dynamic_pointer_cast<Message>(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>();
+ Message::ref message = std::make_shared<Message>();
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<MessageEvent>(message));
- CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
+ controller_->handleIncomingMessage(std::make_shared<MessageEvent>(message));
+ CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
}
}
@@ -457,23 +457,23 @@ public:
void testSubjectChangeIncorrectB() {
std::string messageBody("test message");
window_->onSendMessageRequest(messageBody, false);
- boost::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- Message::ref message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ std::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
+ Message::ref message = std::dynamic_pointer_cast<Message>(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>();
+ Message::ref message = std::make_shared<Message>();
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>("Thread that prevents the subject change."));
+ message->addPayload(std::make_shared<Thread>("Thread that prevents the subject change."));
- controller_->handleIncomingMessage(boost::make_shared<MessageEvent>(message));
- CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
+ controller_->handleIncomingMessage(std::make_shared<MessageEvent>(message));
+ CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
}
}
@@ -483,14 +483,14 @@ public:
void testSubjectChangeIncorrectC() {
std::string messageBody("test message");
window_->onSendMessageRequest(messageBody, false);
- boost::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
- Message::ref message = boost::dynamic_pointer_cast<Message>(rawStanza);
+ std::shared_ptr<Stanza> rawStanza = stanzaChannel_->sentStanzas[stanzaChannel_->sentStanzas.size() - 1];
+ Message::ref message = std::dynamic_pointer_cast<Message>(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>();
+ Message::ref message = std::make_shared<Message>();
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<MessageEvent>(message));
- CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
+ controller_->handleIncomingMessage(std::make_shared<MessageEvent>(message));
+ CPPUNIT_ASSERT_EQUAL(std::string("Trying to enter room teaparty@rooms.wonderland.lit"), std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(window_->lastAddedSystemMessage_.getParts()[0])->text);
}
}
@@ -544,8 +544,8 @@ private:
DummyEntityCapsProvider* entityCapsProvider_;
DummySettingsProvider* settings_;
HighlightManager* highlightManager_;
- boost::shared_ptr<ChatMessageParser> chatMessageParser_;
- boost::shared_ptr<CryptoProvider> crypto_;
+ std::shared_ptr<ChatMessageParser> chatMessageParser_;
+ std::shared_ptr<CryptoProvider> 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 <Swift/Controllers/Chat/UserSearchController.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Avatars/AvatarManager.h>
#include <Swiften/Base/String.h>
@@ -79,23 +79,23 @@ void UserSearchController::setCanInitiateImpromptuMUC(bool supportsImpromptu) {
} // Else doesn't support search
}
-void UserSearchController::handleUIEvent(boost::shared_ptr<UIEvent> event) {
+void UserSearchController::handleUIEvent(std::shared_ptr<UIEvent> event) {
bool handle = false;
- boost::shared_ptr<RequestAddUserDialogUIEvent> addUserRequest = boost::shared_ptr<RequestAddUserDialogUIEvent>();
+ std::shared_ptr<RequestAddUserDialogUIEvent> addUserRequest = std::shared_ptr<RequestAddUserDialogUIEvent>();
RequestInviteToMUCUIEvent::ref inviteToMUCRequest = RequestInviteToMUCUIEvent::ref();
switch (type_) {
case AddContact:
- if ((addUserRequest = boost::dynamic_pointer_cast<RequestAddUserDialogUIEvent>(event))) {
+ if ((addUserRequest = std::dynamic_pointer_cast<RequestAddUserDialogUIEvent>(event))) {
handle = true;
}
break;
case StartChat:
- if (boost::dynamic_pointer_cast<RequestChatWithUserDialogUIEvent>(event)) {
+ if (std::dynamic_pointer_cast<RequestChatWithUserDialogUIEvent>(event)) {
handle = true;
}
break;
case InviteToChat:
- if ((inviteToMUCRequest = boost::dynamic_pointer_cast<RequestInviteToMUCUIEvent>(event))) {
+ if ((inviteToMUCRequest = std::dynamic_pointer_cast<RequestInviteToMUCUIEvent>(event))) {
handle = true;
}
break;
@@ -140,7 +140,7 @@ void UserSearchController::endDiscoWalker() {
}
}
-void UserSearchController::handleDiscoServiceFound(const JID& jid, boost::shared_ptr<DiscoInfo> info) {
+void UserSearchController::handleDiscoServiceFound(const JID& jid, std::shared_ptr<DiscoInfo> 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<GenericRequest<SearchPayload> > searchRequest(new GenericRequest<SearchPayload>(IQ::Get, jid, boost::make_shared<SearchPayload>(), iqRouter_));
+ std::shared_ptr<GenericRequest<SearchPayload> > searchRequest(new GenericRequest<SearchPayload>(IQ::Get, jid, std::make_shared<SearchPayload>(), iqRouter_));
searchRequest->onResponse.connect(boost::bind(&UserSearchController::handleFormResponse, this, _1, _2));
searchRequest->send();
}
}
-void UserSearchController::handleFormResponse(boost::shared_ptr<SearchPayload> fields, ErrorPayload::ref error) {
+void UserSearchController::handleFormResponse(std::shared_ptr<SearchPayload> fields, ErrorPayload::ref error) {
if (error || !fields) {
window_->setServerSupportsSearch(false);
return;
@@ -168,14 +168,14 @@ void UserSearchController::handleFormResponse(boost::shared_ptr<SearchPayload> f
window_->setSearchFields(fields);
}
-void UserSearchController::handleSearch(boost::shared_ptr<SearchPayload> fields, const JID& jid) {
+void UserSearchController::handleSearch(std::shared_ptr<SearchPayload> fields, const JID& jid) {
addToSavedDirectories(jid);
- boost::shared_ptr<GenericRequest<SearchPayload> > searchRequest(new GenericRequest<SearchPayload>(IQ::Set, jid, fields, iqRouter_));
+ std::shared_ptr<GenericRequest<SearchPayload> > searchRequest(new GenericRequest<SearchPayload>(IQ::Set, jid, fields, iqRouter_));
searchRequest->onResponse.connect(boost::bind(&UserSearchController::handleSearchResponse, this, _1, _2));
searchRequest->send();
}
-void UserSearchController::handleSearchResponse(boost::shared_ptr<SearchPayload> resultsPayload, ErrorPayload::ref error) {
+void UserSearchController::handleSearchResponse(std::shared_ptr<SearchPayload> resultsPayload, ErrorPayload::ref error) {
if (error || !resultsPayload) {
window_->setSearchError(true);
return;
@@ -290,7 +290,7 @@ void UserSearchController::handleJIDAddRequested(const std::vector<JID>& jids) {
}
Contact::ref UserSearchController::convertJIDtoContact(const JID& jid) {
- Contact::ref contact = boost::make_shared<Contact>();
+ Contact::ref contact = std::make_shared<Contact>();
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 <map>
+#include <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/DiscoInfo.h>
#include <Swiften/Elements/DiscoItems.h>
@@ -57,13 +56,13 @@ namespace Swift {
void setCanInitiateImpromptuMUC(bool supportsImpromptu);
private:
- void handleUIEvent(boost::shared_ptr<UIEvent> event);
+ void handleUIEvent(std::shared_ptr<UIEvent> event);
void handleFormRequested(const JID& service);
- void handleDiscoServiceFound(const JID& jid, boost::shared_ptr<DiscoInfo> info);
+ void handleDiscoServiceFound(const JID& jid, std::shared_ptr<DiscoInfo> info);
void handleDiscoWalkFinished();
- void handleFormResponse(boost::shared_ptr<SearchPayload> items, ErrorPayload::ref error);
- void handleSearch(boost::shared_ptr<SearchPayload> fields, const JID& jid);
- void handleSearchResponse(boost::shared_ptr<SearchPayload> results, ErrorPayload::ref error);
+ void handleFormResponse(std::shared_ptr<SearchPayload> items, ErrorPayload::ref error);
+ void handleSearch(std::shared_ptr<SearchPayload> fields, const JID& jid);
+ void handleSearchResponse(std::shared_ptr<SearchPayload> 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 <boost/enable_shared_from_this.hpp>
+#include <memory>
+
#include <boost/filesystem/path.hpp>
#include <Swiften/Elements/StatusShow.h>
@@ -20,9 +21,9 @@
namespace Swift {
-class Contact : public boost::enable_shared_from_this<Contact> {
+class Contact : public std::enable_shared_from_this<Contact> {
public:
- typedef boost::shared_ptr<Contact> ref;
+ typedef std::shared_ptr<Contact> 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 <Swift/Controllers/ContactEditController.h>
+#include <memory>
+
#include <boost/algorithm/string.hpp>
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/VCards/VCardManager.h>
@@ -35,7 +36,7 @@ ContactEditController::~ContactEditController() {
}
void ContactEditController::handleUIEvent(UIEvent::ref event) {
- RequestContactEditorUIEvent::ref editEvent = boost::dynamic_pointer_cast<RequestContactEditorUIEvent>(event);
+ RequestContactEditorUIEvent::ref editEvent = std::dynamic_pointer_cast<RequestContactEditorUIEvent>(event);
if (!editEvent) {
return;
}
@@ -90,7 +91,7 @@ std::vector<std::string> ContactEditController::nameSuggestionsFromVCard(VCard::
void ContactEditController::handleRemoveContactRequest() {
assert(currentContact);
- uiEventStream->send(boost::make_shared<RemoveRosterItemUIEvent>(currentContact->getJID()));
+ uiEventStream->send(std::make_shared<RemoveRosterItemUIEvent>(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<Contact::ref> ContactsFromXMPPRoster::getContacts(bool /*withMUCNick
std::vector<Contact::ref> results;
std::vector<XMPPRosterItem> rosterItems = roster_->getItems();
foreach(const XMPPRosterItem& rosterItem, rosterItems) {
- Contact::ref contact = boost::make_shared<Contact>(rosterItem.getName().empty() ? rosterItem.getJID().toString() : rosterItem.getName(), rosterItem.getJID(), StatusShow::None,"");
+ Contact::ref contact = std::make_shared<Contact>(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<StanzaEvent> event) {
+void EventNotifier::handleEventAdded(std::shared_ptr<StanzaEvent> event) {
if (event->getConcluded()) {
return;
}
- if (boost::shared_ptr<MessageEvent> messageEvent = boost::dynamic_pointer_cast<MessageEvent>(event)) {
+ if (std::shared_ptr<MessageEvent> messageEvent = std::dynamic_pointer_cast<MessageEvent>(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<StanzaEvent> event) {
notifier->showMessage(Notifier::IncomingMessage, title, messageText, avatarManager->getAvatarPath(jid), boost::bind(&EventNotifier::handleNotificationActivated, this, activationJID));
}
}
- else if(boost::shared_ptr<SubscriptionRequestEvent> subscriptionEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(event)) {
+ else if(std::shared_ptr<SubscriptionRequestEvent> subscriptionEvent = std::dynamic_pointer_cast<SubscriptionRequestEvent>(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<void()>());
}
- else if(boost::shared_ptr<ErrorEvent> errorEvent = boost::dynamic_pointer_cast<ErrorEvent>(event)) {
+ else if(std::shared_ptr<ErrorEvent> errorEvent = std::dynamic_pointer_cast<ErrorEvent>(event)) {
notifier->showMessage(Notifier::SystemMessage, QT_TRANSLATE_NOOP("", "Error"), errorEvent->getText(), boost::filesystem::path(), boost::function<void()>());
}
- else if (boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(event)) {
+ else if (std::shared_ptr<MUCInviteEvent> mucInviteEvent = std::dynamic_pointer_cast<MUCInviteEvent>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/JID/JID.h>
@@ -32,7 +32,7 @@ namespace Swift {
boost::signal<void (const JID&)> onNotificationActivated;
private:
- void handleEventAdded(boost::shared_ptr<StanzaEvent>);
+ void handleEventAdded(std::shared_ptr<StanzaEvent>);
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<StanzaEvent> event) {
+void EventWindowController::handleEventQueueEventAdded(std::shared_ptr<StanzaEvent> event) {
if (event->getConcluded()) {
handleEventConcluded(event);
} else {
- boost::shared_ptr<MessageEvent> message = boost::dynamic_pointer_cast<MessageEvent>(event);
+ std::shared_ptr<MessageEvent> message = std::dynamic_pointer_cast<MessageEvent>(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<StanzaE
}
}
-void EventWindowController::handleEventConcluded(boost::shared_ptr<StanzaEvent> event) {
+void EventWindowController::handleEventConcluded(std::shared_ptr<StanzaEvent> event) {
window_->removeEvent(event);
bool includeAsCompleted = true;
/* Because subscription requests get duplicated, don't add them back */
- if (boost::dynamic_pointer_cast<SubscriptionRequestEvent>(event) || boost::dynamic_pointer_cast<MessageEvent>(event)) {
+ if (std::dynamic_pointer_cast<SubscriptionRequestEvent>(event) || std::dynamic_pointer_cast<MessageEvent>(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<StanzaEvent> event);
- void handleEventConcluded(boost::shared_ptr<StanzaEvent> event);
+ void handleEventQueueEventAdded(std::shared_ptr<StanzaEvent> event);
+ void handleEventConcluded(std::shared_ptr<StanzaEvent> 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 <Swift/Controllers/FileTransfer/FileTransferController.h>
+#include <memory>
+
#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Log.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -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<FileReadBytestream>(boost::filesystem::path(filename));
+ fileReadStream = std::make_shared<FileReadBytestream>(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<IncomingFileTransfer>(transfer);
+ IncomingFileTransfer::ref incomingTransfer = std::dynamic_pointer_cast<IncomingFileTransfer>(transfer);
if (incomingTransfer) {
- fileWriteStream = boost::make_shared<FileWriteBytestream>(boost::filesystem::path(file));
+ fileWriteStream = std::make_shared<FileWriteBytestream>(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 <memory>
#include <string>
#include <boost/cstdint.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/FileTransfer/FileReadBytestream.h>
#include <Swiften/FileTransfer/FileTransfer.h>
@@ -68,8 +68,8 @@ private:
JID otherParty;
std::string filename;
FileTransfer::ref transfer;
- boost::shared_ptr<FileReadBytestream> fileReadStream;
- boost::shared_ptr<FileWriteBytestream> fileWriteStream;
+ std::shared_ptr<FileReadBytestream> fileReadStream;
+ std::shared_ptr<FileWriteBytestream> 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<UIEvent> rawEvent) {
- boost::shared_ptr<RequestFileTransferListUIEvent> event = boost::dynamic_pointer_cast<RequestFileTransferListUIEvent>(rawEvent);
+void FileTransferListController::handleUIEvent(std::shared_ptr<UIEvent> rawEvent) {
+ std::shared_ptr<RequestFileTransferListUIEvent> event = std::dynamic_pointer_cast<RequestFileTransferListUIEvent>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swift/Controllers/UIEvents/UIEventStream.h>
@@ -30,7 +30,7 @@ public:
void setFileTransferOverview(FileTransferOverview* overview);
private:
- void handleUIEvent(boost::shared_ptr<UIEvent> event);
+ void handleUIEvent(std::shared_ptr<UIEvent> 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<UIEvent> rawEvent)
+void HighlightEditorController::handleUIEvent(std::shared_ptr<UIEvent> rawEvent)
{
- boost::shared_ptr<RequestHighlightEditorUIEvent> event = boost::dynamic_pointer_cast<RequestHighlightEditorUIEvent>(rawEvent);
+ std::shared_ptr<RequestHighlightEditorUIEvent> event = std::dynamic_pointer_cast<RequestHighlightEditorUIEvent>(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 <boost/shared_ptr.hpp>
+#include <memory>
+#include <string>
#include <Swift/Controllers/UIEvents/UIEvent.h>
@@ -35,7 +36,7 @@ namespace Swift {
void setContactSuggester(ContactSuggester *suggester) { contactSuggester_ = suggester; }
private:
- void handleUIEvent(boost::shared_ptr<UIEvent> event);
+ void handleUIEvent(std::shared_ptr<UIEvent> 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<HighlightRulesList>();
+ rules_ = std::make_shared<HighlightRulesList>();
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<const HighlightManager::HighlightRulesList> getRules() const { return rules_; }
+ std::shared_ptr<const HighlightManager::HighlightRulesList> getRules() const { return rules_; }
bool isDefaultRulesList() const;
void resetToDefaultRulesList();
@@ -72,10 +72,10 @@ namespace Swift {
SettingsProvider* settings_;
bool storingSettings_;
- boost::shared_ptr<HighlightManager::HighlightRulesList> rules_;
+ std::shared_ptr<HighlightManager::HighlightRulesList> rules_;
boost::bsignals::scoped_connection handleSettingChangedConnection_;
};
- typedef boost::shared_ptr<const HighlightManager::HighlightRulesList> HighlightRulesListPtr;
+ typedef std::shared_ptr<const HighlightManager::HighlightRulesList> 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<UIEvent> rawEvent) {
- boost::shared_ptr<RequestHistoryUIEvent> event = boost::dynamic_pointer_cast<RequestHistoryUIEvent>(rawEvent);
+void HistoryViewController::handleUIEvent(std::shared_ptr<UIEvent> rawEvent) {
+ std::shared_ptr<RequestHistoryUIEvent> event = std::dynamic_pointer_cast<RequestHistoryUIEvent>(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());
+ Presence::ref availablePresence = std::make_shared<Presence>(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<Presence::ref> mucPresence = presenceOracle_->getAllPresence(jid.toBare());
if (isMUC && !mucPresence.empty()) {
- Presence::ref presence = boost::make_shared<Presence>(Presence());
+ Presence::ref presence = std::make_shared<Presence>(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 <memory>
#include <set>
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/History/HistoryStorage.h>
@@ -40,7 +40,7 @@ namespace Swift {
~HistoryViewController();
private:
- void handleUIEvent(boost::shared_ptr<UIEvent> event);
+ void handleUIEvent(std::shared_ptr<UIEvent> 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 <boost/bind.hpp>
#include <boost/lexical_cast.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
+#include <memory>
#include <Swiften/Base/Algorithm.h>
#include <Swiften/Base/String.h>
@@ -328,7 +328,7 @@ void MainController::resetPendingReconnects() {
void MainController::resetCurrentError() {
if (lastDisconnectError_) {
lastDisconnectError_->conclude();
- lastDisconnectError_ = boost::shared_ptr<ErrorEvent>();
+ lastDisconnectError_ = std::shared_ptr<ErrorEvent>();
}
}
@@ -447,7 +447,7 @@ void MainController::reconnectAfterError() {
}
void MainController::handleChangeStatusRequest(StatusShow::Type show, const std::string &statusText) {
- boost::shared_ptr<Presence> presence(new Presence());
+ std::shared_ptr<Presence> 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> presence) {
+void MainController::sendPresence(std::shared_ptr<Presence> 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<VCardUpdate>(vCardPhotoHash_));
+ presence->updatePayload(std::make_shared<VCardUpdate>(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<boost::system::error_code> errorCode = getUserNameEx(userName, clientName, serverName);
+ std::shared_ptr<boost::system::error_code> 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<Swift::Client>(clientJID, createSafeByteArray(password_.c_str()), networkFactories_, storages_);
+ client_ = std::make_shared<Swift::Client>(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> presence(new Presence());
+ std::shared_ptr<Presence> presence(new Presence());
presence->setShow(static_cast<StatusShow::Type>(profileSettings_->getIntSetting("lastShow", StatusShow::Online)));
presence->setStatus(profileSettings_->getStringSetting("lastStatus"));
statusTracker_->setRequestedPresence(presence);
@@ -725,7 +725,7 @@ void MainController::handleDisconnected(const boost::optional<ClientError>& erro
} else {
message = str(format(QT_TRANSLATE_NOOP("", "Disconnected from %1%: %2%.")) % jid_.getDomain() % message);
}
- lastDisconnectError_ = boost::make_shared<ErrorEvent>(JID(jid_.getDomain()), message);
+ lastDisconnectError_ = std::make_shared<ErrorEvent>(JID(jid_.getDomain()), message);
eventController_->handleIncomingEvent(lastDisconnectError_);
}
}
@@ -794,7 +794,7 @@ void MainController::setManagersOffline() {
}
}
-void MainController::handleServerDiscoInfoResponse(boost::shared_ptr<DiscoInfo> info, ErrorPayload::ref error) {
+void MainController::handleServerDiscoInfoResponse(std::shared_ptr<DiscoInfo> 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<JoinMUCUIEvent>(jid));
+ uiEventStream_->send(std::make_shared<JoinMUCUIEvent>(jid));
}
else {
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(jid)));
+ uiEventStream_->send(std::make_shared<RequestChatUIEvent>(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 <map>
+#include <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Client/ClientError.h>
#include <Swiften/Client/ClientXMLTracer.h>
@@ -109,12 +108,12 @@ namespace Swift {
void handleQuitRequest();
void handleChangeStatusRequest(StatusShow::Type show, const std::string &statusText);
void handleDisconnected(const boost::optional<ClientError>& error);
- void handleServerDiscoInfoResponse(boost::shared_ptr<DiscoInfo>, ErrorPayload::ref);
+ void handleServerDiscoInfoResponse(std::shared_ptr<DiscoInfo>, 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> presence);
+ void sendPresence(std::shared_ptr<Presence> presence);
void handleInputIdleChanged(bool);
void handleShowCertificateRequest();
void logout();
@@ -142,7 +141,7 @@ namespace Swift {
CertificateStorage* certificateStorage_;
CertificateStorageTrustChecker* certificateTrustChecker_;
bool clientInitialized_;
- boost::shared_ptr<Client> client_;
+ std::shared_ptr<Client> client_;
SettingsProvider *settings_;
ProfileSettingsProvider* profileSettings_;
Dock* dock_;
@@ -178,7 +177,7 @@ namespace Swift {
std::string password_;
CertificateWithKey::ref certificate_;
ClientOptions clientOptions_;
- boost::shared_ptr<ErrorEvent> lastDisconnectError_;
+ std::shared_ptr<ErrorEvent> 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> presence) {
+void PresenceNotifier::handlePresenceReceived(std::shared_ptr<Presence> 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 <memory>
#include <set>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Avatars/AvatarManager.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/Presence.h>
@@ -35,7 +34,7 @@ namespace Swift {
boost::signal<void (const JID&)> onNotificationActivated;
private:
- void handlePresenceReceived(boost::shared_ptr<Presence>);
+ void handlePresenceReceived(std::shared_ptr<Presence>);
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> timer;
+ std::shared_ptr<Timer> timer;
bool justInitialized;
bool inQuietPeriod;
std::set<JID> 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<RequestProfileEditorUIEvent>(event)) {
+ if (!std::dynamic_pointer_cast<RequestProfileEditorUIEvent>(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<VCard>());
+ profileWindow->setVCard(std::make_shared<VCard>());
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<std::string, boost::shared_ptr<Presence> > StringPresencePair;
+typedef std::pair<std::string, std::shared_ptr<Presence> > StringPresencePair;
void ContactRosterItem::clearPresence() {
presence_.reset();
onDataChanged();
}
-void ContactRosterItem::applyPresence(boost::shared_ptr<Presence> presence) {
+void ContactRosterItem::applyPresence(std::shared_ptr<Presence> 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 <memory>
#include <set>
#include <string>
#include <vector>
@@ -13,7 +14,6 @@
#include <boost/bind.hpp>
#include <boost/date_time/posix_time/ptime.hpp>
#include <boost/filesystem/path.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/MUCOccupant.h>
@@ -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> presence);
+ void applyPresence(std::shared_ptr<Presence> presence);
const std::vector<std::string>& 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> presence_;
+ std::shared_ptr<Presence> presence_;
std::vector<std::string> 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 <map>
+#include <memory>
#include <set>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/JID/JID.h>
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 <Swift/Controllers/Roster/RosterController.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Avatars/AvatarManager.h>
#include <Swiften/Base/Path.h>
@@ -96,7 +97,7 @@ RosterController::RosterController(const JID& jid, XMPPRoster* xmppRoster, Avata
handleShowOfflineToggled(settings_->getSetting(SettingConstants::SHOW_OFFLINE));
- ownContact_ = boost::make_shared<ContactRosterItem>(myJID_.toBare(), myJID_.toBare(), nickManager_->getOwnNick(), static_cast<GroupRosterItem*>(nullptr));
+ ownContact_ = std::make_shared<ContactRosterItem>(myJID_.toBare(), myJID_.toBare(), nickManager_->getOwnNick(), static_cast<GroupRosterItem*>(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<UIEvent> event) {
- if (boost::shared_ptr<AddContactUIEvent> addContactEvent = boost::dynamic_pointer_cast<AddContactUIEvent>(event)) {
+void RosterController::handleUIEvent(std::shared_ptr<UIEvent> event) {
+ if (std::shared_ptr<AddContactUIEvent> addContactEvent = std::dynamic_pointer_cast<AddContactUIEvent>(event)) {
RosterItemPayload item;
item.setName(addContactEvent->getName());
item.setJID(addContactEvent->getJID());
item.setGroups(std::vector<std::string>(addContactEvent->getGroups().begin(), addContactEvent->getGroups().end()));
- boost::shared_ptr<RosterPayload> roster(new RosterPayload());
+ std::shared_ptr<RosterPayload> 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<RemoveRosterItemUIEvent> removeEvent = boost::dynamic_pointer_cast<RemoveRosterItemUIEvent>(event)) {
+ else if (std::shared_ptr<RemoveRosterItemUIEvent> removeEvent = std::dynamic_pointer_cast<RemoveRosterItemUIEvent>(event)) {
RosterItemPayload item(removeEvent->getJID(), "", RosterItemPayload::Remove);
- boost::shared_ptr<RosterPayload> roster(new RosterPayload());
+ std::shared_ptr<RosterPayload> 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<RenameRosterItemUIEvent> renameEvent = boost::dynamic_pointer_cast<RenameRosterItemUIEvent>(event)) {
+ else if (std::shared_ptr<RenameRosterItemUIEvent> renameEvent = std::dynamic_pointer_cast<RenameRosterItemUIEvent>(event)) {
JID contact(renameEvent->getJID());
RosterItemPayload item(contact, renameEvent->getNewName(), xmppRoster_->getSubscriptionStateForJID(contact));
item.setGroups(xmppRoster_->getGroupsForJID(contact));
- boost::shared_ptr<RosterPayload> roster(new RosterPayload());
+ std::shared_ptr<RosterPayload> 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<RenameGroupUIEvent> renameGroupEvent = boost::dynamic_pointer_cast<RenameGroupUIEvent>(event)) {
+ else if (std::shared_ptr<RenameGroupUIEvent> renameGroupEvent = std::dynamic_pointer_cast<RenameGroupUIEvent>(event)) {
std::vector<XMPPRosterItem> 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<UIEvent> event) {
}
}
}
- else if (boost::shared_ptr<SendFileUIEvent> sendFileEvent = boost::dynamic_pointer_cast<SendFileUIEvent>(event)) {
+ else if (std::shared_ptr<SendFileUIEvent> sendFileEvent = std::dynamic_pointer_cast<SendFileUIEvent>(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>();
+ RosterPayload::ref roster = std::make_shared<RosterPayload>();
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> blockList = clientBlockListManager_->requestBlockList();
+ std::shared_ptr<BlockList> 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> rosterPayload) {
+void RosterController::handleRosterItemUpdated(ErrorPayload::ref error, std::shared_ptr<RosterPayload> rosterPayload) {
if (!!error) {
handleRosterSetError(error, rosterPayload);
}
- boost::shared_ptr<BlockList> blockList = clientBlockListManager_->getBlockList();
+ std::shared_ptr<BlockList> blockList = clientBlockListManager_->getBlockList();
std::vector<RosterItemPayload> items = rosterPayload->getItems();
if (blockList->getState() == BlockList::Available && items.size() > 0) {
std::vector<JID> 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> rosterPayload) {
+void RosterController::handleRosterSetError(ErrorPayload::ref error, std::shared_ptr<RosterPayload> 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> errorEvent(new ErrorEvent(JID(myJID_.getDomain()), text));
+ std::shared_ptr<ErrorEvent> 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<StanzaEvent> event(eventPointer);
+ std::shared_ptr<StanzaEvent> 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 <memory>
#include <set>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Avatars/AvatarManager.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/ErrorPayload.h>
@@ -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<Presence> newPresence);
+ void handleIncomingPresence(std::shared_ptr<Presence> newPresence);
void handleSubscriptionRequest(const JID& jid, const std::string& message);
void handleSubscriptionRequestAccepted(SubscriptionRequestEvent* event);
void handleSubscriptionRequestDeclined(SubscriptionRequestEvent* event);
- void handleUIEvent(boost::shared_ptr<UIEvent> event);
- void handleRosterItemUpdated(ErrorPayload::ref error, boost::shared_ptr<RosterPayload> rosterPayload);
- void handleRosterSetError(ErrorPayload::ref error, boost::shared_ptr<RosterPayload> rosterPayload);
+ void handleUIEvent(std::shared_ptr<UIEvent> event);
+ void handleRosterItemUpdated(ErrorPayload::ref error, std::shared_ptr<RosterPayload> rosterPayload);
+ void handleRosterSetError(ErrorPayload::ref error, std::shared_ptr<RosterPayload> 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<ContactRosterItem> ownContact_;
+ std::shared_ptr<ContactRosterItem> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/boost_bsignals.h>
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<Section> sections;
bool updatePending;
- boost::shared_ptr<Timer> updateTimer;
+ std::shared_ptr<Timer> 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<UIEvent>(new RenameRosterItemUIEvent(jid, "Robert")));
+ uiEventStream_->send(std::make_shared<RenameRosterItemUIEvent>(jid, "Robert"));
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), channel_->iqs_.size());
CPPUNIT_ASSERT_EQUAL(IQ::Set, channel_->iqs_[0]->getType());
- boost::shared_ptr<RosterPayload> payload = channel_->iqs_[0]->getPayload<RosterPayload>();
+ std::shared_ptr<RosterPayload> payload = channel_->iqs_[0]->getPayload<RosterPayload>();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -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> presence(new Presence());
+ std::shared_ptr<Presence> 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>();
+ presence = std::make_shared<Presence>();
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>();
+ presence = std::make_shared<Presence>();
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 <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <boost/variant.hpp>
#include <Swiften/Network/DummyTimerFactory.h>
@@ -46,7 +46,7 @@ class TableRosterTest : public CppUnit::TestFixture {
void testAddContact_EmptyRoster() {
/*
- boost::shared_ptr<TableRoster> tableRoster(createTestling());
+ std::shared_ptr<TableRoster> 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<ShowProfileForRosterItemUIEvent>(event);
+ ShowProfileForRosterItemUIEvent::ref showProfileEvent = std::dynamic_pointer_cast<ShowProfileForRosterItemUIEvent>(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<StanzaEvent> event) {
- if (playSounds_ && boost::dynamic_pointer_cast<IncomingFileTransferEvent>(event)) {
+void SoundEventController::handleEventQueueEventAdded(std::shared_ptr<StanzaEvent> event) {
+ if (playSounds_ && std::dynamic_pointer_cast<IncomingFileTransferEvent>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swift/Controllers/HighlightAction.h>
#include <Swift/Controllers/Settings/SettingsProvider.h>
@@ -23,7 +23,7 @@ namespace Swift {
bool getSoundEnabled() {return playSounds_;}
private:
void handleSettingChanged(const std::string& settingPath);
- void handleEventQueueEventAdded(boost::shared_ptr<StanzaEvent> event);
+ void handleEventQueueEventAdded(std::shared_ptr<StanzaEvent> 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 <Swift/Controllers/StatusTracker.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Elements/Idle.h>
@@ -14,27 +14,27 @@ namespace Swift {
StatusTracker::StatusTracker() {
isAutoAway_ = false;
- queuedPresence_ = boost::make_shared<Presence>();
+ queuedPresence_ = std::make_shared<Presence>();
}
-boost::shared_ptr<Presence> StatusTracker::getNextPresence() {
- boost::shared_ptr<Presence> presence;
+std::shared_ptr<Presence> StatusTracker::getNextPresence() {
+ std::shared_ptr<Presence> presence;
if (isAutoAway_) {
- presence = boost::make_shared<Presence>();
+ presence = std::make_shared<Presence>();
presence->setShow(StatusShow::Away);
presence->setStatus(queuedPresence_->getStatus());
- presence->addPayload(boost::make_shared<Idle>(isAutoAwaySince_));
+ presence->addPayload(std::make_shared<Idle>(isAutoAwaySince_));
} else {
presence = queuedPresence_;
}
return presence;
}
-void StatusTracker::setRequestedPresence(boost::shared_ptr<Presence> presence) {
+void StatusTracker::setRequestedPresence(std::shared_ptr<Presence> presence) {
isAutoAway_ = false;
queuedPresence_ = presence;
// if (presence->getType() == Presence::Unavailable) {
-// queuedPresence_ = boost::make_shared<Presence>();
+// queuedPresence_ = std::make_shared<Presence>();
// }
}
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 <memory>
+
#include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Elements/Presence.h>
@@ -16,12 +17,12 @@ namespace Swift {
class StatusTracker {
public:
StatusTracker();
- boost::shared_ptr<Presence> getNextPresence();
- void setRequestedPresence(boost::shared_ptr<Presence> presence);
+ std::shared_ptr<Presence> getNextPresence();
+ void setRequestedPresence(std::shared_ptr<Presence> presence);
bool goAutoAway(const int& seconds);
bool goAutoUnAway();
private:
- boost::shared_ptr<Presence> queuedPresence_;
+ std::shared_ptr<Presence> 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<RosterPayload, RosterParser, RosterSerializer> R
RosterFileStorage::RosterFileStorage(const boost::filesystem::path& path) : path(path) {
}
-boost::shared_ptr<RosterPayload> RosterFileStorage::getRoster() const {
+std::shared_ptr<RosterPayload> RosterFileStorage::getRoster() const {
return RosterPersister().loadPayloadGeneric(path);
}
-void RosterFileStorage::setRoster(boost::shared_ptr<RosterPayload> roster) {
+void RosterFileStorage::setRoster(std::shared_ptr<RosterPayload> 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<RosterPayload> getRoster() const;
- virtual void setRoster(boost::shared_ptr<RosterPayload>);
+ virtual std::shared_ptr<RosterPayload> getRoster() const;
+ virtual void setRoster(std::shared_ptr<RosterPayload>);
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<VCard> VCardFileStorage::getVCard(const JID& jid) const {
- boost::shared_ptr<VCard> result = VCardPersister().loadPayloadGeneric(getVCardPath(jid));
+std::shared_ptr<VCard> VCardFileStorage::getVCard(const JID& jid) const {
+ std::shared_ptr<VCard> 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 <map>
+#include <memory>
#include <string>
#include <boost/filesystem/path.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/VCards/VCardStorage.h>
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<MessageEvent>(*it)) {
+ if (std::dynamic_pointer_cast<MessageEvent>(*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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/JID/JID.h>
@@ -14,7 +20,7 @@
namespace Swift {
class AcceptWhiteboardSessionUIEvent : public UIEvent {
- typedef boost::shared_ptr<AcceptWhiteboardSessionUIEvent> ref;
+ typedef std::shared_ptr<AcceptWhiteboardSessionUIEvent> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/MUC/MUCBookmark.h>
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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/JID/JID.h>
@@ -14,7 +20,7 @@
namespace Swift {
class CancelWhiteboardSessionUIEvent : public UIEvent {
- typedef boost::shared_ptr<CancelWhiteboardSessionUIEvent> ref;
+ typedef std::shared_ptr<CancelWhiteboardSessionUIEvent> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/MUC/MUCBookmark.h>
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 <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/JID/JID.h>
#include <Swift/Controllers/UIEvents/UIEvent.h>
@@ -23,7 +22,7 @@
namespace Swift {
class InviteToMUCUIEvent : public UIEvent {
public:
- typedef boost::shared_ptr<InviteToMUCUIEvent> ref;
+ typedef std::shared_ptr<InviteToMUCUIEvent> ref;
InviteToMUCUIEvent(const JID& room, const std::vector<JID>& 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 <memory>
#include <string>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/JID/JID.h>
@@ -18,7 +18,7 @@
namespace Swift {
class JoinMUCUIEvent : public UIEvent {
public:
- typedef boost::shared_ptr<JoinMUCUIEvent> ref;
+ typedef std::shared_ptr<JoinMUCUIEvent> ref;
JoinMUCUIEvent(const JID& jid, const boost::optional<std::string>& password = boost::optional<std::string>(), const boost::optional<std::string>& nick = boost::optional<std::string>(), 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<std::string>& 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/MUC/MUCBookmark.h>
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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/MUC/MUCBookmark.h>
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<RequestContactEditorUIEvent> ref;
+ typedef std::shared_ptr<RequestContactEditorUIEvent> 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 <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/JID/JID.h>
#include <Swift/Controllers/UIEvents/UIEvent.h>
@@ -23,7 +22,7 @@
namespace Swift {
class RequestInviteToMUCUIEvent : public UIEvent {
public:
- typedef boost::shared_ptr<RequestInviteToMUCUIEvent> ref;
+ typedef std::shared_ptr<RequestInviteToMUCUIEvent> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/JID/JID.h>
#include <Swift/Controllers/UIEvents/UIEvent.h>
@@ -17,7 +16,7 @@
namespace Swift {
class RequestJoinMUCUIEvent : public UIEvent {
public:
- typedef boost::shared_ptr<RequestJoinMUCUIEvent> ref;
+ typedef std::shared_ptr<RequestJoinMUCUIEvent> 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<SendFileUIEvent> ref;
+ typedef std::shared_ptr<SendFileUIEvent> 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<ShowProfileForRosterItemUIEvent> ref;
+ typedef std::shared_ptr<ShowProfileForRosterItemUIEvent> 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 <boost/shared_ptr.hpp>
+#include <memory>
namespace Swift {
class UIEvent {
public:
- typedef boost::shared_ptr<UIEvent> ref;
+ typedef std::shared_ptr<UIEvent> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/boost_bsignals.h>
@@ -15,9 +15,9 @@
namespace Swift {
class UIEventStream {
public:
- boost::signal<void (boost::shared_ptr<UIEvent>)> onUIEvent;
+ boost::signal<void (std::shared_ptr<UIEvent>)> onUIEvent;
- void send(boost::shared_ptr<UIEvent> event) {
+ void send(std::shared_ptr<UIEvent> 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<OutgoingAdHocCommandSession> command) = 0;
+ virtual AdHocCommandWindow* createAdHocCommandWindow(std::shared_ptr<OutgoingAdHocCommandSession> 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 <list>
#include <map>
+#include <memory>
#include <set>
#include <boost/filesystem/path.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Base/foreach.h>
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 <memory>
#include <string>
#include <vector>
#include <boost/algorithm/string.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/make_shared.hpp>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/Tristate.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -47,13 +46,13 @@ namespace Swift {
public:
ChatMessage() {}
ChatMessage(const std::string& text) {
- append(boost::make_shared<ChatTextMessagePart>(text));
+ append(std::make_shared<ChatTextMessagePart>(text));
}
- void append(const boost::shared_ptr<ChatMessagePart>& part) {
+ void append(const std::shared_ptr<ChatMessagePart>& part) {
parts_.push_back(part);
}
- const std::vector<boost::shared_ptr<ChatMessagePart> >& getParts() const {
+ const std::vector<std::shared_ptr<ChatMessagePart> >& getParts() const {
return parts_;
}
@@ -68,7 +67,7 @@ namespace Swift {
bool isMeCommand() const {
bool isMeCommand = false;
if (!parts_.empty()) {
- boost::shared_ptr<ChatTextMessagePart> textPart = boost::dynamic_pointer_cast<ChatTextMessagePart>(parts_[0]);
+ std::shared_ptr<ChatTextMessagePart> textPart = std::dynamic_pointer_cast<ChatTextMessagePart>(parts_[0]);
if (textPart) {
if (boost::starts_with(textPart->text, "/me ")) {
isMeCommand = true;
@@ -79,7 +78,7 @@ namespace Swift {
}
private:
- std::vector<boost::shared_ptr<ChatMessagePart> > parts_;
+ std::vector<std::shared_ptr<ChatMessagePart> > 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<SecurityLabel> 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<SecurityLabel> 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<SecurityLabel> 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<SecurityLabel> 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 <memory>
#include <set>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/boost_bsignals.h>
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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swift/Controllers/XMPPEvents/StanzaEvent.h>
@@ -20,8 +20,8 @@ namespace Swift {
}
virtual ~EventWindow() {}
- virtual void addEvent(boost::shared_ptr<StanzaEvent> event, bool active) = 0;
- virtual void removeEvent(boost::shared_ptr<StanzaEvent> event) = 0;
+ virtual void addEvent(std::shared_ptr<StanzaEvent> event, bool active) = 0;
+ virtual void removeEvent(std::shared_ptr<StanzaEvent> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Client/ClientOptions.h>
#include <Swiften/TLS/Certificate.h>
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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/DiscoItems.h>
#include <Swiften/Elements/StatusShow.h>
@@ -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<ContactRosterItem> contact) = 0;
+ virtual void setMyContactRosterItem(std::shared_ptr<ContactRosterItem> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/VCard.h>
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<SearchPayload> fields) = 0;
+ virtual void setSearchFields(std::shared_ptr<SearchPayload> fields) = 0;
virtual void setNameSuggestions(const std::vector<std::string>& suggestions) = 0;
virtual void prepopulateJIDAndName(const JID& jid, const std::string& name) = 0;
virtual void setContactSuggestions(const std::vector<Contact::ref>& suggestions) = 0;
@@ -46,7 +46,7 @@ namespace Swift {
virtual void show() = 0;
boost::signal<void (const JID&)> onFormRequested;
- boost::signal<void (boost::shared_ptr<SearchPayload>, const JID&)> onSearchRequested;
+ boost::signal<void (std::shared_ptr<SearchPayload>, const JID&)> onSearchRequested;
boost::signal<void (const JID&)> onNameSuggestionRequested;
boost::signal<void (const std::string&)> onContactSuggestionsRequested;
boost::signal<void (const std::vector<JID>&)> 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<WhiteboardSession> session) = 0;
+ virtual void setSession(std::shared_ptr<WhiteboardSession> 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> whiteboardSession) = 0;
+ virtual WhiteboardWindow* createWhiteboardWindow(std::shared_ptr<WhiteboardSession> 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 <memory>
+
#include <boost/bind.hpp>
#include <boost/function.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -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<Contact>(name, jid, status, ""));
+ contacts.push_back(std::make_shared<Contact>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
@@ -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<SecurityLabel> /*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<SecurityLabel> /*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<SecurityLabel> /*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<SecurityLabel> /*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<ChatTextMessagePart> text;
- foreach (boost::shared_ptr<ChatMessagePart> part, message.getParts()) {
- if ((text = boost::dynamic_pointer_cast<ChatTextMessagePart>(part))) {
+ std::shared_ptr<ChatTextMessagePart> text;
+ foreach (std::shared_ptr<ChatMessagePart> part, message.getParts()) {
+ if ((text = std::dynamic_pointer_cast<ChatTextMessagePart>(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<ContactRosterItem> /*contact*/) {}
+ virtual void setMyContactRosterItem(std::shared_ptr<ContactRosterItem> /*contact*/) {}
virtual void setAvailableAdHocCommands(const std::vector<DiscoItems::Item>& /*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<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Online);
@@ -83,7 +83,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveSecondPresenceCreatesStatusChangeNotification() {
- boost::shared_ptr<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Away);
notifier->notifications.clear();
@@ -94,7 +94,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveUnavailablePresenceAfterAvailablePresenceCreatesUnavailableNotification() {
- boost::shared_ptr<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Away);
notifier->notifications.clear();
@@ -105,7 +105,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveUnavailablePresenceWithoutAvailableDoesNotCreateNotification() {
- boost::shared_ptr<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> testling = createNotifier();
sendUnavailablePresence(user1);
@@ -113,7 +113,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveAvailablePresenceAfterUnavailableCreatesAvailableNotification() {
- boost::shared_ptr<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> 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<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> 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<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> 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<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> 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<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> 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<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> testling = createNotifier();
roster->addContact(user1.toBare(), "User 1", std::vector<std::string>(), RosterItemPayload::Both);
sendPresence(user1, StatusShow::Online);
@@ -179,7 +179,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testNotificationSubjectContainsJIDForJIDNotInRoster() {
- boost::shared_ptr<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Online);
@@ -189,7 +189,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testNotificationSubjectContainsStatus() {
- boost::shared_ptr<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Away);
@@ -199,7 +199,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testNotificationMessageContainsStatusMessage() {
- boost::shared_ptr<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> testling = createNotifier();
sendPresence(user1, StatusShow::Away);
@@ -208,7 +208,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveFirstPresenceWithQuietPeriodDoesNotNotify() {
- boost::shared_ptr<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> testling = createNotifier();
testling->setInitialQuietPeriodMS(10);
sendPresence(user1, StatusShow::Online);
@@ -217,7 +217,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceivePresenceDuringQuietPeriodDoesNotNotify() {
- boost::shared_ptr<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> testling = createNotifier();
testling->setInitialQuietPeriodMS(10);
sendPresence(user1, StatusShow::Online);
@@ -228,7 +228,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceivePresenceDuringQuietPeriodResetsTimer() {
- boost::shared_ptr<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> testling = createNotifier();
testling->setInitialQuietPeriodMS(10);
sendPresence(user1, StatusShow::Online);
@@ -241,7 +241,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceivePresenceAfterQuietPeriodNotifies() {
- boost::shared_ptr<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> testling = createNotifier();
testling->setInitialQuietPeriodMS(10);
sendPresence(user1, StatusShow::Online);
@@ -252,7 +252,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveFirstPresenceWithQuietPeriodDoesNotCountAsQuietPeriod() {
- boost::shared_ptr<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> testling = createNotifier();
testling->setInitialQuietPeriodMS(10);
timerFactory->setTime(11);
@@ -262,7 +262,7 @@ class PresenceNotifierTest : public CppUnit::TestFixture {
}
void testReceiveFirstPresenceAfterReconnectWithQuietPeriodDoesNotNotify() {
- boost::shared_ptr<PresenceNotifier> testling = createNotifier();
+ std::shared_ptr<PresenceNotifier> 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<PresenceNotifier> createNotifier() {
- boost::shared_ptr<PresenceNotifier> result(new PresenceNotifier(stanzaChannel, notifier, mucRegistry, avatarManager, nickResolver, presenceOracle, timerFactory));
+ std::shared_ptr<PresenceNotifier> createNotifier() {
+ std::shared_ptr<PresenceNotifier> 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> presence(new Presence());
+ std::shared_ptr<Presence> 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> presence(new Presence());
+ std::shared_ptr<Presence> 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<UIEvent> event) {
- boost::shared_ptr<RequestWhiteboardUIEvent> requestWhiteboardEvent = boost::dynamic_pointer_cast<RequestWhiteboardUIEvent>(event);
+ void WhiteboardManager::handleUIEvent(std::shared_ptr<UIEvent> event) {
+ std::shared_ptr<RequestWhiteboardUIEvent> requestWhiteboardEvent = std::dynamic_pointer_cast<RequestWhiteboardUIEvent>(event);
if (requestWhiteboardEvent) {
requestSession(requestWhiteboardEvent->getContact());
}
- boost::shared_ptr<AcceptWhiteboardSessionUIEvent> sessionAcceptEvent = boost::dynamic_pointer_cast<AcceptWhiteboardSessionUIEvent>(event);
+ std::shared_ptr<AcceptWhiteboardSessionUIEvent> sessionAcceptEvent = std::dynamic_pointer_cast<AcceptWhiteboardSessionUIEvent>(event);
if (sessionAcceptEvent) {
acceptSession(sessionAcceptEvent->getContact());
}
- boost::shared_ptr<CancelWhiteboardSessionUIEvent> sessionCancelEvent = boost::dynamic_pointer_cast<CancelWhiteboardSessionUIEvent>(event);
+ std::shared_ptr<CancelWhiteboardSessionUIEvent> sessionCancelEvent = std::dynamic_pointer_cast<CancelWhiteboardSessionUIEvent>(event);
if (sessionCancelEvent) {
cancelSession(sessionCancelEvent->getContact());
}
- boost::shared_ptr<ShowWhiteboardUIEvent> showWindowEvent = boost::dynamic_pointer_cast<ShowWhiteboardUIEvent>(event);
+ std::shared_ptr<ShowWhiteboardUIEvent> showWindowEvent = std::dynamic_pointer_cast<ShowWhiteboardUIEvent>(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<IncomingWhiteboardSession>(whiteboardSessionManager_->getSession(from));
+ IncomingWhiteboardSession::ref session = std::dynamic_pointer_cast<IncomingWhiteboardSession>(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 <map>
-
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/JID/JID.h>
#include <Swiften/Whiteboard/IncomingWhiteboardSession.h>
@@ -43,7 +42,7 @@ namespace Swift {
boost::signal< void (const JID&)> onRequestRejected;
private:
- void handleUIEvent(boost::shared_ptr<UIEvent> event);
+ void handleUIEvent(std::shared_ptr<UIEvent> 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<UIEvent> rawEvent) {
- boost::shared_ptr<RequestXMLConsoleUIEvent> event = boost::dynamic_pointer_cast<RequestXMLConsoleUIEvent>(rawEvent);
+void XMLConsoleController::handleUIEvent(std::shared_ptr<UIEvent> rawEvent) {
+ std::shared_ptr<RequestXMLConsoleUIEvent> event = std::dynamic_pointer_cast<RequestXMLConsoleUIEvent>(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 <memory>
+
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/SafeByteArray.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -29,7 +30,7 @@ namespace Swift {
void handleDataWritten(const SafeByteArray& data);
private:
- void handleUIEvent(boost::shared_ptr<UIEvent> event);
+ void handleUIEvent(std::shared_ptr<UIEvent> 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 <cassert>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/JID/JID.h>
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<StanzaEvent> event, events_) {
+ foreach(std::shared_ptr<StanzaEvent> event, events_) {
event->onConclusion.disconnect(boost::bind(&EventController::handleEventConcluded, this, event));
}
}
-void EventController::handleIncomingEvent(boost::shared_ptr<StanzaEvent> sourceEvent) {
- boost::shared_ptr<MessageEvent> messageEvent = boost::dynamic_pointer_cast<MessageEvent>(sourceEvent);
- boost::shared_ptr<SubscriptionRequestEvent> subscriptionEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(sourceEvent);
- boost::shared_ptr<ErrorEvent> errorEvent = boost::dynamic_pointer_cast<ErrorEvent>(sourceEvent);
- boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(sourceEvent);
- boost::shared_ptr<IncomingFileTransferEvent> incomingFileTransferEvent = boost::dynamic_pointer_cast<IncomingFileTransferEvent>(sourceEvent);
+void EventController::handleIncomingEvent(std::shared_ptr<StanzaEvent> sourceEvent) {
+ std::shared_ptr<MessageEvent> messageEvent = std::dynamic_pointer_cast<MessageEvent>(sourceEvent);
+ std::shared_ptr<SubscriptionRequestEvent> subscriptionEvent = std::dynamic_pointer_cast<SubscriptionRequestEvent>(sourceEvent);
+ std::shared_ptr<ErrorEvent> errorEvent = std::dynamic_pointer_cast<ErrorEvent>(sourceEvent);
+ std::shared_ptr<MUCInviteEvent> mucInviteEvent = std::dynamic_pointer_cast<MUCInviteEvent>(sourceEvent);
+ std::shared_ptr<IncomingFileTransferEvent> incomingFileTransferEvent = std::dynamic_pointer_cast<IncomingFileTransferEvent>(sourceEvent);
/* If it's a duplicate subscription request, remove the previous request first */
if (subscriptionEvent) {
EventList existingEvents(events_);
- foreach(boost::shared_ptr<StanzaEvent> existingEvent, existingEvents) {
- boost::shared_ptr<SubscriptionRequestEvent> existingSubscriptionEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(existingEvent);
+ foreach(std::shared_ptr<StanzaEvent> existingEvent, existingEvents) {
+ std::shared_ptr<SubscriptionRequestEvent> existingSubscriptionEvent = std::dynamic_pointer_cast<SubscriptionRequestEvent>(existingEvent);
if (existingSubscriptionEvent) {
if (existingSubscriptionEvent->getJID() == subscriptionEvent->getJID()) {
existingEvent->conclude();
@@ -61,7 +61,7 @@ void EventController::handleIncomingEvent(boost::shared_ptr<StanzaEvent> sourceE
}
}
-void EventController::handleEventConcluded(boost::shared_ptr<StanzaEvent> event) {
+void EventController::handleEventConcluded(std::shared_ptr<StanzaEvent> 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<int>(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 <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/boost_bsignals.h>
#include <Swift/Controllers/XMPPEvents/MessageEvent.h>
#include <Swift/Controllers/XMPPEvents/StanzaEvent.h>
namespace Swift {
- typedef std::vector<boost::shared_ptr<StanzaEvent> > EventList;
+ typedef std::vector<std::shared_ptr<StanzaEvent> > EventList;
class EventController {
public:
EventController();
~EventController();
- void handleIncomingEvent(boost::shared_ptr<StanzaEvent> sourceEvent);
+ void handleIncomingEvent(std::shared_ptr<StanzaEvent> sourceEvent);
boost::signal<void (int)> onEventQueueLengthChange;
- boost::signal<void (boost::shared_ptr<StanzaEvent>)> onEventQueueEventAdded;
+ boost::signal<void (std::shared_ptr<StanzaEvent>)> onEventQueueEventAdded;
const EventList& getEvents() const {return events_;}
void disconnectAll();
void clear();
private:
- void handleEventConcluded(boost::shared_ptr<StanzaEvent> event);
+ void handleEventConcluded(std::shared_ptr<StanzaEvent> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/JID/JID.h>
@@ -15,7 +15,7 @@
namespace Swift {
class IncomingFileTransferEvent : public StanzaEvent {
public:
- typedef boost::shared_ptr<IncomingFileTransferEvent> ref;
+ typedef std::shared_ptr<IncomingFileTransferEvent> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/JID/JID.h>
#include <Swift/Controllers/XMPPEvents/StanzaEvent.h>
@@ -24,7 +23,7 @@ namespace Swift {
class MUCInviteEvent : public StanzaEvent {
public:
- typedef boost::shared_ptr<MUCInviteEvent> ref;
+ typedef std::shared_ptr<MUCInviteEvent> 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 <cassert>
-
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Elements/Message.h>
@@ -17,11 +16,11 @@
namespace Swift {
class MessageEvent : public StanzaEvent {
public:
- typedef boost::shared_ptr<MessageEvent> ref;
+ typedef std::shared_ptr<MessageEvent> ref;
- MessageEvent(boost::shared_ptr<Message> stanza) : stanza_(stanza), targetsMe_(true) {}
+ MessageEvent(std::shared_ptr<Message> stanza) : stanza_(stanza), targetsMe_(true) {}
- boost::shared_ptr<Message> getStanza() {return stanza_;}
+ std::shared_ptr<Message> getStanza() {return stanza_;}
bool isReadable() {
return getStanza()->isError() || !getStanza()->getBody().get_value_or("").empty();
@@ -41,7 +40,7 @@ namespace Swift {
}
private:
- boost::shared_ptr<Message> stanza_;
+ std::shared_ptr<Message> 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 <memory>
+
#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/boost_bsignals.h>
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 <cassert>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/JID/JID.h>
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 <Swift/Controllers/XMPPURIController.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swift/Controllers/UIEvents/RequestChatUIEvent.h>
#include <Swift/Controllers/UIEvents/RequestJoinMUCUIEvent.h>
@@ -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<RequestJoinMUCUIEvent>(uri.getPath()));
+ uiEventStream->send(std::make_shared<RequestJoinMUCUIEvent>(uri.getPath()));
}
else {
- uiEventStream->send(boost::make_shared<RequestChatUIEvent>(uri.getPath()));
+ uiEventStream->send(std::make_shared<RequestChatUIEvent>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <QList>
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 <boost/shared_ptr.hpp>
+#include <memory>
#include <QIcon>
#include <QList>
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 <boost/shared_ptr.hpp>
+#include <memory>
#include <QIcon>
#include <QList>
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<ChatListWhiteboardItem*>(item)) {
if (!whiteboardItem->getChat().isMUC || bookmarksEnabled_) {
- eventStream_->send(boost::make_shared<ShowWhiteboardUIEvent>(whiteboardItem->getChat().jid));
+ eventStream_->send(std::make_shared<ShowWhiteboardUIEvent>(whiteboardItem->getChat().jid));
}
}
}
@@ -143,7 +143,7 @@ void QtChatListWindow::setOnline(bool isOnline) {
void QtChatListWindow::handleRemoveBookmark() {
const ChatListMUCItem* mucItem = dynamic_cast<const ChatListMUCItem*>(contextMenuItem_);
if (!mucItem) return;
- eventStream_->send(boost::shared_ptr<UIEvent>(new RemoveMUCBookmarkUIEvent(mucItem->getBookmark())));
+ eventStream_->send(std::make_shared<RemoveMUCBookmarkUIEvent>(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<UIEvent>(new AddMUCBookmarkUIEvent(bookmark)));
+ eventStream_->send(std::make_shared<AddMUCBookmarkUIEvent>(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<ChatWindow::ChatTextMessagePart> textPart;
+ std::shared_ptr<ChatWindow::ChatTextMessagePart> textPart;
std::string text = "";
- foreach (boost::shared_ptr<ChatWindow::ChatMessagePart> part, message.getParts()) {
- if ((textPart = boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(part))) {
+ foreach (std::shared_ptr<ChatWindow::ChatMessagePart> part, message.getParts()) {
+ if ((textPart = std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <QDateTime>
#include <QString>
@@ -31,7 +31,7 @@ namespace Swift {
virtual const QString& getContent() const = 0;
virtual QString getContinuationElementID() const { return ""; }
- boost::shared_ptr<ChatSnippet> getContinuationFallbackSnippet() const {return continuationFallback_;}
+ std::shared_ptr<ChatSnippet> 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<ChatSnippet> continuationFallback) {
+ void setContinuationFallbackSnippet(std::shared_ptr<ChatSnippet> continuationFallback) {
continuationFallback_ = continuationFallback;
}
private:
bool appendToPrevious_;
- boost::shared_ptr<ChatSnippet> continuationFallback_;
+ std::shared_ptr<ChatSnippet> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <boost/type_traits.hpp>
#include <Cocoa/Cocoa.h>
@@ -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<boost::remove_pointer<CFDataRef>::type> certData(CFDataCreate(nullptr, certAsDER.data(), certAsDER.size()), CFRelease);
- boost::shared_ptr<OpaqueSecCertificateRef> macCert(SecCertificateCreateWithData(nullptr, certData.get()), CFRelease);
+ std::shared_ptr<boost::remove_pointer<CFDataRef>::type> certData(CFDataCreate(nullptr, certAsDER.data(), certAsDER.size()), CFRelease);
+ std::shared_ptr<OpaqueSecCertificateRef> 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<StanzaEvent> event) const {
- boost::shared_ptr<MessageEvent> messageEvent = boost::dynamic_pointer_cast<MessageEvent>(event);
+EventType EventDelegate::getEventType(std::shared_ptr<StanzaEvent> event) const {
+ std::shared_ptr<MessageEvent> messageEvent = std::dynamic_pointer_cast<MessageEvent>(event);
if (messageEvent) {
return MessageEventType;
}
- boost::shared_ptr<SubscriptionRequestEvent> subscriptionEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(event);
+ std::shared_ptr<SubscriptionRequestEvent> subscriptionEvent = std::dynamic_pointer_cast<SubscriptionRequestEvent>(event);
if (subscriptionEvent) {
return SubscriptionEventType;
}
- boost::shared_ptr<ErrorEvent> errorEvent = boost::dynamic_pointer_cast<ErrorEvent>(event);
+ std::shared_ptr<ErrorEvent> errorEvent = std::dynamic_pointer_cast<ErrorEvent>(event);
if (errorEvent) {
return ErrorEventType;
}
- boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(event);
+ std::shared_ptr<MUCInviteEvent> mucInviteEvent = std::dynamic_pointer_cast<MUCInviteEvent>(event);
if (mucInviteEvent) {
return MUCInviteEventType;
}
- boost::shared_ptr<IncomingFileTransferEvent> incomingFileTransferEvent = boost::dynamic_pointer_cast<IncomingFileTransferEvent>(event);
+ std::shared_ptr<IncomingFileTransferEvent> incomingFileTransferEvent = std::dynamic_pointer_cast<IncomingFileTransferEvent>(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<StanzaEvent> event) const;
+ EventType getEventType(std::shared_ptr<StanzaEvent> 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<StanzaEvent> event, bool active) {
+void EventModel::addEvent(std::shared_ptr<StanzaEvent> event, bool active) {
beginResetModel();
if (active) {
activeEvents_.push_front(new QtEvent(event, active));
@@ -87,7 +87,7 @@ void EventModel::addEvent(boost::shared_ptr<StanzaEvent> event, bool active) {
endResetModel();
}
-void EventModel::removeEvent(boost::shared_ptr<StanzaEvent> event) {
+void EventModel::removeEvent(std::shared_ptr<StanzaEvent> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <QAbstractListModel>
#include <QList>
@@ -21,8 +21,8 @@ class EventModel : public QAbstractListModel {
public:
EventModel();
virtual ~EventModel();
- void addEvent(boost::shared_ptr<StanzaEvent> event, bool active);
- void removeEvent(boost::shared_ptr<StanzaEvent> event);
+ void addEvent(std::shared_ptr<StanzaEvent> event, bool active);
+ void removeEvent(std::shared_ptr<StanzaEvent> 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<StanzaEvent> event, bool active) : event_(event) {
+QtEvent::QtEvent(std::shared_ptr<StanzaEvent> event, bool active) : event_(event) {
active_ = active;
}
@@ -38,23 +38,23 @@ QVariant QtEvent::data(int role) {
}
QString QtEvent::sender() {
- boost::shared_ptr<MessageEvent> messageEvent = boost::dynamic_pointer_cast<MessageEvent>(event_);
+ std::shared_ptr<MessageEvent> messageEvent = std::dynamic_pointer_cast<MessageEvent>(event_);
if (messageEvent) {
return P2QSTRING(messageEvent->getStanza()->getFrom().toString());
}
- boost::shared_ptr<SubscriptionRequestEvent> subscriptionRequestEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(event_);
+ std::shared_ptr<SubscriptionRequestEvent> subscriptionRequestEvent = std::dynamic_pointer_cast<SubscriptionRequestEvent>(event_);
if (subscriptionRequestEvent) {
return P2QSTRING(subscriptionRequestEvent->getJID().toBare().toString());
}
- boost::shared_ptr<ErrorEvent> errorEvent = boost::dynamic_pointer_cast<ErrorEvent>(event_);
+ std::shared_ptr<ErrorEvent> errorEvent = std::dynamic_pointer_cast<ErrorEvent>(event_);
if (errorEvent) {
return P2QSTRING(errorEvent->getJID().toBare().toString());
}
- boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(event_);
+ std::shared_ptr<MUCInviteEvent> mucInviteEvent = std::dynamic_pointer_cast<MUCInviteEvent>(event_);
if (mucInviteEvent) {
return P2QSTRING(mucInviteEvent->getInviter().toString());
}
- boost::shared_ptr<IncomingFileTransferEvent> incomingFTEvent = boost::dynamic_pointer_cast<IncomingFileTransferEvent>(event_);
+ std::shared_ptr<IncomingFileTransferEvent> incomingFTEvent = std::dynamic_pointer_cast<IncomingFileTransferEvent>(event_);
if (incomingFTEvent) {
return P2QSTRING(incomingFTEvent->getSender().toString());
}
@@ -62,11 +62,11 @@ QString QtEvent::sender() {
}
QString QtEvent::text() {
- boost::shared_ptr<MessageEvent> messageEvent = boost::dynamic_pointer_cast<MessageEvent>(event_);
+ std::shared_ptr<MessageEvent> messageEvent = std::dynamic_pointer_cast<MessageEvent>(event_);
if (messageEvent) {
return P2QSTRING(messageEvent->getStanza()->getBody().get_value_or(""));
}
- boost::shared_ptr<SubscriptionRequestEvent> subscriptionRequestEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(event_);
+ std::shared_ptr<SubscriptionRequestEvent> subscriptionRequestEvent = std::dynamic_pointer_cast<SubscriptionRequestEvent>(event_);
if (subscriptionRequestEvent) {
std::string reason = subscriptionRequestEvent->getReason();
QString message;
@@ -78,16 +78,16 @@ QString QtEvent::text() {
}
return message;
}
- boost::shared_ptr<ErrorEvent> errorEvent = boost::dynamic_pointer_cast<ErrorEvent>(event_);
+ std::shared_ptr<ErrorEvent> errorEvent = std::dynamic_pointer_cast<ErrorEvent>(event_);
if (errorEvent) {
return P2QSTRING(errorEvent->getText());
}
- boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(event_);
+ std::shared_ptr<MUCInviteEvent> mucInviteEvent = std::dynamic_pointer_cast<MUCInviteEvent>(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<IncomingFileTransferEvent> incomingFTEvent = boost::dynamic_pointer_cast<IncomingFileTransferEvent>(event_);
+ std::shared_ptr<IncomingFileTransferEvent> incomingFTEvent = std::dynamic_pointer_cast<IncomingFileTransferEvent>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <QVariant>
@@ -15,9 +15,9 @@
namespace Swift {
class QtEvent {
public:
- QtEvent(boost::shared_ptr<StanzaEvent> event, bool active);
+ QtEvent(std::shared_ptr<StanzaEvent> event, bool active);
QVariant data(int role);
- boost::shared_ptr<StanzaEvent> getEvent() { return event_; }
+ std::shared_ptr<StanzaEvent> getEvent() { return event_; }
enum EventRoles {
SenderRole = Qt::UserRole
@@ -26,7 +26,7 @@ namespace Swift {
private:
QString text();
QString sender();
- boost::shared_ptr<StanzaEvent> event_;
+ std::shared_ptr<StanzaEvent> 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> messageEvent = boost::dynamic_pointer_cast<MessageEvent>(event->getEvent());
- boost::shared_ptr<SubscriptionRequestEvent> subscriptionEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(event->getEvent());
- boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(event->getEvent());
- boost::shared_ptr<IncomingFileTransferEvent> incomingFTEvent = boost::dynamic_pointer_cast<IncomingFileTransferEvent>(event->getEvent());
- boost::shared_ptr<ErrorEvent> errorEvent = boost::dynamic_pointer_cast<ErrorEvent>(event->getEvent());
+ std::shared_ptr<MessageEvent> messageEvent = std::dynamic_pointer_cast<MessageEvent>(event->getEvent());
+ std::shared_ptr<SubscriptionRequestEvent> subscriptionEvent = std::dynamic_pointer_cast<SubscriptionRequestEvent>(event->getEvent());
+ std::shared_ptr<MUCInviteEvent> mucInviteEvent = std::dynamic_pointer_cast<MUCInviteEvent>(event->getEvent());
+ std::shared_ptr<IncomingFileTransferEvent> incomingFTEvent = std::dynamic_pointer_cast<IncomingFileTransferEvent>(event->getEvent());
+ std::shared_ptr<ErrorEvent> errorEvent = std::dynamic_pointer_cast<ErrorEvent>(event->getEvent());
if (messageEvent) {
if (messageEvent->getStanza()->getType() == Message::Groupchat) {
- eventStream_->send(boost::shared_ptr<UIEvent>(new JoinMUCUIEvent(messageEvent->getStanza()->getFrom().toBare(), messageEvent->getStanza()->getTo().getResource())));
+ eventStream_->send(std::make_shared<JoinMUCUIEvent>(messageEvent->getStanza()->getFrom().toBare(), messageEvent->getStanza()->getTo().getResource()));
} else {
- eventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(messageEvent->getStanza()->getFrom())));
+ eventStream_->send(std::make_shared<RequestChatUIEvent>(messageEvent->getStanza()->getFrom()));
}
} else if (subscriptionEvent) {
QtSubscriptionRequestWindow* window = QtSubscriptionRequestWindow::getWindow(subscriptionEvent, this);
window->show();
} else if (mucInviteEvent) {
- eventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(mucInviteEvent->getInviter())));
+ eventStream_->send(std::make_shared<RequestChatUIEvent>(mucInviteEvent->getInviter()));
mucInviteEvent->conclude();
} else if (incomingFTEvent) {
- eventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(incomingFTEvent->getSender())));
+ eventStream_->send(std::make_shared<RequestChatUIEvent>(incomingFTEvent->getSender()));
incomingFTEvent->conclude();
} else {
if (errorEvent) {
@@ -105,14 +105,14 @@ void QtEventWindow::handleItemActivated(const QModelIndex& item) {
}
-void QtEventWindow::addEvent(boost::shared_ptr<StanzaEvent> event, bool active) {
+void QtEventWindow::addEvent(std::shared_ptr<StanzaEvent> event, bool active) {
view_->clearSelection();
model_->addEvent(event, active);
emit onNewEventCountUpdated(model_->getNewEventCount());
readButton_->setEnabled(model_->rowCount() > 0);
}
-void QtEventWindow::removeEvent(boost::shared_ptr<StanzaEvent> event) {
+void QtEventWindow::removeEvent(std::shared_ptr<StanzaEvent> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <QTreeView>
@@ -25,8 +25,8 @@ namespace Swift {
public:
QtEventWindow(UIEventStream* eventStream);
~QtEventWindow();
- void addEvent(boost::shared_ptr<StanzaEvent> event, bool active);
- void removeEvent(boost::shared_ptr<StanzaEvent> event);
+ void addEvent(std::shared_ptr<StanzaEvent> event, bool active);
+ void removeEvent(std::shared_ptr<StanzaEvent> 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<Swift::Message> message1(new Swift::Message());
+ std::shared_ptr<Swift::Message> message1(new Swift::Message());
message1->setBody("Oooh, shiny");
- boost::shared_ptr<Swift::MessageEvent> event1(new Swift::MessageEvent(message1));
- viewer->addEvent(boost::dynamic_pointer_cast<Swift::StanzaEvent>(event1), true);
+ std::shared_ptr<Swift::MessageEvent> event1(new Swift::MessageEvent(message1));
+ viewer->addEvent(std::dynamic_pointer_cast<Swift::StanzaEvent>(event1), true);
for (int i = 0; i < 100; i++) {
- viewer->addEvent(boost::dynamic_pointer_cast<Swift::StanzaEvent>(event1), false);
+ viewer->addEvent(std::dynamic_pointer_cast<Swift::StanzaEvent>(event1), false);
}
- viewer->addEvent(boost::dynamic_pointer_cast<Swift::StanzaEvent>(boost::make_shared<Swift::ErrorEvent>(Swift::JID("me@example.com"), "Something bad did happen to you.")), true);
+ viewer->addEvent(std::dynamic_pointer_cast<Swift::StanzaEvent>(std::make_shared<Swift::ErrorEvent>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <QAbstractItemModel>
#include <QList>
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<ChatSnippet>(new MessageSnippet(message, sender, time, iconURI, isIncoming, false, theme, id, direction)));
+ setContinuationFallbackSnippet(std::make_shared<MessageSnippet>(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<OutgoingAdHocCommandSession> command) : command_(command) {
+QtAdHocCommandWindow::QtAdHocCommandWindow(std::shared_ptr<OutgoingAdHocCommandSession> 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<OutgoingAdHocCommandSession> command);
+ QtAdHocCommandWindow(std::shared_ptr<OutgoingAdHocCommandSession> command);
virtual ~QtAdHocCommandWindow();
virtual void setOnline(bool online);
@@ -41,7 +41,7 @@ namespace Swift {
void handleCompleteClicked();
private:
- boost::shared_ptr<OutgoingAdHocCommandSession> command_;
+ std::shared_ptr<OutgoingAdHocCommandSession> 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<UIEvent> event(new RequestAdHocWithJIDUIEvent(jid, node));
+ std::shared_ptr<UIEvent> 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<MUCBookmark> bookmark = createBookmarkFromForm();
if (bookmark) {
- eventStream_->send(boost::shared_ptr<UIEvent>(new AddMUCBookmarkUIEvent(*bookmark)));
+ eventStream_->send(std::make_shared<AddMUCBookmarkUIEvent>(*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 <memory>
#include <string>
#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/shared_ptr.hpp>
#include <QWidget>
@@ -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<SecurityLabel> 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<SecurityLabel> 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<SecurityLabel> 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<SecurityLabel> 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 <Swift/QtUI/QtChatWindow.h>
+#include <memory>
+
#include <boost/cstdint.hpp>
#include <boost/lexical_cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <QApplication>
#include <QBoxLayout>
@@ -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<ChatTextMessagePart>(messageText));
+ message.append(std::make_shared<ChatTextMessagePart>(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<SecurityLabel> 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<SecurityLabel> 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<SecurityLabel> 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<SecurityLabel> 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<SecurityLabel> label = availableLabels_[index.row()].getLabel();
+ std::shared_ptr<SecurityLabel> 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<std::string, std::string>& emoticons);
virtual ~QtChatWindow();
- std::string addMessage(const ChatMessage& message, const std::string &senderName, bool senderIsSelf, boost::shared_ptr<SecurityLabel> 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<SecurityLabel> 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<SecurityLabel> 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<SecurityLabel> 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 <map>
+#include <memory>
#include <set>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <QWidget>
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<UIEvent>(new EditMUCBookmarkUIEvent(bookmark_, *bookmark)));
+ eventStream_->send(std::make_shared<EditMUCBookmarkUIEvent>(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 <Swift/QtUI/QtFormWidget.h>
+#include <memory>
+
#include <boost/algorithm/string/join.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <QCheckBox>
#include <QGridLayout>
@@ -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<FormField> field, form_->getFields()) {
- boost::shared_ptr<FormField> resultField = boost::make_shared<FormField>(field->getType());
+ foreach (std::shared_ptr<FormField> field, form_->getFields()) {
+ std::shared_ptr<FormField> resultField = std::make_shared<FormField>(field->getType());
if (field->getType() == FormField::BooleanType) {
resultField->setBoolValue(qobject_cast<QCheckBox*>(fields_[field->getName()])->checkState() == Qt::Checked);
}
@@ -225,7 +226,7 @@ void QtFormWidget::setEditable(bool editable) {
if (!form_) {
return;
}
- foreach (boost::shared_ptr<FormField> field, form_->getFields()) {
+ foreach (std::shared_ptr<FormField> 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 <Swift/QtUI/QtHistoryWindow.h>
+#include <memory>
#include <string>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <QDateTime>
#include <QLineEdit>
@@ -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<ChatSnippet>(new MessageSnippet(messageHTML, QtUtilities::htmlEscape(P2QSTRING(senderName)), qTime, qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), ChatSnippet::getDirection(message))));
+ conversation_->addMessageTop(std::make_shared<MessageSnippet>(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<MessageSnippet>(messageHTML, QtUtilities::htmlEscape(P2QSTRING(senderName)), qTime, qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), ChatSnippet::getDirection(message)));
+ conversation_->addMessageBottom(std::make_shared<MessageSnippet>(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 <Swift/QtUI/QtJoinMUCWindow.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <QToolTip>
@@ -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<JoinMUCUIEvent>(room, password, lastSetNick, ui.joinAutomatically->isChecked(), !ui.instantRoom->isChecked()));
+ uiEventStream->send(std::make_shared<JoinMUCUIEvent>(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 <cassert>
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <QApplication>
#include <QBoxLayout>
@@ -399,12 +399,12 @@ void QtLoginWindow::loginClicked() {
if (!certificateString.empty()) {
#if defined(HAVE_SCHANNEL)
if (isCAPIURI(certificateString)) {
- certificate = boost::make_shared<CAPICertificate>(certificateString, timerFactory_);
+ certificate = std::make_shared<CAPICertificate>(certificateString, timerFactory_);
} else {
- certificate = boost::make_shared<PKCS12Certificate>(certificateString, createSafeByteArray(Q2PSTRING(password_->text())));
+ certificate = std::make_shared<PKCS12Certificate>(certificateString, createSafeByteArray(Q2PSTRING(password_->text())));
}
#else
- certificate = boost::make_shared<PKCS12Certificate>(certificateString, createSafeByteArray(Q2PSTRING(password_->text())));
+ certificate = std::make_shared<PKCS12Certificate>(certificateString, createSafeByteArray(Q2PSTRING(password_->text())));
#endif
}
@@ -454,15 +454,15 @@ void QtLoginWindow::handleAbout() {
}
void QtLoginWindow::handleShowXMLConsole() {
- uiEventStream_->send(boost::make_shared<RequestXMLConsoleUIEvent>());
+ uiEventStream_->send(std::make_shared<RequestXMLConsoleUIEvent>());
}
void QtLoginWindow::handleShowFileTransferOverview() {
- uiEventStream_->send(boost::make_shared<RequestFileTransferListUIEvent>());
+ uiEventStream_->send(std::make_shared<RequestFileTransferListUIEvent>());
}
void QtLoginWindow::handleShowHighlightEditor() {
- uiEventStream_->send(boost::make_shared<RequestHighlightEditorUIEvent>());
+ uiEventStream_->send(std::make_shared<RequestHighlightEditorUIEvent>());
}
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 <boost/bind.hpp>
#include <boost/optional.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <QAction>
#include <QBoxLayout>
@@ -225,7 +225,7 @@ void QtMainWindow::handleShowCertificateInfo() {
}
void QtMainWindow::handleEditBlockingList() {
- uiEventStream_->send(boost::make_shared<RequestBlockListDialogUIEvent>());
+ uiEventStream_->send(std::make_shared<RequestBlockListDialogUIEvent>());
}
void QtMainWindow::handleSomethingSelectedChanged(bool itemSelected) {
@@ -246,7 +246,7 @@ void QtMainWindow::setRosterModel(Roster* roster) {
}
void QtMainWindow::handleEditProfileRequest() {
- uiEventStream_->send(boost::make_shared<RequestProfileEditorUIEvent>());
+ uiEventStream_->send(std::make_shared<RequestProfileEditorUIEvent>());
}
void QtMainWindow::handleEventCountUpdated(int count) {
@@ -272,12 +272,12 @@ void QtMainWindow::handleChatCountUpdated(int count) {
}
void QtMainWindow::handleAddUserActionTriggered(bool /*checked*/) {
- boost::shared_ptr<UIEvent> event(new RequestAddUserDialogUIEvent());
+ std::shared_ptr<UIEvent> event(new RequestAddUserDialogUIEvent());
uiEventStream_->send(event);
}
void QtMainWindow::handleChatUserActionTriggered(bool /*checked*/) {
- boost::shared_ptr<UIEvent> event(new RequestChatWithUserDialogUIEvent());
+ std::shared_ptr<UIEvent> event(new RequestChatWithUserDialogUIEvent());
uiEventStream_->send(event);
}
@@ -291,15 +291,15 @@ void QtMainWindow::handleSignOutAction() {
}
void QtMainWindow::handleEditProfileAction() {
- uiEventStream_->send(boost::make_shared<RequestProfileEditorUIEvent>());
+ uiEventStream_->send(std::make_shared<RequestProfileEditorUIEvent>());
}
void QtMainWindow::handleJoinMUCAction() {
- uiEventStream_->send(boost::make_shared<RequestJoinMUCUIEvent>());
+ uiEventStream_->send(std::make_shared<RequestJoinMUCUIEvent>());
}
void QtMainWindow::handleViewLogsAction() {
- uiEventStream_->send(boost::make_shared<RequestHistoryUIEvent>());
+ uiEventStream_->send(std::make_shared<RequestHistoryUIEvent>());
}
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<ContactRosterItem> contact) {
+void QtMainWindow::setMyContactRosterItem(std::shared_ptr<ContactRosterItem> contact) {
meView_->setContactRosterItem(contact);
}
@@ -393,7 +393,7 @@ void QtMainWindow::handleAdHocActionTriggered(bool /*checked*/) {
QAction* action = qobject_cast<QAction*>(sender());
assert(action);
DiscoItems::Item command = serverAdHocCommands_[serverAdHocCommandActions_.indexOf(action)];
- uiEventStream_->send(boost::shared_ptr<UIEvent>(new RequestAdHocUIEvent(command)));
+ uiEventStream_->send(std::make_shared<RequestAdHocUIEvent>(command));
}
void QtMainWindow::setAvailableAdHocCommands(const std::vector<DiscoItems::Item>& 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<ContactRosterItem> contact);
+ void setMyContactRosterItem(std::shared_ptr<ContactRosterItem> contact);
void setConnecting();
void setStreamEncryptionStatus(bool tlsInPlaceAndValid);
void openCertificateDialog(const std::vector<Certificate::ref>& 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<ChatWindow::ChatMessagePart> part, message.getParts()) {
- boost::shared_ptr<ChatWindow::ChatTextMessagePart> textPart;
- boost::shared_ptr<ChatWindow::ChatURIMessagePart> uriPart;
- boost::shared_ptr<ChatWindow::ChatEmoticonMessagePart> emoticonPart;
- boost::shared_ptr<ChatWindow::ChatHighlightingMessagePart> highlightPart;
+ foreach (std::shared_ptr<ChatWindow::ChatMessagePart> part, message.getParts()) {
+ std::shared_ptr<ChatWindow::ChatTextMessagePart> textPart;
+ std::shared_ptr<ChatWindow::ChatURIMessagePart> uriPart;
+ std::shared_ptr<ChatWindow::ChatEmoticonMessagePart> emoticonPart;
+ std::shared_ptr<ChatWindow::ChatHighlightingMessagePart> highlightPart;
- if ((textPart = boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(part))) {
+ if ((textPart = std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(part))) {
QString text = QtUtilities::htmlEscape(P2QSTRING(textPart->text));
text.replace("\n","<br/>");
result += text;
continue;
}
- if ((uriPart = boost::dynamic_pointer_cast<ChatWindow::ChatURIMessagePart>(part))) {
+ if ((uriPart = std::dynamic_pointer_cast<ChatWindow::ChatURIMessagePart>(part))) {
QString uri = QtUtilities::htmlEscape(P2QSTRING(uriPart->target));
result += "<a href='" + uri + "' >" + uri + "</a>";
continue;
}
- if ((emoticonPart = boost::dynamic_pointer_cast<ChatWindow::ChatEmoticonMessagePart>(part))) {
+ if ((emoticonPart = std::dynamic_pointer_cast<ChatWindow::ChatEmoticonMessagePart>(part))) {
result += P2QSTRING(emoticonPart->alternativeText);
continue;
}
- if ((highlightPart = boost::dynamic_pointer_cast<ChatWindow::ChatHighlightingMessagePart>(part))) {
+ if ((highlightPart = std::dynamic_pointer_cast<ChatWindow::ChatHighlightingMessagePart>(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<SecurityLabel> 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<SecurityLabel> label, const std::string& /*avatarPath*/, const boost::posix_time::ptime& time) {
QString text = "<p>";
if (label) {
text += P2QSTRING(label->getLabel()) + "<br/>";
@@ -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<SecurityLabel> 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<SecurityLabel> label, const std::string& /*avatarPath*/, const boost::posix_time::ptime& time) {
QString text = "<p>";
if (label) {
text += P2QSTRING(label->getLabel()) + "<br/>";
@@ -328,7 +328,7 @@ void QtPlainChatView::acceptMUCInvite()
{
AcceptMUCInviteAction *action = dynamic_cast<AcceptMUCInviteAction*>(sender());
if (action) {
- eventStream_->send(boost::make_shared<JoinMUCUIEvent>(action->jid_.toString(), action->password_, boost::optional<std::string>(), false, false, action->isImpromptu_, action->isContinuation_));
+ eventStream_->send(std::make_shared<JoinMUCUIEvent>(action->jid_.toString(), action->password_, boost::optional<std::string>(), 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 <memory>
#include <string>
#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/shared_ptr.hpp>
#include <QTextEdit>
#include <QWidget>
@@ -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<SecurityLabel> /*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<SecurityLabel> /*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<SecurityLabel> /*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<SecurityLabel> /*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<std::string, boost::shared_ptr<SecurityLabel> > lastMessageLabel_;
+ std::map<std::string, std::shared_ptr<SecurityLabel> > 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<ContactRosterItem> contact) {
+void QtRosterHeader::setContactRosterItem(std::shared_ptr<ContactRosterItem> 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<ContactRosterItem> contact);
+ void setContactRosterItem(std::shared_ptr<ContactRosterItem> 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<ContactRosterItem> contact_;
+ std::shared_ptr<ContactRosterItem> 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 <Swift/QtUI/QtSwiftUtil.h>
namespace Swift {
-QtSubscriptionRequestWindow::QtSubscriptionRequestWindow(boost::shared_ptr<SubscriptionRequestEvent> event, QWidget* parent) : QDialog(parent), event_(event) {
+QtSubscriptionRequestWindow::QtSubscriptionRequestWindow(std::shared_ptr<SubscriptionRequestEvent> 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<SubscriptionRequestEvent> event, QWidget* parent) {
+QtSubscriptionRequestWindow* QtSubscriptionRequestWindow::getWindow(std::shared_ptr<SubscriptionRequestEvent> 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<SubscriptionRequestEvent> QtSubscriptionRequestWindow::getEvent() {
+std::shared_ptr<SubscriptionRequestEvent> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <QDialog>
@@ -16,17 +16,17 @@ namespace Swift {
class QtSubscriptionRequestWindow : public QDialog {
Q_OBJECT
public:
- static QtSubscriptionRequestWindow* getWindow(boost::shared_ptr<SubscriptionRequestEvent> event, QWidget* parent = nullptr);
+ static QtSubscriptionRequestWindow* getWindow(std::shared_ptr<SubscriptionRequestEvent> event, QWidget* parent = nullptr);
~QtSubscriptionRequestWindow();
- boost::shared_ptr<SubscriptionRequestEvent> getEvent();
+ std::shared_ptr<SubscriptionRequestEvent> getEvent();
private slots:
void handleYes();
void handleNo();
void handleDefer();
private:
- QtSubscriptionRequestWindow(boost::shared_ptr<SubscriptionRequestEvent> event, QWidget* parent = nullptr);
+ QtSubscriptionRequestWindow(std::shared_ptr<SubscriptionRequestEvent> event, QWidget* parent = nullptr);
static QList<QtSubscriptionRequestWindow*> windows_;
- boost::shared_ptr<SubscriptionRequestEvent> event_;
+ std::shared_ptr<SubscriptionRequestEvent> 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> whiteboardSession) {
+WhiteboardWindow* QtUIFactory::createWhiteboardWindow(std::shared_ptr<WhiteboardSession> whiteboardSession) {
return new QtWhiteboardWindow(whiteboardSession);
}
@@ -171,7 +171,7 @@ BlockListEditorWidget *QtUIFactory::createBlockListEditorWidget() {
return new QtBlockListEditorWindow();
}
-AdHocCommandWindow* QtUIFactory::createAdHocCommandWindow(boost::shared_ptr<OutgoingAdHocCommandSession> command) {
+AdHocCommandWindow* QtUIFactory::createAdHocCommandWindow(std::shared_ptr<OutgoingAdHocCommandSession> 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> whiteboardSession);
+ virtual WhiteboardWindow* createWhiteboardWindow(std::shared_ptr<WhiteboardSession> whiteboardSession);
virtual HighlightEditorWindow* createHighlightEditorWindow();
virtual BlockListEditorWidget* createBlockListEditorWidget();
- virtual AdHocCommandWindow* createAdHocCommandWindow(boost::shared_ptr<OutgoingAdHocCommandSession> command);
+ virtual AdHocCommandWindow* createAdHocCommandWindow(std::shared_ptr<OutgoingAdHocCommandSession> 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<QtVCardInternetEMailField::FieldInfo>());
- addFieldType(menu, boost::make_shared<QtVCardTelephoneField::FieldInfo>());
- addFieldType(menu, boost::make_shared<QtVCardAddressField::FieldInfo>());
- addFieldType(menu, boost::make_shared<QtVCardAddressLabelField::FieldInfo>());
- addFieldType(menu, boost::make_shared<QtVCardBirthdayField::FieldInfo>());
- addFieldType(menu, boost::make_shared<QtVCardJIDField::FieldInfo>());
- addFieldType(menu, boost::make_shared<QtVCardDescriptionField::FieldInfo>());
- addFieldType(menu, boost::make_shared<QtVCardRoleField::FieldInfo>());
- addFieldType(menu, boost::make_shared<QtVCardTitleField::FieldInfo>());
- addFieldType(menu, boost::make_shared<QtVCardOrganizationField::FieldInfo>());
- addFieldType(menu, boost::make_shared<QtVCardURLField::FieldInfo>());
+ addFieldType(menu, std::make_shared<QtVCardInternetEMailField::FieldInfo>());
+ addFieldType(menu, std::make_shared<QtVCardTelephoneField::FieldInfo>());
+ addFieldType(menu, std::make_shared<QtVCardAddressField::FieldInfo>());
+ addFieldType(menu, std::make_shared<QtVCardAddressLabelField::FieldInfo>());
+ addFieldType(menu, std::make_shared<QtVCardBirthdayField::FieldInfo>());
+ addFieldType(menu, std::make_shared<QtVCardJIDField::FieldInfo>());
+ addFieldType(menu, std::make_shared<QtVCardDescriptionField::FieldInfo>());
+ addFieldType(menu, std::make_shared<QtVCardRoleField::FieldInfo>());
+ addFieldType(menu, std::make_shared<QtVCardTitleField::FieldInfo>());
+ addFieldType(menu, std::make_shared<QtVCardOrganizationField::FieldInfo>());
+ addFieldType(menu, std::make_shared<QtVCardURLField::FieldInfo>());
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>(*vcard);
+ this->vcard = std::make_shared<VCard>(*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<QAction*>(sender()))) {
- boost::shared_ptr<QtVCardFieldInfo> fieldInfo = actionFieldInfo[action];
+ std::shared_ptr<QtVCardFieldInfo> fieldInfo = actionFieldInfo[action];
QWidget* newField = fieldInfo->createFieldInstance(this, ui->cardFields, true);
QtVCardGeneralField* newGeneralField = dynamic_cast<QtVCardGeneralField*>(newField);
if (newGeneralField) {
@@ -341,7 +341,7 @@ void QtVCardWidget::removeField(QtVCardGeneralField *field) {
delete field;
}
-void QtVCardWidget::addFieldType(QMenu* menu, boost::shared_ptr<QtVCardFieldInfo> fieldType) {
+void QtVCardWidget::addFieldType(QMenu* menu, std::shared_ptr<QtVCardFieldInfo> 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<QtVCardFieldInfo
}
}
-int QtVCardWidget::fieldTypeInstances(boost::shared_ptr<QtVCardFieldInfo> fieldType) {
+int QtVCardWidget::fieldTypeInstances(std::shared_ptr<QtVCardFieldInfo> 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 <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <QToolButton>
#include <QWidget>
@@ -53,8 +53,8 @@ namespace Swift {
void removeField(QtVCardGeneralField* field);
private:
- void addFieldType(QMenu*, boost::shared_ptr<QtVCardFieldInfo>);
- int fieldTypeInstances(boost::shared_ptr<QtVCardFieldInfo>);
+ void addFieldType(QMenu*, std::shared_ptr<QtVCardFieldInfo>);
+ int fieldTypeInstances(std::shared_ptr<QtVCardFieldInfo>);
void clearFields();
void clearEmptyFields();
void appendField(QtVCardGeneralField* field);
@@ -67,7 +67,7 @@ namespace Swift {
bool editable;
QMenu* menu;
std::list<QtVCardGeneralField*> fields;
- std::map<QAction*, boost::shared_ptr<QtVCardFieldInfo> > actionFieldInfo;
+ std::map<QAction*, std::shared_ptr<QtVCardFieldInfo> > 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<ChatSnippet> snippet) {
+void QtWebKitChatView::addMessageBottom(std::shared_ptr<ChatSnippet> snippet) {
if (viewReady_) {
addToDOM(snippet);
} else {
@@ -127,12 +127,12 @@ void QtWebKitChatView::addMessageBottom(boost::shared_ptr<ChatSnippet> snippet)
}
}
-void QtWebKitChatView::addMessageTop(boost::shared_ptr<ChatSnippet> /* snippet */) {
+void QtWebKitChatView::addMessageTop(std::shared_ptr<ChatSnippet> /* snippet */) {
// TODO: Implement this in a sensible manner later.
assert(false);
}
-void QtWebKitChatView::addToDOM(boost::shared_ptr<ChatSnippet> snippet) {
+void QtWebKitChatView::addToDOM(std::shared_ptr<ChatSnippet> 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<SecurityLabel> label,
+ std::shared_ptr<SecurityLabel> 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<ChatWindow::ChatMessagePart> part, message.getParts()) {
- boost::shared_ptr<ChatWindow::ChatTextMessagePart> textPart;
- boost::shared_ptr<ChatWindow::ChatURIMessagePart> uriPart;
- boost::shared_ptr<ChatWindow::ChatEmoticonMessagePart> emoticonPart;
- boost::shared_ptr<ChatWindow::ChatHighlightingMessagePart> highlightPart;
+ foreach (std::shared_ptr<ChatWindow::ChatMessagePart> part, message.getParts()) {
+ std::shared_ptr<ChatWindow::ChatTextMessagePart> textPart;
+ std::shared_ptr<ChatWindow::ChatURIMessagePart> uriPart;
+ std::shared_ptr<ChatWindow::ChatEmoticonMessagePart> emoticonPart;
+ std::shared_ptr<ChatWindow::ChatHighlightingMessagePart> highlightPart;
- if ((textPart = boost::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(part))) {
+ if ((textPart = std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(part))) {
QString text = QtUtilities::htmlEscape(P2QSTRING(textPart->text));
text.replace("\n","<br/>");
result += text;
continue;
}
- if ((uriPart = boost::dynamic_pointer_cast<ChatWindow::ChatURIMessagePart>(part))) {
+ if ((uriPart = std::dynamic_pointer_cast<ChatWindow::ChatURIMessagePart>(part))) {
QString uri = QtUtilities::htmlEscape(P2QSTRING(uriPart->target));
result += "<a href='" + uri + "' >" + uri + "</a>";
continue;
}
- if ((emoticonPart = boost::dynamic_pointer_cast<ChatWindow::ChatEmoticonMessagePart>(part))) {
+ if ((emoticonPart = std::dynamic_pointer_cast<ChatWindow::ChatEmoticonMessagePart>(part))) {
QString textStyle = showEmoticons_ ? "style='display:none'" : "";
QString imageStyle = showEmoticons_ ? "" : "style='display:none'";
result += "<span class='swift_emoticon_image' " + imageStyle + "><img src='" + P2QSTRING(emoticonPart->imagePath) + "'/></span><span class='swift_emoticon_text' " + textStyle + ">" + QtUtilities::htmlEscape(P2QSTRING(emoticonPart->alternativeText)) + "</span>";
continue;
}
- if ((highlightPart = boost::dynamic_pointer_cast<ChatWindow::ChatHighlightingMessagePart>(part))) {
+ if ((highlightPart = std::dynamic_pointer_cast<ChatWindow::ChatHighlightingMessagePart>(part))) {
QString spanStart = getHighlightSpanStart(highlightPart->action.getTextColor(), highlightPart->action.getTextBackground());
result += spanStart + QtUtilities::htmlEscape(P2QSTRING(highlightPart->text)) + "</span>";
continue;
@@ -536,7 +536,7 @@ std::string QtWebKitChatView::addMessage(
const QString& message,
const std::string& senderName,
bool senderIsSelf,
- boost::shared_ptr<SecurityLabel> label,
+ std::shared_ptr<SecurityLabel> 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<std::string>(idCounter_++);
- addMessageBottom(boost::make_shared<MessageSnippet>(htmlString, QtUtilities::htmlEscape(P2QSTRING(senderName)), B2QDATE(time), qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), direction));
+ addMessageBottom(std::make_shared<MessageSnippet>(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<SecurityLabel> 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<SecurityLabel> 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
"</div>";
}
- //addMessage(message, senderName, senderIsSelf, boost::shared_ptr<SecurityLabel>(), "", boost::posix_time::second_clock::local_time());
+ //addMessage(message, senderName, senderIsSelf, std::shared_ptr<SecurityLabel>(), "", 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<std::string>(idCounter_++);
- addMessageBottom(boost::make_shared<MessageSnippet>(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<MessageSnippet>(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<std::string>(idCounter_++);
- addMessageBottom(boost::make_shared<MessageSnippet>(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<MessageSnippet>(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<JoinMUCUIEvent>(Q2PSTRING(roomJID), Q2PSTRING(password), boost::optional<std::string>(), false, false, isImpromptu.contains("true"), isContinuation.contains("true")));
+ eventStream_->send(std::make_shared<JoinMUCUIEvent>(Q2PSTRING(roomJID), Q2PSTRING(password), boost::optional<std::string>(), 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<std::string>(idCounter_++);
- addMessageBottom(boost::make_shared<SystemMessageSnippet>("<span class=\"error\">" + errorMessageHTML + "</span>", QDateTime::currentDateTime(), false, theme_, P2QSTRING(id), ChatSnippet::getDirection(errorMessage)));
+ addMessageBottom(std::make_shared<SystemMessageSnippet>("<span class=\"error\">" + errorMessageHTML + "</span>", 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<std::string>(idCounter_++);
- addMessageBottom(boost::make_shared<SystemMessageSnippet>(messageHTML, QDateTime::currentDateTime(), false, theme_, P2QSTRING(id), getActualDirection(message, direction)));
+ addMessageBottom(std::make_shared<SystemMessageSnippet>(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<std::string>(idCounter_++);
- addMessageBottom(boost::make_shared<SystemMessageSnippet>(messageHTML, QDateTime::currentDateTime(), false, theme_, P2QSTRING(id), getActualDirection(message, direction)));
+ addMessageBottom(std::make_shared<SystemMessageSnippet>(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<MessageSnippet>(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<MessageSnippet>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <QList>
#include <QString>
@@ -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<SecurityLabel> 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<SecurityLabel> 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<SecurityLabel> 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<SecurityLabel> 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<ChatSnippet> snippet);
- void addMessageBottom(boost::shared_ptr<ChatSnippet> snippet);
+ void addMessageTop(std::shared_ptr<ChatSnippet> snippet);
+ void addMessageBottom(std::shared_ptr<ChatSnippet> 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<SecurityLabel> label,
+ std::shared_ptr<SecurityLabel> 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<ChatSnippet> snippet);
+ void addToDOM(std::shared_ptr<ChatSnippet> 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<UIEvent>(new RequestChatUIEvent(target)));
+ eventStream_->send(std::make_shared<RequestChatUIEvent>(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<RosterItem*>(index.internalPointer());
if (ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item)) {
- eventStream_->send(boost::make_shared<RequestContactEditorUIEvent>(contact->getJID()));
+ eventStream_->send(std::make_shared<RequestContactEditorUIEvent>(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<RequestContactEditorUIEvent>(contact->getJID()));
+ eventStream_->send(std::make_shared<RequestContactEditorUIEvent>(contact->getJID()));
}
else if (result == removeContact) {
if (QtContactEditWindow::confirmContactDeletion(contact->getJID())) {
- eventStream_->send(boost::make_shared<RemoveRosterItemUIEvent>(contact->getJID()));
+ eventStream_->send(std::make_shared<RemoveRosterItemUIEvent>(contact->getJID()));
}
}
else if (result == showProfileForContact) {
- eventStream_->send(boost::make_shared<ShowProfileForRosterItemUIEvent>(contact->getJID()));
+ eventStream_->send(std::make_shared<ShowProfileForRosterItemUIEvent>(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>(RequestChangeBlockStateUIEvent::Unblocked, contact->getJID().getDomain()));
+ eventStream_->send(std::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Unblocked, contact->getJID().getDomain()));
}
} else {
- eventStream_->send(boost::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Unblocked, contact->getJID()));
+ eventStream_->send(std::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Unblocked, contact->getJID()));
}
}
else if (blockContact && result == blockContact) {
- eventStream_->send(boost::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Blocked, contact->getJID()));
+ eventStream_->send(std::make_shared<RequestChangeBlockStateUIEvent>(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<SendFileUIEvent>(contact->getJID(), Q2PSTRING(fileName)));
+ eventStream_->send(std::make_shared<SendFileUIEvent>(contact->getJID(), Q2PSTRING(fileName)));
}
}
#endif
#ifdef SWIFT_EXPERIMENTAL_WB
else if (startWhiteboardChat && result == startWhiteboardChat) {
- eventStream_->send(boost::make_shared<RequestWhiteboardUIEvent>(contact->getJID()));
+ eventStream_->send(std::make_shared<RequestWhiteboardUIEvent>(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<RenameGroupUIEvent>(group->getDisplayName(), Q2PSTRING(newName)));
+ eventStream_->send(std::make_shared<RenameGroupUIEvent>(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 <Swift/QtUI/Roster/QtTreeWidget.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <QLabel>
#include <QMimeData>
@@ -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<UIEvent>(new RequestChatUIEvent(target)));
+ eventStream_->send(std::make_shared<RequestChatUIEvent>(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<SendFileUIEvent>(contact->getJID(), Q2PSTRING(filename)));
+ eventStream_->send(std::make_shared<SendFileUIEvent>(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<ChatSnippet>(new SystemMessageSnippet(message, time, false, theme, id, direction)));
+ setContinuationFallbackSnippet(std::make_shared<SystemMessageSnippet>(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>();
+ Contact::ref manualContact = std::make_shared<Contact>();
manualContact->name = jid.toString();
manualContact->jid = jid;
return manualContact;
}
}
- return boost::shared_ptr<Contact>();
+ return std::shared_ptr<Contact>();
}
void QtSuggestingJIDInput::setSuggestions(const std::vector<Contact::ref>& 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 <Swift/QtUI/UserSearch/QtUserSearchWindow.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <QItemDelegate>
#include <QModelIndex>
@@ -132,11 +133,11 @@ void QtUserSearchWindow::handleAccepted() {
switch(type_) {
case AddContact:
jid = getContactJID();
- eventStream_->send(boost::make_shared<AddContactUIEvent>(jid, detailsPage_->getName(), detailsPage_->getSelectedGroups()));
+ eventStream_->send(std::make_shared<AddContactUIEvent>(jid, detailsPage_->getName(), detailsPage_->getSelectedGroups()));
break;
case ChatToContact:
if (contactVector_.size() == 1) {
- boost::shared_ptr<UIEvent> event(new RequestChatUIEvent(contactVector_[0]->jid));
+ std::shared_ptr<UIEvent> 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<CreateImpromptuMUCUIEvent>(jids, JID(), Q2PSTRING(firstMultiJIDPage_->reason_->text())));
+ eventStream_->send(std::make_shared<CreateImpromptuMUCUIEvent>(jids, JID(), Q2PSTRING(firstMultiJIDPage_->reason_->text())));
break;
case InviteToChat:
foreach(Contact::ref contact, contactVector_) {
jids.push_back(contact->jid);
}
- eventStream_->send(boost::make_shared<InviteToMUCUIEvent>(roomJID_, jids, Q2PSTRING(firstMultiJIDPage_->reason_->text())));
+ eventStream_->send(std::make_shared<InviteToMUCUIEvent>(roomJID_, jids, Q2PSTRING(firstMultiJIDPage_->reason_->text())));
break;
}
}
@@ -229,7 +230,7 @@ void QtUserSearchWindow::handleFirstPageRadioChange() {
}
void QtUserSearchWindow::handleSearch() {
- boost::shared_ptr<SearchPayload> search(new SearchPayload());
+ std::shared_ptr<SearchPayload> 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<Contact>("", getContactJID(), StatusShow::None, "");
+ return std::make_shared<Contact>("", getContactJID(), StatusShow::None, "");
}
void QtUserSearchWindow::addSearchedJIDToList(const Contact::ref& contact) {
@@ -330,7 +331,7 @@ void QtUserSearchWindow::addSavedServices(const std::vector<JID>& services) {
}
}
-void QtUserSearchWindow::setSearchFields(boost::shared_ptr<SearchPayload> fields) {
+void QtUserSearchWindow::setSearchFields(std::shared_ptr<SearchPayload> fields) {
fieldsPage_->fetchingThrobber_->hide();
fieldsPage_->fetchingThrobber_->movie()->stop();
fieldsPage_->fetchingLabel_->hide();
@@ -375,7 +376,7 @@ void QtUserSearchWindow::setContactSuggestions(const std::vector<Contact::ref>&
void QtUserSearchWindow::setJIDs(const std::vector<JID> &jids) {
foreach(JID jid, jids) {
- addSearchedJIDToList(boost::make_shared<Contact>("", jid, StatusShow::None, ""));
+ addSearchedJIDToList(std::make_shared<Contact>("", 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<SearchPayload> fields);
+ virtual void setSearchFields(std::shared_ptr<SearchPayload> fields);
virtual void setNameSuggestions(const std::vector<std::string>& suggestions);
virtual void prepopulateJIDAndName(const JID& jid, const std::string& name);
virtual void setContactSuggestions(const std::vector<Contact::ref>& 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <QAbstractItemModel>
#include <QList>
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 <Swift/QtUI/Whiteboard/QtWhiteboardWindow.h>
#include <iostream>
+#include <memory>
#include <boost/bind.hpp>
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <QLabel>
#include <QMessageBox>
@@ -154,13 +154,13 @@ namespace Swift {
}
void QtWhiteboardWindow::handleWhiteboardOperationReceive(const WhiteboardOperation::ref operation) {
- WhiteboardInsertOperation::ref insertOp = boost::dynamic_pointer_cast<WhiteboardInsertOperation>(operation);
+ WhiteboardInsertOperation::ref insertOp = std::dynamic_pointer_cast<WhiteboardInsertOperation>(operation);
if (insertOp) {
WhiteboardElementDrawingVisitor visitor(graphicsView, operation->getPos(), GView::New);
insertOp->getElement()->accept(visitor);
}
- WhiteboardUpdateOperation::ref updateOp = boost::dynamic_pointer_cast<WhiteboardUpdateOperation>(operation);
+ WhiteboardUpdateOperation::ref updateOp = std::dynamic_pointer_cast<WhiteboardUpdateOperation>(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<WhiteboardDeleteOperation>(operation);
+ WhiteboardDeleteOperation::ref deleteOp = std::dynamic_pointer_cast<WhiteboardDeleteOperation>(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<WhiteboardLineElement>(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<WhiteboardLineElement>(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<FreehandLineItem*>(item);
if (freehandLineItem != nullptr) {
- WhiteboardFreehandPathElement::ref element = boost::make_shared<WhiteboardFreehandPathElement>();
+ WhiteboardFreehandPathElement::ref element = std::make_shared<WhiteboardFreehandPathElement>();
QColor color = freehandLineItem->pen().color();
std::vector<std::pair<int, int> > points;
QVector<QPointF>::const_iterator it = freehandLineItem->points().constBegin();
@@ -292,7 +292,7 @@ namespace Swift {
QGraphicsRectItem* rectItem = qgraphicsitem_cast<QGraphicsRectItem*>(item);
if (rectItem != nullptr) {
QRectF rect = rectItem->rect();
- WhiteboardRectElement::ref element = boost::make_shared<WhiteboardRectElement>(rect.x()+item->pos().x(), rect.y()+item->pos().y(), rect.width(), rect.height());
+ WhiteboardRectElement::ref element = std::make_shared<WhiteboardRectElement>(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<QGraphicsTextItem*>(item);
if (textItem != nullptr) {
QPointF point = textItem->pos();
- WhiteboardTextElement::ref element = boost::make_shared<WhiteboardTextElement>(point.x(), point.y());
+ WhiteboardTextElement::ref element = std::make_shared<WhiteboardTextElement>(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<QGraphicsPolygonItem*>(item);
if (polygonItem) {
- WhiteboardPolygonElement::ref element = boost::make_shared<WhiteboardPolygonElement>();
+ WhiteboardPolygonElement::ref element = std::make_shared<WhiteboardPolygonElement>();
QPolygonF polygon = polygonItem->polygon();
std::vector<std::pair<int, int> > points;
QVector<QPointF>::const_iterator it = polygon.begin();
@@ -348,7 +348,7 @@ namespace Swift {
int cy = boost::numeric_cast<int>(rect.y()+rect.height()/2 + item->pos().y());
int rx = boost::numeric_cast<int>(rect.width()/2);
int ry = boost::numeric_cast<int>(rect.height()/2);
- WhiteboardEllipseElement::ref element = boost::make_shared<WhiteboardEllipseElement>(cx, cy, rx, ry);
+ WhiteboardEllipseElement::ref element = std::make_shared<WhiteboardEllipseElement>(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>();
+ WhiteboardInsertOperation::ref insertOp = std::make_shared<WhiteboardInsertOperation>();
insertOp->setPos(pos);
insertOp->setElement(el);
whiteboardSession_->sendOperation(insertOp);
} else {
- WhiteboardUpdateOperation::ref updateOp = boost::make_shared<WhiteboardUpdateOperation>();
+ WhiteboardUpdateOperation::ref updateOp = std::make_shared<WhiteboardUpdateOperation>();
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>();
+ WhiteboardDeleteOperation::ref deleteOp = std::make_shared<WhiteboardDeleteOperation>();
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 <cryptuiapi.h>
#pragma comment(lib, "cryptui.lib")
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
@@ -35,7 +35,7 @@ void WinUIHelpers::displayCertificateChainAsSheet(QWidget* parent, const std::ve
}
ByteArray certAsDER = chain[0]->toDER();
- boost::shared_ptr<const CERT_CONTEXT> certificate_chain;
+ std::shared_ptr<const CERT_CONTEXT> 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 <Swiften/AdHoc/OutgoingAdHocCommandSession.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Algorithm.h>
#include <Swiften/Queries/GenericRequest.h>
@@ -21,7 +22,7 @@ OutgoingAdHocCommandSession::~OutgoingAdHocCommandSession() {
connection_.disconnect();
}
-void OutgoingAdHocCommandSession::handleResponse(boost::shared_ptr<Command> payload, ErrorPayload::ref error) {
+void OutgoingAdHocCommandSession::handleResponse(std::shared_ptr<Command> payload, ErrorPayload::ref error) {
if (error) {
onError(error);
} else {
@@ -61,7 +62,7 @@ bool OutgoingAdHocCommandSession::getIsMultiStage() const {
}
void OutgoingAdHocCommandSession::start() {
- boost::shared_ptr<GenericRequest<Command> > commandRequest = boost::make_shared< GenericRequest<Command> >(IQ::Set, to_, boost::make_shared<Command>(commandNode_), iqRouter_);
+ std::shared_ptr<GenericRequest<Command> > commandRequest = std::make_shared< GenericRequest<Command> >(IQ::Set, to_, std::make_shared<Command>(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> command(boost::make_shared<Command>(commandNode_, sessionID_, action));
+ std::shared_ptr<Command> command(std::make_shared<Command>(commandNode_, sessionID_, action));
command->setForm(form);
- boost::shared_ptr<GenericRequest<Command> > commandRequest = boost::make_shared< GenericRequest<Command> >(IQ::Set, to_, command, iqRouter_);
+ std::shared_ptr<GenericRequest<Command> > commandRequest = std::make_shared< GenericRequest<Command> >(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 <map>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/Command.h>
@@ -84,7 +83,7 @@ namespace Swift {
ActionState getActionState(Command::Action action) const;
private:
- void handleResponse(boost::shared_ptr<Command> payload, ErrorPayload::ref error);
+ void handleResponse(std::shared_ptr<Command> 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<DummyStanzaChannel>();
- iqRouter = boost::make_shared<IQRouter>(stanzaChannel.get());
- crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
- vcardStorage = boost::make_shared<VCardMemoryStorage>(crypto.get());
- vcardManager = boost::make_shared<VCardManager>(ownerJID, iqRouter.get(), vcardStorage.get());
- avatarStorage = boost::make_shared<AvatarMemoryStorage>();
- mucRegistry = boost::make_shared<DummyMUCRegistry>();
- avatarManager = boost::make_shared<AvatarManagerImpl>(vcardManager.get(), stanzaChannel.get(), avatarStorage.get(), crypto.get(), mucRegistry.get());
+ stanzaChannel = std::make_shared<DummyStanzaChannel>();
+ iqRouter = std::make_shared<IQRouter>(stanzaChannel.get());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ vcardStorage = std::make_shared<VCardMemoryStorage>(crypto.get());
+ vcardManager = std::make_shared<VCardManager>(ownerJID, iqRouter.get(), vcardStorage.get());
+ avatarStorage = std::make_shared<AvatarMemoryStorage>();
+ mucRegistry = std::make_shared<DummyMUCRegistry>();
+ avatarManager = std::make_shared<AvatarManagerImpl>(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> vcardUpdate = boost::make_shared<VCardUpdate>();
+ std::shared_ptr<VCardUpdate> vcardUpdate = std::make_shared<VCardUpdate>();
vcardUpdate->setPhotoHash(Hexify::hexify(crypto->getSHA1Hash(fullAvatar)));
- boost::shared_ptr<Presence> presence = boost::make_shared<Presence>();
+ std::shared_ptr<Presence> presence = std::make_shared<Presence>();
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<IQ> request = boost::dynamic_pointer_cast<IQ>(stanzaChannel->sentStanzas[0]);
+ std::shared_ptr<IQ> request = std::dynamic_pointer_cast<IQ>(stanzaChannel->sentStanzas[0]);
stanzaChannel->sentStanzas.pop_back();
CPPUNIT_ASSERT(!!request);
- boost::shared_ptr<VCard> vcard = request->getPayload<VCard>();
+ std::shared_ptr<VCard> vcard = request->getPayload<VCard>();
CPPUNIT_ASSERT(!!vcard);
- boost::shared_ptr<IQ> reply = boost::make_shared<IQ>(IQ::Result);
+ std::shared_ptr<IQ> reply = std::make_shared<IQ>(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<VCardUpdate>();
- presence = boost::make_shared<Presence>();
+ vcardUpdate = std::make_shared<VCardUpdate>();
+ presence = std::make_shared<Presence>();
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<IQ>(stanzaChannel->sentStanzas[0]);
+ request = std::dynamic_pointer_cast<IQ>(stanzaChannel->sentStanzas[0]);
stanzaChannel->sentStanzas.pop_back();
CPPUNIT_ASSERT(!!request);
vcard = request->getPayload<VCard>();
CPPUNIT_ASSERT(!!vcard);
ByteArray blankAvatar = createByteArray("");
- reply = boost::make_shared<IQ>(IQ::Result);
+ reply = std::make_shared<IQ>(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<DummyStanzaChannel> stanzaChannel;
- boost::shared_ptr<IQRouter> iqRouter;
- boost::shared_ptr<CryptoProvider> crypto;
- boost::shared_ptr<VCardMemoryStorage> vcardStorage;
- boost::shared_ptr<VCardManager> vcardManager;
- boost::shared_ptr<AvatarMemoryStorage> avatarStorage;
- boost::shared_ptr<DummyMUCRegistry> mucRegistry;
- boost::shared_ptr<AvatarManagerImpl> avatarManager;
+ std::shared_ptr<DummyStanzaChannel> stanzaChannel;
+ std::shared_ptr<IQRouter> iqRouter;
+ std::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<VCardMemoryStorage> vcardStorage;
+ std::shared_ptr<VCardManager> vcardManager;
+ std::shared_ptr<AvatarMemoryStorage> avatarStorage;
+ std::shared_ptr<DummyMUCRegistry> mucRegistry;
+ std::shared_ptr<AvatarManagerImpl> 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<CombinedAvatarProvider> testling(createProvider());
+ std::shared_ptr<CombinedAvatarProvider> testling(createProvider());
boost::optional<std::string> hash = testling->getAvatarHash(user1);
CPPUNIT_ASSERT(!hash);
}
void testGetAvatarWithSingleAvatarProvider() {
- boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
+ std::shared_ptr<CombinedAvatarProvider> testling(createProvider());
avatarProvider1->avatars[user1] = avatarHash1;
testling->addProvider(avatarProvider1);
@@ -79,7 +79,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
}
void testGetAvatarWithMultipleAvatarProviderReturnsFirstAvatar() {
- boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
+ std::shared_ptr<CombinedAvatarProvider> 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<CombinedAvatarProvider> testling(createProvider());
+ std::shared_ptr<CombinedAvatarProvider> 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<CombinedAvatarProvider> testling(createProvider());
+ std::shared_ptr<CombinedAvatarProvider> 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<CombinedAvatarProvider> testling(createProvider());
+ std::shared_ptr<CombinedAvatarProvider> 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<CombinedAvatarProvider> testling(createProvider());
+ std::shared_ptr<CombinedAvatarProvider> 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<CombinedAvatarProvider> testling(createProvider());
+ std::shared_ptr<CombinedAvatarProvider> 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<CombinedAvatarProvider> testling(createProvider());
+ std::shared_ptr<CombinedAvatarProvider> 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<CombinedAvatarProvider> testling(createProvider());
+ std::shared_ptr<CombinedAvatarProvider> testling(createProvider());
testling->addProvider(avatarProvider1);
avatarProvider1->avatars[user1] = avatarHash1;
@@ -180,7 +180,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
}
void testRemoveProviderDisconnectsUpdates() {
- boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
+ std::shared_ptr<CombinedAvatarProvider> 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<CombinedAvatarProvider> testling(createProvider());
+ std::shared_ptr<CombinedAvatarProvider> 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<CryptoProvider> crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ std::shared_ptr<CryptoProvider> crypto = std::shared_ptr<CryptoProvider>(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<VCardUpdateAvatarManager> updateManager(new VCardUpdateAvatarManager(vcardManager, stanzaChannel, avatarStorage, crypto.get(), mucRegistry));
+ std::shared_ptr<VCardUpdateAvatarManager> updateManager(new VCardUpdateAvatarManager(vcardManager, stanzaChannel, avatarStorage, crypto.get(), mucRegistry));
updateManager->onAvatarChanged.connect(boost::bind(&CombinedAvatarProviderTest::handleAvatarChanged, this, _1));
- boost::shared_ptr<VCardAvatarManager> manager(new VCardAvatarManager(vcardManager, avatarStorage, crypto.get(), mucRegistry));
+ std::shared_ptr<VCardAvatarManager> manager(new VCardAvatarManager(vcardManager, avatarStorage, crypto.get(), mucRegistry));
manager->onAvatarChanged.connect(boost::bind(&CombinedAvatarProviderTest::handleAvatarChanged, this, _1));
- boost::shared_ptr<OfflineAvatarManager> offlineManager(new OfflineAvatarManager(avatarStorage));
+ std::shared_ptr<OfflineAvatarManager> offlineManager(new OfflineAvatarManager(avatarStorage));
offlineManager->onAvatarChanged.connect(boost::bind(&CombinedAvatarProviderTest::handleAvatarChanged, this, _1));
- boost::shared_ptr<CombinedAvatarProvider> testling(createProvider());
+ std::shared_ptr<CombinedAvatarProvider> 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<IQ>(stanzaChannel->sentStanzas.back());
+ IQ::ref request = std::dynamic_pointer_cast<IQ>(stanzaChannel->sentStanzas.back());
VCard::ref payload = request->getPayload<VCard>();
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>();
+ IQ::ref reply = std::make_shared<IQ>();
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<IQ>(stanzaChannel->sentStanzas.back());
+ request = std::dynamic_pointer_cast<IQ>(stanzaChannel->sentStanzas.back());
payload = request->getPayload<VCard>();
CPPUNIT_ASSERT(!!payload);
stanzaChannel->sentStanzas.pop_back();
VCard::ref vcard3(new VCard());
- reply = boost::make_shared<IQ>();
+ reply = std::make_shared<IQ>();
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<CombinedAvatarProvider> createProvider() {
- boost::shared_ptr<CombinedAvatarProvider> result(new CombinedAvatarProvider());
+ std::shared_ptr<CombinedAvatarProvider> createProvider() {
+ std::shared_ptr<CombinedAvatarProvider> 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<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(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<VCardAvatarManager> testling = createManager();
+ std::shared_ptr<VCardAvatarManager> testling = createManager();
storeVCardWithPhoto(user1.toBare(), avatar1);
avatarStorage->addAvatar(avatar1Hash, avatar1);
@@ -74,7 +74,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture {
}
void testGetAvatarHashEmptyAvatar() {
- boost::shared_ptr<VCardAvatarManager> testling = createManager();
+ std::shared_ptr<VCardAvatarManager> testling = createManager();
storeEmptyVCard(user1.toBare());
boost::optional<std::string> result = testling->getAvatarHash(user1);
@@ -84,7 +84,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture {
}
void testGetAvatarHashUnknownAvatarKnownVCardStoresAvatar() {
- boost::shared_ptr<VCardAvatarManager> testling = createManager();
+ std::shared_ptr<VCardAvatarManager> testling = createManager();
storeVCardWithPhoto(user1.toBare(), avatar1);
boost::optional<std::string> result = testling->getAvatarHash(user1);
@@ -96,7 +96,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture {
}
void testGetAvatarHashUnknownAvatarUnknownVCard() {
- boost::shared_ptr<VCardAvatarManager> testling = createManager();
+ std::shared_ptr<VCardAvatarManager> testling = createManager();
boost::optional<std::string> result = testling->getAvatarHash(user1);
@@ -105,7 +105,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture {
}
void testGetAvatarHashKnownAvatarUnknownVCard() {
- boost::shared_ptr<VCardAvatarManager> testling = createManager();
+ std::shared_ptr<VCardAvatarManager> testling = createManager();
avatarStorage->setAvatarForJID(user1, avatar1Hash);
@@ -117,7 +117,7 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture {
void testVCardUpdateTriggersUpdate() {
- boost::shared_ptr<VCardAvatarManager> testling = createManager();
+ std::shared_ptr<VCardAvatarManager> testling = createManager();
vcardManager->requestVCard(user1);
sendVCardResult();
@@ -125,8 +125,8 @@ class VCardAvatarManagerTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<VCardAvatarManager> createManager() {
- boost::shared_ptr<VCardAvatarManager> result(new VCardAvatarManager(vcardManager, avatarStorage, crypto.get(), mucRegistry));
+ std::shared_ptr<VCardAvatarManager> createManager() {
+ std::shared_ptr<VCardAvatarManager> 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<JID> changes;
JID user1;
JID user2;
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> 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<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(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<VCardUpdateAvatarManager> testling = createManager();
+ std::shared_ptr<VCardUpdateAvatarManager> testling = createManager();
stanzaChannel->onPresenceReceived(createPresenceWithPhotoHash(user1, avatar1Hash));
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(stanzaChannel->sentStanzas.size()));
@@ -73,7 +73,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture {
}
void testUpdate_NewHashStoresAvatarAndEmitsNotificationOnVCardReceive() {
- boost::shared_ptr<VCardUpdateAvatarManager> testling = createManager();
+ std::shared_ptr<VCardUpdateAvatarManager> 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<VCardUpdateAvatarManager> testling = createManager();
+ std::shared_ptr<VCardUpdateAvatarManager> 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<VCardUpdateAvatarManager> testling = createManager();
+ std::shared_ptr<VCardUpdateAvatarManager> 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<VCardUpdateAvatarManager> testling = createManager();
+ std::shared_ptr<VCardUpdateAvatarManager> 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<VCardUpdateAvatarManager> testling = createManager();
+ std::shared_ptr<VCardUpdateAvatarManager> 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<VCardUpdateAvatarManager> testling = createManager();
+ std::shared_ptr<VCardUpdateAvatarManager> 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<VCardUpdateAvatarManager> createManager() {
- boost::shared_ptr<VCardUpdateAvatarManager> result(new VCardUpdateAvatarManager(vcardManager, stanzaChannel, avatarStorage, crypto.get(), mucRegistry));
+ std::shared_ptr<VCardUpdateAvatarManager> createManager() {
+ std::shared_ptr<VCardUpdateAvatarManager> result(new VCardUpdateAvatarManager(vcardManager, stanzaChannel, avatarStorage, crypto.get(), mucRegistry));
result->onAvatarChanged.connect(boost::bind(&VCardUpdateAvatarManagerTest::handleAvatarChanged, this, _1));
return result;
}
- boost::shared_ptr<Presence> createPresenceWithPhotoHash(const JID& jid, const std::string& hash) {
- boost::shared_ptr<Presence> presence(new Presence());
+ std::shared_ptr<Presence> createPresenceWithPhotoHash(const JID& jid, const std::string& hash) {
+ std::shared_ptr<Presence> presence(new Presence());
presence->setFrom(jid);
- presence->addPayload(boost::make_shared<VCardUpdate>(hash));
+ presence->addPayload(std::make_shared<VCardUpdate>(hash));
return presence;
}
@@ -206,7 +206,7 @@ class VCardUpdateAvatarManagerTest : public CppUnit::TestFixture {
std::vector<JID> changes;
JID user1;
JID user2;
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> 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> presence) {
- boost::shared_ptr<VCardUpdate> update = presence->getPayload<VCardUpdate>();
+void VCardUpdateAvatarManager::handlePresenceReceived(std::shared_ptr<Presence> presence) {
+ std::shared_ptr<VCardUpdate> update = presence->getPayload<VCardUpdate>();
if (!update || presence->getPayload<ErrorPayload>()) {
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 <map>
-
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Avatars/AvatarProvider.h>
#include <Swiften/Base/API.h>
@@ -31,7 +30,7 @@ namespace Swift {
boost::optional<std::string> getAvatarHash(const JID&) const;
private:
- void handlePresenceReceived(boost::shared_ptr<Presence>);
+ void handlePresenceReceived(std::shared_ptr<Presence>);
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 <Swiften/Base/Debug.h>
#include <iostream>
-
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Client/ClientError.h>
#include <Swiften/Serializer/PayloadSerializer.h>
@@ -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> element = boost::shared_ptr<Element>(ele);
+ std::shared_ptr<Element> element = std::shared_ptr<Element>(ele);
- boost::shared_ptr<Payload> payload = boost::dynamic_pointer_cast<Payload>(element);
+ std::shared_ptr<Payload> payload = std::dynamic_pointer_cast<Payload>(element);
if (payload) {
FullPayloadSerializerCollection payloadSerializerCollection;
PayloadSerializer *serializer = payloadSerializerCollection.getPayloadSerializer(payload);
os << "Payload(" << serializer->serialize(payload) << ")";
return os;
}
- boost::shared_ptr<ToplevelElement> topLevelElement = boost::dynamic_pointer_cast<ToplevelElement>(element);
+ std::shared_ptr<ToplevelElement> topLevelElement = std::dynamic_pointer_cast<ToplevelElement>(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 <memory>
#include <vector>
-#include <boost/smart_ptr/make_shared.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/ByteArray.h>
#include <Swiften/Base/SafeAllocator.h>
@@ -27,8 +26,8 @@ namespace Swift {
return SafeByteArray(s.begin(), s.end());
}
- inline boost::shared_ptr<SafeByteArray> createSafeByteArrayRef(const std::string& s) {
- return boost::make_shared<SafeByteArray>(s.begin(), s.end());
+ inline std::shared_ptr<SafeByteArray> createSafeByteArrayRef(const std::string& s) {
+ return std::make_shared<SafeByteArray>(s.begin(), s.end());
}
inline SafeByteArray createSafeByteArray(char c) {
@@ -39,16 +38,16 @@ namespace Swift {
return SafeByteArray(c, c + n);
}
- inline boost::shared_ptr<SafeByteArray> createSafeByteArrayRef(const char* c, size_t n) {
- return boost::make_shared<SafeByteArray>(c, c + n);
+ inline std::shared_ptr<SafeByteArray> createSafeByteArrayRef(const char* c, size_t n) {
+ return std::make_shared<SafeByteArray>(c, c + n);
}
inline SafeByteArray createSafeByteArray(const unsigned char* c, size_t n) {
return SafeByteArray(c, c + n);
}
- inline boost::shared_ptr<SafeByteArray> createSafeByteArrayRef(const unsigned char* c, size_t n) {
- return boost::make_shared<SafeByteArray>(c, c + n);
+ inline std::shared_ptr<SafeByteArray> createSafeByteArrayRef(const unsigned char* c, size_t n) {
+ return std::make_shared<SafeByteArray>(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 <Swiften/Chat/ChatStateNotifier.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Client/StanzaChannel.h>
#include <Swiften/Disco/EntityCapsProvider.h>
@@ -69,15 +70,15 @@ bool ChatStateNotifier::contactShouldReceiveStates() {
}
void ChatStateNotifier::changeState(ChatState::ChatStateType state) {
- boost::shared_ptr<Message> message(boost::make_shared<Message>());
+ std::shared_ptr<Message> message(std::make_shared<Message>());
message->setTo(contact_);
- message->addPayload(boost::make_shared<ChatState>(state));
+ message->addPayload(std::make_shared<ChatState>(state));
stanzaChannel_->sendMessage(message);
}
void ChatStateNotifier::addChatStateRequest(Message::ref message) {
if (contactShouldReceiveStates()) {
- message->addPayload(boost::make_shared<ChatState>(ChatState::Active));
+ message->addPayload(std::make_shared<ChatState>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
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> message) {
+void ChatStateTracker::handleMessageReceived(std::shared_ptr<Message> message) {
if (message->getType() == Message::Error) {
return;
}
- boost::shared_ptr<ChatState> statePayload = message->getPayload<ChatState>();
+ std::shared_ptr<ChatState> statePayload = message->getPayload<ChatState>();
if (statePayload) {
changeState(statePayload->getChatState());;
}
}
-void ChatStateTracker::handlePresenceChange(boost::shared_ptr<Presence> newPresence) {
+void ChatStateTracker::handlePresenceChange(std::shared_ptr<Presence> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -18,8 +18,8 @@ namespace Swift {
class SWIFTEN_API ChatStateTracker {
public:
ChatStateTracker();
- void handleMessageReceived(boost::shared_ptr<Message> message);
- void handlePresenceChange(boost::shared_ptr<Presence> newPresence);
+ void handleMessageReceived(std::shared_ptr<Message> message);
+ void handlePresenceChange(std::shared_ptr<Presence> newPresence);
boost::signal<void (ChatState::ChatStateType)> 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> message(new Message());
+ std::shared_ptr<Message> message(new Message());
notifier_->addChatStateRequest(message);
CPPUNIT_ASSERT(message->getPayload<ChatState>());
CPPUNIT_ASSERT_EQUAL(ChatState::Active, message->getPayload<ChatState>()->getChatState());
}
void testContactShouldReceiveStates_CapsNorActive() {
- boost::shared_ptr<Message> message(new Message());
+ std::shared_ptr<Message> message(new Message());
notifier_->addChatStateRequest(message);
CPPUNIT_ASSERT(!message->getPayload<ChatState>());
}
void testContactShouldReceiveStates_ActiveOverrideOn() {
notifier_->receivedMessageFromContact(true);
- boost::shared_ptr<Message> message(new Message());
+ std::shared_ptr<Message> message(new Message());
notifier_->addChatStateRequest(message);
CPPUNIT_ASSERT(message->getPayload<ChatState>());
CPPUNIT_ASSERT_EQUAL(ChatState::Active, message->getPayload<ChatState>()->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> message(new Message());
+ std::shared_ptr<Message> message(new Message());
notifier_->addChatStateRequest(message);
CPPUNIT_ASSERT(message->getPayload<ChatState>());
CPPUNIT_ASSERT_EQUAL(ChatState::Active, message->getPayload<ChatState>()->getChatState());
@@ -142,7 +142,7 @@ public:
int getComposingCount() const {
int result = 0;
- foreach(boost::shared_ptr<Stanza> stanza, stanzaChannel->sentStanzas) {
+ foreach(std::shared_ptr<Stanza> stanza, stanzaChannel->sentStanzas) {
if (stanza->getPayload<ChatState>() && stanza->getPayload<ChatState>()->getChatState() == ChatState::Composing) {
result++;
}
@@ -152,7 +152,7 @@ public:
int getActiveCount() const {
int result = 0;
- foreach(boost::shared_ptr<Stanza> stanza, stanzaChannel->sentStanzas) {
+ foreach(std::shared_ptr<Stanza> stanza, stanzaChannel->sentStanzas) {
if (stanza->getPayload<ChatState>() && stanza->getPayload<ChatState>()->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<Presence> getLastPresence(const JID& jid) const;
+ std::shared_ptr<Presence> getLastPresence(const JID& jid) const;
/**
* Returns the presence with the highest priority received for the given JID.
*/
- boost::shared_ptr<Presence> getHighestPriorityPresence(const JID& bareJID) const;
+ std::shared_ptr<Presence> 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<void (boost::shared_ptr<Presence>)> onPresenceChange;
+ boost::signal<void (std::shared_ptr<Presence>)> 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 <Swiften/Client/ClientBlockListManager.h>
#include <cassert>
+#include <memory>
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Client/BlockListImpl.h>
@@ -18,15 +18,15 @@ using namespace Swift;
namespace {
class BlockResponder : public SetResponder<BlockPayload> {
public:
- BlockResponder(boost::shared_ptr<BlockListImpl> blockList, IQRouter* iqRouter) : SetResponder<BlockPayload>(iqRouter), blockList(blockList) {
+ BlockResponder(std::shared_ptr<BlockListImpl> blockList, IQRouter* iqRouter) : SetResponder<BlockPayload>(iqRouter), blockList(blockList) {
}
- virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr<BlockPayload> payload) {
+ virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr<BlockPayload> payload) {
if (getIQRouter()->isAccountJID(from)) {
if (payload) {
blockList->addItems(payload->getItems());
}
- sendResponse(from, id, boost::shared_ptr<BlockPayload>());
+ sendResponse(from, id, std::shared_ptr<BlockPayload>());
}
else {
sendError(from, id, ErrorPayload::NotAuthorized, ErrorPayload::Cancel);
@@ -35,15 +35,15 @@ namespace {
}
private:
- boost::shared_ptr<BlockListImpl> blockList;
+ std::shared_ptr<BlockListImpl> blockList;
};
class UnblockResponder : public SetResponder<UnblockPayload> {
public:
- UnblockResponder(boost::shared_ptr<BlockListImpl> blockList, IQRouter* iqRouter) : SetResponder<UnblockPayload>(iqRouter), blockList(blockList) {
+ UnblockResponder(std::shared_ptr<BlockListImpl> blockList, IQRouter* iqRouter) : SetResponder<UnblockPayload>(iqRouter), blockList(blockList) {
}
- virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr<UnblockPayload> payload) {
+ virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr<UnblockPayload> 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<UnblockPayload>());
+ sendResponse(from, id, std::shared_ptr<UnblockPayload>());
}
else {
sendError(from, id, ErrorPayload::NotAuthorized, ErrorPayload::Cancel);
@@ -62,7 +62,7 @@ namespace {
}
private:
- boost::shared_ptr<BlockListImpl> blockList;
+ std::shared_ptr<BlockListImpl> blockList;
};
}
@@ -77,20 +77,20 @@ ClientBlockListManager::~ClientBlockListManager() {
}
}
-boost::shared_ptr<BlockList> ClientBlockListManager::getBlockList() {
+std::shared_ptr<BlockList> ClientBlockListManager::getBlockList() {
if (!blockList) {
- blockList = boost::make_shared<BlockListImpl>();
+ blockList = std::make_shared<BlockListImpl>();
blockList->setState(BlockList::Init);
}
return blockList;
}
-boost::shared_ptr<BlockList> ClientBlockListManager::requestBlockList() {
+std::shared_ptr<BlockList> ClientBlockListManager::requestBlockList() {
if (!blockList) {
- blockList = boost::make_shared<BlockListImpl>();
+ blockList = std::make_shared<BlockListImpl>();
}
blockList->setState(BlockList::Requesting);
- boost::shared_ptr<GenericRequest<BlockListPayload> > getRequest = boost::make_shared< GenericRequest<BlockListPayload> >(IQ::Get, JID(), boost::make_shared<BlockListPayload>(), iqRouter);
+ std::shared_ptr<GenericRequest<BlockListPayload> > getRequest = std::make_shared< GenericRequest<BlockListPayload> >(IQ::Get, JID(), std::make_shared<BlockListPayload>(), iqRouter);
getRequest->onResponse.connect(boost::bind(&ClientBlockListManager::handleBlockListReceived, this, _1, _2));
getRequest->send();
return blockList;
@@ -101,8 +101,8 @@ GenericRequest<BlockPayload>::ref ClientBlockListManager::createBlockJIDRequest(
}
GenericRequest<BlockPayload>::ref ClientBlockListManager::createBlockJIDsRequest(const std::vector<JID>& jids) {
- boost::shared_ptr<BlockPayload> payload = boost::make_shared<BlockPayload>(jids);
- return boost::make_shared< GenericRequest<BlockPayload> >(IQ::Set, JID(), payload, iqRouter);
+ std::shared_ptr<BlockPayload> payload = std::make_shared<BlockPayload>(jids);
+ return std::make_shared< GenericRequest<BlockPayload> >(IQ::Set, JID(), payload, iqRouter);
}
GenericRequest<UnblockPayload>::ref ClientBlockListManager::createUnblockJIDRequest(const JID& jid) {
@@ -110,8 +110,8 @@ GenericRequest<UnblockPayload>::ref ClientBlockListManager::createUnblockJIDRequ
}
GenericRequest<UnblockPayload>::ref ClientBlockListManager::createUnblockJIDsRequest(const std::vector<JID>& jids) {
- boost::shared_ptr<UnblockPayload> payload = boost::make_shared<UnblockPayload>(jids);
- return boost::make_shared< GenericRequest<UnblockPayload> >(IQ::Set, JID(), payload, iqRouter);
+ std::shared_ptr<UnblockPayload> payload = std::make_shared<UnblockPayload>(jids);
+ return std::make_shared< GenericRequest<UnblockPayload> >(IQ::Set, JID(), payload, iqRouter);
}
GenericRequest<UnblockPayload>::ref ClientBlockListManager::createUnblockAllRequest() {
@@ -119,7 +119,7 @@ GenericRequest<UnblockPayload>::ref ClientBlockListManager::createUnblockAllRequ
}
-void ClientBlockListManager::handleBlockListReceived(boost::shared_ptr<BlockListPayload> payload, ErrorPayload::ref error) {
+void ClientBlockListManager::handleBlockListReceived(std::shared_ptr<BlockListPayload> payload, ErrorPayload::ref error) {
if (error || !payload) {
blockList->setState(BlockList::Error);
}
@@ -127,11 +127,11 @@ void ClientBlockListManager::handleBlockListReceived(boost::shared_ptr<BlockList
blockList->setItems(payload->getItems());
blockList->setState(BlockList::Available);
if (!blockResponder) {
- blockResponder = boost::make_shared<BlockResponder>(blockList, iqRouter);
+ blockResponder = std::make_shared<BlockResponder>(blockList, iqRouter);
blockResponder->start();
}
if (!unblockResponder) {
- unblockResponder = boost::make_shared<UnblockResponder>(blockList, iqRouter);
+ unblockResponder = std::make_shared<UnblockResponder>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -30,12 +30,12 @@ namespace Swift {
/**
* Returns the blocklist.
*/
- boost::shared_ptr<BlockList> getBlockList();
+ std::shared_ptr<BlockList> getBlockList();
/**
* Get the blocklist from the server.
*/
- boost::shared_ptr<BlockList> requestBlockList();
+ std::shared_ptr<BlockList> requestBlockList();
GenericRequest<BlockPayload>::ref createBlockJIDRequest(const JID& jid);
GenericRequest<BlockPayload>::ref createBlockJIDsRequest(const std::vector<JID>& jids);
@@ -45,13 +45,13 @@ namespace Swift {
GenericRequest<UnblockPayload>::ref createUnblockAllRequest();
private:
- void handleBlockListReceived(boost::shared_ptr<BlockListPayload> payload, ErrorPayload::ref);
+ void handleBlockListReceived(std::shared_ptr<BlockListPayload> payload, ErrorPayload::ref);
private:
IQRouter* iqRouter;
- boost::shared_ptr<SetResponder<BlockPayload> > blockResponder;
- boost::shared_ptr<SetResponder<UnblockPayload> > unblockResponder;
- boost::shared_ptr<BlockListImpl> blockList;
+ std::shared_ptr<SetResponder<BlockPayload> > blockResponder;
+ std::shared_ptr<SetResponder<UnblockPayload> > unblockResponder;
+ std::shared_ptr<BlockListImpl> 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 <boost/shared_ptr.hpp>
+#include <memory>
+
#include <boost/system/system_error.hpp>
namespace Swift {
@@ -54,12 +55,12 @@ namespace Swift {
Type getType() const { return type_; }
- void setErrorCode(boost::shared_ptr<boost::system::error_code> errorCode) { errorCode_ = errorCode; }
+ void setErrorCode(std::shared_ptr<boost::system::error_code> errorCode) { errorCode_ = errorCode; }
- boost::shared_ptr<boost::system::error_code> getErrorCode() const { return errorCode_; }
+ std::shared_ptr<boost::system::error_code> getErrorCode() const { return errorCode_; }
private:
Type type_;
- boost::shared_ptr<boost::system::error_code> errorCode_;
+ std::shared_ptr<boost::system::error_code> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeString.h>
@@ -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> httpTrafficFilter;
+ std::shared_ptr<HTTPTrafficFilter> 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 <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/uuid/uuid_generators.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/Platform.h>
#include <Swiften/Base/Log.h>
@@ -57,7 +57,7 @@ namespace Swift {
ClientSession::ClientSession(
const JID& jid,
- boost::shared_ptr<SessionStream> stream,
+ std::shared_ptr<SessionStream> stream,
IDNConverter* idnConverter,
CryptoProvider* crypto) :
localJID(jid),
@@ -104,7 +104,7 @@ void ClientSession::sendStreamHeader() {
stream->writeHeader(header);
}
-void ClientSession::sendStanza(boost::shared_ptr<Stanza> stanza) {
+void ClientSession::sendStanza(std::shared_ptr<Stanza> 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<ToplevelElement> element) {
- if (boost::shared_ptr<Stanza> stanza = boost::dynamic_pointer_cast<Stanza>(element)) {
+void ClientSession::handleElement(std::shared_ptr<ToplevelElement> element) {
+ if (std::shared_ptr<Stanza> stanza = std::dynamic_pointer_cast<Stanza>(element)) {
if (stanzaAckResponder_) {
stanzaAckResponder_->handleStanzaReceived();
}
if (getState() == Initialized) {
onStanzaReceived(stanza);
}
- else if (boost::shared_ptr<IQ> iq = boost::dynamic_pointer_cast<IQ>(element)) {
+ else if (std::shared_ptr<IQ> iq = std::dynamic_pointer_cast<IQ>(element)) {
if (state == BindingResource) {
- boost::shared_ptr<ResourceBind> resourceBind(iq->getPayload<ResourceBind>());
+ std::shared_ptr<ResourceBind> resourceBind(iq->getPayload<ResourceBind>());
if (iq->getType() == IQ::Error && iq->getID() == "session-bind") {
finishSession(Error::ResourceBindError);
}
@@ -162,12 +162,12 @@ void ClientSession::handleElement(boost::shared_ptr<ToplevelElement> element) {
}
}
}
- else if (boost::dynamic_pointer_cast<StanzaAckRequest>(element)) {
+ else if (std::dynamic_pointer_cast<StanzaAckRequest>(element)) {
if (stanzaAckResponder_) {
stanzaAckResponder_->handleAckRequestReceived();
}
}
- else if (boost::shared_ptr<StanzaAck> ack = boost::dynamic_pointer_cast<StanzaAck>(element)) {
+ else if (std::shared_ptr<StanzaAck> ack = std::dynamic_pointer_cast<StanzaAck>(element)) {
if (stanzaAckRequester_) {
if (ack->isValid()) {
stanzaAckRequester_->handleAckReceived(ack->getHandledStanzasCount());
@@ -180,11 +180,11 @@ void ClientSession::handleElement(boost::shared_ptr<ToplevelElement> element) {
SWIFT_LOG(warning) << "Ignoring ack";
}
}
- else if (StreamError::ref streamError = boost::dynamic_pointer_cast<StreamError>(element)) {
+ else if (StreamError::ref streamError = std::dynamic_pointer_cast<StreamError>(element)) {
finishSession(Error::StreamError);
}
else if (getState() == Initialized) {
- boost::shared_ptr<Stanza> stanza = boost::dynamic_pointer_cast<Stanza>(element);
+ std::shared_ptr<Stanza> stanza = std::dynamic_pointer_cast<Stanza>(element);
if (stanza) {
if (stanzaAckResponder_) {
stanzaAckResponder_->handleStanzaReceived();
@@ -197,14 +197,14 @@ void ClientSession::handleElement(boost::shared_ptr<ToplevelElement> element) {
if (streamFeatures->hasStartTLS() && stream->supportsTLSEncryption() && useTLS != NeverUseTLS) {
state = WaitingForEncrypt;
- stream->writeElement(boost::make_shared<StartTLSRequest>());
+ stream->writeElement(std::make_shared<StartTLSRequest>());
}
else if (useTLS == RequireTLS && !stream->isTLSEncrypted()) {
finishSession(Error::NoSupportedAuthMechanismsError);
}
else if (useStreamCompression && stream->supportsZLibCompression() && streamFeatures->hasCompressionMethod("zlib")) {
state = Compressing;
- stream->writeElement(boost::make_shared<CompressRequest>("zlib"));
+ stream->writeElement(std::make_shared<CompressRequest>("zlib"));
}
else if (streamFeatures->hasAuthenticationMechanisms()) {
#ifdef SWIFTEN_PLATFORM_WIN32
@@ -217,13 +217,13 @@ void ClientSession::handleElement(boost::shared_ptr<ToplevelElement> element) {
}
else {
WindowsGSSAPIClientAuthenticator* gssapiAuthenticator = new WindowsGSSAPIClientAuthenticator(*authenticationHostname, localJID.getDomain(), authenticationPort);
- boost::shared_ptr<Error> error = boost::make_shared<Error>(Error::AuthenticationFailedError);
+ std::shared_ptr<Error> error = std::make_shared<Error>(Error::AuthenticationFailedError);
authenticator = gssapiAuthenticator;
if (!gssapiAuthenticator->isError()) {
state = Authenticating;
- stream->writeElement(boost::make_shared<AuthRequest>(authenticator->getName(), authenticator->getResponse()));
+ stream->writeElement(std::make_shared<AuthRequest>(authenticator->getName(), authenticator->getResponse()));
}
else {
error->errorCode = gssapiAuthenticator->getErrorCode();
@@ -237,7 +237,7 @@ void ClientSession::handleElement(boost::shared_ptr<ToplevelElement> element) {
if (streamFeatures->hasAuthenticationMechanism("EXTERNAL")) {
authenticator = new EXTERNALClientAuthenticator();
state = Authenticating;
- stream->writeElement(boost::make_shared<AuthRequest>("EXTERNAL", createSafeByteArray("")));
+ stream->writeElement(std::make_shared<AuthRequest>("EXTERNAL", createSafeByteArray("")));
}
else {
finishSession(Error::TLSClientCertificateError);
@@ -246,7 +246,7 @@ void ClientSession::handleElement(boost::shared_ptr<ToplevelElement> element) {
else if (streamFeatures->hasAuthenticationMechanism("EXTERNAL")) {
authenticator = new EXTERNALClientAuthenticator();
state = Authenticating;
- stream->writeElement(boost::make_shared<AuthRequest>("EXTERNAL", createSafeByteArray("")));
+ stream->writeElement(std::make_shared<AuthRequest>("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<ToplevelElement> element) {
}
}
}
- else if (boost::dynamic_pointer_cast<Compressed>(element)) {
+ else if (std::dynamic_pointer_cast<Compressed>(element)) {
CHECK_STATE_OR_RETURN(Compressing);
state = WaitingForStreamStart;
stream->addZLibCompression();
stream->resetXMPPParser();
sendStreamHeader();
}
- else if (boost::dynamic_pointer_cast<CompressFailure>(element)) {
+ else if (std::dynamic_pointer_cast<CompressFailure>(element)) {
finishSession(Error::CompressionFailedError);
}
- else if (boost::dynamic_pointer_cast<StreamManagementEnabled>(element)) {
- stanzaAckRequester_ = boost::make_shared<StanzaAckRequester>();
+ else if (std::dynamic_pointer_cast<StreamManagementEnabled>(element)) {
+ stanzaAckRequester_ = std::make_shared<StanzaAckRequester>();
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>();
+ stanzaAckResponder_ = std::make_shared<StanzaAckResponder>();
stanzaAckResponder_->onAck.connect(boost::bind(&ClientSession::ack, shared_from_this(), _1));
needAcking = false;
continueSessionInitialization();
}
- else if (boost::dynamic_pointer_cast<StreamManagementFailed>(element)) {
+ else if (std::dynamic_pointer_cast<StreamManagementFailed>(element)) {
needAcking = false;
continueSessionInitialization();
}
@@ -325,11 +325,11 @@ void ClientSession::handleElement(boost::shared_ptr<ToplevelElement> element) {
CHECK_STATE_OR_RETURN(Authenticating);
assert(authenticator);
if (authenticator->setChallenge(challenge->getValue())) {
- stream->writeElement(boost::make_shared<AuthResponse>(authenticator->getResponse()));
+ stream->writeElement(std::make_shared<AuthResponse>(authenticator->getResponse()));
}
#ifdef SWIFTEN_PLATFORM_WIN32
else if (WindowsGSSAPIClientAuthenticator* gssapiAuthenticator = dynamic_cast<WindowsGSSAPIClientAuthenticator*>(authenticator)) {
- boost::shared_ptr<Error> error = boost::make_shared<Error>(Error::AuthenticationFailedError);
+ std::shared_ptr<Error> error = std::make_shared<Error>(Error::AuthenticationFailedError);
error->errorCode = gssapiAuthenticator->getErrorCode();
finishSession(error);
@@ -374,7 +374,7 @@ void ClientSession::handleElement(boost::shared_ptr<ToplevelElement> element) {
void ClientSession::continueSessionInitialization() {
if (needResourceBind) {
state = BindingResource;
- boost::shared_ptr<ResourceBind> resourceBind(boost::make_shared<ResourceBind>());
+ std::shared_ptr<ResourceBind> resourceBind(std::make_shared<ResourceBind>());
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<EnableStreamManagement>());
+ stream->writeElement(std::make_shared<EnableStreamManagement>());
}
else if (needSessionStart) {
state = StartingSession;
- sendStanza(IQ::createRequest(IQ::Set, JID(), "session-start", boost::make_shared<StartSession>()));
+ sendStanza(IQ::createRequest(IQ::Set, JID(), "session-start", std::make_shared<StartSession>()));
}
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<AuthRequest>(authenticator->getName(), authenticator->getResponse()));
+ stream->writeElement(std::make_shared<AuthRequest>(authenticator->getName(), authenticator->getResponse()));
}
void ClientSession::handleTLSEncrypted() {
CHECK_STATE_OR_RETURN(Encrypting);
std::vector<Certificate::ref> certificateChain = stream->getPeerCertificateChain();
- boost::shared_ptr<CertificateVerificationError> verificationError = stream->getPeerCertificateVerificationError();
+ std::shared_ptr<CertificateVerificationError> verificationError = stream->getPeerCertificateVerificationError();
if (verificationError) {
checkTrustOrFinish(certificateChain, verificationError);
}
@@ -424,12 +424,12 @@ void ClientSession::handleTLSEncrypted() {
continueAfterTLSEncrypted();
}
else {
- checkTrustOrFinish(certificateChain, boost::make_shared<CertificateVerificationError>(CertificateVerificationError::InvalidServerIdentity));
+ checkTrustOrFinish(certificateChain, std::make_shared<CertificateVerificationError>(CertificateVerificationError::InvalidServerIdentity));
}
}
}
-void ClientSession::checkTrustOrFinish(const std::vector<Certificate::ref>& certificateChain, boost::shared_ptr<CertificateVerificationError> error) {
+void ClientSession::checkTrustOrFinish(const std::vector<Certificate::ref>& certificateChain, std::shared_ptr<CertificateVerificationError> error) {
if (certificateTrustChecker && certificateTrustChecker->isCertificateTrusted(certificateChain)) {
continueAfterTLSEncrypted();
}
@@ -444,7 +444,7 @@ void ClientSession::continueAfterTLSEncrypted() {
sendStreamHeader();
}
-void ClientSession::handleStreamClosed(boost::shared_ptr<Swift::Error> streamError) {
+void ClientSession::handleStreamClosed(std::shared_ptr<Swift::Error> streamError) {
State previousState = state;
state = Finished;
@@ -472,14 +472,14 @@ void ClientSession::handleStreamClosed(boost::shared_ptr<Swift::Error> streamErr
}
void ClientSession::finish() {
- finishSession(boost::shared_ptr<Error>());
+ finishSession(std::shared_ptr<Error>());
}
void ClientSession::finishSession(Error::Type error) {
- finishSession(boost::make_shared<Swift::ClientSession::Error>(error));
+ finishSession(std::make_shared<Swift::ClientSession::Error>(error));
}
-void ClientSession::finishSession(boost::shared_ptr<Swift::Error> error) {
+void ClientSession::finishSession(std::shared_ptr<Swift::Error> error) {
state = Finishing;
if (!error_) {
error_ = error;
@@ -500,15 +500,15 @@ void ClientSession::finishSession(boost::shared_ptr<Swift::Error> error) {
}
void ClientSession::requestAck() {
- stream->writeElement(boost::make_shared<StanzaAckRequest>());
+ stream->writeElement(std::make_shared<StanzaAckRequest>());
}
-void ClientSession::handleStanzaAcked(boost::shared_ptr<Stanza> stanza) {
+void ClientSession::handleStanzaAcked(std::shared_ptr<Stanza> stanza) {
onStanzaAcked(stanza);
}
void ClientSession::ack(unsigned int handledStanzasCount) {
- stream->writeElement(boost::make_shared<StanzaAck>(handledStanzasCount));
+ stream->writeElement(std::make_shared<StanzaAck>(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 <memory>
#include <string>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Error.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -26,7 +24,7 @@ namespace Swift {
class IDNConverter;
class CryptoProvider;
- class SWIFTEN_API ClientSession : public boost::enable_shared_from_this<ClientSession> {
+ class SWIFTEN_API ClientSession : public std::enable_shared_from_this<ClientSession> {
public:
enum State {
Initial,
@@ -58,7 +56,7 @@ namespace Swift {
TLSError,
StreamError
} type;
- boost::shared_ptr<boost::system::error_code> errorCode;
+ std::shared_ptr<boost::system::error_code> errorCode;
Error(Type type) : type(type) {}
};
@@ -70,8 +68,8 @@ namespace Swift {
~ClientSession();
- static boost::shared_ptr<ClientSession> create(const JID& jid, boost::shared_ptr<SessionStream> stream, IDNConverter* idnConverter, CryptoProvider* crypto) {
- return boost::shared_ptr<ClientSession>(new ClientSession(jid, stream, idnConverter, crypto));
+ static std::shared_ptr<ClientSession> create(const JID& jid, std::shared_ptr<SessionStream> stream, IDNConverter* idnConverter, CryptoProvider* crypto) {
+ return std::shared_ptr<ClientSession>(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<Stanza>);
+ void sendStanza(std::shared_ptr<Stanza>);
void setCertificateTrustChecker(CertificateTrustChecker* checker) {
certificateTrustChecker = checker;
@@ -142,19 +140,19 @@ namespace Swift {
public:
boost::signal<void ()> onNeedCredentials;
boost::signal<void ()> onInitialized;
- boost::signal<void (boost::shared_ptr<Swift::Error>)> onFinished;
- boost::signal<void (boost::shared_ptr<Stanza>)> onStanzaReceived;
- boost::signal<void (boost::shared_ptr<Stanza>)> onStanzaAcked;
+ boost::signal<void (std::shared_ptr<Swift::Error>)> onFinished;
+ boost::signal<void (std::shared_ptr<Stanza>)> onStanzaReceived;
+ boost::signal<void (std::shared_ptr<Stanza>)> onStanzaAcked;
private:
ClientSession(
const JID& jid,
- boost::shared_ptr<SessionStream>,
+ std::shared_ptr<SessionStream>,
IDNConverter* idnConverter,
CryptoProvider* crypto);
void finishSession(Error::Type error);
- void finishSession(boost::shared_ptr<Swift::Error> error);
+ void finishSession(std::shared_ptr<Swift::Error> error);
JID getRemoteJID() const {
return JID("", localJID.getDomain());
@@ -162,9 +160,9 @@ namespace Swift {
void sendStreamHeader();
- void handleElement(boost::shared_ptr<ToplevelElement>);
+ void handleElement(std::shared_ptr<ToplevelElement>);
void handleStreamStart(const ProtocolHeader&);
- void handleStreamClosed(boost::shared_ptr<Swift::Error>);
+ void handleStreamClosed(std::shared_ptr<Swift::Error>);
void handleTLSEncrypted();
@@ -172,15 +170,15 @@ namespace Swift {
void continueSessionInitialization();
void requestAck();
- void handleStanzaAcked(boost::shared_ptr<Stanza> stanza);
+ void handleStanzaAcked(std::shared_ptr<Stanza> stanza);
void ack(unsigned int handledStanzasCount);
void continueAfterTLSEncrypted();
- void checkTrustOrFinish(const std::vector<Certificate::ref>& certificateChain, boost::shared_ptr<CertificateVerificationError> error);
+ void checkTrustOrFinish(const std::vector<Certificate::ref>& certificateChain, std::shared_ptr<CertificateVerificationError> error);
private:
JID localJID;
State state;
- boost::shared_ptr<SessionStream> stream;
+ std::shared_ptr<SessionStream> stream;
IDNConverter* idnConverter;
CryptoProvider* crypto;
bool allowPLAINOverNonTLS;
@@ -192,9 +190,9 @@ namespace Swift {
bool needAcking;
bool rosterVersioningSupported;
ClientAuthenticator* authenticator;
- boost::shared_ptr<StanzaAckRequester> stanzaAckRequester_;
- boost::shared_ptr<StanzaAckResponder> stanzaAckResponder_;
- boost::shared_ptr<Swift::Error> error_;
+ std::shared_ptr<StanzaAckRequester> stanzaAckRequester_;
+ std::shared_ptr<StanzaAckResponder> stanzaAckResponder_;
+ std::shared_ptr<Swift::Error> 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<ClientSession> session) {
+void ClientSessionStanzaChannel::setSession(std::shared_ptr<ClientSession> 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<ClientSession> ses
session->onStanzaAcked.connect(boost::bind(&ClientSessionStanzaChannel::handleStanzaAcked, this, _1));
}
-void ClientSessionStanzaChannel::sendIQ(boost::shared_ptr<IQ> iq) {
+void ClientSessionStanzaChannel::sendIQ(std::shared_ptr<IQ> iq) {
send(iq);
}
-void ClientSessionStanzaChannel::sendMessage(boost::shared_ptr<Message> message) {
+void ClientSessionStanzaChannel::sendMessage(std::shared_ptr<Message> message) {
send(message);
}
-void ClientSessionStanzaChannel::sendPresence(boost::shared_ptr<Presence> presence) {
+void ClientSessionStanzaChannel::sendPresence(std::shared_ptr<Presence> presence) {
send(presence);
}
@@ -47,7 +47,7 @@ std::string ClientSessionStanzaChannel::getNewIQID() {
return idGenerator.generateID();
}
-void ClientSessionStanzaChannel::send(boost::shared_ptr<Stanza> stanza) {
+void ClientSessionStanzaChannel::send(std::shared_ptr<Stanza> 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> stanza) {
session->sendStanza(stanza);
}
-void ClientSessionStanzaChannel::handleSessionFinished(boost::shared_ptr<Error>) {
+void ClientSessionStanzaChannel::handleSessionFinished(std::shared_ptr<Error>) {
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<Error>)
onAvailableChanged(false);
}
-void ClientSessionStanzaChannel::handleStanza(boost::shared_ptr<Stanza> stanza) {
- boost::shared_ptr<Message> message = boost::dynamic_pointer_cast<Message>(stanza);
+void ClientSessionStanzaChannel::handleStanza(std::shared_ptr<Stanza> stanza) {
+ std::shared_ptr<Message> message = std::dynamic_pointer_cast<Message>(stanza);
if (message) {
onMessageReceived(message);
return;
}
- boost::shared_ptr<Presence> presence = boost::dynamic_pointer_cast<Presence>(stanza);
+ std::shared_ptr<Presence> presence = std::dynamic_pointer_cast<Presence>(stanza);
if (presence) {
onPresenceReceived(presence);
return;
}
- boost::shared_ptr<IQ> iq = boost::dynamic_pointer_cast<IQ>(stanza);
+ std::shared_ptr<IQ> iq = std::dynamic_pointer_cast<IQ>(stanza);
if (iq) {
onIQReceived(iq);
return;
@@ -100,7 +100,7 @@ std::vector<Certificate::ref> ClientSessionStanzaChannel::getPeerCertificateChai
return std::vector<Certificate::ref>();
}
-void ClientSessionStanzaChannel::handleStanzaAcked(boost::shared_ptr<Stanza> stanza) {
+void ClientSessionStanzaChannel::handleStanzaAcked(std::shared_ptr<Stanza> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/IDGenerator.h>
@@ -24,11 +24,11 @@ namespace Swift {
public:
virtual ~ClientSessionStanzaChannel();
- void setSession(boost::shared_ptr<ClientSession> session);
+ void setSession(std::shared_ptr<ClientSession> session);
- void sendIQ(boost::shared_ptr<IQ> iq);
- void sendMessage(boost::shared_ptr<Message> message);
- void sendPresence(boost::shared_ptr<Presence> presence);
+ void sendIQ(std::shared_ptr<IQ> iq);
+ void sendMessage(std::shared_ptr<Message> message);
+ void sendPresence(std::shared_ptr<Presence> presence);
bool getStreamManagementEnabled() const;
virtual std::vector<Certificate::ref> getPeerCertificateChain() const;
@@ -38,15 +38,15 @@ namespace Swift {
private:
std::string getNewIQID();
- void send(boost::shared_ptr<Stanza> stanza);
- void handleSessionFinished(boost::shared_ptr<Error> error);
- void handleStanza(boost::shared_ptr<Stanza> stanza);
- void handleStanzaAcked(boost::shared_ptr<Stanza> stanza);
+ void send(std::shared_ptr<Stanza> stanza);
+ void handleSessionFinished(std::shared_ptr<Error> error);
+ void handleStanza(std::shared_ptr<Stanza> stanza);
+ void handleStanzaAcked(std::shared_ptr<Stanza> stanza);
void handleSessionInitialized();
private:
IDGenerator idGenerator;
- boost::shared_ptr<ClientSession> session;
+ std::shared_ptr<ClientSession> 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 <Swiften/Client/CoreClient.h>
+#include <memory>
+
#include <boost/bind.hpp>
#include <boost/optional.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Algorithm.h>
#include <Swiften/Base/IDGenerator.h>
@@ -115,7 +116,7 @@ void CoreClient::connect(const ClientOptions& o) {
}
assert(!connector_);
if (options.boshURL.isEmpty()) {
- connector_ = boost::make_shared<ChainedConnector>(host, port, serviceLookupPrefix, networkFactories->getDomainNameResolver(), connectionFactories, networkFactories->getTimerFactory());
+ connector_ = std::make_shared<ChainedConnector>(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> boshSessionStream_ = boost::shared_ptr<BOSHSessionStream>(new BOSHSessionStream(
+ std::shared_ptr<BOSHSessionStream> boshSessionStream_ = std::shared_ptr<BOSHSessionStream>(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> connection, boost::shared_ptr<Error> error) {
+void CoreClient::handleConnectorFinished(std::shared_ptr<Connection> connection, std::shared_ptr<Error> error) {
resetConnector();
if (!connection) {
if (options.forgetPassword) {
@@ -189,7 +190,7 @@ void CoreClient::handleConnectorFinished(boost::shared_ptr<Connection> connectio
}
boost::optional<ClientError> clientError;
if (!disconnectRequested_) {
- clientError = boost::dynamic_pointer_cast<DomainNameResolveError>(error) ? boost::optional<ClientError>(ClientError::DomainNameResolveError) : boost::optional<ClientError>(ClientError::ConnectionError);
+ clientError = std::dynamic_pointer_cast<DomainNameResolveError>(error) ? boost::optional<ClientError>(ClientError::DomainNameResolveError) : boost::optional<ClientError>(ClientError::ConnectionError);
}
onDisconnected(clientError);
}
@@ -205,7 +206,7 @@ void CoreClient::handleConnectorFinished(boost::shared_ptr<Connection> connectio
connection_ = connection;
- sessionStream_ = boost::make_shared<BasicSessionStream>(ClientStreamType, connection_, getPayloadParserFactories(), getPayloadSerializers(), networkFactories->getTLSContextFactory(), networkFactories->getTimerFactory(), networkFactories->getXMLParserFactory(), options.tlsOptions);
+ sessionStream_ = std::make_shared<BasicSessionStream>(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> error) {
+void CoreClient::handleSessionFinished(std::shared_ptr<Error> error) {
if (options.forgetPassword) {
purgePassword();
}
@@ -241,7 +242,7 @@ void CoreClient::handleSessionFinished(boost::shared_ptr<Error> error) {
boost::optional<ClientError> actualError;
if (error) {
ClientError clientError;
- if (boost::shared_ptr<ClientSession::Error> actualError = boost::dynamic_pointer_cast<ClientSession::Error>(error)) {
+ if (std::shared_ptr<ClientSession::Error> actualError = std::dynamic_pointer_cast<ClientSession::Error>(error)) {
switch(actualError->type) {
case ClientSession::Error::AuthenticationFailedError:
clientError = ClientError(ClientError::AuthenticationFailedError);
@@ -276,7 +277,7 @@ void CoreClient::handleSessionFinished(boost::shared_ptr<Error> error) {
}
clientError.setErrorCode(actualError->errorCode);
}
- else if (boost::shared_ptr<TLSError> actualError = boost::dynamic_pointer_cast<TLSError>(error)) {
+ else if (std::shared_ptr<TLSError> actualError = std::dynamic_pointer_cast<TLSError>(error)) {
switch(actualError->getType()) {
case TLSError::CertificateCardRemoved:
clientError = ClientError(ClientError::CertificateCardRemoved);
@@ -286,7 +287,7 @@ void CoreClient::handleSessionFinished(boost::shared_ptr<Error> error) {
break;
}
}
- else if (boost::shared_ptr<SessionStream::SessionStreamError> actualError = boost::dynamic_pointer_cast<SessionStream::SessionStreamError>(error)) {
+ else if (std::shared_ptr<SessionStream::SessionStreamError> actualError = std::dynamic_pointer_cast<SessionStream::SessionStreamError>(error)) {
switch(actualError->type) {
case SessionStream::SessionStreamError::ParseError:
clientError = ClientError(ClientError::XMLError);
@@ -305,7 +306,7 @@ void CoreClient::handleSessionFinished(boost::shared_ptr<Error> error) {
break;
}
}
- else if (boost::shared_ptr<CertificateVerificationError> verificationError = boost::dynamic_pointer_cast<CertificateVerificationError>(error)) {
+ else if (std::shared_ptr<CertificateVerificationError> verificationError = std::dynamic_pointer_cast<CertificateVerificationError>(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> message) {
+void CoreClient::sendMessage(std::shared_ptr<Message> message) {
stanzaChannel_->sendMessage(message);
}
-void CoreClient::sendPresence(boost::shared_ptr<Presence> presence) {
+void CoreClient::sendPresence(std::shared_ptr<Presence> presence) {
stanzaChannel_->sendPresence(presence);
}
@@ -458,7 +459,7 @@ void CoreClient::resetSession() {
if (connection_) {
connection_->disconnect();
}
- else if (boost::dynamic_pointer_cast<BOSHSessionStream>(sessionStream_)) {
+ else if (std::dynamic_pointer_cast<BOSHSessionStream>(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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeByteArray.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -78,12 +77,12 @@ namespace Swift {
/**
* Sends a message.
*/
- void sendMessage(boost::shared_ptr<Message>);
+ void sendMessage(std::shared_ptr<Message>);
/**
* Sends a presence stanza.
*/
- void sendPresence(boost::shared_ptr<Presence>);
+ void sendPresence(std::shared_ptr<Presence>);
/**
* Sends raw, unchecked data.
@@ -177,12 +176,12 @@ namespace Swift {
/**
* Emitted when a message is received.
*/
- boost::signal<void (boost::shared_ptr<Message>)> onMessageReceived;
+ boost::signal<void (std::shared_ptr<Message>)> onMessageReceived;
/**
* Emitted when a presence stanza is received.
*/
- boost::signal<void (boost::shared_ptr<Presence>) > onPresenceReceived;
+ boost::signal<void (std::shared_ptr<Presence>) > onPresenceReceived;
/**
* Emitted when the server acknowledges receipt of a
@@ -190,10 +189,10 @@ namespace Swift {
*
* \see getStreamManagementEnabled()
*/
- boost::signal<void (boost::shared_ptr<Stanza>)> onStanzaAcked;
+ boost::signal<void (std::shared_ptr<Stanza>)> onStanzaAcked;
protected:
- boost::shared_ptr<ClientSession> getSession() const {
+ std::shared_ptr<ClientSession> getSession() const {
return session_;
}
@@ -207,15 +206,15 @@ namespace Swift {
virtual void handleConnected() {}
private:
- void handleConnectorFinished(boost::shared_ptr<Connection>, boost::shared_ptr<Error> error);
+ void handleConnectorFinished(std::shared_ptr<Connection>, std::shared_ptr<Error> error);
void handleStanzaChannelAvailableChanged(bool available);
- void handleSessionFinished(boost::shared_ptr<Error>);
+ void handleSessionFinished(std::shared_ptr<Error>);
void handleNeedCredentials();
void handleDataRead(const SafeByteArray&);
void handleDataWritten(const SafeByteArray&);
- void handlePresenceReceived(boost::shared_ptr<Presence>);
- void handleMessageReceived(boost::shared_ptr<Message>);
- void handleStanzaAcked(boost::shared_ptr<Stanza>);
+ void handlePresenceReceived(std::shared_ptr<Presence>);
+ void handleMessageReceived(std::shared_ptr<Message>);
+ void handleStanzaAcked(std::shared_ptr<Stanza>);
void purgePassword();
void bindSessionToStream();
@@ -230,11 +229,11 @@ namespace Swift {
ClientSessionStanzaChannel* stanzaChannel_;
IQRouter* iqRouter_;
ClientOptions options;
- boost::shared_ptr<ChainedConnector> connector_;
+ std::shared_ptr<ChainedConnector> connector_;
std::vector<ConnectionFactory*> proxyConnectionFactories;
- boost::shared_ptr<Connection> connection_;
- boost::shared_ptr<SessionStream> sessionStream_;
- boost::shared_ptr<ClientSession> session_;
+ std::shared_ptr<Connection> connection_;
+ std::shared_ptr<SessionStream> sessionStream_;
+ std::shared_ptr<ClientSession> 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> stanza) {
+ virtual void sendStanza(std::shared_ptr<Stanza> stanza) {
sentStanzas.push_back(stanza);
}
@@ -24,15 +24,15 @@ namespace Swift {
onAvailableChanged(available);
}
- virtual void sendIQ(boost::shared_ptr<IQ> iq) {
+ virtual void sendIQ(std::shared_ptr<IQ> iq) {
sentStanzas.push_back(iq);
}
- virtual void sendMessage(boost::shared_ptr<Message> message) {
+ virtual void sendMessage(std::shared_ptr<Message> message) {
sentStanzas.push_back(message);
}
- virtual void sendPresence(boost::shared_ptr<Presence> presence) {
+ virtual void sendPresence(std::shared_ptr<Presence> presence) {
sentStanzas.push_back(presence);
}
@@ -52,7 +52,7 @@ namespace Swift {
if (index >= sentStanzas.size()) {
return false;
}
- boost::shared_ptr<IQ> iqStanza = boost::dynamic_pointer_cast<IQ>(sentStanzas[index]);
+ std::shared_ptr<IQ> iqStanza = std::dynamic_pointer_cast<IQ>(sentStanzas[index]);
return iqStanza && iqStanza->getType() == type && iqStanza->getTo() == jid && iqStanza->getPayload<T>();
}
@@ -60,7 +60,7 @@ namespace Swift {
if (index >= sentStanzas.size()) {
return false;
}
- boost::shared_ptr<IQ> iqStanza = boost::dynamic_pointer_cast<IQ>(sentStanzas[index]);
+ std::shared_ptr<IQ> iqStanza = std::dynamic_pointer_cast<IQ>(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<IQ> iqStanza = boost::dynamic_pointer_cast<IQ>(sentStanzas[index]);
+ std::shared_ptr<IQ> iqStanza = std::dynamic_pointer_cast<IQ>(sentStanzas[index]);
return iqStanza && iqStanza->getType() == IQ::Error && iqStanza->getID() == id;
}
- template<typename T> boost::shared_ptr<T> getStanzaAtIndex(size_t index) {
+ template<typename T> std::shared_ptr<T> getStanzaAtIndex(size_t index) {
if (sentStanzas.size() <= index) {
- return boost::shared_ptr<T>();
+ return std::shared_ptr<T>();
}
- return boost::dynamic_pointer_cast<T>(sentStanzas[index]);
+ return std::dynamic_pointer_cast<T>(sentStanzas[index]);
}
std::vector<Certificate::ref> getPeerCertificateChain() const {
return std::vector<Certificate::ref>();
}
- std::vector<boost::shared_ptr<Stanza> > sentStanzas;
+ std::vector<std::shared_ptr<Stanza> > 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 <Swiften/Client/NickResolver.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/MUC/MUCRegistry.h>
#include <Swiften/Roster/XMPPRoster.h>
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 <map>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/VCard.h>
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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -18,15 +18,15 @@
namespace Swift {
class SWIFTEN_API StanzaChannel : public IQChannel {
public:
- virtual void sendMessage(boost::shared_ptr<Message>) = 0;
- virtual void sendPresence(boost::shared_ptr<Presence>) = 0;
+ virtual void sendMessage(std::shared_ptr<Message>) = 0;
+ virtual void sendPresence(std::shared_ptr<Presence>) = 0;
virtual bool isAvailable() const = 0;
virtual bool getStreamManagementEnabled() const = 0;
virtual std::vector<Certificate::ref> getPeerCertificateChain() const = 0;
boost::signal<void (bool /* isAvailable */)> onAvailableChanged;
- boost::signal<void (boost::shared_ptr<Message>)> onMessageReceived;
- boost::signal<void (boost::shared_ptr<Presence>) > onPresenceReceived;
- boost::signal<void (boost::shared_ptr<Stanza>)> onStanzaAcked;
+ boost::signal<void (std::shared_ptr<Message>)> onMessageReceived;
+ boost::signal<void (std::shared_ptr<Presence>) > onPresenceReceived;
+ boost::signal<void (std::shared_ptr<Stanza>)> 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<BlockListImpl>();
+ blockList_ = std::make_shared<BlockListImpl>();
addedJIDs_.clear();
removedJIDs_.clear();
blockList_->addItem(JID("a@example.com"));
@@ -83,7 +83,7 @@ class BlockListImplTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<BlockListImpl> blockList_;
+ std::shared_ptr<BlockListImpl> blockList_;
std::vector<JID> addedJIDs_;
std::vector<JID> 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<IQ>(2);
CPPUNIT_ASSERT(request.get() != nullptr);
- boost::shared_ptr<BlockPayload> blockPayload = request->getPayload<BlockPayload>();
+ std::shared_ptr<BlockPayload> blockPayload = request->getPayload<BlockPayload>();
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<size_t>(1), clientBlockListManager_->getBlockList()->getItems().size());
// send block push
- boost::shared_ptr<BlockPayload> pushPayload = boost::make_shared<BlockPayload>();
+ std::shared_ptr<BlockPayload> pushPayload = std::make_shared<BlockPayload>();
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<IQ>(2);
CPPUNIT_ASSERT(request.get() != nullptr);
- boost::shared_ptr<UnblockPayload> unblockPayload = request->getPayload<UnblockPayload>();
+ std::shared_ptr<UnblockPayload> unblockPayload = request->getPayload<UnblockPayload>();
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<size_t>(2), clientBlockListManager_->getBlockList()->getItems().size());
// send block push
- boost::shared_ptr<UnblockPayload> pushPayload = boost::make_shared<UnblockPayload>();
+ std::shared_ptr<UnblockPayload> pushPayload = std::make_shared<UnblockPayload>();
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<IQ>(2);
CPPUNIT_ASSERT(request.get() != nullptr);
- boost::shared_ptr<UnblockPayload> unblockPayload = request->getPayload<UnblockPayload>();
+ std::shared_ptr<UnblockPayload> unblockPayload = request->getPayload<UnblockPayload>();
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<size_t>(3), clientBlockListManager_->getBlockList()->getItems().size());
// send block push
- boost::shared_ptr<UnblockPayload> pushPayload = boost::make_shared<UnblockPayload>();
+ std::shared_ptr<UnblockPayload> pushPayload = std::make_shared<UnblockPayload>();
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<JID>& blockedJids) {
- boost::shared_ptr<BlockList> blockList = clientBlockListManager_->requestBlockList();
+ std::shared_ptr<BlockList> blockList = clientBlockListManager_->requestBlockList();
CPPUNIT_ASSERT(blockList);
// check for IQ request
IQ::ref request = stanzaChannel_->getStanzaAtIndex<IQ>(0);
CPPUNIT_ASSERT(request.get() != nullptr);
- boost::shared_ptr<BlockListPayload> requestPayload = request->getPayload<BlockListPayload>();
+ std::shared_ptr<BlockListPayload> requestPayload = request->getPayload<BlockListPayload>();
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<BlockListPayload> responsePayload = boost::make_shared<BlockListPayload>();
+ std::shared_ptr<BlockListPayload> responsePayload = std::make_shared<BlockListPayload>();
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 <deque>
+#include <memory>
#include <boost/bind.hpp>
#include <boost/optional.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -75,9 +75,9 @@ class ClientSessionTest : public CppUnit::TestFixture {
public:
void setUp() {
- crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
- idnConverter = boost::shared_ptr<IDNConverter>(PlatformIDNConverter::create());
- server = boost::make_shared<MockSessionStream>();
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ idnConverter = std::shared_ptr<IDNConverter>(PlatformIDNConverter::create());
+ server = std::make_shared<MockSessionStream>();
sessionFinishedReceived = false;
needCredentials = false;
blindCertificateTrustChecker = new BlindCertificateTrustChecker();
@@ -88,7 +88,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testStart_Error() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
session->start();
server->breakConnection();
@@ -98,7 +98,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testStart_StreamError() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
session->start();
server->sendStreamStart();
server->sendStreamError();
@@ -109,7 +109,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testStartTLS() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
session->setCertificateTrustChecker(blindCertificateTrustChecker);
session->start();
server->receiveStreamStart();
@@ -127,7 +127,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testStartTLS_ServerError() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
session->start();
server->receiveStreamStart();
server->sendStreamStart();
@@ -142,7 +142,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testStartTLS_ConnectError() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
session->start();
server->receiveStreamStart();
server->sendStreamStart();
@@ -157,7 +157,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testStartTLS_InvalidIdentity() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> 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<CertificateVerificationError>(sessionFinishedError)->getType());
+ CPPUNIT_ASSERT_EQUAL(CertificateVerificationError::InvalidServerIdentity, std::dynamic_pointer_cast<CertificateVerificationError>(sessionFinishedError)->getType());
}
void testStart_StreamFeaturesWithoutResourceBindingFails() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
session->start();
server->receiveStreamStart();
server->sendStreamStart();
@@ -187,7 +187,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testAuthenticate() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
session->start();
server->receiveStreamStart();
server->sendStreamStart();
@@ -203,7 +203,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testAuthenticate_Unauthorized() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
session->start();
server->receiveStreamStart();
server->sendStreamStart();
@@ -220,7 +220,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testAuthenticate_PLAINOverNonTLS() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
session->setAllowPLAINOverNonTLS(false);
session->start();
server->receiveStreamStart();
@@ -233,7 +233,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testAuthenticate_RequireTLS() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> 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<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
session->start();
server->receiveStreamStart();
server->sendStreamStart();
@@ -259,7 +259,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testAuthenticate_EXTERNAL() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
session->start();
server->receiveStreamStart();
server->sendStreamStart();
@@ -272,7 +272,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testUnexpectedChallenge() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
session->start();
server->receiveStreamStart();
server->sendStreamStart();
@@ -287,7 +287,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testStreamManagement() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
session->start();
server->receiveStreamStart();
server->sendStreamStart();
@@ -311,7 +311,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testStreamManagement_Failed() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
session->start();
server->receiveStreamStart();
server->sendStreamStart();
@@ -334,7 +334,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void testFinishAcksStanzas() {
- boost::shared_ptr<ClientSession> session(createSession());
+ std::shared_ptr<ClientSession> session(createSession());
initializeSession(session);
server->sendMessage();
server->sendMessage();
@@ -346,15 +346,15 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<ClientSession> createSession() {
- boost::shared_ptr<ClientSession> session = ClientSession::create(JID("me@foo.com"), server, idnConverter.get(), crypto.get());
+ std::shared_ptr<ClientSession> createSession() {
+ std::shared_ptr<ClientSession> 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<ClientSession> session) {
+ void initializeSession(std::shared_ptr<ClientSession> session) {
session->start();
server->receiveStreamStart();
server->sendStreamStart();
@@ -371,7 +371,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
server->sendStreamManagementEnabled();
}
- void handleSessionFinished(boost::shared_ptr<Error> error) {
+ void handleSessionFinished(std::shared_ptr<Error> 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<ToplevelElement> element) : element(element), footer(false) {}
+ Event(std::shared_ptr<ToplevelElement> element) : element(element), footer(false) {}
Event(const ProtocolHeader& header) : header(header), footer(false) {}
Event() : footer(true) {}
- boost::shared_ptr<ToplevelElement> element;
+ std::shared_ptr<ToplevelElement> element;
boost::optional<ProtocolHeader> header;
bool footer;
};
@@ -396,7 +396,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
virtual void close() {
- onClosed(boost::shared_ptr<Error>());
+ onClosed(std::shared_ptr<Error>());
}
virtual bool isOpen() {
@@ -411,7 +411,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
receivedEvents.push_back(Event());
}
- virtual void writeElement(boost::shared_ptr<ToplevelElement> element) {
+ virtual void writeElement(std::shared_ptr<ToplevelElement> element) {
receivedEvents.push_back(Event(element));
}
@@ -442,8 +442,8 @@ class ClientSessionTest : public CppUnit::TestFixture {
return std::vector<Certificate::ref>();
}
- virtual boost::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const {
- return boost::shared_ptr<CertificateVerificationError>();
+ virtual std::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const {
+ return std::shared_ptr<CertificateVerificationError>();
}
virtual bool supportsZLibCompression() {
@@ -463,11 +463,11 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void breakConnection() {
- onClosed(boost::make_shared<SessionStream::SessionStreamError>(SessionStream::SessionStreamError::ConnectionReadError));
+ onClosed(std::make_shared<SessionStream::SessionStreamError>(SessionStream::SessionStreamError::ConnectionReadError));
}
void breakTLS() {
- onClosed(boost::make_shared<SessionStream::SessionStreamError>(SessionStream::SessionStreamError::TLSError));
+ onClosed(std::make_shared<SessionStream::SessionStreamError>(SessionStream::SessionStreamError::TLSError));
}
@@ -478,29 +478,29 @@ class ClientSessionTest : public CppUnit::TestFixture {
}
void sendStreamFeaturesWithStartTLS() {
- boost::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures());
+ std::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures());
streamFeatures->setHasStartTLS();
onElementReceived(streamFeatures);
}
void sendChallenge() {
- onElementReceived(boost::make_shared<AuthChallenge>());
+ onElementReceived(std::make_shared<AuthChallenge>());
}
void sendStreamError() {
- onElementReceived(boost::make_shared<StreamError>());
+ onElementReceived(std::make_shared<StreamError>());
}
void sendTLSProceed() {
- onElementReceived(boost::make_shared<TLSProceed>());
+ onElementReceived(std::make_shared<TLSProceed>());
}
void sendTLSFailure() {
- onElementReceived(boost::make_shared<StartTLSFailure>());
+ onElementReceived(std::make_shared<StartTLSFailure>());
}
void sendStreamFeaturesWithMultipleAuthentication() {
- boost::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures());
+ std::shared_ptr<StreamFeatures> 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> streamFeatures(new StreamFeatures());
+ std::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures());
streamFeatures->addAuthenticationMechanism("PLAIN");
onElementReceived(streamFeatures);
}
void sendStreamFeaturesWithEXTERNALAuthentication() {
- boost::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures());
+ std::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures());
streamFeatures->addAuthenticationMechanism("EXTERNAL");
onElementReceived(streamFeatures);
}
void sendStreamFeaturesWithUnknownAuthentication() {
- boost::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures());
+ std::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures());
streamFeatures->addAuthenticationMechanism("UNKNOWN");
onElementReceived(streamFeatures);
}
void sendStreamFeaturesWithBindAndStreamManagement() {
- boost::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures());
+ std::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures());
streamFeatures->setHasResourceBind();
streamFeatures->setHasStreamManagement();
onElementReceived(streamFeatures);
}
void sendEmptyStreamFeatures() {
- onElementReceived(boost::make_shared<StreamFeatures>());
+ onElementReceived(std::make_shared<StreamFeatures>());
}
void sendAuthSuccess() {
- onElementReceived(boost::make_shared<AuthSuccess>());
+ onElementReceived(std::make_shared<AuthSuccess>());
}
void sendAuthFailure() {
- onElementReceived(boost::make_shared<AuthFailure>());
+ onElementReceived(std::make_shared<AuthFailure>());
}
void sendStreamManagementEnabled() {
- onElementReceived(boost::make_shared<StreamManagementEnabled>());
+ onElementReceived(std::make_shared<StreamManagementEnabled>());
}
void sendStreamManagementFailed() {
- onElementReceived(boost::make_shared<StreamManagementFailed>());
+ onElementReceived(std::make_shared<StreamManagementFailed>());
}
void sendBindResult() {
- boost::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
+ std::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
resourceBind->setJID(JID("foo@bar.com/bla"));
- boost::shared_ptr<IQ> iq = IQ::createResult(JID("foo@bar.com"), bindID, resourceBind);
+ std::shared_ptr<IQ> iq = IQ::createResult(JID("foo@bar.com"), bindID, resourceBind);
onElementReceived(iq);
}
void sendMessage() {
- boost::shared_ptr<Message> message = boost::make_shared<Message>();
+ std::shared_ptr<Message> message = std::make_shared<Message>();
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<StartTLSRequest>(event.element));
+ CPPUNIT_ASSERT(std::dynamic_pointer_cast<StartTLSRequest>(event.element));
}
void receiveAuthRequest(const std::string& mech) {
Event event = popEvent();
CPPUNIT_ASSERT(event.element);
- boost::shared_ptr<AuthRequest> request(boost::dynamic_pointer_cast<AuthRequest>(event.element));
+ std::shared_ptr<AuthRequest> request(std::dynamic_pointer_cast<AuthRequest>(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<EnableStreamManagement>(event.element));
+ CPPUNIT_ASSERT(std::dynamic_pointer_cast<EnableStreamManagement>(event.element));
}
void receiveBind() {
Event event = popEvent();
CPPUNIT_ASSERT(event.element);
- boost::shared_ptr<IQ> iq = boost::dynamic_pointer_cast<IQ>(event.element);
+ std::shared_ptr<IQ> iq = std::dynamic_pointer_cast<IQ>(event.element);
CPPUNIT_ASSERT(iq);
CPPUNIT_ASSERT(iq->getPayload<ResourceBind>());
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<StanzaAck> ack = boost::dynamic_pointer_cast<StanzaAck>(event.element);
+ std::shared_ptr<StanzaAck> ack = std::dynamic_pointer_cast<StanzaAck>(event.element);
CPPUNIT_ASSERT(ack);
CPPUNIT_ASSERT_EQUAL(n, ack->getHandledStanzasCount());
}
@@ -624,20 +624,20 @@ class ClientSessionTest : public CppUnit::TestFixture {
std::deque<Event> receivedEvents;
};
- boost::shared_ptr<IDNConverter> idnConverter;
- boost::shared_ptr<MockSessionStream> server;
+ std::shared_ptr<IDNConverter> idnConverter;
+ std::shared_ptr<MockSessionStream> server;
bool sessionFinishedReceived;
bool needCredentials;
- boost::shared_ptr<Error> sessionFinishedError;
+ std::shared_ptr<Error> sessionFinishedError;
BlindCertificateTrustChecker* blindCertificateTrustChecker;
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> crypto;
};
CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest);
#if 0
void testAuthenticate() {
- boost::shared_ptr<MockSession> session(createSession("me@foo.com/Bar"));
+ std::shared_ptr<MockSession> 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<MockSession> session(createSession("me@foo.com/Bar"));
+ std::shared_ptr<MockSession> 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<MockSession> session(createSession("me@foo.com/Bar"));
+ std::shared_ptr<MockSession> 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<MockSession> session(createSession("me@foo.com/Bar"));
+ std::shared_ptr<MockSession> 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<MockSession> session(createSession("me@foo.com/Bar"));
+ std::shared_ptr<MockSession> 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<MockSession> session(createSession("me@foo.com"));
+ std::shared_ptr<MockSession> 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<MockSession> session(createSession("me@foo.com"));
+ std::shared_ptr<MockSession> 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<MockSession> session(createSession("me@foo.com/Bar"));
+ std::shared_ptr<MockSession> 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<MockSession> session(createSession("me@foo.com/Bar"));
+ std::shared_ptr<MockSession> 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<MockSession> session(createSession("me@foo.com/Bar"));
+ std::shared_ptr<MockSession> 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<MockSession> session(createSession("me@foo.com/Bar"));
+ std::shared_ptr<MockSession> 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<MockSession> session(createSession("me@foo.com/Bar"));
+ std::shared_ptr<MockSession> 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<Message>()));
+ session->sendElement(std::make_shared<Message>()));
}
void testSendElement() {
- boost::shared_ptr<MockSession> session(createSession("me@foo.com/Bar"));
+ std::shared_ptr<MockSession> 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<int>(receivedElements_.size()));
- CPPUNIT_ASSERT(boost::dynamic_pointer_cast<Message>(receivedElements_[0]));
+ CPPUNIT_ASSERT(std::dynamic_pointer_cast<Message>(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<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(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<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> 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<Connection>());
+ finish(std::shared_ptr<Connection>());
}
void ComponentConnector::handleAddressQueryResult(const std::vector<HostAddress>& addresses, boost::optional<DomainNameResolveError> error) {
addressQuery.reset();
if (error || addresses.empty()) {
- finish(boost::shared_ptr<Connection>());
+ finish(std::shared_ptr<Connection>());
}
else {
addressQueryResults = std::deque<HostAddress>(addresses.begin(), addresses.end());
@@ -76,7 +76,7 @@ void ComponentConnector::handleConnectionConnectFinished(bool error) {
tryNextAddress();
}
else {
- finish(boost::shared_ptr<Connection>());
+ finish(std::shared_ptr<Connection>());
}
}
else {
@@ -84,7 +84,7 @@ void ComponentConnector::handleConnectionConnectFinished(bool error) {
}
}
-void ComponentConnector::finish(boost::shared_ptr<Connection> connection) {
+void ComponentConnector::finish(std::shared_ptr<Connection> 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> connection) {
}
void ComponentConnector::handleTimeout() {
- finish(boost::shared_ptr<Connection>());
+ finish(std::shared_ptr<Connection>());
}
}
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 <deque>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Network/Connection.h>
@@ -24,9 +23,9 @@ namespace Swift {
class ConnectionFactory;
class TimerFactory;
- class SWIFTEN_API ComponentConnector : public boost::bsignals::trackable, public boost::enable_shared_from_this<ComponentConnector> {
+ class SWIFTEN_API ComponentConnector : public boost::bsignals::trackable, public std::enable_shared_from_this<ComponentConnector> {
public:
- typedef boost::shared_ptr<ComponentConnector> ref;
+ typedef std::shared_ptr<ComponentConnector> 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<void (boost::shared_ptr<Connection>)> onConnectFinished;
+ boost::signal<void (std::shared_ptr<Connection>)> 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<Connection>);
+ void finish(std::shared_ptr<Connection>);
void handleTimeout();
@@ -58,9 +57,9 @@ namespace Swift {
ConnectionFactory* connectionFactory;
TimerFactory* timerFactory;
int timeoutMilliseconds;
- boost::shared_ptr<Timer> timer;
- boost::shared_ptr<DomainNameAddressQuery> addressQuery;
+ std::shared_ptr<Timer> timer;
+ std::shared_ptr<DomainNameAddressQuery> addressQuery;
std::deque<HostAddress> addressQueryResults;
- boost::shared_ptr<Connection> currentConnection;
+ std::shared_ptr<Connection> 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 <Swiften/Component/ComponentSession.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Component/ComponentHandshakeGenerator.h>
#include <Swiften/Elements/ComponentHandshake.h>
@@ -17,7 +18,7 @@
namespace Swift {
-ComponentSession::ComponentSession(const JID& jid, const std::string& secret, boost::shared_ptr<SessionStream> 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<SessionStream> 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> stanza) {
+void ComponentSession::sendStanza(std::shared_ptr<Stanza> 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<ToplevelElement> element) {
- if (boost::shared_ptr<Stanza> stanza = boost::dynamic_pointer_cast<Stanza>(element)) {
+void ComponentSession::handleElement(std::shared_ptr<ToplevelElement> element) {
+ if (std::shared_ptr<Stanza> stanza = std::dynamic_pointer_cast<Stanza>(element)) {
if (getState() == Initialized) {
onStanzaReceived(stanza);
}
@@ -58,7 +59,7 @@ void ComponentSession::handleElement(boost::shared_ptr<ToplevelElement> element)
finishSession(Error::UnexpectedElementError);
}
}
- else if (boost::dynamic_pointer_cast<ComponentHandshake>(element)) {
+ else if (std::dynamic_pointer_cast<ComponentHandshake>(element)) {
if (!checkState(Authenticating)) {
return;
}
@@ -67,7 +68,7 @@ void ComponentSession::handleElement(boost::shared_ptr<ToplevelElement> element)
onInitialized();
}
else if (getState() == Authenticating) {
- if (boost::dynamic_pointer_cast<StreamFeatures>(element)) {
+ if (std::dynamic_pointer_cast<StreamFeatures>(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<Swift::Error> streamError) {
+void ComponentSession::handleStreamClosed(std::shared_ptr<Swift::Error> streamError) {
State oldState = state;
state = Finished;
stream->setWhitespacePingEnabled(false);
@@ -104,14 +105,14 @@ void ComponentSession::handleStreamClosed(boost::shared_ptr<Swift::Error> stream
}
void ComponentSession::finish() {
- finishSession(boost::shared_ptr<Error>());
+ finishSession(std::shared_ptr<Error>());
}
void ComponentSession::finishSession(Error::Type error) {
- finishSession(boost::make_shared<Swift::ComponentSession::Error>(error));
+ finishSession(std::make_shared<Swift::ComponentSession::Error>(error));
}
-void ComponentSession::finishSession(boost::shared_ptr<Swift::Error> finishError) {
+void ComponentSession::finishSession(std::shared_ptr<Swift::Error> 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 <memory>
#include <string>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Error.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -23,7 +21,7 @@ namespace Swift {
class ComponentAuthenticator;
class CryptoProvider;
- class SWIFTEN_API ComponentSession : public boost::enable_shared_from_this<ComponentSession> {
+ class SWIFTEN_API ComponentSession : public std::enable_shared_from_this<ComponentSession> {
public:
enum State {
Initial,
@@ -44,8 +42,8 @@ namespace Swift {
~ComponentSession();
- static boost::shared_ptr<ComponentSession> create(const JID& jid, const std::string& secret, boost::shared_ptr<SessionStream> stream, CryptoProvider* crypto) {
- return boost::shared_ptr<ComponentSession>(new ComponentSession(jid, secret, stream, crypto));
+ static std::shared_ptr<ComponentSession> create(const JID& jid, const std::string& secret, std::shared_ptr<SessionStream> stream, CryptoProvider* crypto) {
+ return std::shared_ptr<ComponentSession>(new ComponentSession(jid, secret, stream, crypto));
}
State getState() const {
@@ -55,33 +53,33 @@ namespace Swift {
void start();
void finish();
- void sendStanza(boost::shared_ptr<Stanza>);
+ void sendStanza(std::shared_ptr<Stanza>);
public:
boost::signal<void ()> onInitialized;
- boost::signal<void (boost::shared_ptr<Swift::Error>)> onFinished;
- boost::signal<void (boost::shared_ptr<Stanza>)> onStanzaReceived;
+ boost::signal<void (std::shared_ptr<Swift::Error>)> onFinished;
+ boost::signal<void (std::shared_ptr<Stanza>)> onStanzaReceived;
private:
- ComponentSession(const JID& jid, const std::string& secret, boost::shared_ptr<SessionStream>, CryptoProvider*);
+ ComponentSession(const JID& jid, const std::string& secret, std::shared_ptr<SessionStream>, CryptoProvider*);
void finishSession(Error::Type error);
- void finishSession(boost::shared_ptr<Swift::Error> error);
+ void finishSession(std::shared_ptr<Swift::Error> error);
void sendStreamHeader();
- void handleElement(boost::shared_ptr<ToplevelElement>);
+ void handleElement(std::shared_ptr<ToplevelElement>);
void handleStreamStart(const ProtocolHeader&);
- void handleStreamClosed(boost::shared_ptr<Swift::Error>);
+ void handleStreamClosed(std::shared_ptr<Swift::Error>);
bool checkState(State);
private:
JID jid;
std::string secret;
- boost::shared_ptr<SessionStream> stream;
+ std::shared_ptr<SessionStream> stream;
CryptoProvider* crypto;
- boost::shared_ptr<Swift::Error> error;
+ std::shared_ptr<Swift::Error> 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<ComponentSession> session) {
+void ComponentSessionStanzaChannel::setSession(std::shared_ptr<ComponentSession> session) {
assert(!this->session);
this->session = session;
session->onInitialized.connect(boost::bind(&ComponentSessionStanzaChannel::handleSessionInitialized, this));
@@ -20,15 +20,15 @@ void ComponentSessionStanzaChannel::setSession(boost::shared_ptr<ComponentSessio
session->onStanzaReceived.connect(boost::bind(&ComponentSessionStanzaChannel::handleStanza, this, _1));
}
-void ComponentSessionStanzaChannel::sendIQ(boost::shared_ptr<IQ> iq) {
+void ComponentSessionStanzaChannel::sendIQ(std::shared_ptr<IQ> iq) {
send(iq);
}
-void ComponentSessionStanzaChannel::sendMessage(boost::shared_ptr<Message> message) {
+void ComponentSessionStanzaChannel::sendMessage(std::shared_ptr<Message> message) {
send(message);
}
-void ComponentSessionStanzaChannel::sendPresence(boost::shared_ptr<Presence> presence) {
+void ComponentSessionStanzaChannel::sendPresence(std::shared_ptr<Presence> presence) {
send(presence);
}
@@ -36,7 +36,7 @@ std::string ComponentSessionStanzaChannel::getNewIQID() {
return idGenerator.generateID();
}
-void ComponentSessionStanzaChannel::send(boost::shared_ptr<Stanza> stanza) {
+void ComponentSessionStanzaChannel::send(std::shared_ptr<Stanza> 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> stanza) {
session->sendStanza(stanza);
}
-void ComponentSessionStanzaChannel::handleSessionFinished(boost::shared_ptr<Error>) {
+void ComponentSessionStanzaChannel::handleSessionFinished(std::shared_ptr<Error>) {
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<Erro
onAvailableChanged(false);
}
-void ComponentSessionStanzaChannel::handleStanza(boost::shared_ptr<Stanza> stanza) {
- boost::shared_ptr<Message> message = boost::dynamic_pointer_cast<Message>(stanza);
+void ComponentSessionStanzaChannel::handleStanza(std::shared_ptr<Stanza> stanza) {
+ std::shared_ptr<Message> message = std::dynamic_pointer_cast<Message>(stanza);
if (message) {
onMessageReceived(message);
return;
}
- boost::shared_ptr<Presence> presence = boost::dynamic_pointer_cast<Presence>(stanza);
+ std::shared_ptr<Presence> presence = std::dynamic_pointer_cast<Presence>(stanza);
if (presence) {
onPresenceReceived(presence);
return;
}
- boost::shared_ptr<IQ> iq = boost::dynamic_pointer_cast<IQ>(stanza);
+ std::shared_ptr<IQ> iq = std::dynamic_pointer_cast<IQ>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/IDGenerator.h>
@@ -22,11 +22,11 @@ namespace Swift {
*/
class SWIFTEN_API ComponentSessionStanzaChannel : public StanzaChannel {
public:
- void setSession(boost::shared_ptr<ComponentSession> session);
+ void setSession(std::shared_ptr<ComponentSession> session);
- void sendIQ(boost::shared_ptr<IQ> iq);
- void sendMessage(boost::shared_ptr<Message> message);
- void sendPresence(boost::shared_ptr<Presence> presence);
+ void sendIQ(std::shared_ptr<IQ> iq);
+ void sendMessage(std::shared_ptr<Message> message);
+ void sendPresence(std::shared_ptr<Presence> presence);
bool getStreamManagementEnabled() const {
return false;
@@ -43,14 +43,14 @@ namespace Swift {
private:
std::string getNewIQID();
- void send(boost::shared_ptr<Stanza> stanza);
- void handleSessionFinished(boost::shared_ptr<Error> error);
- void handleStanza(boost::shared_ptr<Stanza> stanza);
+ void send(std::shared_ptr<Stanza> stanza);
+ void handleSessionFinished(std::shared_ptr<Error> error);
+ void handleStanza(std::shared_ptr<Stanza> stanza);
void handleSessionInitialized();
private:
IDGenerator idGenerator;
- boost::shared_ptr<ComponentSession> session;
+ std::shared_ptr<ComponentSession> 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> connection) {
+void CoreComponent::handleConnectorFinished(std::shared_ptr<Connection> connection) {
connector_->onConnectFinished.disconnect(boost::bind(&CoreComponent::handleConnectorFinished, this, _1));
connector_.reset();
if (!connection) {
@@ -65,7 +65,7 @@ void CoreComponent::handleConnectorFinished(boost::shared_ptr<Connection> connec
connection_ = connection;
assert(!sessionStream_);
- sessionStream_ = boost::shared_ptr<BasicSessionStream>(new BasicSessionStream(ComponentStreamType, connection_, getPayloadParserFactories(), getPayloadSerializers(), nullptr, networkFactories->getTimerFactory(), networkFactories->getXMLParserFactory(), TLSOptions()));
+ sessionStream_ = std::make_shared<BasicSessionStream>(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> error) {
+void CoreComponent::handleSessionFinished(std::shared_ptr<Error> error) {
session_->onFinished.disconnect(boost::bind(&CoreComponent::handleSessionFinished, this, _1));
session_.reset();
@@ -106,7 +106,7 @@ void CoreComponent::handleSessionFinished(boost::shared_ptr<Error> error) {
if (error) {
ComponentError componentError;
- if (boost::shared_ptr<ComponentSession::Error> actualError = boost::dynamic_pointer_cast<ComponentSession::Error>(error)) {
+ if (std::shared_ptr<ComponentSession::Error> actualError = std::dynamic_pointer_cast<ComponentSession::Error>(error)) {
switch(actualError->type) {
case ComponentSession::Error::AuthenticationFailedError:
componentError = ComponentError(ComponentError::AuthenticationFailedError);
@@ -116,7 +116,7 @@ void CoreComponent::handleSessionFinished(boost::shared_ptr<Error> error) {
break;
}
}
- else if (boost::shared_ptr<SessionStream::SessionStreamError> actualError = boost::dynamic_pointer_cast<SessionStream::SessionStreamError>(error)) {
+ else if (std::shared_ptr<SessionStream::SessionStreamError> actualError = std::dynamic_pointer_cast<SessionStream::SessionStreamError>(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> message) {
+void CoreComponent::sendMessage(std::shared_ptr<Message> message) {
stanzaChannel_->sendMessage(message);
}
-void CoreComponent::sendPresence(boost::shared_ptr<Presence> presence) {
+void CoreComponent::sendPresence(std::shared_ptr<Presence> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Error.h>
#include <Swiften/Base/SafeByteArray.h>
@@ -50,8 +49,8 @@ namespace Swift {
void connect(const std::string& host, int port);
void disconnect();
- void sendMessage(boost::shared_ptr<Message>);
- void sendPresence(boost::shared_ptr<Presence>);
+ void sendMessage(std::shared_ptr<Message>);
+ void sendPresence(std::shared_ptr<Presence>);
void sendData(const std::string& data);
IQRouter* getIQRouter() const {
@@ -79,13 +78,13 @@ namespace Swift {
boost::signal<void (const SafeByteArray&)> onDataRead;
boost::signal<void (const SafeByteArray&)> onDataWritten;
- boost::signal<void (boost::shared_ptr<Message>)> onMessageReceived;
- boost::signal<void (boost::shared_ptr<Presence>) > onPresenceReceived;
+ boost::signal<void (std::shared_ptr<Message>)> onMessageReceived;
+ boost::signal<void (std::shared_ptr<Presence>) > onPresenceReceived;
private:
- void handleConnectorFinished(boost::shared_ptr<Connection>);
+ void handleConnectorFinished(std::shared_ptr<Connection>);
void handleStanzaChannelAvailableChanged(bool available);
- void handleSessionFinished(boost::shared_ptr<Error>);
+ void handleSessionFinished(std::shared_ptr<Error>);
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> connection_;
- boost::shared_ptr<BasicSessionStream> sessionStream_;
- boost::shared_ptr<ComponentSession> session_;
+ std::shared_ptr<Connection> connection_;
+ std::shared_ptr<BasicSessionStream> sessionStream_;
+ std::shared_ptr<ComponentSession> 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> connection) {
- boost::shared_ptr<MockConnection> c(boost::dynamic_pointer_cast<MockConnection>(connection));
+ void handleConnectorFinished(std::shared_ptr<Connection> connection) {
+ std::shared_ptr<MockConnection> c(std::dynamic_pointer_cast<MockConnection>(connection));
if (connection) {
assert(c);
}
@@ -188,8 +188,8 @@ class ComponentConnectorTest : public CppUnit::TestFixture {
MockConnectionFactory(EventLoop* eventLoop) : eventLoop(eventLoop), isResponsive(true) {
}
- boost::shared_ptr<Connection> createConnection() {
- return boost::shared_ptr<Connection>(new MockConnection(failingPorts, isResponsive, eventLoop));
+ std::shared_ptr<Connection> createConnection() {
+ return std::make_shared<MockConnection>(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<MockConnection> > connections;
+ std::vector< std::shared_ptr<MockConnection> > 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<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
}
void testGetHandshake() {
@@ -35,7 +35,7 @@ class ComponentHandshakeGeneratorTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> 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<MockSessionStream>();
+ server = std::make_shared<MockSessionStream>();
sessionFinishedReceived = false;
- crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
}
void testStart() {
- boost::shared_ptr<ComponentSession> session(createSession());
+ std::shared_ptr<ComponentSession> session(createSession());
session->start();
server->receiveStreamStart();
server->sendStreamStart();
@@ -51,7 +51,7 @@ class ComponentSessionTest : public CppUnit::TestFixture {
}
void testStart_Error() {
- boost::shared_ptr<ComponentSession> session(createSession());
+ std::shared_ptr<ComponentSession> session(createSession());
session->start();
server->breakConnection();
@@ -61,7 +61,7 @@ class ComponentSessionTest : public CppUnit::TestFixture {
}
void testStart_Unauthorized() {
- boost::shared_ptr<ComponentSession> session(createSession());
+ std::shared_ptr<ComponentSession> session(createSession());
session->start();
server->receiveStreamStart();
server->sendStreamStart();
@@ -74,13 +74,13 @@ class ComponentSessionTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<ComponentSession> createSession() {
- boost::shared_ptr<ComponentSession> session = ComponentSession::create(JID("service.foo.com"), "servicesecret", server, crypto.get());
+ std::shared_ptr<ComponentSession> createSession() {
+ std::shared_ptr<ComponentSession> 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> error) {
+ void handleSessionFinished(std::shared_ptr<Error> 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<ToplevelElement> element) : element(element), footer(false) {}
+ Event(std::shared_ptr<ToplevelElement> element) : element(element), footer(false) {}
Event(const ProtocolHeader& header) : header(header), footer(false) {}
Event() : footer(true) {}
- boost::shared_ptr<ToplevelElement> element;
+ std::shared_ptr<ToplevelElement> element;
boost::optional<ProtocolHeader> header;
bool footer;
};
@@ -101,7 +101,7 @@ class ComponentSessionTest : public CppUnit::TestFixture {
}
virtual void close() {
- onClosed(boost::shared_ptr<Error>());
+ onClosed(std::shared_ptr<Error>());
}
virtual bool isOpen() {
@@ -116,7 +116,7 @@ class ComponentSessionTest : public CppUnit::TestFixture {
receivedEvents.push_back(Event());
}
- virtual void writeElement(boost::shared_ptr<ToplevelElement> element) {
+ virtual void writeElement(std::shared_ptr<ToplevelElement> element) {
receivedEvents.push_back(Event(element));
}
@@ -147,8 +147,8 @@ class ComponentSessionTest : public CppUnit::TestFixture {
return std::vector<Certificate::ref>();
}
- virtual boost::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const {
- return boost::shared_ptr<CertificateVerificationError>();
+ virtual std::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const {
+ return std::shared_ptr<CertificateVerificationError>();
}
virtual bool supportsZLibCompression() {
@@ -168,7 +168,7 @@ class ComponentSessionTest : public CppUnit::TestFixture {
}
void breakConnection() {
- onClosed(boost::make_shared<SessionStream::SessionStreamError>(SessionStream::SessionStreamError::ConnectionReadError));
+ onClosed(std::make_shared<SessionStream::SessionStreamError>(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<ComponentHandshake>(event.element));
+ ComponentHandshake::ref handshake(std::dynamic_pointer_cast<ComponentHandshake>(event.element));
CPPUNIT_ASSERT(handshake);
CPPUNIT_ASSERT_EQUAL(std::string("4c4f8a41141722c8bbfbdd92d827f7b2fc0a542b"), handshake->getData());
}
@@ -213,10 +213,10 @@ class ComponentSessionTest : public CppUnit::TestFixture {
std::deque<Event> receivedEvents;
};
- boost::shared_ptr<MockSessionStream> server;
+ std::shared_ptr<MockSessionStream> server;
bool sessionFinishedReceived;
- boost::shared_ptr<Error> sessionFinishedError;
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<Error> sessionFinishedError;
+ std::shared_ptr<CryptoProvider> 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<Private>()) {
+ZLibCodecompressor::ZLibCodecompressor() : p(std::make_shared<Private>()) {
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<Private> p;
+ std::shared_ptr<Private> 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 <Swiften/Crypto/CryptoProvider.h>
-#include <boost/shared_ptr.hpp>
+#include <memory>
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<typename T> ByteArray getSHA1Hash(const T& data) {
- return boost::shared_ptr<Hash>(createSHA1())->update(data).getHash();
+ return std::shared_ptr<Hash>(createSHA1())->update(data).getHash();
}
template<typename T> ByteArray getMD5Hash(const T& data) {
- return boost::shared_ptr<Hash>(createMD5())->update(data).getHash();
+ return std::shared_ptr<Hash>(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<Hash> sha = boost::shared_ptr<Hash>(provider->createSHA1());
+ std::shared_ptr<Hash> sha = std::shared_ptr<Hash>(provider->createSHA1());
sha->update(createByteArray("client/pc//Exodus 0.9.1<http://jabber.org/protocol/caps<http://jabber.org/protocol/disco#info<http://jabber.org/protocol/disco#items<http://jabber.org/protocol/muc<"));
CPPUNIT_ASSERT_EQUAL(createByteArray("\x42\x06\xb2\x3c\xa6\xb0\xa6\x43\xd2\x0d\x89\xb0\x4f\xf5\x8c\xf7\x8b\x80\x96\xed"), sha->getHash());
}
void testGetSHA1Hash_TwoUpdates() {
- boost::shared_ptr<Hash> sha = boost::shared_ptr<Hash>(provider->createSHA1());
+ std::shared_ptr<Hash> sha = std::shared_ptr<Hash>(provider->createSHA1());
sha->update(createByteArray("client/pc//Exodus 0.9.1<http://jabber.org/protocol/caps<"));
sha->update(createByteArray("http://jabber.org/protocol/disco#info<http://jabber.org/protocol/disco#items<http://jabber.org/protocol/muc<"));
@@ -73,7 +73,7 @@ class CryptoProviderTest : public CppUnit::TestFixture {
}
void testGetSHA1Hash_NoData() {
- boost::shared_ptr<Hash> sha = boost::shared_ptr<Hash>(provider->createSHA1());
+ std::shared_ptr<Hash> sha = std::shared_ptr<Hash>(provider->createSHA1());
sha->update(std::vector<unsigned char>());
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<Hash> testling = boost::shared_ptr<Hash>(provider->createMD5());
+ std::shared_ptr<Hash> testling = std::shared_ptr<Hash>(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 <security.h>
#include <Wincrypt.h>
#include <cassert>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Crypto/Hash.h>
#include <Swiften/Base/ByteArray.h>
@@ -191,7 +191,7 @@ namespace {
}
WindowsCryptoProvider::WindowsCryptoProvider() {
- p = boost::make_shared<Private>();
+ p = std::make_shared<Private>();
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 <memory>
+
#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/Override.h>
#include <Swiften/Crypto/CryptoProvider.h>
@@ -26,6 +27,6 @@ namespace Swift {
private:
struct Private;
- boost::shared_ptr<Private> p;
+ std::shared_ptr<Private> 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> presence) {
- boost::shared_ptr<CapsInfo> capsInfo = presence->getPayload<CapsInfo>();
+void CapsManager::handlePresenceReceived(std::shared_ptr<Presence> presence) {
+ std::shared_ptr<CapsInfo> capsInfo = presence->getPayload<CapsInfo>();
if (!capsInfo || capsInfo->getHash() != "sha-1" || presence->getPayload<ErrorPayload>()) {
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<Presence>);
+ void handlePresenceReceived(std::shared_ptr<Presence>);
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 <map>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Disco/CapsStorage.h>
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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/DiscoInfo.h>
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 <Swiften/Disco/DiscoInfoResponder.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Elements/DiscoInfo.h>
#include <Swiften/Queries/IQRouter.h>
@@ -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<DiscoInfo> info) {
+bool DiscoInfoResponder::handleGetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr<DiscoInfo> info) {
if (info->getNode().empty()) {
- sendResponse(from, id, boost::make_shared<DiscoInfo>(info_));
+ sendResponse(from, id, std::make_shared<DiscoInfo>(info_));
}
else {
std::map<std::string,DiscoInfo>::const_iterator i = nodeInfo_.find(info->getNode());
if (i != nodeInfo_.end()) {
- sendResponse(from, id, boost::make_shared<DiscoInfo>((*i).second));
+ sendResponse(from, id, std::make_shared<DiscoInfo>((*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<DiscoInfo> payload);
+ virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr<DiscoInfo> 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<DiscoInfo> info, ErrorPayload::ref error, GetDiscoInfoRequest::ref request) {
+void DiscoServiceWalker::handleDiscoInfoResponse(std::shared_ptr<DiscoInfo> 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<DiscoInfo> in
}
}
-void DiscoServiceWalker::handleDiscoItemsResponse(boost::shared_ptr<DiscoItems> items, ErrorPayload::ref error, GetDiscoItemsRequest::ref request) {
+void DiscoServiceWalker::handleDiscoItemsResponse(std::shared_ptr<DiscoItems> 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 <memory>
#include <set>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Disco/GetDiscoInfoRequest.h>
@@ -48,7 +47,7 @@ namespace Swift {
}
/** Emitted for each service found. */
- boost::signal<void(const JID&, boost::shared_ptr<DiscoInfo>)> onServiceFound;
+ boost::signal<void(const JID&, std::shared_ptr<DiscoInfo>)> onServiceFound;
/** Emitted when walking is aborted. */
boost::signal<void()> onWalkAborted;
@@ -59,8 +58,8 @@ namespace Swift {
private:
void walkNode(const JID& jid);
void markNodeCompleted(const JID& jid);
- void handleDiscoInfoResponse(boost::shared_ptr<DiscoInfo> info, ErrorPayload::ref error, GetDiscoInfoRequest::ref request);
- void handleDiscoItemsResponse(boost::shared_ptr<DiscoItems> items, ErrorPayload::ref error, GetDiscoItemsRequest::ref request);
+ void handleDiscoInfoResponse(std::shared_ptr<DiscoInfo> info, ErrorPayload::ref error, GetDiscoInfoRequest::ref request);
+ void handleDiscoItemsResponse(std::shared_ptr<DiscoItems> 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> presence) {
+void EntityCapsManager::handlePresenceReceived(std::shared_ptr<Presence> presence) {
JID from = presence->getFrom();
if (presence->isAvailable()) {
- boost::shared_ptr<CapsInfo> capsInfo = presence->getPayload<CapsInfo>();
+ std::shared_ptr<CapsInfo> capsInfo = presence->getPayload<CapsInfo>();
if (!capsInfo || capsInfo->getHash() != "sha-1" || presence->getPayload<ErrorPayload>()) {
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<Presence>);
+ void handlePresenceReceived(std::shared_ptr<Presence>);
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>();
+ discoInfo = std::make_shared<DiscoInfo>();
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 <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/DiscoInfo.h>
@@ -15,7 +15,7 @@
namespace Swift {
class SWIFTEN_API GetDiscoInfoRequest : public GenericRequest<DiscoInfo> {
public:
- typedef boost::shared_ptr<GetDiscoInfoRequest> ref;
+ typedef std::shared_ptr<GetDiscoInfoRequest> 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<DiscoInfo>(IQ::Get, jid, boost::make_shared<DiscoInfo>(), router) {
+ GenericRequest<DiscoInfo>(IQ::Get, jid, std::make_shared<DiscoInfo>(), router) {
}
GetDiscoInfoRequest(const JID& jid, const std::string& node, IQRouter* router) :
- GenericRequest<DiscoInfo>(IQ::Get, jid, boost::make_shared<DiscoInfo>(), router) {
+ GenericRequest<DiscoInfo>(IQ::Get, jid, std::make_shared<DiscoInfo>(), 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 <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/DiscoItems.h>
@@ -15,7 +15,7 @@
namespace Swift {
class SWIFTEN_API GetDiscoItemsRequest : public GenericRequest<DiscoItems> {
public:
- typedef boost::shared_ptr<GetDiscoItemsRequest> ref;
+ typedef std::shared_ptr<GetDiscoItemsRequest> 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<DiscoItems>(IQ::Get, jid, boost::make_shared<DiscoItems>(), router) {
+ GenericRequest<DiscoItems>(IQ::Get, jid, std::make_shared<DiscoItems>(), router) {
}
GetDiscoItemsRequest(const JID& jid, const std::string& node, IQRouter* router) :
- GenericRequest<DiscoItems>(IQ::Get, jid, boost::make_shared<DiscoItems>(), router) {
+ GenericRequest<DiscoItems>(IQ::Get, jid, std::make_shared<DiscoItems>(), 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 <Swiften/Disco/JIDDiscoInfoResponder.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Elements/DiscoInfo.h>
#include <Swiften/Queries/IQRouter.h>
@@ -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> discoInfo) {
+bool JIDDiscoInfoResponder::handleGetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr<DiscoInfo> discoInfo) {
JIDDiscoInfoMap::const_iterator i = info.find(to);
if (i != info.end()) {
if (discoInfo->getNode().empty()) {
- sendResponse(from, to, id, boost::make_shared<DiscoInfo>(i->second.discoInfo));
+ sendResponse(from, to, id, std::make_shared<DiscoInfo>(i->second.discoInfo));
}
else {
std::map<std::string,DiscoInfo>::const_iterator j = i->second.nodeDiscoInfo.find(discoInfo->getNode());
if (j != i->second.nodeDiscoInfo.end()) {
- sendResponse(from, to, id, boost::make_shared<DiscoInfo>(j->second));
+ sendResponse(from, to, id, std::make_shared<DiscoInfo>(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<DiscoInfo> payload);
+ virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr<DiscoInfo> 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<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(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>(FormField::HiddenType, "urn:xmpp:dataforms:softwareinfo");
+ FormField::ref field = std::make_shared<FormField>(FormField::HiddenType, "urn:xmpp:dataforms:softwareinfo");
field->setName("FORM_TYPE");
extension->addField(field);
- field = boost::make_shared<FormField>(FormField::ListMultiType);
+ field = std::make_shared<FormField>(FormField::ListMultiType);
field->addValue("ipv6");
field->addValue("ipv4");
field->setName("ip_version");
extension->addField(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Psi");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Psi");
field->setName("software");
extension->addField(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "0.11");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "0.11");
field->setName("software_version");
extension->addField(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Mac");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Mac");
field->setName("os");
extension->addField(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "10.5.1");
+ field = std::make_shared<FormField>(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<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> 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<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
stanzaChannel = new DummyStanzaChannel();
iqRouter = new IQRouter(stanzaChannel);
storage = new CapsMemoryStorage();
user1 = JID("user1@bar.com/bla");
- discoInfo1 = boost::make_shared<DiscoInfo>();
+ discoInfo1 = std::make_shared<DiscoInfo>();
discoInfo1->addFeature("http://swift.im/feature1");
- capsInfo1 = boost::make_shared<CapsInfo>(CapsInfoGenerator("http://node1.im", crypto.get()).generateCapsInfo(*discoInfo1.get()));
- capsInfo1alt = boost::make_shared<CapsInfo>(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo1.get()));
+ capsInfo1 = std::make_shared<CapsInfo>(CapsInfoGenerator("http://node1.im", crypto.get()).generateCapsInfo(*discoInfo1.get()));
+ capsInfo1alt = std::make_shared<CapsInfo>(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo1.get()));
user2 = JID("user2@foo.com/baz");
- discoInfo2 = boost::make_shared<DiscoInfo>();
+ discoInfo2 = std::make_shared<DiscoInfo>();
discoInfo2->addFeature("http://swift.im/feature2");
- capsInfo2 = boost::make_shared<CapsInfo>(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo2.get()));
+ capsInfo2 = std::make_shared<CapsInfo>(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo2.get()));
user3 = JID("user3@foo.com/baz");
- legacyCapsInfo = boost::make_shared<CapsInfo>("http://swift.im", "ver1", "");
+ legacyCapsInfo = std::make_shared<CapsInfo>("http://swift.im", "ver1", "");
}
void tearDown() {
@@ -69,17 +69,17 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveNewHashRequestsDisco() {
- boost::shared_ptr<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
CPPUNIT_ASSERT(stanzaChannel->isRequestAtIndex<DiscoInfo>(0, user1, IQ::Get));
- boost::shared_ptr<DiscoInfo> discoInfo(stanzaChannel->sentStanzas[0]->getPayload<DiscoInfo>());
+ std::shared_ptr<DiscoInfo> discoInfo(stanzaChannel->sentStanzas[0]->getPayload<DiscoInfo>());
CPPUNIT_ASSERT(discoInfo);
CPPUNIT_ASSERT_EQUAL("http://node1.im#" + capsInfo1->getVersion(), discoInfo->getNode());
}
void testReceiveSameHashDoesNotRequestDisco() {
- boost::shared_ptr<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> 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<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, legacyCapsInfo);
CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(stanzaChannel->sentStanzas.size()));
}
void testReceiveSameHashAfterSuccesfulDiscoDoesNotRequestDisco() {
- boost::shared_ptr<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
sendDiscoInfoResult(discoInfo1);
@@ -106,7 +106,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveSameHashFromSameUserAfterFailedDiscoDoesNotRequestDisco() {
- boost::shared_ptr<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> 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<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
sendDiscoInfoResult(discoInfo2);
@@ -128,7 +128,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveSameHashFromDifferentUserAfterFailedDiscoRequestsDisco() {
- boost::shared_ptr<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> 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<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
sendDiscoInfoResult(discoInfo2);
@@ -148,7 +148,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveDifferentHashFromSameUserAfterFailedDiscoDoesNotRequestDisco() {
- boost::shared_ptr<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> 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<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
sendDiscoInfoResult(discoInfo1);
- boost::shared_ptr<DiscoInfo> discoInfo(storage->getDiscoInfo(capsInfo1->getVersion()));
+ std::shared_ptr<DiscoInfo> discoInfo(storage->getDiscoInfo(capsInfo1->getVersion()));
CPPUNIT_ASSERT(discoInfo);
CPPUNIT_ASSERT(discoInfo->hasFeature("http://swift.im/feature1"));
}
void testReceiveIncorrectVerificationDiscoDoesNotStoreCaps() {
- boost::shared_ptr<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
sendDiscoInfoResult(discoInfo2);
- boost::shared_ptr<DiscoInfo> discoInfo(storage->getDiscoInfo(capsInfo1->getVersion()));
+ std::shared_ptr<DiscoInfo> discoInfo(storage->getDiscoInfo(capsInfo1->getVersion()));
CPPUNIT_ASSERT(!discoInfo);
}
void testReceiveFailingDiscoFallsBack() {
- boost::shared_ptr<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> 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<DiscoInfo>(1, user2, IQ::Get));
- boost::shared_ptr<DiscoInfo> discoInfo(stanzaChannel->sentStanzas[1]->getPayload<DiscoInfo>());
+ std::shared_ptr<DiscoInfo> discoInfo(stanzaChannel->sentStanzas[1]->getPayload<DiscoInfo>());
CPPUNIT_ASSERT(discoInfo);
CPPUNIT_ASSERT_EQUAL("http://node2.im#" + capsInfo1alt->getVersion(), discoInfo->getNode());
}
void testReceiveNoDiscoFallsBack() {
- boost::shared_ptr<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> 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<DiscoInfo>()));
+ stanzaChannel->onIQReceived(IQ::createResult(JID("baz@fum.com/dum"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID(), std::shared_ptr<DiscoInfo>()));
CPPUNIT_ASSERT(stanzaChannel->isRequestAtIndex<DiscoInfo>(1, user2, IQ::Get));
- boost::shared_ptr<DiscoInfo> discoInfo(stanzaChannel->sentStanzas[1]->getPayload<DiscoInfo>());
+ std::shared_ptr<DiscoInfo> discoInfo(stanzaChannel->sentStanzas[1]->getPayload<DiscoInfo>());
CPPUNIT_ASSERT(discoInfo);
CPPUNIT_ASSERT_EQUAL("http://node2.im#" + capsInfo1alt->getVersion(), discoInfo->getNode());
}
void testReceiveFailingFallbackDiscoFallsBack() {
- boost::shared_ptr<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> 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<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> 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<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> 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<CapsManager> testling = createManager();
+ std::shared_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
stanzaChannel->sentStanzas.clear();
stanzaChannel->setAvailable(false);
@@ -250,8 +250,8 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<CapsManager> createManager() {
- boost::shared_ptr<CapsManager> manager(new CapsManager(storage, stanzaChannel, iqRouter, crypto.get()));
+ std::shared_ptr<CapsManager> createManager() {
+ std::shared_ptr<CapsManager> 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<CapsInfo> caps) {
- boost::shared_ptr<Presence> presence(new Presence());
+ void sendPresenceWithCaps(const JID& jid, std::shared_ptr<CapsInfo> caps) {
+ std::shared_ptr<Presence> presence(new Presence());
presence->setFrom(jid);
presence->addPayload(caps);
stanzaChannel->onPresenceReceived(presence);
}
- void sendDiscoInfoResult(boost::shared_ptr<DiscoInfo> discoInfo) {
+ void sendDiscoInfoResult(std::shared_ptr<DiscoInfo> 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<JID> changes;
JID user1;
- boost::shared_ptr<DiscoInfo> discoInfo1;
- boost::shared_ptr<CapsInfo> capsInfo1;
- boost::shared_ptr<CapsInfo> capsInfo1alt;
+ std::shared_ptr<DiscoInfo> discoInfo1;
+ std::shared_ptr<CapsInfo> capsInfo1;
+ std::shared_ptr<CapsInfo> capsInfo1alt;
JID user2;
- boost::shared_ptr<DiscoInfo> discoInfo2;
- boost::shared_ptr<CapsInfo> capsInfo2;
- boost::shared_ptr<CapsInfo> legacyCapsInfo;
+ std::shared_ptr<DiscoInfo> discoInfo2;
+ std::shared_ptr<CapsInfo> capsInfo2;
+ std::shared_ptr<CapsInfo> legacyCapsInfo;
JID user3;
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> 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<DiscoInfo> query(new DiscoInfo());
+ std::shared_ptr<DiscoInfo> query(new DiscoInfo());
channel_->onIQReceived(IQ::createRequest(IQ::Get, JID("foo@bar.com"), "id-1", query));
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel_->iqs_.size()));
- boost::shared_ptr<DiscoInfo> payload(channel_->iqs_[0]->getPayload<DiscoInfo>());
+ std::shared_ptr<DiscoInfo> payload(channel_->iqs_[0]->getPayload<DiscoInfo>());
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<DiscoInfo> query(new DiscoInfo());
+ std::shared_ptr<DiscoInfo> 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<int>(channel_->iqs_.size()));
- boost::shared_ptr<DiscoInfo> payload(channel_->iqs_[0]->getPayload<DiscoInfo>());
+ std::shared_ptr<DiscoInfo> payload(channel_->iqs_[0]->getPayload<DiscoInfo>());
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<DiscoInfo> query(new DiscoInfo());
+ std::shared_ptr<DiscoInfo> 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<int>(channel_->iqs_.size()));
- boost::shared_ptr<ErrorPayload> payload(channel_->iqs_[0]->getPayload<ErrorPayload>());
+ std::shared_ptr<ErrorPayload> payload(channel_->iqs_[0]->getPayload<ErrorPayload>());
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<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
stanzaChannel = new DummyStanzaChannel();
capsProvider = new DummyCapsProvider();
user1 = JID("user1@bar.com/bla");
- discoInfo1 = boost::make_shared<DiscoInfo>();
+ discoInfo1 = std::make_shared<DiscoInfo>();
discoInfo1->addFeature("http://swift.im/feature1");
- capsInfo1 = boost::make_shared<CapsInfo>(CapsInfoGenerator("http://node1.im", crypto.get()).generateCapsInfo(*discoInfo1.get()));
- capsInfo1alt = boost::make_shared<CapsInfo>(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo1.get()));
+ capsInfo1 = std::make_shared<CapsInfo>(CapsInfoGenerator("http://node1.im", crypto.get()).generateCapsInfo(*discoInfo1.get()));
+ capsInfo1alt = std::make_shared<CapsInfo>(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo1.get()));
user2 = JID("user2@foo.com/baz");
- discoInfo2 = boost::make_shared<DiscoInfo>();
+ discoInfo2 = std::make_shared<DiscoInfo>();
discoInfo2->addFeature("http://swift.im/feature2");
- capsInfo2 = boost::make_shared<CapsInfo>(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo2.get()));
+ capsInfo2 = std::make_shared<CapsInfo>(CapsInfoGenerator("http://node2.im", crypto.get()).generateCapsInfo(*discoInfo2.get()));
user3 = JID("user3@foo.com/baz");
- legacyCapsInfo = boost::make_shared<CapsInfo>("http://swift.im", "ver1", "");
+ legacyCapsInfo = std::make_shared<CapsInfo>("http://swift.im", "ver1", "");
}
void tearDown() {
@@ -58,7 +58,7 @@ class EntityCapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveKnownHash() {
- boost::shared_ptr<EntityCapsManager> testling = createManager();
+ std::shared_ptr<EntityCapsManager> testling = createManager();
capsProvider->caps[capsInfo1->getVersion()] = discoInfo1;
sendPresenceWithCaps(user1, capsInfo1);
@@ -68,7 +68,7 @@ class EntityCapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveKnownHashTwiceDoesNotTriggerChange() {
- boost::shared_ptr<EntityCapsManager> testling = createManager();
+ std::shared_ptr<EntityCapsManager> 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<EntityCapsManager> testling = createManager();
+ std::shared_ptr<EntityCapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(changes.size()));
}
void testHashAvailable() {
- boost::shared_ptr<EntityCapsManager> testling = createManager();
+ std::shared_ptr<EntityCapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
capsProvider->caps[capsInfo1->getVersion()] = discoInfo1;
@@ -98,7 +98,7 @@ class EntityCapsManagerTest : public CppUnit::TestFixture {
}
void testReceiveUnknownHashAfterKnownHashTriggersChangeAndClearsCaps() {
- boost::shared_ptr<EntityCapsManager> testling = createManager();
+ std::shared_ptr<EntityCapsManager> 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<EntityCapsManager> testling = createManager();
+ std::shared_ptr<EntityCapsManager> 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<EntityCapsManager> testling = createManager();
+ std::shared_ptr<EntityCapsManager> 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<EntityCapsManager> createManager() {
- boost::shared_ptr<EntityCapsManager> manager(new EntityCapsManager(capsProvider, stanzaChannel));
+ std::shared_ptr<EntityCapsManager> createManager() {
+ std::shared_ptr<EntityCapsManager> 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<CapsInfo> caps) {
- boost::shared_ptr<Presence> presence(new Presence());
+ void sendPresenceWithCaps(const JID& jid, std::shared_ptr<CapsInfo> caps) {
+ std::shared_ptr<Presence> presence(new Presence());
presence->setFrom(jid);
presence->addPayload(caps);
stanzaChannel->onPresenceReceived(presence);
}
void sendUnavailablePresence(const JID& jid) {
- boost::shared_ptr<Presence> presence(new Presence());
+ std::shared_ptr<Presence> 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<DiscoInfo> discoInfo1;
- boost::shared_ptr<CapsInfo> capsInfo1;
- boost::shared_ptr<CapsInfo> capsInfo1alt;
+ std::shared_ptr<DiscoInfo> discoInfo1;
+ std::shared_ptr<CapsInfo> capsInfo1;
+ std::shared_ptr<CapsInfo> capsInfo1alt;
JID user2;
- boost::shared_ptr<DiscoInfo> discoInfo2;
- boost::shared_ptr<CapsInfo> capsInfo2;
- boost::shared_ptr<CapsInfo> legacyCapsInfo;
+ std::shared_ptr<DiscoInfo> discoInfo2;
+ std::shared_ptr<CapsInfo> capsInfo2;
+ std::shared_ptr<CapsInfo> legacyCapsInfo;
JID user3;
std::vector<JID> changes;
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> 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<DiscoInfo> query(new DiscoInfo());
+ std::shared_ptr<DiscoInfo> query(new DiscoInfo());
channel_->onIQReceived(IQ::createRequest(IQ::Get, JID("foo@bar.com/baz"), "id-1", query));
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel_->iqs_.size()));
- boost::shared_ptr<DiscoInfo> payload(channel_->iqs_[0]->getPayload<DiscoInfo>());
+ std::shared_ptr<DiscoInfo> payload(channel_->iqs_[0]->getPayload<DiscoInfo>());
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<DiscoInfo> query(new DiscoInfo());
+ std::shared_ptr<DiscoInfo> 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<int>(channel_->iqs_.size()));
- boost::shared_ptr<DiscoInfo> payload(channel_->iqs_[0]->getPayload<DiscoInfo>());
+ std::shared_ptr<DiscoInfo> payload(channel_->iqs_[0]->getPayload<DiscoInfo>());
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<DiscoInfo> query(new DiscoInfo());
+ std::shared_ptr<DiscoInfo> 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<int>(channel_->iqs_.size()));
- boost::shared_ptr<ErrorPayload> payload(channel_->iqs_[0]->getPayload<ErrorPayload>());
+ std::shared_ptr<ErrorPayload> payload(channel_->iqs_[0]->getPayload<ErrorPayload>());
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<DiscoInfo> query(new DiscoInfo());
+ std::shared_ptr<DiscoInfo> query(new DiscoInfo());
channel_->onIQReceived(IQ::createRequest(IQ::Get, JID("foo@bar.com/fum"), "id-1", query));
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel_->iqs_.size()));
- boost::shared_ptr<ErrorPayload> payload(channel_->iqs_[0]->getPayload<ErrorPayload>());
+ std::shared_ptr<ErrorPayload> payload(channel_->iqs_[0]->getPayload<ErrorPayload>());
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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/ToplevelElement.h>
@@ -14,7 +14,7 @@
namespace Swift {
class SWIFTEN_API AuthFailure : public ToplevelElement {
public:
- typedef boost::shared_ptr<AuthFailure> ref;
+ typedef std::shared_ptr<AuthFailure> 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 <memory>
#include <string>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
@@ -19,7 +19,7 @@
namespace Swift {
class SWIFTEN_API Bytestreams : public Payload {
public:
- typedef boost::shared_ptr<Bytestreams> ref;
+ typedef std::shared_ptr<Bytestreams> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
class SWIFTEN_API CapsInfo : public Payload {
public:
- typedef boost::shared_ptr<CapsInfo> ref;
+ typedef std::shared_ptr<CapsInfo> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
@@ -14,7 +14,7 @@
namespace Swift {
class SWIFTEN_API CarbonsDisable : public Payload {
public:
- typedef boost::shared_ptr<CarbonsDisable> ref;
+ typedef std::shared_ptr<CarbonsDisable> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
@@ -14,7 +14,7 @@
namespace Swift {
class SWIFTEN_API CarbonsEnable : public Payload {
public:
- typedef boost::shared_ptr<CarbonsEnable> ref;
+ typedef std::shared_ptr<CarbonsEnable> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
@@ -14,7 +14,7 @@
namespace Swift {
class SWIFTEN_API CarbonsPrivate : public Payload {
public:
- typedef boost::shared_ptr<CarbonsPrivate> ref;
+ typedef std::shared_ptr<CarbonsPrivate> 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> forwarded) {
+ void CarbonsReceived::setForwarded(std::shared_ptr<Forwarded> forwarded) {
forwarded_ = forwarded;
}
- boost::shared_ptr<Forwarded> CarbonsReceived::getForwarded() const {
+ std::shared_ptr<Forwarded> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Forwarded.h>
@@ -15,14 +15,14 @@
namespace Swift {
class SWIFTEN_API CarbonsReceived : public Payload {
public:
- typedef boost::shared_ptr<CarbonsReceived> ref;
+ typedef std::shared_ptr<CarbonsReceived> ref;
public:
virtual ~CarbonsReceived();
- void setForwarded(boost::shared_ptr<Forwarded> forwarded);
- boost::shared_ptr<Forwarded> getForwarded() const;
+ void setForwarded(std::shared_ptr<Forwarded> forwarded);
+ std::shared_ptr<Forwarded> getForwarded() const;
private:
- boost::shared_ptr<Forwarded> forwarded_;
+ std::shared_ptr<Forwarded> 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> forwarded) {
+ void CarbonsSent::setForwarded(std::shared_ptr<Forwarded> forwarded) {
forwarded_ = forwarded;
}
- boost::shared_ptr<Forwarded> CarbonsSent::getForwarded() const {
+ std::shared_ptr<Forwarded> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Forwarded.h>
@@ -15,14 +15,14 @@
namespace Swift {
class SWIFTEN_API CarbonsSent : public Payload {
public:
- typedef boost::shared_ptr<CarbonsSent> ref;
+ typedef std::shared_ptr<CarbonsSent> ref;
public:
virtual ~CarbonsSent();
- void setForwarded(boost::shared_ptr<Forwarded> forwarded);
- boost::shared_ptr<Forwarded> getForwarded() const;
+ void setForwarded(std::shared_ptr<Forwarded> forwarded);
+ std::shared_ptr<Forwarded> getForwarded() const;
private:
- boost::shared_ptr<Forwarded> forwarded_;
+ std::shared_ptr<Forwarded> 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<ChatState> ref;
+ typedef std::shared_ptr<ChatState> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Form.h>
#include <Swiften/Elements/Payload.h>
@@ -20,7 +19,7 @@ namespace Swift {
*/
class SWIFTEN_API Command : public Payload {
public:
- typedef boost::shared_ptr<Command> ref;
+ typedef std::shared_ptr<Command> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
class SWIFTEN_API ComponentHandshake : public ToplevelElement {
public:
- typedef boost::shared_ptr<ComponentHandshake> ref;
+ typedef std::shared_ptr<ComponentHandshake> 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 <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Payload.h>
@@ -19,17 +18,17 @@ namespace Swift {
class SWIFTEN_API ContainerPayload : public Payload {
public:
ContainerPayload() {}
- ContainerPayload(boost::shared_ptr<T> payload) : payload(payload) {}
+ ContainerPayload(std::shared_ptr<T> payload) : payload(payload) {}
- void setPayload(boost::shared_ptr<T> payload) {
+ void setPayload(std::shared_ptr<T> payload) {
this->payload = payload;
}
- boost::shared_ptr<T> getPayload() const {
+ std::shared_ptr<T> getPayload() const {
return payload;
}
private:
- boost::shared_ptr<T> payload;
+ std::shared_ptr<T> 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<DeliveryReceipt> ref;
+ typedef std::shared_ptr<DeliveryReceipt> 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<DeliveryReceiptRequest> ref;
+ typedef std::shared_ptr<DeliveryReceiptRequest> 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<DiscoInfo> ref;
+ typedef std::shared_ptr<DiscoInfo> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
class SWIFTEN_API ErrorPayload : public Payload {
public:
- typedef boost::shared_ptr<ErrorPayload> ref;
+ typedef std::shared_ptr<ErrorPayload> ref;
enum Type { Cancel, Continue, Modify, Auth, Wait };
@@ -71,11 +70,11 @@ namespace Swift {
return text_;
}
- void setPayload(boost::shared_ptr<Payload> payload) {
+ void setPayload(std::shared_ptr<Payload> payload) {
payload_ = payload;
}
- boost::shared_ptr<Payload> getPayload() const {
+ std::shared_ptr<Payload> getPayload() const {
return payload_;
}
@@ -83,6 +82,6 @@ namespace Swift {
Type type_;
Condition condition_;
std::string text_;
- boost::shared_ptr<Payload> payload_;
+ std::shared_ptr<Payload> 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<Form> ref;
+ typedef std::shared_ptr<Form> ref;
typedef std::vector<FormField::ref> 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<FormPage> page) {
+ void addPage(std::shared_ptr<FormPage> page) {
assert(page);
pages_.push_back(page);
}
- const std::vector<boost::shared_ptr<FormPage> >& getPages() const {
+ const std::vector<std::shared_ptr<FormPage> >& getPages() const {
return pages_;
}
- void addField(boost::shared_ptr<FormField> field) {
+ void addField(std::shared_ptr<FormField> field) {
assert(field);
fields_.push_back(field);
}
- const std::vector<boost::shared_ptr<FormField> >& getFields() const {
+ const std::vector<std::shared_ptr<FormField> >& getFields() const {
return fields_;
}
@@ -54,21 +54,21 @@ namespace Swift {
fields_.clear();
}
- void addTextElement(boost::shared_ptr<FormText> text) {
+ void addTextElement(std::shared_ptr<FormText> text) {
assert(text);
textElements_.push_back(text);
}
- const std::vector<boost::shared_ptr<FormText> >& getTextElements() const {
+ const std::vector<std::shared_ptr<FormText> >& getTextElements() const {
return textElements_;
}
- void addReportedRef(boost::shared_ptr<FormReportedRef> reportedRef) {
+ void addReportedRef(std::shared_ptr<FormReportedRef> reportedRef) {
assert(reportedRef);
reportedRefs_.push_back(reportedRef);
}
- const std::vector<boost::shared_ptr<FormReportedRef> >& getReportedRefs() const {
+ const std::vector<std::shared_ptr<FormReportedRef> >& getReportedRefs() const {
return reportedRefs_;
}
@@ -109,13 +109,13 @@ namespace Swift {
void clearReportedFields() { reportedFields_.clear(); }
private:
- std::vector<boost::shared_ptr<FormReportedRef> >reportedRefs_;
- std::vector<boost::shared_ptr<FormText> > textElements_;
- std::vector<boost::shared_ptr<FormPage> > pages_;
- std::vector<boost::shared_ptr<FormField> > fields_;
- std::vector<boost::shared_ptr<FormField> > reportedFields_;
+ std::vector<std::shared_ptr<FormReportedRef> >reportedRefs_;
+ std::vector<std::shared_ptr<FormText> > textElements_;
+ std::vector<std::shared_ptr<FormPage> > pages_;
+ std::vector<std::shared_ptr<FormField> > fields_;
+ std::vector<std::shared_ptr<FormField> > reportedFields_;
std::vector<FormItem> items_;
- boost::shared_ptr<FormReportedRef> reportedRef_;
+ std::shared_ptr<FormReportedRef> 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 <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/JID/JID.h>
namespace Swift {
class SWIFTEN_API FormField {
public:
- typedef boost::shared_ptr<FormField> ref;
+ typedef std::shared_ptr<FormField> 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<FormSection> section) {
+void FormPage::addChildSection(std::shared_ptr<FormSection> section) {
childSections_.push_back(section);
}
-const std::vector<boost::shared_ptr<FormSection> >& FormPage::getChildSections() const {
+const std::vector<std::shared_ptr<FormSection> >& FormPage::getChildSections() const {
return childSections_;
}
-void FormPage::addTextElement(boost::shared_ptr<FormText> textElement) {
+void FormPage::addTextElement(std::shared_ptr<FormText> textElement) {
textElements_.push_back(textElement);
}
-const std::vector<boost::shared_ptr<FormText> >& FormPage::getTextElements() const {
+const std::vector<std::shared_ptr<FormText> >& FormPage::getTextElements() const {
return textElements_;
}
-void FormPage::addReportedRef(boost::shared_ptr<FormReportedRef> reportedRef) {
+void FormPage::addReportedRef(std::shared_ptr<FormReportedRef> reportedRef) {
reportedRefs_.push_back(reportedRef);
}
-const std::vector<boost::shared_ptr<FormReportedRef> >& FormPage::getReportedRefs() const {
+const std::vector<std::shared_ptr<FormReportedRef> >& FormPage::getReportedRefs() const {
return reportedRefs_;
}
-void FormPage::addField(boost::shared_ptr<FormField> field) {
+void FormPage::addField(std::shared_ptr<FormField> field) {
fields_.push_back(field);
}
-const std::vector<boost::shared_ptr<FormField> >& FormPage::getFields() const {
+const std::vector<std::shared_ptr<FormField> >& 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 <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/FormField.h>
#include <Swiften/Elements/FormReportedRef.h>
@@ -20,28 +19,28 @@ namespace Swift {
class SWIFTEN_API FormPage {
public:
- typedef boost::shared_ptr<FormPage> page;
+ typedef std::shared_ptr<FormPage> page;
FormPage ();
~FormPage();
void setLabel(const std::string& label);
const std::string& getLabel() const;
- void addChildSection(boost::shared_ptr<FormSection> section);
- const std::vector<boost::shared_ptr<FormSection> >& getChildSections() const;
- void addTextElement(boost::shared_ptr<FormText> textElement);
- const std::vector<boost::shared_ptr<FormText> >& getTextElements() const;
- void addReportedRef(boost::shared_ptr<FormReportedRef> reportedRef);
- const std::vector<boost::shared_ptr<FormReportedRef> >& getReportedRefs() const;
- void addField(boost::shared_ptr<FormField> field);
- const std::vector<boost::shared_ptr<FormField> >& getFields() const;
+ void addChildSection(std::shared_ptr<FormSection> section);
+ const std::vector<std::shared_ptr<FormSection> >& getChildSections() const;
+ void addTextElement(std::shared_ptr<FormText> textElement);
+ const std::vector<std::shared_ptr<FormText> >& getTextElements() const;
+ void addReportedRef(std::shared_ptr<FormReportedRef> reportedRef);
+ const std::vector<std::shared_ptr<FormReportedRef> >& getReportedRefs() const;
+ void addField(std::shared_ptr<FormField> field);
+ const std::vector<std::shared_ptr<FormField> >& getFields() const;
void addFieldRef(std::string ref);
const std::vector<std::string> getFieldRefs() const;
private:
std::string label_;
- std::vector<boost::shared_ptr<FormText> > textElements_;
- std::vector<boost::shared_ptr<FormSection> > childSections_;
- std::vector<boost::shared_ptr<FormReportedRef> > reportedRefs_;
- std::vector<boost::shared_ptr<FormField> > fields_;
+ std::vector<std::shared_ptr<FormText> > textElements_;
+ std::vector<std::shared_ptr<FormSection> > childSections_;
+ std::vector<std::shared_ptr<FormReportedRef> > reportedRefs_;
+ std::vector<std::shared_ptr<FormField> > fields_;
std::vector<std::string> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
@@ -14,6 +14,6 @@ namespace Swift {
class SWIFTEN_API FormReportedRef {
public:
- typedef boost::shared_ptr<FormReportedRef> ref;
+ typedef std::shared_ptr<FormReportedRef> 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<FormText> textElement) {
+void FormSection::addTextElement(std::shared_ptr<FormText> textElement) {
textElements_.push_back(textElement);
}
-const std::vector<boost::shared_ptr<FormText> >& FormSection::getTextElements() const {
+const std::vector<std::shared_ptr<FormText> >& FormSection::getTextElements() const {
return textElements_;
}
-void FormSection::addReportedRef(boost::shared_ptr<FormReportedRef> reportedRef) {
+void FormSection::addReportedRef(std::shared_ptr<FormReportedRef> reportedRef) {
reportedRefs_.push_back(reportedRef);
}
-const std::vector<boost::shared_ptr<FormReportedRef> >& FormSection::getReportedRefs() const {
+const std::vector<std::shared_ptr<FormReportedRef> >& FormSection::getReportedRefs() const {
return reportedRefs_;
}
-void FormSection::addChildSection(boost::shared_ptr<FormSection> childSection) {
+void FormSection::addChildSection(std::shared_ptr<FormSection> childSection) {
childSections_.push_back(childSection);
}
-const std::vector<boost::shared_ptr<FormSection> >& FormSection::getChildSections() const {
+const std::vector<std::shared_ptr<FormSection> >& FormSection::getChildSections() const {
return childSections_;
}
-void FormSection::addField(boost::shared_ptr<FormField> field) {
+void FormSection::addField(std::shared_ptr<FormField> field) {
fields_.push_back(field);
}
-const std::vector<boost::shared_ptr<FormField> >& FormSection::getFields() const {
+const std::vector<std::shared_ptr<FormField> >& 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 <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/FormField.h>
#include <Swiften/Elements/FormReportedRef.h>
@@ -19,28 +18,28 @@ namespace Swift {
class SWIFTEN_API FormSection {
public:
- typedef boost::shared_ptr<FormSection> section;
+ typedef std::shared_ptr<FormSection> section;
FormSection();
~FormSection();
void setLabel(const std::string& label);
const std::string& getLabel() const;
- void addTextElement(boost::shared_ptr<FormText> textElement);
- const std::vector<boost::shared_ptr<FormText> >& getTextElements() const;
- void addReportedRef(boost::shared_ptr<FormReportedRef> reportedRef);
- const std::vector<boost::shared_ptr<FormReportedRef> >& getReportedRefs() const;
- void addChildSection(boost::shared_ptr<FormSection> childSection);
- const std::vector<boost::shared_ptr<FormSection> >& getChildSections() const;
- void addField(boost::shared_ptr<FormField> field);
- const std::vector<boost::shared_ptr<FormField> >& getFields() const;
+ void addTextElement(std::shared_ptr<FormText> textElement);
+ const std::vector<std::shared_ptr<FormText> >& getTextElements() const;
+ void addReportedRef(std::shared_ptr<FormReportedRef> reportedRef);
+ const std::vector<std::shared_ptr<FormReportedRef> >& getReportedRefs() const;
+ void addChildSection(std::shared_ptr<FormSection> childSection);
+ const std::vector<std::shared_ptr<FormSection> >& getChildSections() const;
+ void addField(std::shared_ptr<FormField> field);
+ const std::vector<std::shared_ptr<FormField> >& getFields() const;
void addFieldRef(std::string ref);
const std::vector<std::string> getFieldRefs() const;
private:
std::string label_;
- std::vector<boost::shared_ptr<FormText> > textElements_;
- std::vector<boost::shared_ptr<FormReportedRef> > reportedRefs_;
- std::vector<boost::shared_ptr<FormSection> > childSections_;
- std::vector<boost::shared_ptr<FormField> > fields_;
+ std::vector<std::shared_ptr<FormText> > textElements_;
+ std::vector<std::shared_ptr<FormReportedRef> > reportedRefs_;
+ std::vector<std::shared_ptr<FormSection> > childSections_;
+ std::vector<std::shared_ptr<FormField> > fields_;
std::vector<std::string> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
namespace Swift {
@@ -16,7 +15,7 @@ namespace Swift {
class SWIFTEN_API FormText{
public:
- typedef boost::shared_ptr<FormText> text;
+ typedef std::shared_ptr<FormText> 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_ = delay; }
- const boost::shared_ptr<Delay>& getDelay() const { return delay_; }
+ void setDelay(std::shared_ptr<Delay> delay) { delay_ = delay; }
+ const std::shared_ptr<Delay>& getDelay() const { return delay_; }
- void setStanza(boost::shared_ptr<Stanza> stanza) { stanza_ = stanza; }
- const boost::shared_ptr<Stanza>& getStanza() const { return stanza_; }
+ void setStanza(std::shared_ptr<Stanza> stanza) { stanza_ = stanza; }
+ const std::shared_ptr<Stanza>& getStanza() const { return stanza_; }
private:
- boost::shared_ptr<Delay> delay_;
- boost::shared_ptr<Stanza> stanza_;
+ std::shared_ptr<Delay> delay_;
+ std::shared_ptr<Stanza> 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 <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
class SWIFTEN_API IBB : public Payload {
public:
- typedef boost::shared_ptr<IBB> ref;
+ typedef std::shared_ptr<IBB> 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<IBB>(Open, streamID);
+ IBB::ref result = std::make_shared<IBB>(Open, streamID);
result->setBlockSize(blockSize);
return result;
}
static IBB::ref createIBBData(const std::string& streamID, int sequenceNumber, const std::vector<unsigned char>& data) {
- IBB::ref result = boost::make_shared<IBB>(Data, streamID);
+ IBB::ref result = std::make_shared<IBB>(Data, streamID);
result->setSequenceNumber(sequenceNumber);
result->setData(data);
return result;
}
static IBB::ref createIBBClose(const std::string& streamID) {
- return boost::make_shared<IBB>(Close, streamID);
+ return std::make_shared<IBB>(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 <Swiften/Elements/IQ.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
namespace Swift {
-boost::shared_ptr<IQ> IQ::createRequest(
- Type type, const JID& to, const std::string& id, boost::shared_ptr<Payload> payload) {
- boost::shared_ptr<IQ> iq = boost::make_shared<IQ>(type);
+std::shared_ptr<IQ> IQ::createRequest(
+ Type type, const JID& to, const std::string& id, std::shared_ptr<Payload> payload) {
+ std::shared_ptr<IQ> iq = std::make_shared<IQ>(type);
if (to.isValid()) {
iq->setTo(to);
}
@@ -23,8 +23,8 @@ boost::shared_ptr<IQ> IQ::createRequest(
return iq;
}
-boost::shared_ptr<IQ> IQ::createResult(const JID& to, const std::string& id, boost::shared_ptr<Payload> payload) {
- boost::shared_ptr<IQ> iq = boost::make_shared<IQ>(Result);
+std::shared_ptr<IQ> IQ::createResult(const JID& to, const std::string& id, std::shared_ptr<Payload> payload) {
+ std::shared_ptr<IQ> iq = std::make_shared<IQ>(Result);
iq->setTo(to);
iq->setID(id);
if (payload) {
@@ -33,8 +33,8 @@ boost::shared_ptr<IQ> IQ::createResult(const JID& to, const std::string& id, boo
return iq;
}
-boost::shared_ptr<IQ> IQ::createResult(const JID& to, const JID& from, const std::string& id, boost::shared_ptr<Payload> payload) {
- boost::shared_ptr<IQ> iq = boost::make_shared<IQ>(Result);
+std::shared_ptr<IQ> IQ::createResult(const JID& to, const JID& from, const std::string& id, std::shared_ptr<Payload> payload) {
+ std::shared_ptr<IQ> iq = std::make_shared<IQ>(Result);
iq->setTo(to);
iq->setFrom(from);
iq->setID(id);
@@ -44,22 +44,22 @@ boost::shared_ptr<IQ> IQ::createResult(const JID& to, const JID& from, const std
return iq;
}
-boost::shared_ptr<IQ> IQ::createError(const JID& to, const std::string& id, ErrorPayload::Condition condition, ErrorPayload::Type type, boost::shared_ptr<Payload> payload) {
- boost::shared_ptr<IQ> iq = boost::make_shared<IQ>(IQ::Error);
+std::shared_ptr<IQ> IQ::createError(const JID& to, const std::string& id, ErrorPayload::Condition condition, ErrorPayload::Type type, std::shared_ptr<Payload> payload) {
+ std::shared_ptr<IQ> iq = std::make_shared<IQ>(IQ::Error);
iq->setTo(to);
iq->setID(id);
- boost::shared_ptr<ErrorPayload> errorPayload = boost::make_shared<Swift::ErrorPayload>(condition, type);
+ std::shared_ptr<ErrorPayload> errorPayload = std::make_shared<Swift::ErrorPayload>(condition, type);
errorPayload->setPayload(payload);
iq->addPayload(errorPayload);
return iq;
}
-boost::shared_ptr<IQ> IQ::createError(const JID& to, const JID& from, const std::string& id, ErrorPayload::Condition condition, ErrorPayload::Type type, boost::shared_ptr<Payload> payload) {
- boost::shared_ptr<IQ> iq = boost::make_shared<IQ>(IQ::Error);
+std::shared_ptr<IQ> IQ::createError(const JID& to, const JID& from, const std::string& id, ErrorPayload::Condition condition, ErrorPayload::Type type, std::shared_ptr<Payload> payload) {
+ std::shared_ptr<IQ> iq = std::make_shared<IQ>(IQ::Error);
iq->setTo(to);
iq->setFrom(from);
iq->setID(id);
- boost::shared_ptr<ErrorPayload> errorPayload = boost::make_shared<Swift::ErrorPayload>(condition, type);
+ std::shared_ptr<ErrorPayload> errorPayload = std::make_shared<Swift::ErrorPayload>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/ErrorPayload.h>
@@ -15,7 +15,7 @@
namespace Swift {
class SWIFTEN_API IQ : public Stanza {
public:
- typedef boost::shared_ptr<IQ> ref;
+ typedef std::shared_ptr<IQ> 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<IQ> createRequest(
+ static std::shared_ptr<IQ> createRequest(
Type type,
const JID& to,
const std::string& id,
- boost::shared_ptr<Payload> payload);
- static boost::shared_ptr<IQ> createResult(
+ std::shared_ptr<Payload> payload);
+ static std::shared_ptr<IQ> createResult(
const JID& to,
const std::string& id,
- boost::shared_ptr<Payload> payload = boost::shared_ptr<Payload>());
- static boost::shared_ptr<IQ> createResult(
+ std::shared_ptr<Payload> payload = std::shared_ptr<Payload>());
+ static std::shared_ptr<IQ> createResult(
const JID& to,
const JID& from,
const std::string& id,
- boost::shared_ptr<Payload> payload = boost::shared_ptr<Payload>());
- static boost::shared_ptr<IQ> createError(
+ std::shared_ptr<Payload> payload = std::shared_ptr<Payload>());
+ static std::shared_ptr<IQ> createError(
const JID& to,
const std::string& id,
ErrorPayload::Condition condition = ErrorPayload::BadRequest,
ErrorPayload::Type type = ErrorPayload::Cancel,
- boost::shared_ptr<Payload> payload = boost::shared_ptr<Payload>());
- static boost::shared_ptr<IQ> createError(
+ std::shared_ptr<Payload> payload = std::shared_ptr<Payload>());
+ static std::shared_ptr<IQ> 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> payload = boost::shared_ptr<Payload>());
+ std::shared_ptr<Payload> payload = std::shared_ptr<Payload>());
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 <memory>
+
#include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
@@ -22,7 +23,7 @@ namespace Swift {
class SWIFTEN_API Idle : public Payload {
public:
- typedef boost::shared_ptr<Idle> ref;
+ typedef std::shared_ptr<Idle> 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 <memory>
#include <string>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Form.h>
@@ -18,7 +18,7 @@
namespace Swift {
class SWIFTEN_API InBandRegistrationPayload : public Payload {
public:
- typedef boost::shared_ptr<InBandRegistrationPayload> ref;
+ typedef std::shared_ptr<InBandRegistrationPayload> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,16 +21,16 @@ namespace Swift {
virtual ~IsodeIQDelegation();
- boost::shared_ptr<Forwarded> getForward() const {
+ std::shared_ptr<Forwarded> getForward() const {
return forward;
}
- void setForward(boost::shared_ptr<Forwarded> value) {
+ void setForward(std::shared_ptr<Forwarded> value) {
this->forward = value ;
}
private:
- boost::shared_ptr<Forwarded> forward;
+ std::shared_ptr<Forwarded> 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<JingleContentPayload> ref;
+ typedef std::shared_ptr<JingleContentPayload> ref;
enum Creator {
UnknownCreator,
@@ -62,34 +62,34 @@ namespace Swift {
descriptions.push_back(description);
}
- const std::vector<boost::shared_ptr<JingleTransportPayload> >& getTransports() const {
+ const std::vector<std::shared_ptr<JingleTransportPayload> >& getTransports() const {
return transports;
}
- void addTransport(boost::shared_ptr<JingleTransportPayload> transport) {
+ void addTransport(std::shared_ptr<JingleTransportPayload> transport) {
transports.push_back(transport);
}
template<typename T>
- boost::shared_ptr<T> getDescription() const {
+ std::shared_ptr<T> getDescription() const {
for (size_t i = 0; i < descriptions.size(); ++i) {
- boost::shared_ptr<T> result(boost::dynamic_pointer_cast<T>(descriptions[i]));
+ std::shared_ptr<T> result(std::dynamic_pointer_cast<T>(descriptions[i]));
if (result) {
return result;
}
}
- return boost::shared_ptr<T>();
+ return std::shared_ptr<T>();
}
template<typename T>
- boost::shared_ptr<T> getTransport() const {
+ std::shared_ptr<T> getTransport() const {
for (size_t i = 0; i < transports.size(); ++i) {
- boost::shared_ptr<T> result(boost::dynamic_pointer_cast<T>(transports[i]));
+ std::shared_ptr<T> result(std::dynamic_pointer_cast<T>(transports[i]));
if (result) {
return result;
}
}
- return boost::shared_ptr<T>();
+ return std::shared_ptr<T>();
}
private:
@@ -97,6 +97,6 @@ namespace Swift {
std::string name;
//Senders senders;
std::vector<JingleDescription::ref> descriptions;
- std::vector<boost::shared_ptr<JingleTransportPayload> > transports;
+ std::vector<std::shared_ptr<JingleTransportPayload> > 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
@@ -14,6 +14,6 @@
namespace Swift {
class SWIFTEN_API JingleDescription : public Payload {
public:
- typedef boost::shared_ptr<JingleDescription> ref;
+ typedef std::shared_ptr<JingleDescription> 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 <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/JingleDescription.h>
#include <Swiften/Elements/JingleFileTransferFileInfo.h>
@@ -17,7 +16,7 @@
namespace Swift {
class SWIFTEN_API JingleFileTransferDescription : public JingleDescription {
public:
- typedef boost::shared_ptr<JingleFileTransferDescription> ref;
+ typedef std::shared_ptr<JingleFileTransferDescription> 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 <map>
+#include <memory>
#include <string>
#include <vector>
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/HashElement.h>
@@ -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<JingleFileTransferFileInfo> ref;
+ typedef std::shared_ptr<JingleFileTransferFileInfo> 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 <map>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/JingleDescription.h>
#include <Swiften/Elements/JingleFileTransferFileInfo.h>
@@ -25,7 +24,7 @@ namespace Swift {
class SWIFTEN_API JingleFileTransferHash : public Payload {
public:
- typedef boost::shared_ptr<JingleFileTransferHash> ref;
+ typedef std::shared_ptr<JingleFileTransferHash> 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 <memory>
#include <string>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/JingleTransportPayload.h>
@@ -17,7 +17,7 @@
namespace Swift {
class SWIFTEN_API JingleIBBTransportPayload : public JingleTransportPayload {
public:
- typedef boost::shared_ptr<JingleIBBTransportPayload> ref;
+ typedef std::shared_ptr<JingleIBBTransportPayload> 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 <memory>
#include <string>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/JingleContentPayload.h>
@@ -20,7 +20,7 @@
namespace Swift {
class SWIFTEN_API JinglePayload : public Payload {
public:
- typedef boost::shared_ptr<JinglePayload> ref;
+ typedef std::shared_ptr<JinglePayload> 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> payload) {
+ void addPayload(std::shared_ptr<Payload> payload) {
this->payloads.push_back(payload);
}
@@ -117,15 +117,15 @@ namespace Swift {
return getPayloads<JingleContentPayload>();
}
- const std::vector<boost::shared_ptr<Payload> > getPayloads() const {
+ const std::vector<std::shared_ptr<Payload> > getPayloads() const {
return payloads;
}
template<typename T>
- const std::vector<boost::shared_ptr<T> > getPayloads() const {
- std::vector<boost::shared_ptr<T> > matched_payloads;
- for (std::vector<boost::shared_ptr<Payload> >::const_iterator i = payloads.begin(); i != payloads.end(); ++i) {
- boost::shared_ptr<T> result = boost::dynamic_pointer_cast<T>(*i);
+ const std::vector<std::shared_ptr<T> > getPayloads() const {
+ std::vector<std::shared_ptr<T> > matched_payloads;
+ for (std::vector<std::shared_ptr<Payload> >::const_iterator i = payloads.begin(); i != payloads.end(); ++i) {
+ std::shared_ptr<T> result = std::dynamic_pointer_cast<T>(*i);
if (result) {
matched_payloads.push_back(result);
}
@@ -136,10 +136,10 @@ namespace Swift {
}
template<typename T>
- const boost::shared_ptr<T> getPayload() const {
- boost::shared_ptr<T> result;
- for (std::vector<boost::shared_ptr<Payload> >::const_iterator i = payloads.begin(); i != payloads.end(); ++i) {
- result = boost::dynamic_pointer_cast<T>(*i);
+ const std::shared_ptr<T> getPayload() const {
+ std::shared_ptr<T> result;
+ for (std::vector<std::shared_ptr<Payload> >::const_iterator i = payloads.begin(); i != payloads.end(); ++i) {
+ result = std::dynamic_pointer_cast<T>(*i);
if (result) {
return result;
}
@@ -161,7 +161,7 @@ namespace Swift {
JID initiator;
JID responder;
std::string sessionID;
- std::vector<boost::shared_ptr<Payload> > payloads;
+ std::vector<std::shared_ptr<Payload> > payloads;
boost::optional<Reason> 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 <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Bytestreams.h>
#include <Swiften/Elements/JingleTransportPayload.h>
@@ -106,7 +105,7 @@ namespace Swift {
return proxyError;
}
public:
- typedef boost::shared_ptr<JingleS5BTransportPayload> ref;
+ typedef std::shared_ptr<JingleS5BTransportPayload> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
@@ -23,7 +23,7 @@ namespace Swift {
}
public:
- typedef boost::shared_ptr<JingleTransportPayload> ref;
+ typedef std::shared_ptr<JingleTransportPayload> 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 <memory>
#include <string>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
@@ -37,11 +37,11 @@ namespace Swift {
return isStable_;
}
- void setResultSet(boost::shared_ptr<ResultSet> resultSet) {
+ void setResultSet(std::shared_ptr<ResultSet> resultSet) {
resultSet_ = resultSet;
}
- boost::shared_ptr<ResultSet> getResultSet() const {
+ std::shared_ptr<ResultSet> getResultSet() const {
return resultSet_;
}
@@ -57,7 +57,7 @@ namespace Swift {
private:
bool isComplete_;
bool isStable_;
- boost::shared_ptr<ResultSet> resultSet_;
+ std::shared_ptr<ResultSet> resultSet_;
boost::optional<std::string> 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 <memory>
#include <string>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Form.h>
@@ -27,16 +27,16 @@ namespace Swift {
void setNode(const boost::optional<std::string>& node) { node_ = node; }
const boost::optional<std::string>& getNode() const { return node_; }
- void setForm(boost::shared_ptr<Form> form) { form_ = form; }
- const boost::shared_ptr<Form>& getForm() const { return form_; }
+ void setForm(std::shared_ptr<Form> form) { form_ = form; }
+ const std::shared_ptr<Form>& getForm() const { return form_; }
- void setResultSet(boost::shared_ptr<ResultSet> resultSet) { resultSet_ = resultSet; }
- const boost::shared_ptr<ResultSet>& getResultSet() const { return resultSet_; }
+ void setResultSet(std::shared_ptr<ResultSet> resultSet) { resultSet_ = resultSet; }
+ const std::shared_ptr<ResultSet>& getResultSet() const { return resultSet_; }
private:
boost::optional<std::string> queryID_;
boost::optional<std::string> node_;
- boost::shared_ptr<Form> form_;
- boost::shared_ptr<ResultSet> resultSet_;
+ std::shared_ptr<Form> form_;
+ std::shared_ptr<ResultSet> 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 <memory>
#include <string>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/MUCItem.h>
@@ -21,7 +21,7 @@
namespace Swift {
class SWIFTEN_API MUCAdminPayload : public Payload {
public:
- typedef boost::shared_ptr<MUCAdminPayload> ref;
+ typedef std::shared_ptr<MUCAdminPayload> 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<MUCDestroyPayload> ref;
+ typedef std::shared_ptr<MUCDestroyPayload> 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<MUCInvitationPayload> ref;
+ typedef std::shared_ptr<MUCInvitationPayload> 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<MUCOwnerPayload> ref;
+ typedef std::shared_ptr<MUCOwnerPayload> ref;
MUCOwnerPayload() {
}
- boost::shared_ptr<Payload> getPayload() const {
+ std::shared_ptr<Payload> getPayload() const {
return payload;
}
- void setPayload(boost::shared_ptr<Payload> p) {
+ void setPayload(std::shared_ptr<Payload> p) {
payload = p;
}
Form::ref getForm() {
- return boost::dynamic_pointer_cast<Form>(payload);
+ return std::dynamic_pointer_cast<Form>(payload);
}
private:
- boost::shared_ptr<Payload> payload;
+ std::shared_ptr<Payload> 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<MUCPayload> ref;
+ typedef std::shared_ptr<MUCPayload> 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 <memory>
#include <string>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/MUCItem.h>
@@ -21,7 +21,7 @@
namespace Swift {
class SWIFTEN_API MUCUserPayload : public Payload {
public:
- typedef boost::shared_ptr<MUCUserPayload> ref;
+ typedef std::shared_ptr<MUCUserPayload> ref;
struct StatusCode {
StatusCode() : code(0) {}
@@ -61,11 +61,11 @@ namespace Swift {
const std::vector<StatusCode>& getStatusCodes() const {return statusCodes_;}
- boost::shared_ptr<Payload> getPayload() const {
+ std::shared_ptr<Payload> getPayload() const {
return payload_;
}
- void setPayload(boost::shared_ptr<Payload> p) {
+ void setPayload(std::shared_ptr<Payload> p) {
payload_ = p;
}
@@ -90,7 +90,7 @@ namespace Swift {
private:
std::vector<MUCItem> items_;
std::vector<StatusCode> statusCodes_;
- boost::shared_ptr<Payload> payload_;
+ std::shared_ptr<Payload> payload_;
boost::optional<std::string> password_;
boost::optional<Invite> 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 <memory>
#include <string>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Body.h>
@@ -22,14 +21,14 @@
namespace Swift {
class SWIFTEN_API Message : public Stanza {
public:
- typedef boost::shared_ptr<Message> ref;
+ typedef std::shared_ptr<Message> ref;
enum Type { Normal, Chat, Error, Groupchat, Headline };
Message() : type_(Chat) { }
std::string getSubject() const {
- boost::shared_ptr<Subject> subject(getPayload<Subject>());
+ std::shared_ptr<Subject> subject(getPayload<Subject>());
if (subject) {
return subject->getText();
}
@@ -37,7 +36,7 @@ namespace Swift {
}
void setSubject(const std::string& subject) {
- updatePayload(boost::make_shared<Subject>(subject));
+ updatePayload(std::make_shared<Subject>(subject));
}
// Explicitly convert to bool. In C++11, it would be cleaner to
@@ -47,7 +46,7 @@ namespace Swift {
}
boost::optional<std::string> getBody() const {
- boost::shared_ptr<Body> body(getPayload<Body>());
+ std::shared_ptr<Body> body(getPayload<Body>());
boost::optional<std::string> bodyData;
if (body) {
bodyData = body->getText();
@@ -61,15 +60,15 @@ namespace Swift {
void setBody(const boost::optional<std::string>& body) {
if (body) {
- updatePayload(boost::make_shared<Body>(body.get()));
+ updatePayload(std::make_shared<Body>(body.get()));
}
else {
- removePayloadOfSameType(boost::make_shared<Body>());
+ removePayloadOfSameType(std::make_shared<Body>());
}
}
bool isError() {
- boost::shared_ptr<Swift::ErrorPayload> error(getPayload<Swift::ErrorPayload>());
+ std::shared_ptr<Swift::ErrorPayload> error(getPayload<Swift::ErrorPayload>());
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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Element.h>
@@ -14,7 +14,7 @@
namespace Swift {
class SWIFTEN_API Payload : public Element {
public:
- typedef boost::shared_ptr<Payload> ref;
+ typedef std::shared_ptr<Payload> 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> priority(getPayload<Priority>());
+ std::shared_ptr<Priority> priority(getPayload<Priority>());
return (priority ? priority->getPriority() : 0);
}
void Presence::setPriority(int priority) {
- updatePayload(boost::make_shared<Priority>(priority));
+ updatePayload(std::make_shared<Priority>(priority));
}
std::string Presence::getStatus() const {
- boost::shared_ptr<Status> status(getPayload<Status>());
+ std::shared_ptr<Status> status(getPayload<Status>());
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>(status));
+ updatePayload(std::make_shared<Status>(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 <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Stanza.h>
@@ -15,7 +15,7 @@
namespace Swift {
class SWIFTEN_API Presence : public Stanza {
public:
- typedef boost::shared_ptr<Presence> ref;
+ typedef std::shared_ptr<Presence> 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<Presence>();
+ return std::make_shared<Presence>();
}
static ref create(const std::string& status) {
- return boost::make_shared<Presence>(status);
+ return std::make_shared<Presence>(status);
}
static ref create(Presence::ref presence) {
- return boost::make_shared<Presence>(*presence);
+ return std::make_shared<Presence>(*presence);
}
Type getType() const { return type_; }
void setType(Type type) { type_ = type; }
StatusShow::Type getShow() const {
- boost::shared_ptr<StatusShow> show(getPayload<StatusShow>());
+ std::shared_ptr<StatusShow> show(getPayload<StatusShow>());
if (show) {
return show->getType();
}
@@ -48,7 +48,7 @@ namespace Swift {
}
void setShow(const StatusShow::Type &show) {
- updatePayload(boost::make_shared<StatusShow>(show));
+ updatePayload(std::make_shared<StatusShow>(show));
}
std::string getStatus() const;
@@ -57,8 +57,8 @@ namespace Swift {
int getPriority() const;
void setPriority(int priority);
- boost::shared_ptr<Presence> clone() const {
- return boost::make_shared<Presence>(*this);
+ std::shared_ptr<Presence> clone() const {
+ return std::make_shared<Presence>(*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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
@@ -14,18 +14,18 @@
namespace Swift {
class SWIFTEN_API PrivateStorage : public Payload {
public:
- PrivateStorage(boost::shared_ptr<Payload> payload = boost::shared_ptr<Payload>()) : payload(payload) {
+ PrivateStorage(std::shared_ptr<Payload> payload = std::shared_ptr<Payload>()) : payload(payload) {
}
- boost::shared_ptr<Payload> getPayload() const {
+ std::shared_ptr<Payload> getPayload() const {
return payload;
}
- void setPayload(boost::shared_ptr<Payload> p) {
+ void setPayload(std::shared_ptr<Payload> p) {
payload = p;
}
private:
- boost::shared_ptr<Payload> payload;
+ std::shared_ptr<Payload> 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 <memory>
#include <string>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -34,21 +34,21 @@ namespace Swift {
this->node = value ;
}
- const std::vector< boost::shared_ptr<PubSubAffiliation> >& getAffiliations() const {
+ const std::vector< std::shared_ptr<PubSubAffiliation> >& getAffiliations() const {
return affiliations;
}
- void setAffiliations(const std::vector< boost::shared_ptr<PubSubAffiliation> >& value) {
+ void setAffiliations(const std::vector< std::shared_ptr<PubSubAffiliation> >& value) {
this->affiliations = value ;
}
- void addAffiliation(boost::shared_ptr<PubSubAffiliation> value) {
+ void addAffiliation(std::shared_ptr<PubSubAffiliation> value) {
this->affiliations.push_back(value);
}
private:
boost::optional< std::string > node;
- std::vector< boost::shared_ptr<PubSubAffiliation> > affiliations;
+ std::vector< std::shared_ptr<PubSubAffiliation> > 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,16 +21,16 @@ namespace Swift {
virtual ~PubSubConfigure();
- boost::shared_ptr<Form> getData() const {
+ std::shared_ptr<Form> getData() const {
return data;
}
- void setData(boost::shared_ptr<Form> value) {
+ void setData(std::shared_ptr<Form> value) {
this->data = value ;
}
private:
- boost::shared_ptr<Form> data;
+ std::shared_ptr<Form> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Payload.h>
@@ -32,17 +31,17 @@ namespace Swift {
this->node = value ;
}
- boost::shared_ptr<PubSubConfigure> getConfigure() const {
+ std::shared_ptr<PubSubConfigure> getConfigure() const {
return configure;
}
- void setConfigure(boost::shared_ptr<PubSubConfigure> value) {
+ void setConfigure(std::shared_ptr<PubSubConfigure> value) {
this->configure = value ;
}
private:
std::string node;
- boost::shared_ptr<PubSubConfigure> configure;
+ std::shared_ptr<PubSubConfigure> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
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 <memory>
#include <string>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -34,26 +34,26 @@ namespace Swift {
this->node = value ;
}
- boost::shared_ptr<PubSubEventDisassociate> getDisassociate() const {
+ std::shared_ptr<PubSubEventDisassociate> getDisassociate() const {
return disassociate;
}
- void setDisassociate(boost::shared_ptr<PubSubEventDisassociate> value) {
+ void setDisassociate(std::shared_ptr<PubSubEventDisassociate> value) {
this->disassociate = value ;
}
- boost::shared_ptr<PubSubEventAssociate> getAssociate() const {
+ std::shared_ptr<PubSubEventAssociate> getAssociate() const {
return associate;
}
- void setAssociate(boost::shared_ptr<PubSubEventAssociate> value) {
+ void setAssociate(std::shared_ptr<PubSubEventAssociate> value) {
this->associate = value ;
}
private:
boost::optional< std::string > node;
- boost::shared_ptr<PubSubEventDisassociate> disassociate;
- boost::shared_ptr<PubSubEventAssociate> associate;
+ std::shared_ptr<PubSubEventDisassociate> disassociate;
+ std::shared_ptr<PubSubEventAssociate> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Form.h>
@@ -32,17 +31,17 @@ namespace Swift {
this->node = value ;
}
- boost::shared_ptr<Form> getData() const {
+ std::shared_ptr<Form> getData() const {
return data;
}
- void setData(boost::shared_ptr<Form> value) {
+ void setData(std::shared_ptr<Form> value) {
this->data = value ;
}
private:
std::string node;
- boost::shared_ptr<Form> data;
+ std::shared_ptr<Form> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Payload.h>
@@ -32,17 +31,17 @@ namespace Swift {
this->node = value ;
}
- boost::shared_ptr<PubSubEventRedirect> getRedirects() const {
+ std::shared_ptr<PubSubEventRedirect> getRedirects() const {
return redirects;
}
- void setRedirects(boost::shared_ptr<PubSubEventRedirect> value) {
+ void setRedirects(std::shared_ptr<PubSubEventRedirect> value) {
this->redirects = value ;
}
private:
std::string node;
- boost::shared_ptr<PubSubEventRedirect> redirects;
+ std::shared_ptr<PubSubEventRedirect> 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 <memory>
#include <string>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -40,15 +40,15 @@ namespace Swift {
this->publisher = value ;
}
- const std::vector< boost::shared_ptr<Payload> >& getData() const {
+ const std::vector< std::shared_ptr<Payload> >& getData() const {
return data;
}
- void setData(const std::vector< boost::shared_ptr<Payload> >& value) {
+ void setData(const std::vector< std::shared_ptr<Payload> >& value) {
this->data = value ;
}
- void addData(boost::shared_ptr<Payload> value) {
+ void addData(std::shared_ptr<Payload> 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<Payload> > data;
+ std::vector< std::shared_ptr<Payload> > 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 <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Payload.h>
@@ -34,34 +33,34 @@ namespace Swift {
this->node = value ;
}
- const std::vector< boost::shared_ptr<PubSubEventItem> >& getItems() const {
+ const std::vector< std::shared_ptr<PubSubEventItem> >& getItems() const {
return items;
}
- void setItems(const std::vector< boost::shared_ptr<PubSubEventItem> >& value) {
+ void setItems(const std::vector< std::shared_ptr<PubSubEventItem> >& value) {
this->items = value ;
}
- void addItem(boost::shared_ptr<PubSubEventItem> value) {
+ void addItem(std::shared_ptr<PubSubEventItem> value) {
this->items.push_back(value);
}
- const std::vector< boost::shared_ptr<PubSubEventRetract> >& getRetracts() const {
+ const std::vector< std::shared_ptr<PubSubEventRetract> >& getRetracts() const {
return retracts;
}
- void setRetracts(const std::vector< boost::shared_ptr<PubSubEventRetract> >& value) {
+ void setRetracts(const std::vector< std::shared_ptr<PubSubEventRetract> >& value) {
this->retracts = value ;
}
- void addRetract(boost::shared_ptr<PubSubEventRetract> value) {
+ void addRetract(std::shared_ptr<PubSubEventRetract> value) {
this->retracts.push_back(value);
}
private:
std::string node;
- std::vector< boost::shared_ptr<PubSubEventItem> > items;
- std::vector< boost::shared_ptr<PubSubEventRetract> > retracts;
+ std::vector< std::shared_ptr<PubSubEventItem> > items;
+ std::vector< std::shared_ptr<PubSubEventRetract> > 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 <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Payload.h>
@@ -23,15 +22,15 @@ namespace Swift {
virtual ~PubSubItem();
- const std::vector< boost::shared_ptr<Payload> >& getData() const {
+ const std::vector< std::shared_ptr<Payload> >& getData() const {
return data;
}
- void setData(const std::vector< boost::shared_ptr<Payload> >& value) {
+ void setData(const std::vector< std::shared_ptr<Payload> >& value) {
this->data = value ;
}
- void addData(boost::shared_ptr<Payload> value) {
+ void addData(std::shared_ptr<Payload> value) {
this->data.push_back(value);
}
@@ -45,7 +44,7 @@ namespace Swift {
private:
- std::vector< boost::shared_ptr<Payload> > data;
+ std::vector< std::shared_ptr<Payload> > 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 <memory>
#include <string>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -34,15 +34,15 @@ namespace Swift {
this->node = value ;
}
- const std::vector< boost::shared_ptr<PubSubItem> >& getItems() const {
+ const std::vector< std::shared_ptr<PubSubItem> >& getItems() const {
return items;
}
- void setItems(const std::vector< boost::shared_ptr<PubSubItem> >& value) {
+ void setItems(const std::vector< std::shared_ptr<PubSubItem> >& value) {
this->items = value ;
}
- void addItem(boost::shared_ptr<PubSubItem> value) {
+ void addItem(std::shared_ptr<PubSubItem> value) {
this->items.push_back(value);
}
@@ -65,7 +65,7 @@ namespace Swift {
private:
std::string node;
- std::vector< boost::shared_ptr<PubSubItem> > items;
+ std::vector< std::shared_ptr<PubSubItem> > 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 <memory>
#include <string>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -42,11 +42,11 @@ namespace Swift {
this->jid = value ;
}
- boost::shared_ptr<Form> getData() const {
+ std::shared_ptr<Form> getData() const {
return data;
}
- void setData(boost::shared_ptr<Form> value) {
+ void setData(std::shared_ptr<Form> value) {
this->data = value ;
}
@@ -62,7 +62,7 @@ namespace Swift {
private:
std::string node;
JID jid;
- boost::shared_ptr<Form> data;
+ std::shared_ptr<Form> 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 <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Payload.h>
@@ -33,21 +32,21 @@ namespace Swift {
this->node = value ;
}
- const std::vector< boost::shared_ptr<PubSubOwnerAffiliation> >& getAffiliations() const {
+ const std::vector< std::shared_ptr<PubSubOwnerAffiliation> >& getAffiliations() const {
return affiliations;
}
- void setAffiliations(const std::vector< boost::shared_ptr<PubSubOwnerAffiliation> >& value) {
+ void setAffiliations(const std::vector< std::shared_ptr<PubSubOwnerAffiliation> >& value) {
this->affiliations = value ;
}
- void addAffiliation(boost::shared_ptr<PubSubOwnerAffiliation> value) {
+ void addAffiliation(std::shared_ptr<PubSubOwnerAffiliation> value) {
this->affiliations.push_back(value);
}
private:
std::string node;
- std::vector< boost::shared_ptr<PubSubOwnerAffiliation> > affiliations;
+ std::vector< std::shared_ptr<PubSubOwnerAffiliation> > 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 <memory>
#include <string>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -33,17 +33,17 @@ namespace Swift {
this->node = value ;
}
- boost::shared_ptr<Form> getData() const {
+ std::shared_ptr<Form> getData() const {
return data;
}
- void setData(boost::shared_ptr<Form> value) {
+ void setData(std::shared_ptr<Form> value) {
this->data = value ;
}
private:
boost::optional< std::string > node;
- boost::shared_ptr<Form> data;
+ std::shared_ptr<Form> 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -22,16 +22,16 @@ namespace Swift {
virtual ~PubSubOwnerDefault();
- boost::shared_ptr<Form> getData() const {
+ std::shared_ptr<Form> getData() const {
return data;
}
- void setData(boost::shared_ptr<Form> value) {
+ void setData(std::shared_ptr<Form> value) {
this->data = value ;
}
private:
- boost::shared_ptr<Form> data;
+ std::shared_ptr<Form> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Payload.h>
@@ -32,17 +31,17 @@ namespace Swift {
this->node = value ;
}
- boost::shared_ptr<PubSubOwnerRedirect> getRedirect() const {
+ std::shared_ptr<PubSubOwnerRedirect> getRedirect() const {
return redirect;
}
- void setRedirect(boost::shared_ptr<PubSubOwnerRedirect> value) {
+ void setRedirect(std::shared_ptr<PubSubOwnerRedirect> value) {
this->redirect = value ;
}
private:
std::string node;
- boost::shared_ptr<PubSubOwnerRedirect> redirect;
+ std::shared_ptr<PubSubOwnerRedirect> 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 <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Payload.h>
@@ -33,21 +32,21 @@ namespace Swift {
this->node = value ;
}
- const std::vector< boost::shared_ptr<PubSubOwnerSubscription> >& getSubscriptions() const {
+ const std::vector< std::shared_ptr<PubSubOwnerSubscription> >& getSubscriptions() const {
return subscriptions;
}
- void setSubscriptions(const std::vector< boost::shared_ptr<PubSubOwnerSubscription> >& value) {
+ void setSubscriptions(const std::vector< std::shared_ptr<PubSubOwnerSubscription> >& value) {
this->subscriptions = value ;
}
- void addSubscription(boost::shared_ptr<PubSubOwnerSubscription> value) {
+ void addSubscription(std::shared_ptr<PubSubOwnerSubscription> value) {
this->subscriptions.push_back(value);
}
private:
std::string node;
- std::vector< boost::shared_ptr<PubSubOwnerSubscription> > subscriptions;
+ std::vector< std::shared_ptr<PubSubOwnerSubscription> > 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 <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Payload.h>
@@ -33,21 +32,21 @@ namespace Swift {
this->node = value ;
}
- const std::vector< boost::shared_ptr<PubSubItem> >& getItems() const {
+ const std::vector< std::shared_ptr<PubSubItem> >& getItems() const {
return items;
}
- void setItems(const std::vector< boost::shared_ptr<PubSubItem> >& value) {
+ void setItems(const std::vector< std::shared_ptr<PubSubItem> >& value) {
this->items = value ;
}
- void addItem(boost::shared_ptr<PubSubItem> value) {
+ void addItem(std::shared_ptr<PubSubItem> value) {
this->items.push_back(value);
}
private:
std::string node;
- std::vector< boost::shared_ptr<PubSubItem> > items;
+ std::vector< std::shared_ptr<PubSubItem> > 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 <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Payload.h>
@@ -33,15 +32,15 @@ namespace Swift {
this->node = value ;
}
- const std::vector< boost::shared_ptr<PubSubItem> >& getItems() const {
+ const std::vector< std::shared_ptr<PubSubItem> >& getItems() const {
return items;
}
- void setItems(const std::vector< boost::shared_ptr<PubSubItem> >& value) {
+ void setItems(const std::vector< std::shared_ptr<PubSubItem> >& value) {
this->items = value ;
}
- void addItem(boost::shared_ptr<PubSubItem> value) {
+ void addItem(std::shared_ptr<PubSubItem> value) {
this->items.push_back(value);
}
@@ -56,7 +55,7 @@ namespace Swift {
private:
std::string node;
- std::vector< boost::shared_ptr<PubSubItem> > items;
+ std::vector< std::shared_ptr<PubSubItem> > 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 <memory>
#include <string>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -42,11 +42,11 @@ namespace Swift {
this->jid = value ;
}
- boost::shared_ptr<PubSubOptions> getOptions() const {
+ std::shared_ptr<PubSubOptions> getOptions() const {
return options;
}
- void setOptions(boost::shared_ptr<PubSubOptions> value) {
+ void setOptions(std::shared_ptr<PubSubOptions> value) {
this->options = value ;
}
@@ -54,6 +54,6 @@ namespace Swift {
private:
boost::optional< std::string > node;
JID jid;
- boost::shared_ptr<PubSubOptions> options;
+ std::shared_ptr<PubSubOptions> 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 <memory>
#include <string>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -56,11 +56,11 @@ namespace Swift {
this->jid = value ;
}
- boost::shared_ptr<PubSubSubscribeOptions> getOptions() const {
+ std::shared_ptr<PubSubSubscribeOptions> getOptions() const {
return options;
}
- void setOptions(boost::shared_ptr<PubSubSubscribeOptions> value) {
+ void setOptions(std::shared_ptr<PubSubSubscribeOptions> 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<PubSubSubscribeOptions> options;
+ std::shared_ptr<PubSubSubscribeOptions> 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 <memory>
#include <string>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -34,21 +34,21 @@ namespace Swift {
this->node = value ;
}
- const std::vector< boost::shared_ptr<PubSubSubscription> >& getSubscriptions() const {
+ const std::vector< std::shared_ptr<PubSubSubscription> >& getSubscriptions() const {
return subscriptions;
}
- void setSubscriptions(const std::vector< boost::shared_ptr<PubSubSubscription> >& value) {
+ void setSubscriptions(const std::vector< std::shared_ptr<PubSubSubscription> >& value) {
this->subscriptions = value ;
}
- void addSubscription(boost::shared_ptr<PubSubSubscription> value) {
+ void addSubscription(std::shared_ptr<PubSubSubscription> value) {
this->subscriptions.push_back(value);
}
private:
boost::optional< std::string > node;
- std::vector< boost::shared_ptr<PubSubSubscription> > subscriptions;
+ std::vector< std::shared_ptr<PubSubSubscription> > 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
class SWIFTEN_API Replace : public Payload {
public:
- typedef boost::shared_ptr<Replace> ref;
+ typedef std::shared_ptr<Replace> 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 <string>
+
#include <boost/optional.hpp>
#include <Swiften/Base/API.h>
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 <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/JID/JID.h>
@@ -24,7 +23,7 @@
namespace Swift {
class SWIFTEN_API RosterItemExchangePayload : public Payload {
public:
- typedef boost::shared_ptr<RosterItemExchangePayload> ref;
+ typedef std::shared_ptr<RosterItemExchangePayload> 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 <memory>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
@@ -18,7 +18,7 @@
namespace Swift {
class SWIFTEN_API RosterPayload : public Payload {
public:
- typedef boost::shared_ptr<RosterPayload> ref;
+ typedef std::shared_ptr<RosterPayload> ref;
typedef std::vector<RosterItemPayload> 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<S5BProxyRequest> ref;
+ typedef std::shared_ptr<S5BProxyRequest> 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 <memory>
#include <string>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Form.h>
@@ -21,7 +21,7 @@ namespace Swift {
*/
class SWIFTEN_API SearchPayload : public Payload {
public:
- typedef boost::shared_ptr<SearchPayload> ref;
+ typedef std::shared_ptr<SearchPayload> 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 <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/SecurityLabel.h>
@@ -19,15 +18,15 @@
namespace Swift {
class SWIFTEN_API SecurityLabelsCatalog : public Payload {
public:
- typedef boost::shared_ptr<SecurityLabelsCatalog> ref;
+ typedef std::shared_ptr<SecurityLabelsCatalog> ref;
class Item {
public:
Item() : default_(false) {}
- boost::shared_ptr<SecurityLabel> getLabel() const {
+ std::shared_ptr<SecurityLabel> getLabel() const {
return label_;
}
- void setLabel(boost::shared_ptr<SecurityLabel> label) {
+ void setLabel(std::shared_ptr<SecurityLabel> label) {
label_ = label;
}
@@ -43,7 +42,7 @@ namespace Swift {
default_ = isDefault;
}
private:
- boost::shared_ptr<SecurityLabel> label_;
+ std::shared_ptr<SecurityLabel> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
class SWIFTEN_API SoftwareVersion : public Payload {
public:
- typedef boost::shared_ptr<SoftwareVersion> ref;
+ typedef std::shared_ptr<SoftwareVersion> 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> payload) {
- foreach (boost::shared_ptr<Payload>& i, payloads_) {
+void Stanza::updatePayload(std::shared_ptr<Payload> payload) {
+ foreach (std::shared_ptr<Payload>& i, payloads_) {
if (typeid(*i.get()) == typeid(*payload.get())) {
i = payload;
return;
@@ -32,32 +32,32 @@ void Stanza::updatePayload(boost::shared_ptr<Payload> payload) {
addPayload(payload);
}
-static bool sameType(boost::shared_ptr<Payload> a, boost::shared_ptr<Payload> b) {
+static bool sameType(std::shared_ptr<Payload> a, std::shared_ptr<Payload> b) {
return typeid(*a.get()) == typeid(*b.get());
}
-void Stanza::removePayloadOfSameType(boost::shared_ptr<Payload> payload) {
+void Stanza::removePayloadOfSameType(std::shared_ptr<Payload> payload) {
payloads_.erase(std::remove_if(payloads_.begin(), payloads_.end(),
boost::bind<bool>(&sameType, payload, _1)),
payloads_.end());
}
-boost::shared_ptr<Payload> Stanza::getPayloadOfSameType(boost::shared_ptr<Payload> payload) const {
- foreach (const boost::shared_ptr<Payload>& i, payloads_) {
+std::shared_ptr<Payload> Stanza::getPayloadOfSameType(std::shared_ptr<Payload> payload) const {
+ foreach (const std::shared_ptr<Payload>& i, payloads_) {
if (typeid(*i.get()) == typeid(*payload.get())) {
return i;
}
}
- return boost::shared_ptr<Payload>();
+ return std::shared_ptr<Payload>();
}
boost::optional<boost::posix_time::ptime> Stanza::getTimestamp() const {
- boost::shared_ptr<Delay> delay = getPayload<Delay>();
+ std::shared_ptr<Delay> delay = getPayload<Delay>();
return delay ? delay->getStamp() : boost::optional<boost::posix_time::ptime>();
}
boost::optional<boost::posix_time::ptime> Stanza::getTimestampFrom(const JID& jid) const {
- std::vector< boost::shared_ptr<Delay> > delays = getPayloads<Delay>();
+ std::vector< std::shared_ptr<Delay> > delays = getPayloads<Delay>();
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 <memory>
#include <string>
#include <vector>
#include <boost/date_time/posix_time/ptime.hpp>
#include <boost/optional/optional_fwd.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/ToplevelElement.h>
@@ -22,7 +22,7 @@ namespace Swift {
class SWIFTEN_API Stanza : public ToplevelElement {
public:
- typedef boost::shared_ptr<Stanza> ref;
+ typedef std::shared_ptr<Stanza> ref;
protected:
Stanza();
@@ -32,21 +32,21 @@ namespace Swift {
SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Stanza)
template<typename T>
- boost::shared_ptr<T> getPayload() const {
+ std::shared_ptr<T> getPayload() const {
for (size_t i = 0; i < payloads_.size(); ++i) {
- boost::shared_ptr<T> result(boost::dynamic_pointer_cast<T>(payloads_[i]));
+ std::shared_ptr<T> result(std::dynamic_pointer_cast<T>(payloads_[i]));
if (result) {
return result;
}
}
- return boost::shared_ptr<T>();
+ return std::shared_ptr<T>();
}
template<typename T>
- std::vector< boost::shared_ptr<T> > getPayloads() const {
- std::vector< boost::shared_ptr<T> > results;
+ std::vector< std::shared_ptr<T> > getPayloads() const {
+ std::vector< std::shared_ptr<T> > results;
for (size_t i = 0; i < payloads_.size(); ++i) {
- boost::shared_ptr<T> result(boost::dynamic_pointer_cast<T>(payloads_[i]));
+ std::shared_ptr<T> result(std::dynamic_pointer_cast<T>(payloads_[i]));
if (result) {
results.push_back(result);
}
@@ -55,11 +55,11 @@ namespace Swift {
}
- const std::vector< boost::shared_ptr<Payload> >& getPayloads() const {
+ const std::vector< std::shared_ptr<Payload> >& getPayloads() const {
return payloads_;
}
- void addPayload(boost::shared_ptr<Payload> payload) {
+ void addPayload(std::shared_ptr<Payload> payload) {
payloads_.push_back(payload);
}
@@ -68,10 +68,10 @@ namespace Swift {
payloads_.insert(payloads_.end(), begin, end);
}
- void updatePayload(boost::shared_ptr<Payload> payload);
+ void updatePayload(std::shared_ptr<Payload> payload);
- void removePayloadOfSameType(boost::shared_ptr<Payload>);
- boost::shared_ptr<Payload> getPayloadOfSameType(boost::shared_ptr<Payload>) const;
+ void removePayloadOfSameType(std::shared_ptr<Payload>);
+ std::shared_ptr<Payload> getPayloadOfSameType(std::shared_ptr<Payload>) 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<Payload> > payloads_;
+ std::vector< std::shared_ptr<Payload> > 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 <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/ToplevelElement.h>
@@ -14,7 +14,7 @@
namespace Swift {
class SWIFTEN_API StanzaAck : public ToplevelElement {
public:
- typedef boost::shared_ptr<StanzaAck> ref;
+ typedef std::shared_ptr<StanzaAck> 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 <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
class SWIFTEN_API StreamError : public ToplevelElement {
public:
- typedef boost::shared_ptr<StreamError> ref;
+ typedef std::shared_ptr<StreamError> 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 <memory>
#include <string>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/ToplevelElement.h>
@@ -18,7 +18,7 @@
namespace Swift {
class SWIFTEN_API StreamFeatures : public ToplevelElement {
public:
- typedef boost::shared_ptr<StreamFeatures> ref;
+ typedef std::shared_ptr<StreamFeatures> 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 <memory>
#include <string>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
@@ -19,7 +19,7 @@
namespace Swift {
class SWIFTEN_API StreamInitiation : public Payload {
public:
- typedef boost::shared_ptr<StreamInitiation> ref;
+ typedef std::shared_ptr<StreamInitiation> 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 <memory>
#include <string>
#include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
@@ -18,7 +18,7 @@ namespace Swift {
class SWIFTEN_API StreamInitiationFileInfo : public Payload {
public:
- typedef boost::shared_ptr<StreamInitiationFileInfo> ref;
+ typedef std::shared_ptr<StreamInitiationFileInfo> 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 <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -25,13 +24,13 @@ class FormTest : public CppUnit::TestFixture {
void testGetFormType() {
Form form;
- form.addField(boost::make_shared<FormField>(FormField::FixedType, "Foo"));
+ form.addField(std::make_shared<FormField>(FormField::FixedType, "Foo"));
- FormField::ref field = boost::make_shared<FormField>(FormField::HiddenType, "jabber:bot");
+ FormField::ref field = std::make_shared<FormField>(FormField::HiddenType, "jabber:bot");
field->setName("FORM_TYPE");
form.addField(field);
- form.addField(boost::make_shared<FormField>(FormField::FixedType, "Bar"));
+ form.addField(std::make_shared<FormField>(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>(FormField::FixedType, "jabber:bot");
+ FormField::ref field = std::make_shared<FormField>(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>(FormField::FixedType, "Foo"));
+ form.addField(std::make_shared<FormField>(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 <boost/shared_ptr.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -26,8 +26,8 @@ class IQTest : public CppUnit::TestFixture
IQTest() {}
void testCreateResult() {
- boost::shared_ptr<Payload> payload(new SoftwareVersion("myclient"));
- boost::shared_ptr<IQ> iq(IQ::createResult(JID("foo@bar/fum"), "myid", payload));
+ std::shared_ptr<Payload> payload(new SoftwareVersion("myclient"));
+ std::shared_ptr<IQ> 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(IQ::createResult(JID("foo@bar/fum"), "myid"));
+ std::shared_ptr<IQ> 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(IQ::createError(JID("foo@bar/fum"), "myid", ErrorPayload::BadRequest, ErrorPayload::Modify));
+ std::shared_ptr<IQ> 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<ErrorPayload> error(iq->getPayload<ErrorPayload>());
+ std::shared_ptr<ErrorPayload> error(iq->getPayload<ErrorPayload>());
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 <memory>
+
#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/shared_ptr.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -70,8 +71,8 @@ class StanzaTest : public CppUnit::TestFixture
void testConstructor_Copy() {
Message m;
- m.addPayload(boost::make_shared<MyPayload1>());
- m.addPayload(boost::make_shared<MyPayload2>());
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(std::make_shared<MyPayload2>());
Message copy(m);
CPPUNIT_ASSERT(copy.getPayload<MyPayload1>());
@@ -82,7 +83,7 @@ class StanzaTest : public CppUnit::TestFixture
bool payloadAlive = true;
{
Message m;
- m.addPayload(boost::make_shared<DestroyingPayload>(&payloadAlive));
+ m.addPayload(std::make_shared<DestroyingPayload>(&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<DestroyingPayload>(&payloadAlive));
+ m1->addPayload(std::make_shared<DestroyingPayload>(&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<MyPayload1>());
- m.addPayload(boost::make_shared<MyPayload2>());
- m.addPayload(boost::make_shared<MyPayload3>());
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(std::make_shared<MyPayload2>());
+ m.addPayload(std::make_shared<MyPayload3>());
- boost::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
+ std::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
CPPUNIT_ASSERT(p);
}
void testGetPayload_NoSuchPayload() {
Message m;
- m.addPayload(boost::make_shared<MyPayload1>());
- m.addPayload(boost::make_shared<MyPayload3>());
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(std::make_shared<MyPayload3>());
- boost::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
+ std::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
CPPUNIT_ASSERT(!p);
}
void testGetPayloads() {
Message m;
- boost::shared_ptr<MyPayload2> payload1(new MyPayload2());
- boost::shared_ptr<MyPayload2> payload2(new MyPayload2());
- m.addPayload(boost::make_shared<MyPayload1>());
+ std::shared_ptr<MyPayload2> payload1(new MyPayload2());
+ std::shared_ptr<MyPayload2> payload2(new MyPayload2());
+ m.addPayload(std::make_shared<MyPayload1>());
m.addPayload(payload1);
- m.addPayload(boost::make_shared<MyPayload3>());
+ m.addPayload(std::make_shared<MyPayload3>());
m.addPayload(payload2);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), m.getPayloads<MyPayload2>().size());
@@ -137,51 +138,51 @@ class StanzaTest : public CppUnit::TestFixture
void testUpdatePayload_ExistingPayload() {
Message m;
- m.addPayload(boost::make_shared<MyPayload1>());
- m.addPayload(boost::make_shared<MyPayload2>("foo"));
- m.addPayload(boost::make_shared<MyPayload3>());
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(std::make_shared<MyPayload2>("foo"));
+ m.addPayload(std::make_shared<MyPayload3>());
- m.updatePayload(boost::make_shared<MyPayload2>("bar"));
+ m.updatePayload(std::make_shared<MyPayload2>("bar"));
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), m.getPayloads().size());
- boost::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
+ std::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
CPPUNIT_ASSERT_EQUAL(std::string("bar"), p->text_);
}
void testUpdatePayload_NewPayload() {
Message m;
- m.addPayload(boost::make_shared<MyPayload1>());
- m.addPayload(boost::make_shared<MyPayload3>());
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(std::make_shared<MyPayload3>());
- m.updatePayload(boost::make_shared<MyPayload2>("bar"));
+ m.updatePayload(std::make_shared<MyPayload2>("bar"));
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), m.getPayloads().size());
- boost::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
+ std::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
CPPUNIT_ASSERT_EQUAL(std::string("bar"), p->text_);
}
void testGetPayloadOfSameType() {
Message m;
- m.addPayload(boost::make_shared<MyPayload1>());
- m.addPayload(boost::make_shared<MyPayload2>("foo"));
- m.addPayload(boost::make_shared<MyPayload3>());
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(std::make_shared<MyPayload2>("foo"));
+ m.addPayload(std::make_shared<MyPayload3>());
- boost::shared_ptr<MyPayload2> payload(boost::dynamic_pointer_cast<MyPayload2>(m.getPayloadOfSameType(boost::make_shared<MyPayload2>("bar"))));
+ std::shared_ptr<MyPayload2> payload(std::dynamic_pointer_cast<MyPayload2>(m.getPayloadOfSameType(std::make_shared<MyPayload2>("bar"))));
CPPUNIT_ASSERT(payload);
CPPUNIT_ASSERT_EQUAL(std::string("foo"), payload->text_);
}
void testGetPayloadOfSameType_NoSuchPayload() {
Message m;
- m.addPayload(boost::make_shared<MyPayload1>());
- m.addPayload(boost::make_shared<MyPayload3>());
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(std::make_shared<MyPayload3>());
- CPPUNIT_ASSERT(!m.getPayloadOfSameType(boost::make_shared<MyPayload2>("bar")));
+ CPPUNIT_ASSERT(!m.getPayloadOfSameType(std::make_shared<MyPayload2>("bar")));
}
void testGetTimestamp() {
Message m;
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(1)));
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(1)));
boost::optional<boost::posix_time::ptime> timestamp = m.getTimestamp();
@@ -191,7 +192,7 @@ class StanzaTest : public CppUnit::TestFixture
void testGetTimestamp_TimestampWithFrom() {
Message m;
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(1), JID("foo@bar.com")));
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(1), JID("foo@bar.com")));
boost::optional<boost::posix_time::ptime> timestamp = m.getTimestamp();
@@ -206,10 +207,10 @@ class StanzaTest : public CppUnit::TestFixture
void testGetTimestampFrom() {
Message m;
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(0)));
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(1), JID("foo1@bar.com")));
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(2), JID("foo2@bar.com")));
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(3), JID("foo3@bar.com")));
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(0)));
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(1), JID("foo1@bar.com")));
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(2), JID("foo2@bar.com")));
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(3), JID("foo3@bar.com")));
boost::optional<boost::posix_time::ptime> 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<Delay>(boost::posix_time::from_time_t(1), JID("foo1@bar.com")));
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(3), JID("foo3@bar.com")));
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(1), JID("foo1@bar.com")));
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(3), JID("foo3@bar.com")));
boost::optional<boost::posix_time::ptime> 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 <memory>
#include <string>
#include <boost/date_time/posix_time/ptime.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/ByteArray.h>
@@ -19,7 +19,7 @@
namespace Swift {
class SWIFTEN_API VCard : public Payload {
public:
- typedef boost::shared_ptr<VCard> ref;
+ typedef std::shared_ptr<VCard> 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<WhiteboardDeleteOperation> ref;
+ typedef std::shared_ptr<WhiteboardDeleteOperation> 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 <boost/shared_ptr.hpp>
+#include <memory>
+#include <string>
#include <Swiften/Elements/Whiteboard/WhiteboardElementVisitor.h>
namespace Swift {
class WhiteboardElement {
public:
- typedef boost::shared_ptr<WhiteboardElement> ref;
+ typedef std::shared_ptr<WhiteboardElement> 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<WhiteboardEllipseElement> ref;
+ typedef std::shared_ptr<WhiteboardEllipseElement> 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<int, int> Point;
public:
- typedef boost::shared_ptr<WhiteboardFreehandPathElement> ref;
+ typedef std::shared_ptr<WhiteboardFreehandPathElement> 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<WhiteboardInsertOperation> ref;
+ typedef std::shared_ptr<WhiteboardInsertOperation> 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<WhiteboardLineElement> ref;
+ typedef std::shared_ptr<WhiteboardLineElement> 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<WhiteboardOperation> ref;
+ typedef std::shared_ptr<WhiteboardOperation> 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<int, int> Point;
public:
- typedef boost::shared_ptr<WhiteboardPolygonElement> ref;
+ typedef std::shared_ptr<WhiteboardPolygonElement> 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<WhiteboardRectElement> ref;
+ typedef std::shared_ptr<WhiteboardRectElement> 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<WhiteboardTextElement> ref;
+ typedef std::shared_ptr<WhiteboardTextElement> 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<WhiteboardUpdateOperation> ref;
+ typedef std::shared_ptr<WhiteboardUpdateOperation> 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<WhiteboardPayload> ref;
+ typedef std::shared_ptr<WhiteboardPayload> 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<PAYLOAD> loadPayloadGeneric(const boost::filesystem::path& path) {
- return boost::dynamic_pointer_cast<PAYLOAD>(loadPayload(path));
+ std::shared_ptr<PAYLOAD> loadPayloadGeneric(const boost::filesystem::path& path) {
+ return std::dynamic_pointer_cast<PAYLOAD>(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> payload, const boost::filesystem::path& path) {
+void PayloadPersister::savePayload(std::shared_ptr<Payload> 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> payload, const boo
}
}
-boost::shared_ptr<Payload> PayloadPersister::loadPayload(const boost::filesystem::path& path) {
+std::shared_ptr<Payload> PayloadPersister::loadPayload(const boost::filesystem::path& path) {
try {
if (boost::filesystem::exists(path)) {
ByteArray data;
readByteArrayFromFile(data, path);
- boost::shared_ptr<PayloadParser> parser(createParser());
+ std::shared_ptr<PayloadParser> parser(createParser());
PayloadParserTester tester(parser.get());
tester.parse(byteArrayToString(data));
return parser->getPayload();
@@ -53,5 +53,5 @@ boost::shared_ptr<Payload> PayloadPersister::loadPayload(const boost::filesystem
catch (const boost::filesystem::filesystem_error& e) {
std::cerr << "ERROR: " << e.what() << std::endl;
}
- return boost::shared_ptr<Payload>();
+ return std::shared_ptr<Payload>();
}
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 <memory>
+
#include <boost/filesystem/path.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
@@ -21,8 +22,8 @@ namespace Swift {
PayloadPersister();
virtual ~PayloadPersister();
- void savePayload(boost::shared_ptr<Payload>, const boost::filesystem::path&);
- boost::shared_ptr<Payload> loadPayload(const boost::filesystem::path&);
+ void savePayload(std::shared_ptr<Payload>, const boost::filesystem::path&);
+ std::shared_ptr<Payload> 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<boost::asio::io_service> ioService) : ioService_(ioService) {
+BoostASIOEventLoop::BoostASIOEventLoop(std::shared_ptr<boost::asio::io_service> 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 <memory>
+
#include <boost/asio/io_service.hpp>
-#include <boost/shared_ptr.hpp>
#include <boost/thread.hpp>
#include <Swiften/Base/API.h>
@@ -17,7 +18,7 @@
namespace Swift {
class SWIFTEN_API BoostASIOEventLoop : public EventLoop {
public:
- BoostASIOEventLoop(boost::shared_ptr<boost::asio::io_service> ioService);
+ BoostASIOEventLoop(std::shared_ptr<boost::asio::io_service> ioService);
virtual ~BoostASIOEventLoop();
protected:
@@ -26,7 +27,7 @@ namespace Swift {
virtual void eventPosted();
private:
- boost::shared_ptr<boost::asio::io_service> ioService_;
+ std::shared_ptr<boost::asio::io_service> 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 <memory>
+
#include <boost/function.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/EventLoop/EventOwner.h>
namespace Swift {
class Event {
public:
- Event(boost::shared_ptr<EventOwner> owner, const boost::function<void()>& callback) : id(~0U), owner(owner), callback(callback) {
+ Event(std::shared_ptr<EventOwner> owner, const boost::function<void()>& 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<EventOwner> owner;
+ std::shared_ptr<EventOwner> owner;
boost::function<void()> 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<void ()> callback, boost::shared_ptr<EventOwner> owner) {
+void EventLoop::postEvent(boost::function<void ()> callback, std::shared_ptr<EventOwner> owner) {
Event event(owner, callback);
bool callEventPosted = false;
{
@@ -91,7 +91,7 @@ void EventLoop::postEvent(boost::function<void ()> callback, boost::shared_ptr<E
}
}
-void EventLoop::removeEventsFromOwner(boost::shared_ptr<EventOwner> owner) {
+void EventLoop::removeEventsFromOwner(std::shared_ptr<EventOwner> 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<void ()> event, boost::shared_ptr<EventOwner> owner = boost::shared_ptr<EventOwner>());
+ void postEvent(boost::function<void ()> event, std::shared_ptr<EventOwner> owner = std::shared_ptr<EventOwner>());
/**
* The \ref removeEventsFromOwner method removes all events from the specified \ref owner from the
* event queue.
*/
- void removeEventsFromOwner(boost::shared_ptr<EventOwner> owner);
+ void removeEventsFromOwner(std::shared_ptr<EventOwner> 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<MyEventOwner> eventOwner1(new MyEventOwner());
- boost::shared_ptr<MyEventOwner> eventOwner2(new MyEventOwner());
+ std::shared_ptr<MyEventOwner> eventOwner1(new MyEventOwner());
+ std::shared_ptr<MyEventOwner> 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<MyEventOwner> eventOwner(new MyEventOwner());
+ std::shared_ptr<MyEventOwner> 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<MyEventOwner> eventOwner) {
+ void runEventLoop(DummyEventLoop* loop, std::shared_ptr<MyEventOwner> eventOwner) {
loop->processEvents();
CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(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<DiscoInfo> /*info*/, ErrorPayload::ref error) {
+static void handleServerDiscoInfoResponse(std::shared_ptr<DiscoInfo> /*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<DNSSDQuerier> querier = factory.createQuerier();
+ std::shared_ptr<DNSSDQuerier> querier = factory.createQuerier();
querier->start();
if (std::string(argv[1]) == "browse") {
- boost::shared_ptr<DNSSDBrowseQuery> browseQuery = querier->createBrowseQuery();
+ std::shared_ptr<DNSSDBrowseQuery> 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<DNSSDResolveServiceQuery> resolveQuery = querier->createResolveServiceQuery(DNSSDServiceID(argv[2], argv[3], argv[4]));
+ std::shared_ptr<DNSSDResolveServiceQuery> 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 <iostream>
+#include <memory>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/foreach.h>
#include <Swiften/Client/Client.h>
@@ -27,7 +27,7 @@ using namespace std;
static SimpleEventLoop eventLoop;
static BoostNetworkFactories networkFactories(&eventLoop);
-static boost::shared_ptr<Client> client;
+static std::shared_ptr<Client> 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<DiscoItems> items, ErrorPayload::ref error) {
+static void handleRoomsItemsResponse(std::shared_ptr<DiscoItems> items, ErrorPayload::ref error) {
if (error) {
cout << "Error fetching list of rooms." << endl;
return;
@@ -73,7 +73,7 @@ static void handleDisconnected(const boost::optional<ClientError>&) {
cout << "Disconnected." << endl;
}
-static void handleIncomingMessage(boost::shared_ptr<Message> message) {
+static void handleIncomingMessage(std::shared_ptr<Message> 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<Client>(JID(argv[1]), string(argv[2]), &networkFactories);
+ client = std::make_shared<Client>(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<NATTraversalGetPublicIPRequest> query = natTraverser.createGetPublicIPRequest();
+ std::shared_ptr<NATTraversalGetPublicIPRequest> 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<NATTraversalForwardPortRequest> query = natTraverser.createForwardPortRequest(boost::lexical_cast<int>(argv[2]), boost::lexical_cast<int>(argv[3]));
+ std::shared_ptr<NATTraversalForwardPortRequest> query = natTraverser.createForwardPortRequest(boost::lexical_cast<int>(argv[2]), boost::lexical_cast<int>(argv[3]));
query->onResult.connect(boost::bind(&handleGetForwardPortRequestResponse, _1));
query->start();
eventLoop.run();
@@ -75,7 +75,7 @@ int main(int argc, char* argv[]) {
if (argc < 4) {
std::cerr << "Invalid parameters" << std::endl;
}
- boost::shared_ptr<NATTraversalRemovePortForwardingRequest> query = natTraverser.createRemovePortForwardingRequest(boost::lexical_cast<int>(argv[2]), boost::lexical_cast<int>(argv[3]));
+ std::shared_ptr<NATTraversalRemovePortForwardingRequest> query = natTraverser.createRemovePortForwardingRequest(boost::lexical_cast<int>(argv[2]), boost::lexical_cast<int>(argv[3]));
query->onResult.connect(boost::bind(&handleRemovePortForwardingRequestResponse, _1));
query->start();
eventLoop.run();
diff --git a/Swiften/Examples/ParserTester/ParserTester.cpp b/Swiften/Examples/ParserTester/ParserTester.cpp
index af79ece..71b0611 100644
--- a/Swiften/Examples/ParserTester/ParserTester.cpp
+++ b/Swiften/Examples/ParserTester/ParserTester.cpp
@@ -22,7 +22,7 @@ class MyXMPPParserClient : public XMPPParserClient {
virtual void handleStreamStart(const ProtocolHeader&) {
std::cout << "-> Stream start" << std::endl;
}
- virtual void handleElement(boost::shared_ptr<ToplevelElement> element) {
+ virtual void handleElement(std::shared_ptr<ToplevelElement> element) {
std::cout << "-> Element " << typeid(*element.get()).name() << std::endl;
}
virtual void handleStreamEnd() {
diff --git a/Swiften/Examples/SendFile/ReceiveFile.cpp b/Swiften/Examples/SendFile/ReceiveFile.cpp
index c6e75e8..0b61987 100644
--- a/Swiften/Examples/SendFile/ReceiveFile.cpp
+++ b/Swiften/Examples/SendFile/ReceiveFile.cpp
@@ -5,10 +5,10 @@
*/
#include <iostream>
+#include <memory>
#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Log.h>
#include <Swiften/Base/foreach.h>
@@ -82,7 +82,7 @@ class FileReceiver {
void handleIncomingFileTransfer(IncomingFileTransfer::ref transfer) {
SWIFT_LOG(debug) << "foo" << std::endl;
incomingFileTransfers.push_back(transfer);
- boost::shared_ptr<FileWriteBytestream> out = boost::make_shared<FileWriteBytestream>("out");
+ std::shared_ptr<FileWriteBytestream> out = std::make_shared<FileWriteBytestream>("out");
transfer->onFinished.connect(boost::bind(&FileReceiver::handleFileTransferFinished, this, _1, out));
transfer->accept(out);
}
@@ -94,7 +94,7 @@ class FileReceiver {
void handleFileTransferFinished(
const boost::optional<FileTransferError>& error,
- boost::shared_ptr<FileWriteBytestream> out) {
+ std::shared_ptr<FileWriteBytestream> out) {
std::cout << "File transfer finished" << std::endl;
out->close();
if (error) {
diff --git a/Swiften/Examples/SendFile/SendFile.cpp b/Swiften/Examples/SendFile/SendFile.cpp
index 1b70747..0e1fb23 100644
--- a/Swiften/Examples/SendFile/SendFile.cpp
+++ b/Swiften/Examples/SendFile/SendFile.cpp
@@ -67,7 +67,7 @@ class FileSender {
void handleCapsChanged(JID jid) {
if (jid.toBare() == recipient) {
// create ReadBytestream from file
- boost::shared_ptr<FileReadBytestream> fileStream = boost::make_shared<FileReadBytestream>(file);
+ std::shared_ptr<FileReadBytestream> fileStream = std::make_shared<FileReadBytestream>(file);
outgoingFileTransfer = client->getFileTransferManager()->createOutgoingFileTransfer(recipient, file, "Some File!", fileStream);
diff --git a/Swiften/Examples/SendMessage/SendMessage.cpp b/Swiften/Examples/SendMessage/SendMessage.cpp
index 9a954f2..2458e65 100644
--- a/Swiften/Examples/SendMessage/SendMessage.cpp
+++ b/Swiften/Examples/SendMessage/SendMessage.cpp
@@ -30,7 +30,7 @@ static boost::bsignals::connection errorConnection;
static void handleConnected() {
- boost::shared_ptr<Message> message(new Message());
+ std::shared_ptr<Message> message(new Message());
message->setBody(messageBody);
message->setTo(recipient);
client->sendMessage(message);
diff --git a/Swiften/FileTransfer/ByteArrayReadBytestream.cpp b/Swiften/FileTransfer/ByteArrayReadBytestream.cpp
index c1fadee..cd9fa4a 100644
--- a/Swiften/FileTransfer/ByteArrayReadBytestream.cpp
+++ b/Swiften/FileTransfer/ByteArrayReadBytestream.cpp
@@ -6,19 +6,20 @@
#include <Swiften/FileTransfer/ByteArrayReadBytestream.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Algorithm.h>
using namespace Swift;
-boost::shared_ptr<ByteArray> ByteArrayReadBytestream::read(size_t size) {
+std::shared_ptr<ByteArray> ByteArrayReadBytestream::read(size_t size) {
size_t readSize = size;
if (position + readSize > data.size()) {
readSize = data.size() - position;
}
- boost::shared_ptr<ByteArray> result = boost::make_shared<ByteArray>(
+ std::shared_ptr<ByteArray> result = std::make_shared<ByteArray>(
data.begin() + boost::numeric_cast<long long>(position),
data.begin() + boost::numeric_cast<long long>(position) + boost::numeric_cast<long long>(readSize));
diff --git a/Swiften/FileTransfer/ByteArrayReadBytestream.h b/Swiften/FileTransfer/ByteArrayReadBytestream.h
index a711acb..d90e5cc 100644
--- a/Swiften/FileTransfer/ByteArrayReadBytestream.h
+++ b/Swiften/FileTransfer/ByteArrayReadBytestream.h
@@ -18,7 +18,7 @@ namespace Swift {
ByteArrayReadBytestream(const std::vector<unsigned char>& data) : data(data), position(0), dataComplete(true) {
}
- virtual boost::shared_ptr<ByteArray> read(size_t size);
+ virtual std::shared_ptr<ByteArray> read(size_t size);
virtual bool isFinished() const {
return position >= data.size() && dataComplete;
diff --git a/Swiften/FileTransfer/BytestreamsRequest.h b/Swiften/FileTransfer/BytestreamsRequest.h
index 7fa3660..d278e79 100644
--- a/Swiften/FileTransfer/BytestreamsRequest.h
+++ b/Swiften/FileTransfer/BytestreamsRequest.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Bytestreams.h>
@@ -15,21 +15,21 @@
namespace Swift {
class SWIFTEN_API BytestreamsRequest : public GenericRequest<Bytestreams> {
public:
- typedef boost::shared_ptr<BytestreamsRequest> ref;
+ typedef std::shared_ptr<BytestreamsRequest> ref;
- static ref create(const JID& jid, boost::shared_ptr<Bytestreams> payload, IQRouter* router) {
+ static ref create(const JID& jid, std::shared_ptr<Bytestreams> payload, IQRouter* router) {
return ref(new BytestreamsRequest(jid, payload, router));
}
- static ref create(const JID& from, const JID& to, boost::shared_ptr<Bytestreams> payload, IQRouter* router) {
+ static ref create(const JID& from, const JID& to, std::shared_ptr<Bytestreams> payload, IQRouter* router) {
return ref(new BytestreamsRequest(from, to, payload, router));
}
private:
- BytestreamsRequest(const JID& jid, boost::shared_ptr<Bytestreams> payload, IQRouter* router) : GenericRequest<Bytestreams>(IQ::Set, jid, payload, router) {
+ BytestreamsRequest(const JID& jid, std::shared_ptr<Bytestreams> payload, IQRouter* router) : GenericRequest<Bytestreams>(IQ::Set, jid, payload, router) {
}
- BytestreamsRequest(const JID& from, const JID& to, boost::shared_ptr<Bytestreams> payload, IQRouter* router) : GenericRequest<Bytestreams>(IQ::Set, from, to, payload, router) {
+ BytestreamsRequest(const JID& from, const JID& to, std::shared_ptr<Bytestreams> payload, IQRouter* router) : GenericRequest<Bytestreams>(IQ::Set, from, to, payload, router) {
}
};
}
diff --git a/Swiften/FileTransfer/DefaultFileTransferTransporter.cpp b/Swiften/FileTransfer/DefaultFileTransferTransporter.cpp
index b54f1c1..9428d0b 100644
--- a/Swiften/FileTransfer/DefaultFileTransferTransporter.cpp
+++ b/Swiften/FileTransfer/DefaultFileTransferTransporter.cpp
@@ -1,13 +1,14 @@
/*
- * Copyright (c) 2013-2015 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/FileTransfer/DefaultFileTransferTransporter.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Log.h>
#include <Swiften/Base/foreach.h>
@@ -107,7 +108,7 @@ void DefaultFileTransferTransporter::handleLocalCandidatesGenerated(
void DefaultFileTransferTransporter::handleRemoteCandidateSelectFinished(
const boost::optional<JingleS5BTransportPayload::Candidate>& candidate,
- boost::shared_ptr<SOCKS5BytestreamClientSession> session) {
+ std::shared_ptr<SOCKS5BytestreamClientSession> session) {
remoteS5BClientSession = session;
onRemoteCandidateSelectFinished(s5bSessionID, candidate);
}
@@ -134,11 +135,11 @@ void DefaultFileTransferTransporter::handleActivateProxySessionResult(const std:
void DefaultFileTransferTransporter::startActivatingProxy(const JID& proxyServiceJID) {
// activate proxy
SWIFT_LOG(debug) << "Start activating proxy " << proxyServiceJID.toString() << " with sid = " << s5bSessionID << "." << std::endl;
- S5BProxyRequest::ref proxyRequest = boost::make_shared<S5BProxyRequest>();
+ S5BProxyRequest::ref proxyRequest = std::make_shared<S5BProxyRequest>();
proxyRequest->setSID(s5bSessionID);
proxyRequest->setActivate(role == Initiator ? responder : initiator);
- boost::shared_ptr<GenericRequest<S5BProxyRequest> > request = boost::make_shared<GenericRequest<S5BProxyRequest> >(IQ::Set, proxyServiceJID, proxyRequest, router);
+ std::shared_ptr<GenericRequest<S5BProxyRequest> > request = std::make_shared<GenericRequest<S5BProxyRequest> >(IQ::Set, proxyServiceJID, proxyRequest, router);
request->onResponse.connect(boost::bind(&DefaultFileTransferTransporter::handleActivateProxySessionResult, this, s5bSessionID, _2));
request->send();
}
@@ -148,97 +149,97 @@ void DefaultFileTransferTransporter::stopActivatingProxy() {
assert(false);
}
-boost::shared_ptr<TransportSession> DefaultFileTransferTransporter::createIBBSendSession(
- const std::string& sessionID, unsigned int blockSize, boost::shared_ptr<ReadBytestream> stream) {
+std::shared_ptr<TransportSession> DefaultFileTransferTransporter::createIBBSendSession(
+ const std::string& sessionID, unsigned int blockSize, std::shared_ptr<ReadBytestream> stream) {
if (s5bServerManager->getServer()) {
closeLocalSession();
}
closeRemoteSession();
- boost::shared_ptr<IBBSendSession> ibbSession = boost::make_shared<IBBSendSession>(
+ std::shared_ptr<IBBSendSession> ibbSession = std::make_shared<IBBSendSession>(
sessionID, initiator, responder, stream, router);
ibbSession->setBlockSize(blockSize);
- return boost::make_shared<IBBSendTransportSession>(ibbSession);
+ return std::make_shared<IBBSendTransportSession>(ibbSession);
}
-boost::shared_ptr<TransportSession> DefaultFileTransferTransporter::createIBBReceiveSession(
- const std::string& sessionID, unsigned long long size, boost::shared_ptr<WriteBytestream> stream) {
+std::shared_ptr<TransportSession> DefaultFileTransferTransporter::createIBBReceiveSession(
+ const std::string& sessionID, unsigned long long size, std::shared_ptr<WriteBytestream> stream) {
if (s5bServerManager->getServer()) {
closeLocalSession();
}
closeRemoteSession();
- boost::shared_ptr<IBBReceiveSession> ibbSession = boost::make_shared<IBBReceiveSession>(
+ std::shared_ptr<IBBReceiveSession> ibbSession = std::make_shared<IBBReceiveSession>(
sessionID, initiator, responder, size, stream, router);
- return boost::make_shared<IBBReceiveTransportSession>(ibbSession);
+ return std::make_shared<IBBReceiveTransportSession>(ibbSession);
}
-boost::shared_ptr<TransportSession> DefaultFileTransferTransporter::createRemoteCandidateSession(
- boost::shared_ptr<ReadBytestream> stream, const JingleS5BTransportPayload::Candidate& /* candidate */) {
+std::shared_ptr<TransportSession> DefaultFileTransferTransporter::createRemoteCandidateSession(
+ std::shared_ptr<ReadBytestream> stream, const JingleS5BTransportPayload::Candidate& /* candidate */) {
closeLocalSession();
- return boost::make_shared<S5BTransportSession<SOCKS5BytestreamClientSession> >(
+ return std::make_shared<S5BTransportSession<SOCKS5BytestreamClientSession> >(
remoteS5BClientSession, stream);
}
-boost::shared_ptr<TransportSession> DefaultFileTransferTransporter::createRemoteCandidateSession(
- boost::shared_ptr<WriteBytestream> stream, const JingleS5BTransportPayload::Candidate& /* candidate */) {
+std::shared_ptr<TransportSession> DefaultFileTransferTransporter::createRemoteCandidateSession(
+ std::shared_ptr<WriteBytestream> stream, const JingleS5BTransportPayload::Candidate& /* candidate */) {
closeLocalSession();
- return boost::make_shared<S5BTransportSession<SOCKS5BytestreamClientSession> >(
+ return std::make_shared<S5BTransportSession<SOCKS5BytestreamClientSession> >(
remoteS5BClientSession, stream);
}
-boost::shared_ptr<SOCKS5BytestreamServerSession> DefaultFileTransferTransporter::getServerSession() {
+std::shared_ptr<SOCKS5BytestreamServerSession> DefaultFileTransferTransporter::getServerSession() {
s5bRegistry->setHasBytestream(getSOCKS5DstAddr(), false);
- std::vector<boost::shared_ptr<SOCKS5BytestreamServerSession> > serverSessions =
+ std::vector<std::shared_ptr<SOCKS5BytestreamServerSession> > serverSessions =
s5bServerManager->getServer()->getSessions(getSOCKS5DstAddr());
while (serverSessions.size() > 1) {
- boost::shared_ptr<SOCKS5BytestreamServerSession> session = serverSessions.back();
+ std::shared_ptr<SOCKS5BytestreamServerSession> session = serverSessions.back();
serverSessions.pop_back();
session->stop();
}
- return !serverSessions.empty() ? serverSessions.front() : boost::shared_ptr<SOCKS5BytestreamServerSession>();
+ return !serverSessions.empty() ? serverSessions.front() : std::shared_ptr<SOCKS5BytestreamServerSession>();
}
-boost::shared_ptr<TransportSession> DefaultFileTransferTransporter::createLocalCandidateSession(
- boost::shared_ptr<ReadBytestream> stream, const JingleS5BTransportPayload::Candidate& candidate) {
+std::shared_ptr<TransportSession> DefaultFileTransferTransporter::createLocalCandidateSession(
+ std::shared_ptr<ReadBytestream> stream, const JingleS5BTransportPayload::Candidate& candidate) {
closeRemoteSession();
- boost::shared_ptr<TransportSession> transportSession;
+ std::shared_ptr<TransportSession> transportSession;
if (candidate.type == JingleS5BTransportPayload::Candidate::ProxyType) {
SOCKS5BytestreamClientSession::ref proxySession = s5bProxy->getProxySessionAndCloseOthers(candidate.jid, getLocalCandidateSOCKS5DstAddr());
assert(proxySession);
- transportSession = boost::make_shared<S5BTransportSession<SOCKS5BytestreamClientSession> >(proxySession, stream);
+ transportSession = std::make_shared<S5BTransportSession<SOCKS5BytestreamClientSession> >(proxySession, stream);
}
if (!transportSession) {
- boost::shared_ptr<SOCKS5BytestreamServerSession> serverSession = getServerSession();
+ std::shared_ptr<SOCKS5BytestreamServerSession> serverSession = getServerSession();
if (serverSession) {
- transportSession = boost::make_shared<S5BTransportSession<SOCKS5BytestreamServerSession> >(serverSession, stream);
+ transportSession = std::make_shared<S5BTransportSession<SOCKS5BytestreamServerSession> >(serverSession, stream);
}
}
if (!transportSession) {
- transportSession = boost::make_shared<FailingTransportSession>();
+ transportSession = std::make_shared<FailingTransportSession>();
}
return transportSession;
}
-boost::shared_ptr<TransportSession> DefaultFileTransferTransporter::createLocalCandidateSession(
- boost::shared_ptr<WriteBytestream> stream, const JingleS5BTransportPayload::Candidate& candidate) {
+std::shared_ptr<TransportSession> DefaultFileTransferTransporter::createLocalCandidateSession(
+ std::shared_ptr<WriteBytestream> stream, const JingleS5BTransportPayload::Candidate& candidate) {
closeRemoteSession();
- boost::shared_ptr<TransportSession> transportSession;
+ std::shared_ptr<TransportSession> transportSession;
if (candidate.type == JingleS5BTransportPayload::Candidate::ProxyType) {
SOCKS5BytestreamClientSession::ref proxySession = s5bProxy->getProxySessionAndCloseOthers(candidate.jid, getLocalCandidateSOCKS5DstAddr());
assert(proxySession);
- transportSession = boost::make_shared<S5BTransportSession<SOCKS5BytestreamClientSession> >(proxySession, stream);
+ transportSession = std::make_shared<S5BTransportSession<SOCKS5BytestreamClientSession> >(proxySession, stream);
}
if (!transportSession) {
- boost::shared_ptr<SOCKS5BytestreamServerSession> serverSession = getServerSession();
+ std::shared_ptr<SOCKS5BytestreamServerSession> serverSession = getServerSession();
if (serverSession) {
- transportSession = boost::make_shared<S5BTransportSession<SOCKS5BytestreamServerSession> >(serverSession, stream);
+ transportSession = std::make_shared<S5BTransportSession<SOCKS5BytestreamServerSession> >(serverSession, stream);
}
}
if (!transportSession) {
- transportSession = boost::make_shared<FailingTransportSession>();
+ transportSession = std::make_shared<FailingTransportSession>();
}
return transportSession;
}
@@ -285,8 +286,8 @@ std::string DefaultFileTransferTransporter::getLocalCandidateSOCKS5DstAddr() con
void DefaultFileTransferTransporter::closeLocalSession() {
s5bRegistry->setHasBytestream(getSOCKS5DstAddr(), false);
if (s5bServerManager->getServer()) {
- std::vector<boost::shared_ptr<SOCKS5BytestreamServerSession> > serverSessions = s5bServerManager->getServer()->getSessions(getSOCKS5DstAddr());
- foreach(boost::shared_ptr<SOCKS5BytestreamServerSession> session, serverSessions) {
+ std::vector<std::shared_ptr<SOCKS5BytestreamServerSession> > serverSessions = s5bServerManager->getServer()->getSessions(getSOCKS5DstAddr());
+ foreach(std::shared_ptr<SOCKS5BytestreamServerSession> session, serverSessions) {
session->stop();
}
}
diff --git a/Swiften/FileTransfer/DefaultFileTransferTransporter.h b/Swiften/FileTransfer/DefaultFileTransferTransporter.h
index 7ec6a12..339232f 100644
--- a/Swiften/FileTransfer/DefaultFileTransferTransporter.h
+++ b/Swiften/FileTransfer/DefaultFileTransferTransporter.h
@@ -65,28 +65,28 @@ namespace Swift {
virtual void startActivatingProxy(const JID& jid) SWIFTEN_OVERRIDE;
virtual void stopActivatingProxy() SWIFTEN_OVERRIDE;
- virtual boost::shared_ptr<TransportSession> createIBBSendSession(
- const std::string& sessionID, unsigned int blockSize, boost::shared_ptr<ReadBytestream>) SWIFTEN_OVERRIDE;
- virtual boost::shared_ptr<TransportSession> createIBBReceiveSession(
- const std::string& sessionID, unsigned long long size, boost::shared_ptr<WriteBytestream>) SWIFTEN_OVERRIDE;
- virtual boost::shared_ptr<TransportSession> createRemoteCandidateSession(
- boost::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE;
- virtual boost::shared_ptr<TransportSession> createRemoteCandidateSession(
- boost::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE;
- virtual boost::shared_ptr<TransportSession> createLocalCandidateSession(
- boost::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE;
- virtual boost::shared_ptr<TransportSession> createLocalCandidateSession(
- boost::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<TransportSession> createIBBSendSession(
+ const std::string& sessionID, unsigned int blockSize, std::shared_ptr<ReadBytestream>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<TransportSession> createIBBReceiveSession(
+ const std::string& sessionID, unsigned long long size, std::shared_ptr<WriteBytestream>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<TransportSession> createRemoteCandidateSession(
+ std::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<TransportSession> createRemoteCandidateSession(
+ std::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<TransportSession> createLocalCandidateSession(
+ std::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<TransportSession> createLocalCandidateSession(
+ std::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& candidate) SWIFTEN_OVERRIDE;
private:
void handleLocalCandidatesGenerated(const std::vector<JingleS5BTransportPayload::Candidate>&);
void handleRemoteCandidateSelectFinished(
const boost::optional<JingleS5BTransportPayload::Candidate>&,
- boost::shared_ptr<SOCKS5BytestreamClientSession>);
+ std::shared_ptr<SOCKS5BytestreamClientSession>);
void handleActivateProxySessionResult(const std::string& sessionID, ErrorPayload::ref error);
void closeLocalSession();
void closeRemoteSession();
- boost::shared_ptr<SOCKS5BytestreamServerSession> getServerSession();
+ std::shared_ptr<SOCKS5BytestreamServerSession> getServerSession();
std::string getSOCKS5DstAddr() const;
std::string getInitiatorCandidateSOCKS5DstAddr() const;
@@ -106,7 +106,7 @@ namespace Swift {
LocalJingleTransportCandidateGenerator* localCandidateGenerator;
RemoteJingleTransportCandidateSelector* remoteCandidateSelector;
std::string s5bSessionID;
- boost::shared_ptr<SOCKS5BytestreamClientSession> remoteS5BClientSession;
+ std::shared_ptr<SOCKS5BytestreamClientSession> remoteS5BClientSession;
};
}
diff --git a/Swiften/FileTransfer/FileReadBytestream.cpp b/Swiften/FileTransfer/FileReadBytestream.cpp
index ad9a33b..2ff00dc 100644
--- a/Swiften/FileTransfer/FileReadBytestream.cpp
+++ b/Swiften/FileTransfer/FileReadBytestream.cpp
@@ -7,10 +7,10 @@
#include <Swiften/FileTransfer/FileReadBytestream.h>
#include <cassert>
+#include <memory>
#include <boost/filesystem/fstream.hpp>
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/ByteArray.h>
@@ -27,11 +27,11 @@ FileReadBytestream::~FileReadBytestream() {
}
}
-boost::shared_ptr<ByteArray> FileReadBytestream::read(size_t size) {
+std::shared_ptr<ByteArray> FileReadBytestream::read(size_t size) {
if (!stream) {
stream = new boost::filesystem::ifstream(file, std::ios_base::in|std::ios_base::binary);
}
- boost::shared_ptr<ByteArray> result = boost::make_shared<ByteArray>();
+ std::shared_ptr<ByteArray> result = std::make_shared<ByteArray>();
result->resize(size);
assert(stream->good());
stream->read(reinterpret_cast<char*>(vecptr(*result)), boost::numeric_cast<std::streamsize>(size));
diff --git a/Swiften/FileTransfer/FileReadBytestream.h b/Swiften/FileTransfer/FileReadBytestream.h
index 24cfbae..aaf3de3 100644
--- a/Swiften/FileTransfer/FileReadBytestream.h
+++ b/Swiften/FileTransfer/FileReadBytestream.h
@@ -18,7 +18,7 @@ namespace Swift {
FileReadBytestream(const boost::filesystem::path& file);
virtual ~FileReadBytestream();
- virtual boost::shared_ptr< std::vector<unsigned char> > read(size_t size);
+ virtual std::shared_ptr< std::vector<unsigned char> > read(size_t size);
virtual bool isFinished() const;
private:
diff --git a/Swiften/FileTransfer/FileTransfer.h b/Swiften/FileTransfer/FileTransfer.h
index b585ab9..e6442b7 100644
--- a/Swiften/FileTransfer/FileTransfer.h
+++ b/Swiften/FileTransfer/FileTransfer.h
@@ -5,16 +5,17 @@
*/
/*
- * Copyright (c) 2013-2015 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+
#include <boost/cstdint.hpp>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -46,7 +47,7 @@ namespace Swift {
Type type;
std::string message;
};
- typedef boost::shared_ptr<FileTransfer> ref;
+ typedef std::shared_ptr<FileTransfer> ref;
public:
FileTransfer();
diff --git a/Swiften/FileTransfer/FileTransferManager.h b/Swiften/FileTransfer/FileTransferManager.h
index be2902a..60deeaa 100644
--- a/Swiften/FileTransfer/FileTransferManager.h
+++ b/Swiften/FileTransfer/FileTransferManager.h
@@ -36,7 +36,7 @@ namespace Swift {
const JID& to,
const boost::filesystem::path& filepath,
const std::string& description,
- boost::shared_ptr<ReadBytestream> bytestream,
+ std::shared_ptr<ReadBytestream> bytestream,
const FileTransferOptions& = FileTransferOptions()) = 0;
virtual OutgoingFileTransfer::ref createOutgoingFileTransfer(
const JID& to,
@@ -44,7 +44,7 @@ namespace Swift {
const std::string& description,
const boost::uintmax_t sizeInBytes,
const boost::posix_time::ptime& lastModified,
- boost::shared_ptr<ReadBytestream> bytestream,
+ std::shared_ptr<ReadBytestream> bytestream,
const FileTransferOptions& = FileTransferOptions()) = 0;
static bool isSupportedBy(const DiscoInfo::ref info);
diff --git a/Swiften/FileTransfer/FileTransferManagerImpl.cpp b/Swiften/FileTransfer/FileTransferManagerImpl.cpp
index 80993ef..d449179 100644
--- a/Swiften/FileTransfer/FileTransferManagerImpl.cpp
+++ b/Swiften/FileTransfer/FileTransferManagerImpl.cpp
@@ -125,7 +125,7 @@ OutgoingFileTransfer::ref FileTransferManagerImpl::createOutgoingFileTransfer(
const JID& to,
const boost::filesystem::path& filepath,
const std::string& description,
- boost::shared_ptr<ReadBytestream> bytestream,
+ std::shared_ptr<ReadBytestream> bytestream,
const FileTransferOptions& config) {
#if BOOST_FILESYSTEM_VERSION == 2 // TODO: Delete this when boost 1.44 becomes a minimum requirement, and we no longer need v2
std::string filename = filepath.filename();
@@ -144,7 +144,7 @@ OutgoingFileTransfer::ref FileTransferManagerImpl::createOutgoingFileTransfer(
const std::string& description,
const boost::uintmax_t sizeInBytes,
const boost::posix_time::ptime& lastModified,
- boost::shared_ptr<ReadBytestream> bytestream,
+ std::shared_ptr<ReadBytestream> bytestream,
const FileTransferOptions& config) {
JingleFileTransferFileInfo fileInfo;
fileInfo.setDate(lastModified);
diff --git a/Swiften/FileTransfer/FileTransferManagerImpl.h b/Swiften/FileTransfer/FileTransferManagerImpl.h
index a939ace..3566e92 100644
--- a/Swiften/FileTransfer/FileTransferManagerImpl.h
+++ b/Swiften/FileTransfer/FileTransferManagerImpl.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2013-2015 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -71,7 +71,7 @@ namespace Swift {
const JID& to,
const boost::filesystem::path& filepath,
const std::string& description,
- boost::shared_ptr<ReadBytestream> bytestream,
+ std::shared_ptr<ReadBytestream> bytestream,
const FileTransferOptions&) SWIFTEN_OVERRIDE;
OutgoingFileTransfer::ref createOutgoingFileTransfer(
const JID& to,
@@ -79,7 +79,7 @@ namespace Swift {
const std::string& description,
const boost::uintmax_t sizeInBytes,
const boost::posix_time::ptime& lastModified,
- boost::shared_ptr<ReadBytestream> bytestream,
+ std::shared_ptr<ReadBytestream> bytestream,
const FileTransferOptions&) SWIFTEN_OVERRIDE;
void start();
diff --git a/Swiften/FileTransfer/FileTransferTransporter.h b/Swiften/FileTransfer/FileTransferTransporter.h
index dc12b0e..a680ca2 100644
--- a/Swiften/FileTransfer/FileTransferTransporter.h
+++ b/Swiften/FileTransfer/FileTransferTransporter.h
@@ -40,21 +40,21 @@ namespace Swift {
virtual void startActivatingProxy(const JID& proxy) = 0;
virtual void stopActivatingProxy() = 0;
- virtual boost::shared_ptr<TransportSession> createIBBSendSession(
- const std::string& sessionID, unsigned int blockSize, boost::shared_ptr<ReadBytestream>) = 0;
- virtual boost::shared_ptr<TransportSession> createIBBReceiveSession(
- const std::string& sessionID, unsigned long long size, boost::shared_ptr<WriteBytestream>) = 0;
- virtual boost::shared_ptr<TransportSession> createRemoteCandidateSession(
- boost::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& candidate) = 0;
- virtual boost::shared_ptr<TransportSession> createRemoteCandidateSession(
- boost::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& candidate) = 0;
- virtual boost::shared_ptr<TransportSession> createLocalCandidateSession(
- boost::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& candidate) = 0;
- virtual boost::shared_ptr<TransportSession> createLocalCandidateSession(
- boost::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& candidate) = 0;
+ virtual std::shared_ptr<TransportSession> createIBBSendSession(
+ const std::string& sessionID, unsigned int blockSize, std::shared_ptr<ReadBytestream>) = 0;
+ virtual std::shared_ptr<TransportSession> createIBBReceiveSession(
+ const std::string& sessionID, unsigned long long size, std::shared_ptr<WriteBytestream>) = 0;
+ virtual std::shared_ptr<TransportSession> createRemoteCandidateSession(
+ std::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& candidate) = 0;
+ virtual std::shared_ptr<TransportSession> createRemoteCandidateSession(
+ std::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& candidate) = 0;
+ virtual std::shared_ptr<TransportSession> createLocalCandidateSession(
+ std::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& candidate) = 0;
+ virtual std::shared_ptr<TransportSession> createLocalCandidateSession(
+ std::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& candidate) = 0;
boost::signal<void (const std::string& /* sessionID */, const std::vector<JingleS5BTransportPayload::Candidate>&, const std::string& /* dstAddr */)> onLocalCandidatesGenerated;
boost::signal<void (const std::string& /* sessionID */, const boost::optional<JingleS5BTransportPayload::Candidate>&)> onRemoteCandidateSelectFinished;
- boost::signal<void (const std::string& /* sessionID */, boost::shared_ptr<ErrorPayload>)> onProxyActivated;
+ boost::signal<void (const std::string& /* sessionID */, std::shared_ptr<ErrorPayload>)> onProxyActivated;
};
}
diff --git a/Swiften/FileTransfer/IBBReceiveSession.cpp b/Swiften/FileTransfer/IBBReceiveSession.cpp
index 5a29ccb..24996ed 100644
--- a/Swiften/FileTransfer/IBBReceiveSession.cpp
+++ b/Swiften/FileTransfer/IBBReceiveSession.cpp
@@ -72,7 +72,7 @@ IBBReceiveSession::IBBReceiveSession(
const JID& from,
const JID& to,
unsigned long long size,
- boost::shared_ptr<WriteBytestream> bytestream,
+ std::shared_ptr<WriteBytestream> bytestream,
IQRouter* router) :
id(id),
from(from),
diff --git a/Swiften/FileTransfer/IBBReceiveSession.h b/Swiften/FileTransfer/IBBReceiveSession.h
index 3eec96e..c383455 100644
--- a/Swiften/FileTransfer/IBBReceiveSession.h
+++ b/Swiften/FileTransfer/IBBReceiveSession.h
@@ -6,8 +6,9 @@
#pragma once
+#include <memory>
+
#include <boost/optional/optional_fwd.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -26,7 +27,7 @@ namespace Swift {
const JID& from,
const JID& to,
unsigned long long size,
- boost::shared_ptr<WriteBytestream> bytestream,
+ std::shared_ptr<WriteBytestream> bytestream,
IQRouter* router);
~IBBReceiveSession();
@@ -55,7 +56,7 @@ namespace Swift {
JID from;
JID to;
unsigned long long size;
- boost::shared_ptr<WriteBytestream> bytestream;
+ std::shared_ptr<WriteBytestream> bytestream;
IQRouter* router;
IBBResponder* responder;
bool active;
diff --git a/Swiften/FileTransfer/IBBReceiveTransportSession.cpp b/Swiften/FileTransfer/IBBReceiveTransportSession.cpp
index 2e19b75..6e47ac6 100644
--- a/Swiften/FileTransfer/IBBReceiveTransportSession.cpp
+++ b/Swiften/FileTransfer/IBBReceiveTransportSession.cpp
@@ -10,7 +10,7 @@
namespace Swift {
-IBBReceiveTransportSession::IBBReceiveTransportSession(boost::shared_ptr<IBBReceiveSession> session) : session(session) {
+IBBReceiveTransportSession::IBBReceiveTransportSession(std::shared_ptr<IBBReceiveSession> session) : session(session) {
finishedConnection = session->onFinished.connect(boost::bind(boost::ref(onFinished), _1));
}
diff --git a/Swiften/FileTransfer/IBBReceiveTransportSession.h b/Swiften/FileTransfer/IBBReceiveTransportSession.h
index f66731b..65488d9 100644
--- a/Swiften/FileTransfer/IBBReceiveTransportSession.h
+++ b/Swiften/FileTransfer/IBBReceiveTransportSession.h
@@ -15,14 +15,14 @@ namespace Swift {
class SWIFTEN_API IBBReceiveTransportSession : public TransportSession {
public:
- IBBReceiveTransportSession(boost::shared_ptr<IBBReceiveSession> session);
+ IBBReceiveTransportSession(std::shared_ptr<IBBReceiveSession> session);
virtual ~IBBReceiveTransportSession();
virtual void start() SWIFTEN_OVERRIDE;
virtual void stop() SWIFTEN_OVERRIDE;
private:
- boost::shared_ptr<IBBReceiveSession> session;
+ std::shared_ptr<IBBReceiveSession> session;
boost::bsignals::scoped_connection finishedConnection;
boost::bsignals::scoped_connection bytesSentConnection;
};
diff --git a/Swiften/FileTransfer/IBBRequest.h b/Swiften/FileTransfer/IBBRequest.h
index 165dd21..67bd33a 100644
--- a/Swiften/FileTransfer/IBBRequest.h
+++ b/Swiften/FileTransfer/IBBRequest.h
@@ -13,14 +13,14 @@
namespace Swift {
class SWIFTEN_API IBBRequest : public GenericRequest<IBB> {
public:
- typedef boost::shared_ptr<IBBRequest> ref;
+ typedef std::shared_ptr<IBBRequest> ref;
- static ref create(const JID& from, const JID& to, boost::shared_ptr<IBB> payload, IQRouter* router) {
+ static ref create(const JID& from, const JID& to, std::shared_ptr<IBB> payload, IQRouter* router) {
return ref(new IBBRequest(from, to, payload, router));
}
private:
- IBBRequest(const JID& from, const JID& to, boost::shared_ptr<IBB> payload, IQRouter* router) : GenericRequest<IBB>(IQ::Set, from, to, payload, router) {
+ IBBRequest(const JID& from, const JID& to, std::shared_ptr<IBB> payload, IQRouter* router) : GenericRequest<IBB>(IQ::Set, from, to, payload, router) {
}
};
}
diff --git a/Swiften/FileTransfer/IBBSendSession.cpp b/Swiften/FileTransfer/IBBSendSession.cpp
index 10a36a9..e51c91c 100644
--- a/Swiften/FileTransfer/IBBSendSession.cpp
+++ b/Swiften/FileTransfer/IBBSendSession.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -20,7 +20,7 @@ IBBSendSession::IBBSendSession(
const std::string& id,
const JID& from,
const JID& to,
- boost::shared_ptr<ReadBytestream> bytestream,
+ std::shared_ptr<ReadBytestream> bytestream,
IQRouter* router) :
id(id),
from(from),
@@ -75,7 +75,7 @@ void IBBSendSession::handleIBBResponse(IBB::ref, ErrorPayload::ref error) {
void IBBSendSession::sendMoreData() {
try {
- boost::shared_ptr<ByteArray> data = bytestream->read(blockSize);
+ std::shared_ptr<ByteArray> data = bytestream->read(blockSize);
if (!data->empty()) {
waitingForData = false;
IBBRequest::ref request = IBBRequest::create(from, to, IBB::createIBBData(id, sequenceNumber, *data), router);
diff --git a/Swiften/FileTransfer/IBBSendSession.h b/Swiften/FileTransfer/IBBSendSession.h
index e62ef79..7988398 100644
--- a/Swiften/FileTransfer/IBBSendSession.h
+++ b/Swiften/FileTransfer/IBBSendSession.h
@@ -1,13 +1,14 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -27,7 +28,7 @@ namespace Swift {
const std::string& id,
const JID& from,
const JID& to,
- boost::shared_ptr<ReadBytestream> bytestream,
+ std::shared_ptr<ReadBytestream> bytestream,
IQRouter* router);
~IBBSendSession();
@@ -59,12 +60,12 @@ namespace Swift {
std::string id;
JID from;
JID to;
- boost::shared_ptr<ReadBytestream> bytestream;
+ std::shared_ptr<ReadBytestream> bytestream;
IQRouter* router;
unsigned int blockSize;
int sequenceNumber;
bool active;
bool waitingForData;
- boost::shared_ptr<IBBRequest> currentRequest;
+ std::shared_ptr<IBBRequest> currentRequest;
};
}
diff --git a/Swiften/FileTransfer/IBBSendTransportSession.cpp b/Swiften/FileTransfer/IBBSendTransportSession.cpp
index fd2d8e6..81972c9 100644
--- a/Swiften/FileTransfer/IBBSendTransportSession.cpp
+++ b/Swiften/FileTransfer/IBBSendTransportSession.cpp
@@ -10,7 +10,7 @@
namespace Swift {
-IBBSendTransportSession::IBBSendTransportSession(boost::shared_ptr<IBBSendSession> session) : session(session) {
+IBBSendTransportSession::IBBSendTransportSession(std::shared_ptr<IBBSendSession> session) : session(session) {
finishedConnection = session->onFinished.connect(boost::bind(boost::ref(onFinished), _1));
bytesSentConnection = session->onBytesSent.connect(boost::bind(boost::ref(onBytesSent), _1));
}
diff --git a/Swiften/FileTransfer/IBBSendTransportSession.h b/Swiften/FileTransfer/IBBSendTransportSession.h
index 812c42e..5b55215 100644
--- a/Swiften/FileTransfer/IBBSendTransportSession.h
+++ b/Swiften/FileTransfer/IBBSendTransportSession.h
@@ -15,14 +15,14 @@ namespace Swift {
class SWIFTEN_API IBBSendTransportSession : public TransportSession {
public:
- IBBSendTransportSession(boost::shared_ptr<IBBSendSession> session);
+ IBBSendTransportSession(std::shared_ptr<IBBSendSession> session);
virtual ~IBBSendTransportSession();
virtual void start() SWIFTEN_OVERRIDE;
virtual void stop() SWIFTEN_OVERRIDE;
private:
- boost::shared_ptr<IBBSendSession> session;
+ std::shared_ptr<IBBSendSession> session;
boost::bsignals::scoped_connection finishedConnection;
boost::bsignals::scoped_connection bytesSentConnection;
};
diff --git a/Swiften/FileTransfer/IncomingFileTransfer.h b/Swiften/FileTransfer/IncomingFileTransfer.h
index 4cb18e8..2976216 100644
--- a/Swiften/FileTransfer/IncomingFileTransfer.h
+++ b/Swiften/FileTransfer/IncomingFileTransfer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -23,12 +23,12 @@ namespace Swift {
*/
class SWIFTEN_API IncomingFileTransfer : public FileTransfer {
public:
- typedef boost::shared_ptr<IncomingFileTransfer> ref;
+ typedef std::shared_ptr<IncomingFileTransfer> ref;
virtual ~IncomingFileTransfer();
virtual void accept(
- boost::shared_ptr<WriteBytestream>,
+ std::shared_ptr<WriteBytestream>,
const FileTransferOptions& = FileTransferOptions()) = 0;
virtual const JID& getSender() const = 0;
diff --git a/Swiften/FileTransfer/IncomingFileTransferManager.cpp b/Swiften/FileTransfer/IncomingFileTransferManager.cpp
index b0b4d49..1c2b788 100644
--- a/Swiften/FileTransfer/IncomingFileTransferManager.cpp
+++ b/Swiften/FileTransfer/IncomingFileTransferManager.cpp
@@ -6,7 +6,7 @@
#include <Swiften/FileTransfer/IncomingFileTransferManager.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/Log.h>
#include <Swiften/Elements/JingleDescription.h>
@@ -43,7 +43,7 @@ bool IncomingFileTransferManager::handleIncomingJingleSession(
if (content->getTransport<JingleS5BTransportPayload>() || content->getTransport<JingleIBBTransportPayload>()) {
JingleFileTransferDescription::ref description = content->getDescription<JingleFileTransferDescription>();
if (description) {
- IncomingJingleFileTransfer::ref transfer = boost::make_shared<IncomingJingleFileTransfer>(
+ IncomingJingleFileTransfer::ref transfer = std::make_shared<IncomingJingleFileTransfer>(
recipient, session, content, transporterFactory, timerFactory, crypto);
onIncomingFileTransfer(transfer);
}
diff --git a/Swiften/FileTransfer/IncomingFileTransferManager.h b/Swiften/FileTransfer/IncomingFileTransferManager.h
index 7a34b2a..fa1b3bb 100644
--- a/Swiften/FileTransfer/IncomingFileTransferManager.h
+++ b/Swiften/FileTransfer/IncomingFileTransferManager.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
diff --git a/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp b/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp
index 526c54c..f73cd38 100644
--- a/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp
+++ b/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp
@@ -6,10 +6,10 @@
#include <Swiften/FileTransfer/IncomingJingleFileTransfer.h>
+#include <memory>
#include <set>
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Log.h>
#include <Swiften/Base/foreach.h>
@@ -66,7 +66,7 @@ IncomingJingleFileTransfer::~IncomingJingleFileTransfer() {
}
void IncomingJingleFileTransfer::accept(
- boost::shared_ptr<WriteBytestream> stream,
+ std::shared_ptr<WriteBytestream> stream,
const FileTransferOptions& options) {
SWIFT_LOG(debug) << std::endl;
if (state != Initial) { SWIFT_LOG(warning) << "Incorrect state" << std::endl; return; }
@@ -126,7 +126,7 @@ void IncomingJingleFileTransfer::handleLocalTransportCandidatesGenerated(
fillCandidateMap(localCandidates, candidates);
- JingleS5BTransportPayload::ref transport = boost::make_shared<JingleS5BTransportPayload>();
+ JingleS5BTransportPayload::ref transport = std::make_shared<JingleS5BTransportPayload>();
transport->setSessionID(s5bSessionID);
transport->setMode(JingleS5BTransportPayload::TCPMode);
transport->setDstAddr(dstAddr);
@@ -233,7 +233,7 @@ void IncomingJingleFileTransfer::handleTransportReplaceReceived(
}
JingleIBBTransportPayload::ref ibbTransport;
- if (options.isInBandAllowed() && (ibbTransport = boost::dynamic_pointer_cast<JingleIBBTransportPayload>(transport))) {
+ if (options.isInBandAllowed() && (ibbTransport = std::dynamic_pointer_cast<JingleIBBTransportPayload>(transport))) {
SWIFT_LOG(debug) << "transport replaced with IBB" << std::endl;
startTransferring(transporter->createIBBReceiveSession(
@@ -379,7 +379,7 @@ void IncomingJingleFileTransfer::startTransferViaLocalCandidate() {
}
}
-void IncomingJingleFileTransfer::startTransferring(boost::shared_ptr<TransportSession> transportSession) {
+void IncomingJingleFileTransfer::startTransferring(std::shared_ptr<TransportSession> transportSession) {
SWIFT_LOG(debug) << std::endl;
this->transportSession = transportSession;
@@ -401,11 +401,11 @@ bool IncomingJingleFileTransfer::isTryingCandidates() const {
return state == TryingCandidates;
}
-boost::shared_ptr<TransportSession> IncomingJingleFileTransfer::createLocalCandidateSession() {
+std::shared_ptr<TransportSession> IncomingJingleFileTransfer::createLocalCandidateSession() {
return transporter->createLocalCandidateSession(stream, theirCandidateChoice.get());
}
-boost::shared_ptr<TransportSession> IncomingJingleFileTransfer::createRemoteCandidateSession() {
+std::shared_ptr<TransportSession> IncomingJingleFileTransfer::createRemoteCandidateSession() {
return transporter->createRemoteCandidateSession(stream, ourCandidateChoice.get());
}
diff --git a/Swiften/FileTransfer/IncomingJingleFileTransfer.h b/Swiften/FileTransfer/IncomingJingleFileTransfer.h
index d3cc331..36b76b1 100644
--- a/Swiften/FileTransfer/IncomingJingleFileTransfer.h
+++ b/Swiften/FileTransfer/IncomingJingleFileTransfer.h
@@ -6,10 +6,10 @@
#pragma once
+#include <memory>
#include <string>
#include <boost/cstdint.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/ByteArray.h>
@@ -42,18 +42,18 @@ namespace Swift {
*/
class SWIFTEN_API IncomingJingleFileTransfer : public IncomingFileTransfer, public JingleFileTransfer {
public:
- typedef boost::shared_ptr<IncomingJingleFileTransfer> ref;
+ typedef std::shared_ptr<IncomingJingleFileTransfer> ref;
IncomingJingleFileTransfer(
const JID& recipient,
- boost::shared_ptr<JingleSession>,
- boost::shared_ptr<JingleContentPayload> content,
+ std::shared_ptr<JingleSession>,
+ std::shared_ptr<JingleContentPayload> content,
FileTransferTransporterFactory*,
TimerFactory*,
CryptoProvider*);
virtual ~IncomingJingleFileTransfer();
- virtual void accept(boost::shared_ptr<WriteBytestream>, const FileTransferOptions& = FileTransferOptions()) SWIFTEN_OVERRIDE;
+ virtual void accept(std::shared_ptr<WriteBytestream>, const FileTransferOptions& = FileTransferOptions()) SWIFTEN_OVERRIDE;
virtual void cancel() SWIFTEN_OVERRIDE;
private:
@@ -71,9 +71,9 @@ namespace Swift {
virtual void handleSessionTerminateReceived(
boost::optional<JinglePayload::Reason> reason) SWIFTEN_OVERRIDE;
- virtual void handleSessionInfoReceived(boost::shared_ptr<JinglePayload>) SWIFTEN_OVERRIDE;
+ virtual void handleSessionInfoReceived(std::shared_ptr<JinglePayload>) SWIFTEN_OVERRIDE;
virtual void handleTransportReplaceReceived(
- const JingleContentID&, boost::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
+ const JingleContentID&, std::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
virtual void handleLocalTransportCandidatesGenerated(
const std::string& s5bSessionID,
@@ -101,24 +101,24 @@ namespace Swift {
static FileTransfer::State::Type getExternalState(State state);
virtual bool hasPriorityOnCandidateTie() const SWIFTEN_OVERRIDE;
virtual void fallback() SWIFTEN_OVERRIDE;
- virtual void startTransferring(boost::shared_ptr<TransportSession>) SWIFTEN_OVERRIDE;
+ virtual void startTransferring(std::shared_ptr<TransportSession>) SWIFTEN_OVERRIDE;
virtual bool isWaitingForPeerProxyActivate() const SWIFTEN_OVERRIDE;
virtual bool isWaitingForLocalProxyActivate() const SWIFTEN_OVERRIDE;
virtual bool isTryingCandidates() const SWIFTEN_OVERRIDE;
- virtual boost::shared_ptr<TransportSession> createLocalCandidateSession() SWIFTEN_OVERRIDE;
- virtual boost::shared_ptr<TransportSession> createRemoteCandidateSession() SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<TransportSession> createLocalCandidateSession() SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<TransportSession> createRemoteCandidateSession() SWIFTEN_OVERRIDE;
virtual void terminate(JinglePayload::Reason::Type reason) SWIFTEN_OVERRIDE;
private:
- boost::shared_ptr<JingleContentPayload> initialContent;
+ std::shared_ptr<JingleContentPayload> initialContent;
CryptoProvider* crypto;
State state;
- boost::shared_ptr<JingleFileTransferDescription> description;
- boost::shared_ptr<WriteBytestream> stream;
+ std::shared_ptr<JingleFileTransferDescription> description;
+ std::shared_ptr<WriteBytestream> stream;
boost::uintmax_t receivedBytes;
IncrementalBytestreamHashCalculator* hashCalculator;
- boost::shared_ptr<Timer> waitOnHashTimer;
+ std::shared_ptr<Timer> waitOnHashTimer;
std::map<std::string, ByteArray> hashes;
FileTransferOptions options;
diff --git a/Swiften/FileTransfer/JingleFileTransfer.cpp b/Swiften/FileTransfer/JingleFileTransfer.cpp
index 53977ec..36725de 100644
--- a/Swiften/FileTransfer/JingleFileTransfer.cpp
+++ b/Swiften/FileTransfer/JingleFileTransfer.cpp
@@ -19,7 +19,7 @@
using namespace Swift;
JingleFileTransfer::JingleFileTransfer(
- boost::shared_ptr<JingleSession> session,
+ std::shared_ptr<JingleSession> session,
const JID& target,
FileTransferTransporterFactory* transporterFactory) :
session(session),
@@ -87,7 +87,7 @@ void JingleFileTransfer::handleRemoteTransportCandidateSelectFinished(
ourCandidateChoice = candidate;
ourCandidateSelectFinished = true;
- JingleS5BTransportPayload::ref s5bPayload = boost::make_shared<JingleS5BTransportPayload>();
+ JingleS5BTransportPayload::ref s5bPayload = std::make_shared<JingleS5BTransportPayload>();
s5bPayload->setSessionID(s5bSessionID);
if (candidate) {
s5bPayload->setCandidateUsed(candidate->cid);
@@ -151,14 +151,14 @@ void JingleFileTransfer::handleProxyActivateFinished(
if (error) {
SWIFT_LOG(debug) << "Error activating proxy" << std::endl;
- JingleS5BTransportPayload::ref proxyError = boost::make_shared<JingleS5BTransportPayload>();
+ JingleS5BTransportPayload::ref proxyError = std::make_shared<JingleS5BTransportPayload>();
proxyError->setSessionID(s5bSessionID);
proxyError->setProxyError(true);
session->sendTransportInfo(getContentID(), proxyError);
fallback();
}
else {
- JingleS5BTransportPayload::ref proxyActivate = boost::make_shared<JingleS5BTransportPayload>();
+ JingleS5BTransportPayload::ref proxyActivate = std::make_shared<JingleS5BTransportPayload>();
proxyActivate->setSessionID(s5bSessionID);
proxyActivate->setActivated(theirCandidateChoice->cid);
session->sendTransportInfo(getContentID(), proxyActivate);
@@ -170,7 +170,7 @@ void JingleFileTransfer::handleTransportInfoReceived(
const JingleContentID& /* contentID */, JingleTransportPayload::ref transport) {
SWIFT_LOG(debug) << std::endl;
- if (JingleS5BTransportPayload::ref s5bPayload = boost::dynamic_pointer_cast<JingleS5BTransportPayload>(transport)) {
+ if (JingleS5BTransportPayload::ref s5bPayload = std::dynamic_pointer_cast<JingleS5BTransportPayload>(transport)) {
if (s5bPayload->hasCandidateError() || !s5bPayload->getCandidateUsed().empty()) {
SWIFT_LOG(debug) << "Received candidate decision from peer" << std::endl;
if (!isTryingCandidates()) { SWIFT_LOG(warning) << "Incorrect state" << std::endl; return; }
diff --git a/Swiften/FileTransfer/JingleFileTransfer.h b/Swiften/FileTransfer/JingleFileTransfer.h
index 6862ba2..8a80e06 100644
--- a/Swiften/FileTransfer/JingleFileTransfer.h
+++ b/Swiften/FileTransfer/JingleFileTransfer.h
@@ -1,15 +1,14 @@
/*
- * Copyright (c) 2013-2015 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/ErrorPayload.h>
@@ -31,7 +30,7 @@ namespace Swift {
class SWIFTEN_API JingleFileTransfer : public AbstractJingleSessionListener {
public:
JingleFileTransfer(
- boost::shared_ptr<JingleSession>,
+ std::shared_ptr<JingleSession>,
const JID& target,
FileTransferTransporterFactory*);
virtual ~JingleFileTransfer();
@@ -49,15 +48,15 @@ namespace Swift {
void handleRemoteTransportCandidateSelectFinished(
const std::string& s5bSessionID, const boost::optional<JingleS5BTransportPayload::Candidate>&);
virtual JingleContentID getContentID() const = 0;
- virtual void startTransferring(boost::shared_ptr<TransportSession>) = 0;
+ virtual void startTransferring(std::shared_ptr<TransportSession>) = 0;
virtual void terminate(JinglePayload::Reason::Type reason) = 0;
virtual void fallback() = 0;
virtual bool hasPriorityOnCandidateTie() const = 0;
virtual bool isWaitingForPeerProxyActivate() const = 0;
virtual bool isWaitingForLocalProxyActivate() const = 0;
virtual bool isTryingCandidates() const = 0;
- virtual boost::shared_ptr<TransportSession> createLocalCandidateSession() = 0;
- virtual boost::shared_ptr<TransportSession> createRemoteCandidateSession() = 0;
+ virtual std::shared_ptr<TransportSession> createLocalCandidateSession() = 0;
+ virtual std::shared_ptr<TransportSession> createRemoteCandidateSession() = 0;
virtual void startTransferViaLocalCandidate() = 0;
virtual void startTransferViaRemoteCandidate() = 0;
@@ -75,7 +74,7 @@ namespace Swift {
static FileTransfer::State::Type getExternalFinishedState(JinglePayload::Reason::Type);
static boost::optional<FileTransferError> getFileTransferError(JinglePayload::Reason::Type);
- boost::shared_ptr<JingleSession> session;
+ std::shared_ptr<JingleSession> session;
JID target;
FileTransferTransporterFactory* transporterFactory;
FileTransferTransporter* transporter;
@@ -87,7 +86,7 @@ namespace Swift {
boost::optional<JingleS5BTransportPayload::Candidate> theirCandidateChoice;
CandidateMap localCandidates;
- boost::shared_ptr<TransportSession> transportSession;
+ std::shared_ptr<TransportSession> transportSession;
boost::bsignals::scoped_connection localTransportCandidatesGeneratedConnection;
boost::bsignals::scoped_connection remoteTransportCandidateSelectFinishedConnection;
diff --git a/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp b/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp
index 3703ba1..2975193 100644
--- a/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp
+++ b/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp
@@ -5,18 +5,17 @@
*/
/*
- * Copyright (c) 2013-2015 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.h>
+#include <memory>
#include <vector>
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Log.h>
#include <Swiften/Base/foreach.h>
diff --git a/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.h b/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.h
index 74c6bfb..66b035e 100644
--- a/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.h
+++ b/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.h
@@ -58,9 +58,9 @@ namespace Swift {
SOCKS5BytestreamProxiesManager* s5bProxy;
JID ownJID;
IDGenerator* idGenerator;
- boost::shared_ptr<SOCKS5BytestreamServerInitializeRequest> s5bServerInitializeRequest;
- boost::shared_ptr<SOCKS5BytestreamServerResourceUser> s5bServerResourceUser_;
- boost::shared_ptr<SOCKS5BytestreamServerPortForwardingUser> s5bServerPortForwardingUser_;
+ std::shared_ptr<SOCKS5BytestreamServerInitializeRequest> s5bServerInitializeRequest;
+ std::shared_ptr<SOCKS5BytestreamServerResourceUser> s5bServerResourceUser_;
+ std::shared_ptr<SOCKS5BytestreamServerPortForwardingUser> s5bServerPortForwardingUser_;
bool triedServerInit_;
bool triedForwarding_;
bool triedProxyDiscovery_;
diff --git a/Swiften/FileTransfer/OutgoingFileTransfer.h b/Swiften/FileTransfer/OutgoingFileTransfer.h
index e83a893..07fc6d2 100644
--- a/Swiften/FileTransfer/OutgoingFileTransfer.h
+++ b/Swiften/FileTransfer/OutgoingFileTransfer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/FileTransfer/FileTransfer.h>
@@ -14,7 +14,7 @@
namespace Swift {
class SWIFTEN_API OutgoingFileTransfer : public FileTransfer {
public:
- typedef boost::shared_ptr<OutgoingFileTransfer> ref;
+ typedef std::shared_ptr<OutgoingFileTransfer> ref;
public:
virtual ~OutgoingFileTransfer();
diff --git a/Swiften/FileTransfer/OutgoingFileTransferManager.cpp b/Swiften/FileTransfer/OutgoingFileTransferManager.cpp
index f6d216e..c74aefb 100644
--- a/Swiften/FileTransfer/OutgoingFileTransferManager.cpp
+++ b/Swiften/FileTransfer/OutgoingFileTransferManager.cpp
@@ -12,7 +12,7 @@
#include <Swiften/FileTransfer/OutgoingFileTransferManager.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/IDGenerator.h>
#include <Swiften/FileTransfer/OutgoingJingleFileTransfer.h>
@@ -41,16 +41,16 @@ OutgoingFileTransferManager::~OutgoingFileTransferManager() {
delete idGenerator;
}
-boost::shared_ptr<OutgoingFileTransfer> OutgoingFileTransferManager::createOutgoingFileTransfer(
+std::shared_ptr<OutgoingFileTransfer> OutgoingFileTransferManager::createOutgoingFileTransfer(
const JID& from,
const JID& recipient,
- boost::shared_ptr<ReadBytestream> readBytestream,
+ std::shared_ptr<ReadBytestream> readBytestream,
const JingleFileTransferFileInfo& fileInfo,
const FileTransferOptions& config) {
- JingleSessionImpl::ref jingleSession = boost::make_shared<JingleSessionImpl>(
+ JingleSessionImpl::ref jingleSession = std::make_shared<JingleSessionImpl>(
from, recipient, idGenerator->generateID(), iqRouter);
jingleSessionManager->registerOutgoingSession(from, jingleSession);
- return boost::shared_ptr<OutgoingJingleFileTransfer>(new OutgoingJingleFileTransfer(
+ return std::shared_ptr<OutgoingJingleFileTransfer>(new OutgoingJingleFileTransfer(
recipient,
jingleSession,
readBytestream,
diff --git a/Swiften/FileTransfer/OutgoingFileTransferManager.h b/Swiften/FileTransfer/OutgoingFileTransferManager.h
index 3981005..48a6e5a 100644
--- a/Swiften/FileTransfer/OutgoingFileTransferManager.h
+++ b/Swiften/FileTransfer/OutgoingFileTransferManager.h
@@ -5,14 +5,14 @@
*/
/*
- * Copyright (c) 2013-2015 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
@@ -39,10 +39,10 @@ namespace Swift {
CryptoProvider* crypto);
~OutgoingFileTransferManager();
- boost::shared_ptr<OutgoingFileTransfer> createOutgoingFileTransfer(
+ std::shared_ptr<OutgoingFileTransfer> createOutgoingFileTransfer(
const JID& from,
const JID& to,
- boost::shared_ptr<ReadBytestream>,
+ std::shared_ptr<ReadBytestream>,
const JingleFileTransferFileInfo&,
const FileTransferOptions&);
diff --git a/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp b/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
index c7573c2..fcc160a 100644
--- a/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
+++ b/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
@@ -17,8 +17,9 @@
#include <Swiften/FileTransfer/OutgoingJingleFileTransfer.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <boost/typeof/typeof.hpp>
#include <Swiften/Base/IDGenerator.h>
@@ -46,7 +47,7 @@ static const int DEFAULT_BLOCK_SIZE = 4096;
OutgoingJingleFileTransfer::OutgoingJingleFileTransfer(
const JID& toJID,
JingleSession::ref session,
- boost::shared_ptr<ReadBytestream> stream,
+ std::shared_ptr<ReadBytestream> stream,
FileTransferTransporterFactory* transporterFactory,
TimerFactory* timerFactory,
IDGenerator* idGenerator,
@@ -125,12 +126,12 @@ void OutgoingJingleFileTransfer::handleSessionAcceptReceived(
SWIFT_LOG(debug) << std::endl;
if (state != WaitingForAccept) { SWIFT_LOG(warning) << "Incorrect state" << std::endl; return; }
- if (JingleS5BTransportPayload::ref s5bPayload = boost::dynamic_pointer_cast<JingleS5BTransportPayload>(transportPayload)) {
+ if (JingleS5BTransportPayload::ref s5bPayload = std::dynamic_pointer_cast<JingleS5BTransportPayload>(transportPayload)) {
transporter->addRemoteCandidates(s5bPayload->getCandidates(), s5bPayload->getDstAddr());
setInternalState(TryingCandidates);
transporter->startTryingRemoteCandidates();
}
- else if (JingleIBBTransportPayload::ref ibbPayload = boost::dynamic_pointer_cast<JingleIBBTransportPayload>(transportPayload)) {
+ else if (JingleIBBTransportPayload::ref ibbPayload = std::dynamic_pointer_cast<JingleIBBTransportPayload>(transportPayload)) {
startTransferring(transporter->createIBBSendSession(ibbPayload->getSessionID(), ibbPayload->getBlockSize().get_value_or(DEFAULT_BLOCK_SIZE), stream));
}
else {
@@ -165,7 +166,7 @@ void OutgoingJingleFileTransfer::handleTransportAcceptReceived(const JingleConte
SWIFT_LOG(debug) << std::endl;
if (state != FallbackRequested) { SWIFT_LOG(warning) << "Incorrect state" << std::endl; return; }
- if (JingleIBBTransportPayload::ref ibbPayload = boost::dynamic_pointer_cast<JingleIBBTransportPayload>(transport)) {
+ if (JingleIBBTransportPayload::ref ibbPayload = std::dynamic_pointer_cast<JingleIBBTransportPayload>(transport)) {
startTransferring(transporter->createIBBSendSession(ibbPayload->getSessionID(), ibbPayload->getBlockSize().get_value_or(DEFAULT_BLOCK_SIZE), stream));
}
else {
@@ -174,7 +175,7 @@ void OutgoingJingleFileTransfer::handleTransportAcceptReceived(const JingleConte
}
}
-void OutgoingJingleFileTransfer::handleTransportRejectReceived(const JingleContentID &, boost::shared_ptr<JingleTransportPayload>) {
+void OutgoingJingleFileTransfer::handleTransportRejectReceived(const JingleContentID &, std::shared_ptr<JingleTransportPayload>) {
SWIFT_LOG(debug) << std::endl;
terminate(JinglePayload::Reason::UnsupportedTransports);
@@ -183,7 +184,7 @@ void OutgoingJingleFileTransfer::handleTransportRejectReceived(const JingleConte
void OutgoingJingleFileTransfer::sendSessionInfoHash() {
SWIFT_LOG(debug) << std::endl;
- JingleFileTransferHash::ref hashElement = boost::make_shared<JingleFileTransferHash>();
+ JingleFileTransferHash::ref hashElement = std::make_shared<JingleFileTransferHash>();
hashElement->getFileInfo().addHash(HashElement("sha-1", hashCalculator->getSHA1Hash()));
hashElement->getFileInfo().addHash(HashElement("md5", hashCalculator->getMD5Hash()));
session->sendInfo(hashElement);
@@ -196,7 +197,7 @@ void OutgoingJingleFileTransfer::handleLocalTransportCandidatesGenerated(
fillCandidateMap(localCandidates, candidates);
- JingleFileTransferDescription::ref description = boost::make_shared<JingleFileTransferDescription>();
+ JingleFileTransferDescription::ref description = std::make_shared<JingleFileTransferDescription>();
fileInfo.addHash(HashElement("sha-1", ByteArray()));
fileInfo.addHash(HashElement("md5", ByteArray()));
description->setFileInfo(fileInfo);
@@ -204,13 +205,13 @@ void OutgoingJingleFileTransfer::handleLocalTransportCandidatesGenerated(
JingleTransportPayload::ref transport;
if (candidates.empty()) {
SWIFT_LOG(debug) << "no S5B candidates generated. Send IBB transport candidate." << std::endl;
- JingleIBBTransportPayload::ref ibbTransport = boost::make_shared<JingleIBBTransportPayload>();
+ JingleIBBTransportPayload::ref ibbTransport = std::make_shared<JingleIBBTransportPayload>();
ibbTransport->setBlockSize(DEFAULT_BLOCK_SIZE);
ibbTransport->setSessionID(idGenerator->generateID());
transport = ibbTransport;
}
else {
- JingleS5BTransportPayload::ref s5bTransport = boost::make_shared<JingleS5BTransportPayload>();
+ JingleS5BTransportPayload::ref s5bTransport = std::make_shared<JingleS5BTransportPayload>();
s5bTransport->setSessionID(s5bSessionID);
s5bTransport->setMode(JingleS5BTransportPayload::TCPMode);
s5bTransport->setDstAddr(dstAddr);
@@ -227,7 +228,7 @@ void OutgoingJingleFileTransfer::handleLocalTransportCandidatesGenerated(
void OutgoingJingleFileTransfer::fallback() {
if (options.isInBandAllowed()) {
SWIFT_LOG(debug) << "Trying to fallback to IBB transport." << std::endl;
- JingleIBBTransportPayload::ref ibbTransport = boost::make_shared<JingleIBBTransportPayload>();
+ JingleIBBTransportPayload::ref ibbTransport = std::make_shared<JingleIBBTransportPayload>();
ibbTransport->setBlockSize(DEFAULT_BLOCK_SIZE);
ibbTransport->setSessionID(idGenerator->generateID());
setInternalState(FallbackRequested);
@@ -255,7 +256,7 @@ void OutgoingJingleFileTransfer::handleTransferFinished(boost::optional<FileTran
}
}
-void OutgoingJingleFileTransfer::startTransferring(boost::shared_ptr<TransportSession> transportSession) {
+void OutgoingJingleFileTransfer::startTransferring(std::shared_ptr<TransportSession> transportSession) {
SWIFT_LOG(debug) << std::endl;
this->transportSession = transportSession;
@@ -390,11 +391,11 @@ bool OutgoingJingleFileTransfer::isTryingCandidates() const {
return state == TryingCandidates;
}
-boost::shared_ptr<TransportSession> OutgoingJingleFileTransfer::createLocalCandidateSession() {
+std::shared_ptr<TransportSession> OutgoingJingleFileTransfer::createLocalCandidateSession() {
return transporter->createLocalCandidateSession(stream, theirCandidateChoice.get());
}
-boost::shared_ptr<TransportSession> OutgoingJingleFileTransfer::createRemoteCandidateSession() {
+std::shared_ptr<TransportSession> OutgoingJingleFileTransfer::createRemoteCandidateSession() {
return transporter->createRemoteCandidateSession(stream, ourCandidateChoice.get());
}
diff --git a/Swiften/FileTransfer/OutgoingJingleFileTransfer.h b/Swiften/FileTransfer/OutgoingJingleFileTransfer.h
index a8dad1e..4f28433 100644
--- a/Swiften/FileTransfer/OutgoingJingleFileTransfer.h
+++ b/Swiften/FileTransfer/OutgoingJingleFileTransfer.h
@@ -5,15 +5,16 @@
*/
/*
- * Copyright (c) 2013-2015 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+
#include <boost/optional/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -38,8 +39,8 @@ namespace Swift {
public:
OutgoingJingleFileTransfer(
const JID& to,
- boost::shared_ptr<JingleSession>,
- boost::shared_ptr<ReadBytestream>,
+ std::shared_ptr<JingleSession>,
+ std::shared_ptr<ReadBytestream>,
FileTransferTransporterFactory*,
TimerFactory*,
IDGenerator*,
@@ -66,10 +67,10 @@ namespace Swift {
Finished
};
- virtual void handleSessionAcceptReceived(const JingleContentID&, boost::shared_ptr<JingleDescription>, boost::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
+ virtual void handleSessionAcceptReceived(const JingleContentID&, std::shared_ptr<JingleDescription>, std::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
virtual void handleSessionTerminateReceived(boost::optional<JinglePayload::Reason> reason) SWIFTEN_OVERRIDE;
- virtual void handleTransportAcceptReceived(const JingleContentID&, boost::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
- virtual void handleTransportRejectReceived(const JingleContentID &, boost::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
+ virtual void handleTransportAcceptReceived(const JingleContentID&, std::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
+ virtual void handleTransportRejectReceived(const JingleContentID &, std::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
virtual void startTransferViaRemoteCandidate() SWIFTEN_OVERRIDE;
virtual void startTransferViaLocalCandidate() SWIFTEN_OVERRIDE;
void startTransferringIfCandidateAcknowledged();
@@ -86,14 +87,14 @@ namespace Swift {
void sendSessionInfoHash();
- virtual void startTransferring(boost::shared_ptr<TransportSession>) SWIFTEN_OVERRIDE;
+ virtual void startTransferring(std::shared_ptr<TransportSession>) SWIFTEN_OVERRIDE;
virtual bool hasPriorityOnCandidateTie() const SWIFTEN_OVERRIDE;
virtual bool isWaitingForPeerProxyActivate() const SWIFTEN_OVERRIDE;
virtual bool isWaitingForLocalProxyActivate() const SWIFTEN_OVERRIDE;
virtual bool isTryingCandidates() const SWIFTEN_OVERRIDE;
- virtual boost::shared_ptr<TransportSession> createLocalCandidateSession() SWIFTEN_OVERRIDE;
- virtual boost::shared_ptr<TransportSession> createRemoteCandidateSession() SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<TransportSession> createLocalCandidateSession() SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<TransportSession> createRemoteCandidateSession() SWIFTEN_OVERRIDE;
void handleWaitForRemoteTerminationTimeout();
@@ -105,7 +106,7 @@ namespace Swift {
private:
IDGenerator* idGenerator;
- boost::shared_ptr<ReadBytestream> stream;
+ std::shared_ptr<ReadBytestream> stream;
JingleFileTransferFileInfo fileInfo;
FileTransferOptions options;
JingleContentID contentID;
diff --git a/Swiften/FileTransfer/ReadBytestream.h b/Swiften/FileTransfer/ReadBytestream.h
index e967c53..62542bc 100644
--- a/Swiften/FileTransfer/ReadBytestream.h
+++ b/Swiften/FileTransfer/ReadBytestream.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -22,7 +21,7 @@ namespace Swift {
* Return an empty vector if no more data is available.
* Use onDataAvailable signal for signaling there is data available again.
*/
- virtual boost::shared_ptr< std::vector<unsigned char> > read(size_t size) = 0;
+ virtual std::shared_ptr< std::vector<unsigned char> > read(size_t size) = 0;
virtual bool isFinished() const = 0;
diff --git a/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp b/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp
index 296723e..c29fd5c 100644
--- a/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp
+++ b/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp
@@ -12,8 +12,9 @@
#include <Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Log.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -58,7 +59,7 @@ void RemoteJingleTransportCandidateSelector::tryNextCandidate() {
if (candidates.empty()) {
SWIFT_LOG(debug) << "No more candidates" << std::endl;
onCandidateSelectFinished(
- boost::optional<JingleS5BTransportPayload::Candidate>(), boost::shared_ptr<SOCKS5BytestreamClientSession>());
+ boost::optional<JingleS5BTransportPayload::Candidate>(), std::shared_ptr<SOCKS5BytestreamClientSession>());
}
else {
lastCandidate = candidates.top();
@@ -67,8 +68,8 @@ void RemoteJingleTransportCandidateSelector::tryNextCandidate() {
if ((lastCandidate.type == JingleS5BTransportPayload::Candidate::DirectType && options.isDirectAllowed()) ||
(lastCandidate.type == JingleS5BTransportPayload::Candidate::AssistedType && options.isAssistedAllowed()) ||
(lastCandidate.type == JingleS5BTransportPayload::Candidate::ProxyType && options.isProxiedAllowed())) {
- boost::shared_ptr<Connection> connection = connectionFactory->createConnection();
- s5bSession = boost::make_shared<SOCKS5BytestreamClientSession>(
+ std::shared_ptr<Connection> connection = connectionFactory->createConnection();
+ s5bSession = std::make_shared<SOCKS5BytestreamClientSession>(
connection, lastCandidate.hostPort, socks5DstAddr, timerFactory);
sessionReadyConnection = s5bSession->onSessionReady.connect(
boost::bind(&RemoteJingleTransportCandidateSelector::handleSessionReady, this, _1));
diff --git a/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.h b/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.h
index 5928754..1f24b6a 100644
--- a/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.h
+++ b/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.h
@@ -14,11 +14,10 @@
#include <Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.h>
+#include <memory>
#include <queue>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/JingleS5BTransportPayload.h>
#include <Swiften/FileTransfer/FileTransferOptions.h>
@@ -40,7 +39,7 @@ namespace Swift {
virtual void startSelectingCandidate();
virtual void stopSelectingCandidate();
- boost::signal<void (const boost::optional<JingleS5BTransportPayload::Candidate>&, boost::shared_ptr<SOCKS5BytestreamClientSession>)> onCandidateSelectFinished;
+ boost::signal<void (const boost::optional<JingleS5BTransportPayload::Candidate>&, std::shared_ptr<SOCKS5BytestreamClientSession>)> onCandidateSelectFinished;
private:
void tryNextCandidate();
@@ -54,7 +53,7 @@ namespace Swift {
JingleS5BTransportPayload::Candidate,
std::vector<JingleS5BTransportPayload::Candidate>,
JingleS5BTransportPayload::CompareCandidate> candidates;
- boost::shared_ptr<SOCKS5BytestreamClientSession> s5bSession;
+ std::shared_ptr<SOCKS5BytestreamClientSession> s5bSession;
boost::bsignals::connection sessionReadyConnection;
JingleS5BTransportPayload::Candidate lastCandidate;
std::string socks5DstAddr;
diff --git a/Swiften/FileTransfer/S5BTransportSession.h b/Swiften/FileTransfer/S5BTransportSession.h
index 95143bd..683e9c4 100644
--- a/Swiften/FileTransfer/S5BTransportSession.h
+++ b/Swiften/FileTransfer/S5BTransportSession.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -20,16 +20,16 @@ template <typename T>
class SWIFTEN_API S5BTransportSession : public TransportSession {
public:
S5BTransportSession(
- boost::shared_ptr<T> session,
- boost::shared_ptr<ReadBytestream> readStream) :
+ std::shared_ptr<T> session,
+ std::shared_ptr<ReadBytestream> readStream) :
session(session),
readStream(readStream) {
initialize();
}
S5BTransportSession(
- boost::shared_ptr<T> session,
- boost::shared_ptr<WriteBytestream> writeStream) :
+ std::shared_ptr<T> session,
+ std::shared_ptr<WriteBytestream> writeStream) :
session(session),
writeStream(writeStream) {
initialize();
@@ -58,9 +58,9 @@ class SWIFTEN_API S5BTransportSession : public TransportSession {
}
private:
- boost::shared_ptr<T> session;
- boost::shared_ptr<ReadBytestream> readStream;
- boost::shared_ptr<WriteBytestream> writeStream;
+ std::shared_ptr<T> session;
+ std::shared_ptr<ReadBytestream> readStream;
+ std::shared_ptr<WriteBytestream> writeStream;
boost::bsignals::scoped_connection finishedConnection;
boost::bsignals::scoped_connection bytesSentConnection;
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp b/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp
index 98a0988..5ddd32b 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp
+++ b/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp
@@ -27,7 +27,7 @@
namespace Swift {
SOCKS5BytestreamClientSession::SOCKS5BytestreamClientSession(
- boost::shared_ptr<Connection> connection,
+ std::shared_ptr<Connection> connection,
const HostAddressPort& addressPort,
const std::string& destination,
TimerFactory* timerFactory) :
@@ -161,7 +161,7 @@ void SOCKS5BytestreamClientSession::authenticate() {
state = Authenticating;
}
-void SOCKS5BytestreamClientSession::startReceiving(boost::shared_ptr<WriteBytestream> writeStream) {
+void SOCKS5BytestreamClientSession::startReceiving(std::shared_ptr<WriteBytestream> writeStream) {
if (state == Ready) {
state = Reading;
writeBytestream = writeStream;
@@ -172,7 +172,7 @@ void SOCKS5BytestreamClientSession::startReceiving(boost::shared_ptr<WriteBytest
}
}
-void SOCKS5BytestreamClientSession::startSending(boost::shared_ptr<ReadBytestream> readStream) {
+void SOCKS5BytestreamClientSession::startSending(std::shared_ptr<ReadBytestream> readStream) {
if (state == Ready) {
state = Writing;
readBytestream = readStream;
@@ -191,7 +191,7 @@ HostAddressPort SOCKS5BytestreamClientSession::getAddressPort() const {
void SOCKS5BytestreamClientSession::sendData() {
if (!readBytestream->isFinished()) {
try {
- boost::shared_ptr<ByteArray> dataToSend = readBytestream->read(boost::numeric_cast<size_t>(chunkSize));
+ std::shared_ptr<ByteArray> dataToSend = readBytestream->read(boost::numeric_cast<size_t>(chunkSize));
connection->write(createSafeByteArray(*dataToSend));
onBytesSent(dataToSend->size());
}
@@ -241,7 +241,7 @@ void SOCKS5BytestreamClientSession::handleConnectFinished(bool error) {
}
}
-void SOCKS5BytestreamClientSession::handleDataRead(boost::shared_ptr<SafeByteArray> data) {
+void SOCKS5BytestreamClientSession::handleDataRead(std::shared_ptr<SafeByteArray> data) {
SWIFT_LOG(debug) << "state: " << state << " data.size() = " << data->size() << std::endl;
if (state != Reading) {
append(unprocessedData, *data);
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamClientSession.h b/Swiften/FileTransfer/SOCKS5BytestreamClientSession.h
index 5aea7d0..2a73a79 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamClientSession.h
+++ b/Swiften/FileTransfer/SOCKS5BytestreamClientSession.h
@@ -5,15 +5,16 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/ByteArray.h>
@@ -48,11 +49,11 @@ public:
};
public:
- typedef boost::shared_ptr<SOCKS5BytestreamClientSession> ref;
+ typedef std::shared_ptr<SOCKS5BytestreamClientSession> ref;
public:
SOCKS5BytestreamClientSession(
- boost::shared_ptr<Connection> connection,
+ std::shared_ptr<Connection> connection,
const HostAddressPort&,
const std::string&,
TimerFactory*);
@@ -61,8 +62,8 @@ public:
void start();
void stop();
- void startReceiving(boost::shared_ptr<WriteBytestream>);
- void startSending(boost::shared_ptr<ReadBytestream>);
+ void startReceiving(std::shared_ptr<WriteBytestream>);
+ void startSending(std::shared_ptr<ReadBytestream>);
HostAddressPort getAddressPort() const;
@@ -78,7 +79,7 @@ private:
void authenticate();
void handleConnectFinished(bool error);
- void handleDataRead(boost::shared_ptr<SafeByteArray>);
+ void handleDataRead(std::shared_ptr<SafeByteArray>);
void handleDisconnected(const boost::optional<Connection::Error>&);
void handleWeFailedTimeout();
@@ -87,7 +88,7 @@ private:
void closeConnection();
private:
- boost::shared_ptr<Connection> connection;
+ std::shared_ptr<Connection> connection;
HostAddressPort addressPort;
std::string destination; // hexify(SHA1(sessionID + requester + target))
@@ -97,8 +98,8 @@ private:
ByteArray authenticateAddress;
int chunkSize;
- boost::shared_ptr<WriteBytestream> writeBytestream;
- boost::shared_ptr<ReadBytestream> readBytestream;
+ std::shared_ptr<WriteBytestream> writeBytestream;
+ std::shared_ptr<ReadBytestream> readBytestream;
Timer::ref weFailedTimeout;
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp b/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp
index 881a82d..6a738ee 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp
+++ b/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,8 +13,9 @@
#include <Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Log.h>
#include <Swiften/Base/foreach.h>
@@ -67,13 +68,13 @@ void SOCKS5BytestreamProxiesManager::connectToProxies(const std::string& session
if (localS5BProxies_) {
foreach(S5BProxyRequest::ref proxy, localS5BProxies_.get()) {
- boost::shared_ptr<Connection> conn = connectionFactory_->createConnection();
+ std::shared_ptr<Connection> conn = connectionFactory_->createConnection();
HostAddressPort addressPort = HostAddressPort(proxy->getStreamHost().get().host, proxy->getStreamHost().get().port);
SWIFT_LOG_ASSERT(addressPort.isValid(), warning) << std::endl;
- boost::shared_ptr<SOCKS5BytestreamClientSession> session = boost::make_shared<SOCKS5BytestreamClientSession>(conn, addressPort, sessionID, timerFactory_);
+ std::shared_ptr<SOCKS5BytestreamClientSession> session = std::make_shared<SOCKS5BytestreamClientSession>(conn, addressPort, sessionID, timerFactory_);
JID proxyJid = proxy->getStreamHost().get().jid;
- clientSessions.push_back(std::pair<JID, boost::shared_ptr<SOCKS5BytestreamClientSession> >(proxyJid, session));
+ clientSessions.push_back(std::pair<JID, std::shared_ptr<SOCKS5BytestreamClientSession> >(proxyJid, session));
session->onSessionReady.connect(boost::bind(&SOCKS5BytestreamProxiesManager::handleProxySessionReady, this,sessionID, proxyJid, session, _1));
session->onFinished.connect(boost::bind(&SOCKS5BytestreamProxiesManager::handleProxySessionFinished, this, sessionID, proxyJid, session, _1));
session->start();
@@ -83,14 +84,14 @@ void SOCKS5BytestreamProxiesManager::connectToProxies(const std::string& session
proxySessions_[sessionID] = clientSessions;
}
-boost::shared_ptr<SOCKS5BytestreamClientSession> SOCKS5BytestreamProxiesManager::getProxySessionAndCloseOthers(const JID& proxyJID, const std::string& sessionID) {
+std::shared_ptr<SOCKS5BytestreamClientSession> SOCKS5BytestreamProxiesManager::getProxySessionAndCloseOthers(const JID& proxyJID, const std::string& sessionID) {
// checking parameters
if (proxySessions_.find(sessionID) == proxySessions_.end()) {
- return boost::shared_ptr<SOCKS5BytestreamClientSession>();
+ return std::shared_ptr<SOCKS5BytestreamClientSession>();
}
// get active session
- boost::shared_ptr<SOCKS5BytestreamClientSession> activeSession;
+ std::shared_ptr<SOCKS5BytestreamClientSession> activeSession;
for (ProxyJIDClientSessionVector::iterator i = proxySessions_[sessionID].begin(); i != proxySessions_[sessionID].end(); i++) {
i->second->onSessionReady.disconnect(boost::bind(&SOCKS5BytestreamProxiesManager::handleProxySessionReady, this,sessionID, proxyJID, i->second, _1));
i->second->onFinished.disconnect(boost::bind(&SOCKS5BytestreamProxiesManager::handleProxySessionFinished, this, sessionID, proxyJID, i->second, _1));
@@ -107,8 +108,8 @@ boost::shared_ptr<SOCKS5BytestreamClientSession> SOCKS5BytestreamProxiesManager:
return activeSession;
}
-boost::shared_ptr<SOCKS5BytestreamClientSession> SOCKS5BytestreamProxiesManager::createSOCKS5BytestreamClientSession(HostAddressPort addressPort, const std::string& destAddr) {
- SOCKS5BytestreamClientSession::ref connection = boost::make_shared<SOCKS5BytestreamClientSession>(connectionFactory_->createConnection(), addressPort, destAddr, timerFactory_);
+std::shared_ptr<SOCKS5BytestreamClientSession> SOCKS5BytestreamProxiesManager::createSOCKS5BytestreamClientSession(HostAddressPort addressPort, const std::string& destAddr) {
+ SOCKS5BytestreamClientSession::ref connection = std::make_shared<SOCKS5BytestreamClientSession>(connectionFactory_->createConnection(), addressPort, destAddr, timerFactory_);
return connection;
}
@@ -146,7 +147,7 @@ void SOCKS5BytestreamProxiesManager::handleNameLookupResult(const std::vector<Ho
// generate proxy per returned address
foreach (const HostAddress& address, addresses) {
S5BProxyRequest::StreamHost streamHost = proxy->getStreamHost().get();
- S5BProxyRequest::ref proxyForAddress = boost::make_shared<S5BProxyRequest>(*proxy);
+ S5BProxyRequest::ref proxyForAddress = std::make_shared<S5BProxyRequest>(*proxy);
streamHost.host = address.toString();
proxyForAddress->setStreamHost(streamHost);
addS5BProxy(proxyForAddress);
@@ -157,13 +158,13 @@ void SOCKS5BytestreamProxiesManager::handleNameLookupResult(const std::vector<Ho
}
void SOCKS5BytestreamProxiesManager::queryForProxies() {
- proxyFinder_ = boost::make_shared<SOCKS5BytestreamProxyFinder>(serviceRoot_, iqRouter_);
+ proxyFinder_ = std::make_shared<SOCKS5BytestreamProxyFinder>(serviceRoot_, iqRouter_);
proxyFinder_->onProxiesFound.connect(boost::bind(&SOCKS5BytestreamProxiesManager::handleProxiesFound, this, _1));
proxyFinder_->start();
}
-void SOCKS5BytestreamProxiesManager::handleProxySessionReady(const std::string& sessionID, const JID& jid, boost::shared_ptr<SOCKS5BytestreamClientSession> session, bool error) {
+void SOCKS5BytestreamProxiesManager::handleProxySessionReady(const std::string& sessionID, const JID& jid, std::shared_ptr<SOCKS5BytestreamClientSession> session, bool error) {
session->onSessionReady.disconnect(boost::bind(&SOCKS5BytestreamProxiesManager::handleProxySessionReady, this, boost::cref(sessionID), boost::cref(jid), session, _1));
if (!error) {
// The SOCKS5 bytestream session to the proxy succeeded; stop and remove other sessions.
@@ -181,7 +182,7 @@ void SOCKS5BytestreamProxiesManager::handleProxySessionReady(const std::string&
}
}
-void SOCKS5BytestreamProxiesManager::handleProxySessionFinished(const std::string& sessionID, const JID& jid, boost::shared_ptr<SOCKS5BytestreamClientSession> session, boost::optional<FileTransferError> error) {
+void SOCKS5BytestreamProxiesManager::handleProxySessionFinished(const std::string& sessionID, const JID& jid, std::shared_ptr<SOCKS5BytestreamClientSession> session, boost::optional<FileTransferError> error) {
session->onFinished.disconnect(boost::bind(&SOCKS5BytestreamProxiesManager::handleProxySessionFinished, this, sessionID, jid, session, _1));
if (error.is_initialized()) {
// The SOCKS5 bytestream session to the proxy failed; remove it.
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.h b/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.h
index b490ffa..0b566f3 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.h
+++ b/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -49,9 +49,9 @@ namespace Swift {
const boost::optional<std::vector<S5BProxyRequest::ref> >& getOrDiscoverS5BProxies();
void connectToProxies(const std::string& sessionID);
- boost::shared_ptr<SOCKS5BytestreamClientSession> getProxySessionAndCloseOthers(const JID& proxyJID, const std::string& sessionID);
+ std::shared_ptr<SOCKS5BytestreamClientSession> getProxySessionAndCloseOthers(const JID& proxyJID, const std::string& sessionID);
- boost::shared_ptr<SOCKS5BytestreamClientSession> createSOCKS5BytestreamClientSession(HostAddressPort addressPort, const std::string& destAddr);
+ std::shared_ptr<SOCKS5BytestreamClientSession> createSOCKS5BytestreamClientSession(HostAddressPort addressPort, const std::string& destAddr);
public:
boost::signal<void ()> onDiscoveredProxiesChanged;
@@ -62,8 +62,8 @@ namespace Swift {
void queryForProxies();
- void handleProxySessionReady(const std::string& sessionID, const JID& jid, boost::shared_ptr<SOCKS5BytestreamClientSession> session, bool error);
- void handleProxySessionFinished(const std::string& sessionID, const JID& jid, boost::shared_ptr<SOCKS5BytestreamClientSession> session, boost::optional<FileTransferError> error);
+ void handleProxySessionReady(const std::string& sessionID, const JID& jid, std::shared_ptr<SOCKS5BytestreamClientSession> session, bool error);
+ void handleProxySessionFinished(const std::string& sessionID, const JID& jid, std::shared_ptr<SOCKS5BytestreamClientSession> session, boost::optional<FileTransferError> error);
private:
ConnectionFactory* connectionFactory_;
@@ -72,11 +72,11 @@ namespace Swift {
IQRouter* iqRouter_;
JID serviceRoot_;
- typedef std::vector<std::pair<JID, boost::shared_ptr<SOCKS5BytestreamClientSession> > > ProxyJIDClientSessionVector;
+ typedef std::vector<std::pair<JID, std::shared_ptr<SOCKS5BytestreamClientSession> > > ProxyJIDClientSessionVector;
typedef std::map<std::string, ProxyJIDClientSessionVector> ProxySessionsMap;
ProxySessionsMap proxySessions_;
- boost::shared_ptr<SOCKS5BytestreamProxyFinder> proxyFinder_;
+ std::shared_ptr<SOCKS5BytestreamProxyFinder> proxyFinder_;
boost::optional<std::vector<S5BProxyRequest::ref> > localS5BProxies_;
};
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.cpp b/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.cpp
index e6c85cf..9624d4c 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.cpp
+++ b/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.cpp
@@ -5,15 +5,16 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Log.h>
#include <Swiften/Base/foreach.h>
@@ -30,14 +31,14 @@ SOCKS5BytestreamProxyFinder::~SOCKS5BytestreamProxyFinder() {
}
void SOCKS5BytestreamProxyFinder::start() {
- serviceWalker = boost::make_shared<DiscoServiceWalker>(service, iqRouter);
+ serviceWalker = std::make_shared<DiscoServiceWalker>(service, iqRouter);
serviceWalker->onServiceFound.connect(boost::bind(&SOCKS5BytestreamProxyFinder::handleServiceFound, this, _1, _2));
serviceWalker->onWalkComplete.connect(boost::bind(&SOCKS5BytestreamProxyFinder::handleWalkEnded, this));
serviceWalker->beginWalk();
}
void SOCKS5BytestreamProxyFinder::stop() {
- typedef boost::shared_ptr<GenericRequest<S5BProxyRequest> > S5BProxyRequestGenericRequest;
+ typedef std::shared_ptr<GenericRequest<S5BProxyRequest> > S5BProxyRequestGenericRequest;
foreach (S5BProxyRequestGenericRequest requester, pendingRequests) {
requester->onResponse.disconnect(boost::bind(&SOCKS5BytestreamProxyFinder::handleProxyResponse, this, requester, _1, _2));
}
@@ -49,14 +50,14 @@ void SOCKS5BytestreamProxyFinder::stop() {
}
void SOCKS5BytestreamProxyFinder::sendBytestreamQuery(const JID& jid) {
- S5BProxyRequest::ref proxyRequest = boost::make_shared<S5BProxyRequest>();
- boost::shared_ptr<GenericRequest<S5BProxyRequest> > request = boost::make_shared<GenericRequest<S5BProxyRequest> >(IQ::Get, jid, proxyRequest, iqRouter);
+ S5BProxyRequest::ref proxyRequest = std::make_shared<S5BProxyRequest>();
+ std::shared_ptr<GenericRequest<S5BProxyRequest> > request = std::make_shared<GenericRequest<S5BProxyRequest> >(IQ::Get, jid, proxyRequest, iqRouter);
request->onResponse.connect(boost::bind(&SOCKS5BytestreamProxyFinder::handleProxyResponse, this, request, _1, _2));
pendingRequests.insert(request);
request->send();
}
-void SOCKS5BytestreamProxyFinder::handleServiceFound(const JID& jid, boost::shared_ptr<DiscoInfo> discoInfo) {
+void SOCKS5BytestreamProxyFinder::handleServiceFound(const JID& jid, std::shared_ptr<DiscoInfo> discoInfo) {
if (discoInfo->hasFeature(DiscoInfo::Bytestream)) {
sendBytestreamQuery(jid);
}
@@ -68,7 +69,7 @@ void SOCKS5BytestreamProxyFinder::handleWalkEnded() {
}
}
-void SOCKS5BytestreamProxyFinder::handleProxyResponse(boost::shared_ptr<GenericRequest<S5BProxyRequest> > requester, boost::shared_ptr<S5BProxyRequest> request, ErrorPayload::ref error) {
+void SOCKS5BytestreamProxyFinder::handleProxyResponse(std::shared_ptr<GenericRequest<S5BProxyRequest> > requester, std::shared_ptr<S5BProxyRequest> request, ErrorPayload::ref error) {
requester->onResponse.disconnect(boost::bind(&SOCKS5BytestreamProxyFinder::handleProxyResponse, this, requester, _1, _2));
pendingRequests.erase(requester);
if (error) {
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.h b/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.h
index 1047df0..55e499e 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.h
+++ b/Swiften/FileTransfer/SOCKS5BytestreamProxyFinder.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,7 +13,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Disco/DiscoServiceWalker.h>
@@ -36,21 +36,21 @@ class SWIFTEN_API SOCKS5BytestreamProxyFinder {
void start();
void stop();
- boost::signal<void(std::vector<boost::shared_ptr<S5BProxyRequest> >)> onProxiesFound;
+ boost::signal<void(std::vector<std::shared_ptr<S5BProxyRequest> >)> onProxiesFound;
private:
void sendBytestreamQuery(const JID&);
- void handleServiceFound(const JID&, boost::shared_ptr<DiscoInfo>);
- void handleProxyResponse(boost::shared_ptr<GenericRequest<S5BProxyRequest> > requester, boost::shared_ptr<S5BProxyRequest>, ErrorPayload::ref);
+ void handleServiceFound(const JID&, std::shared_ptr<DiscoInfo>);
+ void handleProxyResponse(std::shared_ptr<GenericRequest<S5BProxyRequest> > requester, std::shared_ptr<S5BProxyRequest>, ErrorPayload::ref);
void handleWalkEnded();
private:
JID service;
IQRouter* iqRouter;
- boost::shared_ptr<DiscoServiceWalker> serviceWalker;
+ std::shared_ptr<DiscoServiceWalker> serviceWalker;
std::vector<S5BProxyRequest::ref> proxyHosts;
- std::set<boost::shared_ptr<GenericRequest<S5BProxyRequest> > > pendingRequests;
+ std::set<std::shared_ptr<GenericRequest<S5BProxyRequest> > > pendingRequests;
};
}
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamRegistry.cpp b/Swiften/FileTransfer/SOCKS5BytestreamRegistry.cpp
index 2f66dff..1591e24 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamRegistry.cpp
+++ b/Swiften/FileTransfer/SOCKS5BytestreamRegistry.cpp
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2013 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/FileTransfer/SOCKS5BytestreamRegistry.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/Algorithm.h>
#include <Swiften/Base/Log.h>
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServer.cpp b/Swiften/FileTransfer/SOCKS5BytestreamServer.cpp
index f25227a..b68bd58 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamServer.cpp
+++ b/Swiften/FileTransfer/SOCKS5BytestreamServer.cpp
@@ -18,7 +18,7 @@
namespace Swift {
SOCKS5BytestreamServer::SOCKS5BytestreamServer(
- boost::shared_ptr<ConnectionServer> connectionServer,
+ std::shared_ptr<ConnectionServer> connectionServer,
SOCKS5BytestreamRegistry* registry) :
connectionServer(connectionServer),
registry(registry) {
@@ -30,16 +30,16 @@ void SOCKS5BytestreamServer::start() {
void SOCKS5BytestreamServer::stop() {
connectionServer->onNewConnection.disconnect(boost::bind(&SOCKS5BytestreamServer::handleNewConnection, this, _1));
- foreach (boost::shared_ptr<SOCKS5BytestreamServerSession> session, sessions) {
+ foreach (std::shared_ptr<SOCKS5BytestreamServerSession> session, sessions) {
session->onFinished.disconnect(boost::bind(&SOCKS5BytestreamServer::handleSessionFinished, this, session));
session->stop();
}
sessions.clear();
}
-void SOCKS5BytestreamServer::handleNewConnection(boost::shared_ptr<Connection> connection) {
- boost::shared_ptr<SOCKS5BytestreamServerSession> session =
- boost::make_shared<SOCKS5BytestreamServerSession>(connection, registry);
+void SOCKS5BytestreamServer::handleNewConnection(std::shared_ptr<Connection> connection) {
+ std::shared_ptr<SOCKS5BytestreamServerSession> session =
+ std::make_shared<SOCKS5BytestreamServerSession>(connection, registry);
session->onFinished.connect(boost::bind(&SOCKS5BytestreamServer::handleSessionFinished, this, session));
sessions.push_back(session);
session->start();
@@ -49,10 +49,10 @@ HostAddressPort SOCKS5BytestreamServer::getAddressPort() const {
return connectionServer->getAddressPort();
}
-std::vector< boost::shared_ptr<SOCKS5BytestreamServerSession> > SOCKS5BytestreamServer::getSessions(
+std::vector< std::shared_ptr<SOCKS5BytestreamServerSession> > SOCKS5BytestreamServer::getSessions(
const std::string& streamID) const {
- std::vector< boost::shared_ptr<SOCKS5BytestreamServerSession> > result;
- foreach (boost::shared_ptr<SOCKS5BytestreamServerSession> session, sessions) {
+ std::vector< std::shared_ptr<SOCKS5BytestreamServerSession> > result;
+ foreach (std::shared_ptr<SOCKS5BytestreamServerSession> session, sessions) {
if (session->getStreamID() == streamID) {
result.push_back(session);
}
@@ -60,7 +60,7 @@ std::vector< boost::shared_ptr<SOCKS5BytestreamServerSession> > SOCKS5Bytestream
return result;
}
-void SOCKS5BytestreamServer::handleSessionFinished(boost::shared_ptr<SOCKS5BytestreamServerSession> session) {
+void SOCKS5BytestreamServer::handleSessionFinished(std::shared_ptr<SOCKS5BytestreamServerSession> session) {
sessions.erase(std::remove(sessions.begin(), sessions.end(), session), sessions.end());
session->onFinished.disconnect(boost::bind(&SOCKS5BytestreamServer::handleSessionFinished, this, session));
}
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServer.h b/Swiften/FileTransfer/SOCKS5BytestreamServer.h
index f9b293e..c8866c4 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamServer.h
+++ b/Swiften/FileTransfer/SOCKS5BytestreamServer.h
@@ -7,10 +7,9 @@
#pragma once
#include <map>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/FileTransfer/ReadBytestream.h>
#include <Swiften/FileTransfer/SOCKS5BytestreamRegistry.h>
@@ -24,7 +23,7 @@ namespace Swift {
class SWIFTEN_API SOCKS5BytestreamServer {
public:
SOCKS5BytestreamServer(
- boost::shared_ptr<ConnectionServer> connectionServer,
+ std::shared_ptr<ConnectionServer> connectionServer,
SOCKS5BytestreamRegistry* registry);
HostAddressPort getAddressPort() const;
@@ -32,18 +31,18 @@ namespace Swift {
void start();
void stop();
- std::vector< boost::shared_ptr<SOCKS5BytestreamServerSession> > getSessions(const std::string& id) const;
+ std::vector< std::shared_ptr<SOCKS5BytestreamServerSession> > getSessions(const std::string& id) const;
private:
- void handleNewConnection(boost::shared_ptr<Connection> connection);
- void handleSessionFinished(boost::shared_ptr<SOCKS5BytestreamServerSession>);
+ void handleNewConnection(std::shared_ptr<Connection> connection);
+ void handleSessionFinished(std::shared_ptr<SOCKS5BytestreamServerSession>);
private:
friend class SOCKS5BytestreamServerSession;
- boost::shared_ptr<ConnectionServer> connectionServer;
+ std::shared_ptr<ConnectionServer> connectionServer;
SOCKS5BytestreamRegistry* registry;
- std::vector<boost::shared_ptr<SOCKS5BytestreamServerSession> > sessions;
+ std::vector<std::shared_ptr<SOCKS5BytestreamServerSession> > sessions;
};
}
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp b/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp
index 22a07fd..33a5283 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp
+++ b/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp
@@ -12,8 +12,9 @@
#include <Swiften/FileTransfer/SOCKS5BytestreamServerManager.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Log.h>
#include <Swiften/Base/foreach.h>
@@ -59,10 +60,10 @@ SOCKS5BytestreamServerManager::~SOCKS5BytestreamServerManager() {
}
}
-boost::shared_ptr<SOCKS5BytestreamServerResourceUser> SOCKS5BytestreamServerManager::aquireResourceUser() {
- boost::shared_ptr<SOCKS5BytestreamServerResourceUser> resourceUser;
+std::shared_ptr<SOCKS5BytestreamServerResourceUser> SOCKS5BytestreamServerManager::aquireResourceUser() {
+ std::shared_ptr<SOCKS5BytestreamServerResourceUser> resourceUser;
if (s5bServerResourceUser_.expired()) {
- resourceUser = boost::make_shared<SOCKS5BytestreamServerResourceUser>(this);
+ resourceUser = std::make_shared<SOCKS5BytestreamServerResourceUser>(this);
s5bServerResourceUser_ = resourceUser;
}
else {
@@ -71,10 +72,10 @@ boost::shared_ptr<SOCKS5BytestreamServerResourceUser> SOCKS5BytestreamServerMana
return resourceUser;
}
-boost::shared_ptr<SOCKS5BytestreamServerPortForwardingUser> SOCKS5BytestreamServerManager::aquirePortForwardingUser() {
- boost::shared_ptr<SOCKS5BytestreamServerPortForwardingUser> portForwardingUser;
+std::shared_ptr<SOCKS5BytestreamServerPortForwardingUser> SOCKS5BytestreamServerManager::aquirePortForwardingUser() {
+ std::shared_ptr<SOCKS5BytestreamServerPortForwardingUser> portForwardingUser;
if (s5bServerPortForwardingUser_.expired()) {
- portForwardingUser = boost::make_shared<SOCKS5BytestreamServerPortForwardingUser>(this);
+ portForwardingUser = std::make_shared<SOCKS5BytestreamServerPortForwardingUser>(this);
s5bServerPortForwardingUser_ = portForwardingUser;
}
else {
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerManager.h b/Swiften/FileTransfer/SOCKS5BytestreamServerManager.h
index ab12dfe..98b5bea 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamServerManager.h
+++ b/Swiften/FileTransfer/SOCKS5BytestreamServerManager.h
@@ -6,11 +6,9 @@
#pragma once
+#include <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-#include <boost/weak_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Network/HostAddressPort.h>
@@ -41,8 +39,8 @@ namespace Swift {
NATTraverser* natTraverser);
~SOCKS5BytestreamServerManager();
- boost::shared_ptr<SOCKS5BytestreamServerResourceUser> aquireResourceUser();
- boost::shared_ptr<SOCKS5BytestreamServerPortForwardingUser> aquirePortForwardingUser();
+ std::shared_ptr<SOCKS5BytestreamServerResourceUser> aquireResourceUser();
+ std::shared_ptr<SOCKS5BytestreamServerPortForwardingUser> aquirePortForwardingUser();
void stop();
@@ -78,18 +76,18 @@ namespace Swift {
NATTraverser* natTraverser;
enum { Start, Initializing, Initialized } state;
SOCKS5BytestreamServer* server;
- boost::shared_ptr<ConnectionServer> connectionServer;
+ std::shared_ptr<ConnectionServer> connectionServer;
int connectionServerPort;
- boost::shared_ptr<NATTraversalGetPublicIPRequest> getPublicIPRequest;
- boost::shared_ptr<NATTraversalForwardPortRequest> forwardPortRequest;
- boost::shared_ptr<NATTraversalRemovePortForwardingRequest> unforwardPortRequest;
+ std::shared_ptr<NATTraversalGetPublicIPRequest> getPublicIPRequest;
+ std::shared_ptr<NATTraversalForwardPortRequest> forwardPortRequest;
+ std::shared_ptr<NATTraversalRemovePortForwardingRequest> unforwardPortRequest;
boost::optional<HostAddress> publicAddress;
boost::optional<NATPortMapping> portMapping;
bool attemptedPortMapping_;
- boost::weak_ptr<SOCKS5BytestreamServerResourceUser> s5bServerResourceUser_;
- boost::weak_ptr<SOCKS5BytestreamServerPortForwardingUser> s5bServerPortForwardingUser_;
+ std::weak_ptr<SOCKS5BytestreamServerResourceUser> s5bServerResourceUser_;
+ std::weak_ptr<SOCKS5BytestreamServerPortForwardingUser> s5bServerPortForwardingUser_;
};
}
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp
index e2d46f4..bc4e8e4 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp
+++ b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp
@@ -21,7 +21,7 @@
namespace Swift {
SOCKS5BytestreamServerSession::SOCKS5BytestreamServerSession(
- boost::shared_ptr<Connection> connection,
+ std::shared_ptr<Connection> connection,
SOCKS5BytestreamRegistry* bytestreams) :
connection(connection),
bytestreams(bytestreams),
@@ -49,7 +49,7 @@ void SOCKS5BytestreamServerSession::stop() {
finish();
}
-void SOCKS5BytestreamServerSession::startSending(boost::shared_ptr<ReadBytestream> stream) {
+void SOCKS5BytestreamServerSession::startSending(std::shared_ptr<ReadBytestream> stream) {
if (state != ReadyForTransfer) { SWIFT_LOG(debug) << "Not ready for transfer!" << std::endl; return; }
readBytestream = stream;
@@ -61,7 +61,7 @@ void SOCKS5BytestreamServerSession::startSending(boost::shared_ptr<ReadBytestrea
sendData();
}
-void SOCKS5BytestreamServerSession::startReceiving(boost::shared_ptr<WriteBytestream> stream) {
+void SOCKS5BytestreamServerSession::startReceiving(std::shared_ptr<WriteBytestream> stream) {
if (state != ReadyForTransfer) { SWIFT_LOG(debug) << "Not ready for transfer!" << std::endl; return; }
writeBytestream = stream;
@@ -75,7 +75,7 @@ HostAddressPort SOCKS5BytestreamServerSession::getAddressPort() const {
return connection->getLocalAddress();
}
-void SOCKS5BytestreamServerSession::handleDataRead(boost::shared_ptr<SafeByteArray> data) {
+void SOCKS5BytestreamServerSession::handleDataRead(std::shared_ptr<SafeByteArray> data) {
if (state != ReadingData) {
append(unprocessedData, *data);
process();
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h
index a90e8c5..d530a06 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h
+++ b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -20,7 +20,7 @@ namespace Swift {
class SWIFTEN_API SOCKS5BytestreamServerSession {
public:
- typedef boost::shared_ptr<SOCKS5BytestreamServerSession> ref;
+ typedef std::shared_ptr<SOCKS5BytestreamServerSession> ref;
public:
enum State {
@@ -33,7 +33,7 @@ namespace Swift {
Finished
};
- SOCKS5BytestreamServerSession(boost::shared_ptr<Connection> connection, SOCKS5BytestreamRegistry* registry);
+ SOCKS5BytestreamServerSession(std::shared_ptr<Connection> connection, SOCKS5BytestreamRegistry* registry);
~SOCKS5BytestreamServerSession();
void setChunkSize(int chunkSize) {
@@ -43,8 +43,8 @@ namespace Swift {
void start();
void stop();
- void startSending(boost::shared_ptr<ReadBytestream>);
- void startReceiving(boost::shared_ptr<WriteBytestream>);
+ void startSending(std::shared_ptr<ReadBytestream>);
+ void startReceiving(std::shared_ptr<WriteBytestream>);
HostAddressPort getAddressPort() const;
@@ -58,20 +58,20 @@ namespace Swift {
private:
void finish(const boost::optional<FileTransferError>& error = boost::optional<FileTransferError>());
void process();
- void handleDataRead(boost::shared_ptr<SafeByteArray>);
+ void handleDataRead(std::shared_ptr<SafeByteArray>);
void handleDisconnected(const boost::optional<Connection::Error>&);
void handleDataAvailable();
void sendData();
private:
- boost::shared_ptr<Connection> connection;
+ std::shared_ptr<Connection> connection;
SOCKS5BytestreamRegistry* bytestreams;
ByteArray unprocessedData;
State state;
int chunkSize;
std::string streamID;
- boost::shared_ptr<ReadBytestream> readBytestream;
- boost::shared_ptr<WriteBytestream> writeBytestream;
+ std::shared_ptr<ReadBytestream> readBytestream;
+ std::shared_ptr<WriteBytestream> writeBytestream;
bool waitingForData;
boost::bsignals::connection disconnectedConnection;
diff --git a/Swiften/FileTransfer/StreamInitiationRequest.h b/Swiften/FileTransfer/StreamInitiationRequest.h
index c03fae6..44e826c 100644
--- a/Swiften/FileTransfer/StreamInitiationRequest.h
+++ b/Swiften/FileTransfer/StreamInitiationRequest.h
@@ -13,21 +13,21 @@
namespace Swift {
class SWIFTEN_API StreamInitiationRequest : public GenericRequest<StreamInitiation> {
public:
- typedef boost::shared_ptr<StreamInitiationRequest> ref;
+ typedef std::shared_ptr<StreamInitiationRequest> ref;
- static ref create(const JID& jid, boost::shared_ptr<StreamInitiation> payload, IQRouter* router) {
+ static ref create(const JID& jid, std::shared_ptr<StreamInitiation> payload, IQRouter* router) {
return ref(new StreamInitiationRequest(jid, payload, router));
}
- static ref create(const JID& from, const JID& to, boost::shared_ptr<StreamInitiation> payload, IQRouter* router) {
+ static ref create(const JID& from, const JID& to, std::shared_ptr<StreamInitiation> payload, IQRouter* router) {
return ref(new StreamInitiationRequest(from, to, payload, router));
}
private:
- StreamInitiationRequest(const JID& jid, boost::shared_ptr<StreamInitiation> payload, IQRouter* router) : GenericRequest<StreamInitiation>(IQ::Set, jid, payload, router) {
+ StreamInitiationRequest(const JID& jid, std::shared_ptr<StreamInitiation> payload, IQRouter* router) : GenericRequest<StreamInitiation>(IQ::Set, jid, payload, router) {
}
- StreamInitiationRequest(const JID& from, const JID& to, boost::shared_ptr<StreamInitiation> payload, IQRouter* router) : GenericRequest<StreamInitiation>(IQ::Set, from, to, payload, router) {
+ StreamInitiationRequest(const JID& from, const JID& to, std::shared_ptr<StreamInitiation> payload, IQRouter* router) : GenericRequest<StreamInitiation>(IQ::Set, from, to, payload, router) {
}
};
}
diff --git a/Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h b/Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h
index 70d25a5..03e2476 100644
--- a/Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h
+++ b/Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h
@@ -33,7 +33,7 @@ namespace Swift {
const JID&,
const boost::filesystem::path&,
const std::string&,
- boost::shared_ptr<ReadBytestream>,
+ std::shared_ptr<ReadBytestream>,
const FileTransferOptions&) SWIFTEN_OVERRIDE {
return OutgoingFileTransfer::ref();
}
@@ -44,12 +44,12 @@ namespace Swift {
const std::string&,
const boost::uintmax_t,
const boost::posix_time::ptime&,
- boost::shared_ptr<ReadBytestream>,
+ std::shared_ptr<ReadBytestream>,
const FileTransferOptions&) SWIFTEN_OVERRIDE {
return OutgoingFileTransfer::ref();
}
- virtual void addS5BProxy(boost::shared_ptr<S5BProxyRequest>) {
+ virtual void addS5BProxy(std::shared_ptr<S5BProxyRequest>) {
}
};
diff --git a/Swiften/FileTransfer/UnitTest/DummyFileTransferTransporterFactory.h b/Swiften/FileTransfer/UnitTest/DummyFileTransferTransporterFactory.h
index f3972ab..5db3368 100644
--- a/Swiften/FileTransfer/UnitTest/DummyFileTransferTransporterFactory.h
+++ b/Swiften/FileTransfer/UnitTest/DummyFileTransferTransporterFactory.h
@@ -84,37 +84,37 @@ public:
virtual void stopActivatingProxy() {
}
- virtual boost::shared_ptr<TransportSession> createIBBSendSession(const std::string& sessionID, unsigned int blockSize, boost::shared_ptr<ReadBytestream> stream) {
- boost::shared_ptr<IBBSendSession> ibbSession = boost::make_shared<IBBSendSession>(
+ virtual std::shared_ptr<TransportSession> createIBBSendSession(const std::string& sessionID, unsigned int blockSize, std::shared_ptr<ReadBytestream> stream) {
+ std::shared_ptr<IBBSendSession> ibbSession = std::make_shared<IBBSendSession>(
sessionID, initiator_, responder_, stream, iqRouter_);
ibbSession->setBlockSize(blockSize);
- return boost::make_shared<IBBSendTransportSession>(ibbSession);
+ return std::make_shared<IBBSendTransportSession>(ibbSession);
}
- virtual boost::shared_ptr<TransportSession> createIBBReceiveSession(const std::string& sessionID, unsigned long long size, boost::shared_ptr<WriteBytestream> stream) {
- boost::shared_ptr<IBBReceiveSession> ibbSession = boost::make_shared<IBBReceiveSession>(
+ virtual std::shared_ptr<TransportSession> createIBBReceiveSession(const std::string& sessionID, unsigned long long size, std::shared_ptr<WriteBytestream> stream) {
+ std::shared_ptr<IBBReceiveSession> ibbSession = std::make_shared<IBBReceiveSession>(
sessionID, initiator_, responder_, size, stream, iqRouter_);
- return boost::make_shared<IBBReceiveTransportSession>(ibbSession);
+ return std::make_shared<IBBReceiveTransportSession>(ibbSession);
}
- virtual boost::shared_ptr<TransportSession> createRemoteCandidateSession(
- boost::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
- return boost::shared_ptr<TransportSession>();
+ virtual std::shared_ptr<TransportSession> createRemoteCandidateSession(
+ std::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
+ return std::shared_ptr<TransportSession>();
}
- virtual boost::shared_ptr<TransportSession> createRemoteCandidateSession(
- boost::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
- return boost::shared_ptr<TransportSession>();
+ virtual std::shared_ptr<TransportSession> createRemoteCandidateSession(
+ std::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
+ return std::shared_ptr<TransportSession>();
}
- virtual boost::shared_ptr<TransportSession> createLocalCandidateSession(
- boost::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
- return boost::shared_ptr<TransportSession>();
+ virtual std::shared_ptr<TransportSession> createLocalCandidateSession(
+ std::shared_ptr<ReadBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
+ return std::shared_ptr<TransportSession>();
}
- virtual boost::shared_ptr<TransportSession> createLocalCandidateSession(
- boost::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
- return boost::shared_ptr<TransportSession>();
+ virtual std::shared_ptr<TransportSession> createLocalCandidateSession(
+ std::shared_ptr<WriteBytestream>, const JingleS5BTransportPayload::Candidate& /* candidate */) {
+ return std::shared_ptr<TransportSession>();
}
private:
diff --git a/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp b/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp
index d78f4f0..31f46de 100644
--- a/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/IBBReceiveSessionTest.cpp
@@ -5,10 +5,10 @@
*/
+#include <memory>
#include <vector>
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -38,7 +38,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
stanzaChannel = new DummyStanzaChannel();
iqRouter = new IQRouter(stanzaChannel);
finished = false;
- bytestream = boost::make_shared<ByteArrayWriteBytestream>();
+ bytestream = std::make_shared<ByteArrayWriteBytestream>();
}
void tearDown() {
@@ -47,7 +47,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testOpen() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -58,7 +58,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveData() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -72,7 +72,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveMultipleData() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -87,7 +87,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveDataForOtherSession() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -99,7 +99,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveDataOutOfOrder() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -114,7 +114,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveLastData() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession", 6));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession", 6));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -130,7 +130,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testReceiveClose() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -143,7 +143,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
}
void testStopWhileActive() {
- boost::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
+ std::shared_ptr<IBBReceiveSession> testling(createSession("foo@bar.com/baz", "mysession"));
testling->start();
stanzaChannel->onIQReceived(createIBBRequest(IBB::createIBBOpen("mysession", 0x10), "foo@bar.com/baz", "id-open"));
@@ -181,7 +181,7 @@ class IBBReceiveSessionTest : public CppUnit::TestFixture {
IQRouter* iqRouter;
bool finished;
boost::optional<FileTransferError> error;
- boost::shared_ptr<ByteArrayWriteBytestream> bytestream;
+ std::shared_ptr<ByteArrayWriteBytestream> bytestream;
};
CPPUNIT_TEST_SUITE_REGISTRATION(IBBReceiveSessionTest);
diff --git a/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp b/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp
index e417c77..f9057f8 100644
--- a/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/IBBSendSessionTest.cpp
@@ -39,7 +39,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
void setUp() {
stanzaChannel = new DummyStanzaChannel();
iqRouter = new IQRouter(stanzaChannel);
- bytestream = boost::make_shared<ByteArrayReadBytestream>(createByteArray("abcdefg"));
+ bytestream = std::make_shared<ByteArrayReadBytestream>(createByteArray("abcdefg"));
finished = false;
}
@@ -49,7 +49,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testStart() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(1234);
testling->start();
@@ -63,7 +63,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testStart_ResponseStartsSending() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
@@ -79,7 +79,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testResponseContinuesSending() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
stanzaChannel->onIQReceived(createIBBResult());
@@ -95,7 +95,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testRespondToAllFinishes() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
stanzaChannel->onIQReceived(createIBBResult());
@@ -108,7 +108,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testErrorResponseFinishesWithError() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID()));
@@ -118,7 +118,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testStopDuringSessionCloses() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(3);
testling->start();
testling->stop();
@@ -133,7 +133,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testStopAfterFinishedDoesNotClose() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
testling->setBlockSize(16);
testling->start();
stanzaChannel->onIQReceived(createIBBResult());
@@ -146,7 +146,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testDataStreamPauseStopsSendingData() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
bytestream->setDataComplete(false);
testling->setBlockSize(3);
testling->start();
@@ -162,7 +162,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testDataStreamResumeAfterPauseSendsData() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
bytestream->setDataComplete(false);
testling->setBlockSize(3);
testling->start();
@@ -177,7 +177,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testDataStreamResumeBeforePauseDoesNotSendData() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
bytestream->setDataComplete(false);
testling->setBlockSize(3);
testling->start();
@@ -189,7 +189,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
}
void testDataStreamResumeAfterResumeDoesNotSendData() {
- boost::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
+ std::shared_ptr<IBBSendSession> testling = createSession("foo@bar.com/baz");
bytestream->setDataComplete(false);
testling->setBlockSize(3);
testling->start();
@@ -206,12 +206,12 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
private:
IQ::ref createIBBResult() {
- return IQ::createResult(JID("baz@fum.com/dum"), stanzaChannel->sentStanzas[stanzaChannel->sentStanzas.size()-1]->getTo(), stanzaChannel->sentStanzas[stanzaChannel->sentStanzas.size()-1]->getID(), boost::shared_ptr<IBB>());
+ return IQ::createResult(JID("baz@fum.com/dum"), stanzaChannel->sentStanzas[stanzaChannel->sentStanzas.size()-1]->getTo(), stanzaChannel->sentStanzas[stanzaChannel->sentStanzas.size()-1]->getID(), std::shared_ptr<IBB>());
}
private:
- boost::shared_ptr<IBBSendSession> createSession(const std::string& to) {
- boost::shared_ptr<IBBSendSession> session(new IBBSendSession("myid", JID(), JID(to), bytestream, iqRouter));
+ std::shared_ptr<IBBSendSession> createSession(const std::string& to) {
+ std::shared_ptr<IBBSendSession> session(new IBBSendSession("myid", JID(), JID(to), bytestream, iqRouter));
session->onFinished.connect(boost::bind(&IBBSendSessionTest::handleFinished, this, _1));
return session;
}
@@ -226,7 +226,7 @@ class IBBSendSessionTest : public CppUnit::TestFixture {
IQRouter* iqRouter;
bool finished;
boost::optional<FileTransferError> error;
- boost::shared_ptr<ByteArrayReadBytestream> bytestream;
+ std::shared_ptr<ByteArrayReadBytestream> bytestream;
};
CPPUNIT_TEST_SUITE_REGISTRATION(IBBSendSessionTest);
diff --git a/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp b/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp
index a76773c..72b933d 100644
--- a/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp
@@ -5,14 +5,13 @@
*/
/*
- * Copyright (c) 2013-2015 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <iostream>
-
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -45,7 +44,6 @@
#include <Swiften/Queries/IQRouter.h>
using namespace Swift;
-using namespace boost;
class IncomingJingleFileTransferTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(IncomingJingleFileTransferTest);
@@ -54,9 +52,9 @@ class IncomingJingleFileTransferTest : public CppUnit::TestFixture {
//CPPUNIT_TEST(test_AcceptFailingS5BFallsBackToIBB);
CPPUNIT_TEST_SUITE_END();
public:
- shared_ptr<IncomingJingleFileTransfer> createTestling() {
+ std::shared_ptr<IncomingJingleFileTransfer> createTestling() {
JID ourJID("our@jid.org/full");
- return boost::make_shared<IncomingJingleFileTransfer>(ourJID, shared_ptr<JingleSession>(session), jingleContentPayload, ftTransporterFactory, timerFactory, crypto.get());
+ return std::make_shared<IncomingJingleFileTransfer>(ourJID, std::shared_ptr<JingleSession>(session), jingleContentPayload, ftTransporterFactory, timerFactory, crypto.get());
}
IQ::ref createIBBRequest(IBB::ref ibb, const JID& from, const std::string& id) {
@@ -66,13 +64,13 @@ public:
}
void setUp() {
- crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
eventLoop = new DummyEventLoop();
resolver = new StaticDomainNameResolver(eventLoop);
- session = boost::make_shared<FakeJingleSession>("foo@bar.com/baz", "mysession");
- jingleContentPayload = make_shared<JingleContentPayload>();
- // fakeRJTCSF = make_shared<FakeRemoteJingleTransportCandidateSelectorFactory>();
- // fakeLJTCF = make_shared<FakeLocalJingleTransportCandidateGeneratorFactory>();
+ session = std::make_shared<FakeJingleSession>("foo@bar.com/baz", "mysession");
+ jingleContentPayload = std::make_shared<JingleContentPayload>();
+ // fakeRJTCSF = std::make_shared<FakeRemoteJingleTransportCandidateSelectorFactory>();
+ // fakeLJTCF = std::make_shared<FakeLocalJingleTransportCandidateGeneratorFactory>();
stanzaChannel = new DummyStanzaChannel();
connectionFactory = new DummyConnectionFactory(eventLoop);
serverConnectionFactory = new DummyConnectionServerFactory(eventLoop);
@@ -108,17 +106,17 @@ public:
// Tests whether IncomingJingleFileTransfer would accept a IBB only file transfer.
void test_AcceptOnyIBBSendsSessionAccept() {
//1. create your test incoming file transfer
- shared_ptr<JingleFileTransferDescription> desc = make_shared<JingleFileTransferDescription>();
+ std::shared_ptr<JingleFileTransferDescription> desc = std::make_shared<JingleFileTransferDescription>();
desc->setFileInfo(JingleFileTransferFileInfo("foo.txt", "", 10));
jingleContentPayload->addDescription(desc);
- JingleIBBTransportPayload::ref tpRef = make_shared<JingleIBBTransportPayload>();
+ JingleIBBTransportPayload::ref tpRef = std::make_shared<JingleIBBTransportPayload>();
tpRef->setSessionID("mysession");
jingleContentPayload->addTransport(tpRef);
- shared_ptr<IncomingJingleFileTransfer> fileTransfer = createTestling();
+ std::shared_ptr<IncomingJingleFileTransfer> fileTransfer = createTestling();
//2. do 'accept' on a dummy writebytestream (you'll have to look if there already is one)
- shared_ptr<ByteArrayWriteBytestream> byteStream = make_shared<ByteArrayWriteBytestream>();
+ std::shared_ptr<ByteArrayWriteBytestream> byteStream = std::make_shared<ByteArrayWriteBytestream>();
fileTransfer->accept(byteStream);
// check whether accept has been called
@@ -127,17 +125,17 @@ public:
void test_OnlyIBBTransferReceiveWorks() {
//1. create your test incoming file transfer
- shared_ptr<JingleFileTransferDescription> desc = make_shared<JingleFileTransferDescription>();
+ std::shared_ptr<JingleFileTransferDescription> desc = std::make_shared<JingleFileTransferDescription>();
desc->setFileInfo(JingleFileTransferFileInfo("file.txt", "", 10));
jingleContentPayload->addDescription(desc);
- JingleIBBTransportPayload::ref tpRef = make_shared<JingleIBBTransportPayload>();
+ JingleIBBTransportPayload::ref tpRef = std::make_shared<JingleIBBTransportPayload>();
tpRef->setSessionID("mysession");
jingleContentPayload->addTransport(tpRef);
- shared_ptr<IncomingJingleFileTransfer> fileTransfer = createTestling();
+ std::shared_ptr<IncomingJingleFileTransfer> fileTransfer = createTestling();
//2. do 'accept' on a dummy writebytestream (you'll have to look if there already is one)
- shared_ptr<ByteArrayWriteBytestream> byteStream = make_shared<ByteArrayWriteBytestream>();
+ std::shared_ptr<ByteArrayWriteBytestream> byteStream = std::make_shared<ByteArrayWriteBytestream>();
fileTransfer->accept(byteStream);
// check whether accept has been called
@@ -154,10 +152,10 @@ public:
// add SOCKS5BytestreamTransportPayload
JingleS5BTransportPayload::ref payLoad = addJingleS5BPayload();
- shared_ptr<IncomingJingleFileTransfer> fileTransfer = createTestling();
+ std::shared_ptr<IncomingJingleFileTransfer> fileTransfer = createTestling();
//2. do 'accept' on a dummy writebytestream (you'll have to look if there already is one)
- shared_ptr<ByteArrayWriteBytestream> byteStream = make_shared<ByteArrayWriteBytestream>();
+ std::shared_ptr<ByteArrayWriteBytestream> byteStream = std::make_shared<ByteArrayWriteBytestream>();
fileTransfer->accept(byteStream);
// candidates are gathered
@@ -168,7 +166,7 @@ public:
// check for candidate error
FakeJingleSession::InfoTransportCall infoTransportCall = getCall<FakeJingleSession::InfoTransportCall>(1);
- JingleS5BTransportPayload::ref s5bPayload = dynamic_pointer_cast<JingleS5BTransportPayload>(infoTransportCall.payload);
+ JingleS5BTransportPayload::ref s5bPayload = std::dynamic_pointer_cast<JingleS5BTransportPayload>(infoTransportCall.payload);
CPPUNIT_ASSERT(s5bPayload->hasCandidateError());
// indicate transport replace (Romeo)
@@ -189,20 +187,20 @@ public:
#endif
private:
void addFileTransferDescription() {
- shared_ptr<JingleFileTransferDescription> desc = make_shared<JingleFileTransferDescription>();
+ std::shared_ptr<JingleFileTransferDescription> desc = std::make_shared<JingleFileTransferDescription>();
desc->setFileInfo(JingleFileTransferFileInfo("file.txt", "", 10));
jingleContentPayload->addDescription(desc);
}
- shared_ptr<JingleS5BTransportPayload> addJingleS5BPayload() {
- JingleS5BTransportPayload::ref payLoad = make_shared<JingleS5BTransportPayload>();
+ std::shared_ptr<JingleS5BTransportPayload> addJingleS5BPayload() {
+ JingleS5BTransportPayload::ref payLoad = std::make_shared<JingleS5BTransportPayload>();
payLoad->setSessionID("mysession");
jingleContentPayload->addTransport(payLoad);
return payLoad;
}
- shared_ptr<JingleIBBTransportPayload> addJingleIBBPayload() {
- JingleIBBTransportPayload::ref payLoad = make_shared<JingleIBBTransportPayload>();
+ std::shared_ptr<JingleIBBTransportPayload> addJingleIBBPayload() {
+ JingleIBBTransportPayload::ref payLoad = std::make_shared<JingleIBBTransportPayload>();
payLoad->setSessionID("mysession");
jingleContentPayload->addTransport(payLoad);
return payLoad;
@@ -222,9 +220,9 @@ private:
private:
EventLoop* eventLoop;
- boost::shared_ptr<CryptoProvider> crypto;
- boost::shared_ptr<FakeJingleSession> session;
- shared_ptr<JingleContentPayload> jingleContentPayload;
+ std::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<FakeJingleSession> session;
+ std::shared_ptr<JingleContentPayload> jingleContentPayload;
// shared_ptr<FakeRemoteJingleTransportCandidateSelectorFactory> fakeRJTCSF;
// shared_ptr<FakeLocalJingleTransportCandidateGeneratorFactory> fakeLJTCF;
FileTransferTransporterFactory* ftTransporterFactory;
diff --git a/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp b/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp
index 401463c..3f4d20f 100644
--- a/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/OutgoingJingleFileTransferTest.cpp
@@ -11,10 +11,10 @@
*/
#include <iostream>
+#include <memory>
#include <boost/bind.hpp>
#include <boost/optional.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -81,16 +81,16 @@ class OutgoingJingleFileTransferTest : public CppUnit::TestFixture {
public:
- boost::shared_ptr<OutgoingJingleFileTransfer> createTestling(const FileTransferOptions& options = FileTransferOptions().withAssistedAllowed(false).withDirectAllowed(false).withProxiedAllowed(false)) {
+ std::shared_ptr<OutgoingJingleFileTransfer> createTestling(const FileTransferOptions& options = FileTransferOptions().withAssistedAllowed(false).withDirectAllowed(false).withProxiedAllowed(false)) {
JID to("test@foo.com/bla");
JingleFileTransferFileInfo fileInfo;
fileInfo.setDescription("some file");
fileInfo.setName("test.bin");
fileInfo.addHash(HashElement("sha-1", ByteArray()));
fileInfo.setSize(1024 * 1024);
- return boost::shared_ptr<OutgoingJingleFileTransfer>(new OutgoingJingleFileTransfer(
+ return std::shared_ptr<OutgoingJingleFileTransfer>(new OutgoingJingleFileTransfer(
to,
- boost::shared_ptr<JingleSession>(fakeJingleSession),
+ std::shared_ptr<JingleSession>(fakeJingleSession),
stream,
ftTransportFactory,
timerFactory,
@@ -107,9 +107,9 @@ public:
}
void setUp() {
- crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
fakeJingleSession = new FakeJingleSession("foo@bar.com/baz", "mysession");
- jingleContentPayload = boost::make_shared<JingleContentPayload>();
+ jingleContentPayload = std::make_shared<JingleContentPayload>();
stanzaChannel = new DummyStanzaChannel();
iqRouter = new IQRouter(stanzaChannel);
eventLoop = new DummyEventLoop();
@@ -126,7 +126,7 @@ public:
data.push_back(34);
}
- stream = boost::make_shared<ByteArrayReadBytestream>(data);
+ stream = std::make_shared<ByteArrayReadBytestream>(data);
idGen = new IDGenerator();
s5bProxy = new SOCKS5BytestreamProxiesManager(connectionFactory, timerFactory, resolver, iqRouter, "bar.com");
@@ -151,29 +151,29 @@ public:
void test_SendSessionInitiateOnStart() {
- boost::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling();
+ std::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling();
transfer->start();
FakeJingleSession::InitiateCall call = getCall<FakeJingleSession::InitiateCall>(0);
- JingleFileTransferDescription::ref description = boost::dynamic_pointer_cast<JingleFileTransferDescription>(call.description);
+ JingleFileTransferDescription::ref description = std::dynamic_pointer_cast<JingleFileTransferDescription>(call.description);
CPPUNIT_ASSERT(description);
CPPUNIT_ASSERT(static_cast<size_t>(1048576) == description->getFileInfo().getSize());
- JingleIBBTransportPayload::ref transport = boost::dynamic_pointer_cast<JingleIBBTransportPayload>(call.payload);
+ JingleIBBTransportPayload::ref transport = std::dynamic_pointer_cast<JingleIBBTransportPayload>(call.payload);
CPPUNIT_ASSERT(transport);
}
void test_FallbackToIBBAfterFailingS5B() {
- boost::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling(FileTransferOptions().withAssistedAllowed(true).withDirectAllowed(true).withProxiedAllowed(true));
+ std::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling(FileTransferOptions().withAssistedAllowed(true).withDirectAllowed(true).withProxiedAllowed(true));
transfer->start();
FakeJingleSession::InitiateCall call = getCall<FakeJingleSession::InitiateCall>(0);
- CPPUNIT_ASSERT(boost::dynamic_pointer_cast<JingleS5BTransportPayload>(call.payload));
+ CPPUNIT_ASSERT(std::dynamic_pointer_cast<JingleS5BTransportPayload>(call.payload));
fakeJingleSession->handleSessionAcceptReceived(call.id, call.description, call.payload);
// send candidate failure
- JingleS5BTransportPayload::ref candidateFailurePayload = boost::make_shared<JingleS5BTransportPayload>();
+ JingleS5BTransportPayload::ref candidateFailurePayload = std::make_shared<JingleS5BTransportPayload>();
candidateFailurePayload->setCandidateError(true);
candidateFailurePayload->setSessionID(call.payload->getSessionID());
fakeJingleSession->handleTransportInfoReceived(call.id, candidateFailurePayload);
@@ -193,7 +193,7 @@ public:
}
void test_ReceiveSessionTerminateAfterSessionInitiate() {
- boost::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling();
+ std::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling();
transfer->start();
getCall<FakeJingleSession::InitiateCall>(0);
@@ -207,7 +207,7 @@ public:
}
void test_DeclineEmitsFinishedStateCanceled() {
- boost::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling();
+ std::shared_ptr<OutgoingJingleFileTransfer> transfer = createTestling();
transfer->start();
getCall<FakeJingleSession::InitiateCall>(0);
@@ -227,20 +227,20 @@ public:
private:
void addFileTransferDescription() {
- boost::shared_ptr<JingleFileTransferDescription> desc = boost::make_shared<JingleFileTransferDescription>();
+ std::shared_ptr<JingleFileTransferDescription> desc = std::make_shared<JingleFileTransferDescription>();
desc->setFileInfo(JingleFileTransferFileInfo());
jingleContentPayload->addDescription(desc);
}
- boost::shared_ptr<JingleS5BTransportPayload> addJingleS5BPayload() {
- JingleS5BTransportPayload::ref payLoad = boost::make_shared<JingleS5BTransportPayload>();
+ std::shared_ptr<JingleS5BTransportPayload> addJingleS5BPayload() {
+ JingleS5BTransportPayload::ref payLoad = std::make_shared<JingleS5BTransportPayload>();
payLoad->setSessionID("mysession");
jingleContentPayload->addTransport(payLoad);
return payLoad;
}
- boost::shared_ptr<JingleIBBTransportPayload> addJingleIBBPayload() {
- JingleIBBTransportPayload::ref payLoad = boost::make_shared<JingleIBBTransportPayload>();
+ std::shared_ptr<JingleIBBTransportPayload> addJingleIBBPayload() {
+ JingleIBBTransportPayload::ref payLoad = std::make_shared<JingleIBBTransportPayload>();
payLoad->setSessionID("mysession");
jingleContentPayload->addTransport(payLoad);
return payLoad;
@@ -260,9 +260,9 @@ private:
private:
std::vector<unsigned char> data;
- boost::shared_ptr<ByteArrayReadBytestream> stream;
+ std::shared_ptr<ByteArrayReadBytestream> stream;
FakeJingleSession* fakeJingleSession;
- boost::shared_ptr<JingleContentPayload> jingleContentPayload;
+ std::shared_ptr<JingleContentPayload> jingleContentPayload;
FileTransferTransporterFactory* ftTransportFactory;
SOCKS5BytestreamServerManager* bytestreamServerManager;
DummyStanzaChannel* stanzaChannel;
@@ -274,7 +274,7 @@ private:
DummyTimerFactory* timerFactory;
DummyConnectionFactory* connectionFactory;
DummyConnectionServerFactory* serverConnectionFactory;
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> crypto;
NetworkEnvironment* networkEnvironment;
NATTraverser* natTraverser;
DomainNameResolver* resolver;
diff --git a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp
index 9690c09..5408cd4 100644
--- a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp
@@ -10,11 +10,12 @@
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/bind.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/variate_generator.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <QA/Checker/IO.h>
@@ -55,14 +56,14 @@ public:
SOCKS5BytestreamClientSessionTest() : destinationAddressPort(HostAddressPort(HostAddress("127.0.0.1"), 8888)) {}
void setUp() {
- crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
destination = "092a44d859d19c9eed676b551ee80025903351c2";
randomGen.seed(static_cast<unsigned int>(time(nullptr)));
eventLoop = new DummyEventLoop();
timerFactory = new DummyTimerFactory();
- connection = boost::make_shared<MockeryConnection>(failingPorts, true, eventLoop);
+ connection = std::make_shared<MockeryConnection>(failingPorts, true, eventLoop);
//connection->onDataSent.connect(boost::bind(&SOCKS5BytestreamServerSessionTest::handleDataWritten, this, _1));
- //stream1 = boost::make_shared<ByteArrayReadBytestream>(createByteArray("abcdefg")));
+ //stream1 = std::make_shared<ByteArrayReadBytestream>(createByteArray("abcdefg")));
// connection->onDataRead.connect(boost::bind(&SOCKS5BytestreamClientSessionTest::handleDataRead, this, _1));
}
@@ -76,7 +77,7 @@ public:
TestHelper helper;
connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1));
- SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
+ SOCKS5BytestreamClientSession::ref clientSession = std::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1));
clientSession->start();
@@ -102,7 +103,7 @@ public:
TestHelper helper;
connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1));
- SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
+ SOCKS5BytestreamClientSession::ref clientSession = std::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1));
clientSession->start();
@@ -122,7 +123,7 @@ public:
TestHelper helper;
connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1));
- SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
+ SOCKS5BytestreamClientSession::ref clientSession = std::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1));
clientSession->start();
@@ -149,7 +150,7 @@ public:
TestHelper helper;
connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1));
- SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
+ SOCKS5BytestreamClientSession::ref clientSession = std::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1));
clientSession->start();
@@ -165,7 +166,7 @@ public:
CPPUNIT_ASSERT_EQUAL(true, helper.sessionReadyCalled);
CPPUNIT_ASSERT_EQUAL(false, helper.sessionReadyError);
- boost::shared_ptr<ByteArrayWriteBytestream> output = boost::make_shared<ByteArrayWriteBytestream>();
+ std::shared_ptr<ByteArrayWriteBytestream> output = std::make_shared<ByteArrayWriteBytestream>();
clientSession->startReceiving(output);
ByteArray transferData = generateRandomByteArray(1024);
@@ -177,7 +178,7 @@ public:
TestHelper helper;
connection->onDataSent.connect(boost::bind(&TestHelper::handleConnectionDataWritten, &helper, _1));
- SOCKS5BytestreamClientSession::ref clientSession = boost::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
+ SOCKS5BytestreamClientSession::ref clientSession = std::make_shared<SOCKS5BytestreamClientSession>(connection, destinationAddressPort, destination, timerFactory);
clientSession->onSessionReady.connect(boost::bind(&TestHelper::handleSessionReady, &helper, _1));
clientSession->start();
@@ -195,7 +196,7 @@ public:
helper.unprocessedInput.clear();
ByteArray transferData = generateRandomByteArray(1024);
- boost::shared_ptr<ByteArrayReadBytestream> input = boost::make_shared<ByteArrayReadBytestream>(transferData);
+ std::shared_ptr<ByteArrayReadBytestream> input = std::make_shared<ByteArrayReadBytestream>(transferData);
clientSession->startSending(input);
eventLoop->processEvents();
@@ -225,7 +226,7 @@ private:
}
void serverRespondRequestOK() {
- boost::shared_ptr<SafeByteArray> dataToSend = createSafeByteArrayRef("\x05\x00\x00\x03", 4);
+ std::shared_ptr<SafeByteArray> dataToSend = createSafeByteArrayRef("\x05\x00\x00\x03", 4);
append(*dataToSend, createSafeByteArray(static_cast<char>(destination.size())));
append(*dataToSend, createSafeByteArray(destination));
append(*dataToSend, createSafeByteArray("\x00", 1));
@@ -233,12 +234,12 @@ private:
}
void serverRespondRequestFail() {
- boost::shared_ptr<SafeByteArray> correctData = createSafeByteArrayRef("\x05\x00\x00\x03", 4);
+ std::shared_ptr<SafeByteArray> correctData = createSafeByteArrayRef("\x05\x00\x00\x03", 4);
append(*correctData, createSafeByteArray(static_cast<char>(destination.size())));
append(*correctData, createSafeByteArray(destination));
append(*correctData, createSafeByteArray("\x00", 1));
- boost::shared_ptr<SafeByteArray> dataToSend;
+ std::shared_ptr<SafeByteArray> dataToSend;
//ByteArray failingData = Hexify::unhexify("8417947d1d305c72c11520ea7d2c6e787396705e72c312c6ccc3f66613d7cae1b91b7ab48e8b59a17d559c15fb51");
//append(dataToSend, failingData);
//SWIFT_LOG(debug) << "hexed: " << Hexify::hexify(failingData) << std::endl;
@@ -269,7 +270,7 @@ private:
private:
- struct MockeryConnection : public Connection, public EventOwner, public boost::enable_shared_from_this<MockeryConnection> {
+ struct MockeryConnection : public Connection, public EventOwner, public std::enable_shared_from_this<MockeryConnection> {
public:
MockeryConnection(const std::vector<HostAddressPort>& failingPorts, bool isResponsive, EventLoop* eventLoop) : eventLoop(eventLoop), failingPorts(failingPorts), isResponsive(isResponsive), disconnectCalled(false) {}
@@ -309,9 +310,9 @@ private:
std::string destination;
DummyEventLoop* eventLoop;
DummyTimerFactory* timerFactory;
- boost::shared_ptr<MockeryConnection> connection;
+ std::shared_ptr<MockeryConnection> connection;
const std::vector<HostAddressPort> failingPorts;
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> crypto;
};
CPPUNIT_TEST_SUITE_REGISTRATION(SOCKS5BytestreamClientSessionTest);
diff --git a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp
index 12690ff..d419b8a 100644
--- a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp
@@ -37,9 +37,9 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
receivedDataChunks = 0;
eventLoop = new DummyEventLoop();
bytestreams = new SOCKS5BytestreamRegistry();
- connection = boost::make_shared<DummyConnection>(eventLoop);
+ connection = std::make_shared<DummyConnection>(eventLoop);
connection->onDataSent.connect(boost::bind(&SOCKS5BytestreamServerSessionTest::handleDataWritten, this, _1));
- stream1 = boost::make_shared<ByteArrayReadBytestream>(createByteArray("abcdefg"));
+ stream1 = std::make_shared<ByteArrayReadBytestream>(createByteArray("abcdefg"));
finished = false;
}
@@ -50,7 +50,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testAuthenticate() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
receive(createSafeByteArray("\x05\x02\x01\x02"));
@@ -59,7 +59,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testAuthenticate_Chunked() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
receive(createSafeByteArray("\x05\x02\x01"));
@@ -70,7 +70,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testRequest() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
bytestreams->setHasBytestream("abcdef", true);
authenticate();
@@ -81,7 +81,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testRequest_UnknownBytestream() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
authenticate();
@@ -91,7 +91,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testReceiveData() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
bytestreams->setHasBytestream("abcdef", true);
authenticate();
@@ -106,7 +106,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testReceiveData_Chunked() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
testling->setChunkSize(3);
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
bytestreams->setHasBytestream("abcdef", true);
@@ -121,7 +121,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testDataStreamPauseStopsSendingData() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
testling->setChunkSize(3);
stream1->setDataComplete(false);
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
@@ -140,7 +140,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void testDataStreamResumeAfterPauseSendsData() {
- boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
+ std::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
testling->setChunkSize(3);
stream1->setDataComplete(false);
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
@@ -202,10 +202,10 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
private:
DummyEventLoop* eventLoop;
SOCKS5BytestreamRegistry* bytestreams;
- boost::shared_ptr<DummyConnection> connection;
+ std::shared_ptr<DummyConnection> connection;
std::vector<unsigned char> receivedData;
int receivedDataChunks;
- boost::shared_ptr<ByteArrayReadBytestream> stream1;
+ std::shared_ptr<ByteArrayReadBytestream> stream1;
bool finished;
boost::optional<FileTransferError> error;
};
diff --git a/Swiften/FileTransfer/WriteBytestream.h b/Swiften/FileTransfer/WriteBytestream.h
index ffcfdcc..ccc7880 100644
--- a/Swiften/FileTransfer/WriteBytestream.h
+++ b/Swiften/FileTransfer/WriteBytestream.h
@@ -6,17 +6,16 @@
#pragma once
+#include <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
namespace Swift {
class SWIFTEN_API WriteBytestream {
public:
- typedef boost::shared_ptr<WriteBytestream> ref;
+ typedef std::shared_ptr<WriteBytestream> ref;
virtual ~WriteBytestream();
diff --git a/Swiften/History/UnitTest/SQLiteHistoryManagerTest.cpp b/Swiften/History/UnitTest/SQLiteHistoryManagerTest.cpp
index 5968d7e..4d8a111 100644
--- a/Swiften/History/UnitTest/SQLiteHistoryManagerTest.cpp
+++ b/Swiften/History/UnitTest/SQLiteHistoryManagerTest.cpp
@@ -35,7 +35,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void testAddMessage() {
- boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ std::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
HistoryMessage testMessage("Test", JID("foo@bar.com"), JID("fum@baz.org"), boost::posix_time::time_from_string("1980-01-21 22:03"));
testling->addMessage(testMessage);
@@ -45,7 +45,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void testAddMessage_TwoMessages() {
- boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ std::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
HistoryMessage testMessage1("Test1", JID("foo@bar.com"), JID("fum@baz.org"), boost::posix_time::time_from_string("1980-01-21 22:03"));
testling->addMessage(testMessage1);
HistoryMessage testMessage2("Test2", JID("fum@baz.org"), JID("foo@bar.com"), boost::posix_time::time_from_string("1975-03-09 22:04"));
@@ -58,7 +58,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void testGetIDForJID_SameJID() {
- boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ std::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
int id1 = testling->getIDForJID(JID("foo@bar.com"));
int id2 = testling->getIDForJID(JID("foo@bar.com"));
@@ -66,7 +66,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void testGetIDForJID_DifferentJIDs() {
- boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ std::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
int id1 = testling->getIDForJID(JID("foo@bar.com"));
int id2 = testling->getIDForJID(JID("foo@baz.com"));
@@ -74,7 +74,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void getJIDFromID() {
- boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ std::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
int id = testling->addJID(JID("foo@bar.com"));
boost::optional<JID> result(testling->getJIDFromID(id));
@@ -83,7 +83,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void getJIDFromID_UnexistingID() {
- boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ std::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
boost::optional<JID> result(testling->getJIDFromID(1));
@@ -91,7 +91,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void getIDFromJID() {
- boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ std::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
int id = testling->addJID(JID("foo@bar.com"));
boost::optional<int> result(testling->getIDFromJID(JID("foo@bar.com")));
@@ -100,7 +100,7 @@ class SQLiteHistoryManagerTest : public CppUnit::TestFixture {
}
void getIDFromJID_UnexistingJID() {
- boost::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
+ std::shared_ptr<SQLiteHistoryManager> testling(createHistoryManager());
boost::optional<int> result(testling->getIDFromJID(JID("foo@bar.com")));
diff --git a/Swiften/IDN/ICUConverter.cpp b/Swiften/IDN/ICUConverter.cpp
index b83739c..d6b0827 100644
--- a/Swiften/IDN/ICUConverter.cpp
+++ b/Swiften/IDN/ICUConverter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2013 Isode Limited.
+ * Copyright (c) 2012-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -87,7 +87,7 @@ namespace {
std::vector<char, SafeAllocator<char> > getStringPreparedDetail(const StringType& s, IDNConverter::StringPrepProfile profile) {
UErrorCode status = U_ZERO_ERROR;
- boost::shared_ptr<UStringPrepProfile> icuProfile(usprep_openByType(getICUProfileType(profile), &status), usprep_close);
+ std::shared_ptr<UStringPrepProfile> icuProfile(usprep_openByType(getICUProfileType(profile), &status), usprep_close);
assert(U_SUCCESS(status));
ICUString icuInput = convertToICUString(s);
diff --git a/Swiften/IDN/LibIDNConverter.cpp b/Swiften/IDN/LibIDNConverter.cpp
index 0823bcc..0c01352 100644
--- a/Swiften/IDN/LibIDNConverter.cpp
+++ b/Swiften/IDN/LibIDNConverter.cpp
@@ -15,7 +15,7 @@ extern "C" {
#include <cstdlib>
#include <vector>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/ByteArray.h>
#include <Swiften/Base/SafeAllocator.h>
diff --git a/Swiften/IDN/UnitTest/IDNConverterTest.cpp b/Swiften/IDN/UnitTest/IDNConverterTest.cpp
index e0c97b5..508a28c 100644
--- a/Swiften/IDN/UnitTest/IDNConverterTest.cpp
+++ b/Swiften/IDN/UnitTest/IDNConverterTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -25,7 +25,7 @@ class IDNConverterTest : public CppUnit::TestFixture {
public:
void setUp() {
- testling = boost::shared_ptr<IDNConverter>(PlatformIDNConverter::create());
+ testling = std::shared_ptr<IDNConverter>(PlatformIDNConverter::create());
}
void testStringPrep() {
@@ -58,7 +58,7 @@ class IDNConverterTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<IDNConverter> testling;
+ std::shared_ptr<IDNConverter> testling;
};
CPPUNIT_TEST_SUITE_REGISTRATION(IDNConverterTest);
diff --git a/Swiften/JID/JID.cpp b/Swiften/JID/JID.cpp
index b1805df..c7abe45 100644
--- a/Swiften/JID/JID.cpp
+++ b/Swiften/JID/JID.cpp
@@ -26,7 +26,7 @@
#include <Swiften/JID/JID.h>
#include <Swiften/IDN/IDNConverter.h>
#ifndef SWIFTEN_JID_NO_DEFAULT_IDN_CONVERTER
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/IDN/PlatformIDNConverter.h>
#endif
@@ -51,7 +51,7 @@ namespace {
IDNInitializer() : defaultIDNConverter(PlatformIDNConverter::create()) {
idnConverter = defaultIDNConverter.get();
}
- boost::shared_ptr<IDNConverter> defaultIDNConverter;
+ std::shared_ptr<IDNConverter> defaultIDNConverter;
} initializer;
}
#endif
diff --git a/Swiften/Jingle/AbstractJingleSessionListener.cpp b/Swiften/Jingle/AbstractJingleSessionListener.cpp
index 791dcb3..20edf15 100644
--- a/Swiften/Jingle/AbstractJingleSessionListener.cpp
+++ b/Swiften/Jingle/AbstractJingleSessionListener.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -10,11 +10,11 @@
using namespace Swift;
-void AbstractJingleSessionListener::handleSessionAcceptReceived(const JingleContentID&, boost::shared_ptr<JingleDescription>, boost::shared_ptr<JingleTransportPayload>) {
+void AbstractJingleSessionListener::handleSessionAcceptReceived(const JingleContentID&, std::shared_ptr<JingleDescription>, std::shared_ptr<JingleTransportPayload>) {
SWIFT_LOG(warning) << "Unimplemented" << std::endl;
}
-void AbstractJingleSessionListener::handleSessionInfoReceived(boost::shared_ptr<JinglePayload>) {
+void AbstractJingleSessionListener::handleSessionInfoReceived(std::shared_ptr<JinglePayload>) {
SWIFT_LOG(warning) << "Unimplemented" << std::endl;
}
@@ -22,19 +22,19 @@ void AbstractJingleSessionListener::handleSessionTerminateReceived(boost::option
SWIFT_LOG(warning) << "Unimplemented" << std::endl;
}
-void AbstractJingleSessionListener::handleTransportAcceptReceived(const JingleContentID&, boost::shared_ptr<JingleTransportPayload>) {
+void AbstractJingleSessionListener::handleTransportAcceptReceived(const JingleContentID&, std::shared_ptr<JingleTransportPayload>) {
SWIFT_LOG(warning) << "Unimplemented" << std::endl;
}
-void AbstractJingleSessionListener::handleTransportInfoReceived(const JingleContentID&, boost::shared_ptr<JingleTransportPayload>) {
+void AbstractJingleSessionListener::handleTransportInfoReceived(const JingleContentID&, std::shared_ptr<JingleTransportPayload>) {
SWIFT_LOG(warning) << "Unimplemented" << std::endl;
}
-void AbstractJingleSessionListener::handleTransportRejectReceived(const JingleContentID&, boost::shared_ptr<JingleTransportPayload>) {
+void AbstractJingleSessionListener::handleTransportRejectReceived(const JingleContentID&, std::shared_ptr<JingleTransportPayload>) {
SWIFT_LOG(warning) << "Unimplemented" << std::endl;
}
-void AbstractJingleSessionListener::handleTransportReplaceReceived(const JingleContentID&, boost::shared_ptr<JingleTransportPayload>) {
+void AbstractJingleSessionListener::handleTransportReplaceReceived(const JingleContentID&, std::shared_ptr<JingleTransportPayload>) {
SWIFT_LOG(warning) << "Unimplemented" << std::endl;
}
diff --git a/Swiften/Jingle/AbstractJingleSessionListener.h b/Swiften/Jingle/AbstractJingleSessionListener.h
index 678f173..590cd14 100644
--- a/Swiften/Jingle/AbstractJingleSessionListener.h
+++ b/Swiften/Jingle/AbstractJingleSessionListener.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,13 +13,13 @@
namespace Swift {
class SWIFTEN_API AbstractJingleSessionListener : public JingleSessionListener {
public:
- virtual void handleSessionAcceptReceived(const JingleContentID&, boost::shared_ptr<JingleDescription>, boost::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
- virtual void handleSessionInfoReceived(boost::shared_ptr<JinglePayload>) SWIFTEN_OVERRIDE;
+ virtual void handleSessionAcceptReceived(const JingleContentID&, std::shared_ptr<JingleDescription>, std::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
+ virtual void handleSessionInfoReceived(std::shared_ptr<JinglePayload>) SWIFTEN_OVERRIDE;
virtual void handleSessionTerminateReceived(boost::optional<JinglePayload::Reason>) SWIFTEN_OVERRIDE;
- virtual void handleTransportAcceptReceived(const JingleContentID&, boost::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
- virtual void handleTransportInfoReceived(const JingleContentID&, boost::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
- virtual void handleTransportRejectReceived(const JingleContentID&, boost::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
- virtual void handleTransportReplaceReceived(const JingleContentID&, boost::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
+ virtual void handleTransportAcceptReceived(const JingleContentID&, std::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
+ virtual void handleTransportInfoReceived(const JingleContentID&, std::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
+ virtual void handleTransportRejectReceived(const JingleContentID&, std::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
+ virtual void handleTransportReplaceReceived(const JingleContentID&, std::shared_ptr<JingleTransportPayload>) SWIFTEN_OVERRIDE;
virtual void handleTransportInfoAcknowledged(const std::string& id) SWIFTEN_OVERRIDE;
};
}
diff --git a/Swiften/Jingle/FakeJingleSession.cpp b/Swiften/Jingle/FakeJingleSession.cpp
index ec792ab..6b88477 100644
--- a/Swiften/Jingle/FakeJingleSession.cpp
+++ b/Swiften/Jingle/FakeJingleSession.cpp
@@ -12,7 +12,7 @@
#include <Swiften/Jingle/FakeJingleSession.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Jingle/JingleSessionListener.h>
@@ -33,7 +33,7 @@ void FakeJingleSession::sendTerminate(JinglePayload::Reason::Type reason) {
calledCommands.push_back(TerminateCall(reason));
}
-void FakeJingleSession::sendInfo(boost::shared_ptr<Payload> payload) {
+void FakeJingleSession::sendInfo(std::shared_ptr<Payload> payload) {
calledCommands.push_back(InfoCall(payload));
}
@@ -74,7 +74,7 @@ void FakeJingleSession::handleSessionTerminateReceived(boost::optional<JinglePay
notifyListeners(&JingleSessionListener::handleSessionTerminateReceived, reason);
}
-void FakeJingleSession::handleSessionAcceptReceived(const JingleContentID& contentID, boost::shared_ptr<JingleDescription> desc, boost::shared_ptr<JingleTransportPayload> payload) {
+void FakeJingleSession::handleSessionAcceptReceived(const JingleContentID& contentID, std::shared_ptr<JingleDescription> desc, std::shared_ptr<JingleTransportPayload> payload) {
notifyListeners(&JingleSessionListener::handleSessionAcceptReceived, contentID, desc, payload);
}
diff --git a/Swiften/Jingle/FakeJingleSession.h b/Swiften/Jingle/FakeJingleSession.h
index 0107384..d961d1d 100644
--- a/Swiften/Jingle/FakeJingleSession.h
+++ b/Swiften/Jingle/FakeJingleSession.h
@@ -12,10 +12,10 @@
#pragma once
+#include <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
#include <boost/variant.hpp>
#include <Swiften/Base/API.h>
@@ -45,8 +45,8 @@ namespace Swift {
};
struct InfoCall {
- InfoCall(boost::shared_ptr<Payload> info) : payload(info) {}
- boost::shared_ptr<Payload> payload;
+ InfoCall(std::shared_ptr<Payload> info) : payload(info) {}
+ std::shared_ptr<Payload> payload;
};
struct AcceptCall {
@@ -83,14 +83,14 @@ namespace Swift {
typedef boost::variant<InitiateCall, TerminateCall, AcceptCall, InfoCall, InfoTransportCall, AcceptTransportCall, RejectTransportCall, ReplaceTransportCall> Command;
public:
- typedef boost::shared_ptr<FakeJingleSession> ref;
+ typedef std::shared_ptr<FakeJingleSession> ref;
FakeJingleSession(const JID& initiator, const std::string& id);
virtual ~FakeJingleSession();
virtual void sendInitiate(const JingleContentID&, JingleDescription::ref, JingleTransportPayload::ref) SWIFTEN_OVERRIDE;
virtual void sendTerminate(JinglePayload::Reason::Type reason) SWIFTEN_OVERRIDE;
- virtual void sendInfo(boost::shared_ptr<Payload>) SWIFTEN_OVERRIDE;
+ virtual void sendInfo(std::shared_ptr<Payload>) SWIFTEN_OVERRIDE;
virtual void sendAccept(const JingleContentID&, JingleDescription::ref, JingleTransportPayload::ref = JingleTransportPayload::ref()) SWIFTEN_OVERRIDE;
virtual std::string sendTransportInfo(const JingleContentID&, JingleTransportPayload::ref) SWIFTEN_OVERRIDE;
virtual void sendTransportAccept(const JingleContentID&, JingleTransportPayload::ref) SWIFTEN_OVERRIDE;
@@ -98,13 +98,13 @@ namespace Swift {
virtual void sendTransportReplace(const JingleContentID&, JingleTransportPayload::ref) SWIFTEN_OVERRIDE;
void handleSessionTerminateReceived(boost::optional<JinglePayload::Reason>);
- void handleSessionAcceptReceived(const JingleContentID&, boost::shared_ptr<JingleDescription>, boost::shared_ptr<JingleTransportPayload>);
- void handleSessionInfoReceived(boost::shared_ptr<JinglePayload>);
+ void handleSessionAcceptReceived(const JingleContentID&, std::shared_ptr<JingleDescription>, std::shared_ptr<JingleTransportPayload>);
+ void handleSessionInfoReceived(std::shared_ptr<JinglePayload>);
void handleTransportReplaceReceived(const JingleContentID&, JingleTransportPayload::ref);
- void handleTransportAcceptReceived(const JingleContentID&, boost::shared_ptr<JingleTransportPayload>);
- void handleTransportInfoReceived(const JingleContentID&, boost::shared_ptr<JingleTransportPayload>);
- void handleTransportRejectReceived(const JingleContentID&, boost::shared_ptr<JingleTransportPayload>);
+ void handleTransportAcceptReceived(const JingleContentID&, std::shared_ptr<JingleTransportPayload>);
+ void handleTransportInfoReceived(const JingleContentID&, std::shared_ptr<JingleTransportPayload>);
+ void handleTransportRejectReceived(const JingleContentID&, std::shared_ptr<JingleTransportPayload>);
void handleTransportInfoAcknowledged(const std::string& id);
public:
diff --git a/Swiften/Jingle/JingleResponder.cpp b/Swiften/Jingle/JingleResponder.cpp
index d0c2edd..09bb234 100644
--- a/Swiften/Jingle/JingleResponder.cpp
+++ b/Swiften/Jingle/JingleResponder.cpp
@@ -6,7 +6,7 @@
#include <Swiften/Jingle/JingleResponder.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/Log.h>
#include <Swiften/Jingle/JingleSessionImpl.h>
@@ -20,16 +20,16 @@ JingleResponder::JingleResponder(JingleSessionManager* sessionManager, IQRouter*
JingleResponder::~JingleResponder() {
}
-bool JingleResponder::handleSetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr<JinglePayload> payload) {
+bool JingleResponder::handleSetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr<JinglePayload> payload) {
if (payload->getAction() == JinglePayload::SessionInitiate) {
if (sessionManager->getSession(from, payload->getSessionID())) {
// TODO: Add tie-break error
sendError(from, id, ErrorPayload::Conflict, ErrorPayload::Cancel);
}
else {
- sendResponse(from, id, boost::shared_ptr<JinglePayload>());
+ sendResponse(from, id, std::shared_ptr<JinglePayload>());
if (!payload->getInitiator().isBare()) {
- JingleSessionImpl::ref session = boost::make_shared<JingleSessionImpl>(payload->getInitiator(), from, payload->getSessionID(), router);
+ JingleSessionImpl::ref session = std::make_shared<JingleSessionImpl>(payload->getInitiator(), from, payload->getSessionID(), router);
sessionManager->handleIncomingSession(from, to, session, payload->getContents());
} else {
SWIFT_LOG(debug) << "Unable to create Jingle session due to initiator not being a full JID." << std::endl;
@@ -47,7 +47,7 @@ bool JingleResponder::handleSetRequest(const JID& from, const JID& to, const std
}
if (session) {
session->handleIncomingAction(payload);
- sendResponse(from, id, boost::shared_ptr<JinglePayload>());
+ sendResponse(from, id, std::shared_ptr<JinglePayload>());
}
else {
SWIFT_LOG(warning) << "Didn't find jingle session!";
diff --git a/Swiften/Jingle/JingleResponder.h b/Swiften/Jingle/JingleResponder.h
index 1340835..cb9220c 100644
--- a/Swiften/Jingle/JingleResponder.h
+++ b/Swiften/Jingle/JingleResponder.h
@@ -19,7 +19,7 @@ namespace Swift {
JingleResponder(JingleSessionManager* sessionManager, IQRouter* router);
virtual ~JingleResponder();
private:
- virtual bool handleSetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr<JinglePayload> payload);
+ virtual bool handleSetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr<JinglePayload> payload);
private:
JingleSessionManager* sessionManager;
diff --git a/Swiften/Jingle/JingleSession.cpp b/Swiften/Jingle/JingleSession.cpp
index 8abbd56..778ee1d 100644
--- a/Swiften/Jingle/JingleSession.cpp
+++ b/Swiften/Jingle/JingleSession.cpp
@@ -7,9 +7,9 @@
#include <Swiften/Jingle/JingleSession.h>
#include <algorithm>
+#include <memory>
#include <boost/function.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/foreach.h>
diff --git a/Swiften/Jingle/JingleSession.h b/Swiften/Jingle/JingleSession.h
index 7a64c47..993e8de 100644
--- a/Swiften/Jingle/JingleSession.h
+++ b/Swiften/Jingle/JingleSession.h
@@ -6,11 +6,11 @@
#pragma once
+#include <memory>
#include <string>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Listenable.h>
@@ -24,7 +24,7 @@ namespace Swift {
class SWIFTEN_API JingleSession : public Listenable<JingleSessionListener> {
public:
- typedef boost::shared_ptr<JingleSession> ref;
+ typedef std::shared_ptr<JingleSession> ref;
JingleSession(const JID& initiator, const std::string& id);
virtual ~JingleSession();
@@ -39,7 +39,7 @@ namespace Swift {
virtual void sendInitiate(const JingleContentID&, JingleDescription::ref, JingleTransportPayload::ref) = 0;
virtual void sendTerminate(JinglePayload::Reason::Type reason) = 0;
- virtual void sendInfo(boost::shared_ptr<Payload>) = 0;
+ virtual void sendInfo(std::shared_ptr<Payload>) = 0;
virtual void sendAccept(const JingleContentID&, JingleDescription::ref, JingleTransportPayload::ref = JingleTransportPayload::ref()) = 0;
virtual std::string sendTransportInfo(const JingleContentID&, JingleTransportPayload::ref) = 0;
virtual void sendTransportAccept(const JingleContentID&, JingleTransportPayload::ref) = 0;
diff --git a/Swiften/Jingle/JingleSessionImpl.cpp b/Swiften/Jingle/JingleSessionImpl.cpp
index 3063242..06aa039 100644
--- a/Swiften/Jingle/JingleSessionImpl.cpp
+++ b/Swiften/Jingle/JingleSessionImpl.cpp
@@ -7,9 +7,9 @@
#include <Swiften/Jingle/JingleSessionImpl.h>
#include <algorithm>
+#include <memory>
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Log.h>
#include <Swiften/Elements/JingleContentPayload.h>
@@ -81,9 +81,9 @@ void JingleSessionImpl::handleIncomingAction(JinglePayload::ref action) {
}
void JingleSessionImpl::sendInitiate(const JingleContentID& id, JingleDescription::ref description, JingleTransportPayload::ref transport) {
- JinglePayload::ref payload = boost::make_shared<JinglePayload>(JinglePayload::SessionInitiate, getID());
+ JinglePayload::ref payload = std::make_shared<JinglePayload>(JinglePayload::SessionInitiate, getID());
payload->setInitiator(getInitiator());
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(id.getCreator());
content->setName(id.getName());
content->addDescription(description);
@@ -94,14 +94,14 @@ void JingleSessionImpl::sendInitiate(const JingleContentID& id, JingleDescriptio
}
void JingleSessionImpl::sendTerminate(JinglePayload::Reason::Type reason) {
- JinglePayload::ref payload = boost::make_shared<JinglePayload>(JinglePayload::SessionTerminate, getID());
+ JinglePayload::ref payload = std::make_shared<JinglePayload>(JinglePayload::SessionTerminate, getID());
payload->setReason(JinglePayload::Reason(reason));
payload->setInitiator(getInitiator());
sendSetRequest(payload);
}
-void JingleSessionImpl::sendInfo(boost::shared_ptr<Payload> info) {
- JinglePayload::ref payload = boost::make_shared<JinglePayload>(JinglePayload::SessionInfo, getID());
+void JingleSessionImpl::sendInfo(std::shared_ptr<Payload> info) {
+ JinglePayload::ref payload = std::make_shared<JinglePayload>(JinglePayload::SessionInfo, getID());
payload->addPayload(info);
sendSetRequest(payload);
@@ -110,7 +110,7 @@ void JingleSessionImpl::sendInfo(boost::shared_ptr<Payload> info) {
void JingleSessionImpl::sendAccept(const JingleContentID& id, JingleDescription::ref description, JingleTransportPayload::ref transPayload) {
JinglePayload::ref payload = createPayload();
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(id.getCreator());
content->setName(id.getName());
content->addTransport(transPayload);
@@ -126,7 +126,7 @@ void JingleSessionImpl::sendAccept(const JingleContentID& id, JingleDescription:
void JingleSessionImpl::sendTransportAccept(const JingleContentID& id, JingleTransportPayload::ref transPayload) {
JinglePayload::ref payload = createPayload();
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(id.getCreator());
content->setName(id.getName());
content->addTransport(transPayload);
@@ -140,7 +140,7 @@ void JingleSessionImpl::sendTransportAccept(const JingleContentID& id, JingleTra
std::string JingleSessionImpl::sendTransportInfo(const JingleContentID& id, JingleTransportPayload::ref transPayload) {
JinglePayload::ref payload = createPayload();
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(id.getCreator());
content->setName(id.getName());
content->addTransport(transPayload);
@@ -153,7 +153,7 @@ std::string JingleSessionImpl::sendTransportInfo(const JingleContentID& id, Jing
void JingleSessionImpl::sendTransportReject(const JingleContentID& id, JingleTransportPayload::ref transPayload) {
JinglePayload::ref payload = createPayload();
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(id.getCreator());
content->setName(id.getName());
content->addTransport(transPayload);
@@ -166,7 +166,7 @@ void JingleSessionImpl::sendTransportReject(const JingleContentID& id, JingleTra
void JingleSessionImpl::sendTransportReplace(const JingleContentID& id, JingleTransportPayload::ref transPayload) {
JinglePayload::ref payload = createPayload();
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(id.getCreator());
content->setName(id.getName());
content->addTransport(transPayload);
@@ -178,7 +178,7 @@ void JingleSessionImpl::sendTransportReplace(const JingleContentID& id, JingleTr
std::string JingleSessionImpl::sendSetRequest(JinglePayload::ref payload) {
- boost::shared_ptr<GenericRequest<JinglePayload> > request = boost::make_shared<GenericRequest<JinglePayload> >(
+ std::shared_ptr<GenericRequest<JinglePayload> > request = std::make_shared<GenericRequest<JinglePayload> >(
IQ::Set, peerJID, payload, iqRouter);
pendingRequests.insert(std::make_pair(
request,
@@ -188,7 +188,7 @@ std::string JingleSessionImpl::sendSetRequest(JinglePayload::ref payload) {
JinglePayload::ref JingleSessionImpl::createPayload() const {
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setSessionID(getID());
payload->setInitiator(getInitiator());
return payload;
diff --git a/Swiften/Jingle/JingleSessionImpl.h b/Swiften/Jingle/JingleSessionImpl.h
index eec2370..4dd32ed 100644
--- a/Swiften/Jingle/JingleSessionImpl.h
+++ b/Swiften/Jingle/JingleSessionImpl.h
@@ -7,8 +7,7 @@
#pragma once
#include <map>
-
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Jingle/JingleSession.h>
#include <Swiften/Queries/GenericRequest.h>
@@ -20,13 +19,13 @@ namespace Swift {
class JingleSessionImpl : public JingleSession {
friend class JingleResponder;
public:
- typedef boost::shared_ptr<JingleSessionImpl> ref;
+ typedef std::shared_ptr<JingleSessionImpl> ref;
JingleSessionImpl(const JID& initiator, const JID&, const std::string& id, IQRouter* router);
virtual void sendInitiate(const JingleContentID&, JingleDescription::ref, JingleTransportPayload::ref);
virtual void sendTerminate(JinglePayload::Reason::Type reason);
- virtual void sendInfo(boost::shared_ptr<Payload>);
+ virtual void sendInfo(std::shared_ptr<Payload>);
virtual void sendAccept(const JingleContentID&, JingleDescription::ref, JingleTransportPayload::ref);
virtual std::string sendTransportInfo(const JingleContentID&, JingleTransportPayload::ref);
virtual void sendTransportAccept(const JingleContentID&, JingleTransportPayload::ref);
@@ -34,7 +33,7 @@ namespace Swift {
virtual void sendTransportReplace(const JingleContentID&, JingleTransportPayload::ref);
private:
- typedef boost::shared_ptr<GenericRequest<JinglePayload> > RequestRef;
+ typedef std::shared_ptr<GenericRequest<JinglePayload> > RequestRef;
void handleIncomingAction(JinglePayload::ref);
diff --git a/Swiften/Jingle/JingleSessionListener.h b/Swiften/Jingle/JingleSessionListener.h
index 54101b6..7c015f0 100644
--- a/Swiften/Jingle/JingleSessionListener.h
+++ b/Swiften/Jingle/JingleSessionListener.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -20,20 +20,20 @@ namespace Swift {
virtual void handleSessionAcceptReceived(
const JingleContentID&,
- boost::shared_ptr<JingleDescription>,
- boost::shared_ptr<JingleTransportPayload>) = 0;
- virtual void handleSessionInfoReceived(boost::shared_ptr<JinglePayload>) = 0;
+ std::shared_ptr<JingleDescription>,
+ std::shared_ptr<JingleTransportPayload>) = 0;
+ virtual void handleSessionInfoReceived(std::shared_ptr<JinglePayload>) = 0;
virtual void handleSessionTerminateReceived(boost::optional<JinglePayload::Reason>) = 0;
virtual void handleTransportAcceptReceived(
const JingleContentID&,
- boost::shared_ptr<JingleTransportPayload>) = 0;
+ std::shared_ptr<JingleTransportPayload>) = 0;
virtual void handleTransportInfoReceived(
const JingleContentID&,
- boost::shared_ptr<JingleTransportPayload>) = 0;
+ std::shared_ptr<JingleTransportPayload>) = 0;
virtual void handleTransportRejectReceived(
- const JingleContentID&, boost::shared_ptr<JingleTransportPayload>) = 0;
+ const JingleContentID&, std::shared_ptr<JingleTransportPayload>) = 0;
virtual void handleTransportReplaceReceived(
- const JingleContentID&, boost::shared_ptr<JingleTransportPayload>) = 0;
+ const JingleContentID&, std::shared_ptr<JingleTransportPayload>) = 0;
virtual void handleTransportInfoAcknowledged(const std::string& id) = 0;
};
diff --git a/Swiften/Jingle/JingleSessionManager.h b/Swiften/Jingle/JingleSessionManager.h
index fea6c73..0c0f775 100644
--- a/Swiften/Jingle/JingleSessionManager.h
+++ b/Swiften/Jingle/JingleSessionManager.h
@@ -7,8 +7,7 @@
#pragma once
#include <map>
-
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h
index 767ee1d..a227613 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h
@@ -17,7 +17,7 @@ namespace Swift {
class AvahiBrowseQuery : public DNSSDBrowseQuery, public AvahiQuery {
public:
- AvahiBrowseQuery(boost::shared_ptr<AvahiQuerier> q, EventLoop* eventLoop) : AvahiQuery(q, eventLoop), browser(NULL) {
+ AvahiBrowseQuery(std::shared_ptr<AvahiQuerier> q, EventLoop* eventLoop) : AvahiQuery(q, eventLoop), browser(NULL) {
}
void startBrowsing();
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp
index 11f1650..1b79946 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp
@@ -21,20 +21,20 @@ AvahiQuerier::AvahiQuerier(EventLoop* eventLoop) : eventLoop(eventLoop), client(
AvahiQuerier::~AvahiQuerier() {
}
-boost::shared_ptr<DNSSDBrowseQuery> AvahiQuerier::createBrowseQuery() {
- return boost::shared_ptr<DNSSDBrowseQuery>(new AvahiBrowseQuery(shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDBrowseQuery> AvahiQuerier::createBrowseQuery() {
+ return std::make_shared<AvahiBrowseQuery>(shared_from_this(), eventLoop);
}
-boost::shared_ptr<DNSSDRegisterQuery> AvahiQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) {
- return boost::shared_ptr<DNSSDRegisterQuery>(new AvahiRegisterQuery(name, port, info, shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDRegisterQuery> AvahiQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) {
+ return std::make_shared<AvahiRegisterQuery>(name, port, info, shared_from_this(), eventLoop);
}
-boost::shared_ptr<DNSSDResolveServiceQuery> AvahiQuerier::createResolveServiceQuery(const DNSSDServiceID& service) {
- return boost::shared_ptr<DNSSDResolveServiceQuery>(new AvahiResolveServiceQuery(service, shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDResolveServiceQuery> AvahiQuerier::createResolveServiceQuery(const DNSSDServiceID& service) {
+ return std::make_shared<AvahiResolveServiceQuery>(service, shared_from_this(), eventLoop);
}
-boost::shared_ptr<DNSSDResolveHostnameQuery> AvahiQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) {
- return boost::shared_ptr<DNSSDResolveHostnameQuery>(new AvahiResolveHostnameQuery(hostname, interfaceIndex, shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDResolveHostnameQuery> AvahiQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) {
+ return std::make_shared<AvahiResolveHostnameQuery>(hostname, interfaceIndex, shared_from_this(), eventLoop);
}
void AvahiQuerier::start() {
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h
index fa9580e..5dce19d 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h
@@ -6,8 +6,7 @@
#pragma once
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <avahi-client/client.h>
#include <avahi-client/lookup.h>
@@ -24,17 +23,17 @@ namespace Swift {
class AvahiQuerier :
public DNSSDQuerier,
- public boost::enable_shared_from_this<AvahiQuerier> {
+ public std::enable_shared_from_this<AvahiQuerier> {
public:
AvahiQuerier(EventLoop* eventLoop);
~AvahiQuerier();
- boost::shared_ptr<DNSSDBrowseQuery> createBrowseQuery();
- boost::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
+ std::shared_ptr<DNSSDBrowseQuery> createBrowseQuery();
+ std::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
const std::string& name, int port, const ByteArray& info);
- boost::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
+ std::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
const DNSSDServiceID&);
- boost::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
+ std::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
const std::string& hostname, int interfaceIndex);
void start();
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.cpp b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.cpp
index 97a7912..08997f6 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.cpp
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.cpp
@@ -10,7 +10,7 @@
namespace Swift {
-AvahiQuery::AvahiQuery(boost::shared_ptr<AvahiQuerier> q, EventLoop* eventLoop) : querier(q), eventLoop(eventLoop) {
+AvahiQuery::AvahiQuery(std::shared_ptr<AvahiQuerier> q, EventLoop* eventLoop) : querier(q), eventLoop(eventLoop) {
}
AvahiQuery::~AvahiQuery() {
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h
index 5752003..1b98bbf 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h
@@ -6,8 +6,7 @@
#pragma once
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/EventLoop/EventOwner.h>
@@ -17,13 +16,13 @@ namespace Swift {
class AvahiQuery :
public EventOwner,
- public boost::enable_shared_from_this<AvahiQuery> {
+ public std::enable_shared_from_this<AvahiQuery> {
public:
- AvahiQuery(boost::shared_ptr<AvahiQuerier>, EventLoop* eventLoop);
+ AvahiQuery(std::shared_ptr<AvahiQuerier>, EventLoop* eventLoop);
virtual ~AvahiQuery();
protected:
- boost::shared_ptr<AvahiQuerier> querier;
+ std::shared_ptr<AvahiQuerier> querier;
EventLoop* eventLoop;
};
}
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h
index 5570559..68281d0 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h
@@ -18,7 +18,7 @@ namespace Swift {
class AvahiRegisterQuery : public DNSSDRegisterQuery, public AvahiQuery {
public:
- AvahiRegisterQuery(const std::string& name, int port, const ByteArray& txtRecord, boost::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), name(name), port(port), txtRecord(txtRecord), group(0) {
+ AvahiRegisterQuery(const std::string& name, int port, const ByteArray& txtRecord, std::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), name(name), port(port), txtRecord(txtRecord), group(0) {
}
void registerService();
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp
index af1a048..6510275 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp
@@ -12,7 +12,7 @@
namespace Swift {
-AvahiResolveHostnameQuery::AvahiResolveHostnameQuery(const std::string& hostname, int, boost::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), hostname(hostname) {
+AvahiResolveHostnameQuery::AvahiResolveHostnameQuery(const std::string& hostname, int, std::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), hostname(hostname) {
std::cout << "Resolving hostname " << hostname << std::endl;
}
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h
index 9d21bf9..5498285 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h
@@ -20,7 +20,7 @@ namespace Swift {
class AvahiResolveHostnameQuery : public DNSSDResolveHostnameQuery, public AvahiQuery {
public:
- AvahiResolveHostnameQuery(const std::string& hostname, int, boost::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop);
+ AvahiResolveHostnameQuery(const std::string& hostname, int, std::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop);
void run();
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h
index c95d131..c05c73e 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h
@@ -19,7 +19,7 @@ namespace Swift {
class AvahiResolveServiceQuery : public DNSSDResolveServiceQuery, public AvahiQuery {
public:
- AvahiResolveServiceQuery(const DNSSDServiceID& service, boost::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), service(service), resolver(NULL) {
+ AvahiResolveServiceQuery(const DNSSDServiceID& service, std::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), service(service), resolver(NULL) {
}
void start();
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h
index 988f025..c049ed2 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h
@@ -17,7 +17,7 @@ namespace Swift {
class BonjourBrowseQuery : public DNSSDBrowseQuery, public BonjourQuery {
public:
- BonjourBrowseQuery(boost::shared_ptr<BonjourQuerier> q, EventLoop* eventLoop) : BonjourQuery(q, eventLoop) {
+ BonjourBrowseQuery(std::shared_ptr<BonjourQuerier> q, EventLoop* eventLoop) : BonjourQuery(q, eventLoop) {
DNSServiceErrorType result = DNSServiceBrowse(
&sdRef, 0, 0, "_presence._tcp", nullptr,
&BonjourBrowseQuery::handleServiceDiscoveredStatic, this);
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp
index fda5032..e6d8b94 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp
@@ -33,23 +33,23 @@ BonjourQuerier::~BonjourQuerier() {
assert(!thread);
}
-boost::shared_ptr<DNSSDBrowseQuery> BonjourQuerier::createBrowseQuery() {
- return boost::shared_ptr<DNSSDBrowseQuery>(new BonjourBrowseQuery(shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDBrowseQuery> BonjourQuerier::createBrowseQuery() {
+ return std::make_shared<BonjourBrowseQuery>(shared_from_this(), eventLoop);
}
-boost::shared_ptr<DNSSDRegisterQuery> BonjourQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) {
- return boost::shared_ptr<DNSSDRegisterQuery>(new BonjourRegisterQuery(name, port, info, shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDRegisterQuery> BonjourQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) {
+ return std::make_shared<BonjourRegisterQuery>(name, port, info, shared_from_this(), eventLoop);
}
-boost::shared_ptr<DNSSDResolveServiceQuery> BonjourQuerier::createResolveServiceQuery(const DNSSDServiceID& service) {
- return boost::shared_ptr<DNSSDResolveServiceQuery>(new BonjourResolveServiceQuery(service, shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDResolveServiceQuery> BonjourQuerier::createResolveServiceQuery(const DNSSDServiceID& service) {
+ return std::make_shared<BonjourResolveServiceQuery>(service, shared_from_this(), eventLoop);
}
-boost::shared_ptr<DNSSDResolveHostnameQuery> BonjourQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) {
- return boost::shared_ptr<DNSSDResolveHostnameQuery>(new BonjourResolveHostnameQuery(hostname, interfaceIndex, shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDResolveHostnameQuery> BonjourQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) {
+ return std::make_shared<BonjourResolveHostnameQuery>(hostname, interfaceIndex, shared_from_this(), eventLoop);
}
-void BonjourQuerier::addRunningQuery(boost::shared_ptr<BonjourQuery> query) {
+void BonjourQuerier::addRunningQuery(std::shared_ptr<BonjourQuery> query) {
{
boost::lock_guard<boost::mutex> lock(runningQueriesMutex);
runningQueries.push_back(query);
@@ -58,7 +58,7 @@ void BonjourQuerier::addRunningQuery(boost::shared_ptr<BonjourQuery> query) {
interruptSelect();
}
-void BonjourQuerier::removeRunningQuery(boost::shared_ptr<BonjourQuery> query) {
+void BonjourQuerier::removeRunningQuery(std::shared_ptr<BonjourQuery> query) {
{
boost::lock_guard<boost::mutex> lock(runningQueriesMutex);
erase(runningQueries, query);
@@ -106,7 +106,7 @@ void BonjourQuerier::run() {
maxSocket = interruptSelectReadSocket;
FD_SET(interruptSelectReadSocket, &fdSet);
- foreach(const boost::shared_ptr<BonjourQuery>& query, runningQueries) {
+ foreach(const std::shared_ptr<BonjourQuery>& query, runningQueries) {
int socketID = query->getSocketID();
maxSocket = std::max(maxSocket, socketID);
FD_SET(socketID, &fdSet);
@@ -124,7 +124,7 @@ void BonjourQuerier::run() {
{
boost::lock_guard<boost::mutex> lock(runningQueriesMutex);
- foreach(boost::shared_ptr<BonjourQuery> query, runningQueries) {
+ foreach(std::shared_ptr<BonjourQuery> query, runningQueries) {
if (FD_ISSET(query->getSocketID(), &fdSet)) {
query->processResult();
}
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.h
index 74140ac..199eeb2 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.h
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.h
@@ -7,9 +7,8 @@
#pragma once
#include <list>
+#include <memory>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp>
@@ -20,17 +19,17 @@
namespace Swift {
class BonjourQuerier :
public DNSSDQuerier,
- public boost::enable_shared_from_this<BonjourQuerier> {
+ public std::enable_shared_from_this<BonjourQuerier> {
public:
BonjourQuerier(EventLoop* eventLoop);
~BonjourQuerier();
- boost::shared_ptr<DNSSDBrowseQuery> createBrowseQuery();
- boost::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
+ std::shared_ptr<DNSSDBrowseQuery> createBrowseQuery();
+ std::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
const std::string& name, int port, const ByteArray& info);
- boost::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
+ std::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
const DNSSDServiceID&);
- boost::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
+ std::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
const std::string& hostname, int interfaceIndex);
void start();
@@ -39,8 +38,8 @@ namespace Swift {
private:
friend class BonjourQuery;
- void addRunningQuery(boost::shared_ptr<BonjourQuery>);
- void removeRunningQuery(boost::shared_ptr<BonjourQuery>);
+ void addRunningQuery(std::shared_ptr<BonjourQuery>);
+ void removeRunningQuery(std::shared_ptr<BonjourQuery>);
void interruptSelect();
void run();
@@ -49,7 +48,7 @@ namespace Swift {
bool stopRequested;
boost::thread* thread;
boost::mutex runningQueriesMutex;
- std::list< boost::shared_ptr<BonjourQuery> > runningQueries;
+ std::list< std::shared_ptr<BonjourQuery> > runningQueries;
int interruptSelectReadSocket;
int interruptSelectWriteSocket;
boost::condition_variable runningQueriesAvailableEvent;
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.cpp b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.cpp
index fa4b6fe..5f9a98f 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.cpp
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.cpp
@@ -10,7 +10,7 @@
namespace Swift {
-BonjourQuery::BonjourQuery(boost::shared_ptr<BonjourQuerier> q, EventLoop* eventLoop) : eventLoop(eventLoop), querier(q), sdRef(nullptr) {
+BonjourQuery::BonjourQuery(std::shared_ptr<BonjourQuerier> q, EventLoop* eventLoop) : eventLoop(eventLoop), querier(q), sdRef(nullptr) {
}
BonjourQuery::~BonjourQuery() {
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h
index 2e3eb80..5520158 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h
@@ -6,8 +6,8 @@
#pragma once
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
+
#include <boost/thread/mutex.hpp>
#include <dns_sd.h>
@@ -20,9 +20,9 @@ namespace Swift {
class BonjourQuery :
public EventOwner,
- public boost::enable_shared_from_this<BonjourQuery> {
+ public std::enable_shared_from_this<BonjourQuery> {
public:
- BonjourQuery(boost::shared_ptr<BonjourQuerier>, EventLoop* eventLoop);
+ BonjourQuery(std::shared_ptr<BonjourQuerier>, EventLoop* eventLoop);
virtual ~BonjourQuery();
void processResult();
@@ -34,7 +34,7 @@ namespace Swift {
protected:
EventLoop* eventLoop;
- boost::shared_ptr<BonjourQuerier> querier;
+ std::shared_ptr<BonjourQuerier> querier;
mutable boost::mutex sdRefMutex;
DNSServiceRef sdRef;
};
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourRegisterQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourRegisterQuery.h
index 67c96bd..776b434 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourRegisterQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourRegisterQuery.h
@@ -19,7 +19,7 @@ namespace Swift {
class BonjourRegisterQuery : public DNSSDRegisterQuery, public BonjourQuery {
public:
- BonjourRegisterQuery(const std::string& name, int port, const ByteArray& txtRecord, boost::shared_ptr<BonjourQuerier> querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) {
+ BonjourRegisterQuery(const std::string& name, int port, const ByteArray& txtRecord, std::shared_ptr<BonjourQuerier> querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) {
DNSServiceErrorType result = DNSServiceRegister(
&sdRef, 0, 0, name.c_str(), "_presence._tcp", nullptr, nullptr, boost::numeric_cast<unsigned short>(port),
boost::numeric_cast<unsigned short>(txtRecord.size()), vecptr(txtRecord),
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h
index adc5486..dbf3f0e 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h
@@ -22,7 +22,7 @@ namespace Swift {
class BonjourResolveHostnameQuery : public DNSSDResolveHostnameQuery, public BonjourQuery {
public:
- BonjourResolveHostnameQuery(const std::string& hostname, int interfaceIndex, boost::shared_ptr<BonjourQuerier> querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) {
+ BonjourResolveHostnameQuery(const std::string& hostname, int interfaceIndex, std::shared_ptr<BonjourQuerier> querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) {
DNSServiceErrorType result = DNSServiceGetAddrInfo(
&sdRef, 0, boost::numeric_cast<unsigned int>(interfaceIndex), kDNSServiceProtocol_IPv4,
hostname.c_str(),
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveServiceQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveServiceQuery.h
index ee20a25..86b6015 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveServiceQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveServiceQuery.h
@@ -17,7 +17,7 @@ namespace Swift {
class BonjourResolveServiceQuery : public DNSSDResolveServiceQuery, public BonjourQuery {
public:
- BonjourResolveServiceQuery(const DNSSDServiceID& service, boost::shared_ptr<BonjourQuerier> querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) {
+ BonjourResolveServiceQuery(const DNSSDServiceID& service, std::shared_ptr<BonjourQuerier> querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) {
DNSServiceErrorType result = DNSServiceResolve(
&sdRef, 0, boost::numeric_cast<unsigned int>(service.getNetworkInterfaceID()),
service.getName().c_str(), service.getType().c_str(),
diff --git a/Swiften/LinkLocal/DNSSD/DNSSDQuerier.h b/Swiften/LinkLocal/DNSSD/DNSSDQuerier.h
index 85051fe..8f3c3ec 100644
--- a/Swiften/LinkLocal/DNSSD/DNSSDQuerier.h
+++ b/Swiften/LinkLocal/DNSSD/DNSSDQuerier.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/ByteArray.h>
@@ -24,12 +24,12 @@ namespace Swift {
virtual void start() = 0;
virtual void stop() = 0;
- virtual boost::shared_ptr<DNSSDBrowseQuery> createBrowseQuery() = 0;
- virtual boost::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
+ virtual std::shared_ptr<DNSSDBrowseQuery> createBrowseQuery() = 0;
+ virtual std::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
const std::string& name, int port, const ByteArray& info) = 0;
- virtual boost::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
+ virtual std::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
const DNSSDServiceID&) = 0;
- virtual boost::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
+ virtual std::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
const std::string& hostname, int interfaceIndex) = 0;
};
}
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDBrowseQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDBrowseQuery.h
index 860de41..15d8128 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDBrowseQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDBrowseQuery.h
@@ -14,7 +14,7 @@ namespace Swift {
class FakeDNSSDBrowseQuery : public DNSSDBrowseQuery, public FakeDNSSDQuery {
public:
- FakeDNSSDBrowseQuery(boost::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier) {
+ FakeDNSSDBrowseQuery(std::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier) {
}
void startBrowsing() {
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp
index 89698a6..63ad3b8 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp
@@ -29,42 +29,42 @@ FakeDNSSDQuerier::~FakeDNSSDQuerier() {
}
}
-boost::shared_ptr<DNSSDBrowseQuery> FakeDNSSDQuerier::createBrowseQuery() {
- return boost::shared_ptr<DNSSDBrowseQuery>(new FakeDNSSDBrowseQuery(shared_from_this()));
+std::shared_ptr<DNSSDBrowseQuery> FakeDNSSDQuerier::createBrowseQuery() {
+ return std::make_shared<FakeDNSSDBrowseQuery>(shared_from_this());
}
-boost::shared_ptr<DNSSDRegisterQuery> FakeDNSSDQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) {
- return boost::shared_ptr<DNSSDRegisterQuery>(new FakeDNSSDRegisterQuery(name, port, info, shared_from_this()));
+std::shared_ptr<DNSSDRegisterQuery> FakeDNSSDQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) {
+ return std::make_shared<FakeDNSSDRegisterQuery>(name, port, info, shared_from_this());
}
-boost::shared_ptr<DNSSDResolveServiceQuery> FakeDNSSDQuerier::createResolveServiceQuery(const DNSSDServiceID& service) {
- return boost::shared_ptr<DNSSDResolveServiceQuery>(new FakeDNSSDResolveServiceQuery(service, shared_from_this()));
+std::shared_ptr<DNSSDResolveServiceQuery> FakeDNSSDQuerier::createResolveServiceQuery(const DNSSDServiceID& service) {
+ return std::make_shared<FakeDNSSDResolveServiceQuery>(service, shared_from_this());
}
-boost::shared_ptr<DNSSDResolveHostnameQuery> FakeDNSSDQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) {
- return boost::shared_ptr<DNSSDResolveHostnameQuery>(new FakeDNSSDResolveHostnameQuery(hostname, interfaceIndex, shared_from_this()));
+std::shared_ptr<DNSSDResolveHostnameQuery> FakeDNSSDQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) {
+ return std::make_shared<FakeDNSSDResolveHostnameQuery>(hostname, interfaceIndex, shared_from_this());
}
-void FakeDNSSDQuerier::addRunningQuery(boost::shared_ptr<FakeDNSSDQuery> query) {
+void FakeDNSSDQuerier::addRunningQuery(std::shared_ptr<FakeDNSSDQuery> query) {
runningQueries.push_back(query);
allQueriesEverRun.push_back(query);
- if (boost::shared_ptr<FakeDNSSDBrowseQuery> browseQuery = boost::dynamic_pointer_cast<FakeDNSSDBrowseQuery>(query)) {
+ if (std::shared_ptr<FakeDNSSDBrowseQuery> browseQuery = std::dynamic_pointer_cast<FakeDNSSDBrowseQuery>(query)) {
foreach(const DNSSDServiceID& service, services) {
eventLoop->postEvent(boost::bind(boost::ref(browseQuery->onServiceAdded), service), shared_from_this());
}
}
- else if (boost::shared_ptr<FakeDNSSDResolveServiceQuery> resolveQuery = boost::dynamic_pointer_cast<FakeDNSSDResolveServiceQuery>(query)) {
+ else if (std::shared_ptr<FakeDNSSDResolveServiceQuery> resolveQuery = std::dynamic_pointer_cast<FakeDNSSDResolveServiceQuery>(query)) {
for(ServiceInfoMap::const_iterator i = serviceInfo.begin(); i != serviceInfo.end(); ++i) {
if (i->first == resolveQuery->service) {
eventLoop->postEvent(boost::bind(boost::ref(resolveQuery->onServiceResolved), i->second), shared_from_this());
}
}
}
- else if (boost::shared_ptr<FakeDNSSDRegisterQuery> registerQuery = boost::dynamic_pointer_cast<FakeDNSSDRegisterQuery>(query)) {
+ else if (std::shared_ptr<FakeDNSSDRegisterQuery> registerQuery = std::dynamic_pointer_cast<FakeDNSSDRegisterQuery>(query)) {
DNSSDServiceID service(registerQuery->name, domain);
eventLoop->postEvent(boost::bind(boost::ref(registerQuery->onRegisterFinished), service), shared_from_this());
}
- else if (boost::shared_ptr<FakeDNSSDResolveHostnameQuery> resolveHostnameQuery = boost::dynamic_pointer_cast<FakeDNSSDResolveHostnameQuery>(query)) {
+ else if (std::shared_ptr<FakeDNSSDResolveHostnameQuery> resolveHostnameQuery = std::dynamic_pointer_cast<FakeDNSSDResolveHostnameQuery>(query)) {
std::map<std::string,boost::optional<HostAddress> >::const_iterator i = addresses.find(resolveHostnameQuery->hostname);
if (i != addresses.end()) {
eventLoop->postEvent(
@@ -75,13 +75,13 @@ void FakeDNSSDQuerier::addRunningQuery(boost::shared_ptr<FakeDNSSDQuery> query)
}
}
-void FakeDNSSDQuerier::removeRunningQuery(boost::shared_ptr<FakeDNSSDQuery> query) {
+void FakeDNSSDQuerier::removeRunningQuery(std::shared_ptr<FakeDNSSDQuery> query) {
erase(runningQueries, query);
}
void FakeDNSSDQuerier::addService(const DNSSDServiceID& id) {
services.insert(id);
- foreach(const boost::shared_ptr<FakeDNSSDBrowseQuery>& query, getQueries<FakeDNSSDBrowseQuery>()) {
+ foreach(const std::shared_ptr<FakeDNSSDBrowseQuery>& query, getQueries<FakeDNSSDBrowseQuery>()) {
eventLoop->postEvent(boost::bind(boost::ref(query->onServiceAdded), id), shared_from_this());
}
}
@@ -89,7 +89,7 @@ void FakeDNSSDQuerier::addService(const DNSSDServiceID& id) {
void FakeDNSSDQuerier::removeService(const DNSSDServiceID& id) {
services.erase(id);
serviceInfo.erase(id);
- foreach(const boost::shared_ptr<FakeDNSSDBrowseQuery>& query, getQueries<FakeDNSSDBrowseQuery>()) {
+ foreach(const std::shared_ptr<FakeDNSSDBrowseQuery>& query, getQueries<FakeDNSSDBrowseQuery>()) {
eventLoop->postEvent(boost::bind(boost::ref(query->onServiceRemoved), id), shared_from_this());
}
}
@@ -99,7 +99,7 @@ void FakeDNSSDQuerier::setServiceInfo(const DNSSDServiceID& id, const DNSSDResol
if (!r.second) {
r.first->second = info;
}
- foreach(const boost::shared_ptr<FakeDNSSDResolveServiceQuery>& query, getQueries<FakeDNSSDResolveServiceQuery>()) {
+ foreach(const std::shared_ptr<FakeDNSSDResolveServiceQuery>& query, getQueries<FakeDNSSDResolveServiceQuery>()) {
if (query->service == id) {
eventLoop->postEvent(boost::bind(boost::ref(query->onServiceResolved), info), shared_from_this());
}
@@ -107,7 +107,7 @@ void FakeDNSSDQuerier::setServiceInfo(const DNSSDServiceID& id, const DNSSDResol
}
bool FakeDNSSDQuerier::isServiceRegistered(const std::string& name, int port, const ByteArray& info) {
- foreach(const boost::shared_ptr<FakeDNSSDRegisterQuery>& query, getQueries<FakeDNSSDRegisterQuery>()) {
+ foreach(const std::shared_ptr<FakeDNSSDRegisterQuery>& query, getQueries<FakeDNSSDRegisterQuery>()) {
if (query->name == name && query->port == port && query->info == info) {
return true;
}
@@ -116,20 +116,20 @@ bool FakeDNSSDQuerier::isServiceRegistered(const std::string& name, int port, co
}
void FakeDNSSDQuerier::setBrowseError() {
- foreach(const boost::shared_ptr<FakeDNSSDBrowseQuery>& query, getQueries<FakeDNSSDBrowseQuery>()) {
+ foreach(const std::shared_ptr<FakeDNSSDBrowseQuery>& query, getQueries<FakeDNSSDBrowseQuery>()) {
eventLoop->postEvent(boost::ref(query->onError), shared_from_this());
}
}
void FakeDNSSDQuerier::setRegisterError() {
- foreach(const boost::shared_ptr<FakeDNSSDRegisterQuery>& query, getQueries<FakeDNSSDRegisterQuery>()) {
+ foreach(const std::shared_ptr<FakeDNSSDRegisterQuery>& query, getQueries<FakeDNSSDRegisterQuery>()) {
eventLoop->postEvent(boost::bind(boost::ref(query->onRegisterFinished), boost::optional<DNSSDServiceID>()), shared_from_this());
}
}
void FakeDNSSDQuerier::setAddress(const std::string& hostname, boost::optional<HostAddress> address) {
addresses[hostname] = address;
- foreach(const boost::shared_ptr<FakeDNSSDResolveHostnameQuery>& query, getQueries<FakeDNSSDResolveHostnameQuery>()) {
+ foreach(const std::shared_ptr<FakeDNSSDResolveHostnameQuery>& query, getQueries<FakeDNSSDResolveHostnameQuery>()) {
if (query->hostname == hostname) {
eventLoop->postEvent(boost::bind(
boost::ref(query->onHostnameResolved), address), shared_from_this());
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h
index 536bf90..85fdc3a 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h
@@ -7,12 +7,10 @@
#pragma once
#include <list>
+#include <memory>
#include <set>
#include <string>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/ByteArray.h>
#include <Swiften/EventLoop/EventOwner.h>
@@ -28,7 +26,7 @@ namespace Swift {
class SWIFTEN_API FakeDNSSDQuerier :
public DNSSDQuerier,
public EventOwner,
- public boost::enable_shared_from_this<FakeDNSSDQuerier> {
+ public std::enable_shared_from_this<FakeDNSSDQuerier> {
public:
FakeDNSSDQuerier(const std::string& domain, EventLoop* eventLoop);
~FakeDNSSDQuerier();
@@ -40,16 +38,16 @@ namespace Swift {
allQueriesEverRun.clear();
}
- boost::shared_ptr<DNSSDBrowseQuery> createBrowseQuery();
- boost::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
+ std::shared_ptr<DNSSDBrowseQuery> createBrowseQuery();
+ std::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
const std::string& name, int port, const ByteArray& info);
- boost::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
+ std::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
const DNSSDServiceID&);
- boost::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
+ std::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
const std::string& hostname, int interfaceIndex);
- void addRunningQuery(boost::shared_ptr<FakeDNSSDQuery>);
- void removeRunningQuery(boost::shared_ptr<FakeDNSSDQuery>);
+ void addRunningQuery(std::shared_ptr<FakeDNSSDQuery>);
+ void removeRunningQuery(std::shared_ptr<FakeDNSSDQuery>);
void addService(const DNSSDServiceID& id);
void removeService(const DNSSDServiceID& id);
@@ -62,10 +60,10 @@ namespace Swift {
public:
template<typename T>
- std::vector< boost::shared_ptr<T> > getAllQueriesEverRun() const {
- std::vector< boost::shared_ptr<T> > result;
+ std::vector< std::shared_ptr<T> > getAllQueriesEverRun() const {
+ std::vector< std::shared_ptr<T> > result;
for (QueryList::const_iterator i = allQueriesEverRun.begin(); i != allQueriesEverRun.end(); ++i) {
- if (boost::shared_ptr<T> resultQuery = boost::dynamic_pointer_cast<T>(*i)) {
+ if (std::shared_ptr<T> resultQuery = std::dynamic_pointer_cast<T>(*i)) {
result.push_back(resultQuery);
}
}
@@ -74,10 +72,10 @@ namespace Swift {
private:
template<typename T>
- std::vector< boost::shared_ptr<T> > getQueries() const {
- std::vector< boost::shared_ptr<T> > result;
+ std::vector< std::shared_ptr<T> > getQueries() const {
+ std::vector< std::shared_ptr<T> > result;
for (QueryList::const_iterator i = runningQueries.begin(); i != runningQueries.end(); ++i) {
- if (boost::shared_ptr<T> resultQuery = boost::dynamic_pointer_cast<T>(*i)) {
+ if (std::shared_ptr<T> resultQuery = std::dynamic_pointer_cast<T>(*i)) {
result.push_back(resultQuery);
}
}
@@ -87,7 +85,7 @@ namespace Swift {
private:
std::string domain;
EventLoop* eventLoop;
- typedef std::list< boost::shared_ptr<FakeDNSSDQuery> > QueryList;
+ typedef std::list< std::shared_ptr<FakeDNSSDQuery> > QueryList;
QueryList runningQueries;
QueryList allQueriesEverRun;
std::set<DNSSDServiceID> services;
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.cpp b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.cpp
index 980b757..0e05968 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.cpp
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.cpp
@@ -10,7 +10,7 @@
namespace Swift {
-FakeDNSSDQuery::FakeDNSSDQuery(boost::shared_ptr<FakeDNSSDQuerier> querier) : querier(querier) {
+FakeDNSSDQuery::FakeDNSSDQuery(std::shared_ptr<FakeDNSSDQuerier> querier) : querier(querier) {
}
FakeDNSSDQuery::~FakeDNSSDQuery() {
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.h
index 0d7dedc..5d869d4 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.h
@@ -6,8 +6,7 @@
#pragma once
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/EventLoop/EventOwner.h>
@@ -16,9 +15,9 @@ namespace Swift {
class FakeDNSSDQuery :
public EventOwner,
- public boost::enable_shared_from_this<FakeDNSSDQuery> {
+ public std::enable_shared_from_this<FakeDNSSDQuery> {
public:
- FakeDNSSDQuery(boost::shared_ptr<FakeDNSSDQuerier>);
+ FakeDNSSDQuery(std::shared_ptr<FakeDNSSDQuerier>);
virtual ~FakeDNSSDQuery();
protected:
@@ -26,6 +25,6 @@ namespace Swift {
void finish();
protected:
- boost::shared_ptr<FakeDNSSDQuerier> querier;
+ std::shared_ptr<FakeDNSSDQuerier> querier;
};
}
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDRegisterQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDRegisterQuery.h
index 484b2c2..7478841 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDRegisterQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDRegisterQuery.h
@@ -17,7 +17,7 @@ namespace Swift {
class FakeDNSSDRegisterQuery : public DNSSDRegisterQuery, public FakeDNSSDQuery {
public:
- FakeDNSSDRegisterQuery(const std::string& name, int port, const ByteArray& info, boost::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier), name(name), port(port), info(info) {
+ FakeDNSSDRegisterQuery(const std::string& name, int port, const ByteArray& info, std::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier), name(name), port(port), info(info) {
}
void registerService() {
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveHostnameQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveHostnameQuery.h
index 0b6a95d..60dc144 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveHostnameQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveHostnameQuery.h
@@ -17,7 +17,7 @@ namespace Swift {
class FakeDNSSDResolveHostnameQuery : public DNSSDResolveHostnameQuery, public FakeDNSSDQuery {
public:
- FakeDNSSDResolveHostnameQuery(const std::string& hostname, int interfaceIndex, boost::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier), hostname(hostname), interfaceIndex(interfaceIndex) {
+ FakeDNSSDResolveHostnameQuery(const std::string& hostname, int interfaceIndex, std::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier), hostname(hostname), interfaceIndex(interfaceIndex) {
}
void run() {
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveServiceQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveServiceQuery.h
index 180fbb2..8a02e7b 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveServiceQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveServiceQuery.h
@@ -15,7 +15,7 @@ namespace Swift {
class FakeDNSSDResolveServiceQuery : public DNSSDResolveServiceQuery, public FakeDNSSDQuery {
public:
- FakeDNSSDResolveServiceQuery(const DNSSDServiceID& service, boost::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier), service(service) {
+ FakeDNSSDResolveServiceQuery(const DNSSDServiceID& service, std::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier), service(service) {
}
void start() {
diff --git a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp
index f2bfa2e..e20326b 100644
--- a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp
+++ b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -18,14 +18,14 @@ namespace Swift {
PlatformDNSSDQuerierFactory::PlatformDNSSDQuerierFactory(EventLoop* eventLoop) : eventLoop(eventLoop) {
}
-boost::shared_ptr<DNSSDQuerier> PlatformDNSSDQuerierFactory::createQuerier() {
+std::shared_ptr<DNSSDQuerier> PlatformDNSSDQuerierFactory::createQuerier() {
#if defined(HAVE_BONJOUR)
- return boost::shared_ptr<DNSSDQuerier>(new BonjourQuerier(eventLoop));
+ return std::make_shared<BonjourQuerier>(eventLoop);
#elif defined(HAVE_AVAHI)
- return boost::shared_ptr<DNSSDQuerier>(new AvahiQuerier(eventLoop));
+ return std::make_shared<AvahiQuerier>(eventLoop);
#else
(void)eventLoop;
- return boost::shared_ptr<DNSSDQuerier>();
+ return std::shared_ptr<DNSSDQuerier>();
#endif
}
diff --git a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h
index dc40d01..68e10cf 100644
--- a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h
+++ b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
@@ -18,7 +18,7 @@ namespace Swift {
public:
PlatformDNSSDQuerierFactory(EventLoop* eventLoop);
- boost::shared_ptr<DNSSDQuerier> createQuerier();
+ std::shared_ptr<DNSSDQuerier> createQuerier();
bool canCreate();
diff --git a/Swiften/LinkLocal/IncomingLinkLocalSession.cpp b/Swiften/LinkLocal/IncomingLinkLocalSession.cpp
index 435b065..9d446a9 100644
--- a/Swiften/LinkLocal/IncomingLinkLocalSession.cpp
+++ b/Swiften/LinkLocal/IncomingLinkLocalSession.cpp
@@ -6,8 +6,9 @@
#include <Swiften/LinkLocal/IncomingLinkLocalSession.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Elements/IQ.h>
#include <Swiften/Elements/ProtocolHeader.h>
@@ -21,7 +22,7 @@ namespace Swift {
IncomingLinkLocalSession::IncomingLinkLocalSession(
const JID& localJID,
- boost::shared_ptr<Connection> connection,
+ std::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
XMLParserFactory* xmlParserFactory) :
@@ -42,15 +43,15 @@ void IncomingLinkLocalSession::handleStreamStart(const ProtocolHeader& incomingH
getXMPPLayer()->writeHeader(header);
if (incomingHeader.getVersion() == "1.0") {
- getXMPPLayer()->writeElement(boost::make_shared<StreamFeatures>());
+ getXMPPLayer()->writeElement(std::make_shared<StreamFeatures>());
}
else {
setInitialized();
}
}
-void IncomingLinkLocalSession::handleElement(boost::shared_ptr<ToplevelElement> element) {
- boost::shared_ptr<Stanza> stanza = boost::dynamic_pointer_cast<Stanza>(element);
+void IncomingLinkLocalSession::handleElement(std::shared_ptr<ToplevelElement> element) {
+ std::shared_ptr<Stanza> stanza = std::dynamic_pointer_cast<Stanza>(element);
// If we get our first stanza before streamfeatures, our session is implicitly
// initialized
if (stanza && !isInitialized()) {
diff --git a/Swiften/LinkLocal/IncomingLinkLocalSession.h b/Swiften/LinkLocal/IncomingLinkLocalSession.h
index 44a8719..b3f0866 100644
--- a/Swiften/LinkLocal/IncomingLinkLocalSession.h
+++ b/Swiften/LinkLocal/IncomingLinkLocalSession.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -25,7 +25,7 @@ namespace Swift {
public:
IncomingLinkLocalSession(
const JID& localJID,
- boost::shared_ptr<Connection> connection,
+ std::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
XMLParserFactory* xmlParserFactory);
@@ -33,7 +33,7 @@ namespace Swift {
boost::signal<void ()> onSessionStarted;
private:
- void handleElement(boost::shared_ptr<ToplevelElement>);
+ void handleElement(std::shared_ptr<ToplevelElement>);
void handleStreamStart(const ProtocolHeader&);
void setInitialized();
bool isInitialized() const {
diff --git a/Swiften/LinkLocal/LinkLocalConnector.cpp b/Swiften/LinkLocal/LinkLocalConnector.cpp
index 9123e8e..d961030 100644
--- a/Swiften/LinkLocal/LinkLocalConnector.cpp
+++ b/Swiften/LinkLocal/LinkLocalConnector.cpp
@@ -19,8 +19,8 @@ namespace Swift {
LinkLocalConnector::LinkLocalConnector(
const LinkLocalService& service,
- boost::shared_ptr<DNSSDQuerier> querier,
- boost::shared_ptr<Connection> connection) :
+ std::shared_ptr<DNSSDQuerier> querier,
+ std::shared_ptr<Connection> connection) :
service(service),
querier(querier),
connection(connection) {
@@ -36,7 +36,7 @@ void LinkLocalConnector::connect() {
service.getID().getNetworkInterfaceID());
resolveQueryHostNameResolvedConnection = resolveQuery->onHostnameResolved.connect(boost::bind(
&LinkLocalConnector::handleHostnameResolved,
- boost::dynamic_pointer_cast<LinkLocalConnector>(shared_from_this()),
+ std::dynamic_pointer_cast<LinkLocalConnector>(shared_from_this()),
_1));
resolveQuery->run();
}
@@ -71,7 +71,7 @@ void LinkLocalConnector::handleConnected(bool error) {
connectionConnectFinishedConnection.disconnect();
}
-void LinkLocalConnector::queueElement(boost::shared_ptr<ToplevelElement> element) {
+void LinkLocalConnector::queueElement(std::shared_ptr<ToplevelElement> element) {
queuedElements.push_back(element);
}
diff --git a/Swiften/LinkLocal/LinkLocalConnector.h b/Swiften/LinkLocal/LinkLocalConnector.h
index 4e05dce..a55d1b6 100644
--- a/Swiften/LinkLocal/LinkLocalConnector.h
+++ b/Swiften/LinkLocal/LinkLocalConnector.h
@@ -6,11 +6,9 @@
#pragma once
+#include <memory>
#include <vector>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/LinkLocal/LinkLocalService.h>
@@ -25,12 +23,12 @@ namespace Swift {
class DNSSDQuerier;
class DNSSDResolveHostnameQuery;
- class SWIFTEN_API LinkLocalConnector : public boost::enable_shared_from_this<LinkLocalConnector> {
+ class SWIFTEN_API LinkLocalConnector : public std::enable_shared_from_this<LinkLocalConnector> {
public:
LinkLocalConnector(
const LinkLocalService& service,
- boost::shared_ptr<DNSSDQuerier> querier,
- boost::shared_ptr<Connection> connection);
+ std::shared_ptr<DNSSDQuerier> querier,
+ std::shared_ptr<Connection> connection);
~LinkLocalConnector();
const LinkLocalService& getService() const {
@@ -39,13 +37,13 @@ namespace Swift {
void connect();
void cancel();
- void queueElement(boost::shared_ptr<ToplevelElement> element);
+ void queueElement(std::shared_ptr<ToplevelElement> element);
- const std::vector<boost::shared_ptr<ToplevelElement> >& getQueuedElements() const {
+ const std::vector<std::shared_ptr<ToplevelElement> >& getQueuedElements() const {
return queuedElements;
}
- boost::shared_ptr<Connection> getConnection() const {
+ std::shared_ptr<Connection> getConnection() const {
return connection;
}
@@ -57,11 +55,11 @@ namespace Swift {
private:
LinkLocalService service;
- boost::shared_ptr<DNSSDQuerier> querier;
- boost::shared_ptr<DNSSDResolveHostnameQuery> resolveQuery;
+ std::shared_ptr<DNSSDQuerier> querier;
+ std::shared_ptr<DNSSDResolveHostnameQuery> resolveQuery;
boost::bsignals::connection resolveQueryHostNameResolvedConnection;
- boost::shared_ptr<Connection> connection;
+ std::shared_ptr<Connection> connection;
boost::bsignals::connection connectionConnectFinishedConnection;
- std::vector<boost::shared_ptr<ToplevelElement> > queuedElements;
+ std::vector<std::shared_ptr<ToplevelElement> > queuedElements;
};
}
diff --git a/Swiften/LinkLocal/LinkLocalServiceBrowser.cpp b/Swiften/LinkLocal/LinkLocalServiceBrowser.cpp
index d9dfd64..e3b6028 100644
--- a/Swiften/LinkLocal/LinkLocalServiceBrowser.cpp
+++ b/Swiften/LinkLocal/LinkLocalServiceBrowser.cpp
@@ -15,7 +15,7 @@
namespace Swift {
-LinkLocalServiceBrowser::LinkLocalServiceBrowser(boost::shared_ptr<DNSSDQuerier> querier) : querier(querier), haveError(false) {
+LinkLocalServiceBrowser::LinkLocalServiceBrowser(std::shared_ptr<DNSSDQuerier> querier) : querier(querier), haveError(false) {
}
LinkLocalServiceBrowser::~LinkLocalServiceBrowser() {
@@ -98,10 +98,10 @@ void LinkLocalServiceBrowser::handleServiceAdded(const DNSSDServiceID& service)
return;
}
- std::pair<ResolveQueryMap::iterator, bool> r = resolveQueries.insert(std::make_pair(service, boost::shared_ptr<DNSSDResolveServiceQuery>()));
+ std::pair<ResolveQueryMap::iterator, bool> r = resolveQueries.insert(std::make_pair(service, std::shared_ptr<DNSSDResolveServiceQuery>()));
if (r.second) {
// There was no existing query yet. Start a new query.
- boost::shared_ptr<DNSSDResolveServiceQuery> resolveQuery = querier->createResolveServiceQuery(service);
+ std::shared_ptr<DNSSDResolveServiceQuery> resolveQuery = querier->createResolveServiceQuery(service);
resolveQuery->onServiceResolved.connect(
boost::bind(&LinkLocalServiceBrowser::handleServiceResolved, this, service, _1));
r.first->second = resolveQuery;
diff --git a/Swiften/LinkLocal/LinkLocalServiceBrowser.h b/Swiften/LinkLocal/LinkLocalServiceBrowser.h
index 3795258..2b0545e 100644
--- a/Swiften/LinkLocal/LinkLocalServiceBrowser.h
+++ b/Swiften/LinkLocal/LinkLocalServiceBrowser.h
@@ -7,11 +7,11 @@
#pragma once
#include <map>
+#include <memory>
#include <string>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -25,7 +25,7 @@
namespace Swift {
class SWIFTEN_API LinkLocalServiceBrowser {
public:
- LinkLocalServiceBrowser(boost::shared_ptr<DNSSDQuerier> querier);
+ LinkLocalServiceBrowser(std::shared_ptr<DNSSDQuerier> querier);
~LinkLocalServiceBrowser();
void start();
@@ -45,7 +45,7 @@ namespace Swift {
std::vector<LinkLocalService> getServices() const;
// FIXME: Ugly that we need this
- boost::shared_ptr<DNSSDQuerier> getQuerier() const {
+ std::shared_ptr<DNSSDQuerier> getQuerier() const {
return querier;
}
@@ -63,11 +63,11 @@ namespace Swift {
void handleBrowseError();
private:
- boost::shared_ptr<DNSSDQuerier> querier;
+ std::shared_ptr<DNSSDQuerier> querier;
boost::optional<DNSSDServiceID> selfService;
- boost::shared_ptr<DNSSDBrowseQuery> browseQuery;
- boost::shared_ptr<DNSSDRegisterQuery> registerQuery;
- typedef std::map<DNSSDServiceID, boost::shared_ptr<DNSSDResolveServiceQuery> > ResolveQueryMap;
+ std::shared_ptr<DNSSDBrowseQuery> browseQuery;
+ std::shared_ptr<DNSSDRegisterQuery> registerQuery;
+ typedef std::map<DNSSDServiceID, std::shared_ptr<DNSSDResolveServiceQuery> > ResolveQueryMap;
ResolveQueryMap resolveQueries;
typedef std::map<DNSSDServiceID, DNSSDResolveServiceQuery::Result> ServiceMap;
ServiceMap services;
diff --git a/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp b/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
index 89d0e89..f97d9a1 100644
--- a/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
+++ b/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
@@ -19,7 +19,7 @@ namespace Swift {
OutgoingLinkLocalSession::OutgoingLinkLocalSession(
const JID& localJID,
const JID& remoteJID,
- boost::shared_ptr<Connection> connection,
+ std::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
XMLParserFactory* xmlParserFactory) :
@@ -35,17 +35,17 @@ void OutgoingLinkLocalSession::handleSessionStarted() {
}
void OutgoingLinkLocalSession::handleStreamStart(const ProtocolHeader&) {
- foreach(const boost::shared_ptr<ToplevelElement>& stanza, queuedElements_) {
+ foreach(const std::shared_ptr<ToplevelElement>& stanza, queuedElements_) {
sendElement(stanza);
}
queuedElements_.clear();
}
-void OutgoingLinkLocalSession::handleElement(boost::shared_ptr<ToplevelElement> element) {
+void OutgoingLinkLocalSession::handleElement(std::shared_ptr<ToplevelElement> element) {
onElementReceived(element);
}
-void OutgoingLinkLocalSession::queueElement(boost::shared_ptr<ToplevelElement> element) {
+void OutgoingLinkLocalSession::queueElement(std::shared_ptr<ToplevelElement> element) {
queuedElements_.push_back(element);
}
diff --git a/Swiften/LinkLocal/OutgoingLinkLocalSession.h b/Swiften/LinkLocal/OutgoingLinkLocalSession.h
index b467918..2f08ed3 100644
--- a/Swiften/LinkLocal/OutgoingLinkLocalSession.h
+++ b/Swiften/LinkLocal/OutgoingLinkLocalSession.h
@@ -6,11 +6,9 @@
#pragma once
+#include <memory>
#include <vector>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/JID/JID.h>
@@ -28,19 +26,19 @@ namespace Swift {
OutgoingLinkLocalSession(
const JID& localJID,
const JID& remoteJID,
- boost::shared_ptr<Connection> connection,
+ std::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
XMLParserFactory* xmlParserFactory);
- void queueElement(boost::shared_ptr<ToplevelElement> element);
+ void queueElement(std::shared_ptr<ToplevelElement> element);
private:
void handleSessionStarted();
- void handleElement(boost::shared_ptr<ToplevelElement>);
+ void handleElement(std::shared_ptr<ToplevelElement>);
void handleStreamStart(const ProtocolHeader&);
private:
- std::vector<boost::shared_ptr<ToplevelElement> > queuedElements_;
+ std::vector<std::shared_ptr<ToplevelElement> > queuedElements_;
};
}
diff --git a/Swiften/LinkLocal/UnitTest/LinkLocalConnectorTest.cpp b/Swiften/LinkLocal/UnitTest/LinkLocalConnectorTest.cpp
index 3511f90..3c5e098 100644
--- a/Swiften/LinkLocal/UnitTest/LinkLocalConnectorTest.cpp
+++ b/Swiften/LinkLocal/UnitTest/LinkLocalConnectorTest.cpp
@@ -31,8 +31,8 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture {
public:
void setUp() {
eventLoop = new DummyEventLoop();
- querier = boost::make_shared<FakeDNSSDQuerier>("rabbithole.local", eventLoop);
- connection = boost::make_shared<FakeConnection>(eventLoop);
+ querier = std::make_shared<FakeDNSSDQuerier>("rabbithole.local", eventLoop);
+ connection = std::make_shared<FakeConnection>(eventLoop);
connectFinished = false;
}
@@ -42,7 +42,7 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture {
}
void testConnect() {
- boost::shared_ptr<LinkLocalConnector>
+ std::shared_ptr<LinkLocalConnector>
testling(createConnector("rabbithole.local", 1234));
querier->setAddress("rabbithole.local", HostAddress("192.168.1.1"));
@@ -57,7 +57,7 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture {
}
void testConnect_UnableToResolve() {
- boost::shared_ptr<LinkLocalConnector>
+ std::shared_ptr<LinkLocalConnector>
testling(createConnector("rabbithole.local", 1234));
querier->setAddress("rabbithole.local", boost::optional<HostAddress>());
@@ -70,7 +70,7 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture {
}
void testConnect_UnableToConnect() {
- boost::shared_ptr<LinkLocalConnector>
+ std::shared_ptr<LinkLocalConnector>
testling(createConnector("rabbithole.local", 1234));
querier->setAddress("rabbithole.local", HostAddress("192.168.1.1"));
connection->setError(Connection::ReadError);
@@ -84,7 +84,7 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture {
}
void testCancel_DuringResolve() {
- boost::shared_ptr<LinkLocalConnector>
+ std::shared_ptr<LinkLocalConnector>
testling(createConnector("rabbithole.local", 1234));
testling->connect();
eventLoop->processEvents();
@@ -99,7 +99,7 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture {
}
void testCancel_DuringConnect() {
- boost::shared_ptr<LinkLocalConnector>
+ std::shared_ptr<LinkLocalConnector>
testling(createConnector("rabbithole.local", 1234));
querier->setAddress("rabbithole.local", HostAddress("192.168.1.1"));
connection->setDelayConnect();
@@ -114,13 +114,13 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<LinkLocalConnector> createConnector(const std::string& hostname, int port) {
+ std::shared_ptr<LinkLocalConnector> createConnector(const std::string& hostname, int port) {
LinkLocalService service(
DNSSDServiceID("myname", "local."),
DNSSDResolveServiceQuery::Result(
"myname._presence._tcp.local", hostname, port,
LinkLocalServiceInfo().toTXTRecord()));
- boost::shared_ptr<LinkLocalConnector> result(
+ std::shared_ptr<LinkLocalConnector> result(
new LinkLocalConnector(service, querier, connection));
result->onConnectFinished.connect(
boost::bind(&LinkLocalConnectorTest::handleConnected, this, _1));
@@ -134,8 +134,8 @@ class LinkLocalConnectorTest : public CppUnit::TestFixture {
private:
DummyEventLoop* eventLoop;
- boost::shared_ptr<FakeDNSSDQuerier> querier;
- boost::shared_ptr<FakeConnection> connection;
+ std::shared_ptr<FakeDNSSDQuerier> querier;
+ std::shared_ptr<FakeConnection> connection;
bool connectFinished;
bool connectError;
};
diff --git a/Swiften/LinkLocal/UnitTest/LinkLocalServiceBrowserTest.cpp b/Swiften/LinkLocal/UnitTest/LinkLocalServiceBrowserTest.cpp
index 6d8ba97..a80d748 100644
--- a/Swiften/LinkLocal/UnitTest/LinkLocalServiceBrowserTest.cpp
+++ b/Swiften/LinkLocal/UnitTest/LinkLocalServiceBrowserTest.cpp
@@ -5,9 +5,9 @@
*/
#include <map>
+#include <memory>
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -45,7 +45,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
public:
void setUp() {
eventLoop = new DummyEventLoop();
- querier = boost::make_shared<FakeDNSSDQuerier>("wonderland.lit", eventLoop);
+ querier = std::make_shared<FakeDNSSDQuerier>("wonderland.lit", eventLoop);
aliceServiceID = new DNSSDServiceID("alice", "wonderland.lit");
aliceServiceInfo = new DNSSDResolveServiceQuery::Result("_presence._tcp.wonderland.lit", "xmpp.wonderland.lit", 1234, LinkLocalServiceInfo().toTXTRecord());
testServiceID = new DNSSDServiceID("foo", "bar.local");
@@ -70,14 +70,14 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
void testConstructor() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
CPPUNIT_ASSERT(!testling->isRunning());
CPPUNIT_ASSERT(!testling->hasError());
}
void testStart() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
CPPUNIT_ASSERT(testling->isRunning());
@@ -87,7 +87,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
void testServiceAdded() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
eventLoop->processEvents();
@@ -109,7 +109,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
void testServiceAdded_NoServiceInfo() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
eventLoop->processEvents();
@@ -123,7 +123,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
void testServiceAdded_RegisteredService() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
eventLoop->processEvents();
@@ -140,7 +140,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
void testServiceAdded_UnregisteredService() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
eventLoop->processEvents();
testling->registerService("alice", 1234, LinkLocalServiceInfo());
@@ -166,7 +166,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
void testServiceRemoved_UnregisteredService() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
eventLoop->processEvents();
testling->registerService("alice", 1234, LinkLocalServiceInfo());
@@ -183,7 +183,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
void testServiceAdded_Twice() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
eventLoop->processEvents();
@@ -208,7 +208,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
void testServiceChanged() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
querier->setServiceInfo(*testServiceID,*testServiceInfo);
querier->addService(*testServiceID);
@@ -231,7 +231,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
void testServiceRemoved() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
querier->setServiceInfo(*testServiceID,*testServiceInfo);
querier->addService(*testServiceID);
@@ -252,7 +252,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
void testError_BrowseErrorAfterStart() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
querier->setBrowseError();
@@ -264,7 +264,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
void testError_BrowseErrorAfterResolve() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
querier->setServiceInfo(*testServiceID,*testServiceInfo);
querier->addService(*testServiceID);
@@ -283,7 +283,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
void testRegisterService() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
eventLoop->processEvents();
@@ -299,7 +299,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
void testRegisterService_Error() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
LinkLocalServiceInfo info;
testling->registerService("foo@bar", 1234, info);
@@ -315,7 +315,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
void testRegisterService_Reregister() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
eventLoop->processEvents();
LinkLocalServiceInfo info;
@@ -335,7 +335,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
void testUpdateService() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
+ std::shared_ptr<LinkLocalServiceBrowser> testling = createTestling();
testling->start();
eventLoop->processEvents();
@@ -352,8 +352,8 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<LinkLocalServiceBrowser> createTestling() {
- boost::shared_ptr<LinkLocalServiceBrowser> testling(
+ std::shared_ptr<LinkLocalServiceBrowser> createTestling() {
+ std::shared_ptr<LinkLocalServiceBrowser> testling(
new LinkLocalServiceBrowser(querier));
testling->onServiceAdded.connect(boost::bind(
&LinkLocalServiceBrowserTest::handleServiceAdded, this, _1));
@@ -397,7 +397,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture {
private:
DummyEventLoop* eventLoop;
- boost::shared_ptr<FakeDNSSDQuerier> querier;
+ std::shared_ptr<FakeDNSSDQuerier> querier;
std::vector<LinkLocalService> addedServices;
std::vector<LinkLocalService> changedServices;
std::vector<LinkLocalService> removedServices;
diff --git a/Swiften/MUC/MUC.h b/Swiften/MUC/MUC.h
index e8f953e..d0c2bab 100644
--- a/Swiften/MUC/MUC.h
+++ b/Swiften/MUC/MUC.h
@@ -7,9 +7,9 @@
#pragma once
#include <map>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
#include <boost/signals/connection.hpp>
#include <Swiften/Base/API.h>
@@ -30,7 +30,7 @@ namespace Swift {
class SWIFTEN_API MUC {
public:
- typedef boost::shared_ptr<MUC> ref;
+ typedef std::shared_ptr<MUC> ref;
enum JoinResult { JoinSucceeded, JoinFailed };
enum LeavingType { LeavePart, LeaveKick, LeaveBan, LeaveDestroy, LeaveNotMember, Disconnect };
diff --git a/Swiften/MUC/MUCBookmarkManager.cpp b/Swiften/MUC/MUCBookmarkManager.cpp
index 1d8c2aa..570c613 100644
--- a/Swiften/MUC/MUCBookmarkManager.cpp
+++ b/Swiften/MUC/MUCBookmarkManager.cpp
@@ -7,9 +7,9 @@
#include <Swiften/MUC/MUCBookmarkManager.h>
#include <iostream>
+#include <memory>
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/foreach.h>
#include <Swiften/Queries/IQRouter.h>
@@ -26,7 +26,7 @@ MUCBookmarkManager::MUCBookmarkManager(IQRouter* iqRouter) {
request->send();
}
-void MUCBookmarkManager::handleBookmarksReceived(boost::shared_ptr<Storage> payload, ErrorPayload::ref error) {
+void MUCBookmarkManager::handleBookmarksReceived(std::shared_ptr<Storage> payload, ErrorPayload::ref error) {
if (error) {
return;
}
@@ -99,7 +99,7 @@ void MUCBookmarkManager::removeBookmark(const MUCBookmark& bookmark) {
void MUCBookmarkManager::flush() {
if (!storage) {
- storage = boost::make_shared<Storage>();
+ storage = std::make_shared<Storage>();
}
// Update the storage element
storage->clearRooms();
diff --git a/Swiften/MUC/MUCBookmarkManager.h b/Swiften/MUC/MUCBookmarkManager.h
index 18dd677..58aaeee 100644
--- a/Swiften/MUC/MUCBookmarkManager.h
+++ b/Swiften/MUC/MUCBookmarkManager.h
@@ -6,10 +6,10 @@
#pragma once
+#include <memory>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -40,13 +40,13 @@ namespace Swift {
private:
bool containsEquivalent(const std::vector<MUCBookmark>& list, const MUCBookmark& bookmark);
- void handleBookmarksReceived(boost::shared_ptr<Storage> payload, ErrorPayload::ref error);
+ void handleBookmarksReceived(std::shared_ptr<Storage> payload, ErrorPayload::ref error);
void flush();
private:
bool ready_;
std::vector<MUCBookmark> bookmarks_;
IQRouter* iqRouter_;
- boost::shared_ptr<Storage> storage;
+ std::shared_ptr<Storage> storage;
};
}
diff --git a/Swiften/MUC/MUCImpl.cpp b/Swiften/MUC/MUCImpl.cpp
index 8562ec8..4bab39d 100644
--- a/Swiften/MUC/MUCImpl.cpp
+++ b/Swiften/MUC/MUCImpl.cpp
@@ -6,9 +6,9 @@
#include <Swiften/MUC/MUCImpl.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/foreach.h>
#include <Swiften/Client/StanzaChannel.h>
@@ -92,10 +92,10 @@ void MUCImpl::internalJoin(const std::string &nick) {
ownMUCJID = JID(ownMUCJID.getNode(), ownMUCJID.getDomain(), nick);
- Presence::ref joinPresence = presenceSender->getLastSentUndirectedPresence() ? (*presenceSender->getLastSentUndirectedPresence())->clone() : boost::make_shared<Presence>();
+ Presence::ref joinPresence = presenceSender->getLastSentUndirectedPresence() ? (*presenceSender->getLastSentUndirectedPresence())->clone() : std::make_shared<Presence>();
assert(joinPresence->getType() == Presence::Available);
joinPresence->setTo(ownMUCJID);
- MUCPayload::ref mucPayload = boost::make_shared<MUCPayload>();
+ MUCPayload::ref mucPayload = std::make_shared<MUCPayload>();
if (joinSince_ != boost::posix_time::not_a_date_time) {
mucPayload->setSince(joinSince_);
}
@@ -108,7 +108,7 @@ void MUCImpl::internalJoin(const std::string &nick) {
}
void MUCImpl::changeNickname(const std::string& newNickname) {
- Presence::ref changeNicknamePresence = boost::make_shared<Presence>();
+ Presence::ref changeNicknamePresence = std::make_shared<Presence>();
changeNicknamePresence->setTo(ownMUCJID.toBare().toString() + std::string("/") + newNickname);
presenceSender->sendPresence(changeNicknamePresence);
}
@@ -157,7 +157,7 @@ void MUCImpl::handleIncomingPresence(Presence::ref presence) {
presenceSender->addDirectedPresenceReceiver(ownMUCJID, DirectedPresenceSender::DontSendPresence);
if (presenceSender->getLastSentUndirectedPresence() && !isEqualExceptID(**(presenceSender->getLastSentUndirectedPresence()), *joinRequestPresence_)) {
// our presence changed between join request and join complete, send current presence to MUC
- Presence::ref latestPresence = boost::make_shared<Presence>(**presenceSender->getLastSentUndirectedPresence());
+ Presence::ref latestPresence = std::make_shared<Presence>(**presenceSender->getLastSentUndirectedPresence());
latestPresence->setTo(ownMUCJID);
presenceSender->sendPresence(latestPresence);
}
@@ -185,7 +185,7 @@ void MUCImpl::handleIncomingPresence(Presence::ref presence) {
LeavingType type = LeavePart;
boost::optional<std::string> newNickname;
if (mucPayload) {
- if (boost::dynamic_pointer_cast<MUCDestroyPayload>(mucPayload->getPayload())) {
+ if (std::dynamic_pointer_cast<MUCDestroyPayload>(mucPayload->getPayload())) {
type = LeaveDestroy;
}
else foreach (MUCUserPayload::StatusCode status, mucPayload->getStatusCodes()) {
@@ -285,8 +285,8 @@ void MUCImpl::handleIncomingPresence(Presence::ref presence) {
// Accept default room configuration and create an instant room http://xmpp.org/extensions/xep-0045.html#createroom-instant
MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload());
presenceSender->addDirectedPresenceReceiver(ownMUCJID, DirectedPresenceSender::DontSendPresence);
- mucPayload->setPayload(boost::make_shared<Form>(Form::SubmitType));
- boost::shared_ptr< GenericRequest<MUCOwnerPayload> > request = boost::make_shared< GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_);
+ mucPayload->setPayload(std::make_shared<Form>(Form::SubmitType));
+ std::shared_ptr< GenericRequest<MUCOwnerPayload> > request = std::make_shared< GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_);
request->onResponse.connect(boost::bind(&MUCImpl::handleCreationConfigResponse, this, _1, _2));
request->send();
}
@@ -330,12 +330,12 @@ void MUCImpl::kickOccupant(const JID& jid) {
* Call with the room JID, not the real JID.
*/
void MUCImpl::changeOccupantRole(const JID& jid, MUCOccupant::Role role) {
- MUCAdminPayload::ref mucPayload = boost::make_shared<MUCAdminPayload>();
+ MUCAdminPayload::ref mucPayload = std::make_shared<MUCAdminPayload>();
MUCItem item;
item.role = role;
item.nick = jid.getResource();
mucPayload->addItem(item);
- boost::shared_ptr<GenericRequest<MUCAdminPayload> > request = boost::make_shared<GenericRequest<MUCAdminPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_);
+ std::shared_ptr<GenericRequest<MUCAdminPayload> > request = std::make_shared<GenericRequest<MUCAdminPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_);
request->onResponse.connect(boost::bind(&MUCImpl::handleOccupantRoleChangeResponse, this, _1, _2, jid, role));
request->send();
@@ -348,11 +348,11 @@ void MUCImpl::handleOccupantRoleChangeResponse(MUCAdminPayload::ref /*unused*/,
}
void MUCImpl::requestAffiliationList(MUCOccupant::Affiliation affiliation) {
- MUCAdminPayload::ref mucPayload = boost::make_shared<MUCAdminPayload>();
+ MUCAdminPayload::ref mucPayload = std::make_shared<MUCAdminPayload>();
MUCItem item;
item.affiliation = affiliation;
mucPayload->addItem(item);
- boost::shared_ptr<GenericRequest<MUCAdminPayload> > request = boost::make_shared< GenericRequest<MUCAdminPayload> >(IQ::Get, getJID(), mucPayload, iqRouter_);
+ std::shared_ptr<GenericRequest<MUCAdminPayload> > request = std::make_shared< GenericRequest<MUCAdminPayload> >(IQ::Get, getJID(), mucPayload, iqRouter_);
request->onResponse.connect(boost::bind(&MUCImpl::handleAffiliationListResponse, this, _1, _2, affiliation));
request->send();
}
@@ -361,12 +361,12 @@ void MUCImpl::requestAffiliationList(MUCOccupant::Affiliation affiliation) {
* Must be called with the real JID, not the room JID.
*/
void MUCImpl::changeAffiliation(const JID& jid, MUCOccupant::Affiliation affiliation) {
- MUCAdminPayload::ref mucPayload = boost::make_shared<MUCAdminPayload>();
+ MUCAdminPayload::ref mucPayload = std::make_shared<MUCAdminPayload>();
MUCItem item;
item.affiliation = affiliation;
item.realJID = jid.toBare();
mucPayload->addItem(item);
- boost::shared_ptr<GenericRequest<MUCAdminPayload> > request = boost::make_shared<GenericRequest<MUCAdminPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_);
+ std::shared_ptr<GenericRequest<MUCAdminPayload> > request = std::make_shared<GenericRequest<MUCAdminPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_);
request->onResponse.connect(boost::bind(&MUCImpl::handleAffiliationChangeResponse, this, _1, _2, jid, affiliation));
request->send();
}
@@ -393,7 +393,7 @@ void MUCImpl::handleAffiliationChangeResponse(MUCAdminPayload::ref /*unused*/, E
}
void MUCImpl::changeSubject(const std::string& subject) {
- Message::ref message = boost::make_shared<Message>();
+ Message::ref message = std::make_shared<Message>();
message->setSubject(subject);
message->setType(Message::Groupchat);
message->setTo(ownMUCJID.toBare());
@@ -402,15 +402,15 @@ void MUCImpl::changeSubject(const std::string& subject) {
void MUCImpl::requestConfigurationForm() {
MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload());
- boost::shared_ptr<GenericRequest<MUCOwnerPayload> > request = boost::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Get, getJID(), mucPayload, iqRouter_);
+ std::shared_ptr<GenericRequest<MUCOwnerPayload> > request = std::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Get, getJID(), mucPayload, iqRouter_);
request->onResponse.connect(boost::bind(&MUCImpl::handleConfigurationFormReceived, this, _1, _2));
request->send();
}
void MUCImpl::cancelConfigureRoom() {
MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload());
- mucPayload->setPayload(boost::make_shared<Form>(Form::CancelType));
- boost::shared_ptr<GenericRequest<MUCOwnerPayload> > request = boost::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_);
+ mucPayload->setPayload(std::make_shared<Form>(Form::CancelType));
+ std::shared_ptr<GenericRequest<MUCOwnerPayload> > request = std::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_);
request->send();
}
@@ -435,7 +435,7 @@ void MUCImpl::handleConfigurationResultReceived(MUCOwnerPayload::ref /*payload*/
void MUCImpl::configureRoom(Form::ref form) {
MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload());
mucPayload->setPayload(form);
- boost::shared_ptr<GenericRequest<MUCOwnerPayload> > request = boost::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_);
+ std::shared_ptr<GenericRequest<MUCOwnerPayload> > request = std::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_);
if (unlocking) {
request->onResponse.connect(boost::bind(&MUCImpl::handleCreationConfigResponse, this, _1, _2));
}
@@ -446,19 +446,19 @@ void MUCImpl::configureRoom(Form::ref form) {
}
void MUCImpl::destroyRoom() {
- MUCOwnerPayload::ref mucPayload = boost::make_shared<MUCOwnerPayload>();
- MUCDestroyPayload::ref mucDestroyPayload = boost::make_shared<MUCDestroyPayload>();
+ MUCOwnerPayload::ref mucPayload = std::make_shared<MUCOwnerPayload>();
+ MUCDestroyPayload::ref mucDestroyPayload = std::make_shared<MUCDestroyPayload>();
mucPayload->setPayload(mucDestroyPayload);
- boost::shared_ptr< GenericRequest<MUCOwnerPayload> > request = boost::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_);
+ std::shared_ptr< GenericRequest<MUCOwnerPayload> > request = std::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_);
request->onResponse.connect(boost::bind(&MUCImpl::handleConfigurationResultReceived, this, _1, _2));
request->send();
}
void MUCImpl::invitePerson(const JID& person, const std::string& reason, bool isImpromptu, bool isReuseChat) {
- Message::ref message = boost::make_shared<Message>();
+ Message::ref message = std::make_shared<Message>();
message->setTo(person);
message->setType(Message::Normal);
- MUCInvitationPayload::ref invite = boost::make_shared<MUCInvitationPayload>();
+ MUCInvitationPayload::ref invite = std::make_shared<MUCInvitationPayload>();
invite->setReason(reason);
invite->setJID(ownMUCJID.toBare());
invite->setIsImpromptu(isImpromptu);
diff --git a/Swiften/MUC/MUCImpl.h b/Swiften/MUC/MUCImpl.h
index 9b4377a..f9802af 100644
--- a/Swiften/MUC/MUCImpl.h
+++ b/Swiften/MUC/MUCImpl.h
@@ -7,9 +7,9 @@
#pragma once
#include <map>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
#include <boost/signals/connection.hpp>
#include <Swiften/Base/API.h>
@@ -31,7 +31,7 @@ namespace Swift {
class SWIFTEN_API MUCImpl : public MUC {
public:
- typedef boost::shared_ptr<MUCImpl> ref;
+ typedef std::shared_ptr<MUCImpl> ref;
public:
MUCImpl(StanzaChannel* stanzaChannel, IQRouter* iqRouter, DirectedPresenceSender* presenceSender, const JID &muc, MUCRegistry* mucRegistry);
diff --git a/Swiften/MUC/MUCManager.cpp b/Swiften/MUC/MUCManager.cpp
index b4e3b00..81e5cd5 100644
--- a/Swiften/MUC/MUCManager.cpp
+++ b/Swiften/MUC/MUCManager.cpp
@@ -14,7 +14,7 @@ MUCManager::MUCManager(StanzaChannel* stanzaChannel, IQRouter* iqRouter, Directe
}
MUC::ref MUCManager::createMUC(const JID& jid) {
- return boost::make_shared<MUCImpl>(stanzaChannel, iqRouter, presenceSender, jid, mucRegistry);
+ return std::make_shared<MUCImpl>(stanzaChannel, iqRouter, presenceSender, jid, mucRegistry);
}
}
diff --git a/Swiften/MUC/UnitTest/MUCTest.cpp b/Swiften/MUC/UnitTest/MUCTest.cpp
index 548617c..115787e 100644
--- a/Swiften/MUC/UnitTest/MUCTest.cpp
+++ b/Swiften/MUC/UnitTest/MUCTest.cpp
@@ -4,9 +4,9 @@
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -102,7 +102,7 @@ class MUCTest : public CppUnit::TestFixture {
void testCreateInstant() {
MUC::ref testling = createMUC(JID("rabbithole@wonderland.lit"));
testling->joinAs("Alice");
- Presence::ref serverRespondsLocked = boost::make_shared<Presence>();
+ Presence::ref serverRespondsLocked = std::make_shared<Presence>();
serverRespondsLocked->setFrom(JID("rabbithole@wonderland.lit/Alice"));
MUCUserPayload::ref mucPayload(new MUCUserPayload());
MUCItem myItem;
@@ -122,12 +122,12 @@ class MUCTest : public CppUnit::TestFixture {
}
void testReplicateBug() {
- Presence::ref initialPresence = boost::make_shared<Presence>();
+ Presence::ref initialPresence = std::make_shared<Presence>();
initialPresence->setStatus("");
- VCard::ref vcard = boost::make_shared<VCard>();
+ VCard::ref vcard = std::make_shared<VCard>();
vcard->setPhoto(createByteArray("15c30080ae98ec48be94bf0e191d43edd06e500a"));
initialPresence->addPayload(vcard);
- CapsInfo::ref caps = boost::make_shared<CapsInfo>();
+ CapsInfo::ref caps = std::make_shared<CapsInfo>();
caps->setNode("http://swift.im");
caps->setVersion("p2UP0DrcVgKM6jJqYN/B92DKK0o=");
initialPresence->addPayload(caps);
@@ -135,7 +135,7 @@ class MUCTest : public CppUnit::TestFixture {
MUC::ref testling = createMUC(JID("test@rooms.swift.im"));
testling->joinAs("Test");
- Presence::ref serverRespondsLocked = boost::make_shared<Presence>();
+ Presence::ref serverRespondsLocked = std::make_shared<Presence>();
serverRespondsLocked->setFrom(JID("test@rooms.swift.im/Test"));
serverRespondsLocked->setTo(JID("test@swift.im/6913d576d55f0b67"));
serverRespondsLocked->addPayload(vcard);
@@ -163,14 +163,14 @@ class MUCTest : public CppUnit::TestFixture {
testling->joinAs("Rabbit");
// Rabbit joins
- Presence::ref rabbitJoins = boost::make_shared<Presence>();
+ Presence::ref rabbitJoins = std::make_shared<Presence>();
rabbitJoins->setTo("test@swift.im/6913d576d55f0b67");
rabbitJoins->setFrom(testling->getJID().toString() + "/Rabbit");
channel->onPresenceReceived(rabbitJoins);
CPPUNIT_ASSERT_EQUAL(true, testling->hasOccupant("Rabbit"));
// Alice joins
- Presence::ref aliceJoins = boost::make_shared<Presence>();
+ Presence::ref aliceJoins = std::make_shared<Presence>();
aliceJoins->setTo("test@swift.im/6913d576d55f0b67");
aliceJoins->setFrom(testling->getJID().toString() + "/Alice");
channel->onPresenceReceived(aliceJoins);
@@ -183,7 +183,7 @@ class MUCTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(std::string("Dodo"), stanza->getTo().getResource());
// Alice changes nick to Alice2
- stanza = boost::make_shared<Presence>();
+ stanza = std::make_shared<Presence>();
stanza->setFrom(JID("foo@bar.com/Alice"));
stanza->setTo(JID(router->getJID()));
stanza->setType(Presence::Unavailable);
@@ -201,7 +201,7 @@ class MUCTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(true, testling->hasOccupant("Alice2"));
// We (Rabbit) change nick to Robot
- stanza = boost::make_shared<Presence>();
+ stanza = std::make_shared<Presence>();
stanza->setFrom(JID("foo@bar.com/Rabbit"));
stanza->setTo(JID(router->getJID()));
stanza->setType(Presence::Unavailable);
@@ -235,7 +235,7 @@ class MUCTest : public CppUnit::TestFixture {
private:
MUC::ref createMUC(const JID& jid) {
- MUC::ref muc = boost::make_shared<MUCImpl>(channel, router, presenceSender, jid, mucRegistry);
+ MUC::ref muc = std::make_shared<MUCImpl>(channel, router, presenceSender, jid, mucRegistry);
muc->onOccupantNicknameChanged.connect(boost::bind(&MUCTest::handleOccupantNicknameChanged, this, _1, _2));
return muc;
}
@@ -250,7 +250,7 @@ class MUCTest : public CppUnit::TestFixture {
void receivePresence(const JID& jid, const std::string& status) {
Presence::ref p = Presence::create(status);
p->setFrom(jid);
- //MUCUserPayload::ref mucUserPayload = boost::make_shared<MUCUserPayload>();
+ //MUCUserPayload::ref mucUserPayload = std::make_shared<MUCUserPayload>();
//mucUserPayload->addItem(item);
//p->addPayload(mucUserPayload);
channel->onPresenceReceived(p);
diff --git a/Swiften/MUC/UnitTest/MockMUC.h b/Swiften/MUC/UnitTest/MockMUC.h
index c61f8a9..575c8e7 100644
--- a/Swiften/MUC/UnitTest/MockMUC.h
+++ b/Swiften/MUC/UnitTest/MockMUC.h
@@ -7,9 +7,9 @@
#pragma once
#include <map>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
#include <boost/signals/connection.hpp>
#include <Swiften/Base/API.h>
@@ -31,7 +31,7 @@ namespace Swift {
class SWIFTEN_API MockMUC : public MUC{
public:
- typedef boost::shared_ptr<MockMUC> ref;
+ typedef std::shared_ptr<MockMUC> ref;
public:
MockMUC(const JID &muc);
diff --git a/Swiften/Network/BOSHConnection.cpp b/Swiften/Network/BOSHConnection.cpp
index 887a5f0..757b1db 100644
--- a/Swiften/Network/BOSHConnection.cpp
+++ b/Swiften/Network/BOSHConnection.cpp
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -42,10 +42,10 @@ BOSHConnection::BOSHConnection(const URL& boshURL, Connector::ref connector, XML
connectionReady_(false)
{
if (boshURL_.getScheme() == "https") {
- tlsLayer_ = boost::make_shared<TLSLayer>(tlsContextFactory, tlsOptions);
+ tlsLayer_ = std::make_shared<TLSLayer>(tlsContextFactory, tlsOptions);
// The following dummyLayer_ is needed as the TLSLayer will pass the decrypted data to its parent layer.
// The dummyLayer_ will serve as the parent layer.
- dummyLayer_ = boost::make_shared<DummyStreamLayer>(tlsLayer_.get());
+ dummyLayer_ = std::make_shared<DummyStreamLayer>(tlsLayer_.get());
}
}
@@ -78,7 +78,7 @@ void BOSHConnection::handleTLSConnected() {
void BOSHConnection::handleTLSApplicationDataRead(const SafeByteArray& data) {
SWIFT_LOG(debug) << std::endl;
- handleDataRead(boost::make_shared<SafeByteArray>(data));
+ handleDataRead(std::make_shared<SafeByteArray>(data));
}
void BOSHConnection::handleTLSNetowrkDataWriteRequest(const SafeByteArray& data) {
@@ -86,12 +86,12 @@ void BOSHConnection::handleTLSNetowrkDataWriteRequest(const SafeByteArray& data)
connection_->write(data);
}
-void BOSHConnection::handleRawDataRead(boost::shared_ptr<SafeByteArray> data) {
+void BOSHConnection::handleRawDataRead(std::shared_ptr<SafeByteArray> data) {
SWIFT_LOG(debug) << std::endl;
tlsLayer_->handleDataRead(*data.get());
}
-void BOSHConnection::handleTLSError(boost::shared_ptr<TLSError> /* error */) {
+void BOSHConnection::handleTLSError(std::shared_ptr<TLSError> /* error */) {
}
@@ -276,7 +276,7 @@ void BOSHConnection::startStream(const std::string& to, unsigned long long rid)
SWIFT_LOG(debug) << "write stream header: " << safeByteArrayToString(safeHeader) << std::endl;
}
-void BOSHConnection::handleDataRead(boost::shared_ptr<SafeByteArray> data) {
+void BOSHConnection::handleDataRead(std::shared_ptr<SafeByteArray> data) {
onBOSHDataRead(*data);
buffer_ = concat(buffer_, *data);
std::string response = safeByteArrayToString(buffer_);
@@ -295,7 +295,7 @@ void BOSHConnection::handleDataRead(boost::shared_ptr<SafeByteArray> data) {
if (parser.getBody()) {
if (parser.getBody()->attributes.getAttribute("type") == "terminate") {
BOSHError::Type errorType = parseTerminationCondition(parser.getBody()->attributes.getAttribute("condition"));
- onSessionTerminated(errorType == BOSHError::NoError ? boost::shared_ptr<BOSHError>() : boost::make_shared<BOSHError>(errorType));
+ onSessionTerminated(errorType == BOSHError::NoError ? std::shared_ptr<BOSHError>() : std::make_shared<BOSHError>(errorType));
}
buffer_.clear();
if (waitingForStartResponse_) {
diff --git a/Swiften/Network/BOSHConnection.h b/Swiften/Network/BOSHConnection.h
index dc0f3a5..485e86a 100644
--- a/Swiften/Network/BOSHConnection.h
+++ b/Swiften/Network/BOSHConnection.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,7 +13,7 @@
#pragma once
-#include <boost/enable_shared_from_this.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Error.h>
@@ -51,15 +51,15 @@ namespace Swift {
BOSHError(Type type) : SessionStream::SessionStreamError(SessionStream::SessionStreamError::ConnectionReadError), type(type) {}
Type getType() {return type;}
- typedef boost::shared_ptr<BOSHError> ref;
+ typedef std::shared_ptr<BOSHError> ref;
private:
Type type;
};
- class SWIFTEN_API BOSHConnection : public boost::enable_shared_from_this<BOSHConnection> {
+ class SWIFTEN_API BOSHConnection : public std::enable_shared_from_this<BOSHConnection> {
public:
- typedef boost::shared_ptr<BOSHConnection> ref;
+ typedef std::shared_ptr<BOSHConnection> ref;
static ref create(const URL& boshURL, Connector::ref connector, XMLParserFactory* parserFactory, TLSContextFactory* tlsContextFactory, const TLSOptions& tlsOptions) {
return ref(new BOSHConnection(boshURL, connector, parserFactory, tlsContextFactory, tlsOptions));
}
@@ -97,7 +97,7 @@ namespace Swift {
static std::pair<SafeByteArray, size_t> createHTTPRequest(const SafeByteArray& data, bool streamRestart, bool terminate, unsigned long long rid, const std::string& sid, const URL& boshURL);
void handleConnectFinished(Connection::ref);
- void handleDataRead(boost::shared_ptr<SafeByteArray> data);
+ void handleDataRead(std::shared_ptr<SafeByteArray> data);
void handleDisconnected(const boost::optional<Connection::Error>& error);
void write(const SafeByteArray& data, bool streamRestart, bool terminate); /* FIXME: refactor */
BOSHError::Type parseTerminationCondition(const std::string& text);
@@ -106,16 +106,16 @@ namespace Swift {
void handleTLSConnected();
void handleTLSApplicationDataRead(const SafeByteArray& data);
void handleTLSNetowrkDataWriteRequest(const SafeByteArray& data);
- void handleRawDataRead(boost::shared_ptr<SafeByteArray> data);
- void handleTLSError(boost::shared_ptr<TLSError> error);
+ void handleRawDataRead(std::shared_ptr<SafeByteArray> data);
+ void handleTLSError(std::shared_ptr<TLSError> error);
void writeData(const SafeByteArray& data);
URL boshURL_;
Connector::ref connector_;
XMLParserFactory* parserFactory_;
- boost::shared_ptr<Connection> connection_;
- boost::shared_ptr<HighLayer> dummyLayer_;
- boost::shared_ptr<TLSLayer> tlsLayer_;
+ std::shared_ptr<Connection> connection_;
+ std::shared_ptr<HighLayer> dummyLayer_;
+ std::shared_ptr<TLSLayer> tlsLayer_;
std::string sid_;
bool waitingForStartResponse_;
unsigned long long rid_;
diff --git a/Swiften/Network/BOSHConnectionPool.cpp b/Swiften/Network/BOSHConnectionPool.cpp
index 7d5c164..9ce40d3 100644
--- a/Swiften/Network/BOSHConnectionPool.cpp
+++ b/Swiften/Network/BOSHConnectionPool.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -17,7 +17,7 @@
#include <Swiften/Network/HTTPConnectProxiedConnectionFactory.h>
namespace Swift {
-BOSHConnectionPool::BOSHConnectionPool(const URL& boshURL, DomainNameResolver* realResolver, ConnectionFactory* connectionFactoryParameter, XMLParserFactory* parserFactory, TLSContextFactory* tlsFactory, TimerFactory* timerFactory, EventLoop* eventLoop, const std::string& to, unsigned long long initialRID, const URL& boshHTTPConnectProxyURL, const SafeString& boshHTTPConnectProxyAuthID, const SafeString& boshHTTPConnectProxyAuthPassword, const TLSOptions& tlsOptions, boost::shared_ptr<HTTPTrafficFilter> trafficFilter) :
+BOSHConnectionPool::BOSHConnectionPool(const URL& boshURL, DomainNameResolver* realResolver, ConnectionFactory* connectionFactoryParameter, XMLParserFactory* parserFactory, TLSContextFactory* tlsFactory, TimerFactory* timerFactory, EventLoop* eventLoop, const std::string& to, unsigned long long initialRID, const URL& boshHTTPConnectProxyURL, const SafeString& boshHTTPConnectProxyAuthID, const SafeString& boshHTTPConnectProxyAuthPassword, const TLSOptions& tlsOptions, std::shared_ptr<HTTPTrafficFilter> trafficFilter) :
boshURL(boshURL),
connectionFactory(connectionFactoryParameter),
xmlParserFactory(parserFactory),
@@ -96,7 +96,7 @@ std::vector<Certificate::ref> BOSHConnectionPool::getPeerCertificateChain() cons
return pinnedCertificateChain_;
}
-boost::shared_ptr<CertificateVerificationError> BOSHConnectionPool::getPeerCertificateVerificationError() const {
+std::shared_ptr<CertificateVerificationError> BOSHConnectionPool::getPeerCertificateVerificationError() const {
return lastVerificationError_;
}
@@ -132,7 +132,7 @@ void BOSHConnectionPool::handleSessionStarted(const std::string& sessionID, size
void BOSHConnectionPool::handleConnectFinished(bool error, BOSHConnection::ref connection) {
if (error) {
- onSessionTerminated(boost::make_shared<BOSHError>(BOSHError::UndefinedCondition));
+ onSessionTerminated(std::make_shared<BOSHError>(BOSHError::UndefinedCondition));
/*TODO: We can probably manage to not terminate the stream here and use the rid/ack retry
* logic to just swallow the error and try again (some number of tries).
*/
@@ -235,7 +235,7 @@ void BOSHConnectionPool::tryToSendQueuedData() {
}
void BOSHConnectionPool::handleHTTPError(const std::string& /*errorCode*/) {
- handleSessionTerminated(boost::make_shared<BOSHError>(BOSHError::UndefinedCondition));
+ handleSessionTerminated(std::make_shared<BOSHError>(BOSHError::UndefinedCondition));
}
void BOSHConnectionPool::handleConnectionDisconnected(bool/* error*/, BOSHConnection::ref connection) {
@@ -244,7 +244,7 @@ void BOSHConnectionPool::handleConnectionDisconnected(bool/* error*/, BOSHConnec
handleSessionTerminated(BOSHError::ref());
}
//else if (error) {
- // handleSessionTerminated(boost::make_shared<BOSHError>(BOSHError::UndefinedCondition));
+ // handleSessionTerminated(std::make_shared<BOSHError>(BOSHError::UndefinedCondition));
//}
else {
/* We might have just freed up a connection slot to send with */
@@ -252,7 +252,7 @@ void BOSHConnectionPool::handleConnectionDisconnected(bool/* error*/, BOSHConnec
}
}
-boost::shared_ptr<BOSHConnection> BOSHConnectionPool::createConnection() {
+std::shared_ptr<BOSHConnection> BOSHConnectionPool::createConnection() {
Connector::ref connector = Connector::create(boshURL.getHost(), URL::getPortOrDefaultPort(boshURL), boost::optional<std::string>(), resolver, connectionFactory, timerFactory);
BOSHConnection::ref connection = BOSHConnection::create(boshURL, connector, xmlParserFactory, tlsContextFactory_, tlsOptions_);
connection->onXMPPDataRead.connect(boost::bind(&BOSHConnectionPool::handleDataRead, this, _1));
@@ -274,7 +274,7 @@ boost::shared_ptr<BOSHConnection> BOSHConnectionPool::createConnection() {
return connection;
}
-void BOSHConnectionPool::destroyConnection(boost::shared_ptr<BOSHConnection> connection) {
+void BOSHConnectionPool::destroyConnection(std::shared_ptr<BOSHConnection> connection) {
connections.erase(std::remove(connections.begin(), connections.end(), connection), connections.end());
connection->onXMPPDataRead.disconnect(boost::bind(&BOSHConnectionPool::handleDataRead, this, _1));
connection->onSessionStarted.disconnect(boost::bind(&BOSHConnectionPool::handleSessionStarted, this, _1, _2));
diff --git a/Swiften/Network/BOSHConnectionPool.h b/Swiften/Network/BOSHConnectionPool.h
index 5088be6..b288505 100644
--- a/Swiften/Network/BOSHConnectionPool.h
+++ b/Swiften/Network/BOSHConnectionPool.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -26,7 +26,7 @@ namespace Swift {
class SWIFTEN_API BOSHConnectionPool : public boost::bsignals::trackable {
public:
- BOSHConnectionPool(const URL& boshURL, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, XMLParserFactory* parserFactory, TLSContextFactory* tlsFactory, TimerFactory* timerFactory, EventLoop* eventLoop, const std::string& to, unsigned long long initialRID, const URL& boshHTTPConnectProxyURL, const SafeString& boshHTTPConnectProxyAuthID, const SafeString& boshHTTPConnectProxyAuthPassword, const TLSOptions& tlsOptions, boost::shared_ptr<HTTPTrafficFilter> trafficFilter = boost::shared_ptr<HTTPTrafficFilter>());
+ BOSHConnectionPool(const URL& boshURL, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, XMLParserFactory* parserFactory, TLSContextFactory* tlsFactory, TimerFactory* timerFactory, EventLoop* eventLoop, const std::string& to, unsigned long long initialRID, const URL& boshHTTPConnectProxyURL, const SafeString& boshHTTPConnectProxyAuthID, const SafeString& boshHTTPConnectProxyAuthPassword, const TLSOptions& tlsOptions, std::shared_ptr<HTTPTrafficFilter> trafficFilter = std::shared_ptr<HTTPTrafficFilter>());
~BOSHConnectionPool();
void open();
@@ -39,7 +39,7 @@ namespace Swift {
bool isTLSEncrypted() const;
Certificate::ref getPeerCertificate() const;
std::vector<Certificate::ref> getPeerCertificateChain() const;
- boost::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const;
+ std::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const;
boost::signal<void (BOSHError::ref)> onSessionTerminated;
boost::signal<void ()> onSessionStarted;
@@ -82,7 +82,7 @@ namespace Swift {
CertificateWithKey::ref clientCertificate;
TLSContextFactory* tlsContextFactory_;
TLSOptions tlsOptions_;
- std::vector<boost::shared_ptr<Certificate> > pinnedCertificateChain_;
- boost::shared_ptr<CertificateVerificationError> lastVerificationError_;
+ std::vector<std::shared_ptr<Certificate> > pinnedCertificateChain_;
+ std::shared_ptr<CertificateVerificationError> lastVerificationError_;
};
}
diff --git a/Swiften/Network/BoostConnection.cpp b/Swiften/Network/BoostConnection.cpp
index 80cb6b8..a987790 100644
--- a/Swiften/Network/BoostConnection.cpp
+++ b/Swiften/Network/BoostConnection.cpp
@@ -7,13 +7,13 @@
#include <Swiften/Network/BoostConnection.h>
#include <algorithm>
+#include <memory>
#include <string>
#include <boost/asio/placeholders.hpp>
#include <boost/asio/write.hpp>
#include <boost/bind.hpp>
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <boost/thread.hpp>
#include <Swiften/Base/Algorithm.h>
@@ -45,13 +45,13 @@ class SharedBuffer {
const boost::asio::const_buffer* end() const { return &buffer_ + 1; }
private:
- boost::shared_ptr< std::vector<char, SafeAllocator<char> > > data_;
+ std::shared_ptr< std::vector<char, SafeAllocator<char> > > data_;
boost::asio::const_buffer buffer_;
};
// -----------------------------------------------------------------------------
-BoostConnection::BoostConnection(boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) :
+BoostConnection::BoostConnection(std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) :
eventLoop(eventLoop), ioService(ioService), socket_(*ioService), writing_(false), closeSocketAfterNextWrite_(false) {
}
@@ -119,7 +119,7 @@ void BoostConnection::handleConnectFinished(const boost::system::error_code& err
}
void BoostConnection::doRead() {
- readBuffer_ = boost::make_shared<SafeByteArray>(BUFFER_SIZE);
+ readBuffer_ = std::make_shared<SafeByteArray>(BUFFER_SIZE);
boost::lock_guard<boost::mutex> lock(readCloseMutex_);
socket_.async_read_some(
boost::asio::buffer(*readBuffer_),
diff --git a/Swiften/Network/BoostConnection.h b/Swiften/Network/BoostConnection.h
index 9909455..82208a1 100644
--- a/Swiften/Network/BoostConnection.h
+++ b/Swiften/Network/BoostConnection.h
@@ -6,9 +6,10 @@
#pragma once
+#include <memory>
+
#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/tcp.hpp>
-#include <boost/enable_shared_from_this.hpp>
#include <boost/thread/mutex.hpp>
#include <Swiften/Base/API.h>
@@ -29,13 +30,13 @@ namespace boost {
namespace Swift {
class EventLoop;
- class SWIFTEN_API BoostConnection : public Connection, public EventOwner, public boost::enable_shared_from_this<BoostConnection> {
+ class SWIFTEN_API BoostConnection : public Connection, public EventOwner, public std::enable_shared_from_this<BoostConnection> {
public:
- typedef boost::shared_ptr<BoostConnection> ref;
+ typedef std::shared_ptr<BoostConnection> ref;
virtual ~BoostConnection();
- static ref create(boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) {
+ static ref create(std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) {
return ref(new BoostConnection(ioService, eventLoop));
}
@@ -55,10 +56,10 @@ namespace Swift {
Certificate::ref getPeerCertificate() const;
std::vector<Certificate::ref> getPeerCertificateChain() const;
- boost::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const;
+ std::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const;
private:
- BoostConnection(boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop);
+ BoostConnection(std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop);
void handleConnectFinished(const boost::system::error_code& error);
void handleSocketRead(const boost::system::error_code& error, size_t bytesTransferred);
@@ -69,9 +70,9 @@ namespace Swift {
private:
EventLoop* eventLoop;
- boost::shared_ptr<boost::asio::io_service> ioService;
+ std::shared_ptr<boost::asio::io_service> ioService;
boost::asio::ip::tcp::socket socket_;
- boost::shared_ptr<SafeByteArray> readBuffer_;
+ std::shared_ptr<SafeByteArray> readBuffer_;
boost::mutex writeMutex_;
bool writing_;
SafeByteArray writeQueue_;
diff --git a/Swiften/Network/BoostConnectionFactory.cpp b/Swiften/Network/BoostConnectionFactory.cpp
index d22f600..9ec30f5 100644
--- a/Swiften/Network/BoostConnectionFactory.cpp
+++ b/Swiften/Network/BoostConnectionFactory.cpp
@@ -10,10 +10,10 @@
namespace Swift {
-BoostConnectionFactory::BoostConnectionFactory(boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : ioService(ioService), eventLoop(eventLoop) {
+BoostConnectionFactory::BoostConnectionFactory(std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : ioService(ioService), eventLoop(eventLoop) {
}
-boost::shared_ptr<Connection> BoostConnectionFactory::createConnection() {
+std::shared_ptr<Connection> BoostConnectionFactory::createConnection() {
return BoostConnection::create(ioService, eventLoop);
}
diff --git a/Swiften/Network/BoostConnectionFactory.h b/Swiften/Network/BoostConnectionFactory.h
index 46502de..a4e3b0d 100644
--- a/Swiften/Network/BoostConnectionFactory.h
+++ b/Swiften/Network/BoostConnectionFactory.h
@@ -17,12 +17,12 @@ namespace Swift {
class SWIFTEN_API BoostConnectionFactory : public ConnectionFactory {
public:
- BoostConnectionFactory(boost::shared_ptr<boost::asio::io_service>, EventLoop* eventLoop);
+ BoostConnectionFactory(std::shared_ptr<boost::asio::io_service>, EventLoop* eventLoop);
- virtual boost::shared_ptr<Connection> createConnection();
+ virtual std::shared_ptr<Connection> createConnection();
private:
- boost::shared_ptr<boost::asio::io_service> ioService;
+ std::shared_ptr<boost::asio::io_service> ioService;
EventLoop* eventLoop;
};
}
diff --git a/Swiften/Network/BoostConnectionServer.cpp b/Swiften/Network/BoostConnectionServer.cpp
index 99fe9b6..34b5799 100644
--- a/Swiften/Network/BoostConnectionServer.cpp
+++ b/Swiften/Network/BoostConnectionServer.cpp
@@ -19,10 +19,10 @@
namespace Swift {
-BoostConnectionServer::BoostConnectionServer(int port, boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : port_(port), ioService_(ioService), eventLoop(eventLoop), acceptor_(nullptr) {
+BoostConnectionServer::BoostConnectionServer(int port, std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : port_(port), ioService_(ioService), eventLoop(eventLoop), acceptor_(nullptr) {
}
-BoostConnectionServer::BoostConnectionServer(const HostAddress &address, int port, boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : address_(address), port_(port), ioService_(ioService), eventLoop(eventLoop), acceptor_(nullptr) {
+BoostConnectionServer::BoostConnectionServer(const HostAddress &address, int port, std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : address_(address), port_(port), ioService_(ioService), eventLoop(eventLoop), acceptor_(nullptr) {
}
void BoostConnectionServer::start() {
@@ -81,7 +81,7 @@ void BoostConnectionServer::acceptNextConnection() {
boost::bind(&BoostConnectionServer::handleAccept, shared_from_this(), newConnection, boost::asio::placeholders::error));
}
-void BoostConnectionServer::handleAccept(boost::shared_ptr<BoostConnection> newConnection, const boost::system::error_code& error) {
+void BoostConnectionServer::handleAccept(std::shared_ptr<BoostConnection> newConnection, const boost::system::error_code& error) {
if (error) {
eventLoop->postEvent(
boost::bind(
diff --git a/Swiften/Network/BoostConnectionServer.h b/Swiften/Network/BoostConnectionServer.h
index 8ee2a6d..b8a1c64 100644
--- a/Swiften/Network/BoostConnectionServer.h
+++ b/Swiften/Network/BoostConnectionServer.h
@@ -6,11 +6,11 @@
#pragma once
+#include <memory>
+
#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/tcp.hpp>
-#include <boost/enable_shared_from_this.hpp>
#include <boost/optional/optional_fwd.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -19,15 +19,15 @@
#include <Swiften/Network/ConnectionServer.h>
namespace Swift {
- class SWIFTEN_API BoostConnectionServer : public ConnectionServer, public EventOwner, public boost::enable_shared_from_this<BoostConnectionServer> {
+ class SWIFTEN_API BoostConnectionServer : public ConnectionServer, public EventOwner, public std::enable_shared_from_this<BoostConnectionServer> {
public:
- typedef boost::shared_ptr<BoostConnectionServer> ref;
+ typedef std::shared_ptr<BoostConnectionServer> ref;
- static ref create(int port, boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) {
+ static ref create(int port, std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) {
return ref(new BoostConnectionServer(port, ioService, eventLoop));
}
- static ref create(const HostAddress &address, int port, boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) {
+ static ref create(const HostAddress &address, int port, std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) {
return ref(new BoostConnectionServer(address, port, ioService, eventLoop));
}
@@ -40,17 +40,17 @@ namespace Swift {
boost::signal<void (boost::optional<Error>)> onStopped;
private:
- BoostConnectionServer(int port, boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop);
- BoostConnectionServer(const HostAddress &address, int port, boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop);
+ BoostConnectionServer(int port, std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop);
+ BoostConnectionServer(const HostAddress &address, int port, std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop);
void stop(boost::optional<Error> e);
void acceptNextConnection();
- void handleAccept(boost::shared_ptr<BoostConnection> newConnection, const boost::system::error_code& error);
+ void handleAccept(std::shared_ptr<BoostConnection> newConnection, const boost::system::error_code& error);
private:
HostAddress address_;
int port_;
- boost::shared_ptr<boost::asio::io_service> ioService_;
+ std::shared_ptr<boost::asio::io_service> ioService_;
EventLoop* eventLoop;
boost::asio::ip::tcp::acceptor* acceptor_;
};
diff --git a/Swiften/Network/BoostConnectionServerFactory.cpp b/Swiften/Network/BoostConnectionServerFactory.cpp
index 25afdb6..8b3fd2f 100644
--- a/Swiften/Network/BoostConnectionServerFactory.cpp
+++ b/Swiften/Network/BoostConnectionServerFactory.cpp
@@ -16,14 +16,14 @@
namespace Swift {
-BoostConnectionServerFactory::BoostConnectionServerFactory(boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : ioService(ioService), eventLoop(eventLoop) {
+BoostConnectionServerFactory::BoostConnectionServerFactory(std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : ioService(ioService), eventLoop(eventLoop) {
}
-boost::shared_ptr<ConnectionServer> BoostConnectionServerFactory::createConnectionServer(int port) {
+std::shared_ptr<ConnectionServer> BoostConnectionServerFactory::createConnectionServer(int port) {
return BoostConnectionServer::create(port, ioService, eventLoop);
}
-boost::shared_ptr<ConnectionServer> BoostConnectionServerFactory::createConnectionServer(const Swift::HostAddress &hostAddress, int port) {
+std::shared_ptr<ConnectionServer> BoostConnectionServerFactory::createConnectionServer(const Swift::HostAddress &hostAddress, int port) {
return BoostConnectionServer::create(hostAddress, port, ioService, eventLoop);
}
diff --git a/Swiften/Network/BoostConnectionServerFactory.h b/Swiften/Network/BoostConnectionServerFactory.h
index 1e0daa3..033e63d 100644
--- a/Swiften/Network/BoostConnectionServerFactory.h
+++ b/Swiften/Network/BoostConnectionServerFactory.h
@@ -23,14 +23,14 @@ namespace Swift {
class SWIFTEN_API BoostConnectionServerFactory : public ConnectionServerFactory {
public:
- BoostConnectionServerFactory(boost::shared_ptr<boost::asio::io_service>, EventLoop* eventLoop);
+ BoostConnectionServerFactory(std::shared_ptr<boost::asio::io_service>, EventLoop* eventLoop);
- virtual boost::shared_ptr<ConnectionServer> createConnectionServer(int port);
+ virtual std::shared_ptr<ConnectionServer> createConnectionServer(int port);
- virtual boost::shared_ptr<ConnectionServer> createConnectionServer(const Swift::HostAddress &hostAddress, int port);
+ virtual std::shared_ptr<ConnectionServer> createConnectionServer(const Swift::HostAddress &hostAddress, int port);
private:
- boost::shared_ptr<boost::asio::io_service> ioService;
+ std::shared_ptr<boost::asio::io_service> ioService;
EventLoop* eventLoop;
};
}
diff --git a/Swiften/Network/BoostIOServiceThread.cpp b/Swiften/Network/BoostIOServiceThread.cpp
index 79112d8..0b0b7a4 100644
--- a/Swiften/Network/BoostIOServiceThread.cpp
+++ b/Swiften/Network/BoostIOServiceThread.cpp
@@ -6,17 +6,17 @@
#include <Swiften/Network/BoostIOServiceThread.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
namespace Swift {
-BoostIOServiceThread::BoostIOServiceThread(boost::shared_ptr<boost::asio::io_service> ioService) {
+BoostIOServiceThread::BoostIOServiceThread(std::shared_ptr<boost::asio::io_service> ioService) {
if (!!ioService) {
ioService_ = ioService;
thread_ = nullptr;
}
else {
- ioService_ = boost::make_shared<boost::asio::io_service>();
+ ioService_ = std::make_shared<boost::asio::io_service>();
thread_ = new boost::thread(boost::bind(&BoostIOServiceThread::doRun, this));
}
}
diff --git a/Swiften/Network/BoostIOServiceThread.h b/Swiften/Network/BoostIOServiceThread.h
index 54f1840..18d5a5b 100644
--- a/Swiften/Network/BoostIOServiceThread.h
+++ b/Swiften/Network/BoostIOServiceThread.h
@@ -6,8 +6,9 @@
#pragma once
+#include <memory>
+
#include <boost/asio/io_service.hpp>
-#include <boost/shared_ptr.hpp>
#include <boost/thread/thread.hpp>
#include <Swiften/Base/API.h>
@@ -23,10 +24,10 @@ namespace Swift {
* you are re-using an io_service from elsewhere (particularly if you
* are using the BoostASIOEventLoop).
*/
- BoostIOServiceThread(boost::shared_ptr<boost::asio::io_service> ioService = boost::shared_ptr<boost::asio::io_service>());
+ BoostIOServiceThread(std::shared_ptr<boost::asio::io_service> ioService = std::shared_ptr<boost::asio::io_service>());
~BoostIOServiceThread();
- boost::shared_ptr<boost::asio::io_service> getIOService() const {
+ std::shared_ptr<boost::asio::io_service> getIOService() const {
return ioService_;
}
@@ -34,7 +35,7 @@ namespace Swift {
void doRun();
private:
- boost::shared_ptr<boost::asio::io_service> ioService_;
+ std::shared_ptr<boost::asio::io_service> ioService_;
boost::thread* thread_;
};
}
diff --git a/Swiften/Network/BoostNetworkFactories.cpp b/Swiften/Network/BoostNetworkFactories.cpp
index 40282f2..9fef73c 100644
--- a/Swiften/Network/BoostNetworkFactories.cpp
+++ b/Swiften/Network/BoostNetworkFactories.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -28,7 +28,7 @@
namespace Swift {
-BoostNetworkFactories::BoostNetworkFactories(EventLoop* eventLoop, boost::shared_ptr<boost::asio::io_service> ioService) : ioServiceThread(ioService), eventLoop(eventLoop) {
+BoostNetworkFactories::BoostNetworkFactories(EventLoop* eventLoop, std::shared_ptr<boost::asio::io_service> ioService) : ioServiceThread(ioService), eventLoop(eventLoop) {
timerFactory = new BoostTimerFactory(ioServiceThread.getIOService(), eventLoop);
connectionFactory = new BoostConnectionFactory(ioServiceThread.getIOService(), eventLoop);
connectionServerFactory = new BoostConnectionServerFactory(ioServiceThread.getIOService(), eventLoop);
diff --git a/Swiften/Network/BoostNetworkFactories.h b/Swiften/Network/BoostNetworkFactories.h
index ccacbf0..72afb04 100644
--- a/Swiften/Network/BoostNetworkFactories.h
+++ b/Swiften/Network/BoostNetworkFactories.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -23,7 +23,7 @@ namespace Swift {
* @param ioService If this optional parameter is provided, it will be
* used for the construction of the BoostIOServiceThread.
*/
- BoostNetworkFactories(EventLoop* eventLoop, boost::shared_ptr<boost::asio::io_service> ioService = boost::shared_ptr<boost::asio::io_service>());
+ BoostNetworkFactories(EventLoop* eventLoop, std::shared_ptr<boost::asio::io_service> ioService = std::shared_ptr<boost::asio::io_service>());
virtual ~BoostNetworkFactories();
virtual TimerFactory* getTimerFactory() const SWIFTEN_OVERRIDE {
diff --git a/Swiften/Network/BoostTimer.cpp b/Swiften/Network/BoostTimer.cpp
index 734a9c8..846192c 100644
--- a/Swiften/Network/BoostTimer.cpp
+++ b/Swiften/Network/BoostTimer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -14,7 +14,7 @@
namespace Swift {
-BoostTimer::BoostTimer(int milliseconds, boost::shared_ptr<boost::asio::io_service> service, EventLoop* eventLoop) :
+BoostTimer::BoostTimer(int milliseconds, std::shared_ptr<boost::asio::io_service> service, EventLoop* eventLoop) :
timeout(milliseconds), ioService(service), eventLoop(eventLoop), shuttingDown(false) {
timer.reset(new boost::asio::deadline_timer(*service));
}
diff --git a/Swiften/Network/BoostTimer.h b/Swiften/Network/BoostTimer.h
index 79c71cd..c54b401 100644
--- a/Swiften/Network/BoostTimer.h
+++ b/Swiften/Network/BoostTimer.h
@@ -1,14 +1,15 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+
#include <boost/asio/deadline_timer.hpp>
#include <boost/asio/io_service.hpp>
-#include <boost/enable_shared_from_this.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/thread/mutex.hpp>
@@ -19,13 +20,13 @@
namespace Swift {
class EventLoop;
- class SWIFTEN_API BoostTimer : public Timer, public EventOwner, public boost::enable_shared_from_this<BoostTimer> {
+ class SWIFTEN_API BoostTimer : public Timer, public EventOwner, public std::enable_shared_from_this<BoostTimer> {
public:
- typedef boost::shared_ptr<BoostTimer> ref;
+ typedef std::shared_ptr<BoostTimer> ref;
virtual ~BoostTimer();
- static ref create(int milliseconds, boost::shared_ptr<boost::asio::io_service> service, EventLoop* eventLoop) {
+ static ref create(int milliseconds, std::shared_ptr<boost::asio::io_service> service, EventLoop* eventLoop) {
return ref(new BoostTimer(milliseconds, service, eventLoop));
}
@@ -33,13 +34,13 @@ namespace Swift {
virtual void stop();
private:
- BoostTimer(int milliseconds, boost::shared_ptr<boost::asio::io_service> service, EventLoop* eventLoop);
+ BoostTimer(int milliseconds, std::shared_ptr<boost::asio::io_service> service, EventLoop* eventLoop);
void handleTimerTick(const boost::system::error_code& error);
private:
int timeout;
- boost::shared_ptr<boost::asio::io_service> ioService;
+ std::shared_ptr<boost::asio::io_service> ioService;
boost::scoped_ptr<boost::asio::deadline_timer> timer;
boost::mutex timerMutex;
EventLoop* eventLoop;
diff --git a/Swiften/Network/BoostTimerFactory.cpp b/Swiften/Network/BoostTimerFactory.cpp
index 086eb60..ffa9b30 100644
--- a/Swiften/Network/BoostTimerFactory.cpp
+++ b/Swiften/Network/BoostTimerFactory.cpp
@@ -10,10 +10,10 @@
namespace Swift {
-BoostTimerFactory::BoostTimerFactory(boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : ioService(ioService), eventLoop(eventLoop) {
+BoostTimerFactory::BoostTimerFactory(std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : ioService(ioService), eventLoop(eventLoop) {
}
-boost::shared_ptr<Timer> BoostTimerFactory::createTimer(int milliseconds) {
+std::shared_ptr<Timer> BoostTimerFactory::createTimer(int milliseconds) {
return BoostTimer::create(milliseconds, ioService, eventLoop);
}
diff --git a/Swiften/Network/BoostTimerFactory.h b/Swiften/Network/BoostTimerFactory.h
index 4fbabe9..ca9a833 100644
--- a/Swiften/Network/BoostTimerFactory.h
+++ b/Swiften/Network/BoostTimerFactory.h
@@ -18,12 +18,12 @@ namespace Swift {
class SWIFTEN_API BoostTimerFactory : public TimerFactory {
public:
- BoostTimerFactory(boost::shared_ptr<boost::asio::io_service>, EventLoop* eventLoop);
+ BoostTimerFactory(std::shared_ptr<boost::asio::io_service>, EventLoop* eventLoop);
- virtual boost::shared_ptr<Timer> createTimer(int milliseconds);
+ virtual std::shared_ptr<Timer> createTimer(int milliseconds);
private:
- boost::shared_ptr<boost::asio::io_service> ioService;
+ std::shared_ptr<boost::asio::io_service> ioService;
EventLoop* eventLoop;
};
}
diff --git a/Swiften/Network/CachingDomainNameResolver.cpp b/Swiften/Network/CachingDomainNameResolver.cpp
index d731eb9..8846e09 100644
--- a/Swiften/Network/CachingDomainNameResolver.cpp
+++ b/Swiften/Network/CachingDomainNameResolver.cpp
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2012 Isode Limited.
+ * Copyright (c) 2012-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Network/CachingDomainNameResolver.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
namespace Swift {
diff --git a/Swiften/Network/CachingDomainNameResolver.h b/Swiften/Network/CachingDomainNameResolver.h
index 25cb86c..9339a77 100644
--- a/Swiften/Network/CachingDomainNameResolver.h
+++ b/Swiften/Network/CachingDomainNameResolver.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2012-2015 Isode Limited.
+ * Copyright (c) 2012-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Network/DomainNameResolver.h>
diff --git a/Swiften/Network/ChainedConnector.cpp b/Swiften/Network/ChainedConnector.cpp
index 08c4aac..fbea868 100644
--- a/Swiften/Network/ChainedConnector.cpp
+++ b/Swiften/Network/ChainedConnector.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -58,14 +58,14 @@ void ChainedConnector::stop() {
currentConnector->stop();
currentConnector.reset();
}
- finish(boost::shared_ptr<Connection>(), boost::shared_ptr<Error>());
+ finish(std::shared_ptr<Connection>(), std::shared_ptr<Error>());
}
void ChainedConnector::tryNextConnectionFactory() {
assert(!currentConnector);
if (connectionFactoryQueue.empty()) {
SWIFT_LOG(debug) << "No more connection factories" << std::endl;
- finish(boost::shared_ptr<Connection>(), lastError);
+ finish(std::shared_ptr<Connection>(), lastError);
}
else {
ConnectionFactory* connectionFactory = connectionFactoryQueue.front();
@@ -78,7 +78,7 @@ void ChainedConnector::tryNextConnectionFactory() {
}
}
-void ChainedConnector::handleConnectorFinished(boost::shared_ptr<Connection> connection, boost::shared_ptr<Error> error) {
+void ChainedConnector::handleConnectorFinished(std::shared_ptr<Connection> connection, std::shared_ptr<Error> error) {
SWIFT_LOG(debug) << "Connector finished" << std::endl;
currentConnector->onConnectFinished.disconnect(boost::bind(&ChainedConnector::handleConnectorFinished, this, _1, _2));
lastError = error;
@@ -91,6 +91,6 @@ void ChainedConnector::handleConnectorFinished(boost::shared_ptr<Connection> con
}
}
-void ChainedConnector::finish(boost::shared_ptr<Connection> connection, boost::shared_ptr<Error> error) {
+void ChainedConnector::finish(std::shared_ptr<Connection> connection, std::shared_ptr<Error> error) {
onConnectFinished(connection, error);
}
diff --git a/Swiften/Network/ChainedConnector.h b/Swiften/Network/ChainedConnector.h
index 416dccb..bba9bfa 100644
--- a/Swiften/Network/ChainedConnector.h
+++ b/Swiften/Network/ChainedConnector.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -7,11 +7,11 @@
#pragma once
#include <deque>
+#include <memory>
#include <string>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Error.h>
@@ -33,12 +33,12 @@ namespace Swift {
void start();
void stop();
- boost::signal<void (boost::shared_ptr<Connection>, boost::shared_ptr<Error>)> onConnectFinished;
+ boost::signal<void (std::shared_ptr<Connection>, std::shared_ptr<Error>)> onConnectFinished;
private:
- void finish(boost::shared_ptr<Connection> connection, boost::shared_ptr<Error>);
+ void finish(std::shared_ptr<Connection> connection, std::shared_ptr<Error>);
void tryNextConnectionFactory();
- void handleConnectorFinished(boost::shared_ptr<Connection>, boost::shared_ptr<Error>);
+ void handleConnectorFinished(std::shared_ptr<Connection>, std::shared_ptr<Error>);
private:
std::string hostname;
@@ -49,7 +49,7 @@ namespace Swift {
TimerFactory* timerFactory;
int timeoutMilliseconds;
std::deque<ConnectionFactory*> connectionFactoryQueue;
- boost::shared_ptr<Connector> currentConnector;
- boost::shared_ptr<Error> lastError;
+ std::shared_ptr<Connector> currentConnector;
+ std::shared_ptr<Error> lastError;
};
}
diff --git a/Swiften/Network/Connection.h b/Swiften/Network/Connection.h
index c38b98f..1ef5824 100644
--- a/Swiften/Network/Connection.h
+++ b/Swiften/Network/Connection.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeByteArray.h>
@@ -17,7 +17,7 @@ namespace Swift {
class SWIFTEN_API Connection {
public:
- typedef boost::shared_ptr<Connection> ref;
+ typedef std::shared_ptr<Connection> ref;
enum Error {
ReadError,
@@ -38,7 +38,7 @@ namespace Swift {
public:
boost::signal<void (bool /* error */)> onConnectFinished;
boost::signal<void (const boost::optional<Error>&)> onDisconnected;
- boost::signal<void (boost::shared_ptr<SafeByteArray>)> onDataRead;
+ boost::signal<void (std::shared_ptr<SafeByteArray>)> onDataRead;
boost::signal<void ()> onDataWritten;
};
}
diff --git a/Swiften/Network/ConnectionFactory.h b/Swiften/Network/ConnectionFactory.h
index fd65908..e749fa3 100644
--- a/Swiften/Network/ConnectionFactory.h
+++ b/Swiften/Network/ConnectionFactory.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
@@ -17,6 +17,6 @@ namespace Swift {
public:
virtual ~ConnectionFactory();
- virtual boost::shared_ptr<Connection> createConnection() = 0;
+ virtual std::shared_ptr<Connection> createConnection() = 0;
};
}
diff --git a/Swiften/Network/ConnectionServer.h b/Swiften/Network/ConnectionServer.h
index a8c77eb..ae510e5 100644
--- a/Swiften/Network/ConnectionServer.h
+++ b/Swiften/Network/ConnectionServer.h
@@ -6,8 +6,9 @@
#pragma once
+#include <memory>
+
#include <boost/optional/optional_fwd.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -32,6 +33,6 @@ namespace Swift {
virtual void stop() = 0;
- boost::signal<void (boost::shared_ptr<Connection>)> onNewConnection;
+ boost::signal<void (std::shared_ptr<Connection>)> onNewConnection;
};
}
diff --git a/Swiften/Network/ConnectionServerFactory.h b/Swiften/Network/ConnectionServerFactory.h
index 7f988bf..413131e 100644
--- a/Swiften/Network/ConnectionServerFactory.h
+++ b/Swiften/Network/ConnectionServerFactory.h
@@ -12,7 +12,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
@@ -24,8 +24,8 @@ namespace Swift {
public:
virtual ~ConnectionServerFactory();
- virtual boost::shared_ptr<ConnectionServer> createConnectionServer(int port) = 0;
+ virtual std::shared_ptr<ConnectionServer> createConnectionServer(int port) = 0;
- virtual boost::shared_ptr<ConnectionServer> createConnectionServer(const Swift::HostAddress& hostAddress, int port) = 0;
+ virtual std::shared_ptr<ConnectionServer> createConnectionServer(const Swift::HostAddress& hostAddress, int port) = 0;
};
}
diff --git a/Swiften/Network/Connector.cpp b/Swiften/Network/Connector.cpp
index bd25e70..37cf35d 100644
--- a/Swiften/Network/Connector.cpp
+++ b/Swiften/Network/Connector.cpp
@@ -54,7 +54,7 @@ void Connector::stop() {
currentConnection->onConnectFinished.disconnect(boost::bind(&Connector::handleConnectionConnectFinished, shared_from_this(), _1));
currentConnection->disconnect();
}
- finish(boost::shared_ptr<Connection>());
+ finish(std::shared_ptr<Connection>());
}
void Connector::queryAddress(const std::string& hostname) {
@@ -77,7 +77,7 @@ void Connector::handleServiceQueryResult(const std::vector<DomainNameServiceQuer
void Connector::tryNextServiceOrFallback() {
if (queriedAllServices) {
SWIFT_LOG(debug) << "Queried all services" << std::endl;
- finish(boost::shared_ptr<Connection>());
+ finish(std::shared_ptr<Connection>());
}
else if (serviceQueryResults.empty()) {
SWIFT_LOG(debug) << "Falling back on A resolution" << std::endl;
@@ -165,7 +165,7 @@ void Connector::handleConnectionConnectFinished(bool error) {
}
}
-void Connector::finish(boost::shared_ptr<Connection> connection) {
+void Connector::finish(std::shared_ptr<Connection> connection) {
if (timer) {
timer->stop();
timer->onTick.disconnect(boost::bind(&Connector::handleTimeout, shared_from_this()));
@@ -183,7 +183,7 @@ void Connector::finish(boost::shared_ptr<Connection> connection) {
currentConnection->onConnectFinished.disconnect(boost::bind(&Connector::handleConnectionConnectFinished, shared_from_this(), _1));
currentConnection.reset();
}
- onConnectFinished(connection, (connection || foundSomeDNS) ? boost::shared_ptr<Error>() : boost::make_shared<DomainNameResolveError>());
+ onConnectFinished(connection, (connection || foundSomeDNS) ? std::shared_ptr<Error>() : std::make_shared<DomainNameResolveError>());
}
void Connector::handleTimeout() {
diff --git a/Swiften/Network/Connector.h b/Swiften/Network/Connector.h
index 52486b6..8114dd1 100644
--- a/Swiften/Network/Connector.h
+++ b/Swiften/Network/Connector.h
@@ -7,10 +7,10 @@
#pragma once
#include <deque>
+#include <memory>
#include <string>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -26,9 +26,9 @@ namespace Swift {
class ConnectionFactory;
class TimerFactory;
- class SWIFTEN_API Connector : public boost::bsignals::trackable, public boost::enable_shared_from_this<Connector> {
+ class SWIFTEN_API Connector : public boost::bsignals::trackable, public std::enable_shared_from_this<Connector> {
public:
- typedef boost::shared_ptr<Connector> ref;
+ typedef std::shared_ptr<Connector> ref;
static Connector::ref create(const std::string& hostname, int port, const boost::optional<std::string>& serviceLookupPrefix, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) {
return ref(new Connector(hostname, port, serviceLookupPrefix, resolver, connectionFactory, timerFactory));
@@ -43,7 +43,7 @@ namespace Swift {
void start();
void stop();
- boost::signal<void (boost::shared_ptr<Connection>, boost::shared_ptr<Error>)> onConnectFinished;
+ boost::signal<void (std::shared_ptr<Connection>, std::shared_ptr<Error>)> onConnectFinished;
private:
Connector(const std::string& hostname, int port, const boost::optional<std::string>& serviceLookupPrefix, DomainNameResolver*, ConnectionFactory*, TimerFactory*);
@@ -57,7 +57,7 @@ namespace Swift {
void tryConnect(const HostAddressPort& target);
void handleConnectionConnectFinished(bool error);
- void finish(boost::shared_ptr<Connection>);
+ void finish(std::shared_ptr<Connection>);
void handleTimeout();
@@ -69,13 +69,13 @@ namespace Swift {
ConnectionFactory* connectionFactory;
TimerFactory* timerFactory;
int timeoutMilliseconds;
- boost::shared_ptr<Timer> timer;
- boost::shared_ptr<DomainNameServiceQuery> serviceQuery;
+ std::shared_ptr<Timer> timer;
+ std::shared_ptr<DomainNameServiceQuery> serviceQuery;
std::deque<DomainNameServiceQuery::Result> serviceQueryResults;
- boost::shared_ptr<DomainNameAddressQuery> addressQuery;
+ std::shared_ptr<DomainNameAddressQuery> addressQuery;
std::deque<HostAddress> addressQueryResults;
bool queriedAllServices;
- boost::shared_ptr<Connection> currentConnection;
+ std::shared_ptr<Connection> currentConnection;
bool foundSomeDNS;
};
}
diff --git a/Swiften/Network/DomainNameAddressQuery.h b/Swiften/Network/DomainNameAddressQuery.h
index 10bcd5a..f6650c6 100644
--- a/Swiften/Network/DomainNameAddressQuery.h
+++ b/Swiften/Network/DomainNameAddressQuery.h
@@ -6,8 +6,9 @@
#pragma once
+#include <memory>
+
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Network/DomainNameResolveError.h>
@@ -16,7 +17,7 @@
namespace Swift {
class DomainNameAddressQuery {
public:
- typedef boost::shared_ptr<DomainNameAddressQuery> ref;
+ typedef std::shared_ptr<DomainNameAddressQuery> ref;
virtual ~DomainNameAddressQuery();
diff --git a/Swiften/Network/DomainNameResolver.h b/Swiften/Network/DomainNameResolver.h
index 97997c9..5fe30d5 100644
--- a/Swiften/Network/DomainNameResolver.h
+++ b/Swiften/Network/DomainNameResolver.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
namespace Swift {
@@ -21,7 +20,7 @@ namespace Swift {
public:
virtual ~DomainNameResolver();
- virtual boost::shared_ptr<DomainNameServiceQuery> createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) = 0;
- virtual boost::shared_ptr<DomainNameAddressQuery> createAddressQuery(const std::string& name) = 0;
+ virtual std::shared_ptr<DomainNameServiceQuery> createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) = 0;
+ virtual std::shared_ptr<DomainNameAddressQuery> createAddressQuery(const std::string& name) = 0;
};
}
diff --git a/Swiften/Network/DomainNameServiceQuery.h b/Swiften/Network/DomainNameServiceQuery.h
index acbccf0..b8e0e7c 100644
--- a/Swiften/Network/DomainNameServiceQuery.h
+++ b/Swiften/Network/DomainNameServiceQuery.h
@@ -6,11 +6,11 @@
#pragma once
+#include <memory>
#include <string>
#include <vector>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -21,7 +21,7 @@ namespace Swift {
class SWIFTEN_API DomainNameServiceQuery {
public:
- typedef boost::shared_ptr<DomainNameServiceQuery> ref;
+ typedef std::shared_ptr<DomainNameServiceQuery> ref;
struct Result {
Result(const std::string& hostname = "", int port = -1, int priority = -1, int weight = -1) : hostname(hostname), port(port), priority(priority), weight(weight) {}
diff --git a/Swiften/Network/DummyConnection.cpp b/Swiften/Network/DummyConnection.cpp
index a4e5419..3024b21 100644
--- a/Swiften/Network/DummyConnection.cpp
+++ b/Swiften/Network/DummyConnection.cpp
@@ -7,9 +7,9 @@
#include <Swiften/Network/DummyConnection.h>
#include <cassert>
+#include <memory>
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
namespace Swift {
@@ -17,7 +17,7 @@ DummyConnection::DummyConnection(EventLoop* eventLoop) : eventLoop(eventLoop) {
}
void DummyConnection::receive(const SafeByteArray& data) {
- eventLoop->postEvent(boost::bind(boost::ref(onDataRead), boost::make_shared<SafeByteArray>(data)), shared_from_this());
+ eventLoop->postEvent(boost::bind(boost::ref(onDataRead), std::make_shared<SafeByteArray>(data)), shared_from_this());
}
void DummyConnection::listen() {
diff --git a/Swiften/Network/DummyConnection.h b/Swiften/Network/DummyConnection.h
index fcfdb15..f7b9e29 100644
--- a/Swiften/Network/DummyConnection.h
+++ b/Swiften/Network/DummyConnection.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/enable_shared_from_this.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/EventLoop/EventLoop.h>
@@ -15,7 +15,7 @@
#include <Swiften/Network/HostAddressPort.h>
namespace Swift {
- class SWIFTEN_API DummyConnection : public Connection, public EventOwner, public boost::enable_shared_from_this<DummyConnection> {
+ class SWIFTEN_API DummyConnection : public Connection, public EventOwner, public std::enable_shared_from_this<DummyConnection> {
public:
DummyConnection(EventLoop* eventLoop);
diff --git a/Swiften/Network/DummyConnectionFactory.h b/Swiften/Network/DummyConnectionFactory.h
index f861312..d723283 100644
--- a/Swiften/Network/DummyConnectionFactory.h
+++ b/Swiften/Network/DummyConnectionFactory.h
@@ -4,9 +4,15 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Network/ConnectionFactory.h>
#include <Swiften/Network/DummyConnection.h>
@@ -19,8 +25,8 @@ class DummyConnectionFactory : public ConnectionFactory {
public:
DummyConnectionFactory(EventLoop *eventLoop) : eventLoop(eventLoop) {}
virtual ~DummyConnectionFactory() {}
- virtual boost::shared_ptr<Connection> createConnection() {
- return boost::make_shared<DummyConnection>(eventLoop);
+ virtual std::shared_ptr<Connection> createConnection() {
+ return std::make_shared<DummyConnection>(eventLoop);
}
private:
EventLoop* eventLoop;
diff --git a/Swiften/Network/DummyConnectionServer.h b/Swiften/Network/DummyConnectionServer.h
index 0bf7386..970cbb7 100644
--- a/Swiften/Network/DummyConnectionServer.h
+++ b/Swiften/Network/DummyConnectionServer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/enable_shared_from_this.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/EventLoop/EventLoop.h>
@@ -15,7 +15,7 @@
#include <Swiften/Network/HostAddressPort.h>
namespace Swift {
- class SWIFTEN_API DummyConnectionServer : public ConnectionServer, public EventOwner, public boost::enable_shared_from_this<DummyConnectionServer> {
+ class SWIFTEN_API DummyConnectionServer : public ConnectionServer, public EventOwner, public std::enable_shared_from_this<DummyConnectionServer> {
public:
DummyConnectionServer(EventLoop* /*eventLoop*/, int port) : localAddressPort(HostAddress(), port) {}
DummyConnectionServer(EventLoop* /*eventLoop*/, const Swift::HostAddress& hostAddress, int port) : localAddressPort(hostAddress, port) {}
diff --git a/Swiften/Network/DummyConnectionServerFactory.h b/Swiften/Network/DummyConnectionServerFactory.h
index 0952a38..822f95f 100644
--- a/Swiften/Network/DummyConnectionServerFactory.h
+++ b/Swiften/Network/DummyConnectionServerFactory.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2014 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Network/ConnectionServerFactory.h>
#include <Swiften/Network/DummyConnectionServer.h>
@@ -20,12 +20,12 @@ public:
DummyConnectionServerFactory(EventLoop* eventLoop) : eventLoop(eventLoop) {}
virtual ~DummyConnectionServerFactory() {}
- virtual boost::shared_ptr<ConnectionServer> createConnectionServer(int port) {
- return boost::make_shared<DummyConnectionServer>(eventLoop, port);
+ virtual std::shared_ptr<ConnectionServer> createConnectionServer(int port) {
+ return std::make_shared<DummyConnectionServer>(eventLoop, port);
}
- virtual boost::shared_ptr<ConnectionServer> createConnectionServer(const Swift::HostAddress& hostAddress, int port) {
- return boost::make_shared<DummyConnectionServer>(eventLoop, hostAddress, port);
+ virtual std::shared_ptr<ConnectionServer> createConnectionServer(const Swift::HostAddress& hostAddress, int port) {
+ return std::make_shared<DummyConnectionServer>(eventLoop, hostAddress, port);
}
private:
diff --git a/Swiften/Network/DummyTimerFactory.cpp b/Swiften/Network/DummyTimerFactory.cpp
index cae5c84..cdc776c 100644
--- a/Swiften/Network/DummyTimerFactory.cpp
+++ b/Swiften/Network/DummyTimerFactory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -41,15 +41,15 @@ class DummyTimerFactory::DummyTimer : public Timer {
DummyTimerFactory::DummyTimerFactory() : currentTime(0) {
}
-boost::shared_ptr<Timer> DummyTimerFactory::createTimer(int milliseconds) {
- boost::shared_ptr<DummyTimer> timer(new DummyTimer(milliseconds, this));
+std::shared_ptr<Timer> DummyTimerFactory::createTimer(int milliseconds) {
+ std::shared_ptr<DummyTimer> timer(new DummyTimer(milliseconds, this));
timers.push_back(timer);
return timer;
}
void DummyTimerFactory::setTime(int time) {
assert(time > currentTime);
- foreach(boost::shared_ptr<DummyTimer> timer, timers) {
+ foreach(std::shared_ptr<DummyTimer> timer, timers) {
if (timer->getAlarmTime() > currentTime && timer->getAlarmTime() <= time && timer->isRunning) {
timer->onTick();
}
diff --git a/Swiften/Network/DummyTimerFactory.h b/Swiften/Network/DummyTimerFactory.h
index bb2f813..5ccbf93 100644
--- a/Swiften/Network/DummyTimerFactory.h
+++ b/Swiften/Network/DummyTimerFactory.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -18,12 +18,12 @@ namespace Swift {
DummyTimerFactory();
- virtual boost::shared_ptr<Timer> createTimer(int milliseconds);
+ virtual std::shared_ptr<Timer> createTimer(int milliseconds);
void setTime(int time);
private:
friend class DummyTimer;
int currentTime;
- std::list<boost::shared_ptr<DummyTimer> > timers;
+ std::list<std::shared_ptr<DummyTimer> > timers;
};
}
diff --git a/Swiften/Network/FakeConnection.h b/Swiften/Network/FakeConnection.h
index c7d1f27..08c1d75 100644
--- a/Swiften/Network/FakeConnection.h
+++ b/Swiften/Network/FakeConnection.h
@@ -1,14 +1,14 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
#include <vector>
-#include <boost/enable_shared_from_this.hpp>
#include <boost/optional.hpp>
#include <Swiften/Base/API.h>
@@ -21,7 +21,7 @@ namespace Swift {
class SWIFTEN_API FakeConnection :
public Connection,
public EventOwner,
- public boost::enable_shared_from_this<FakeConnection> {
+ public std::enable_shared_from_this<FakeConnection> {
public:
enum State {
Initial,
diff --git a/Swiften/Network/HTTPConnectProxiedConnection.cpp b/Swiften/Network/HTTPConnectProxiedConnection.cpp
index 991e815..b9ab604 100644
--- a/Swiften/Network/HTTPConnectProxiedConnection.cpp
+++ b/Swiften/Network/HTTPConnectProxiedConnection.cpp
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -49,7 +49,7 @@ HTTPConnectProxiedConnection::~HTTPConnectProxiedConnection() {
}
-void HTTPConnectProxiedConnection::setHTTPTrafficFilter(boost::shared_ptr<HTTPTrafficFilter> trafficFilter) {
+void HTTPConnectProxiedConnection::setHTTPTrafficFilter(std::shared_ptr<HTTPTrafficFilter> trafficFilter) {
trafficFilter_ = trafficFilter;
}
@@ -112,7 +112,7 @@ void HTTPConnectProxiedConnection::sendHTTPRequest(const std::string& statusLine
write(createSafeByteArray(request.str()));
}
-void HTTPConnectProxiedConnection::handleProxyInitializeData(boost::shared_ptr<SafeByteArray> data) {
+void HTTPConnectProxiedConnection::handleProxyInitializeData(std::shared_ptr<SafeByteArray> data) {
std::string dataString = byteArrayToString(ByteArray(data->begin(), data->end()));
SWIFT_LOG(debug) << data << std::endl;
httpResponseBuffer_.append(dataString);
diff --git a/Swiften/Network/HTTPConnectProxiedConnection.h b/Swiften/Network/HTTPConnectProxiedConnection.h
index adb8d08..21b3960 100644
--- a/Swiften/Network/HTTPConnectProxiedConnection.h
+++ b/Swiften/Network/HTTPConnectProxiedConnection.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,7 +13,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Network/ProxiedConnection.h>
@@ -27,7 +27,7 @@ namespace Swift {
class SWIFTEN_API HTTPConnectProxiedConnection : public ProxiedConnection {
public:
- typedef boost::shared_ptr<HTTPConnectProxiedConnection> ref;
+ typedef std::shared_ptr<HTTPConnectProxiedConnection> ref;
virtual ~HTTPConnectProxiedConnection();
@@ -35,13 +35,13 @@ namespace Swift {
return ref(new HTTPConnectProxiedConnection(resolver, connectionFactory, timerFactory, proxyHost, proxyPort, authID, authPassword));
}
- void setHTTPTrafficFilter(boost::shared_ptr<HTTPTrafficFilter> trafficFilter);
+ void setHTTPTrafficFilter(std::shared_ptr<HTTPTrafficFilter> trafficFilter);
private:
HTTPConnectProxiedConnection(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, const SafeString& authID, const SafeString& authPassword);
virtual void initializeProxy();
- virtual void handleProxyInitializeData(boost::shared_ptr<SafeByteArray> data);
+ virtual void handleProxyInitializeData(std::shared_ptr<SafeByteArray> data);
void sendHTTPRequest(const std::string& statusLine, const std::vector<std::pair<std::string, std::string> >& headerFields);
void parseHTTPHeader(const std::string& data, std::string& statusLine, std::vector<std::pair<std::string, std::string> >& headerFields);
@@ -49,7 +49,7 @@ namespace Swift {
private:
SafeByteArray authID_;
SafeByteArray authPassword_;
- boost::shared_ptr<HTTPTrafficFilter> trafficFilter_;
+ std::shared_ptr<HTTPTrafficFilter> trafficFilter_;
std::string httpResponseBuffer_;
std::vector<std::pair<std::string, std::string> > nextHTTPRequestHeaders_;
};
diff --git a/Swiften/Network/HTTPConnectProxiedConnectionFactory.cpp b/Swiften/Network/HTTPConnectProxiedConnectionFactory.cpp
index 735791f..91ace3d 100644
--- a/Swiften/Network/HTTPConnectProxiedConnectionFactory.cpp
+++ b/Swiften/Network/HTTPConnectProxiedConnectionFactory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2015 Isode Limited.
+ * Copyright (c) 2012-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -16,14 +16,14 @@
namespace Swift {
-HTTPConnectProxiedConnectionFactory::HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, boost::shared_ptr<HTTPTrafficFilter> httpTrafficFilter) : resolver_(resolver), connectionFactory_(connectionFactory), timerFactory_(timerFactory), proxyHost_(proxyHost), proxyPort_(proxyPort), authID_(""), authPassword_(""), httpTrafficFilter_(httpTrafficFilter) {
+HTTPConnectProxiedConnectionFactory::HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, std::shared_ptr<HTTPTrafficFilter> httpTrafficFilter) : resolver_(resolver), connectionFactory_(connectionFactory), timerFactory_(timerFactory), proxyHost_(proxyHost), proxyPort_(proxyPort), authID_(""), authPassword_(""), httpTrafficFilter_(httpTrafficFilter) {
}
-HTTPConnectProxiedConnectionFactory::HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, const SafeString& authID, const SafeString& authPassword, boost::shared_ptr<HTTPTrafficFilter> httpTrafficFilter) : resolver_(resolver), connectionFactory_(connectionFactory), timerFactory_(timerFactory), proxyHost_(proxyHost), proxyPort_(proxyPort), authID_(authID), authPassword_(authPassword), httpTrafficFilter_(httpTrafficFilter) {
+HTTPConnectProxiedConnectionFactory::HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, const SafeString& authID, const SafeString& authPassword, std::shared_ptr<HTTPTrafficFilter> httpTrafficFilter) : resolver_(resolver), connectionFactory_(connectionFactory), timerFactory_(timerFactory), proxyHost_(proxyHost), proxyPort_(proxyPort), authID_(authID), authPassword_(authPassword), httpTrafficFilter_(httpTrafficFilter) {
}
-boost::shared_ptr<Connection> HTTPConnectProxiedConnectionFactory::createConnection() {
+std::shared_ptr<Connection> HTTPConnectProxiedConnectionFactory::createConnection() {
HTTPConnectProxiedConnection::ref proxyConnection = HTTPConnectProxiedConnection::create(resolver_, connectionFactory_, timerFactory_, proxyHost_, proxyPort_, authID_, authPassword_);
proxyConnection->setHTTPTrafficFilter(httpTrafficFilter_);
return proxyConnection;
diff --git a/Swiften/Network/HTTPConnectProxiedConnectionFactory.h b/Swiften/Network/HTTPConnectProxiedConnectionFactory.h
index 455fba0..74d6279 100644
--- a/Swiften/Network/HTTPConnectProxiedConnectionFactory.h
+++ b/Swiften/Network/HTTPConnectProxiedConnectionFactory.h
@@ -25,10 +25,10 @@ namespace Swift {
class SWIFTEN_API HTTPConnectProxiedConnectionFactory : public ConnectionFactory {
public:
- HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, boost::shared_ptr<HTTPTrafficFilter> httpTrafficFilter = boost::shared_ptr<HTTPTrafficFilter>());
- HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, const SafeString& authID, const SafeString& authPassword, boost::shared_ptr<HTTPTrafficFilter> httpTrafficFilter = boost::shared_ptr<HTTPTrafficFilter>());
+ HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, std::shared_ptr<HTTPTrafficFilter> httpTrafficFilter = std::shared_ptr<HTTPTrafficFilter>());
+ HTTPConnectProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort, const SafeString& authID, const SafeString& authPassword, std::shared_ptr<HTTPTrafficFilter> httpTrafficFilter = std::shared_ptr<HTTPTrafficFilter>());
- virtual boost::shared_ptr<Connection> createConnection();
+ virtual std::shared_ptr<Connection> createConnection();
private:
DomainNameResolver* resolver_;
@@ -38,6 +38,6 @@ namespace Swift {
int proxyPort_;
SafeString authID_;
SafeString authPassword_;
- boost::shared_ptr<HTTPTrafficFilter> httpTrafficFilter_;
+ std::shared_ptr<HTTPTrafficFilter> httpTrafficFilter_;
};
}
diff --git a/Swiften/Network/MiniUPnPInterface.cpp b/Swiften/Network/MiniUPnPInterface.cpp
index b298fc6..b2afd88 100644
--- a/Swiften/Network/MiniUPnPInterface.cpp
+++ b/Swiften/Network/MiniUPnPInterface.cpp
@@ -12,8 +12,9 @@
#include <Swiften/Network/MiniUPnPInterface.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <miniupnpc.h>
#include <upnpcommands.h>
@@ -31,7 +32,7 @@ struct MiniUPnPInterface::Private {
IGDdatas data;
};
-MiniUPnPInterface::MiniUPnPInterface() : p(boost::make_shared<Private>()) {
+MiniUPnPInterface::MiniUPnPInterface() : p(std::make_shared<Private>()) {
p->isValid = false;
int error = 0;
p->deviceList = upnpDiscover(1500 /* timeout in ms */, nullptr, nullptr, 0, 0 /* do IPv6? */, &error);
diff --git a/Swiften/Network/MiniUPnPInterface.h b/Swiften/Network/MiniUPnPInterface.h
index 5253e71..ea956d9 100644
--- a/Swiften/Network/MiniUPnPInterface.h
+++ b/Swiften/Network/MiniUPnPInterface.h
@@ -6,9 +6,10 @@
#pragma once
+#include <memory>
+
#include <boost/noncopyable.hpp>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Network/NATPortMapping.h>
#include <Swiften/Network/NATTraversalInterface.h>
@@ -27,6 +28,6 @@ namespace Swift {
private:
struct Private;
- boost::shared_ptr<Private> p;
+ std::shared_ptr<Private> p;
};
}
diff --git a/Swiften/Network/NATPMPInterface.cpp b/Swiften/Network/NATPMPInterface.cpp
index 3782f75..c811212 100644
--- a/Swiften/Network/NATPMPInterface.cpp
+++ b/Swiften/Network/NATPMPInterface.cpp
@@ -12,8 +12,9 @@
#include <Swiften/Network/NATPMPInterface.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Log.h>
@@ -29,7 +30,7 @@ struct NATPMPInterface::Private {
natpmp_t natpmp;
};
-NATPMPInterface::NATPMPInterface() : p(boost::make_shared<Private>()) {
+NATPMPInterface::NATPMPInterface() : p(std::make_shared<Private>()) {
initnatpmp(&p->natpmp, 0, 0);
}
diff --git a/Swiften/Network/NATPMPInterface.h b/Swiften/Network/NATPMPInterface.h
index a4bb816..80f619c 100644
--- a/Swiften/Network/NATPMPInterface.h
+++ b/Swiften/Network/NATPMPInterface.h
@@ -6,9 +6,10 @@
#pragma once
+#include <memory>
+
#include <boost/noncopyable.hpp>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Network/NATPortMapping.h>
#include <Swiften/Network/NATTraversalInterface.h>
@@ -27,6 +28,6 @@ namespace Swift {
private:
struct Private;
- boost::shared_ptr<Private> p;
+ std::shared_ptr<Private> p;
};
}
diff --git a/Swiften/Network/NATTraverser.h b/Swiften/Network/NATTraverser.h
index 0ff6bb3..716bfcb 100644
--- a/Swiften/Network/NATTraverser.h
+++ b/Swiften/Network/NATTraverser.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
@@ -19,8 +19,8 @@ namespace Swift {
public:
virtual ~NATTraverser();
- virtual boost::shared_ptr<NATTraversalGetPublicIPRequest> createGetPublicIPRequest() = 0;
- virtual boost::shared_ptr<NATTraversalForwardPortRequest> createForwardPortRequest(int localPort, int publicPort) = 0;
- virtual boost::shared_ptr<NATTraversalRemovePortForwardingRequest> createRemovePortForwardingRequest(int localPort, int publicPort) = 0;
+ virtual std::shared_ptr<NATTraversalGetPublicIPRequest> createGetPublicIPRequest() = 0;
+ virtual std::shared_ptr<NATTraversalForwardPortRequest> createForwardPortRequest(int localPort, int publicPort) = 0;
+ virtual std::shared_ptr<NATTraversalRemovePortForwardingRequest> createRemovePortForwardingRequest(int localPort, int publicPort) = 0;
};
}
diff --git a/Swiften/Network/NullNATTraverser.cpp b/Swiften/Network/NullNATTraverser.cpp
index c4e121b..cc8bae0 100644
--- a/Swiften/Network/NullNATTraverser.cpp
+++ b/Swiften/Network/NullNATTraverser.cpp
@@ -6,8 +6,9 @@
#include <Swiften/Network/NullNATTraverser.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/EventLoop/EventLoop.h>
#include <Swiften/Network/NATTraversalForwardPortRequest.h>
@@ -67,16 +68,16 @@ class NullNATTraversalRemovePortForwardingRequest : public NATTraversalRemovePor
NullNATTraverser::NullNATTraverser(EventLoop* eventLoop) : eventLoop(eventLoop) {
}
-boost::shared_ptr<NATTraversalGetPublicIPRequest> NullNATTraverser::createGetPublicIPRequest() {
- return boost::make_shared<NullNATTraversalGetPublicIPRequest>(eventLoop);
+std::shared_ptr<NATTraversalGetPublicIPRequest> NullNATTraverser::createGetPublicIPRequest() {
+ return std::make_shared<NullNATTraversalGetPublicIPRequest>(eventLoop);
}
-boost::shared_ptr<NATTraversalForwardPortRequest> NullNATTraverser::createForwardPortRequest(int, int) {
- return boost::make_shared<NullNATTraversalForwardPortRequest>(eventLoop);
+std::shared_ptr<NATTraversalForwardPortRequest> NullNATTraverser::createForwardPortRequest(int, int) {
+ return std::make_shared<NullNATTraversalForwardPortRequest>(eventLoop);
}
-boost::shared_ptr<NATTraversalRemovePortForwardingRequest> NullNATTraverser::createRemovePortForwardingRequest(int, int) {
- return boost::make_shared<NullNATTraversalRemovePortForwardingRequest>(eventLoop);
+std::shared_ptr<NATTraversalRemovePortForwardingRequest> NullNATTraverser::createRemovePortForwardingRequest(int, int) {
+ return std::make_shared<NullNATTraversalRemovePortForwardingRequest>(eventLoop);
}
}
diff --git a/Swiften/Network/NullNATTraverser.h b/Swiften/Network/NullNATTraverser.h
index 3492940..d3a6640 100644
--- a/Swiften/Network/NullNATTraverser.h
+++ b/Swiften/Network/NullNATTraverser.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -15,9 +15,9 @@ namespace Swift {
public:
NullNATTraverser(EventLoop* eventLoop);
- boost::shared_ptr<NATTraversalGetPublicIPRequest> createGetPublicIPRequest();
- boost::shared_ptr<NATTraversalForwardPortRequest> createForwardPortRequest(int localPort, int publicPort);
- boost::shared_ptr<NATTraversalRemovePortForwardingRequest> createRemovePortForwardingRequest(int localPort, int publicPort);
+ std::shared_ptr<NATTraversalGetPublicIPRequest> createGetPublicIPRequest();
+ std::shared_ptr<NATTraversalForwardPortRequest> createForwardPortRequest(int localPort, int publicPort);
+ std::shared_ptr<NATTraversalRemovePortForwardingRequest> createRemovePortForwardingRequest(int localPort, int publicPort);
private:
EventLoop* eventLoop;
diff --git a/Swiften/Network/PlatformDomainNameAddressQuery.h b/Swiften/Network/PlatformDomainNameAddressQuery.h
index a5cfda7..6cb3e0a 100644
--- a/Swiften/Network/PlatformDomainNameAddressQuery.h
+++ b/Swiften/Network/PlatformDomainNameAddressQuery.h
@@ -1,15 +1,15 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
#include <string>
#include <boost/asio/io_service.hpp>
-#include <boost/enable_shared_from_this.hpp>
#include <Swiften/EventLoop/EventOwner.h>
#include <Swiften/Network/DomainNameAddressQuery.h>
@@ -19,7 +19,7 @@ namespace Swift {
class PlatformDomainNameResolver;
class EventLoop;
- class PlatformDomainNameAddressQuery : public DomainNameAddressQuery, public PlatformDomainNameQuery, public boost::enable_shared_from_this<PlatformDomainNameAddressQuery>, public EventOwner {
+ class PlatformDomainNameAddressQuery : public DomainNameAddressQuery, public PlatformDomainNameQuery, public std::enable_shared_from_this<PlatformDomainNameAddressQuery>, public EventOwner {
public:
PlatformDomainNameAddressQuery(const boost::optional<std::string>& host, EventLoop* eventLoop, PlatformDomainNameResolver*);
virtual ~PlatformDomainNameAddressQuery();
diff --git a/Swiften/Network/PlatformDomainNameQuery.h b/Swiften/Network/PlatformDomainNameQuery.h
index 3c5e152..a279f20 100644
--- a/Swiften/Network/PlatformDomainNameQuery.h
+++ b/Swiften/Network/PlatformDomainNameQuery.h
@@ -1,19 +1,19 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
namespace Swift {
class PlatformDomainNameResolver;
class PlatformDomainNameQuery {
public:
- typedef boost::shared_ptr<PlatformDomainNameQuery> ref;
+ typedef std::shared_ptr<PlatformDomainNameQuery> ref;
PlatformDomainNameQuery(PlatformDomainNameResolver* resolver) : resolver(resolver) {}
virtual ~PlatformDomainNameQuery() {}
diff --git a/Swiften/Network/PlatformDomainNameResolver.cpp b/Swiften/Network/PlatformDomainNameResolver.cpp
index ed08057..ecb5247 100644
--- a/Swiften/Network/PlatformDomainNameResolver.cpp
+++ b/Swiften/Network/PlatformDomainNameResolver.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2013 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -33,22 +33,22 @@ PlatformDomainNameResolver::PlatformDomainNameResolver(IDNConverter* idnConverte
PlatformDomainNameResolver::~PlatformDomainNameResolver() {
stopRequested = true;
- addQueryToQueue(boost::shared_ptr<PlatformDomainNameQuery>());
+ addQueryToQueue(std::shared_ptr<PlatformDomainNameQuery>());
thread->join();
delete thread;
}
-boost::shared_ptr<DomainNameServiceQuery> PlatformDomainNameResolver::createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) {
+std::shared_ptr<DomainNameServiceQuery> PlatformDomainNameResolver::createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) {
boost::optional<std::string> encodedDomain = idnConverter->getIDNAEncoded(domain);
std::string result;
if (encodedDomain) {
result = serviceLookupPrefix + *encodedDomain;
}
- return boost::shared_ptr<DomainNameServiceQuery>(new PlatformDomainNameServiceQuery(result, eventLoop, this));
+ return std::make_shared<PlatformDomainNameServiceQuery>(result, eventLoop, this);
}
-boost::shared_ptr<DomainNameAddressQuery> PlatformDomainNameResolver::createAddressQuery(const std::string& name) {
- return boost::shared_ptr<DomainNameAddressQuery>(new PlatformDomainNameAddressQuery(idnConverter->getIDNAEncoded(name), eventLoop, this));
+std::shared_ptr<DomainNameAddressQuery> PlatformDomainNameResolver::createAddressQuery(const std::string& name) {
+ return std::make_shared<PlatformDomainNameAddressQuery>(idnConverter->getIDNAEncoded(name), eventLoop, this);
}
void PlatformDomainNameResolver::run() {
diff --git a/Swiften/Network/PlatformDomainNameServiceQuery.h b/Swiften/Network/PlatformDomainNameServiceQuery.h
index e415005..0d690f3 100644
--- a/Swiften/Network/PlatformDomainNameServiceQuery.h
+++ b/Swiften/Network/PlatformDomainNameServiceQuery.h
@@ -1,15 +1,14 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
#include <string>
-#include <boost/enable_shared_from_this.hpp>
-
#include <Swiften/EventLoop/EventOwner.h>
#include <Swiften/Network/DomainNameServiceQuery.h>
#include <Swiften/Network/PlatformDomainNameQuery.h>
@@ -17,7 +16,7 @@
namespace Swift {
class EventLoop;
- class PlatformDomainNameServiceQuery : public DomainNameServiceQuery, public PlatformDomainNameQuery, public boost::enable_shared_from_this<PlatformDomainNameServiceQuery>, public EventOwner {
+ class PlatformDomainNameServiceQuery : public DomainNameServiceQuery, public PlatformDomainNameQuery, public std::enable_shared_from_this<PlatformDomainNameServiceQuery>, public EventOwner {
public:
PlatformDomainNameServiceQuery(const boost::optional<std::string>& serviceName, EventLoop* eventLoop, PlatformDomainNameResolver* resolver);
virtual ~PlatformDomainNameServiceQuery();
diff --git a/Swiften/Network/PlatformNATTraversalWorker.cpp b/Swiften/Network/PlatformNATTraversalWorker.cpp
index cb5758e..9b5ec2b 100644
--- a/Swiften/Network/PlatformNATTraversalWorker.cpp
+++ b/Swiften/Network/PlatformNATTraversalWorker.cpp
@@ -12,8 +12,8 @@
#include "PlatformNATTraversalWorker.h"
-#include <boost/smart_ptr/make_shared.hpp>
-#include <boost/enable_shared_from_this.hpp>
+#include <memory>
+#include <memory>
#include <boost/numeric/conversion/cast.hpp>
#include <Swiften/Base/Log.h>
@@ -31,9 +31,9 @@
namespace Swift {
-class PlatformNATTraversalRequest : public boost::enable_shared_from_this<PlatformNATTraversalRequest>, public EventOwner {
+class PlatformNATTraversalRequest : public std::enable_shared_from_this<PlatformNATTraversalRequest>, public EventOwner {
public:
- typedef boost::shared_ptr<PlatformNATTraversalRequest> ref;
+ typedef std::shared_ptr<PlatformNATTraversalRequest> ref;
public:
PlatformNATTraversalRequest(PlatformNATTraversalWorker* worker) : worker(worker) {
@@ -139,7 +139,7 @@ PlatformNATTraversalWorker::PlatformNATTraversalWorker(EventLoop* eventLoop) : e
PlatformNATTraversalWorker::~PlatformNATTraversalWorker() {
stopRequested = true;
- addRequestToQueue(boost::shared_ptr<PlatformNATTraversalRequest>());
+ addRequestToQueue(std::shared_ptr<PlatformNATTraversalRequest>());
thread->join();
delete thread;
#ifdef HAVE_LIBNATPMP
@@ -177,17 +177,17 @@ NATTraversalInterface* PlatformNATTraversalWorker::getNATTraversalInterface() co
return nullNATTraversalInterface;
}
-boost::shared_ptr<NATTraversalGetPublicIPRequest> PlatformNATTraversalWorker::createGetPublicIPRequest() {
- return boost::make_shared<PlatformNATTraversalGetPublicIPRequest>(this);
+std::shared_ptr<NATTraversalGetPublicIPRequest> PlatformNATTraversalWorker::createGetPublicIPRequest() {
+ return std::make_shared<PlatformNATTraversalGetPublicIPRequest>(this);
}
-boost::shared_ptr<NATTraversalForwardPortRequest> PlatformNATTraversalWorker::createForwardPortRequest(int localPort, int publicPort) {
- return boost::make_shared<PlatformNATTraversalForwardPortRequest>(this, localPort, publicPort);
+std::shared_ptr<NATTraversalForwardPortRequest> PlatformNATTraversalWorker::createForwardPortRequest(int localPort, int publicPort) {
+ return std::make_shared<PlatformNATTraversalForwardPortRequest>(this, localPort, publicPort);
}
-boost::shared_ptr<NATTraversalRemovePortForwardingRequest> PlatformNATTraversalWorker::createRemovePortForwardingRequest(int localPort, int publicPort) {
+std::shared_ptr<NATTraversalRemovePortForwardingRequest> PlatformNATTraversalWorker::createRemovePortForwardingRequest(int localPort, int publicPort) {
NATPortMapping mapping(localPort, publicPort, NATPortMapping::TCP); // FIXME
- return boost::make_shared<PlatformNATTraversalRemovePortForwardingRequest>(this, mapping);
+ return std::make_shared<PlatformNATTraversalRemovePortForwardingRequest>(this, mapping);
}
void PlatformNATTraversalWorker::start() {
diff --git a/Swiften/Network/PlatformNATTraversalWorker.h b/Swiften/Network/PlatformNATTraversalWorker.h
index 280a537..35f4ea6 100644
--- a/Swiften/Network/PlatformNATTraversalWorker.h
+++ b/Swiften/Network/PlatformNATTraversalWorker.h
@@ -44,13 +44,13 @@ namespace Swift {
PlatformNATTraversalWorker(EventLoop* eventLoop);
virtual ~PlatformNATTraversalWorker();
- boost::shared_ptr<NATTraversalGetPublicIPRequest> createGetPublicIPRequest();
- boost::shared_ptr<NATTraversalForwardPortRequest> createForwardPortRequest(int localPort, int publicPort);
- boost::shared_ptr<NATTraversalRemovePortForwardingRequest> createRemovePortForwardingRequest(int localPort, int publicPort);
+ std::shared_ptr<NATTraversalGetPublicIPRequest> createGetPublicIPRequest();
+ std::shared_ptr<NATTraversalForwardPortRequest> createForwardPortRequest(int localPort, int publicPort);
+ std::shared_ptr<NATTraversalRemovePortForwardingRequest> createRemovePortForwardingRequest(int localPort, int publicPort);
private:
NATTraversalInterface* getNATTraversalInterface() const;
- void addRequestToQueue(boost::shared_ptr<PlatformNATTraversalRequest>);
+ void addRequestToQueue(std::shared_ptr<PlatformNATTraversalRequest>);
void start();
void stop();
@@ -62,7 +62,7 @@ namespace Swift {
EventLoop* eventLoop;
Atomic<bool> stopRequested;
boost::thread* thread;
- std::deque<boost::shared_ptr<PlatformNATTraversalRequest> > queue;
+ std::deque<std::shared_ptr<PlatformNATTraversalRequest> > queue;
boost::mutex queueMutex;
boost::condition_variable queueNonEmpty;
diff --git a/Swiften/Network/ProxiedConnection.cpp b/Swiften/Network/ProxiedConnection.cpp
index 27f5cd9..16bab0d 100644
--- a/Swiften/Network/ProxiedConnection.cpp
+++ b/Swiften/Network/ProxiedConnection.cpp
@@ -92,7 +92,7 @@ void ProxiedConnection::handleConnectFinished(Connection::ref connection) {
}
}
-void ProxiedConnection::handleDataRead(boost::shared_ptr<SafeByteArray> data) {
+void ProxiedConnection::handleDataRead(std::shared_ptr<SafeByteArray> data) {
if (!connected_) {
handleProxyInitializeData(data);
}
diff --git a/Swiften/Network/ProxiedConnection.h b/Swiften/Network/ProxiedConnection.h
index 80f748c..38194aa 100644
--- a/Swiften/Network/ProxiedConnection.h
+++ b/Swiften/Network/ProxiedConnection.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2015 Isode Limited.
+ * Copyright (c) 2012-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -7,7 +7,7 @@
#pragma once
-#include <boost/enable_shared_from_this.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeString.h>
@@ -25,7 +25,7 @@ namespace boost {
namespace Swift {
class ConnectionFactory;
- class SWIFTEN_API ProxiedConnection : public Connection, public boost::enable_shared_from_this<ProxiedConnection> {
+ class SWIFTEN_API ProxiedConnection : public Connection, public std::enable_shared_from_this<ProxiedConnection> {
public:
ProxiedConnection(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort);
virtual ~ProxiedConnection();
@@ -40,7 +40,7 @@ namespace Swift {
private:
void handleConnectFinished(Connection::ref connection);
- void handleDataRead(boost::shared_ptr<SafeByteArray> data);
+ void handleDataRead(std::shared_ptr<SafeByteArray> data);
void handleDisconnected(const boost::optional<Error>& error);
void cancelConnector();
@@ -48,7 +48,7 @@ namespace Swift {
void setProxyInitializeFinished(bool success);
virtual void initializeProxy() = 0;
- virtual void handleProxyInitializeData(boost::shared_ptr<SafeByteArray> data) = 0;
+ virtual void handleProxyInitializeData(std::shared_ptr<SafeByteArray> data) = 0;
const HostAddressPort& getServer() const {
return server_;
@@ -65,7 +65,7 @@ namespace Swift {
int proxyPort_;
HostAddressPort server_;
Connector::ref connector_;
- boost::shared_ptr<Connection> connection_;
+ std::shared_ptr<Connection> connection_;
};
}
diff --git a/Swiften/Network/SOCKS5ProxiedConnection.cpp b/Swiften/Network/SOCKS5ProxiedConnection.cpp
index 2b7a3f3..67ef4ad 100644
--- a/Swiften/Network/SOCKS5ProxiedConnection.cpp
+++ b/Swiften/Network/SOCKS5ProxiedConnection.cpp
@@ -47,7 +47,7 @@ void SOCKS5ProxiedConnection::initializeProxy() {
write(socksConnect);
}
-void SOCKS5ProxiedConnection::handleProxyInitializeData(boost::shared_ptr<SafeByteArray> data) {
+void SOCKS5ProxiedConnection::handleProxyInitializeData(std::shared_ptr<SafeByteArray> data) {
SafeByteArray socksConnect;
boost::asio::ip::address rawAddress = getServer().getAddress().getRawAddress();
assert(rawAddress.is_v4() || rawAddress.is_v6());
diff --git a/Swiften/Network/SOCKS5ProxiedConnection.h b/Swiften/Network/SOCKS5ProxiedConnection.h
index edbc56c..c8faae9 100644
--- a/Swiften/Network/SOCKS5ProxiedConnection.h
+++ b/Swiften/Network/SOCKS5ProxiedConnection.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,7 +22,7 @@ namespace Swift {
class SWIFTEN_API SOCKS5ProxiedConnection : public ProxiedConnection {
public:
- typedef boost::shared_ptr<SOCKS5ProxiedConnection> ref;
+ typedef std::shared_ptr<SOCKS5ProxiedConnection> ref;
static ref create(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort) {
return ref(new SOCKS5ProxiedConnection(resolver, connectionFactory, timerFactory, proxyHost, proxyPort));
@@ -32,7 +32,7 @@ namespace Swift {
SOCKS5ProxiedConnection(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort);
virtual void initializeProxy();
- virtual void handleProxyInitializeData(boost::shared_ptr<SafeByteArray> data);
+ virtual void handleProxyInitializeData(std::shared_ptr<SafeByteArray> data);
private:
enum {
diff --git a/Swiften/Network/SOCKS5ProxiedConnectionFactory.cpp b/Swiften/Network/SOCKS5ProxiedConnectionFactory.cpp
index 3e24f00..01ce8ac 100644
--- a/Swiften/Network/SOCKS5ProxiedConnectionFactory.cpp
+++ b/Swiften/Network/SOCKS5ProxiedConnectionFactory.cpp
@@ -4,6 +4,12 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <Swiften/Network/SOCKS5ProxiedConnectionFactory.h>
#include <Swiften/Network/SOCKS5ProxiedConnection.h>
@@ -13,7 +19,7 @@ namespace Swift {
SOCKS5ProxiedConnectionFactory::SOCKS5ProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort) : resolver_(resolver), connectionFactory_(connectionFactory), timerFactory_(timerFactory), proxyHost_(proxyHost), proxyPort_(proxyPort) {
}
-boost::shared_ptr<Connection> SOCKS5ProxiedConnectionFactory::createConnection() {
+std::shared_ptr<Connection> SOCKS5ProxiedConnectionFactory::createConnection() {
return SOCKS5ProxiedConnection::create(resolver_, connectionFactory_, timerFactory_, proxyHost_, proxyPort_);
}
diff --git a/Swiften/Network/SOCKS5ProxiedConnectionFactory.h b/Swiften/Network/SOCKS5ProxiedConnectionFactory.h
index 1092381..8631239 100644
--- a/Swiften/Network/SOCKS5ProxiedConnectionFactory.h
+++ b/Swiften/Network/SOCKS5ProxiedConnectionFactory.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -25,7 +25,7 @@ namespace Swift {
public:
SOCKS5ProxiedConnectionFactory(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort);
- virtual boost::shared_ptr<Connection> createConnection();
+ virtual std::shared_ptr<Connection> createConnection();
private:
DomainNameResolver* resolver_;
diff --git a/Swiften/Network/StaticDomainNameResolver.cpp b/Swiften/Network/StaticDomainNameResolver.cpp
index 45e6c5f..3601bf2 100644
--- a/Swiften/Network/StaticDomainNameResolver.cpp
+++ b/Swiften/Network/StaticDomainNameResolver.cpp
@@ -17,8 +17,8 @@
using namespace Swift;
namespace {
- struct ServiceQuery : public DomainNameServiceQuery, public boost::enable_shared_from_this<ServiceQuery> {
- ServiceQuery(const std::string& service, Swift::StaticDomainNameResolver* resolver, EventLoop* eventLoop, boost::shared_ptr<EventOwner> owner) : eventLoop(eventLoop), service(service), resolver(resolver), owner(owner) {}
+ struct ServiceQuery : public DomainNameServiceQuery, public std::enable_shared_from_this<ServiceQuery> {
+ ServiceQuery(const std::string& service, Swift::StaticDomainNameResolver* resolver, EventLoop* eventLoop, std::shared_ptr<EventOwner> owner) : eventLoop(eventLoop), service(service), resolver(resolver), owner(owner) {}
virtual void run() {
if (!resolver->getIsResponsive()) {
@@ -40,11 +40,11 @@ namespace {
EventLoop* eventLoop;
std::string service;
StaticDomainNameResolver* resolver;
- boost::shared_ptr<EventOwner> owner;
+ std::shared_ptr<EventOwner> owner;
};
- struct AddressQuery : public DomainNameAddressQuery, public boost::enable_shared_from_this<AddressQuery> {
- AddressQuery(const std::string& host, StaticDomainNameResolver* resolver, EventLoop* eventLoop, boost::shared_ptr<EventOwner> owner) : eventLoop(eventLoop), host(host), resolver(resolver), owner(owner) {}
+ struct AddressQuery : public DomainNameAddressQuery, public std::enable_shared_from_this<AddressQuery> {
+ AddressQuery(const std::string& host, StaticDomainNameResolver* resolver, EventLoop* eventLoop, std::shared_ptr<EventOwner> owner) : eventLoop(eventLoop), host(host), resolver(resolver), owner(owner) {}
virtual void run() {
if (!resolver->getIsResponsive()) {
@@ -67,7 +67,7 @@ namespace {
EventLoop* eventLoop;
std::string host;
StaticDomainNameResolver* resolver;
- boost::shared_ptr<EventOwner> owner;
+ std::shared_ptr<EventOwner> owner;
};
}
@@ -109,12 +109,12 @@ void StaticDomainNameResolver::addXMPPClientService(const std::string& domain, c
addService("_xmpp-client._tcp." + domain, ServiceQuery::Result(hostname, port, 0, 0));
}
-boost::shared_ptr<DomainNameServiceQuery> StaticDomainNameResolver::createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) {
- return boost::shared_ptr<DomainNameServiceQuery>(new ServiceQuery(serviceLookupPrefix + domain, this, eventLoop, owner));
+std::shared_ptr<DomainNameServiceQuery> StaticDomainNameResolver::createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) {
+ return std::make_shared<ServiceQuery>(serviceLookupPrefix + domain, this, eventLoop, owner);
}
-boost::shared_ptr<DomainNameAddressQuery> StaticDomainNameResolver::createAddressQuery(const std::string& name) {
- return boost::shared_ptr<DomainNameAddressQuery>(new AddressQuery(name, this, eventLoop, owner));
+std::shared_ptr<DomainNameAddressQuery> StaticDomainNameResolver::createAddressQuery(const std::string& name) {
+ return std::make_shared<AddressQuery>(name, this, eventLoop, owner);
}
}
diff --git a/Swiften/Network/StaticDomainNameResolver.h b/Swiften/Network/StaticDomainNameResolver.h
index 6d38a26..76394d0 100644
--- a/Swiften/Network/StaticDomainNameResolver.h
+++ b/Swiften/Network/StaticDomainNameResolver.h
@@ -7,6 +7,7 @@
#pragma once
#include <map>
+#include <memory>
#include <vector>
#include <Swiften/Base/API.h>
@@ -48,13 +49,13 @@ namespace Swift {
isResponsive = b;
}
- virtual boost::shared_ptr<DomainNameServiceQuery> createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain);
- virtual boost::shared_ptr<DomainNameAddressQuery> createAddressQuery(const std::string& name);
+ virtual std::shared_ptr<DomainNameServiceQuery> createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain);
+ virtual std::shared_ptr<DomainNameAddressQuery> createAddressQuery(const std::string& name);
private:
EventLoop* eventLoop;
bool isResponsive;
AddressesMap addresses;
ServicesCollection services;
- boost::shared_ptr<EventOwner> owner;
+ std::shared_ptr<EventOwner> owner;
};
}
diff --git a/Swiften/Network/TLSConnection.cpp b/Swiften/Network/TLSConnection.cpp
index 4099de7..7c293d1 100644
--- a/Swiften/Network/TLSConnection.cpp
+++ b/Swiften/Network/TLSConnection.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -47,7 +47,7 @@ void TLSConnection::handleTLSDataForNetwork(const SafeByteArray& data) {
}
void TLSConnection::handleTLSDataForApplication(const SafeByteArray& data) {
- onDataRead(boost::make_shared<SafeByteArray>(data));
+ onDataRead(std::make_shared<SafeByteArray>(data));
}
void TLSConnection::connect(const HostAddressPort& address) {
@@ -88,7 +88,7 @@ void TLSConnection::handleRawDisconnected(const boost::optional<Error>& error) {
onDisconnected(error);
}
-void TLSConnection::handleRawDataRead(boost::shared_ptr<SafeByteArray> data) {
+void TLSConnection::handleRawDataRead(std::shared_ptr<SafeByteArray> data) {
context->handleDataFromNetwork(*data);
}
diff --git a/Swiften/Network/TLSConnection.h b/Swiften/Network/TLSConnection.h
index 41543a2..fdcdb6d 100644
--- a/Swiften/Network/TLSConnection.h
+++ b/Swiften/Network/TLSConnection.h
@@ -1,13 +1,12 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeByteArray.h>
@@ -39,7 +38,7 @@ namespace Swift {
private:
void handleRawConnectFinished(bool error);
void handleRawDisconnected(const boost::optional<Error>& error);
- void handleRawDataRead(boost::shared_ptr<SafeByteArray> data);
+ void handleRawDataRead(std::shared_ptr<SafeByteArray> data);
void handleRawDataWritten();
void handleTLSConnectFinished(bool error);
void handleTLSDataForNetwork(const SafeByteArray& data);
diff --git a/Swiften/Network/TLSConnectionFactory.cpp b/Swiften/Network/TLSConnectionFactory.cpp
index e0396e2..b311c7d 100644
--- a/Swiften/Network/TLSConnectionFactory.cpp
+++ b/Swiften/Network/TLSConnectionFactory.cpp
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2011 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Network/TLSConnectionFactory.h>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Network/TLSConnection.h>
@@ -21,8 +21,8 @@ TLSConnectionFactory::~TLSConnectionFactory() {
}
-boost::shared_ptr<Connection> TLSConnectionFactory::createConnection() {
- return boost::make_shared<TLSConnection>(connectionFactory->createConnection(), contextFactory, options_);
+std::shared_ptr<Connection> TLSConnectionFactory::createConnection() {
+ return std::make_shared<TLSConnection>(connectionFactory->createConnection(), contextFactory, options_);
}
}
diff --git a/Swiften/Network/TLSConnectionFactory.h b/Swiften/Network/TLSConnectionFactory.h
index 8e39c35..148e345 100644
--- a/Swiften/Network/TLSConnectionFactory.h
+++ b/Swiften/Network/TLSConnectionFactory.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Network/ConnectionFactory.h>
@@ -21,7 +21,7 @@ namespace Swift {
TLSConnectionFactory(TLSContextFactory* contextFactory, ConnectionFactory* connectionFactory, const TLSOptions&);
virtual ~TLSConnectionFactory();
- virtual boost::shared_ptr<Connection> createConnection();
+ virtual std::shared_ptr<Connection> createConnection();
private:
TLSContextFactory* contextFactory;
ConnectionFactory* connectionFactory;
diff --git a/Swiften/Network/Timer.h b/Swiften/Network/Timer.h
index 1abf5bc..501fbd8 100644
--- a/Swiften/Network/Timer.h
+++ b/Swiften/Network/Timer.h
@@ -15,7 +15,7 @@ namespace Swift {
*/
class SWIFTEN_API Timer {
public:
- typedef boost::shared_ptr<Timer> ref;
+ typedef std::shared_ptr<Timer> ref;
virtual ~Timer();
diff --git a/Swiften/Network/TimerFactory.h b/Swiften/Network/TimerFactory.h
index 47e89f8..ebb1b6e 100644
--- a/Swiften/Network/TimerFactory.h
+++ b/Swiften/Network/TimerFactory.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Network/Timer.h>
diff --git a/Swiften/Network/UnboundDomainNameResolver.cpp b/Swiften/Network/UnboundDomainNameResolver.cpp
index a9fed24..380e087 100755
--- a/Swiften/Network/UnboundDomainNameResolver.cpp
+++ b/Swiften/Network/UnboundDomainNameResolver.cpp
@@ -10,11 +10,10 @@
* See the COPYING file for more information.
*/
+#include <memory>
#include <vector>
#include <boost/bind.hpp>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <UnboundDomainNameResolver.h>
#include <arpa/inet.h>
@@ -44,12 +43,12 @@ class UnboundQuery {
};
struct UnboundWrapperHelper {
- UnboundWrapperHelper(UnboundDomainNameResolver* resolver, boost::shared_ptr<UnboundQuery> query) : resolver(resolver), query(query) {}
+ UnboundWrapperHelper(UnboundDomainNameResolver* resolver, std::shared_ptr<UnboundQuery> query) : resolver(resolver), query(query) {}
UnboundDomainNameResolver* resolver;
- boost::shared_ptr<UnboundQuery> query;
+ std::shared_ptr<UnboundQuery> query;
};
-class UnboundDomainNameServiceQuery : public DomainNameServiceQuery, public UnboundQuery, public boost::enable_shared_from_this<UnboundDomainNameServiceQuery> {
+class UnboundDomainNameServiceQuery : public DomainNameServiceQuery, public UnboundQuery, public std::enable_shared_from_this<UnboundDomainNameServiceQuery> {
public:
UnboundDomainNameServiceQuery(UnboundDomainNameResolver* resolver, ub_ctx* context, std::string name) : UnboundQuery(resolver, context), name(name) {
}
@@ -121,7 +120,7 @@ class UnboundDomainNameServiceQuery : public DomainNameServiceQuery, public Unbo
std::string name;
};
-class UnboundDomainNameAddressQuery : public DomainNameAddressQuery, public UnboundQuery, public boost::enable_shared_from_this<UnboundDomainNameAddressQuery> {
+class UnboundDomainNameAddressQuery : public DomainNameAddressQuery, public UnboundQuery, public std::enable_shared_from_this<UnboundDomainNameAddressQuery> {
public:
UnboundDomainNameAddressQuery(UnboundDomainNameResolver* resolver, ub_ctx* context, std::string name) : UnboundQuery(resolver, context), name(name) {
}
@@ -179,12 +178,12 @@ class UnboundDomainNameAddressQuery : public DomainNameAddressQuery, public Unbo
std::string name;
};
-UnboundDomainNameResolver::UnboundDomainNameResolver(IDNConverter* idnConverter, boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : idnConverter(idnConverter), ioService(ioService), ubDescriptior(*ioService), eventLoop(eventLoop) {
+UnboundDomainNameResolver::UnboundDomainNameResolver(IDNConverter* idnConverter, std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : idnConverter(idnConverter), ioService(ioService), ubDescriptior(*ioService), eventLoop(eventLoop) {
ubContext = ub_ctx_create();
if(!ubContext) {
SWIFT_LOG(debug) << "could not create unbound context" << std::endl;
}
- eventOwner = boost::make_shared<EventOwner>();
+ eventOwner = std::make_shared<EventOwner>();
ub_ctx_async(ubContext, true);
@@ -211,7 +210,7 @@ UnboundDomainNameResolver::~UnboundDomainNameResolver() {
}
}
-void UnboundDomainNameResolver::unbound_callback(boost::shared_ptr<UnboundQuery> query, int err, ub_result* result) {
+void UnboundDomainNameResolver::unbound_callback(std::shared_ptr<UnboundQuery> query, int err, ub_result* result) {
query->handleResult(err, result);
}
@@ -236,17 +235,17 @@ void UnboundDomainNameResolver::processData() {
}
}
-boost::shared_ptr<DomainNameServiceQuery> UnboundDomainNameResolver::createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) {
+std::shared_ptr<DomainNameServiceQuery> UnboundDomainNameResolver::createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) {
boost::optional<std::string> encodedDomain = idnConverter->getIDNAEncoded(domain);
std::string result;
if (encodedDomain) {
result = serviceLookupPrefix + *encodedDomain;
}
- return boost::make_shared<UnboundDomainNameServiceQuery>(this, ubContext, result);
+ return std::make_shared<UnboundDomainNameServiceQuery>(this, ubContext, result);
}
-boost::shared_ptr<DomainNameAddressQuery> UnboundDomainNameResolver::createAddressQuery(const std::string& name) {
- return boost::make_shared<UnboundDomainNameAddressQuery>(this, ubContext, idnConverter->getIDNAEncoded(name).get_value_or(""));
+std::shared_ptr<DomainNameAddressQuery> UnboundDomainNameResolver::createAddressQuery(const std::string& name) {
+ return std::make_shared<UnboundDomainNameAddressQuery>(this, ubContext, idnConverter->getIDNAEncoded(name).get_value_or(""));
}
}
diff --git a/Swiften/Network/UnboundDomainNameResolver.h b/Swiften/Network/UnboundDomainNameResolver.h
index afb21c8..a97e385 100755
--- a/Swiften/Network/UnboundDomainNameResolver.h
+++ b/Swiften/Network/UnboundDomainNameResolver.h
@@ -12,9 +12,9 @@
#pragma once
+#include <memory>
+
#include <boost/asio.hpp>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/EventLoop/EventOwner.h>
#include <Swiften/Network/DomainNameResolver.h>
@@ -31,26 +31,26 @@ namespace Swift {
class UnboundDomainNameResolver;
class UnboundQuery;
- class UnboundDomainNameResolver : public DomainNameResolver, public EventOwner, public boost::enable_shared_from_this<UnboundDomainNameResolver> {
+ class UnboundDomainNameResolver : public DomainNameResolver, public EventOwner, public std::enable_shared_from_this<UnboundDomainNameResolver> {
public:
- UnboundDomainNameResolver(IDNConverter* idnConverter, boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop);
+ UnboundDomainNameResolver(IDNConverter* idnConverter, std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop);
virtual ~UnboundDomainNameResolver();
- virtual boost::shared_ptr<DomainNameServiceQuery> createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain);
- virtual boost::shared_ptr<DomainNameAddressQuery> createAddressQuery(const std::string& name);
+ virtual std::shared_ptr<DomainNameServiceQuery> createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain);
+ virtual std::shared_ptr<DomainNameAddressQuery> createAddressQuery(const std::string& name);
static void unbound_callback_wrapper(void* data, int err, ub_result* result);
private:
- void unbound_callback(boost::shared_ptr<UnboundQuery> query, int err, ub_result* result);
+ void unbound_callback(std::shared_ptr<UnboundQuery> query, int err, ub_result* result);
void handleUBSocketReadable(boost::system::error_code);
void processData();
private:
IDNConverter* idnConverter;
- boost::shared_ptr<EventOwner> eventOwner;
- boost::shared_ptr<boost::asio::io_service> ioService;
+ std::shared_ptr<EventOwner> eventOwner;
+ std::shared_ptr<boost::asio::io_service> ioService;
boost::asio::posix::stream_descriptor ubDescriptior;
EventLoop* eventLoop;
ub_ctx* ubContext;
diff --git a/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp b/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp
index 12b48a9..8dbd09e 100644
--- a/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp
+++ b/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp
@@ -4,11 +4,11 @@
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/bind.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <QA/Checker/IO.h>
@@ -29,7 +29,7 @@
using namespace Swift;
-typedef boost::shared_ptr<BOSHConnectionPool> PoolRef;
+typedef std::shared_ptr<BOSHConnectionPool> PoolRef;
class BOSHConnectionPoolTest : public CppUnit::TestFixture {
@@ -167,8 +167,8 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture {
}
void testConnectionCount_ThreeWritesTwoReads() {
- boost::shared_ptr<MockConnection> c0;
- boost::shared_ptr<MockConnection> c1;
+ std::shared_ptr<MockConnection> c0;
+ std::shared_ptr<MockConnection> c1;
unsigned long long rid = initialRID;
PoolRef testling = createTestling();
@@ -294,7 +294,7 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture {
}
void testWrite_Empty() {
- boost::shared_ptr<MockConnection> c0;
+ std::shared_ptr<MockConnection> c0;
PoolRef testling = createTestling();
CPPUNIT_ASSERT_EQUAL(st(1), connectionFactory->connections.size());
@@ -406,32 +406,32 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture {
MockConnectionFactory(EventLoop* eventLoop, bool autoFinishConnect = true) : eventLoop(eventLoop), autoFinishConnect(autoFinishConnect) {
}
- boost::shared_ptr<Connection> createConnection() {
- boost::shared_ptr<MockConnection> connection = boost::make_shared<MockConnection>(failingPorts, eventLoop, autoFinishConnect);
+ std::shared_ptr<Connection> createConnection() {
+ std::shared_ptr<MockConnection> connection = std::make_shared<MockConnection>(failingPorts, eventLoop, autoFinishConnect);
connections.push_back(connection);
return connection;
}
EventLoop* eventLoop;
- std::vector< boost::shared_ptr<MockConnection> > connections;
+ std::vector< std::shared_ptr<MockConnection> > connections;
std::vector<HostAddressPort> failingPorts;
bool autoFinishConnect;
};
- void readResponse(const std::string& response, boost::shared_ptr<MockConnection> connection) {
+ void readResponse(const std::string& response, std::shared_ptr<MockConnection> connection) {
connection->pending = false;
- boost::shared_ptr<SafeByteArray> data1 = boost::make_shared<SafeByteArray>(createSafeByteArray(
+ std::shared_ptr<SafeByteArray> data1 = std::make_shared<SafeByteArray>(createSafeByteArray(
"HTTP/1.1 200 OK\r\n"
"Content-Type: text/xml; charset=utf-8\r\n"
"Access-Control-Allow-Origin: *\r\n"
"Access-Control-Allow-Headers: Content-Type\r\n"
"Content-Length: "));
connection->onDataRead(data1);
- boost::shared_ptr<SafeByteArray> data2 = boost::make_shared<SafeByteArray>(createSafeByteArray(boost::lexical_cast<std::string>(response.size())));
+ std::shared_ptr<SafeByteArray> data2 = std::make_shared<SafeByteArray>(createSafeByteArray(boost::lexical_cast<std::string>(response.size())));
connection->onDataRead(data2);
- boost::shared_ptr<SafeByteArray> data3 = boost::make_shared<SafeByteArray>(createSafeByteArray("\r\n\r\n"));
+ std::shared_ptr<SafeByteArray> data3 = std::make_shared<SafeByteArray>(createSafeByteArray("\r\n\r\n"));
connection->onDataRead(data3);
- boost::shared_ptr<SafeByteArray> data4 = boost::make_shared<SafeByteArray>(createSafeByteArray(response));
+ std::shared_ptr<SafeByteArray> data4 = std::make_shared<SafeByteArray>(createSafeByteArray(response));
connection->onDataRead(data4);
}
diff --git a/Swiften/Network/UnitTest/BOSHConnectionTest.cpp b/Swiften/Network/UnitTest/BOSHConnectionTest.cpp
index abd020f..a791e96 100644
--- a/Swiften/Network/UnitTest/BOSHConnectionTest.cpp
+++ b/Swiften/Network/UnitTest/BOSHConnectionTest.cpp
@@ -4,11 +4,11 @@
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/bind.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <QA/Checker/IO.h>
@@ -151,17 +151,17 @@ class BOSHConnectionTest : public CppUnit::TestFixture {
testling->connect();
eventLoop->processEvents();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), connectionFactory->connections.size());
- boost::shared_ptr<MockConnection> connection = connectionFactory->connections[0];
- boost::shared_ptr<SafeByteArray> data1 = boost::make_shared<SafeByteArray>(createSafeByteArray(
+ std::shared_ptr<MockConnection> connection = connectionFactory->connections[0];
+ std::shared_ptr<SafeByteArray> data1 = std::make_shared<SafeByteArray>(createSafeByteArray(
"HTTP/1.1 200 OK\r\n"
"Content-Type: text/xml; charset=utf-8\r\n"
"Access-Control-Allow-Origin: *\r\n"
"Access-Control-Allow-Headers: Content-Type\r\n"
"Content-Length: 64\r\n"));
- boost::shared_ptr<SafeByteArray> data2 = boost::make_shared<SafeByteArray>(createSafeByteArray(
+ std::shared_ptr<SafeByteArray> data2 = std::make_shared<SafeByteArray>(createSafeByteArray(
"\r\n<body xmlns='http://jabber.org/protocol/httpbind'>"
"<bl"));
- boost::shared_ptr<SafeByteArray> data3 = boost::make_shared<SafeByteArray>(createSafeByteArray(
+ std::shared_ptr<SafeByteArray> data3 = std::make_shared<SafeByteArray>(createSafeByteArray(
"ah/>"
"</body>"));
connection->onDataRead(data1);
@@ -258,30 +258,30 @@ class BOSHConnectionTest : public CppUnit::TestFixture {
MockConnectionFactory(EventLoop* eventLoop) : eventLoop(eventLoop) {
}
- boost::shared_ptr<Connection> createConnection() {
- boost::shared_ptr<MockConnection> connection = boost::make_shared<MockConnection>(failingPorts, eventLoop);
+ std::shared_ptr<Connection> createConnection() {
+ std::shared_ptr<MockConnection> connection = std::make_shared<MockConnection>(failingPorts, eventLoop);
connections.push_back(connection);
return connection;
}
EventLoop* eventLoop;
- std::vector< boost::shared_ptr<MockConnection> > connections;
+ std::vector< std::shared_ptr<MockConnection> > connections;
std::vector<HostAddressPort> failingPorts;
};
- void readResponse(const std::string& response, boost::shared_ptr<MockConnection> connection) {
- boost::shared_ptr<SafeByteArray> data1 = boost::make_shared<SafeByteArray>(createSafeByteArray(
+ void readResponse(const std::string& response, std::shared_ptr<MockConnection> connection) {
+ std::shared_ptr<SafeByteArray> data1 = std::make_shared<SafeByteArray>(createSafeByteArray(
"HTTP/1.1 200 OK\r\n"
"Content-Type: text/xml; charset=utf-8\r\n"
"Access-Control-Allow-Origin: *\r\n"
"Access-Control-Allow-Headers: Content-Type\r\n"
"Content-Length: "));
connection->onDataRead(data1);
- boost::shared_ptr<SafeByteArray> data2 = boost::make_shared<SafeByteArray>(createSafeByteArray(boost::lexical_cast<std::string>(response.size())));
+ std::shared_ptr<SafeByteArray> data2 = std::make_shared<SafeByteArray>(createSafeByteArray(boost::lexical_cast<std::string>(response.size())));
connection->onDataRead(data2);
- boost::shared_ptr<SafeByteArray> data3 = boost::make_shared<SafeByteArray>(createSafeByteArray("\r\n\r\n"));
+ std::shared_ptr<SafeByteArray> data3 = std::make_shared<SafeByteArray>(createSafeByteArray("\r\n\r\n"));
connection->onDataRead(data3);
- boost::shared_ptr<SafeByteArray> data4 = boost::make_shared<SafeByteArray>(createSafeByteArray(response));
+ std::shared_ptr<SafeByteArray> data4 = std::make_shared<SafeByteArray>(createSafeByteArray(response));
connection->onDataRead(data4);
}
diff --git a/Swiften/Network/UnitTest/ChainedConnectorTest.cpp b/Swiften/Network/UnitTest/ChainedConnectorTest.cpp
index 9496e13..3fad433 100644
--- a/Swiften/Network/UnitTest/ChainedConnectorTest.cpp
+++ b/Swiften/Network/UnitTest/ChainedConnectorTest.cpp
@@ -1,11 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -51,7 +52,7 @@ class ChainedConnectorTest : public CppUnit::TestFixture {
}
void testConnect_FirstConnectorSucceeds() {
- boost::shared_ptr<ChainedConnector> testling(createConnector());
+ std::shared_ptr<ChainedConnector> testling(createConnector());
connectionFactory1->connects = true;
connectionFactory2->connects = false;
@@ -60,12 +61,12 @@ class ChainedConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(connections[0]);
- CPPUNIT_ASSERT_EQUAL(1, boost::dynamic_pointer_cast<MockConnection>(connections[0])->id);
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT_EQUAL(1, std::dynamic_pointer_cast<MockConnection>(connections[0])->id);
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testConnect_SecondConnectorSucceeds() {
- boost::shared_ptr<ChainedConnector> testling(createConnector());
+ std::shared_ptr<ChainedConnector> testling(createConnector());
connectionFactory1->connects = false;
connectionFactory2->connects = true;
@@ -74,12 +75,12 @@ class ChainedConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(connections[0]);
- CPPUNIT_ASSERT_EQUAL(2, boost::dynamic_pointer_cast<MockConnection>(connections[0])->id);
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT_EQUAL(2, std::dynamic_pointer_cast<MockConnection>(connections[0])->id);
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testConnect_NoConnectorSucceeds() {
- boost::shared_ptr<ChainedConnector> testling(createConnector());
+ std::shared_ptr<ChainedConnector> testling(createConnector());
connectionFactory1->connects = false;
connectionFactory2->connects = false;
@@ -88,14 +89,14 @@ class ChainedConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(!connections[0]);
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testConnect_NoDNS() {
/* Reset resolver so there's no record */
delete resolver;
resolver = new StaticDomainNameResolver(eventLoop);
- boost::shared_ptr<ChainedConnector> testling(createConnector());
+ std::shared_ptr<ChainedConnector> testling(createConnector());
connectionFactory1->connects = false;
connectionFactory2->connects = false;
@@ -105,11 +106,11 @@ class ChainedConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(!connections[0]);
- CPPUNIT_ASSERT(boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testStop() {
- boost::shared_ptr<ChainedConnector> testling(createConnector());
+ std::shared_ptr<ChainedConnector> testling(createConnector());
connectionFactory1->connects = true;
connectionFactory2->connects = false;
@@ -122,18 +123,18 @@ class ChainedConnectorTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<ChainedConnector> createConnector() {
+ std::shared_ptr<ChainedConnector> createConnector() {
std::vector<ConnectionFactory*> factories;
factories.push_back(connectionFactory1);
factories.push_back(connectionFactory2);
- boost::shared_ptr<ChainedConnector> connector = boost::make_shared<ChainedConnector>("foo.com", -1, boost::optional<std::string>("_xmpp-client._tcp."), resolver, factories, timerFactory);
+ std::shared_ptr<ChainedConnector> connector = std::make_shared<ChainedConnector>("foo.com", -1, boost::optional<std::string>("_xmpp-client._tcp."), resolver, factories, timerFactory);
connector->onConnectFinished.connect(boost::bind(&ChainedConnectorTest::handleConnectorFinished, this, _1, _2));
return connector;
}
- void handleConnectorFinished(boost::shared_ptr<Connection> connection, boost::shared_ptr<Error> resultError) {
+ void handleConnectorFinished(std::shared_ptr<Connection> connection, std::shared_ptr<Error> resultError) {
error = resultError;
- boost::shared_ptr<MockConnection> c(boost::dynamic_pointer_cast<MockConnection>(connection));
+ std::shared_ptr<MockConnection> c(std::dynamic_pointer_cast<MockConnection>(connection));
if (connection) {
assert(c);
}
@@ -164,8 +165,8 @@ class ChainedConnectorTest : public CppUnit::TestFixture {
MockConnectionFactory(EventLoop* eventLoop, int id) : eventLoop(eventLoop), connects(true), id(id) {
}
- boost::shared_ptr<Connection> createConnection() {
- return boost::make_shared<MockConnection>(connects, id, eventLoop);
+ std::shared_ptr<Connection> createConnection() {
+ return std::make_shared<MockConnection>(connects, id, eventLoop);
}
EventLoop* eventLoop;
@@ -180,8 +181,8 @@ class ChainedConnectorTest : public CppUnit::TestFixture {
MockConnectionFactory* connectionFactory1;
MockConnectionFactory* connectionFactory2;
DummyTimerFactory* timerFactory;
- std::vector< boost::shared_ptr<MockConnection> > connections;
- boost::shared_ptr<Error> error;
+ std::vector< std::shared_ptr<MockConnection> > connections;
+ std::shared_ptr<Error> error;
};
CPPUNIT_TEST_SUITE_REGISTRATION(ChainedConnectorTest);
diff --git a/Swiften/Network/UnitTest/ConnectorTest.cpp b/Swiften/Network/UnitTest/ConnectorTest.cpp
index ac2bc83..20ad68d 100644
--- a/Swiften/Network/UnitTest/ConnectorTest.cpp
+++ b/Swiften/Network/UnitTest/ConnectorTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -71,7 +71,7 @@ class ConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(connections[0]);
CPPUNIT_ASSERT(host1 == *(connections[0]->hostAddressPort));
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testConnect_NoServiceLookups() {
@@ -87,7 +87,7 @@ class ConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(connections[0]);
CPPUNIT_ASSERT(host3.getAddress() == (*(connections[0]->hostAddressPort)).getAddress());
CPPUNIT_ASSERT(4321 == (*(connections[0]->hostAddressPort)).getPort());
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testConnect_NoServiceLookups_DefaultPort() {
@@ -103,7 +103,7 @@ class ConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(connections[0]);
CPPUNIT_ASSERT(host3.getAddress() == (*(connections[0]->hostAddressPort)).getAddress());
CPPUNIT_ASSERT_EQUAL(5222, (*(connections[0]->hostAddressPort)).getPort());
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testConnect_NoSRVHost() {
@@ -116,7 +116,7 @@ class ConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(connections[0]);
CPPUNIT_ASSERT(host3 == *(connections[0]->hostAddressPort));
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testConnect_FirstAddressHostFails() {
@@ -135,7 +135,7 @@ class ConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(connections[0]);
CPPUNIT_ASSERT(HostAddressPort(address2, 1234) == *(connections[0]->hostAddressPort));
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testConnect_NoHosts() {
@@ -146,7 +146,7 @@ class ConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(!connections[0]);
- CPPUNIT_ASSERT(boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testConnect_FirstSRVHostFails() {
@@ -160,7 +160,7 @@ class ConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(host2 == *(connections[0]->hostAddressPort));
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testConnect_AllSRVHostsFailWithoutFallbackHost() {
@@ -175,7 +175,7 @@ class ConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(!connections[0]);
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testConnect_AllSRVHostsFailWithFallbackHost() {
@@ -192,7 +192,7 @@ class ConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(connections[0]);
CPPUNIT_ASSERT(host3 == *(connections[0]->hostAddressPort));
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testConnect_SRVAndFallbackHostsFail() {
@@ -207,7 +207,7 @@ class ConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(!connections[0]);
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
/*void testConnect_TimeoutDuringResolve() {
@@ -221,7 +221,7 @@ class ConnectorTest : public CppUnit::TestFixture {
eventLoop->processEvents();
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
- CPPUNIT_ASSERT(boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(std::dynamic_pointer_cast<DomainNameResolveError>(error));
CPPUNIT_ASSERT(!connections[0]);
}*/
@@ -238,7 +238,7 @@ class ConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(!connections[0]);
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testConnect_TimeoutDuringConnectToCandidateFallsBack() {
@@ -261,7 +261,7 @@ class ConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(connections[0]);
CPPUNIT_ASSERT(HostAddressPort(address2, 1234) == *(connections[0]->hostAddressPort));
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
@@ -277,7 +277,7 @@ class ConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(connections[0]);
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testStop_DuringSRVQuery() {
@@ -291,7 +291,7 @@ class ConnectorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(connections.size()));
CPPUNIT_ASSERT(!connections[0]);
- CPPUNIT_ASSERT(boost::dynamic_pointer_cast<DomainNameResolveError>(error));
+ CPPUNIT_ASSERT(std::dynamic_pointer_cast<DomainNameResolveError>(error));
}
void testStop_Timeout() {
@@ -318,8 +318,8 @@ class ConnectorTest : public CppUnit::TestFixture {
return connector;
}
- void handleConnectorFinished(boost::shared_ptr<Connection> connection, boost::shared_ptr<Error> resultError) {
- boost::shared_ptr<MockConnection> c(boost::dynamic_pointer_cast<MockConnection>(connection));
+ void handleConnectorFinished(std::shared_ptr<Connection> connection, std::shared_ptr<Error> resultError) {
+ std::shared_ptr<MockConnection> c(std::dynamic_pointer_cast<MockConnection>(connection));
if (connection) {
assert(c);
}
@@ -355,8 +355,8 @@ class ConnectorTest : public CppUnit::TestFixture {
MockConnectionFactory(EventLoop* eventLoop) : eventLoop(eventLoop), isResponsive(true) {
}
- boost::shared_ptr<Connection> createConnection() {
- return boost::shared_ptr<Connection>(new MockConnection(failingPorts, isResponsive, eventLoop));
+ std::shared_ptr<Connection> createConnection() {
+ return std::make_shared<MockConnection>(failingPorts, isResponsive, eventLoop);
}
EventLoop* eventLoop;
@@ -372,8 +372,8 @@ class ConnectorTest : public CppUnit::TestFixture {
StaticDomainNameResolver* resolver;
MockConnectionFactory* connectionFactory;
DummyTimerFactory* timerFactory;
- std::vector< boost::shared_ptr<MockConnection> > connections;
- boost::shared_ptr<Error> error;
+ std::vector< std::shared_ptr<MockConnection> > connections;
+ std::shared_ptr<Error> error;
};
diff --git a/Swiften/Network/UnitTest/HTTPConnectProxiedConnectionTest.cpp b/Swiften/Network/UnitTest/HTTPConnectProxiedConnectionTest.cpp
index aa3d578..232847b 100644
--- a/Swiften/Network/UnitTest/HTTPConnectProxiedConnectionTest.cpp
+++ b/Swiften/Network/UnitTest/HTTPConnectProxiedConnectionTest.cpp
@@ -1,15 +1,15 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/algorithm/string.hpp>
#include <boost/bind.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <QA/Checker/IO.h>
@@ -254,7 +254,7 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture {
void testTrafficFilter() {
HTTPConnectProxiedConnection::ref testling(createTestling());
- boost::shared_ptr<ExampleHTTPTrafficFilter> httpTrafficFilter = boost::make_shared<ExampleHTTPTrafficFilter>();
+ std::shared_ptr<ExampleHTTPTrafficFilter> httpTrafficFilter = std::make_shared<ExampleHTTPTrafficFilter>();
testling->setHTTPTrafficFilter(httpTrafficFilter);
connect(testling, HostAddressPort(HostAddress("2.2.2.2"), 2345));
@@ -295,7 +295,7 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture {
void testTrafficFilterNoConnectionReuse() {
HTTPConnectProxiedConnection::ref testling = createTestling();
- boost::shared_ptr<ProxyAuthenticationHTTPTrafficFilter> httpTrafficFilter = boost::make_shared<ProxyAuthenticationHTTPTrafficFilter>();
+ std::shared_ptr<ProxyAuthenticationHTTPTrafficFilter> httpTrafficFilter = std::make_shared<ProxyAuthenticationHTTPTrafficFilter>();
testling->setHTTPTrafficFilter(httpTrafficFilter);
connect(testling, HostAddressPort(HostAddress("2.2.2.2"), 2345));
@@ -351,7 +351,7 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture {
private:
HTTPConnectProxiedConnection::ref createTestling() {
- boost::shared_ptr<HTTPConnectProxiedConnection> c = HTTPConnectProxiedConnection::create(resolver, connectionFactory, timerFactory, proxyHost, proxyPort, "", "");
+ std::shared_ptr<HTTPConnectProxiedConnection> c = HTTPConnectProxiedConnection::create(resolver, connectionFactory, timerFactory, proxyHost, proxyPort, "", "");
c->onConnectFinished.connect(boost::bind(&HTTPConnectProxiedConnectionTest::handleConnectFinished, this, _1));
c->onDisconnected.connect(boost::bind(&HTTPConnectProxiedConnectionTest::handleDisconnected, this, _1));
c->onDataRead.connect(boost::bind(&HTTPConnectProxiedConnectionTest::handleDataRead, this, _1));
@@ -368,7 +368,7 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture {
disconnectedError = e;
}
- void handleDataRead(boost::shared_ptr<SafeByteArray> d) {
+ void handleDataRead(std::shared_ptr<SafeByteArray> d) {
append(dataRead, *d);
}
@@ -408,15 +408,15 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture {
MockConnectionFactory(EventLoop* eventLoop) : eventLoop(eventLoop) {
}
- boost::shared_ptr<Connection> createConnection() {
- boost::shared_ptr<MockConnection> connection = boost::make_shared<MockConnection>(failingPorts, eventLoop);
+ std::shared_ptr<Connection> createConnection() {
+ std::shared_ptr<MockConnection> connection = std::make_shared<MockConnection>(failingPorts, eventLoop);
connections.push_back(connection);
SWIFT_LOG(debug) << "new connection created" << std::endl;
return connection;
}
EventLoop* eventLoop;
- std::vector< boost::shared_ptr<MockConnection> > connections;
+ std::vector< std::shared_ptr<MockConnection> > connections;
std::vector<HostAddressPort> failingPorts;
};
diff --git a/Swiften/Parser/BOSHBodyExtractor.cpp b/Swiften/Parser/BOSHBodyExtractor.cpp
index c5723be..c45d338 100644
--- a/Swiften/Parser/BOSHBodyExtractor.cpp
+++ b/Swiften/Parser/BOSHBodyExtractor.cpp
@@ -6,8 +6,9 @@
#include <Swiften/Parser/BOSHBodyExtractor.h>
+#include <memory>
+
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Parser/XMLParser.h>
#include <Swiften/Parser/XMLParserClient.h>
@@ -125,7 +126,7 @@ BOSHBodyExtractor::BOSHBodyExtractor(XMLParserFactory* parserFactory, const Byte
// Parse the body element
BOSHBodyParserClient parserClient(this);
- boost::shared_ptr<XMLParser> parser(parserFactory->createXMLParser(&parserClient));
+ std::shared_ptr<XMLParser> parser(parserFactory->createXMLParser(&parserClient));
if (!parser->parse(std::string(
reinterpret_cast<const char*>(vecptr(data)),
boost::numeric_cast<size_t>(std::distance(data.begin(), i))))) {
diff --git a/Swiften/Parser/ElementParser.h b/Swiften/Parser/ElementParser.h
index 12c6c38..71d4bce 100644
--- a/Swiften/Parser/ElementParser.h
+++ b/Swiften/Parser/ElementParser.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/ToplevelElement.h>
#include <Swiften/Parser/AttributeMap.h>
@@ -23,6 +22,6 @@ namespace Swift {
virtual void handleEndElement(const std::string& element, const std::string& ns) = 0;
virtual void handleCharacterData(const std::string& data) = 0;
- virtual boost::shared_ptr<ToplevelElement> getElement() const = 0;
+ virtual std::shared_ptr<ToplevelElement> getElement() const = 0;
};
}
diff --git a/Swiften/Parser/ExpatParser.h b/Swiften/Parser/ExpatParser.h
index 581847b..6580a7a 100644
--- a/Swiften/Parser/ExpatParser.h
+++ b/Swiften/Parser/ExpatParser.h
@@ -1,13 +1,14 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+
#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Parser/XMLParser.h>
@@ -24,6 +25,6 @@ namespace Swift {
private:
struct Private;
- boost::shared_ptr<Private> p;
+ std::shared_ptr<Private> p;
};
}
diff --git a/Swiften/Parser/GenericElementParser.h b/Swiften/Parser/GenericElementParser.h
index 7a0f989..5aa62c9 100644
--- a/Swiften/Parser/GenericElementParser.h
+++ b/Swiften/Parser/GenericElementParser.h
@@ -1,13 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Parser/ElementParser.h>
@@ -20,14 +19,14 @@ namespace Swift {
class SWIFTEN_API GenericElementParser : public ElementParser {
public:
GenericElementParser() {
- stanza_ = boost::make_shared<ElementType>();
+ stanza_ = std::make_shared<ElementType>();
}
- virtual boost::shared_ptr<ToplevelElement> getElement() const {
+ virtual std::shared_ptr<ToplevelElement> getElement() const {
return stanza_;
}
- virtual boost::shared_ptr<ElementType> getElementGeneric() const {
+ virtual std::shared_ptr<ElementType> getElementGeneric() const {
return stanza_;
}
@@ -42,6 +41,6 @@ namespace Swift {
}
private:
- boost::shared_ptr<ElementType> stanza_;
+ std::shared_ptr<ElementType> stanza_;
};
}
diff --git a/Swiften/Parser/GenericPayloadParser.h b/Swiften/Parser/GenericPayloadParser.h
index be0172c..ea0a7bd 100644
--- a/Swiften/Parser/GenericPayloadParser.h
+++ b/Swiften/Parser/GenericPayloadParser.h
@@ -1,13 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Parser/PayloadParser.h>
@@ -26,18 +25,18 @@ namespace Swift {
class GenericPayloadParser : public PayloadParser {
public:
GenericPayloadParser() : PayloadParser() {
- payload_ = boost::make_shared<PAYLOAD_TYPE>();
+ payload_ = std::make_shared<PAYLOAD_TYPE>();
}
- virtual boost::shared_ptr<Payload> getPayload() const {
+ virtual std::shared_ptr<Payload> getPayload() const {
return payload_;
}
- virtual boost::shared_ptr<PAYLOAD_TYPE> getPayloadInternal() const {
+ virtual std::shared_ptr<PAYLOAD_TYPE> getPayloadInternal() const {
return payload_;
}
private:
- boost::shared_ptr<PAYLOAD_TYPE> payload_;
+ std::shared_ptr<PAYLOAD_TYPE> payload_;
};
}
diff --git a/Swiften/Parser/GenericPayloadTreeParser.h b/Swiften/Parser/GenericPayloadTreeParser.h
index 2a7e190..b4da1a9 100644
--- a/Swiften/Parser/GenericPayloadTreeParser.h
+++ b/Swiften/Parser/GenericPayloadTreeParser.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -7,9 +7,7 @@
#pragma once
#include <deque>
-
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Parser/GenericPayloadParser.h>
@@ -24,7 +22,7 @@ namespace Swift {
public:
virtual void handleStartElement(const std::string& element, const std::string& xmlns, const AttributeMap& attributes) {
if (!root_) {
- root_ = boost::make_shared<ParserElement>(element, xmlns, attributes);
+ root_ = std::make_shared<ParserElement>(element, xmlns, attributes);
elementStack_.push_back(root_);
}
else {
diff --git a/Swiften/Parser/GenericStanzaParser.h b/Swiften/Parser/GenericStanzaParser.h
index 7d16a0c..2686f2f 100644
--- a/Swiften/Parser/GenericStanzaParser.h
+++ b/Swiften/Parser/GenericStanzaParser.h
@@ -1,13 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Parser/StanzaParser.h>
@@ -21,18 +20,18 @@ namespace Swift {
public:
GenericStanzaParser(PayloadParserFactoryCollection* collection) :
StanzaParser(collection) {
- stanza_ = boost::make_shared<STANZA_TYPE>();
+ stanza_ = std::make_shared<STANZA_TYPE>();
}
- virtual boost::shared_ptr<ToplevelElement> getElement() const {
+ virtual std::shared_ptr<ToplevelElement> getElement() const {
return stanza_;
}
- virtual boost::shared_ptr<STANZA_TYPE> getStanzaGeneric() const {
+ virtual std::shared_ptr<STANZA_TYPE> getStanzaGeneric() const {
return stanza_;
}
private:
- boost::shared_ptr<STANZA_TYPE> stanza_;
+ std::shared_ptr<STANZA_TYPE> stanza_;
};
}
diff --git a/Swiften/Parser/LibXMLParser.h b/Swiften/Parser/LibXMLParser.h
index eb2a038..e63a628 100644
--- a/Swiften/Parser/LibXMLParser.h
+++ b/Swiften/Parser/LibXMLParser.h
@@ -6,8 +6,9 @@
#pragma once
+#include <memory>
+
#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Parser/XMLParser.h>
@@ -27,6 +28,6 @@ namespace Swift {
static bool initialized;
struct Private;
- boost::shared_ptr<Private> p;
+ std::shared_ptr<Private> p;
};
}
diff --git a/Swiften/Parser/PayloadParser.h b/Swiften/Parser/PayloadParser.h
index cb50061..a824922 100644
--- a/Swiften/Parser/PayloadParser.h
+++ b/Swiften/Parser/PayloadParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
@@ -45,6 +45,6 @@ namespace Swift {
/**
* Retrieve a pointer to the payload.
*/
- virtual boost::shared_ptr<Payload> getPayload() const = 0;
+ virtual std::shared_ptr<Payload> getPayload() const = 0;
};
}
diff --git a/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.cpp b/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.cpp
index d6fb6be..e4f8ab9 100644
--- a/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.cpp
+++ b/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -16,7 +16,7 @@ namespace Swift {
void CarbonsReceivedParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) {
if (level_ == PayloadLevel) {
if (element == "forwarded") {
- forwardedParser_ = boost::dynamic_pointer_cast<ForwardedParser>(boost::make_shared<ForwardedParser>(factories_));
+ forwardedParser_ = std::dynamic_pointer_cast<ForwardedParser>(std::make_shared<ForwardedParser>(factories_));
}
}
if (forwardedParser_) {
diff --git a/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.h b/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.h
index 666f20b..6cc1f43 100644
--- a/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.h
+++ b/Swiften/Parser/PayloadParsers/CarbonsReceivedParser.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -29,7 +29,7 @@ namespace Swift {
private:
PayloadParserFactoryCollection* factories_;
- boost::shared_ptr<ForwardedParser> forwardedParser_;
+ std::shared_ptr<ForwardedParser> forwardedParser_;
int level_;
};
}
diff --git a/Swiften/Parser/PayloadParsers/CarbonsSentParser.cpp b/Swiften/Parser/PayloadParsers/CarbonsSentParser.cpp
index e616211..f446042 100644
--- a/Swiften/Parser/PayloadParsers/CarbonsSentParser.cpp
+++ b/Swiften/Parser/PayloadParsers/CarbonsSentParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -16,7 +16,7 @@ namespace Swift {
void CarbonsSentParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) {
if (level_ == PayloadLevel) {
if (element == "forwarded") {
- forwardedParser_ = boost::dynamic_pointer_cast<ForwardedParser>(boost::make_shared<ForwardedParser>(factories_));
+ forwardedParser_ = std::dynamic_pointer_cast<ForwardedParser>(std::make_shared<ForwardedParser>(factories_));
}
}
if (forwardedParser_) {
diff --git a/Swiften/Parser/PayloadParsers/CarbonsSentParser.h b/Swiften/Parser/PayloadParsers/CarbonsSentParser.h
index 9faf62d..d4e12ba 100644
--- a/Swiften/Parser/PayloadParsers/CarbonsSentParser.h
+++ b/Swiften/Parser/PayloadParsers/CarbonsSentParser.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -29,7 +29,7 @@ namespace Swift {
private:
PayloadParserFactoryCollection* factories_;
- boost::shared_ptr<ForwardedParser> forwardedParser_;
+ std::shared_ptr<ForwardedParser> forwardedParser_;
int level_;
};
}
diff --git a/Swiften/Parser/PayloadParsers/CommandParser.cpp b/Swiften/Parser/PayloadParsers/CommandParser.cpp
index bdfeaec..cb6fc0a 100644
--- a/Swiften/Parser/PayloadParsers/CommandParser.cpp
+++ b/Swiften/Parser/PayloadParsers/CommandParser.cpp
@@ -89,7 +89,7 @@ void CommandParser::handleEndElement(const std::string& element, const std::stri
if (level_ == FormOrNoteOrActionsLevel) {
if (formParser_) {
- Form::ref form(boost::dynamic_pointer_cast<Form>(formParser_->getPayload()));
+ Form::ref form(std::dynamic_pointer_cast<Form>(formParser_->getPayload()));
assert(form);
getPayloadInternal()->setForm(form);
delete formParser_;
diff --git a/Swiften/Parser/PayloadParsers/ErrorParser.h b/Swiften/Parser/PayloadParsers/ErrorParser.h
index dd1aa95..10f5431 100644
--- a/Swiften/Parser/PayloadParsers/ErrorParser.h
+++ b/Swiften/Parser/PayloadParsers/ErrorParser.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -28,6 +28,6 @@ namespace Swift {
PayloadParserFactoryCollection* factories;
int level_;
std::string currentText_;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/FormParser.cpp b/Swiften/Parser/PayloadParsers/FormParser.cpp
index 3a2c880..4a0a26f 100644
--- a/Swiften/Parser/PayloadParsers/FormParser.cpp
+++ b/Swiften/Parser/PayloadParsers/FormParser.cpp
@@ -45,7 +45,7 @@ void FormParser::handleStartElement(const std::string& element, const std::strin
parsingItem_ = true;
}
else if (element == "page") {
- currentPage_ = boost::make_shared<FormPage>();
+ currentPage_ = std::make_shared<FormPage>();
currentPage_->setLabel(attributes.getAttribute("label"));
}
}
@@ -59,7 +59,7 @@ void FormParser::handleStartElement(const std::string& element, const std::strin
}
if (level_ >= PayloadLevel) {
if (element == "field") {
- currentField_ = boost::make_shared<FormField>();
+ currentField_ = std::make_shared<FormField>();
std::string type = attributes.getAttribute("type");
FormField::Type fieldType = FormField::UnknownType;
if (type == "boolean") {
@@ -102,13 +102,13 @@ void FormParser::handleStartElement(const std::string& element, const std::strin
}
if (level_ > PayloadLevel) {
if (element == "section") {
- currentSection_ = boost::make_shared<FormSection>();
+ currentSection_ = std::make_shared<FormSection>();
currentSection_->setLabel(attributes.getAttribute("label"));
sectionStack_.push_back(currentSection_);
currentSections_.push_back(currentSection_);
}
if (element == "reportedref") {
- currentReportedRef_ = boost::make_shared<FormReportedRef>();
+ currentReportedRef_ = std::make_shared<FormReportedRef>();
}
if (element == "fieldref") {
currentText_.clear();
@@ -121,7 +121,7 @@ void FormParser::handleStartElement(const std::string& element, const std::strin
}
if (element == "text") {
currentText_.clear();
- currentTextElement_ = boost::make_shared<FormText>();
+ currentTextElement_ = std::make_shared<FormText>();
}
}
++level_;
@@ -191,14 +191,14 @@ void FormParser::handleEndElement(const std::string& element, const std::string&
}
else {
if (currentPages_.size() > 0) {
- foreach (boost::shared_ptr<FormPage> page, currentPages_) {
+ foreach (std::shared_ptr<FormPage> page, currentPages_) {
foreach (std::string pageRef, page->getFieldRefs()) {
if (pageRef == currentField_->getName()) {
page->addField(currentField_);
}
}
}
- foreach (boost::shared_ptr<FormSection> section, currentSections_) {
+ foreach (std::shared_ptr<FormSection> section, currentSections_) {
foreach (std::string sectionRef, section->getFieldRefs()) {
if (sectionRef == currentField_->getName()) {
section->addField(currentField_);
diff --git a/Swiften/Parser/PayloadParsers/FormParser.h b/Swiften/Parser/PayloadParsers/FormParser.h
index 81032ee..e1491b1 100644
--- a/Swiften/Parser/PayloadParsers/FormParser.h
+++ b/Swiften/Parser/PayloadParsers/FormParser.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -39,8 +39,8 @@ namespace Swift {
FormReportedRef::ref currentReportedRef_;
FormPage::page currentPage_;
FormSection::section currentSection_;
- std::vector<boost::shared_ptr<FormPage> > currentPages_;
- std::vector<boost::shared_ptr<FormSection> > sectionStack_;
- std::vector<boost::shared_ptr<FormSection> > currentSections_;
+ std::vector<std::shared_ptr<FormPage> > currentPages_;
+ std::vector<std::shared_ptr<FormSection> > sectionStack_;
+ std::vector<std::shared_ptr<FormSection> > currentSections_;
};
}
diff --git a/Swiften/Parser/PayloadParsers/ForwardedParser.cpp b/Swiften/Parser/PayloadParsers/ForwardedParser.cpp
index 35d20a9..72a665a 100644
--- a/Swiften/Parser/PayloadParsers/ForwardedParser.cpp
+++ b/Swiften/Parser/PayloadParsers/ForwardedParser.cpp
@@ -25,13 +25,13 @@ ForwardedParser::ForwardedParser(PayloadParserFactoryCollection* factories) : fa
void ForwardedParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) {
if (level_ == PayloadLevel) {
if (element == "iq" && ns == "jabber:client") { /* begin parsing a nested stanza? */
- childParser_ = boost::dynamic_pointer_cast<StanzaParser>(boost::make_shared<IQParser>(factories_));
+ childParser_ = std::dynamic_pointer_cast<StanzaParser>(std::make_shared<IQParser>(factories_));
} else if (element == "message" && ns == "jabber:client") {
- childParser_ = boost::dynamic_pointer_cast<StanzaParser>(boost::make_shared<MessageParser>(factories_));
+ childParser_ = std::dynamic_pointer_cast<StanzaParser>(std::make_shared<MessageParser>(factories_));
} else if (element == "presence" && ns == "jabber:client") {
- childParser_ = boost::dynamic_pointer_cast<StanzaParser>(boost::make_shared<PresenceParser>(factories_));
+ childParser_ = std::dynamic_pointer_cast<StanzaParser>(std::make_shared<PresenceParser>(factories_));
} else if (element == "delay" && ns == "urn:xmpp:delay") { /* nested delay payload */
- delayParser_ = boost::make_shared<DelayParser>();
+ delayParser_ = std::make_shared<DelayParser>();
}
}
if (childParser_) { /* parsing a nested stanza? */
@@ -58,7 +58,7 @@ void ForwardedParser::handleEndElement(const std::string& element, const std::st
}
if (delayParser_ && level_ == PayloadLevel) {
/* done parsing nested delay payload */
- getPayloadInternal()->setDelay(boost::dynamic_pointer_cast<Delay>(delayParser_->getPayload()));
+ getPayloadInternal()->setDelay(std::dynamic_pointer_cast<Delay>(delayParser_->getPayload()));
delayParser_.reset();
}
}
diff --git a/Swiften/Parser/PayloadParsers/ForwardedParser.h b/Swiften/Parser/PayloadParsers/ForwardedParser.h
index 70eecdf..f91fda5 100644
--- a/Swiften/Parser/PayloadParsers/ForwardedParser.h
+++ b/Swiften/Parser/PayloadParsers/ForwardedParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -33,8 +33,8 @@ namespace Swift {
private:
PayloadParserFactoryCollection* factories_;
- boost::shared_ptr<StanzaParser> childParser_;
- boost::shared_ptr<DelayParser> delayParser_;
+ std::shared_ptr<StanzaParser> childParser_;
+ std::shared_ptr<DelayParser> delayParser_;
int level_;
};
}
diff --git a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp
index d59d9a0..a231397 100644
--- a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp
+++ b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp
@@ -89,87 +89,85 @@
#include <Swiften/Parser/PayloadParsers/VCardUpdateParser.h>
#include <Swiften/Parser/PayloadParsers/WhiteboardParser.h>
-using namespace boost;
-
namespace Swift {
FullPayloadParserFactoryCollection::FullPayloadParserFactoryCollection() {
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<IBBParser> >("", "http://jabber.org/protocol/ibb"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<StatusShowParser> >("show"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<StatusParser> >("status"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<ReplaceParser> >("replace", "http://swift.im/protocol/replace"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<ReplaceParser> >("replace", "urn:xmpp:message-correct:0"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<LastParser> >("query", "jabber:iq:last"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<BodyParser> >("body"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<SubjectParser> >("subject"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<ThreadParser> >("thread"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<PriorityParser> >("priority"));
- factories_.push_back(boost::make_shared<ErrorParserFactory>(this));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<DelayParser> >("delay", "urn:xmpp:delay"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<SoftwareVersionParser> >("query", "jabber:iq:version"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<StorageParser> >("storage", "storage:bookmarks"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<RosterItemExchangeParser> >("x", "http://jabber.org/protocol/rosterx"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<RosterParser> >("query", "jabber:iq:roster"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<DiscoInfoParser> >("query", "http://jabber.org/protocol/disco#info"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<DiscoItemsParser> >("query", "http://jabber.org/protocol/disco#items"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<CapsInfoParser> >("c", "http://jabber.org/protocol/caps"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<ResourceBindParser> >("bind", "urn:ietf:params:xml:ns:xmpp-bind"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<StartSessionParser> >("session", "urn:ietf:params:xml:ns:xmpp-session"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<BlockParser<BlockPayload> > >("block", "urn:xmpp:blocking"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<BlockParser<BlockListPayload> > >("blocklist", "urn:xmpp:blocking"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<BlockParser<UnblockPayload> > >("unblock", "urn:xmpp:blocking"));
- factories_.push_back(boost::make_shared<SecurityLabelParserFactory>());
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<SecurityLabelsCatalogParser> >("catalog", "urn:xmpp:sec-label:catalog:2"));
- factories_.push_back(boost::make_shared<FormParserFactory>());
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<CommandParser> >("command", "http://jabber.org/protocol/commands"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<InBandRegistrationPayloadParser> >("query", "jabber:iq:register"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<SearchPayloadParser> >("query", "jabber:iq:search"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<StreamInitiationParser> >("si", "http://jabber.org/protocol/si"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<BytestreamsParser> >("query", "http://jabber.org/protocol/bytestreams"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<VCardUpdateParser> >("x", "vcard-temp:x:update"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<VCardParser> >("vCard", "vcard-temp"));
- factories_.push_back(boost::make_shared<PrivateStorageParserFactory>(this));
- factories_.push_back(boost::make_shared<ChatStateParserFactory>());
- factories_.push_back(boost::make_shared<MUCUserPayloadParserFactory>(this));
- factories_.push_back(boost::make_shared<MUCOwnerPayloadParserFactory>(this));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<MUCInvitationPayloadParser> >("x", "jabber:x:conference"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<MUCAdminPayloadParser> >("query", "http://jabber.org/protocol/muc#admin"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<MUCDestroyPayloadParser> >("destroy", "http://jabber.org/protocol/muc#user"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<MUCDestroyPayloadParser> >("destroy", "http://jabber.org/protocol/muc#owner"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<NicknameParser> >("nick", "http://jabber.org/protocol/nick"));
- factories_.push_back(boost::make_shared<JingleParserFactory>(this));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<JingleReasonParser> >("reason", "urn:xmpp:jingle:1"));
- factories_.push_back(boost::make_shared<JingleContentPayloadParserFactory>(this));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<JingleIBBTransportMethodPayloadParser> >("transport", "urn:xmpp:jingle:transports:ibb:1"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<JingleS5BTransportMethodPayloadParser> >("transport", "urn:xmpp:jingle:transports:s5b:1"));
- factories_.push_back(boost::make_shared<JingleFileTransferDescriptionParserFactory>(this));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<StreamInitiationFileInfoParser> >("file", "http://jabber.org/protocol/si/profile/file-transfer"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<JingleFileTransferFileInfoParser> >("file", "urn:xmpp:jingle:apps:file-transfer:4"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<JingleFileTransferHashParser> >("checksum"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<S5BProxyRequestParser> >("query", "http://jabber.org/protocol/bytestreams"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<WhiteboardParser> >("wb", "http://swift.im/whiteboard"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<UserLocationParser> >("geoloc", "http://jabber.org/protocol/geoloc"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<UserTuneParser> >("tune", "http://jabber.org/protocol/tune"));
- factories_.push_back(boost::make_shared<DeliveryReceiptParserFactory>());
- factories_.push_back(boost::make_shared<DeliveryReceiptRequestParserFactory>());
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<IdleParser> >("idle", "urn:xmpp:idle:1"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory2<PubSubParser> >("pubsub", "http://jabber.org/protocol/pubsub", this));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory2<PubSubOwnerPubSubParser> >("pubsub", "http://jabber.org/protocol/pubsub#owner", this));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory2<PubSubEventParser> >("event", "http://jabber.org/protocol/pubsub#event", this));
- factories_.push_back(boost::make_shared<PubSubErrorParserFactory>());
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<ResultSetParser> >("set", "http://jabber.org/protocol/rsm"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory2<ForwardedParser> >("forwarded", "urn:xmpp:forward:0", this));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory2<MAMResultParser> >("result", "urn:xmpp:mam:0", this));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<MAMQueryParser> >("query", "urn:xmpp:mam:0"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<MAMFinParser> >("fin", "urn:xmpp:mam:0"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory2<IsodeIQDelegationParser> >("delegate", "http://isode.com/iq_delegation", this));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<CarbonsEnableParser> >("enable", "urn:xmpp:carbons:2"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<CarbonsDisableParser> >("disable", "urn:xmpp:carbons:2"));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory2<CarbonsReceivedParser> >("received", "urn:xmpp:carbons:2", this));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory2<CarbonsSentParser> >("sent", "urn:xmpp:carbons:2", this));
- factories_.push_back(boost::make_shared<GenericPayloadParserFactory<CarbonsPrivateParser> >("private", "urn:xmpp:carbons:2"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<IBBParser> >("", "http://jabber.org/protocol/ibb"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<StatusShowParser> >("show"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<StatusParser> >("status"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<ReplaceParser> >("replace", "http://swift.im/protocol/replace"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<ReplaceParser> >("replace", "urn:xmpp:message-correct:0"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<LastParser> >("query", "jabber:iq:last"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<BodyParser> >("body"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<SubjectParser> >("subject"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<ThreadParser> >("thread"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<PriorityParser> >("priority"));
+ factories_.push_back(std::make_shared<ErrorParserFactory>(this));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<DelayParser> >("delay", "urn:xmpp:delay"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<SoftwareVersionParser> >("query", "jabber:iq:version"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<StorageParser> >("storage", "storage:bookmarks"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<RosterItemExchangeParser> >("x", "http://jabber.org/protocol/rosterx"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<RosterParser> >("query", "jabber:iq:roster"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<DiscoInfoParser> >("query", "http://jabber.org/protocol/disco#info"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<DiscoItemsParser> >("query", "http://jabber.org/protocol/disco#items"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<CapsInfoParser> >("c", "http://jabber.org/protocol/caps"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<ResourceBindParser> >("bind", "urn:ietf:params:xml:ns:xmpp-bind"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<StartSessionParser> >("session", "urn:ietf:params:xml:ns:xmpp-session"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<BlockParser<BlockPayload> > >("block", "urn:xmpp:blocking"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<BlockParser<BlockListPayload> > >("blocklist", "urn:xmpp:blocking"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<BlockParser<UnblockPayload> > >("unblock", "urn:xmpp:blocking"));
+ factories_.push_back(std::make_shared<SecurityLabelParserFactory>());
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<SecurityLabelsCatalogParser> >("catalog", "urn:xmpp:sec-label:catalog:2"));
+ factories_.push_back(std::make_shared<FormParserFactory>());
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<CommandParser> >("command", "http://jabber.org/protocol/commands"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<InBandRegistrationPayloadParser> >("query", "jabber:iq:register"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<SearchPayloadParser> >("query", "jabber:iq:search"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<StreamInitiationParser> >("si", "http://jabber.org/protocol/si"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<BytestreamsParser> >("query", "http://jabber.org/protocol/bytestreams"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<VCardUpdateParser> >("x", "vcard-temp:x:update"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<VCardParser> >("vCard", "vcard-temp"));
+ factories_.push_back(std::make_shared<PrivateStorageParserFactory>(this));
+ factories_.push_back(std::make_shared<ChatStateParserFactory>());
+ factories_.push_back(std::make_shared<MUCUserPayloadParserFactory>(this));
+ factories_.push_back(std::make_shared<MUCOwnerPayloadParserFactory>(this));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<MUCInvitationPayloadParser> >("x", "jabber:x:conference"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<MUCAdminPayloadParser> >("query", "http://jabber.org/protocol/muc#admin"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<MUCDestroyPayloadParser> >("destroy", "http://jabber.org/protocol/muc#user"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<MUCDestroyPayloadParser> >("destroy", "http://jabber.org/protocol/muc#owner"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<NicknameParser> >("nick", "http://jabber.org/protocol/nick"));
+ factories_.push_back(std::make_shared<JingleParserFactory>(this));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<JingleReasonParser> >("reason", "urn:xmpp:jingle:1"));
+ factories_.push_back(std::make_shared<JingleContentPayloadParserFactory>(this));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<JingleIBBTransportMethodPayloadParser> >("transport", "urn:xmpp:jingle:transports:ibb:1"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<JingleS5BTransportMethodPayloadParser> >("transport", "urn:xmpp:jingle:transports:s5b:1"));
+ factories_.push_back(std::make_shared<JingleFileTransferDescriptionParserFactory>(this));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<StreamInitiationFileInfoParser> >("file", "http://jabber.org/protocol/si/profile/file-transfer"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<JingleFileTransferFileInfoParser> >("file", "urn:xmpp:jingle:apps:file-transfer:4"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<JingleFileTransferHashParser> >("checksum"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<S5BProxyRequestParser> >("query", "http://jabber.org/protocol/bytestreams"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<WhiteboardParser> >("wb", "http://swift.im/whiteboard"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<UserLocationParser> >("geoloc", "http://jabber.org/protocol/geoloc"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<UserTuneParser> >("tune", "http://jabber.org/protocol/tune"));
+ factories_.push_back(std::make_shared<DeliveryReceiptParserFactory>());
+ factories_.push_back(std::make_shared<DeliveryReceiptRequestParserFactory>());
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<IdleParser> >("idle", "urn:xmpp:idle:1"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory2<PubSubParser> >("pubsub", "http://jabber.org/protocol/pubsub", this));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory2<PubSubOwnerPubSubParser> >("pubsub", "http://jabber.org/protocol/pubsub#owner", this));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory2<PubSubEventParser> >("event", "http://jabber.org/protocol/pubsub#event", this));
+ factories_.push_back(std::make_shared<PubSubErrorParserFactory>());
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<ResultSetParser> >("set", "http://jabber.org/protocol/rsm"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory2<ForwardedParser> >("forwarded", "urn:xmpp:forward:0", this));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory2<MAMResultParser> >("result", "urn:xmpp:mam:0", this));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<MAMQueryParser> >("query", "urn:xmpp:mam:0"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<MAMFinParser> >("fin", "urn:xmpp:mam:0"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory2<IsodeIQDelegationParser> >("delegate", "http://isode.com/iq_delegation", this));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<CarbonsEnableParser> >("enable", "urn:xmpp:carbons:2"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<CarbonsDisableParser> >("disable", "urn:xmpp:carbons:2"));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory2<CarbonsReceivedParser> >("received", "urn:xmpp:carbons:2", this));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory2<CarbonsSentParser> >("sent", "urn:xmpp:carbons:2", this));
+ factories_.push_back(std::make_shared<GenericPayloadParserFactory<CarbonsPrivateParser> >("private", "urn:xmpp:carbons:2"));
- foreach(shared_ptr<PayloadParserFactory> factory, factories_) {
+ foreach(std::shared_ptr<PayloadParserFactory> factory, factories_) {
addFactory(factory.get());
}
defaultFactory_ = new RawXMLPayloadParserFactory();
@@ -179,7 +177,7 @@ FullPayloadParserFactoryCollection::FullPayloadParserFactoryCollection() {
FullPayloadParserFactoryCollection::~FullPayloadParserFactoryCollection() {
setDefaultFactory(nullptr);
delete defaultFactory_;
- foreach(shared_ptr<PayloadParserFactory> factory, factories_) {
+ foreach(std::shared_ptr<PayloadParserFactory> factory, factories_) {
removeFactory(factory.get());
}
}
diff --git a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h
index 210e85e..e59a6e0 100644
--- a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h
+++ b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Parser/PayloadParserFactory.h>
#include <Swiften/Parser/PayloadParserFactoryCollection.h>
@@ -21,7 +20,7 @@ namespace Swift {
~FullPayloadParserFactoryCollection();
private:
- std::vector< boost::shared_ptr<PayloadParserFactory> > factories_;
+ std::vector< std::shared_ptr<PayloadParserFactory> > factories_;
PayloadParserFactory* defaultFactory_;
};
}
diff --git a/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp b/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp
index 6bdd517..ddcd425 100644
--- a/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp
+++ b/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -46,7 +46,7 @@ void IsodeIQDelegationParser::handleEndElement(const std::string& element, const
}
if (level == 1) {
- getPayloadInternal()->setForward(boost::dynamic_pointer_cast<Forwarded>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->setForward(std::dynamic_pointer_cast<Forwarded>(currentPayloadParser->getPayload()));
currentPayloadParser.reset();
}
}
diff --git a/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.h b/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.h
index cf86a1a..eaedd27 100644
--- a/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.h
+++ b/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.cpp b/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.cpp
index 30404f3..3a01676 100644
--- a/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.cpp
+++ b/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.cpp
@@ -59,12 +59,12 @@ namespace Swift {
}
if (level == 1) {
- boost::shared_ptr<JingleTransportPayload> transport = boost::dynamic_pointer_cast<JingleTransportPayload>(currentPayloadParser->getPayload());
+ std::shared_ptr<JingleTransportPayload> transport = std::dynamic_pointer_cast<JingleTransportPayload>(currentPayloadParser->getPayload());
if (transport) {
getPayloadInternal()->addTransport(transport);
}
- boost::shared_ptr<JingleDescription> description = boost::dynamic_pointer_cast<JingleDescription>(currentPayloadParser->getPayload());
+ std::shared_ptr<JingleDescription> description = std::dynamic_pointer_cast<JingleDescription>(currentPayloadParser->getPayload());
if (description) {
getPayloadInternal()->addDescription(description);
}
diff --git a/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.h b/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.h
index eaa8ff6..fde07cb 100644
--- a/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.h
+++ b/Swiften/Parser/PayloadParsers/JingleContentPayloadParser.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -31,7 +31,7 @@ class SWIFTEN_API JingleContentPayloadParser : public GenericPayloadParser<Jingl
private:
PayloadParserFactoryCollection* factories;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.cpp b/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.cpp
index 32a6e4c..1e433a6 100644
--- a/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.cpp
+++ b/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.cpp
@@ -46,7 +46,7 @@ void JingleFileTransferDescriptionParser::handleEndElement(const std::string& el
}
if (level == 0) {
- boost::shared_ptr<JingleFileTransferFileInfo> info = boost::dynamic_pointer_cast<JingleFileTransferFileInfo>(currentPayloadParser->getPayload());
+ std::shared_ptr<JingleFileTransferFileInfo> info = std::dynamic_pointer_cast<JingleFileTransferFileInfo>(currentPayloadParser->getPayload());
if (info) {
getPayloadInternal()->setFileInfo(*info);
}
diff --git a/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.h b/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.h
index c7f80e1..b148d9b 100644
--- a/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.h
+++ b/Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2014-2015 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -32,7 +32,7 @@ class SWIFTEN_API JingleFileTransferDescriptionParser : public GenericPayloadPar
private:
PayloadParserFactoryCollection* factories;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.cpp b/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.cpp
index a890a99..4adf3bd 100644
--- a/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.cpp
+++ b/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.cpp
@@ -12,8 +12,9 @@
#include <Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.h>
+#include <memory>
+
#include <boost/algorithm/string.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Parser/GenericPayloadParserFactory.h>
#include <Swiften/Parser/PayloadParserFactory.h>
@@ -26,7 +27,7 @@ JingleFileTransferHashParser::JingleFileTransferHashParser() : level(0) {
void JingleFileTransferHashParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) {
if (level == 1 && element == "file") {
- currentPayloadParser = boost::make_shared<JingleFileTransferFileInfoParser>();
+ currentPayloadParser = std::make_shared<JingleFileTransferFileInfoParser>();
}
if (level >= 1 && currentPayloadParser) {
@@ -42,7 +43,7 @@ void JingleFileTransferHashParser::handleEndElement(const std::string& element,
}
if (level == 1) {
- boost::shared_ptr<JingleFileTransferFileInfo> info = boost::dynamic_pointer_cast<JingleFileTransferFileInfo>(currentPayloadParser->getPayload());
+ std::shared_ptr<JingleFileTransferFileInfo> info = std::dynamic_pointer_cast<JingleFileTransferFileInfo>(currentPayloadParser->getPayload());
if (info) {
getPayloadInternal()->setFileInfo(*info);
}
diff --git a/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.h b/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.h
index 8a28d5a..1b47921 100644
--- a/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.h
+++ b/Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2014-2015 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -28,7 +28,7 @@ public:
private:
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/JingleParser.cpp b/Swiften/Parser/PayloadParsers/JingleParser.cpp
index 48507af..a88a5b2 100644
--- a/Swiften/Parser/PayloadParsers/JingleParser.cpp
+++ b/Swiften/Parser/PayloadParsers/JingleParser.cpp
@@ -57,17 +57,17 @@ namespace Swift {
}
if (level == 1) {
- boost::shared_ptr<JinglePayload::Reason> reason = boost::dynamic_pointer_cast<JinglePayload::Reason>(currentPayloadParser->getPayload());
+ std::shared_ptr<JinglePayload::Reason> reason = std::dynamic_pointer_cast<JinglePayload::Reason>(currentPayloadParser->getPayload());
if (reason) {
getPayloadInternal()->setReason(*reason);
}
- boost::shared_ptr<JingleContentPayload> payload = boost::dynamic_pointer_cast<JingleContentPayload>(currentPayloadParser->getPayload());
+ std::shared_ptr<JingleContentPayload> payload = std::dynamic_pointer_cast<JingleContentPayload>(currentPayloadParser->getPayload());
if (payload) {
getPayloadInternal()->addContent(payload);
}
- boost::shared_ptr<JingleFileTransferHash> hash = boost::dynamic_pointer_cast<JingleFileTransferHash>(currentPayloadParser->getPayload());
+ std::shared_ptr<JingleFileTransferHash> hash = std::dynamic_pointer_cast<JingleFileTransferHash>(currentPayloadParser->getPayload());
if (hash) {
getPayloadInternal()->addPayload(hash);
}
diff --git a/Swiften/Parser/PayloadParsers/JingleParser.h b/Swiften/Parser/PayloadParsers/JingleParser.h
index 28850e2..1dcc9e7 100644
--- a/Swiften/Parser/PayloadParsers/JingleParser.h
+++ b/Swiften/Parser/PayloadParsers/JingleParser.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -33,7 +33,7 @@ class SWIFTEN_API JingleParser : public GenericPayloadParser<JinglePayload> {
private:
PayloadParserFactoryCollection* factories;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/MAMFinParser.cpp b/Swiften/Parser/PayloadParsers/MAMFinParser.cpp
index a29a7c4..88dd571 100644
--- a/Swiften/Parser/PayloadParsers/MAMFinParser.cpp
+++ b/Swiften/Parser/PayloadParsers/MAMFinParser.cpp
@@ -30,7 +30,7 @@ void MAMFinParser::handleStartElement(const std::string& element, const std::str
}
else if (level_ == PayloadLevel) {
if (element == "set" && ns == "http://jabber.org/protocol/rsm") {
- resultSetParser_ = boost::make_shared<ResultSetParser>();
+ resultSetParser_ = std::make_shared<ResultSetParser>();
}
}
@@ -49,7 +49,7 @@ void MAMFinParser::handleEndElement(const std::string& element, const std::strin
}
if (resultSetParser_ && level_ == PayloadLevel) {
/* done parsing nested ResultSet */
- getPayloadInternal()->setResultSet(boost::dynamic_pointer_cast<ResultSet>(resultSetParser_->getPayload()));
+ getPayloadInternal()->setResultSet(std::dynamic_pointer_cast<ResultSet>(resultSetParser_->getPayload()));
resultSetParser_.reset();
}
}
diff --git a/Swiften/Parser/PayloadParsers/MAMFinParser.h b/Swiften/Parser/PayloadParsers/MAMFinParser.h
index 2e805ad..f08231e 100644
--- a/Swiften/Parser/PayloadParsers/MAMFinParser.h
+++ b/Swiften/Parser/PayloadParsers/MAMFinParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -30,7 +30,7 @@ namespace Swift {
};
private:
- boost::shared_ptr<ResultSetParser> resultSetParser_;
+ std::shared_ptr<ResultSetParser> resultSetParser_;
int level_;
};
}
diff --git a/Swiften/Parser/PayloadParsers/MAMQueryParser.cpp b/Swiften/Parser/PayloadParsers/MAMQueryParser.cpp
index 41fbbb7..4919d22 100644
--- a/Swiften/Parser/PayloadParsers/MAMQueryParser.cpp
+++ b/Swiften/Parser/PayloadParsers/MAMQueryParser.cpp
@@ -29,9 +29,9 @@ void MAMQueryParser::handleStartElement(const std::string& element, const std::s
}
} else if (level_ == PayloadLevel) {
if (element == "x" && ns == "jabber:x:data") {
- formParser_ = boost::make_shared<FormParser>();
+ formParser_ = std::make_shared<FormParser>();
} else if (element == "set" && ns == "http://jabber.org/protocol/rsm") {
- resultSetParser_ = boost::make_shared<ResultSetParser>();
+ resultSetParser_ = std::make_shared<ResultSetParser>();
}
}
@@ -54,7 +54,7 @@ void MAMQueryParser::handleEndElement(const std::string& element, const std::str
}
if (formParser_ && level_ == PayloadLevel) {
/* done parsing nested Form */
- getPayloadInternal()->setForm(boost::dynamic_pointer_cast<Form>(formParser_->getPayload()));
+ getPayloadInternal()->setForm(std::dynamic_pointer_cast<Form>(formParser_->getPayload()));
formParser_.reset();
}
@@ -63,7 +63,7 @@ void MAMQueryParser::handleEndElement(const std::string& element, const std::str
}
if (resultSetParser_ && level_ == PayloadLevel) {
/* done parsing nested ResultSet */
- getPayloadInternal()->setResultSet(boost::dynamic_pointer_cast<ResultSet>(resultSetParser_->getPayload()));
+ getPayloadInternal()->setResultSet(std::dynamic_pointer_cast<ResultSet>(resultSetParser_->getPayload()));
resultSetParser_.reset();
}
}
diff --git a/Swiften/Parser/PayloadParsers/MAMQueryParser.h b/Swiften/Parser/PayloadParsers/MAMQueryParser.h
index 4f5bd47..7e4b58a 100644
--- a/Swiften/Parser/PayloadParsers/MAMQueryParser.h
+++ b/Swiften/Parser/PayloadParsers/MAMQueryParser.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/MAMQuery.h>
@@ -33,8 +32,8 @@ namespace Swift {
};
private:
- boost::shared_ptr<FormParser> formParser_;
- boost::shared_ptr<ResultSetParser> resultSetParser_;
+ std::shared_ptr<FormParser> formParser_;
+ std::shared_ptr<ResultSetParser> resultSetParser_;
int level_;
};
}
diff --git a/Swiften/Parser/PayloadParsers/MAMResultParser.cpp b/Swiften/Parser/PayloadParsers/MAMResultParser.cpp
index e39ed94..b810b87 100644
--- a/Swiften/Parser/PayloadParsers/MAMResultParser.cpp
+++ b/Swiften/Parser/PayloadParsers/MAMResultParser.cpp
@@ -28,7 +28,7 @@ void MAMResultParser::handleStartElement(const std::string& element, const std::
}
} else if (level_ == PayloadLevel) {
if (element == "forwarded" && ns == "urn:xmpp:forward:0") {
- payloadParser_ = boost::make_shared<ForwardedParser>(factories_);
+ payloadParser_ = std::make_shared<ForwardedParser>(factories_);
}
}
@@ -47,7 +47,7 @@ void MAMResultParser::handleEndElement(const std::string& element, const std::st
}
if (payloadParser_ && level_ == PayloadLevel) {
/* done parsing nested stanza */
- getPayloadInternal()->setPayload(boost::dynamic_pointer_cast<Forwarded>(payloadParser_->getPayload()));
+ getPayloadInternal()->setPayload(std::dynamic_pointer_cast<Forwarded>(payloadParser_->getPayload()));
payloadParser_.reset();
}
}
diff --git a/Swiften/Parser/PayloadParsers/MAMResultParser.h b/Swiften/Parser/PayloadParsers/MAMResultParser.h
index 5177f8b..e68e365 100644
--- a/Swiften/Parser/PayloadParsers/MAMResultParser.h
+++ b/Swiften/Parser/PayloadParsers/MAMResultParser.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/MAMResult.h>
@@ -33,7 +32,7 @@ namespace Swift {
};
private:
- boost::shared_ptr<ForwardedParser> payloadParser_;
+ std::shared_ptr<ForwardedParser> payloadParser_;
PayloadParserFactoryCollection* factories_;
int level_;
};
diff --git a/Swiften/Parser/PayloadParsers/MUCInvitationPayloadParser.cpp b/Swiften/Parser/PayloadParsers/MUCInvitationPayloadParser.cpp
index 20e5f2b..14d6d16 100644
--- a/Swiften/Parser/PayloadParsers/MUCInvitationPayloadParser.cpp
+++ b/Swiften/Parser/PayloadParsers/MUCInvitationPayloadParser.cpp
@@ -18,7 +18,7 @@ void MUCInvitationPayloadParser::handleTree(ParserElement::ref root) {
invite->setReason(root->getAttributes().getAttribute("reason"));
invite->setThread(root->getAttributes().getAttribute("thread"));
ParserElement::ref impromptuNode = root->getChild("impromptu", "http://swift.im/impromptu");
- invite->setIsImpromptu(!boost::dynamic_pointer_cast<NullParserElement>(impromptuNode));
+ invite->setIsImpromptu(!std::dynamic_pointer_cast<NullParserElement>(impromptuNode));
}
}
diff --git a/Swiften/Parser/PayloadParsers/MUCOwnerPayloadParser.h b/Swiften/Parser/PayloadParsers/MUCOwnerPayloadParser.h
index 6502512..4c1f048 100644
--- a/Swiften/Parser/PayloadParsers/MUCOwnerPayloadParser.h
+++ b/Swiften/Parser/PayloadParsers/MUCOwnerPayloadParser.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -27,6 +27,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* factories;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PrivateStorageParser.h b/Swiften/Parser/PayloadParsers/PrivateStorageParser.h
index 761a019..c1d695c 100644
--- a/Swiften/Parser/PayloadParsers/PrivateStorageParser.h
+++ b/Swiften/Parser/PayloadParsers/PrivateStorageParser.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -27,6 +27,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* factories;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubAffiliationParser.h b/Swiften/Parser/PayloadParsers/PubSubAffiliationParser.h
index 1d3f4fd..6c38f37 100644
--- a/Swiften/Parser/PayloadParsers/PubSubAffiliationParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubAffiliationParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.cpp b/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.cpp
index 8a11553..9c44f31 100644
--- a/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -32,7 +32,7 @@ void PubSubAffiliationsParser::handleStartElement(const std::string& element, co
if (level == 1) {
if (element == "affiliation" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubAffiliationParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubAffiliationParser>(parsers);
}
}
@@ -51,7 +51,7 @@ void PubSubAffiliationsParser::handleEndElement(const std::string& element, cons
if (level == 1) {
if (element == "affiliation" && ns == "http://jabber.org/protocol/pubsub") {
- getPayloadInternal()->addAffiliation(boost::dynamic_pointer_cast<PubSubAffiliation>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->addAffiliation(std::dynamic_pointer_cast<PubSubAffiliation>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.h b/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.h
index a26942f..2f80dbd 100644
--- a/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubAffiliationsParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubConfigureParser.cpp b/Swiften/Parser/PayloadParsers/PubSubConfigureParser.cpp
index f3af12f..0abfe0b 100644
--- a/Swiften/Parser/PayloadParsers/PubSubConfigureParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubConfigureParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -28,7 +28,7 @@ void PubSubConfigureParser::handleStartElement(const std::string& element, const
if (level == 1) {
if (element == "x" && ns == "jabber:x:data") {
- currentPayloadParser = boost::make_shared<FormParser>();
+ currentPayloadParser = std::make_shared<FormParser>();
}
}
@@ -47,7 +47,7 @@ void PubSubConfigureParser::handleEndElement(const std::string& element, const s
if (level == 1) {
if (element == "x" && ns == "jabber:x:data") {
- getPayloadInternal()->setData(boost::dynamic_pointer_cast<Form>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->setData(std::dynamic_pointer_cast<Form>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubConfigureParser.h b/Swiften/Parser/PayloadParsers/PubSubConfigureParser.h
index 33a3da5..16f1cd9 100644
--- a/Swiften/Parser/PayloadParsers/PubSubConfigureParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubConfigureParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubCreateParser.h b/Swiften/Parser/PayloadParsers/PubSubCreateParser.h
index 3f277ed..fa1f98c 100644
--- a/Swiften/Parser/PayloadParsers/PubSubCreateParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubCreateParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubDefaultParser.h b/Swiften/Parser/PayloadParsers/PubSubDefaultParser.h
index b0f0e25..e4d4834 100644
--- a/Swiften/Parser/PayloadParsers/PubSubDefaultParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubDefaultParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubErrorParser.h b/Swiften/Parser/PayloadParsers/PubSubErrorParser.h
index 749fb1a..adc36e9 100644
--- a/Swiften/Parser/PayloadParsers/PubSubErrorParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubErrorParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventAssociateParser.h b/Swiften/Parser/PayloadParsers/PubSubEventAssociateParser.h
index c2cc9f6..5e1fc45 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventAssociateParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubEventAssociateParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.cpp b/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.cpp
index bb167e3..bfa9cf5 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -33,10 +33,10 @@ void PubSubEventCollectionParser::handleStartElement(const std::string& element,
if (level == 1) {
if (element == "disassociate" && ns == "http://jabber.org/protocol/pubsub#event") {
- currentPayloadParser = boost::make_shared<PubSubEventDisassociateParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubEventDisassociateParser>(parsers);
}
if (element == "associate" && ns == "http://jabber.org/protocol/pubsub#event") {
- currentPayloadParser = boost::make_shared<PubSubEventAssociateParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubEventAssociateParser>(parsers);
}
}
@@ -55,10 +55,10 @@ void PubSubEventCollectionParser::handleEndElement(const std::string& element, c
if (level == 1) {
if (element == "disassociate" && ns == "http://jabber.org/protocol/pubsub#event") {
- getPayloadInternal()->setDisassociate(boost::dynamic_pointer_cast<PubSubEventDisassociate>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->setDisassociate(std::dynamic_pointer_cast<PubSubEventDisassociate>(currentPayloadParser->getPayload()));
}
if (element == "associate" && ns == "http://jabber.org/protocol/pubsub#event") {
- getPayloadInternal()->setAssociate(boost::dynamic_pointer_cast<PubSubEventAssociate>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->setAssociate(std::dynamic_pointer_cast<PubSubEventAssociate>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.h b/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.h
index a2b1663..ffdafcf 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubEventCollectionParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.cpp b/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.cpp
index d118ab8..73112da 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -32,7 +32,7 @@ void PubSubEventConfigurationParser::handleStartElement(const std::string& eleme
if (level == 1) {
if (element == "x" && ns == "jabber:x:data") {
- currentPayloadParser = boost::make_shared<FormParser>();
+ currentPayloadParser = std::make_shared<FormParser>();
}
}
@@ -51,7 +51,7 @@ void PubSubEventConfigurationParser::handleEndElement(const std::string& element
if (level == 1) {
if (element == "x" && ns == "jabber:x:data") {
- getPayloadInternal()->setData(boost::dynamic_pointer_cast<Form>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->setData(std::dynamic_pointer_cast<Form>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.h b/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.h
index e3fcab6..a79ee07 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubEventConfigurationParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.cpp b/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.cpp
index 167a682..da308db 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -32,7 +32,7 @@ void PubSubEventDeleteParser::handleStartElement(const std::string& element, con
if (level == 1) {
if (element == "redirect" && ns == "http://jabber.org/protocol/pubsub#event") {
- currentPayloadParser = boost::make_shared<PubSubEventRedirectParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubEventRedirectParser>(parsers);
}
}
@@ -51,7 +51,7 @@ void PubSubEventDeleteParser::handleEndElement(const std::string& element, const
if (level == 1) {
if (element == "redirect" && ns == "http://jabber.org/protocol/pubsub#event") {
- getPayloadInternal()->setRedirects(boost::dynamic_pointer_cast<PubSubEventRedirect>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->setRedirects(std::dynamic_pointer_cast<PubSubEventRedirect>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.h b/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.h
index 24d6b6b..270430e 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubEventDeleteParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventDisassociateParser.h b/Swiften/Parser/PayloadParsers/PubSubEventDisassociateParser.h
index 6835602..9088359 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventDisassociateParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubEventDisassociateParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventItemParser.h b/Swiften/Parser/PayloadParsers/PubSubEventItemParser.h
index 4b34a26..bd2e72e 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventItemParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubEventItemParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.cpp b/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.cpp
index 90d3fe8..0264275 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -33,10 +33,10 @@ void PubSubEventItemsParser::handleStartElement(const std::string& element, cons
if (level == 1) {
if (element == "item" && ns == "http://jabber.org/protocol/pubsub#event") {
- currentPayloadParser = boost::make_shared<PubSubEventItemParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubEventItemParser>(parsers);
}
if (element == "retract" && ns == "http://jabber.org/protocol/pubsub#event") {
- currentPayloadParser = boost::make_shared<PubSubEventRetractParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubEventRetractParser>(parsers);
}
}
@@ -55,10 +55,10 @@ void PubSubEventItemsParser::handleEndElement(const std::string& element, const
if (level == 1) {
if (element == "item" && ns == "http://jabber.org/protocol/pubsub#event") {
- getPayloadInternal()->addItem(boost::dynamic_pointer_cast<PubSubEventItem>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->addItem(std::dynamic_pointer_cast<PubSubEventItem>(currentPayloadParser->getPayload()));
}
if (element == "retract" && ns == "http://jabber.org/protocol/pubsub#event") {
- getPayloadInternal()->addRetract(boost::dynamic_pointer_cast<PubSubEventRetract>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->addRetract(std::dynamic_pointer_cast<PubSubEventRetract>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.h b/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.h
index 6cb0148..34b3669 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubEventItemsParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventParser.cpp b/Swiften/Parser/PayloadParsers/PubSubEventParser.cpp
index ae0439c..7677369 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubEventParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -33,22 +33,22 @@ void PubSubEventParser::handleStartElement(const std::string& element, const std
if (level == 1) {
if (element == "items" && ns == "http://jabber.org/protocol/pubsub#event") {
- currentPayloadParser = boost::make_shared<PubSubEventItemsParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubEventItemsParser>(parsers);
}
if (element == "collection" && ns == "http://jabber.org/protocol/pubsub#event") {
- currentPayloadParser = boost::make_shared<PubSubEventCollectionParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubEventCollectionParser>(parsers);
}
if (element == "purge" && ns == "http://jabber.org/protocol/pubsub#event") {
- currentPayloadParser = boost::make_shared<PubSubEventPurgeParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubEventPurgeParser>(parsers);
}
if (element == "configuration" && ns == "http://jabber.org/protocol/pubsub#event") {
- currentPayloadParser = boost::make_shared<PubSubEventConfigurationParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubEventConfigurationParser>(parsers);
}
if (element == "delete" && ns == "http://jabber.org/protocol/pubsub#event") {
- currentPayloadParser = boost::make_shared<PubSubEventDeleteParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubEventDeleteParser>(parsers);
}
if (element == "subscription" && ns == "http://jabber.org/protocol/pubsub#event") {
- currentPayloadParser = boost::make_shared<PubSubEventSubscriptionParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubEventSubscriptionParser>(parsers);
}
}
@@ -67,7 +67,7 @@ void PubSubEventParser::handleEndElement(const std::string& element, const std::
if (level == 1) {
if (currentPayloadParser) {
- getPayloadInternal()->setPayload(boost::dynamic_pointer_cast<PubSubEventPayload>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->setPayload(std::dynamic_pointer_cast<PubSubEventPayload>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventParser.h b/Swiften/Parser/PayloadParsers/PubSubEventParser.h
index a4fc5a6..3b231b0 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubEventParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventPurgeParser.h b/Swiften/Parser/PayloadParsers/PubSubEventPurgeParser.h
index 7afc754..e1b1d05 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventPurgeParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubEventPurgeParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventRedirectParser.h b/Swiften/Parser/PayloadParsers/PubSubEventRedirectParser.h
index ecdeca5..63f0f98 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventRedirectParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubEventRedirectParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventRetractParser.h b/Swiften/Parser/PayloadParsers/PubSubEventRetractParser.h
index 8bc6a9c..eacaac2 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventRetractParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubEventRetractParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubEventSubscriptionParser.h b/Swiften/Parser/PayloadParsers/PubSubEventSubscriptionParser.h
index b43e64a..b1d065a 100644
--- a/Swiften/Parser/PayloadParsers/PubSubEventSubscriptionParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubEventSubscriptionParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubItemParser.h b/Swiften/Parser/PayloadParsers/PubSubItemParser.h
index 39d24bc..c6e4ccf 100644
--- a/Swiften/Parser/PayloadParsers/PubSubItemParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubItemParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubItemsParser.cpp b/Swiften/Parser/PayloadParsers/PubSubItemsParser.cpp
index 643eb85..7cbeb70 100644
--- a/Swiften/Parser/PayloadParsers/PubSubItemsParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubItemsParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -42,7 +42,7 @@ void PubSubItemsParser::handleStartElement(const std::string& element, const std
if (level == 1) {
if (element == "item" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubItemParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubItemParser>(parsers);
}
}
@@ -61,7 +61,7 @@ void PubSubItemsParser::handleEndElement(const std::string& element, const std::
if (level == 1) {
if (element == "item" && ns == "http://jabber.org/protocol/pubsub") {
- getPayloadInternal()->addItem(boost::dynamic_pointer_cast<PubSubItem>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->addItem(std::dynamic_pointer_cast<PubSubItem>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubItemsParser.h b/Swiften/Parser/PayloadParsers/PubSubItemsParser.h
index 84c8f79..ad6e746 100644
--- a/Swiften/Parser/PayloadParsers/PubSubItemsParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubItemsParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOptionsParser.cpp b/Swiften/Parser/PayloadParsers/PubSubOptionsParser.cpp
index 2683ae6..04d11a1 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOptionsParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubOptionsParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -40,7 +40,7 @@ void PubSubOptionsParser::handleStartElement(const std::string& element, const s
if (level == 1) {
if (element == "x" && ns == "jabber:x:data") {
- currentPayloadParser = boost::make_shared<FormParser>();
+ currentPayloadParser = std::make_shared<FormParser>();
}
}
@@ -59,7 +59,7 @@ void PubSubOptionsParser::handleEndElement(const std::string& element, const std
if (level == 1) {
if (element == "x" && ns == "jabber:x:data") {
- getPayloadInternal()->setData(boost::dynamic_pointer_cast<Form>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->setData(std::dynamic_pointer_cast<Form>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOptionsParser.h b/Swiften/Parser/PayloadParsers/PubSubOptionsParser.h
index 52d374c..b4ee87a 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOptionsParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubOptionsParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationParser.h
index 972930c..8b74106 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.cpp b/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.cpp
index 247bf4c..265c404 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -32,7 +32,7 @@ void PubSubOwnerAffiliationsParser::handleStartElement(const std::string& elemen
if (level == 1) {
if (element == "affiliation" && ns == "http://jabber.org/protocol/pubsub#owner") {
- currentPayloadParser = boost::make_shared<PubSubOwnerAffiliationParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubOwnerAffiliationParser>(parsers);
}
}
@@ -51,7 +51,7 @@ void PubSubOwnerAffiliationsParser::handleEndElement(const std::string& element,
if (level == 1) {
if (element == "affiliation" && ns == "http://jabber.org/protocol/pubsub#owner") {
- getPayloadInternal()->addAffiliation(boost::dynamic_pointer_cast<PubSubOwnerAffiliation>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->addAffiliation(std::dynamic_pointer_cast<PubSubOwnerAffiliation>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.h
index 870d809..52c7fa9 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerAffiliationsParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.cpp b/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.cpp
index 62dd1ac..ce9ccff 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -32,7 +32,7 @@ void PubSubOwnerConfigureParser::handleStartElement(const std::string& element,
if (level == 1) {
if (element == "x" && ns == "jabber:x:data") {
- currentPayloadParser = boost::make_shared<FormParser>();
+ currentPayloadParser = std::make_shared<FormParser>();
}
}
@@ -51,7 +51,7 @@ void PubSubOwnerConfigureParser::handleEndElement(const std::string& element, co
if (level == 1) {
if (element == "x" && ns == "jabber:x:data") {
- getPayloadInternal()->setData(boost::dynamic_pointer_cast<Form>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->setData(std::dynamic_pointer_cast<Form>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.h
index 914a309..e23e257 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerConfigureParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.cpp b/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.cpp
index 36ccbaf..e65aa2a 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -28,7 +28,7 @@ void PubSubOwnerDefaultParser::handleStartElement(const std::string& element, co
if (level == 1) {
if (element == "x" && ns == "jabber:x:data") {
- currentPayloadParser = boost::make_shared<FormParser>();
+ currentPayloadParser = std::make_shared<FormParser>();
}
}
@@ -47,7 +47,7 @@ void PubSubOwnerDefaultParser::handleEndElement(const std::string& element, cons
if (level == 1) {
if (element == "x" && ns == "jabber:x:data") {
- getPayloadInternal()->setData(boost::dynamic_pointer_cast<Form>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->setData(std::dynamic_pointer_cast<Form>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.h
index 3106854..82e4825 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerDefaultParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.cpp b/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.cpp
index 047fe8b..0051ee7 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -32,7 +32,7 @@ void PubSubOwnerDeleteParser::handleStartElement(const std::string& element, con
if (level == 1) {
if (element == "redirect" && ns == "http://jabber.org/protocol/pubsub#owner") {
- currentPayloadParser = boost::make_shared<PubSubOwnerRedirectParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubOwnerRedirectParser>(parsers);
}
}
@@ -51,7 +51,7 @@ void PubSubOwnerDeleteParser::handleEndElement(const std::string& element, const
if (level == 1) {
if (element == "redirect" && ns == "http://jabber.org/protocol/pubsub#owner") {
- getPayloadInternal()->setRedirect(boost::dynamic_pointer_cast<PubSubOwnerRedirect>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->setRedirect(std::dynamic_pointer_cast<PubSubOwnerRedirect>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.h
index f56ae3c..99a8c0e 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerDeleteParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.cpp b/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.cpp
index aa7310e..ca73b00 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -33,22 +33,22 @@ void PubSubOwnerPubSubParser::handleStartElement(const std::string& element, con
if (level == 1) {
if (element == "configure" && ns == "http://jabber.org/protocol/pubsub#owner") {
- currentPayloadParser = boost::make_shared<PubSubOwnerConfigureParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubOwnerConfigureParser>(parsers);
}
if (element == "subscriptions" && ns == "http://jabber.org/protocol/pubsub#owner") {
- currentPayloadParser = boost::make_shared<PubSubOwnerSubscriptionsParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubOwnerSubscriptionsParser>(parsers);
}
if (element == "default" && ns == "http://jabber.org/protocol/pubsub#owner") {
- currentPayloadParser = boost::make_shared<PubSubOwnerDefaultParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubOwnerDefaultParser>(parsers);
}
if (element == "purge" && ns == "http://jabber.org/protocol/pubsub#owner") {
- currentPayloadParser = boost::make_shared<PubSubOwnerPurgeParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubOwnerPurgeParser>(parsers);
}
if (element == "affiliations" && ns == "http://jabber.org/protocol/pubsub#owner") {
- currentPayloadParser = boost::make_shared<PubSubOwnerAffiliationsParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubOwnerAffiliationsParser>(parsers);
}
if (element == "delete" && ns == "http://jabber.org/protocol/pubsub#owner") {
- currentPayloadParser = boost::make_shared<PubSubOwnerDeleteParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubOwnerDeleteParser>(parsers);
}
}
@@ -67,7 +67,7 @@ void PubSubOwnerPubSubParser::handleEndElement(const std::string& element, const
if (level == 1) {
if (currentPayloadParser) {
- getPayloadInternal()->setPayload(boost::dynamic_pointer_cast<PubSubOwnerPayload>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->setPayload(std::dynamic_pointer_cast<PubSubOwnerPayload>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.h
index d4d67f9..35420f7 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerPubSubParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerPurgeParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerPurgeParser.h
index 364de29..044ac04 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerPurgeParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerPurgeParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerRedirectParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerRedirectParser.h
index fd48dbb..5714d46 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerRedirectParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerRedirectParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionParser.h
index 46df820..48e2786 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.cpp b/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.cpp
index e08d782..da82600 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -32,7 +32,7 @@ void PubSubOwnerSubscriptionsParser::handleStartElement(const std::string& eleme
if (level == 1) {
if (element == "subscription" && ns == "http://jabber.org/protocol/pubsub#owner") {
- currentPayloadParser = boost::make_shared<PubSubOwnerSubscriptionParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubOwnerSubscriptionParser>(parsers);
}
}
@@ -51,7 +51,7 @@ void PubSubOwnerSubscriptionsParser::handleEndElement(const std::string& element
if (level == 1) {
if (element == "subscription" && ns == "http://jabber.org/protocol/pubsub#owner") {
- getPayloadInternal()->addSubscription(boost::dynamic_pointer_cast<PubSubOwnerSubscription>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->addSubscription(std::dynamic_pointer_cast<PubSubOwnerSubscription>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.h b/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.h
index 10c11e4..541d225 100644
--- a/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubOwnerSubscriptionsParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubParser.cpp b/Swiften/Parser/PayloadParsers/PubSubParser.cpp
index 9c86c21..b527d4c 100644
--- a/Swiften/Parser/PayloadParsers/PubSubParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -38,40 +38,40 @@ PubSubParser::~PubSubParser() {
void PubSubParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) {
if (level == 1) {
if (element == "items" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubItemsParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubItemsParser>(parsers);
}
if (element == "create" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubCreateParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubCreateParser>(parsers);
}
if (element == "publish" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubPublishParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubPublishParser>(parsers);
}
if (element == "affiliations" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubAffiliationsParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubAffiliationsParser>(parsers);
}
if (element == "retract" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubRetractParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubRetractParser>(parsers);
}
if (element == "options" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubOptionsParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubOptionsParser>(parsers);
}
if (element == "configure" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubConfigureParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubConfigureParser>(parsers);
}
if (element == "default" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubDefaultParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubDefaultParser>(parsers);
}
if (element == "subscriptions" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubSubscriptionsParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubSubscriptionsParser>(parsers);
}
if (element == "subscribe" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubSubscribeParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubSubscribeParser>(parsers);
}
if (element == "unsubscribe" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubUnsubscribeParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubUnsubscribeParser>(parsers);
}
if (element == "subscription" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubSubscriptionParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubSubscriptionParser>(parsers);
}
}
@@ -91,25 +91,25 @@ void PubSubParser::handleEndElement(const std::string& element, const std::strin
if (level == 1) {
if (currentPayloadParser) {
if (element == "options" && ns == "http://jabber.org/protocol/pubsub") {
- optionsPayload = boost::dynamic_pointer_cast<PubSubOptions>(currentPayloadParser->getPayload());
+ optionsPayload = std::dynamic_pointer_cast<PubSubOptions>(currentPayloadParser->getPayload());
}
else if (element == "configure" && ns == "http://jabber.org/protocol/pubsub") {
- configurePayload = boost::dynamic_pointer_cast<PubSubConfigure>(currentPayloadParser->getPayload());
+ configurePayload = std::dynamic_pointer_cast<PubSubConfigure>(currentPayloadParser->getPayload());
}
else {
- getPayloadInternal()->setPayload(boost::dynamic_pointer_cast<PubSubPayload>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->setPayload(std::dynamic_pointer_cast<PubSubPayload>(currentPayloadParser->getPayload()));
}
}
currentPayloadParser.reset();
}
if (level == 0) {
- if (boost::shared_ptr<PubSubCreate> create = boost::dynamic_pointer_cast<PubSubCreate>(getPayloadInternal()->getPayload())) {
+ if (std::shared_ptr<PubSubCreate> create = std::dynamic_pointer_cast<PubSubCreate>(getPayloadInternal()->getPayload())) {
if (configurePayload) {
create->setConfigure(configurePayload);
}
}
- if (boost::shared_ptr<PubSubSubscribe> subscribe = boost::dynamic_pointer_cast<PubSubSubscribe>(getPayloadInternal()->getPayload())) {
+ if (std::shared_ptr<PubSubSubscribe> subscribe = std::dynamic_pointer_cast<PubSubSubscribe>(getPayloadInternal()->getPayload())) {
if (optionsPayload) {
subscribe->setOptions(optionsPayload);
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubParser.h b/Swiften/Parser/PayloadParsers/PubSubParser.h
index a8043fc..1f40ca9 100644
--- a/Swiften/Parser/PayloadParsers/PubSubParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -31,8 +31,8 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
- boost::shared_ptr<PubSubConfigure> configurePayload;
- boost::shared_ptr<PubSubOptions> optionsPayload;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PubSubConfigure> configurePayload;
+ std::shared_ptr<PubSubOptions> optionsPayload;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubPublishParser.cpp b/Swiften/Parser/PayloadParsers/PubSubPublishParser.cpp
index 3bd3ac0..3fd2951 100644
--- a/Swiften/Parser/PayloadParsers/PubSubPublishParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubPublishParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -32,7 +32,7 @@ void PubSubPublishParser::handleStartElement(const std::string& element, const s
if (level == 1) {
if (element == "item" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubItemParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubItemParser>(parsers);
}
}
@@ -51,7 +51,7 @@ void PubSubPublishParser::handleEndElement(const std::string& element, const std
if (level == 1) {
if (element == "item" && ns == "http://jabber.org/protocol/pubsub") {
- getPayloadInternal()->addItem(boost::dynamic_pointer_cast<PubSubItem>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->addItem(std::dynamic_pointer_cast<PubSubItem>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubPublishParser.h b/Swiften/Parser/PayloadParsers/PubSubPublishParser.h
index 1df7c6f..ad7dd11 100644
--- a/Swiften/Parser/PayloadParsers/PubSubPublishParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubPublishParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubRetractParser.cpp b/Swiften/Parser/PayloadParsers/PubSubRetractParser.cpp
index e710fad..b011b76 100644
--- a/Swiften/Parser/PayloadParsers/PubSubRetractParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubRetractParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -35,7 +35,7 @@ void PubSubRetractParser::handleStartElement(const std::string& element, const s
if (level == 1) {
if (element == "item" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubItemParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubItemParser>(parsers);
}
}
@@ -54,7 +54,7 @@ void PubSubRetractParser::handleEndElement(const std::string& element, const std
if (level == 1) {
if (element == "item" && ns == "http://jabber.org/protocol/pubsub") {
- getPayloadInternal()->addItem(boost::dynamic_pointer_cast<PubSubItem>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->addItem(std::dynamic_pointer_cast<PubSubItem>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubRetractParser.h b/Swiften/Parser/PayloadParsers/PubSubRetractParser.h
index ece2a52..6bea498 100644
--- a/Swiften/Parser/PayloadParsers/PubSubRetractParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubRetractParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubSubscribeOptionsParser.h b/Swiften/Parser/PayloadParsers/PubSubSubscribeOptionsParser.h
index 9136f44..4e995dd 100644
--- a/Swiften/Parser/PayloadParsers/PubSubSubscribeOptionsParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubSubscribeOptionsParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubSubscribeParser.h b/Swiften/Parser/PayloadParsers/PubSubSubscribeParser.h
index 823c086..2b1788f 100644
--- a/Swiften/Parser/PayloadParsers/PubSubSubscribeParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubSubscribeParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.cpp b/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.cpp
index 5954bf1..4ce83cc 100644
--- a/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -46,7 +46,7 @@ void PubSubSubscriptionParser::handleStartElement(const std::string& element, co
if (level == 1) {
if (element == "subscribe-options" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubSubscribeOptionsParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubSubscribeOptionsParser>(parsers);
}
}
@@ -65,7 +65,7 @@ void PubSubSubscriptionParser::handleEndElement(const std::string& element, cons
if (level == 1) {
if (element == "subscribe-options" && ns == "http://jabber.org/protocol/pubsub") {
- getPayloadInternal()->setOptions(boost::dynamic_pointer_cast<PubSubSubscribeOptions>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->setOptions(std::dynamic_pointer_cast<PubSubSubscribeOptions>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.h b/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.h
index 771a74a..7075a99 100644
--- a/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubSubscriptionParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.cpp b/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.cpp
index 30198a5..3badaa2 100644
--- a/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -32,7 +32,7 @@ void PubSubSubscriptionsParser::handleStartElement(const std::string& element, c
if (level == 1) {
if (element == "subscription" && ns == "http://jabber.org/protocol/pubsub") {
- currentPayloadParser = boost::make_shared<PubSubSubscriptionParser>(parsers);
+ currentPayloadParser = std::make_shared<PubSubSubscriptionParser>(parsers);
}
}
@@ -51,7 +51,7 @@ void PubSubSubscriptionsParser::handleEndElement(const std::string& element, con
if (level == 1) {
if (element == "subscription" && ns == "http://jabber.org/protocol/pubsub") {
- getPayloadInternal()->addSubscription(boost::dynamic_pointer_cast<PubSubSubscription>(currentPayloadParser->getPayload()));
+ getPayloadInternal()->addSubscription(std::dynamic_pointer_cast<PubSubSubscription>(currentPayloadParser->getPayload()));
}
currentPayloadParser.reset();
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.h b/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.h
index 9f18376..2371a56 100644
--- a/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubSubscriptionsParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/PubSubUnsubscribeParser.h b/Swiften/Parser/PayloadParsers/PubSubUnsubscribeParser.h
index d33d33c..d63dd70 100644
--- a/Swiften/Parser/PayloadParsers/PubSubUnsubscribeParser.h
+++ b/Swiften/Parser/PayloadParsers/PubSubUnsubscribeParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -29,6 +29,6 @@ namespace Swift {
private:
PayloadParserFactoryCollection* parsers;
int level;
- boost::shared_ptr<PayloadParser> currentPayloadParser;
+ std::shared_ptr<PayloadParser> currentPayloadParser;
};
}
diff --git a/Swiften/Parser/PayloadParsers/ResultSetParser.h b/Swiften/Parser/PayloadParsers/ResultSetParser.h
index 335a798..aa18ae6 100644
--- a/Swiften/Parser/PayloadParsers/ResultSetParser.h
+++ b/Swiften/Parser/PayloadParsers/ResultSetParser.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp b/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp
index b3a8c67..3dd5811 100644
--- a/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp
+++ b/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp
@@ -63,7 +63,7 @@ void SecurityLabelParser::handleCharacterData(const std::string& data) {
}
}
-boost::shared_ptr<SecurityLabel> SecurityLabelParser::getLabelPayload() const {
+std::shared_ptr<SecurityLabel> SecurityLabelParser::getLabelPayload() const {
return getPayloadInternal();
}
diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelParser.h b/Swiften/Parser/PayloadParsers/SecurityLabelParser.h
index d5b0466..cc444a4 100644
--- a/Swiften/Parser/PayloadParsers/SecurityLabelParser.h
+++ b/Swiften/Parser/PayloadParsers/SecurityLabelParser.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -20,7 +20,7 @@ namespace Swift {
virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes);
virtual void handleEndElement(const std::string& element, const std::string&);
virtual void handleCharacterData(const std::string& data);
- boost::shared_ptr<SecurityLabel> getLabelPayload() const;
+ std::shared_ptr<SecurityLabel> getLabelPayload() const;
private:
enum Level {
TopLevel = 0,
diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp
index 024d587..0de7544 100644
--- a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp
+++ b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp
@@ -6,7 +6,7 @@
#include <Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Parser/PayloadParsers/SecurityLabelParser.h>
#include <Swiften/Parser/PayloadParsers/SecurityLabelParserFactory.h>
@@ -29,7 +29,7 @@ void SecurityLabelsCatalogParser::handleStartElement(const std::string& element,
getPayloadInternal()->setDescription(attributes.getAttribute("desc"));
}
else if (level_ == ItemLevel && element == "item" && ns == "urn:xmpp:sec-label:catalog:2") {
- currentItem_ = boost::make_shared<SecurityLabelsCatalog::Item>();
+ currentItem_ = std::make_shared<SecurityLabelsCatalog::Item>();
currentItem_->setSelector(attributes.getAttribute("selector"));
currentItem_->setIsDefault(attributes.getBoolAttribute("default", false));
}
@@ -51,7 +51,7 @@ void SecurityLabelsCatalogParser::handleEndElement(const std::string& element, c
labelParser_->handleEndElement(element, ns);
}
if (level_ == LabelLevel && labelParser_ && currentItem_) {
- boost::shared_ptr<SecurityLabel> currentLabel = labelParser_->getLabelPayload();
+ std::shared_ptr<SecurityLabel> currentLabel = labelParser_->getLabelPayload();
assert(currentLabel);
currentItem_->setLabel(currentLabel);
delete labelParser_;
diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h
index bb44369..edfa86b 100644
--- a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h
+++ b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -33,6 +33,6 @@ namespace Swift {
int level_;
SecurityLabelParserFactory* labelParserFactory_;
SecurityLabelParser* labelParser_;
- boost::shared_ptr<SecurityLabelsCatalog::Item> currentItem_;
+ std::shared_ptr<SecurityLabelsCatalog::Item> currentItem_;
};
}
diff --git a/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp b/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp
index 12dace9..ca6f644 100644
--- a/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp
+++ b/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp
@@ -88,7 +88,7 @@ void StreamInitiationParser::handleEndElement(const std::string& element, const
else if (formParser) {
Form::ref form = formParser->getPayloadInternal();
if (form) {
- FormField::ref field = boost::dynamic_pointer_cast<FormField>(form->getField("stream-method"));
+ FormField::ref field = std::dynamic_pointer_cast<FormField>(form->getField("stream-method"));
if (field) {
if (form->getType() == Form::FormType) {
foreach (const FormField::Option& option, field->getOptions()) {
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/CarbonsParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/CarbonsParserTest.cpp
index f85efb2..b5b9995 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/CarbonsParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/CarbonsParserTest.cpp
@@ -73,14 +73,14 @@ class CarbonsParserTest : public CppUnit::TestFixture {
CarbonsReceived::ref received = parser.getPayload<CarbonsReceived>();
CPPUNIT_ASSERT(received);
- boost::shared_ptr<Forwarded> forwarded = received->getForwarded();
+ std::shared_ptr<Forwarded> forwarded = received->getForwarded();
CPPUNIT_ASSERT(forwarded);
- boost::shared_ptr<Message> message = boost::dynamic_pointer_cast<Message>(forwarded->getStanza());
+ std::shared_ptr<Message> message = std::dynamic_pointer_cast<Message>(forwarded->getStanza());
CPPUNIT_ASSERT(message);
CPPUNIT_ASSERT_EQUAL(JID("juliet@capulet.example/balcony"), message->getFrom());
- boost::shared_ptr<Thread> thread = message->getPayload<Thread>();
+ std::shared_ptr<Thread> thread = message->getPayload<Thread>();
CPPUNIT_ASSERT(thread);
CPPUNIT_ASSERT_EQUAL(std::string("0e3141cd80894871a68e6fe6b1ec56fa"), thread->getText());
}
@@ -105,10 +105,10 @@ class CarbonsParserTest : public CppUnit::TestFixture {
CarbonsSent::ref sent = parser.getPayload<CarbonsSent>();
CPPUNIT_ASSERT(sent);
- boost::shared_ptr<Forwarded> forwarded = sent->getForwarded();
+ std::shared_ptr<Forwarded> forwarded = sent->getForwarded();
CPPUNIT_ASSERT(forwarded);
- boost::shared_ptr<Message> message = boost::dynamic_pointer_cast<Message>(forwarded->getStanza());
+ std::shared_ptr<Message> message = std::dynamic_pointer_cast<Message>(forwarded->getStanza());
CPPUNIT_ASSERT(message);
CPPUNIT_ASSERT_EQUAL(JID("juliet@capulet.example/balcony"), message->getTo());
}
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/DeliveryReceiptParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/DeliveryReceiptParserTest.cpp
index d18e1b4..d93fd1f 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/DeliveryReceiptParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/DeliveryReceiptParserTest.cpp
@@ -4,6 +4,12 @@
* See http://www.opensource.org/licenses/bsd-license.php for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -25,7 +31,7 @@ class DeliveryReceiptParserTest : public CppUnit::TestFixture {
PayloadsParserTester parser;
CPPUNIT_ASSERT(parser.parse("<request xmlns='urn:xmpp:receipts'/>"));
- DeliveryReceiptRequest::ref request = boost::dynamic_pointer_cast<DeliveryReceiptRequest>(parser.getPayload());
+ DeliveryReceiptRequest::ref request = std::dynamic_pointer_cast<DeliveryReceiptRequest>(parser.getPayload());
CPPUNIT_ASSERT(request);
}
@@ -34,7 +40,7 @@ class DeliveryReceiptParserTest : public CppUnit::TestFixture {
PayloadsParserTester parser;
CPPUNIT_ASSERT(parser.parse("<received xmlns='urn:xmpp:receipts' id='richard2-4.1.247'/>"));
- DeliveryReceipt::ref receipt = boost::dynamic_pointer_cast<DeliveryReceipt>(parser.getPayload());
+ DeliveryReceipt::ref receipt = std::dynamic_pointer_cast<DeliveryReceipt>(parser.getPayload());
CPPUNIT_ASSERT_EQUAL(std::string("richard2-4.1.247"), receipt->getReceivedID());
}
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp
index c23b1d0..6e866fc 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -32,7 +32,7 @@ class DiscoInfoParserTest : public CppUnit::TestFixture {
"<feature var=\"baz-feature\"/>"
"</query>"));
- DiscoInfo::ref payload = boost::dynamic_pointer_cast<DiscoInfo>(parser.getPayload());
+ DiscoInfo::ref payload = std::dynamic_pointer_cast<DiscoInfo>(parser.getPayload());
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(payload->getIdentities().size()));
CPPUNIT_ASSERT_EQUAL(std::string("Swift"), payload->getIdentities()[0].getName());
CPPUNIT_ASSERT_EQUAL(std::string("pc"), payload->getIdentities()[0].getType());
@@ -61,7 +61,7 @@ class DiscoInfoParserTest : public CppUnit::TestFixture {
"<feature var=\"baz-feature\"/>"
"</query>"));
- DiscoInfo::ref payload = boost::dynamic_pointer_cast<DiscoInfo>(parser.getPayload());
+ DiscoInfo::ref payload = std::dynamic_pointer_cast<DiscoInfo>(parser.getPayload());
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(payload->getIdentities().size()));
CPPUNIT_ASSERT_EQUAL(std::string("Swift"), payload->getIdentities()[0].getName());
CPPUNIT_ASSERT_EQUAL(std::string("pc"), payload->getIdentities()[0].getType());
@@ -91,7 +91,7 @@ class DiscoInfoParserTest : public CppUnit::TestFixture {
"<feature var=\"bar-feature\"/>"
"</query>"));
- DiscoInfo::ref payload = boost::dynamic_pointer_cast<DiscoInfo>(parser.getPayload());
+ DiscoInfo::ref payload = std::dynamic_pointer_cast<DiscoInfo>(parser.getPayload());
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(payload->getExtensions().size()));
CPPUNIT_ASSERT_EQUAL(std::string("Bot Configuration"), payload->getExtensions()[0]->getTitle());
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(payload->getFeatures().size()));
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/DiscoItemsParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/DiscoItemsParserTest.cpp
index 01db978..977ef8e 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/DiscoItemsParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/DiscoItemsParserTest.cpp
@@ -4,6 +4,12 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -27,7 +33,7 @@ class DiscoItemsParserTest : public CppUnit::TestFixture {
"<item jid='responder@domain' node='config' name='Configure Service'/>"
"</query>"));
- boost::shared_ptr<DiscoItems> payload = boost::dynamic_pointer_cast<DiscoItems>(parser.getPayload());
+ std::shared_ptr<DiscoItems> payload = std::dynamic_pointer_cast<DiscoItems>(parser.getPayload());
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(payload->getItems().size()));
CPPUNIT_ASSERT_EQUAL(std::string("List Service Configurations"), payload->getItems()[0].getName());
CPPUNIT_ASSERT_EQUAL(std::string("list"), payload->getItems()[0].getNode());
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp
index 529d573..5402614 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp
@@ -29,7 +29,7 @@ class ErrorParserTest : public CppUnit::TestFixture {
"<text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">boo</text>"
"</error>"));
- ErrorPayload::ref payload = boost::dynamic_pointer_cast<ErrorPayload>(parser.getPayload());
+ ErrorPayload::ref payload = std::dynamic_pointer_cast<ErrorPayload>(parser.getPayload());
CPPUNIT_ASSERT_EQUAL(ErrorPayload::BadRequest, payload->getCondition());
CPPUNIT_ASSERT_EQUAL(ErrorPayload::Modify, payload->getType());
CPPUNIT_ASSERT_EQUAL(std::string("boo"), payload->getText());
@@ -46,11 +46,11 @@ class ErrorParserTest : public CppUnit::TestFixture {
"<text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">boo</text>"
"</error>"));
- ErrorPayload::ref payload = boost::dynamic_pointer_cast<ErrorPayload>(parser.getPayload());
+ ErrorPayload::ref payload = std::dynamic_pointer_cast<ErrorPayload>(parser.getPayload());
CPPUNIT_ASSERT_EQUAL(ErrorPayload::BadRequest, payload->getCondition());
CPPUNIT_ASSERT_EQUAL(ErrorPayload::Modify, payload->getType());
CPPUNIT_ASSERT_EQUAL(std::string("boo"), payload->getText());
- CPPUNIT_ASSERT(boost::dynamic_pointer_cast<Delay>(payload->getPayload()));
+ CPPUNIT_ASSERT(std::dynamic_pointer_cast<Delay>(payload->getPayload()));
}
};
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp
index 4ffc776..ace6bcb 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp
@@ -203,7 +203,7 @@ class FormParserTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(std::string("first"), item[0]->getName());
CPPUNIT_ASSERT_EQUAL(std::string("Montague"), item[1]->getValues()[0]);
CPPUNIT_ASSERT_EQUAL(std::string("last"), item[1]->getName());
- boost::shared_ptr<FormField> jidField = item[2];
+ std::shared_ptr<FormField> jidField = item[2];
CPPUNIT_ASSERT_EQUAL(JID("benvolio@montague.net"), jidField->getJIDSingleValue());
CPPUNIT_ASSERT_EQUAL(std::string("jid"), item[2]->getName());
CPPUNIT_ASSERT_EQUAL(std::string("male"), item[3]->getValues()[0]);
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ForwardedParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ForwardedParserTest.cpp
index 30af3ec..a807d4e 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/ForwardedParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/ForwardedParserTest.cpp
@@ -35,12 +35,12 @@ class ForwardedParserTest : public CppUnit::TestFixture
"<iq xmlns=\"jabber:client\" type=\"get\" from=\"kindanormal@example.com/IM\" to=\"stupidnewbie@example.com\" id=\"id0\"/>"
"</forwarded>"));
- boost::shared_ptr<Forwarded> payload = parser.getPayload<Forwarded>();
+ std::shared_ptr<Forwarded> payload = parser.getPayload<Forwarded>();
CPPUNIT_ASSERT(!!payload);
CPPUNIT_ASSERT(payload->getDelay());
CPPUNIT_ASSERT_EQUAL(std::string("2010-07-10T23:08:25Z"), dateTimeToString(payload->getDelay()->getStamp()));
- boost::shared_ptr<IQ> iq = boost::dynamic_pointer_cast<IQ>(payload->getStanza());
+ std::shared_ptr<IQ> iq = std::dynamic_pointer_cast<IQ>(payload->getStanza());
CPPUNIT_ASSERT(!!iq);
CPPUNIT_ASSERT_EQUAL(JID("stupidnewbie@example.com"), iq->getTo());
CPPUNIT_ASSERT_EQUAL(JID("kindanormal@example.com/IM"), iq->getFrom());
@@ -58,12 +58,12 @@ class ForwardedParserTest : public CppUnit::TestFixture
"</message>"
"</forwarded>"));
- boost::shared_ptr<Forwarded> payload = parser.getPayload<Forwarded>();
+ std::shared_ptr<Forwarded> payload = parser.getPayload<Forwarded>();
CPPUNIT_ASSERT(!!payload);
CPPUNIT_ASSERT(payload->getDelay());
CPPUNIT_ASSERT_EQUAL(std::string("2010-07-10T23:08:25Z"), dateTimeToString(payload->getDelay()->getStamp()));
- boost::shared_ptr<Message> message = boost::dynamic_pointer_cast<Message>(payload->getStanza());
+ std::shared_ptr<Message> message = std::dynamic_pointer_cast<Message>(payload->getStanza());
CPPUNIT_ASSERT(!!message);
const std::string expectedBody = "Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.";
CPPUNIT_ASSERT_EQUAL(expectedBody, message->getBody().get());
@@ -81,11 +81,11 @@ class ForwardedParserTest : public CppUnit::TestFixture
"</message>"
"</forwarded>"));
- boost::shared_ptr<Forwarded> payload = parser.getPayload<Forwarded>();
+ std::shared_ptr<Forwarded> payload = parser.getPayload<Forwarded>();
CPPUNIT_ASSERT(!!payload);
CPPUNIT_ASSERT(!payload->getDelay());
- boost::shared_ptr<Message> message = boost::dynamic_pointer_cast<Message>(payload->getStanza());
+ std::shared_ptr<Message> message = std::dynamic_pointer_cast<Message>(payload->getStanza());
CPPUNIT_ASSERT(!!message);
const std::string expectedBody = "Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.";
CPPUNIT_ASSERT_EQUAL(expectedBody, message->getBody().get());
@@ -102,12 +102,12 @@ class ForwardedParserTest : public CppUnit::TestFixture
"<presence xmlns=\"jabber:client\" from=\"alice@wonderland.lit/rabbithole\" to=\"madhatter@wonderland.lit\" type=\"unavailable\"/>"
"</forwarded>"));
- boost::shared_ptr<Forwarded> payload = parser.getPayload<Forwarded>();
+ std::shared_ptr<Forwarded> payload = parser.getPayload<Forwarded>();
CPPUNIT_ASSERT(!!payload);
CPPUNIT_ASSERT(payload->getDelay());
CPPUNIT_ASSERT_EQUAL(std::string("2010-07-10T23:08:25Z"), dateTimeToString(payload->getDelay()->getStamp()));
- boost::shared_ptr<Presence> presence = boost::dynamic_pointer_cast<Presence>(payload->getStanza());
+ std::shared_ptr<Presence> presence = std::dynamic_pointer_cast<Presence>(payload->getStanza());
CPPUNIT_ASSERT(!!presence);
CPPUNIT_ASSERT_EQUAL(JID("madhatter@wonderland.lit"), presence->getTo());
CPPUNIT_ASSERT_EQUAL(JID("alice@wonderland.lit/rabbithole"), presence->getFrom());
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/MAMFinParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/MAMFinParserTest.cpp
index b045ca5..6a8e2ed 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/MAMFinParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/MAMFinParserTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -25,7 +25,7 @@ class MAMFinParserTest : public CppUnit::TestFixture
CPPUNIT_ASSERT(parser.parse(
"<fin xmlns='urn:xmpp:mam:0' queryid='f27' />"));
- boost::shared_ptr<MAMFin> payload = parser.getPayload<MAMFin>();
+ std::shared_ptr<MAMFin> payload = parser.getPayload<MAMFin>();
CPPUNIT_ASSERT(!!payload);
CPPUNIT_ASSERT_EQUAL(false, payload->isComplete());
CPPUNIT_ASSERT_EQUAL(true, payload->isStable());
@@ -46,13 +46,13 @@ class MAMFinParserTest : public CppUnit::TestFixture
"</set>"
"</fin>"));
- boost::shared_ptr<MAMFin> payload = parser.getPayload<MAMFin>();
+ std::shared_ptr<MAMFin> payload = parser.getPayload<MAMFin>();
CPPUNIT_ASSERT(!!payload);
CPPUNIT_ASSERT_EQUAL(true, payload->isComplete());
CPPUNIT_ASSERT_EQUAL(true, payload->isStable());
CPPUNIT_ASSERT(!!payload->getResultSet());
- boost::shared_ptr<ResultSet> resultSet = payload->getResultSet();
+ std::shared_ptr<ResultSet> resultSet = payload->getResultSet();
}
};
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/MAMQueryParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/MAMQueryParserTest.cpp
index 8bdefc1..8750c2e 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/MAMQueryParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/MAMQueryParserTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -41,22 +41,22 @@ class MAMQueryParserTest : public CppUnit::TestFixture
"</query>"));
- boost::shared_ptr<MAMQuery> payload = parser.getPayload<MAMQuery>();
+ std::shared_ptr<MAMQuery> payload = parser.getPayload<MAMQuery>();
CPPUNIT_ASSERT(!!payload);
CPPUNIT_ASSERT(payload->getQueryID());
CPPUNIT_ASSERT_EQUAL(std::string("id0"), *payload->getQueryID());
CPPUNIT_ASSERT_EQUAL(std::string("node1"), *payload->getNode());
CPPUNIT_ASSERT(payload->getForm());
- boost::shared_ptr<FormField> fieldType = payload->getForm()->getField("FORM_TYPE");
+ std::shared_ptr<FormField> fieldType = payload->getForm()->getField("FORM_TYPE");
CPPUNIT_ASSERT(fieldType);
CPPUNIT_ASSERT_EQUAL(std::string("urn:xmpp:mam:0"), fieldType->getTextSingleValue());
- boost::shared_ptr<FormField> fieldStart = payload->getForm()->getField("start");
+ std::shared_ptr<FormField> fieldStart = payload->getForm()->getField("start");
CPPUNIT_ASSERT(fieldStart);
CPPUNIT_ASSERT_EQUAL(std::string("2010-08-07T00:00:00Z"), fieldStart->getTextSingleValue());
CPPUNIT_ASSERT(payload->getResultSet());
- boost::shared_ptr<ResultSet> resultSet = payload->getResultSet();
+ std::shared_ptr<ResultSet> resultSet = payload->getResultSet();
CPPUNIT_ASSERT(resultSet->getMaxItems());
CPPUNIT_ASSERT_EQUAL(*resultSet->getMaxItems(), 10);
}
@@ -75,7 +75,7 @@ class MAMQueryParserTest : public CppUnit::TestFixture
"</x>"
"</query>"));
- boost::shared_ptr<MAMQuery> payload = parser.getPayload<MAMQuery>();
+ std::shared_ptr<MAMQuery> payload = parser.getPayload<MAMQuery>();
CPPUNIT_ASSERT(!!payload && !!payload->getForm() && !!payload->getForm()->getField("FORM_TYPE") && !!payload->getForm()->getField("with"));
CPPUNIT_ASSERT_EQUAL(std::string("urn:xmpp:mam:0"), payload->getForm()->getField("FORM_TYPE")->getTextSingleValue());
CPPUNIT_ASSERT_EQUAL(std::string("juliet@capulet.lit"), payload->getForm()->getField("with")->getTextSingleValue());
@@ -97,7 +97,7 @@ class MAMQueryParserTest : public CppUnit::TestFixture
"</field>"
"</x>"
"</query>"));
- boost::shared_ptr<MAMQuery> payload = parser.getPayload<MAMQuery>();
+ std::shared_ptr<MAMQuery> payload = parser.getPayload<MAMQuery>();
CPPUNIT_ASSERT(!!payload && !!payload->getForm() && !!payload->getForm()->getField("FORM_TYPE") && !!payload->getForm()->getField("start") && !!payload->getForm()->getField("start"));
CPPUNIT_ASSERT_EQUAL(std::string("urn:xmpp:mam:0"), payload->getForm()->getField("FORM_TYPE")->getTextSingleValue());
CPPUNIT_ASSERT_EQUAL(std::string("2010-06-07T00:00:00Z"), payload->getForm()->getField("start")->getTextSingleValue());
@@ -110,7 +110,7 @@ class MAMQueryParserTest : public CppUnit::TestFixture
"<query queryid=\"id0\" xmlns=\"urn:xmpp:mam:0\">"
"</query>"));
- boost::shared_ptr<MAMQuery> payload = parser.getPayload<MAMQuery>();
+ std::shared_ptr<MAMQuery> payload = parser.getPayload<MAMQuery>();
CPPUNIT_ASSERT(!!payload);
CPPUNIT_ASSERT(payload->getQueryID());
CPPUNIT_ASSERT_EQUAL(std::string("id0"), *payload->getQueryID());
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/MAMResultParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/MAMResultParserTest.cpp
index 7393630..15912b1 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/MAMResultParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/MAMResultParserTest.cpp
@@ -35,17 +35,17 @@ class MAMResultParserTest : public CppUnit::TestFixture
"</forwarded>"
"</result>"));
- boost::shared_ptr<MAMResult> payload = parser.getPayload<MAMResult>();
+ std::shared_ptr<MAMResult> payload = parser.getPayload<MAMResult>();
CPPUNIT_ASSERT(!!payload);
CPPUNIT_ASSERT_EQUAL(std::string("28482-98726-73623"), payload->getID());
CPPUNIT_ASSERT(payload->getQueryID());
CPPUNIT_ASSERT_EQUAL(std::string("f27"), *payload->getQueryID());
- boost::shared_ptr<Forwarded> forwarded = payload->getPayload();
+ std::shared_ptr<Forwarded> forwarded = payload->getPayload();
CPPUNIT_ASSERT(forwarded->getDelay());
CPPUNIT_ASSERT_EQUAL(std::string("2010-07-10T23:08:25Z"), dateTimeToString(forwarded->getDelay()->getStamp()));
- boost::shared_ptr<Message> message = boost::dynamic_pointer_cast<Message>(forwarded->getStanza());
+ std::shared_ptr<Message> message = std::dynamic_pointer_cast<Message>(forwarded->getStanza());
CPPUNIT_ASSERT(!!message);
const std::string expectedBody = "Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.";
CPPUNIT_ASSERT_EQUAL(expectedBody, message->getBody().get());
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/MUCAdminPayloadParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/MUCAdminPayloadParserTest.cpp
index 495aefe..d403872 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/MUCAdminPayloadParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/MUCAdminPayloadParserTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -26,7 +26,7 @@ class MUCAdminPayloadParserTest : public CppUnit::TestFixture
CPPUNIT_ASSERT(parser.parse("<query xmlns=\"http://jabber.org/protocol/muc#admin\"><item affiliation=\"owner\" role=\"visitor\"><actor jid=\"kev@tester.lit\"/><reason>malice</reason></item></query>"));
- MUCAdminPayload::ref payload = boost::dynamic_pointer_cast<MUCAdminPayload>(parser.getPayload());
+ MUCAdminPayload::ref payload = std::dynamic_pointer_cast<MUCAdminPayload>(parser.getPayload());
MUCItem item = payload->getItems()[0];
CPPUNIT_ASSERT_EQUAL(MUCOccupant::Owner, item.affiliation.get());
CPPUNIT_ASSERT_EQUAL(MUCOccupant::Visitor, item.role.get());
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/MUCUserPayloadParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/MUCUserPayloadParserTest.cpp
index a8cf246..18597bd 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/MUCUserPayloadParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/MUCUserPayloadParserTest.cpp
@@ -34,7 +34,7 @@ class MUCUserPayloadParserTest : public CppUnit::TestFixture
bool found110 = false;
bool found210 = false;
- MUCUserPayload::ref payload = boost::dynamic_pointer_cast<MUCUserPayload>(parser.getPayload());
+ MUCUserPayload::ref payload = std::dynamic_pointer_cast<MUCUserPayload>(parser.getPayload());
foreach (MUCUserPayload::StatusCode status, payload->getStatusCodes()) {
if (status.code == 110) found110 = true;
@@ -55,7 +55,7 @@ class MUCUserPayloadParserTest : public CppUnit::TestFixture
CPPUNIT_ASSERT(parser.parse("<x xmlns=\"http://jabber.org/protocol/muc#user\"/>"));
- MUCUserPayload::ref payload = boost::dynamic_pointer_cast<MUCUserPayload>(parser.getPayload());
+ MUCUserPayload::ref payload = std::dynamic_pointer_cast<MUCUserPayload>(parser.getPayload());
CPPUNIT_ASSERT(payload);
CPPUNIT_ASSERT(payload->getItems().empty());
}
@@ -65,9 +65,9 @@ class MUCUserPayloadParserTest : public CppUnit::TestFixture
CPPUNIT_ASSERT(parser.parse("<x xmlns=\"http://jabber.org/protocol/muc#user\"><destroy jid='alice@wonderland.lit'><reason>bert</reason></destroy></x>"));
- MUCUserPayload::ref payload = boost::dynamic_pointer_cast<MUCUserPayload>(parser.getPayload());
+ MUCUserPayload::ref payload = std::dynamic_pointer_cast<MUCUserPayload>(parser.getPayload());
CPPUNIT_ASSERT(payload);
- MUCDestroyPayload::ref destroy = boost::dynamic_pointer_cast<MUCDestroyPayload>(payload->getPayload());
+ MUCDestroyPayload::ref destroy = std::dynamic_pointer_cast<MUCDestroyPayload>(payload->getPayload());
CPPUNIT_ASSERT(destroy);
CPPUNIT_ASSERT_EQUAL(std::string("bert"), destroy->getReason());
CPPUNIT_ASSERT_EQUAL(JID("alice@wonderland.lit"), destroy->getNewVenue());
@@ -78,7 +78,7 @@ class MUCUserPayloadParserTest : public CppUnit::TestFixture
CPPUNIT_ASSERT(parser.parse("<x xmlns=\"http://jabber.org/protocol/muc#user\"><invite from='crone1@shakespeare.lit/desktop' to='alice@wonderland.lit/xxx'> <reason>Hey Hecate, this is the place for all good witches!</reason> </invite> <password>cauldronburn</password></x>"));
- MUCUserPayload::ref payload = boost::dynamic_pointer_cast<MUCUserPayload>(parser.getPayload());
+ MUCUserPayload::ref payload = std::dynamic_pointer_cast<MUCUserPayload>(parser.getPayload());
CPPUNIT_ASSERT(payload);
CPPUNIT_ASSERT(payload->getInvite());
CPPUNIT_ASSERT(payload->getPassword());
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h b/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h
index 8e871b2..89b990c 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h
+++ b/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h
@@ -48,19 +48,19 @@ namespace Swift {
payloadParser->handleCharacterData(data);
}
- boost::shared_ptr<Payload> getPayload() const {
+ std::shared_ptr<Payload> getPayload() const {
return payloadParser->getPayload();
}
template<typename T>
- boost::shared_ptr<T> getPayload() const {
- return boost::dynamic_pointer_cast<T>(payloadParser->getPayload());
+ std::shared_ptr<T> getPayload() const {
+ return std::dynamic_pointer_cast<T>(payloadParser->getPayload());
}
private:
XMLParser* xmlParser;
FullPayloadParserFactoryCollection factories;
- boost::shared_ptr<PayloadParser> payloadParser;
+ std::shared_ptr<PayloadParser> payloadParser;
int level;
};
}
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/PriorityParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/PriorityParserTest.cpp
index e724090..2c89f0f 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/PriorityParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/PriorityParserTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -24,7 +24,7 @@ class PriorityParserTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(parser.parse("<priority>-120</priority>"));
- boost::shared_ptr<Priority> payload = boost::dynamic_pointer_cast<Priority>(parser.getPayload());
+ std::shared_ptr<Priority> payload = std::dynamic_pointer_cast<Priority>(parser.getPayload());
CPPUNIT_ASSERT_EQUAL(-120, payload->getPriority());
}
@@ -33,7 +33,7 @@ class PriorityParserTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(parser.parse("<priority>invalid</priority>"));
- boost::shared_ptr<Priority> payload = boost::dynamic_pointer_cast<Priority>(parser.getPayload());
+ std::shared_ptr<Priority> payload = std::dynamic_pointer_cast<Priority>(parser.getPayload());
CPPUNIT_ASSERT_EQUAL(0, payload->getPriority());
}
};
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp
index 2975485..06f3ae5 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp
@@ -36,9 +36,9 @@ class PrivateStorageParserTest : public CppUnit::TestFixture {
"</storage>"
"</query>"));
- boost::shared_ptr<PrivateStorage> payload = boost::dynamic_pointer_cast<PrivateStorage>(parser.getPayload());
+ std::shared_ptr<PrivateStorage> payload = std::dynamic_pointer_cast<PrivateStorage>(parser.getPayload());
CPPUNIT_ASSERT(payload);
- boost::shared_ptr<Storage> storage = boost::dynamic_pointer_cast<Storage>(payload->getPayload());
+ std::shared_ptr<Storage> storage = std::dynamic_pointer_cast<Storage>(payload->getPayload());
CPPUNIT_ASSERT(storage);
CPPUNIT_ASSERT_EQUAL(std::string("Alice"), storage->getRooms()[0].nick);
CPPUNIT_ASSERT_EQUAL(JID("swift@rooms.swift.im"), storage->getRooms()[0].jid);
@@ -49,7 +49,7 @@ class PrivateStorageParserTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(parser.parse("<query xmlns='jabber:iq:private'/>"));
- boost::shared_ptr<PrivateStorage> payload = boost::dynamic_pointer_cast<PrivateStorage>(parser.getPayload());
+ std::shared_ptr<PrivateStorage> payload = std::dynamic_pointer_cast<PrivateStorage>(parser.getPayload());
CPPUNIT_ASSERT(payload);
CPPUNIT_ASSERT(!payload->getPayload());
}
@@ -71,9 +71,9 @@ class PrivateStorageParserTest : public CppUnit::TestFixture {
"</storage>"
"</query>"));
- boost::shared_ptr<PrivateStorage> payload = boost::dynamic_pointer_cast<PrivateStorage>(parser.getPayload());
+ std::shared_ptr<PrivateStorage> payload = std::dynamic_pointer_cast<PrivateStorage>(parser.getPayload());
CPPUNIT_ASSERT(payload);
- boost::shared_ptr<Storage> storage = boost::dynamic_pointer_cast<Storage>(payload->getPayload());
+ std::shared_ptr<Storage> storage = std::dynamic_pointer_cast<Storage>(payload->getPayload());
CPPUNIT_ASSERT(storage);
CPPUNIT_ASSERT_EQUAL(std::string("Rabbit"), storage->getRooms()[0].nick);
}
@@ -88,7 +88,7 @@ class PrivateStorageParserTest : public CppUnit::TestFixture {
"<foo>Bar</foo>"
"</query>"));
- CPPUNIT_ASSERT(!boost::dynamic_pointer_cast<PrivateStorage>(testling.getPayload())->getPayload());
+ CPPUNIT_ASSERT(!std::dynamic_pointer_cast<PrivateStorage>(testling.getPayload())->getPayload());
}
};
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ReplaceTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ReplaceTest.cpp
index 3e42788..6d77d4a 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/ReplaceTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/ReplaceTest.cpp
@@ -4,6 +4,12 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -22,13 +28,13 @@ class ReplaceParserTest : public CppUnit::TestFixture {
void testParseTrivial() {
PayloadsParserTester parser;
CPPUNIT_ASSERT(parser.parse("<replace id='bad1' xmlns='http://swift.im/protocol/replace'/>"));
- Replace::ref payload = boost::dynamic_pointer_cast <Replace>(parser.getPayload());
+ Replace::ref payload = std::dynamic_pointer_cast <Replace>(parser.getPayload());
CPPUNIT_ASSERT_EQUAL(std::string("bad1"), payload->getID());
}
void testParseChild() {
PayloadsParserTester parser;
CPPUNIT_ASSERT(parser.parse("<replace id='bad1' xmlns='http://swift.im/protocol/replace' ><child xmlns='blah' id=\"hi\"/></replace>"));
- Replace::ref payload = boost::dynamic_pointer_cast <Replace>(parser.getPayload());
+ Replace::ref payload = std::dynamic_pointer_cast <Replace>(parser.getPayload());
CPPUNIT_ASSERT_EQUAL(std::string("bad1"), payload->getID());
}
};
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp
index 7924e05..da5d978 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -33,7 +33,7 @@ class ResultSetParserTest : public CppUnit::TestFixture
"<after>09af3-cc343-b409f</after>"
"</set>"));
- boost::shared_ptr<ResultSet> payload = parser.getPayload<ResultSet>();
+ std::shared_ptr<ResultSet> payload = parser.getPayload<ResultSet>();
CPPUNIT_ASSERT(!!payload);
CPPUNIT_ASSERT(payload->getMaxItems());
CPPUNIT_ASSERT_EQUAL(100, *payload->getMaxItems());
@@ -60,7 +60,7 @@ class ResultSetParserTest : public CppUnit::TestFixture
"<first>stpeter@jabber.org</first>"
"</set>"));
- boost::shared_ptr<ResultSet> payload = parser.getPayload<ResultSet>();
+ std::shared_ptr<ResultSet> payload = parser.getPayload<ResultSet>();
CPPUNIT_ASSERT(!!payload);
CPPUNIT_ASSERT(payload->getFirstID());
CPPUNIT_ASSERT_EQUAL(std::string("stpeter@jabber.org"), *payload->getFirstID());
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp
index e02eb7a..bc29921 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp
@@ -84,7 +84,7 @@ class VCardParserTest : public CppUnit::TestFixture {
"<MAILER>mutt</MAILER>"
"</vCard>"));
- boost::shared_ptr<VCard> payload = boost::dynamic_pointer_cast<VCard>(parser.getPayload());
+ std::shared_ptr<VCard> payload = std::dynamic_pointer_cast<VCard>(parser.getPayload());
CPPUNIT_ASSERT_EQUAL(std::string("2.0"), payload->getVersion());
CPPUNIT_ASSERT_EQUAL(std::string("Alice In Wonderland"), payload->getFullName());
CPPUNIT_ASSERT_EQUAL(std::string("Alice"), payload->getGivenName());
diff --git a/Swiften/Parser/PayloadParsers/UserLocationParser.h b/Swiften/Parser/PayloadParsers/UserLocationParser.h
index c2a226e..1445d3e 100644
--- a/Swiften/Parser/PayloadParsers/UserLocationParser.h
+++ b/Swiften/Parser/PayloadParsers/UserLocationParser.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/UserLocation.h>
diff --git a/Swiften/Parser/PayloadParsers/UserTuneParser.h b/Swiften/Parser/PayloadParsers/UserTuneParser.h
index 5c35074..5a27273 100644
--- a/Swiften/Parser/PayloadParsers/UserTuneParser.h
+++ b/Swiften/Parser/PayloadParsers/UserTuneParser.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/UserTune.h>
diff --git a/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp b/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp
index b9786c9..d3a7211 100644
--- a/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp
+++ b/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp
@@ -12,9 +12,10 @@
#include <Swiften/Parser/PayloadParsers/WhiteboardParser.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
#include <boost/optional.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
#include <Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h>
@@ -37,15 +38,15 @@ namespace Swift {
} else if (level_ == 1) {
std::string type = attributes.getAttributeValue("type").get_value_or("");
if (type == "insert") {
- WhiteboardInsertOperation::ref insertOp = boost::make_shared<WhiteboardInsertOperation>();
+ WhiteboardInsertOperation::ref insertOp = std::make_shared<WhiteboardInsertOperation>();
operation = insertOp;
} else if (type == "update") {
- WhiteboardUpdateOperation::ref updateOp = boost::make_shared<WhiteboardUpdateOperation>();
+ WhiteboardUpdateOperation::ref updateOp = std::make_shared<WhiteboardUpdateOperation>();
std::string move = attributes.getAttributeValue("newpos").get_value_or("0");
updateOp->setNewPos(boost::lexical_cast<int>(attributes.getAttributeValue("newpos").get_value_or("0")));
operation = updateOp;
} else if (type == "delete") {
- WhiteboardDeleteOperation::ref deleteOp = boost::make_shared<WhiteboardDeleteOperation>();
+ WhiteboardDeleteOperation::ref deleteOp = std::make_shared<WhiteboardDeleteOperation>();
deleteOp->setElementID(attributes.getAttributeValue("elementid").get_value_or(""));
operation = deleteOp;
}
@@ -71,7 +72,7 @@ namespace Swift {
y2 = boost::lexical_cast<int>(attributes.getAttributeValue("y2").get_value_or("0"));
} catch (boost::bad_lexical_cast&) {
}
- WhiteboardLineElement::ref whiteboardElement = boost::make_shared<WhiteboardLineElement>(x1, y1, x2, y2);
+ WhiteboardLineElement::ref whiteboardElement = std::make_shared<WhiteboardLineElement>(x1, y1, x2, y2);
WhiteboardColor color(attributes.getAttributeValue("stroke").get_value_or("#000000"));
color.setAlpha(opacityToAlpha(attributes.getAttributeValue("opacity").get_value_or("1")));
@@ -87,7 +88,7 @@ namespace Swift {
getPayloadInternal()->setElement(whiteboardElement);
wbElement = whiteboardElement;
} else if (element == "path") {
- WhiteboardFreehandPathElement::ref whiteboardElement = boost::make_shared<WhiteboardFreehandPathElement>();
+ WhiteboardFreehandPathElement::ref whiteboardElement = std::make_shared<WhiteboardFreehandPathElement>();
std::string pathData = attributes.getAttributeValue("d").get_value_or("");
std::vector<std::pair<int, int> > points;
if (pathData[0] == 'M') {
@@ -148,7 +149,7 @@ namespace Swift {
} catch (boost::bad_lexical_cast&) {
}
- WhiteboardRectElement::ref whiteboardElement = boost::make_shared<WhiteboardRectElement>(x, y, width, height);
+ WhiteboardRectElement::ref whiteboardElement = std::make_shared<WhiteboardRectElement>(x, y, width, height);
int penWidth = 1;
try {
@@ -167,7 +168,7 @@ namespace Swift {
getPayloadInternal()->setElement(whiteboardElement);
wbElement = whiteboardElement;
} else if (element == "polygon") {
- WhiteboardPolygonElement::ref whiteboardElement = boost::make_shared<WhiteboardPolygonElement>();
+ WhiteboardPolygonElement::ref whiteboardElement = std::make_shared<WhiteboardPolygonElement>();
std::string pointsData = attributes.getAttributeValue("points").get_value_or("");
std::vector<std::pair<int, int> > points;
@@ -214,7 +215,7 @@ namespace Swift {
} catch (boost::bad_lexical_cast&) {
}
- WhiteboardTextElement::ref whiteboardElement = boost::make_shared<WhiteboardTextElement>(x, y);
+ WhiteboardTextElement::ref whiteboardElement = std::make_shared<WhiteboardTextElement>(x, y);
actualIsText = true;
WhiteboardColor color(attributes.getAttributeValue("fill").get_value_or("#000000"));
@@ -243,7 +244,7 @@ namespace Swift {
} catch (boost::bad_lexical_cast&) {
}
- WhiteboardEllipseElement::ref whiteboardElement = boost::make_shared<WhiteboardEllipseElement>(cx, cy, rx, ry);
+ WhiteboardEllipseElement::ref whiteboardElement = std::make_shared<WhiteboardEllipseElement>(cx, cy, rx, ry);
int penWidth = 1;
try {
@@ -271,12 +272,12 @@ namespace Swift {
if (level_ == 0) {
getPayloadInternal()->setData(data_);
} else if (level_ == 1) {
- WhiteboardInsertOperation::ref insertOp = boost::dynamic_pointer_cast<WhiteboardInsertOperation>(operation);
+ WhiteboardInsertOperation::ref insertOp = std::dynamic_pointer_cast<WhiteboardInsertOperation>(operation);
if (insertOp) {
insertOp->setElement(wbElement);
}
- WhiteboardUpdateOperation::ref updateOp = boost::dynamic_pointer_cast<WhiteboardUpdateOperation>(operation);
+ WhiteboardUpdateOperation::ref updateOp = std::dynamic_pointer_cast<WhiteboardUpdateOperation>(operation);
if (updateOp) {
updateOp->setElement(wbElement);
}
@@ -290,7 +291,7 @@ namespace Swift {
void WhiteboardParser::handleCharacterData(const std::string& data) {
if (level_ == 3 && actualIsText) {
- WhiteboardTextElement::ref element = boost::dynamic_pointer_cast<WhiteboardTextElement>(getPayloadInternal()->getElement());
+ WhiteboardTextElement::ref element = std::dynamic_pointer_cast<WhiteboardTextElement>(getPayloadInternal()->getElement());
element->setText(data);
}
}
diff --git a/Swiften/Parser/SerializingParser.cpp b/Swiften/Parser/SerializingParser.cpp
index b58ccd6..9e39279 100644
--- a/Swiften/Parser/SerializingParser.cpp
+++ b/Swiften/Parser/SerializingParser.cpp
@@ -6,7 +6,7 @@
#include <Swiften/Parser/SerializingParser.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/XML/XMLTextNode.h>
@@ -17,7 +17,7 @@ SerializingParser::SerializingParser() {
}
void SerializingParser::handleStartElement(const std::string& tag, const std::string& ns, const AttributeMap& attributes) {
- boost::shared_ptr<XMLElement> element = boost::make_shared<XMLElement>(tag, ns);
+ std::shared_ptr<XMLElement> element = std::make_shared<XMLElement>(tag, ns);
// FIXME: Ignoring attribute namespace
foreach (const AttributeMap::Entry& e, attributes.getEntries()) {
element->setAttribute(e.getAttribute().getName(), e.getValue());
@@ -39,7 +39,7 @@ void SerializingParser::handleEndElement(const std::string&, const std::string&)
void SerializingParser::handleCharacterData(const std::string& data) {
if (!elementStack_.empty()) {
- (*(elementStack_.end()-1))->addNode(boost::make_shared<XMLTextNode>(data));
+ (*(elementStack_.end()-1))->addNode(std::make_shared<XMLTextNode>(data));
}
}
diff --git a/Swiften/Parser/SerializingParser.h b/Swiften/Parser/SerializingParser.h
index b94d2b8..bc2d872 100644
--- a/Swiften/Parser/SerializingParser.h
+++ b/Swiften/Parser/SerializingParser.h
@@ -24,7 +24,7 @@ namespace Swift {
std::string getResult() const;
private:
- std::vector< boost::shared_ptr<XMLElement> > elementStack_;
- boost::shared_ptr<XMLElement> rootElement_;
+ std::vector< std::shared_ptr<XMLElement> > elementStack_;
+ std::shared_ptr<XMLElement> rootElement_;
};
}
diff --git a/Swiften/Parser/StanzaParser.cpp b/Swiften/Parser/StanzaParser.cpp
index 82ddb5c..da252bf 100644
--- a/Swiften/Parser/StanzaParser.cpp
+++ b/Swiften/Parser/StanzaParser.cpp
@@ -65,7 +65,7 @@ void StanzaParser::handleEndElement(const std::string& element, const std::strin
currentPayloadParser_->handleEndElement(element, ns);
--currentDepth_;
if (!inPayload()) {
- boost::shared_ptr<Payload> payload(currentPayloadParser_->getPayload());
+ std::shared_ptr<Payload> payload(currentPayloadParser_->getPayload());
if (payload) {
getStanza()->addPayload(payload);
}
diff --git a/Swiften/Parser/StanzaParser.h b/Swiften/Parser/StanzaParser.h
index 866df04..7b83e99 100644
--- a/Swiften/Parser/StanzaParser.h
+++ b/Swiften/Parser/StanzaParser.h
@@ -6,10 +6,10 @@
#pragma once
+#include <memory>
#include <string>
#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Stanza.h>
@@ -29,11 +29,11 @@ namespace Swift {
void handleEndElement(const std::string& element, const std::string& ns);
void handleCharacterData(const std::string& data);
- virtual boost::shared_ptr<ToplevelElement> getElement() const = 0;
+ virtual std::shared_ptr<ToplevelElement> getElement() const = 0;
virtual void handleStanzaAttributes(const AttributeMap&) {}
- virtual boost::shared_ptr<Stanza> getStanza() const {
- return boost::dynamic_pointer_cast<Stanza>(getElement());
+ virtual std::shared_ptr<Stanza> getStanza() const {
+ return std::dynamic_pointer_cast<Stanza>(getElement());
}
private:
@@ -49,6 +49,6 @@ namespace Swift {
private:
int currentDepth_;
PayloadParserFactoryCollection* factories_;
- boost::shared_ptr<PayloadParser> currentPayloadParser_;
+ std::shared_ptr<PayloadParser> currentPayloadParser_;
};
}
diff --git a/Swiften/Parser/Tree/NullParserElement.cpp b/Swiften/Parser/Tree/NullParserElement.cpp
index 4a2db8f..7b52926 100644
--- a/Swiften/Parser/Tree/NullParserElement.cpp
+++ b/Swiften/Parser/Tree/NullParserElement.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,6 +8,6 @@
namespace Swift {
-boost::shared_ptr<NullParserElement> NullParserElement::element = boost::make_shared<NullParserElement>();
+std::shared_ptr<NullParserElement> NullParserElement::element = std::make_shared<NullParserElement>();
}
diff --git a/Swiften/Parser/Tree/NullParserElement.h b/Swiften/Parser/Tree/NullParserElement.h
index 8dae25d..320e098 100644
--- a/Swiften/Parser/Tree/NullParserElement.h
+++ b/Swiften/Parser/Tree/NullParserElement.h
@@ -18,6 +18,6 @@ namespace Swift {
virtual operator bool() { return false; }
- static boost::shared_ptr<NullParserElement> element;
+ static std::shared_ptr<NullParserElement> element;
};
}
diff --git a/Swiften/Parser/Tree/ParserElement.cpp b/Swiften/Parser/Tree/ParserElement.cpp
index 6bbd93e..27bd790 100644
--- a/Swiften/Parser/Tree/ParserElement.cpp
+++ b/Swiften/Parser/Tree/ParserElement.cpp
@@ -25,7 +25,7 @@ ParserElement::~ParserElement() {
}
ParserElement::ref ParserElement::addChild(const std::string& name, const std::string& xmlns, const AttributeMap& attributes) {
- ParserElement::ref child = boost::make_shared<ParserElement>(name, xmlns, attributes);
+ ParserElement::ref child = std::make_shared<ParserElement>(name, xmlns, attributes);
children_.push_back(child);
return child;
}
diff --git a/Swiften/Parser/Tree/ParserElement.h b/Swiften/Parser/Tree/ParserElement.h
index dc9f31c..cffd59a 100644
--- a/Swiften/Parser/Tree/ParserElement.h
+++ b/Swiften/Parser/Tree/ParserElement.h
@@ -7,12 +7,10 @@
#pragma once
+#include <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Parser/AttributeMap.h>
@@ -20,7 +18,7 @@
namespace Swift {
class SWIFTEN_API ParserElement {
public:
- typedef boost::shared_ptr<ParserElement> ref;
+ typedef std::shared_ptr<ParserElement> ref;
ParserElement(const std::string& name, const std::string& xmlns, const AttributeMap& attributes);
virtual ~ParserElement();
diff --git a/Swiften/Parser/Tree/TreeReparser.cpp b/Swiften/Parser/Tree/TreeReparser.cpp
index 269b2ea..7fc74cf 100644
--- a/Swiften/Parser/Tree/TreeReparser.cpp
+++ b/Swiften/Parser/Tree/TreeReparser.cpp
@@ -21,7 +21,7 @@ namespace Swift {
typedef std::pair<ParserElement::ref, bool> ElementState;
-boost::shared_ptr<Payload> TreeReparser::parseTree(ParserElement::ref root, PayloadParserFactoryCollection* collection) {
+std::shared_ptr<Payload> TreeReparser::parseTree(ParserElement::ref root, PayloadParserFactoryCollection* collection) {
PayloadParser* parser = collection->getPayloadParserFactory(root->getName(), root->getNamespace(), root->getAttributes())->createPayloadParser();
std::deque<ElementState > stack;
stack.push_back(ElementState(root, true));
@@ -41,7 +41,7 @@ boost::shared_ptr<Payload> TreeReparser::parseTree(ParserElement::ref root, Payl
}
- boost::shared_ptr<Payload> payload = parser->getPayload();
+ std::shared_ptr<Payload> payload = parser->getPayload();
delete parser;
return payload;
}
diff --git a/Swiften/Parser/Tree/TreeReparser.h b/Swiften/Parser/Tree/TreeReparser.h
index fb96c1b..435922b 100644
--- a/Swiften/Parser/Tree/TreeReparser.h
+++ b/Swiften/Parser/Tree/TreeReparser.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -14,7 +14,7 @@ namespace Swift {
class PayloadParserFactoryCollection;
class SWIFTEN_API TreeReparser {
public:
- static boost::shared_ptr<Payload> parseTree(ParserElement::ref root, PayloadParserFactoryCollection* collection);
+ static std::shared_ptr<Payload> parseTree(ParserElement::ref root, PayloadParserFactoryCollection* collection);
};
}
diff --git a/Swiften/Parser/UnitTest/StanzaParserTest.cpp b/Swiften/Parser/UnitTest/StanzaParserTest.cpp
index c081b1b..6febdbc 100644
--- a/Swiften/Parser/UnitTest/StanzaParserTest.cpp
+++ b/Swiften/Parser/UnitTest/StanzaParserTest.cpp
@@ -193,15 +193,15 @@ class StanzaParserTest : public CppUnit::TestFixture {
public:
MyStanzaParser(PayloadParserFactoryCollection* collection) : StanzaParser(collection)
{
- stanza_ = boost::make_shared<MyStanza>();
+ stanza_ = std::make_shared<MyStanza>();
}
- virtual boost::shared_ptr<ToplevelElement> getElement() const {
+ virtual std::shared_ptr<ToplevelElement> getElement() const {
return stanza_;
}
private:
- boost::shared_ptr<MyStanza> stanza_;
+ std::shared_ptr<MyStanza> stanza_;
};
MyPayload1ParserFactory factory1_;
diff --git a/Swiften/Parser/UnitTest/StreamFeaturesParserTest.cpp b/Swiften/Parser/UnitTest/StreamFeaturesParserTest.cpp
index 031f2f3..4664df2 100644
--- a/Swiften/Parser/UnitTest/StreamFeaturesParserTest.cpp
+++ b/Swiften/Parser/UnitTest/StreamFeaturesParserTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -42,7 +42,7 @@ class StreamFeaturesParserTest : public CppUnit::TestFixture {
"<ver xmlns=\"urn:xmpp:features:rosterver\"/>"
"</stream:features>"));
- StreamFeatures::ref element = boost::dynamic_pointer_cast<StreamFeatures>(testling.getElement());
+ StreamFeatures::ref element = std::dynamic_pointer_cast<StreamFeatures>(testling.getElement());
CPPUNIT_ASSERT(element->hasStartTLS());
CPPUNIT_ASSERT(element->hasSession());
CPPUNIT_ASSERT(element->hasResourceBind());
@@ -62,7 +62,7 @@ class StreamFeaturesParserTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(parser.parse("<stream:features xmlns:stream='http://etherx.jabber.org/streams'/>"));
- StreamFeatures::ref element = boost::dynamic_pointer_cast<StreamFeatures>(testling.getElement());
+ StreamFeatures::ref element = std::dynamic_pointer_cast<StreamFeatures>(testling.getElement());
CPPUNIT_ASSERT(!element->hasStartTLS());
CPPUNIT_ASSERT(!element->hasSession());
CPPUNIT_ASSERT(!element->hasResourceBind());
@@ -82,7 +82,7 @@ class StreamFeaturesParserTest : public CppUnit::TestFixture {
"</mechanisms>"
"</stream:features>"));
- StreamFeatures::ref element = boost::dynamic_pointer_cast<StreamFeatures>(testling.getElement());
+ StreamFeatures::ref element = std::dynamic_pointer_cast<StreamFeatures>(testling.getElement());
CPPUNIT_ASSERT(element->hasAuthenticationMechanism("GSSAPI"));
CPPUNIT_ASSERT_EQUAL(*element->getAuthenticationHostname(), hostname);
}
@@ -99,7 +99,7 @@ class StreamFeaturesParserTest : public CppUnit::TestFixture {
"</mechanisms>"
"</stream:features>"));
- StreamFeatures::ref element = boost::dynamic_pointer_cast<StreamFeatures>(testling.getElement());
+ StreamFeatures::ref element = std::dynamic_pointer_cast<StreamFeatures>(testling.getElement());
CPPUNIT_ASSERT(element->hasAuthenticationMechanism("GSSAPI"));
CPPUNIT_ASSERT(element->getAuthenticationHostname()->empty());
}
diff --git a/Swiften/Parser/UnitTest/StreamManagementEnabledParserTest.cpp b/Swiften/Parser/UnitTest/StreamManagementEnabledParserTest.cpp
index 7b4a9cc..704a89f 100644
--- a/Swiften/Parser/UnitTest/StreamManagementEnabledParserTest.cpp
+++ b/Swiften/Parser/UnitTest/StreamManagementEnabledParserTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -25,7 +25,7 @@ class StreamManagementEnabledParserTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(parser.parse(
"<enabled xmlns=\"urn:xmpp:sm:3\" id=\"some-long-sm-id\" resume=\"true\"/>"));
- boost::shared_ptr<StreamManagementEnabled> element = boost::dynamic_pointer_cast<StreamManagementEnabled>(testling.getElement());
+ std::shared_ptr<StreamManagementEnabled> element = std::dynamic_pointer_cast<StreamManagementEnabled>(testling.getElement());
CPPUNIT_ASSERT(element->getResumeSupported());
CPPUNIT_ASSERT_EQUAL(std::string("some-long-sm-id"), element->getResumeID());
}
diff --git a/Swiften/Parser/UnitTest/XMPPParserTest.cpp b/Swiften/Parser/UnitTest/XMPPParserTest.cpp
index a4cb7b8..2424d4d 100644
--- a/Swiften/Parser/UnitTest/XMPPParserTest.cpp
+++ b/Swiften/Parser/UnitTest/XMPPParserTest.cpp
@@ -163,7 +163,7 @@ class XMPPParserTest : public CppUnit::TestFixture {
public:
enum Type { StreamStart, ElementEvent, StreamEnd };
struct Event {
- Event(Type type, boost::shared_ptr<ToplevelElement> element)
+ Event(Type type, std::shared_ptr<ToplevelElement> element)
: type(type), element(element) {}
Event(Type type, const ProtocolHeader& header) : type(type), header(header) {}
@@ -171,7 +171,7 @@ class XMPPParserTest : public CppUnit::TestFixture {
Type type;
boost::optional<ProtocolHeader> header;
- boost::shared_ptr<ToplevelElement> element;
+ std::shared_ptr<ToplevelElement> element;
};
Client() {}
@@ -180,7 +180,7 @@ class XMPPParserTest : public CppUnit::TestFixture {
events.push_back(Event(StreamStart, header));
}
- void handleElement(boost::shared_ptr<ToplevelElement> element) {
+ void handleElement(std::shared_ptr<ToplevelElement> element) {
events.push_back(Event(ElementEvent, element));
}
diff --git a/Swiften/Parser/UnknownPayloadParser.h b/Swiften/Parser/UnknownPayloadParser.h
index ca49269..1553704 100644
--- a/Swiften/Parser/UnknownPayloadParser.h
+++ b/Swiften/Parser/UnknownPayloadParser.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Parser/PayloadParser.h>
@@ -20,8 +20,8 @@ namespace Swift {
virtual void handleEndElement(const std::string&, const std::string&) {}
virtual void handleCharacterData(const std::string&) {}
- virtual boost::shared_ptr<Payload> getPayload() const {
- return boost::shared_ptr<Payload>();
+ virtual std::shared_ptr<Payload> getPayload() const {
+ return std::shared_ptr<Payload>();
}
};
}
diff --git a/Swiften/Parser/XMPPParser.h b/Swiften/Parser/XMPPParser.h
index 52b2921..09fae38 100644
--- a/Swiften/Parser/XMPPParser.h
+++ b/Swiften/Parser/XMPPParser.h
@@ -6,8 +6,9 @@
#pragma once
+#include <memory>
+
#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Parser/AttributeMap.h>
diff --git a/Swiften/Parser/XMPPParserClient.h b/Swiften/Parser/XMPPParserClient.h
index 73f8119..97c0c64 100644
--- a/Swiften/Parser/XMPPParserClient.h
+++ b/Swiften/Parser/XMPPParserClient.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2014 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/ToplevelElement.h>
@@ -20,7 +20,7 @@ namespace Swift {
virtual ~XMPPParserClient();
virtual void handleStreamStart(const ProtocolHeader&) = 0;
- virtual void handleElement(boost::shared_ptr<ToplevelElement>) = 0;
+ virtual void handleElement(std::shared_ptr<ToplevelElement>) = 0;
virtual void handleStreamEnd() = 0;
};
}
diff --git a/Swiften/Presence/DirectedPresenceSender.cpp b/Swiften/Presence/DirectedPresenceSender.cpp
index a3deea5..c1ce3a0 100644
--- a/Swiften/Presence/DirectedPresenceSender.cpp
+++ b/Swiften/Presence/DirectedPresenceSender.cpp
@@ -13,7 +13,7 @@ namespace Swift {
DirectedPresenceSender::DirectedPresenceSender(PresenceSender* sender) : sender(sender) {
}
-void DirectedPresenceSender::sendPresence(boost::shared_ptr<Presence> presence) {
+void DirectedPresenceSender::sendPresence(std::shared_ptr<Presence> presence) {
if (!sender->isAvailable()) {
return;
}
@@ -21,7 +21,7 @@ void DirectedPresenceSender::sendPresence(boost::shared_ptr<Presence> presence)
sender->sendPresence(presence);
if (!presence->getTo().isValid()) {
- boost::shared_ptr<Presence> presenceCopy(new Presence(*presence));
+ std::shared_ptr<Presence> presenceCopy(new Presence(*presence));
foreach(const JID& jid, directedPresenceReceivers) {
presenceCopy->setTo(jid);
sender->sendPresence(presenceCopy);
@@ -48,7 +48,7 @@ void DirectedPresenceSender::addDirectedPresenceReceiver(const JID& jid, SendPre
directedPresenceReceivers.insert(jid);
if (sendPresence == AndSendPresence && sender->isAvailable()) {
if (lastSentUndirectedPresence && (*lastSentUndirectedPresence)->getType() == Presence::Available) {
- boost::shared_ptr<Presence> presenceCopy((*lastSentUndirectedPresence)->clone());
+ std::shared_ptr<Presence> presenceCopy((*lastSentUndirectedPresence)->clone());
presenceCopy->setTo(jid);
sender->sendPresence(presenceCopy);
}
@@ -63,7 +63,7 @@ void DirectedPresenceSender::addDirectedPresenceReceiver(const JID& jid, SendPre
void DirectedPresenceSender::removeDirectedPresenceReceiver(const JID& jid, SendPresence sendPresence) {
directedPresenceReceivers.erase(jid);
if (sendPresence == AndSendPresence && sender->isAvailable()) {
- boost::shared_ptr<Presence> presence(new Presence());
+ std::shared_ptr<Presence> presence(new Presence());
presence->setType(Presence::Unavailable);
presence->setTo(jid);
sender->sendPresence(presence);
diff --git a/Swiften/Presence/PayloadAddingPresenceSender.cpp b/Swiften/Presence/PayloadAddingPresenceSender.cpp
index 2f55374..e5d2688 100644
--- a/Swiften/Presence/PayloadAddingPresenceSender.cpp
+++ b/Swiften/Presence/PayloadAddingPresenceSender.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -34,7 +34,7 @@ bool PayloadAddingPresenceSender::isAvailable() const {
return sender->isAvailable();
}
-void PayloadAddingPresenceSender::setPayload(boost::shared_ptr<Payload> payload) {
+void PayloadAddingPresenceSender::setPayload(std::shared_ptr<Payload> payload) {
this->payload = payload;
if (lastSentPresence) {
sendPresence(lastSentPresence);
diff --git a/Swiften/Presence/PayloadAddingPresenceSender.h b/Swiften/Presence/PayloadAddingPresenceSender.h
index edb9484..3a55183 100644
--- a/Swiften/Presence/PayloadAddingPresenceSender.h
+++ b/Swiften/Presence/PayloadAddingPresenceSender.h
@@ -22,7 +22,7 @@ namespace Swift {
public:
PayloadAddingPresenceSender(PresenceSender*);
- void sendPresence(boost::shared_ptr<Presence>);
+ void sendPresence(std::shared_ptr<Presence>);
bool isAvailable() const;
/**
@@ -31,7 +31,7 @@ namespace Swift {
* with an updated payload. Initial presence is reset when unavailable presence is
* sent, or when reset() is called.
*/
- void setPayload(boost::shared_ptr<Payload>);
+ void setPayload(std::shared_ptr<Payload>);
/**
* Resets the presence sender.
@@ -42,8 +42,8 @@ namespace Swift {
void reset();
private:
- boost::shared_ptr<Presence> lastSentPresence;
+ std::shared_ptr<Presence> lastSentPresence;
PresenceSender* sender;
- boost::shared_ptr<Payload> payload;
+ std::shared_ptr<Payload> payload;
};
}
diff --git a/Swiften/Presence/UnitTest/DirectedPresenceSenderTest.cpp b/Swiften/Presence/UnitTest/DirectedPresenceSenderTest.cpp
index 37679a9..2ce67dc 100644
--- a/Swiften/Presence/UnitTest/DirectedPresenceSenderTest.cpp
+++ b/Swiften/Presence/UnitTest/DirectedPresenceSenderTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -28,9 +28,9 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture {
public:
void setUp() {
channel = new DummyStanzaChannel();
- testPresence = boost::make_shared<Presence>();
+ testPresence = std::make_shared<Presence>();
testPresence->setStatus("Foo");
- secondTestPresence = boost::make_shared<Presence>();
+ secondTestPresence = std::make_shared<Presence>();
secondTestPresence->setStatus("Bar");
stanzaChannelPresenceSender = new StanzaChannelPresenceSender(channel);
}
@@ -41,30 +41,30 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture {
}
void testSendPresence() {
- boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ std::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->sendPresence(testPresence);
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel->sentStanzas.size()));
- boost::shared_ptr<Presence> presence = boost::dynamic_pointer_cast<Presence>(channel->sentStanzas[0]);
+ std::shared_ptr<Presence> presence = std::dynamic_pointer_cast<Presence>(channel->sentStanzas[0]);
CPPUNIT_ASSERT(testPresence == presence);
}
void testSendPresence_UndirectedPresenceWithDirectedPresenceReceivers() {
- boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ std::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence);
testling->sendPresence(testPresence);
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(channel->sentStanzas.size()));
- boost::shared_ptr<Presence> presence = boost::dynamic_pointer_cast<Presence>(channel->sentStanzas[0]);
+ std::shared_ptr<Presence> presence = std::dynamic_pointer_cast<Presence>(channel->sentStanzas[0]);
CPPUNIT_ASSERT(testPresence == presence);
- presence = boost::dynamic_pointer_cast<Presence>(channel->sentStanzas[1]);
+ presence = std::dynamic_pointer_cast<Presence>(channel->sentStanzas[1]);
CPPUNIT_ASSERT_EQUAL(testPresence->getStatus(), presence->getStatus());
CPPUNIT_ASSERT_EQUAL(JID("alice@wonderland.lit/teaparty"), presence->getTo());
}
void testSendPresence_DirectedPresenceWithDirectedPresenceReceivers() {
- boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ std::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence);
channel->sentStanzas.clear();
@@ -72,25 +72,25 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture {
testling->sendPresence(testPresence);
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel->sentStanzas.size()));
- boost::shared_ptr<Presence> presence = boost::dynamic_pointer_cast<Presence>(channel->sentStanzas[0]);
+ std::shared_ptr<Presence> presence = std::dynamic_pointer_cast<Presence>(channel->sentStanzas[0]);
CPPUNIT_ASSERT(testPresence == presence);
}
void testAddDirectedPresenceReceiver() {
- boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ std::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->sendPresence(testPresence);
channel->sentStanzas.clear();
testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence);
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel->sentStanzas.size()));
- boost::shared_ptr<Presence> presence = boost::dynamic_pointer_cast<Presence>(channel->sentStanzas[0]);
+ std::shared_ptr<Presence> presence = std::dynamic_pointer_cast<Presence>(channel->sentStanzas[0]);
CPPUNIT_ASSERT_EQUAL(testPresence->getStatus(), presence->getStatus());
CPPUNIT_ASSERT_EQUAL(JID("alice@wonderland.lit/teaparty"), presence->getTo());
}
void testAddDirectedPresenceReceiver_WithoutSendingPresence() {
- boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ std::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->sendPresence(testPresence);
channel->sentStanzas.clear();
@@ -100,7 +100,7 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture {
}
void testAddDirectedPresenceReceiver_AfterSendingDirectedPresence() {
- boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ std::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->sendPresence(testPresence);
secondTestPresence->setTo(JID("foo@bar.com"));
testling->sendPresence(secondTestPresence);
@@ -109,25 +109,25 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture {
testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence);
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel->sentStanzas.size()));
- boost::shared_ptr<Presence> presence = boost::dynamic_pointer_cast<Presence>(channel->sentStanzas[0]);
+ std::shared_ptr<Presence> presence = std::dynamic_pointer_cast<Presence>(channel->sentStanzas[0]);
CPPUNIT_ASSERT_EQUAL(testPresence->getStatus(), presence->getStatus());
CPPUNIT_ASSERT_EQUAL(JID("alice@wonderland.lit/teaparty"), presence->getTo());
}
void testRemoveDirectedPresenceReceiver() {
- boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ std::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::DontSendPresence);
testling->removeDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence);
testling->sendPresence(testPresence);
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(channel->sentStanzas.size()));
- CPPUNIT_ASSERT_EQUAL(boost::dynamic_pointer_cast<Presence>(channel->sentStanzas[0])->getType(), Presence::Unavailable);
+ CPPUNIT_ASSERT_EQUAL(std::dynamic_pointer_cast<Presence>(channel->sentStanzas[0])->getType(), Presence::Unavailable);
CPPUNIT_ASSERT(channel->sentStanzas[1] == testPresence);
}
void testRemoveDirectedPresenceReceiver_WithoutSendingPresence() {
- boost::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
+ std::shared_ptr<DirectedPresenceSender> testling(createPresenceSender());
testling->addDirectedPresenceReceiver(JID("alice@wonderland.lit/teaparty"), DirectedPresenceSender::AndSendPresence);
channel->sentStanzas.clear();
@@ -146,8 +146,8 @@ class DirectedPresenceSenderTest : public CppUnit::TestFixture {
private:
DummyStanzaChannel* channel;
StanzaChannelPresenceSender* stanzaChannelPresenceSender;
- boost::shared_ptr<Presence> testPresence;
- boost::shared_ptr<Presence> secondTestPresence;
+ std::shared_ptr<Presence> testPresence;
+ std::shared_ptr<Presence> secondTestPresence;
};
CPPUNIT_TEST_SUITE_REGISTRATION(DirectedPresenceSenderTest);
diff --git a/Swiften/Presence/UnitTest/PayloadAddingPresenceSenderTest.cpp b/Swiften/Presence/UnitTest/PayloadAddingPresenceSenderTest.cpp
index 84c0838..234f303 100644
--- a/Swiften/Presence/UnitTest/PayloadAddingPresenceSenderTest.cpp
+++ b/Swiften/Presence/UnitTest/PayloadAddingPresenceSenderTest.cpp
@@ -41,7 +41,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
void testSetPayloadAddsPayloadOnPresenceSend() {
- boost::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
+ std::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
testling->setPayload(MyPayload::create("foo"));
testling->sendPresence(Presence::create("bar"));
@@ -52,7 +52,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
void testSetNullPayloadDoesNotAddPayloadOnPresenceSend() {
- boost::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
+ std::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
testling->setPayload(MyPayload::ref());
testling->sendPresence(Presence::create("bar"));
@@ -63,7 +63,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
void testSendPresenceDoesNotAlterOriginalPayload() {
- boost::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
+ std::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
testling->setPayload(MyPayload::create("foo"));
Presence::ref presence(Presence::create("bar"));
@@ -73,7 +73,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
void testSetPayloadAfterInitialPresenceResendsPresence() {
- boost::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
+ std::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
testling->sendPresence(Presence::create("bar"));
testling->setPayload(MyPayload::create("foo"));
@@ -84,7 +84,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
void testSetPayloadAfterUnavailablePresenceDoesNotResendPresence() {
- boost::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
+ std::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
testling->sendPresence(Presence::create("bar"));
@@ -98,7 +98,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
void testSetPayloadAfterResetDoesNotResendPresence() {
- boost::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
+ std::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
testling->sendPresence(Presence::create("bar"));
testling->reset();
@@ -108,7 +108,7 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
void testSendDirectedPresenceIsNotResent() {
- boost::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
+ std::shared_ptr<PayloadAddingPresenceSender> testling(createSender());
testling->sendPresence(Presence::create("bar"));
Presence::ref directedPresence = Presence::create("baz");
@@ -121,13 +121,13 @@ class PayloadAddingPresenceSenderTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<PayloadAddingPresenceSender> createSender() {
- boost::shared_ptr<PayloadAddingPresenceSender> sender(new PayloadAddingPresenceSender(presenceSender));
+ std::shared_ptr<PayloadAddingPresenceSender> createSender() {
+ std::shared_ptr<PayloadAddingPresenceSender> sender(new PayloadAddingPresenceSender(presenceSender));
return sender;
}
struct MyPayload : public Payload {
- typedef boost::shared_ptr<MyPayload> ref;
+ typedef std::shared_ptr<MyPayload> ref;
MyPayload(const std::string& body) : body(body) {}
diff --git a/Swiften/Presence/UnitTest/PresenceOracleTest.cpp b/Swiften/Presence/UnitTest/PresenceOracleTest.cpp
index 4f066c7..86a7925 100644
--- a/Swiften/Presence/UnitTest/PresenceOracleTest.cpp
+++ b/Swiften/Presence/UnitTest/PresenceOracleTest.cpp
@@ -1,11 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -109,7 +110,7 @@ class PresenceOracleTest : public CppUnit::TestFixture {
}
void testReceivePresence() {
- boost::shared_ptr<Presence> sentPresence(createPresence(user1));
+ std::shared_ptr<Presence> sentPresence(createPresence(user1));
stanzaChannel_->onPresenceReceived(sentPresence);
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(changes.size()));
@@ -119,8 +120,8 @@ class PresenceOracleTest : public CppUnit::TestFixture {
}
void testReceivePresenceFromDifferentResources() {
- boost::shared_ptr<Presence> sentPresence1(createPresence(user1));
- boost::shared_ptr<Presence> sentPresence2(createPresence(user1alt));
+ std::shared_ptr<Presence> sentPresence1(createPresence(user1));
+ std::shared_ptr<Presence> sentPresence2(createPresence(user1alt));
stanzaChannel_->onPresenceReceived(sentPresence1);
stanzaChannel_->onPresenceReceived(sentPresence2);
@@ -132,7 +133,7 @@ class PresenceOracleTest : public CppUnit::TestFixture {
std::string reasonText = "Because I want to";
JID sentJID = JID("me@example.com");
- boost::shared_ptr<Presence> sentPresence(new Presence());
+ std::shared_ptr<Presence> sentPresence(new Presence());
sentPresence->setType(Presence::Subscribe);
sentPresence->setFrom(sentJID);
sentPresence->setStatus(reasonText);
@@ -145,7 +146,7 @@ class PresenceOracleTest : public CppUnit::TestFixture {
}
void testReconnectResetsPresences() {
- boost::shared_ptr<Presence> sentPresence(createPresence(user1));
+ std::shared_ptr<Presence> sentPresence(createPresence(user1));
stanzaChannel_->onPresenceReceived(sentPresence);
stanzaChannel_->setAvailable(false);
stanzaChannel_->setAvailable(true);
@@ -189,7 +190,7 @@ class PresenceOracleTest : public CppUnit::TestFixture {
private:
Presence::ref createPresence(const JID &jid, int priority, Presence::Type type, const StatusShow::Type& statusShow) {
- Presence::ref presence = boost::make_shared<Presence>();
+ Presence::ref presence = std::make_shared<Presence>();
presence->setFrom(jid);
presence->setPriority(priority);
presence->setType(type);
@@ -212,7 +213,7 @@ class PresenceOracleTest : public CppUnit::TestFixture {
return presence;
}
- void handlePresenceChange(boost::shared_ptr<Presence> newPresence) {
+ void handlePresenceChange(std::shared_ptr<Presence> newPresence) {
changes.push_back(newPresence);
}
@@ -223,8 +224,8 @@ class PresenceOracleTest : public CppUnit::TestFixture {
subscriptionRequests.push_back(subscriptionRequest);
}
- boost::shared_ptr<Presence> createPresence(const JID& jid) {
- boost::shared_ptr<Presence> sentPresence(new Presence("blarb"));
+ std::shared_ptr<Presence> createPresence(const JID& jid) {
+ std::shared_ptr<Presence> sentPresence(new Presence("blarb"));
sentPresence->setFrom(jid);
return sentPresence;
}
diff --git a/Swiften/PubSub/PubSubManager.h b/Swiften/PubSub/PubSubManager.h
index daed7e5..c143a81 100644
--- a/Swiften/PubSub/PubSubManager.h
+++ b/Swiften/PubSub/PubSubManager.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -34,8 +34,8 @@
#include <Swiften/PubSub/PubSubUtil.h>
#include <Swiften/Queries/PubSubRequest.h>
#define SWIFTEN_PUBSUBMANAGER_DECLARE_CREATE_REQUEST(payload, container, response) \
- virtual boost::shared_ptr< PubSubRequest<payload> > \
- createRequest(IQ::Type, const JID&, boost::shared_ptr<payload>) = 0;
+ virtual std::shared_ptr< PubSubRequest<payload> > \
+ createRequest(IQ::Type, const JID&, std::shared_ptr<payload>) = 0;
namespace Swift {
class JID;
@@ -47,6 +47,6 @@ namespace Swift {
SWIFTEN_PUBSUB_FOREACH_PUBSUB_PAYLOAD_TYPE(
SWIFTEN_PUBSUBMANAGER_DECLARE_CREATE_REQUEST)
- boost::signal<void (const JID&, const boost::shared_ptr<PubSubEventPayload>)> onEvent;
+ boost::signal<void (const JID&, const std::shared_ptr<PubSubEventPayload>)> onEvent;
};
}
diff --git a/Swiften/PubSub/PubSubManagerImpl.cpp b/Swiften/PubSub/PubSubManagerImpl.cpp
index b186a08..12eb25c 100644
--- a/Swiften/PubSub/PubSubManagerImpl.cpp
+++ b/Swiften/PubSub/PubSubManagerImpl.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -24,8 +24,8 @@ PubSubManagerImpl::~PubSubManagerImpl() {
stanzaChannel->onMessageReceived.disconnect(boost::bind(&PubSubManagerImpl::handleMessageRecevied, this, _1));
}
-void PubSubManagerImpl::handleMessageRecevied(boost::shared_ptr<Message> message) {
- if (boost::shared_ptr<PubSubEvent> event = message->getPayload<PubSubEvent>()) {
+void PubSubManagerImpl::handleMessageRecevied(std::shared_ptr<Message> message) {
+ if (std::shared_ptr<PubSubEvent> event = message->getPayload<PubSubEvent>()) {
onEvent(message->getFrom(), event->getPayload());
}
}
diff --git a/Swiften/PubSub/PubSubManagerImpl.h b/Swiften/PubSub/PubSubManagerImpl.h
index c752b84..58c5fc0 100644
--- a/Swiften/PubSub/PubSubManagerImpl.h
+++ b/Swiften/PubSub/PubSubManagerImpl.h
@@ -6,15 +6,15 @@
#pragma once
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/PubSub/PubSubManager.h>
#define SWIFTEN_PUBSUBMANAGERIMPL_DECLARE_CREATE_REQUEST(payload, container, response) \
- virtual boost::shared_ptr< PubSubRequest<payload> > \
- createRequest(IQ::Type type, const JID& receiver, boost::shared_ptr<payload> p) SWIFTEN_OVERRIDE { \
- return boost::make_shared< PubSubRequest<payload> >(type, receiver, p, router); \
+ virtual std::shared_ptr< PubSubRequest<payload> > \
+ createRequest(IQ::Type type, const JID& receiver, std::shared_ptr<payload> p) SWIFTEN_OVERRIDE { \
+ return std::make_shared< PubSubRequest<payload> >(type, receiver, p, router); \
}
namespace Swift {
@@ -31,7 +31,7 @@ namespace Swift {
SWIFTEN_PUBSUBMANAGERIMPL_DECLARE_CREATE_REQUEST)
private:
- void handleMessageRecevied(boost::shared_ptr<Message>);
+ void handleMessageRecevied(std::shared_ptr<Message>);
private:
StanzaChannel* stanzaChannel;
diff --git a/Swiften/QA/ClientTest/ClientTest.cpp b/Swiften/QA/ClientTest/ClientTest.cpp
index f34a501..9684234 100644
--- a/Swiften/QA/ClientTest/ClientTest.cpp
+++ b/Swiften/QA/ClientTest/ClientTest.cpp
@@ -42,7 +42,7 @@ static void handleDisconnected(boost::optional<ClientError> e) {
}
}
-static void handleRosterReceived(boost::shared_ptr<Payload>) {
+static void handleRosterReceived(std::shared_ptr<Payload>) {
rosterReceived = true;
std::cout << "Disconnecting" << std::endl;
client->disconnect();
diff --git a/Swiften/QA/ConcurrentFileTransferTest/ConcurrentFileTransferTest.cpp b/Swiften/QA/ConcurrentFileTransferTest/ConcurrentFileTransferTest.cpp
index b9ec7b8..8122c63 100644
--- a/Swiften/QA/ConcurrentFileTransferTest/ConcurrentFileTransferTest.cpp
+++ b/Swiften/QA/ConcurrentFileTransferTest/ConcurrentFileTransferTest.cpp
@@ -36,8 +36,8 @@ using namespace Swift;
static const std::string CLIENT_NAME = "Swiften FT Test";
static const std::string CLIENT_NODE = "http://swift.im";
-static boost::shared_ptr<SimpleEventLoop> eventLoop;
-static boost::shared_ptr<BoostNetworkFactories> networkFactories;
+static std::shared_ptr<SimpleEventLoop> eventLoop;
+static std::shared_ptr<BoostNetworkFactories> networkFactories;
BoostRandomGenerator randGen;
@@ -56,12 +56,12 @@ class ConcurrentFileTransferTest {
private:
int clientACandidates_;
- boost::shared_ptr<Client> clientA_;
+ std::shared_ptr<Client> clientA_;
std::map<std::string, ByteArray> clientASendFiles_;
int clientBCandidates_;
- boost::shared_ptr<Client> clientB_;
+ std::shared_ptr<Client> clientB_;
};
/**
diff --git a/Swiften/QA/DNSSDTest/DNSSDTest.cpp b/Swiften/QA/DNSSDTest/DNSSDTest.cpp
index 3b7191d..ae2fafd 100644
--- a/Swiften/QA/DNSSDTest/DNSSDTest.cpp
+++ b/Swiften/QA/DNSSDTest/DNSSDTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -35,7 +35,7 @@ class DNSSDTest : public CppUnit::TestFixture {
public:
void setUp() {
eventLoop = new DummyEventLoop();
- querier = boost::shared_ptr<DNSSDQuerier>(new DNSSDQuerierType());
+ querier = std::make_shared<DNSSDQuerier>();
querier->start();
}
@@ -46,7 +46,7 @@ class DNSSDTest : public CppUnit::TestFixture {
}
void testPublish() {
- boost::shared_ptr<DNSSDBrowseQuery> browseQuery = querier->createBrowseQuery();
+ std::shared_ptr<DNSSDBrowseQuery> browseQuery = querier->createBrowseQuery();
browseQuery->onServiceAdded.connect(boost::bind(&DNSSDTest::handleServiceAdded, this, _1));
browseQuery->onServiceRemoved.connect(boost::bind(&DNSSDTest::handleServiceRemoved, this, _1));
browseQuery->onError.connect(boost::bind(&DNSSDTest::handleBrowseError, this));
@@ -55,7 +55,7 @@ class DNSSDTest : public CppUnit::TestFixture {
// Publish the service
LinkLocalServiceInfo info;
- boost::shared_ptr<DNSSDRegisterQuery> registerQuery = querier->createRegisterQuery("DNSSDTest", 1234, info.toTXTRecord());
+ std::shared_ptr<DNSSDRegisterQuery> registerQuery = querier->createRegisterQuery("DNSSDTest", 1234, info.toTXTRecord());
registerQuery->onRegisterFinished.connect(boost::bind(&DNSSDTest::handleRegisterFinished, this, _1));
registerQuery->registerService();
@@ -82,7 +82,7 @@ class DNSSDTest : public CppUnit::TestFixture {
// Resolve all added services
for (size_t i = 0; i < added.size(); ++i) {
resolvedServices.clear();
- boost::shared_ptr<DNSSDResolveServiceQuery> resolveServiceQuery = querier->createResolveServiceQuery(added[i]);
+ std::shared_ptr<DNSSDResolveServiceQuery> resolveServiceQuery = querier->createResolveServiceQuery(added[i]);
resolveServiceQuery->onServiceResolved.connect(boost::bind(&DNSSDTest::handleResolveFinished, this, _1));
resolveServiceQuery->start();
wait();
@@ -137,7 +137,7 @@ class DNSSDTest : public CppUnit::TestFixture {
private:
DummyEventLoop* eventLoop;
- boost::shared_ptr<DNSSDQuerier> querier;
+ std::shared_ptr<DNSSDQuerier> querier;
std::vector<DNSSDServiceID> added;
std::vector<DNSSDServiceID> registered;
std::vector<DNSSDServiceID> toRemove;
diff --git a/Swiften/QA/FileTransferTest/FileTransferTest.cpp b/Swiften/QA/FileTransferTest/FileTransferTest.cpp
index 8017927..dd8c139 100644
--- a/Swiften/QA/FileTransferTest/FileTransferTest.cpp
+++ b/Swiften/QA/FileTransferTest/FileTransferTest.cpp
@@ -35,8 +35,8 @@ using namespace Swift;
static const std::string CLIENT_NAME = "Swiften FT Test";
static const std::string CLIENT_NODE = "http://swift.im";
-static boost::shared_ptr<SimpleEventLoop> eventLoop;
-static boost::shared_ptr<BoostNetworkFactories> networkFactories;
+static std::shared_ptr<SimpleEventLoop> eventLoop;
+static std::shared_ptr<BoostNetworkFactories> networkFactories;
BoostRandomGenerator randGen;
@@ -50,12 +50,12 @@ enum Candidate {
class FileTransferTest {
public:
FileTransferTest(int senderCandidates, int receiverCandidates) : senderCandidates_(senderCandidates), senderError_(FileTransferError::UnknownError), senderIsDone_(false), receiverCandidates_(receiverCandidates), receiverError_(FileTransferError::UnknownError), receiverIsDone_(false) {
- sender_ = boost::make_shared<Client>(JID(getenv("SWIFT_FILETRANSFERTEST_JID")), getenv("SWIFT_FILETRANSFERTEST_PASS"), networkFactories.get());
+ sender_ = std::make_shared<Client>(JID(getenv("SWIFT_FILETRANSFERTEST_JID")), getenv("SWIFT_FILETRANSFERTEST_PASS"), networkFactories.get());
sender_->onDisconnected.connect(boost::bind(&FileTransferTest::handleSenderDisconnected, this, _1));
sender_->onConnected.connect(boost::bind(&FileTransferTest::handleSenderConnected, this));
sender_->getEntityCapsProvider()->onCapsChanged.connect(boost::bind(&FileTransferTest::handleSenderCapsChanged, this, _1));
- receiver_ = boost::make_shared<Client>(JID(getenv("SWIFT_FILETRANSFERTEST2_JID")), getenv("SWIFT_FILETRANSFERTEST2_PASS"), networkFactories.get());
+ receiver_ = std::make_shared<Client>(JID(getenv("SWIFT_FILETRANSFERTEST2_JID")), getenv("SWIFT_FILETRANSFERTEST2_PASS"), networkFactories.get());
receiver_->onConnected.connect(boost::bind(&FileTransferTest::handleReceiverConnected, this));
receiver_->onDisconnected.connect(boost::bind(&FileTransferTest::handleReceiverDisconnected, this, _1));
@@ -145,7 +145,7 @@ class FileTransferTest {
void handleReceiverIncomingFileTransfer(IncomingFileTransfer::ref transfer) {
incomingFileTransfers_.push_back(transfer);
- boost::shared_ptr<FileWriteBytestream> out = boost::make_shared<FileWriteBytestream>(receiveFilePath_.native());
+ std::shared_ptr<FileWriteBytestream> out = std::make_shared<FileWriteBytestream>(receiveFilePath_.native());
transfer->onFinished.connect(boost::bind(&FileTransferTest::handleReceiverFileTransferFinished, this, _1, out));
FileTransferOptions options;
@@ -164,7 +164,7 @@ class FileTransferTest {
void handleSenderCapsChanged(const JID &jid) {
if (receiver_ && (receiver_->getJID().toBare() == jid.toBare())) {
- boost::shared_ptr<FileReadBytestream> fileStream = boost::make_shared<FileReadBytestream>(sendFilePath_);
+ std::shared_ptr<FileReadBytestream> fileStream = std::make_shared<FileReadBytestream>(sendFilePath_);
FileTransferOptions options;
options = options.withInBandAllowed(senderCandidates_ & InBandBytestream);
@@ -191,7 +191,7 @@ class FileTransferTest {
}
}
- void handleReceiverFileTransferFinished(const boost::optional<FileTransferError>& error, boost::shared_ptr<FileWriteBytestream> out) {
+ void handleReceiverFileTransferFinished(const boost::optional<FileTransferError>& error, std::shared_ptr<FileWriteBytestream> out) {
out->close();
receiverError_ = error;
receiverIsDone_ = true;
@@ -276,7 +276,7 @@ class FileTransferTest {
private:
int senderCandidates_;
- boost::shared_ptr<Client> sender_;
+ std::shared_ptr<Client> sender_;
ClientXMLTracer* senderTracer_;
ByteArray sendData_;
OutgoingFileTransfer::ref outgoingFileTransfer_;
@@ -285,7 +285,7 @@ class FileTransferTest {
bool senderIsDone_;
int receiverCandidates_;
- boost::shared_ptr<Client> receiver_;
+ std::shared_ptr<Client> receiver_;
ClientXMLTracer* receiverTracer_;
ByteArray receiveData_;
std::vector<IncomingFileTransfer::ref> incomingFileTransfers_;
@@ -302,10 +302,10 @@ static bool runTest(int senderCandidates, int receiverCandidates) {
std::cout << "senderCandidates: " << senderCandidates << ", receiverCandidates: " << receiverCandidates << std::endl;
bool expectSuccess = (senderCandidates & receiverCandidates) > 0;
- eventLoop = boost::make_shared<SimpleEventLoop>();
- networkFactories = boost::make_shared<BoostNetworkFactories>(eventLoop.get());
+ eventLoop = std::make_shared<SimpleEventLoop>();
+ networkFactories = std::make_shared<BoostNetworkFactories>(eventLoop.get());
- boost::shared_ptr<FileTransferTest> testRun = boost::make_shared<FileTransferTest>(senderCandidates, receiverCandidates);
+ std::shared_ptr<FileTransferTest> testRun = std::make_shared<FileTransferTest>(senderCandidates, receiverCandidates);
testRun->run();
diff --git a/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp b/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp
index a415a0f..11b0eb5 100644
--- a/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp
+++ b/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp
@@ -1,13 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -194,7 +193,7 @@ class BoostConnectionServerTest : public CppUnit::TestFixture {
stoppedError_ = e;
}
- void handleNewConnection(boost::shared_ptr<Connection> connection) {
+ void handleNewConnection(std::shared_ptr<Connection> connection) {
receivedNewConnection_ = true;
remoteAddress_ = connection->getRemoteAddress();
}
diff --git a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp
index f09e1a7..12c4a77 100755
--- a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp
+++ b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp
@@ -4,11 +4,10 @@
* See the COPYING file for more information.
*/
+#include <memory>
#include <string>
#include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -38,7 +37,7 @@ class BoostConnectionTest : public CppUnit::TestFixture {
void setUp() {
eventLoop_ = new DummyEventLoop();
boostIOServiceThread_ = new BoostIOServiceThread();
- boostIOService_ = boost::make_shared<boost::asio::io_service>();
+ boostIOService_ = std::make_shared<boost::asio::io_service>();
disconnected_ = false;
connectFinished_ = false;
}
@@ -145,7 +144,7 @@ class BoostConnectionTest : public CppUnit::TestFixture {
connection->write(createSafeByteArray("\r\n\r\n")); // Temporarily, while we don't have an xmpp server running on ipv6
}
- void handleDataRead(boost::shared_ptr<SafeByteArray> data) {
+ void handleDataRead(std::shared_ptr<SafeByteArray> data) {
append(receivedData_, *data);
}
@@ -159,7 +158,7 @@ class BoostConnectionTest : public CppUnit::TestFixture {
private:
BoostIOServiceThread* boostIOServiceThread_;
- boost::shared_ptr<boost::asio::io_service> boostIOService_;
+ std::shared_ptr<boost::asio::io_service> boostIOService_;
DummyEventLoop* eventLoop_;
ByteArray receivedData_;
bool disconnected_;
diff --git a/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp b/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp
index 05dd3a1..d45d118 100644
--- a/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp
+++ b/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp
@@ -67,7 +67,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
void setUp() {
ioServiceThread = new BoostIOServiceThread();
eventLoop = new DummyEventLoop();
- idnConverter = boost::shared_ptr<IDNConverter>(PlatformIDNConverter::create());
+ idnConverter = std::shared_ptr<IDNConverter>(PlatformIDNConverter::create());
#ifdef USE_UNBOUND
resolver = new UnboundDomainNameResolver(idnConverter.get(), ioServiceThread->getIOService(), eventLoop);
#else
@@ -83,7 +83,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
}
void testResolveAddress() {
- boost::shared_ptr<DomainNameAddressQuery> query(createAddressQuery("xmpp.test.swift.im"));
+ std::shared_ptr<DomainNameAddressQuery> query(createAddressQuery("xmpp.test.swift.im"));
query->run();
waitForResults();
@@ -94,7 +94,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
}
void testResolveAddress_Error() {
- boost::shared_ptr<DomainNameAddressQuery> query(createAddressQuery("invalid.test.swift.im"));
+ std::shared_ptr<DomainNameAddressQuery> query(createAddressQuery("invalid.test.swift.im"));
query->run();
waitForResults();
@@ -103,7 +103,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
}
void testResolveAddress_IPv6() {
- boost::shared_ptr<DomainNameAddressQuery> query(createAddressQuery("xmpp-ipv6.test.swift.im"));
+ std::shared_ptr<DomainNameAddressQuery> query(createAddressQuery("xmpp-ipv6.test.swift.im"));
query->run();
waitForResults();
@@ -113,7 +113,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
}
void testResolveAddress_IPv4and6() {
- boost::shared_ptr<DomainNameAddressQuery> query(createAddressQuery("xmpp-ipv46.test.swift.im"));
+ std::shared_ptr<DomainNameAddressQuery> query(createAddressQuery("xmpp-ipv46.test.swift.im"));
query->run();
waitForResults();
@@ -125,7 +125,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
}
void testResolveAddress_International() {
- boost::shared_ptr<DomainNameAddressQuery> query(createAddressQuery("tron\xc3\xa7on.test.swift.im"));
+ std::shared_ptr<DomainNameAddressQuery> query(createAddressQuery("tron\xc3\xa7on.test.swift.im"));
query->run();
waitForResults();
@@ -136,7 +136,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
}
void testResolveAddress_Localhost() {
- boost::shared_ptr<DomainNameAddressQuery> query(createAddressQuery("localhost"));
+ std::shared_ptr<DomainNameAddressQuery> query(createAddressQuery("localhost"));
query->run();
waitForResults();
@@ -172,7 +172,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
}
void testResolveService() {
- boost::shared_ptr<DomainNameServiceQuery> query(createServiceQuery("_xmpp-client._tcp.", "xmpp-srv.test.swift.im"));
+ std::shared_ptr<DomainNameServiceQuery> query(createServiceQuery("_xmpp-client._tcp.", "xmpp-srv.test.swift.im"));
query->run();
waitForResults();
@@ -200,8 +200,8 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<DomainNameAddressQuery> createAddressQuery(const std::string& domain) {
- boost::shared_ptr<DomainNameAddressQuery> result = resolver->createAddressQuery(domain);
+ std::shared_ptr<DomainNameAddressQuery> createAddressQuery(const std::string& domain) {
+ std::shared_ptr<DomainNameAddressQuery> result = resolver->createAddressQuery(domain);
result->onResult.connect(boost::bind(&DomainNameResolverTest::handleAddressQueryResult, this, _1, _2));
return result;
}
@@ -214,8 +214,8 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
resultsAvailable = true;
}
- boost::shared_ptr<DomainNameServiceQuery> createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) {
- boost::shared_ptr<DomainNameServiceQuery> result = resolver->createServiceQuery(serviceLookupPrefix, domain);
+ std::shared_ptr<DomainNameServiceQuery> createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) {
+ std::shared_ptr<DomainNameServiceQuery> result = resolver->createServiceQuery(serviceLookupPrefix, domain);
result->onResult.connect(boost::bind(&DomainNameResolverTest::handleServiceQueryResult, this, _1));
return result;
}
@@ -241,8 +241,8 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
private:
BoostIOServiceThread* ioServiceThread;
DummyEventLoop* eventLoop;
- boost::shared_ptr<IDNConverter> idnConverter;
- boost::shared_ptr<TimerFactory> timerFactory;
+ std::shared_ptr<IDNConverter> idnConverter;
+ std::shared_ptr<TimerFactory> timerFactory;
bool resultsAvailable;
std::vector<HostAddress> addressQueryResult;
std::vector<HostAddress> allAddressQueryResults;
diff --git a/Swiften/QA/ReconnectTest/ReconnectTest.cpp b/Swiften/QA/ReconnectTest/ReconnectTest.cpp
index 611c846..27c7e23 100644
--- a/Swiften/QA/ReconnectTest/ReconnectTest.cpp
+++ b/Swiften/QA/ReconnectTest/ReconnectTest.cpp
@@ -25,7 +25,7 @@ Client* client_;
SimpleEventLoop eventLoop_;
int count = 0;
-void handleTick(boost::shared_ptr<BoostTimer> timer) {
+void handleTick(std::shared_ptr<BoostTimer> timer) {
std::cout << "Count " << count++ << std::endl;
if (timer) {
timer->stop();
@@ -43,7 +43,7 @@ void handleTick(boost::shared_ptr<BoostTimer> timer) {
int delay = 500;
// int delay = 0;
- boost::shared_ptr<BoostTimer> newTimer(BoostTimer::create(delay, &MainBoostIOServiceThread::getInstance().getIOService()));
+ std::shared_ptr<BoostTimer> newTimer(BoostTimer::create(delay, &MainBoostIOServiceThread::getInstance().getIOService()));
newTimer->onTick.connect(boost::bind(&handleTick, timer));
newTimer->start();
}
@@ -64,7 +64,7 @@ int main(int, char**) {
std::string pass(passChars);
client_ = new Swift::Client(jid, pass);
- handleTick(boost::shared_ptr<BoostTimer>());
+ handleTick(std::shared_ptr<BoostTimer>());
eventLoop_.run();
delete client_;
diff --git a/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp b/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp
index 5b3867c..e601de9 100644
--- a/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp
+++ b/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp
@@ -32,24 +32,24 @@ class FileReadBytestreamTest : public CppUnit::TestFixture {
}
void testRead() {
- boost::shared_ptr<FileReadBytestream> testling(createTestling());
+ std::shared_ptr<FileReadBytestream> testling(createTestling());
- boost::shared_ptr< std::vector<unsigned char> > result = testling->read(10);
+ std::shared_ptr< std::vector<unsigned char> > result = testling->read(10);
CPPUNIT_ASSERT(createByteArray("/*\n * Copy") == *result.get());
}
void testRead_Twice() {
- boost::shared_ptr<FileReadBytestream> testling(createTestling());
+ std::shared_ptr<FileReadBytestream> testling(createTestling());
testling->read(10);
- boost::shared_ptr< std::vector<unsigned char> > result = testling->read(10);
+ std::shared_ptr< std::vector<unsigned char> > result = testling->read(10);
CPPUNIT_ASSERT_EQUAL(std::string("right (c) "), byteArrayToString(*result));
}
void testIsFinished_NotFinished() {
- boost::shared_ptr<FileReadBytestream> testling(createTestling());
+ std::shared_ptr<FileReadBytestream> testling(createTestling());
testling->read(10);
@@ -57,7 +57,7 @@ class FileReadBytestreamTest : public CppUnit::TestFixture {
}
void testIsFinished_IsFinished() {
- boost::shared_ptr<FileReadBytestream> testling(createTestling());
+ std::shared_ptr<FileReadBytestream> testling(createTestling());
testling->read(4096);
diff --git a/Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp b/Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp
index e847c28..d6963a4 100644
--- a/Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp
+++ b/Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp
@@ -29,7 +29,7 @@ class FileWriteBytestreamTest : public CppUnit::TestFixture {
void testSuccessfulWrite() {
boost::filesystem::path filename = boost::filesystem::unique_path("write_file_bytestream_test_%%%%%%%%%%%%%%%%.bin");
- boost::shared_ptr<WriteBytestream> writeBytestream = boost::make_shared<FileWriteBytestream>(filename.string());
+ std::shared_ptr<WriteBytestream> writeBytestream = std::make_shared<FileWriteBytestream>(filename.string());
writeBytestream->onWrite.connect(boost::bind(&FileWriteBytestreamTest::handleOnWrite, this, _1));
CPPUNIT_ASSERT_EQUAL(true, writeBytestream->write(createByteArray("Some data.")));
@@ -39,7 +39,7 @@ class FileWriteBytestreamTest : public CppUnit::TestFixture {
}
void testFailingWrite() {
- boost::shared_ptr<WriteBytestream> writeBytestream = boost::make_shared<FileWriteBytestream>("");
+ std::shared_ptr<WriteBytestream> writeBytestream = std::make_shared<FileWriteBytestream>("");
writeBytestream->onWrite.connect(boost::bind(&FileWriteBytestreamTest::handleOnWrite, this, _1));
CPPUNIT_ASSERT_EQUAL(false, writeBytestream->write(createByteArray("Some data.")));
diff --git a/Swiften/QA/StorageTest/VCardFileStorageTest.cpp b/Swiften/QA/StorageTest/VCardFileStorageTest.cpp
index 69e5917..0dae2f3 100644
--- a/Swiften/QA/StorageTest/VCardFileStorageTest.cpp
+++ b/Swiften/QA/StorageTest/VCardFileStorageTest.cpp
@@ -43,7 +43,7 @@ class VCardFileStorageTest : public CppUnit::TestFixture {
}
void testSetVCard() {
- boost::shared_ptr<VCardFileStorage> testling(createTestling());
+ std::shared_ptr<VCardFileStorage> testling(createTestling());
VCard::ref vcard(new VCard());
vcard->setFullName("Alice In Wonderland");
@@ -73,7 +73,7 @@ class VCardFileStorageTest : public CppUnit::TestFixture {
}
void testGetVCard() {
- boost::shared_ptr<VCardFileStorage> testling(createTestling());
+ std::shared_ptr<VCardFileStorage> testling(createTestling());
VCard::ref vcard(new VCard());
vcard->setFullName("Alice In Wonderland");
testling->setVCard(JID("alice@wonderland.lit"), vcard);
@@ -99,7 +99,7 @@ class VCardFileStorageTest : public CppUnit::TestFixture {
}
void testGetVCard_FileDoesNotExist() {
- boost::shared_ptr<VCardFileStorage> testling(createTestling());
+ std::shared_ptr<VCardFileStorage> testling(createTestling());
VCard::ref result = testling->getVCard(JID("alice@wonderland.lit"));
CPPUNIT_ASSERT(!result);
}
diff --git a/Swiften/QA/TLSTest/CertificateErrorTest.cpp b/Swiften/QA/TLSTest/CertificateErrorTest.cpp
index b928a3f..abd004e 100644
--- a/Swiften/QA/TLSTest/CertificateErrorTest.cpp
+++ b/Swiften/QA/TLSTest/CertificateErrorTest.cpp
@@ -50,7 +50,7 @@ class CertificateErrorTest : public CppUnit::TestFixture {
void setUp() {
eventLoop_ = new DummyEventLoop();
boostIOServiceThread_ = new BoostIOServiceThread();
- boostIOService_ = boost::make_shared<boost::asio::io_service>();
+ boostIOService_ = std::make_shared<boost::asio::io_service>();
connectionFactory_ = new BoostConnectionFactory(boostIOServiceThread_->getIOService(), eventLoop_);
idnConverter_ = PlatformIDNConverter::create();
domainNameResolver_ = new PlatformDomainNameResolver(idnConverter_, eventLoop_);
@@ -81,7 +81,7 @@ class CertificateErrorTest : public CppUnit::TestFixture {
}
HostAddress resolveName(const std::string& name) {
- boost::shared_ptr<DomainNameAddressQuery> query = domainNameResolver_->createAddressQuery(name);
+ std::shared_ptr<DomainNameAddressQuery> query = domainNameResolver_->createAddressQuery(name);
query->onResult.connect(boost::bind(&CertificateErrorTest::handleAddressQueryResult, this, _1, _2));
lastResoverResult_ = HostAddress();
resolvingDone_ = false;
@@ -94,7 +94,7 @@ class CertificateErrorTest : public CppUnit::TestFixture {
return lastResoverResult_;
}
- void connectToServer(boost::shared_ptr<TLSConnection> connection, const std::string& hostname, int port) {
+ void connectToServer(std::shared_ptr<TLSConnection> connection, const std::string& hostname, int port) {
connection->onConnectFinished.connect(boost::bind(&CertificateErrorTest::handleConnectFinished, this, _1));
HostAddress address = resolveName(hostname);
@@ -107,7 +107,7 @@ class CertificateErrorTest : public CppUnit::TestFixture {
}
void testTLS_O_MaticTrusted() {
- boost::shared_ptr<TLSConnection> connection = boost::dynamic_pointer_cast<TLSConnection>(tlsConnectionFactory_->createConnection());
+ std::shared_ptr<TLSConnection> connection = std::dynamic_pointer_cast<TLSConnection>(tlsConnectionFactory_->createConnection());
TLSContext* context = connection->getTLSContext();
connectToServer(connection, "test1.tls-o-matic.com", 443);
@@ -117,7 +117,7 @@ class CertificateErrorTest : public CppUnit::TestFixture {
}
void testTLS_O_MaticCertificateFromTheFuture() {
- boost::shared_ptr<TLSConnection> connection = boost::dynamic_pointer_cast<TLSConnection>(tlsConnectionFactory_->createConnection());
+ std::shared_ptr<TLSConnection> connection = std::dynamic_pointer_cast<TLSConnection>(tlsConnectionFactory_->createConnection());
TLSContext* context = connection->getTLSContext();
connectToServer(connection, "test5.tls-o-matic.com", 405);
@@ -133,7 +133,7 @@ class CertificateErrorTest : public CppUnit::TestFixture {
}
void testTLS_O_MaticCertificateFromThePast() {
- boost::shared_ptr<TLSConnection> connection = boost::dynamic_pointer_cast<TLSConnection>(tlsConnectionFactory_->createConnection());
+ std::shared_ptr<TLSConnection> connection = std::dynamic_pointer_cast<TLSConnection>(tlsConnectionFactory_->createConnection());
TLSContext* context = connection->getTLSContext();
connectToServer(connection, "test6.tls-o-matic.com", 406);
@@ -144,7 +144,7 @@ class CertificateErrorTest : public CppUnit::TestFixture {
}
void testTLS_O_MaticCertificateFromUnknownCA() {
- boost::shared_ptr<TLSConnection> connection = boost::dynamic_pointer_cast<TLSConnection>(tlsConnectionFactory_->createConnection());
+ std::shared_ptr<TLSConnection> connection = std::dynamic_pointer_cast<TLSConnection>(tlsConnectionFactory_->createConnection());
TLSContext* context = connection->getTLSContext();
connectToServer(connection, "test7.tls-o-matic.com", 407);
@@ -156,7 +156,7 @@ class CertificateErrorTest : public CppUnit::TestFixture {
// test14.tls-o-matic.com:414
void testTLS_O_MaticCertificateWrongPurpose() {
- boost::shared_ptr<TLSConnection> connection = boost::dynamic_pointer_cast<TLSConnection>(tlsConnectionFactory_->createConnection());
+ std::shared_ptr<TLSConnection> connection = std::dynamic_pointer_cast<TLSConnection>(tlsConnectionFactory_->createConnection());
TLSContext* context = connection->getTLSContext();
connectToServer(connection, "test14.tls-o-matic.com", 414);
@@ -168,7 +168,7 @@ class CertificateErrorTest : public CppUnit::TestFixture {
void testRevokedCertificateRevocationDisabled() {
tlsContextFactory_->setCheckCertificateRevocation(false);
- boost::shared_ptr<TLSConnection> connection = boost::dynamic_pointer_cast<TLSConnection>(tlsConnectionFactory_->createConnection());
+ std::shared_ptr<TLSConnection> connection = std::dynamic_pointer_cast<TLSConnection>(tlsConnectionFactory_->createConnection());
TLSContext* context = connection->getTLSContext();
connectToServer(connection, "revoked.grc.com", 443);
@@ -179,7 +179,7 @@ class CertificateErrorTest : public CppUnit::TestFixture {
void testRevokedCertificateRevocationEnabled() {
tlsContextFactory_->setCheckCertificateRevocation(true);
- boost::shared_ptr<TLSConnection> connection = boost::dynamic_pointer_cast<TLSConnection>(tlsConnectionFactory_->createConnection());
+ std::shared_ptr<TLSConnection> connection = std::dynamic_pointer_cast<TLSConnection>(tlsConnectionFactory_->createConnection());
TLSContext* context = connection->getTLSContext();
connectToServer(connection, "revoked.grc.com", 443);
@@ -204,7 +204,7 @@ class CertificateErrorTest : public CppUnit::TestFixture {
private:
BoostIOServiceThread* boostIOServiceThread_;
- boost::shared_ptr<boost::asio::io_service> boostIOService_;
+ std::shared_ptr<boost::asio::io_service> boostIOService_;
DummyEventLoop* eventLoop_;
ConnectionFactory* connectionFactory_;
PlatformTLSFactories* tlsFactories_;
diff --git a/Swiften/Queries/DummyIQChannel.h b/Swiften/Queries/DummyIQChannel.h
index 3f896e0..5ec68ca 100644
--- a/Swiften/Queries/DummyIQChannel.h
+++ b/Swiften/Queries/DummyIQChannel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -15,7 +15,7 @@ namespace Swift {
public:
DummyIQChannel() {}
- virtual void sendIQ(boost::shared_ptr<IQ> iq) {
+ virtual void sendIQ(std::shared_ptr<IQ> iq) {
iqs_.push_back(iq);
}
@@ -27,6 +27,6 @@ namespace Swift {
return true;
}
- std::vector<boost::shared_ptr<IQ> > iqs_;
+ std::vector<std::shared_ptr<IQ> > iqs_;
};
}
diff --git a/Swiften/Queries/GenericRequest.h b/Swiften/Queries/GenericRequest.h
index ad3ec19..2795a54 100644
--- a/Swiften/Queries/GenericRequest.h
+++ b/Swiften/Queries/GenericRequest.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -23,7 +23,7 @@ namespace Swift {
template<typename PAYLOAD_TYPE>
class SWIFTEN_API GenericRequest : public Request {
public:
- typedef boost::shared_ptr<GenericRequest<PAYLOAD_TYPE> > ref;
+ typedef std::shared_ptr<GenericRequest<PAYLOAD_TYPE> > ref;
public:
/**
@@ -36,7 +36,7 @@ namespace Swift {
GenericRequest(
IQ::Type type,
const JID& receiver,
- boost::shared_ptr<Payload> payload,
+ std::shared_ptr<Payload> payload,
IQRouter* router) :
Request(type, receiver, payload, router) {
}
@@ -53,7 +53,7 @@ namespace Swift {
IQ::Type type,
const JID& sender,
const JID& receiver,
- boost::shared_ptr<Payload> payload,
+ std::shared_ptr<Payload> payload,
IQRouter* router) :
Request(type, sender, receiver, payload, router) {
}
@@ -61,19 +61,19 @@ namespace Swift {
/**
* Internal method, do not use.
*/
- virtual void handleResponse(boost::shared_ptr<Payload> payload, ErrorPayload::ref error) {
- onResponse(boost::dynamic_pointer_cast<PAYLOAD_TYPE>(payload), error);
+ virtual void handleResponse(std::shared_ptr<Payload> payload, ErrorPayload::ref error) {
+ onResponse(std::dynamic_pointer_cast<PAYLOAD_TYPE>(payload), error);
}
public:
- boost::shared_ptr<PAYLOAD_TYPE> getPayloadGeneric() const {
- return boost::dynamic_pointer_cast<PAYLOAD_TYPE>(getPayload());
+ std::shared_ptr<PAYLOAD_TYPE> getPayloadGeneric() const {
+ return std::dynamic_pointer_cast<PAYLOAD_TYPE>(getPayload());
}
public:
/**
* Signal emitted when a reply to the iq has been received. Contains a payload if one was present, and an error if one was present.
*/
- boost::signal<void (boost::shared_ptr<PAYLOAD_TYPE>, ErrorPayload::ref)> onResponse;
+ boost::signal<void (std::shared_ptr<PAYLOAD_TYPE>, ErrorPayload::ref)> onResponse;
};
}
diff --git a/Swiften/Queries/GetResponder.h b/Swiften/Queries/GetResponder.h
index cda23d6..18dd694 100644
--- a/Swiften/Queries/GetResponder.h
+++ b/Swiften/Queries/GetResponder.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -16,6 +16,6 @@ namespace Swift {
GetResponder(IQRouter* router) : Responder<T>(router) {}
private:
- virtual bool handleSetRequest(const JID&, const JID&, const std::string&, boost::shared_ptr<T>) { return false; }
+ virtual bool handleSetRequest(const JID&, const JID&, const std::string&, std::shared_ptr<T>) { return false; }
};
}
diff --git a/Swiften/Queries/IQChannel.h b/Swiften/Queries/IQChannel.h
index d762847..2974ecc 100644
--- a/Swiften/Queries/IQChannel.h
+++ b/Swiften/Queries/IQChannel.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/IQ.h>
@@ -19,11 +18,11 @@ namespace Swift {
public:
virtual ~IQChannel();
- virtual void sendIQ(boost::shared_ptr<IQ>) = 0;
+ virtual void sendIQ(std::shared_ptr<IQ>) = 0;
virtual std::string getNewIQID() = 0;
virtual bool isAvailable() const = 0;
- boost::signal<void (boost::shared_ptr<IQ>)> onIQReceived;
+ boost::signal<void (std::shared_ptr<IQ>)> onIQReceived;
};
}
diff --git a/Swiften/Queries/IQHandler.h b/Swiften/Queries/IQHandler.h
index 3581b85..1bfdf0f 100644
--- a/Swiften/Queries/IQHandler.h
+++ b/Swiften/Queries/IQHandler.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/IQ.h>
@@ -18,6 +18,6 @@ namespace Swift {
public:
virtual ~IQHandler();
- virtual bool handleIQ(boost::shared_ptr<IQ>) = 0;
+ virtual bool handleIQ(std::shared_ptr<IQ>) = 0;
};
}
diff --git a/Swiften/Queries/IQRouter.cpp b/Swiften/Queries/IQRouter.cpp
index b32cdf1..e28c2f4 100644
--- a/Swiften/Queries/IQRouter.cpp
+++ b/Swiften/Queries/IQRouter.cpp
@@ -30,13 +30,13 @@ bool IQRouter::isAvailable() {
return channel_->isAvailable();
}
-void IQRouter::handleIQ(boost::shared_ptr<IQ> iq) {
+void IQRouter::handleIQ(std::shared_ptr<IQ> iq) {
queueRemoves_ = true;
bool handled = false;
// Go through the handlers in reverse order, to give precedence to the last added handler
- std::vector<boost::shared_ptr<IQHandler> >::const_reverse_iterator i = handlers_.rbegin();
- std::vector<boost::shared_ptr<IQHandler> >::const_reverse_iterator rend = handlers_.rend();
+ std::vector<std::shared_ptr<IQHandler> >::const_reverse_iterator i = handlers_.rbegin();
+ std::vector<std::shared_ptr<IQHandler> >::const_reverse_iterator rend = handlers_.rend();
for (; i != rend; ++i) {
handled |= (*i)->handleIQ(iq);
if (handled) {
@@ -53,25 +53,25 @@ void IQRouter::handleIQ(boost::shared_ptr<IQ> iq) {
}
void IQRouter::processPendingRemoves() {
- foreach(boost::shared_ptr<IQHandler> handler, queuedRemoves_) {
+ foreach(std::shared_ptr<IQHandler> handler, queuedRemoves_) {
erase(handlers_, handler);
}
queuedRemoves_.clear();
}
void IQRouter::addHandler(IQHandler* handler) {
- addHandler(boost::shared_ptr<IQHandler>(handler, noop));
+ addHandler(std::shared_ptr<IQHandler>(handler, noop));
}
void IQRouter::removeHandler(IQHandler* handler) {
- removeHandler(boost::shared_ptr<IQHandler>(handler, noop));
+ removeHandler(std::shared_ptr<IQHandler>(handler, noop));
}
-void IQRouter::addHandler(boost::shared_ptr<IQHandler> handler) {
+void IQRouter::addHandler(std::shared_ptr<IQHandler> handler) {
handlers_.push_back(handler);
}
-void IQRouter::removeHandler(boost::shared_ptr<IQHandler> handler) {
+void IQRouter::removeHandler(std::shared_ptr<IQHandler> handler) {
if (queueRemoves_) {
queuedRemoves_.push_back(handler);
}
@@ -80,7 +80,7 @@ void IQRouter::removeHandler(boost::shared_ptr<IQHandler> handler) {
}
}
-void IQRouter::sendIQ(boost::shared_ptr<IQ> iq) {
+void IQRouter::sendIQ(std::shared_ptr<IQ> iq) {
if (from_.isValid() && !iq->getFrom().isValid()) {
iq->setFrom(from_);
}
diff --git a/Swiften/Queries/IQRouter.h b/Swiften/Queries/IQRouter.h
index 376fb08..eda7cfb 100644
--- a/Swiften/Queries/IQRouter.h
+++ b/Swiften/Queries/IQRouter.h
@@ -6,11 +6,10 @@
#pragma once
+#include <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/IQ.h>
@@ -50,8 +49,8 @@ namespace Swift {
void addHandler(IQHandler* handler);
void removeHandler(IQHandler* handler);
- void addHandler(boost::shared_ptr<IQHandler> handler);
- void removeHandler(boost::shared_ptr<IQHandler> handler);
+ void addHandler(std::shared_ptr<IQHandler> handler);
+ void removeHandler(std::shared_ptr<IQHandler> handler);
/**
* Sends an IQ stanza.
@@ -60,7 +59,7 @@ namespace Swift {
* be set as the 'from' address on iq before sending
* it.
*/
- void sendIQ(boost::shared_ptr<IQ> iq);
+ void sendIQ(std::shared_ptr<IQ> iq);
std::string getNewIQID();
bool isAvailable();
@@ -76,15 +75,15 @@ namespace Swift {
}
private:
- void handleIQ(boost::shared_ptr<IQ> iq);
+ void handleIQ(std::shared_ptr<IQ> iq);
void processPendingRemoves();
private:
IQChannel* channel_;
JID jid_;
JID from_;
- std::vector< boost::shared_ptr<IQHandler> > handlers_;
- std::vector< boost::shared_ptr<IQHandler> > queuedRemoves_;
+ std::vector< std::shared_ptr<IQHandler> > handlers_;
+ std::vector< std::shared_ptr<IQHandler> > queuedRemoves_;
bool queueRemoves_;
};
}
diff --git a/Swiften/Queries/PubSubRequest.h b/Swiften/Queries/PubSubRequest.h
index 7218f83..888b531 100644
--- a/Swiften/Queries/PubSubRequest.h
+++ b/Swiften/Queries/PubSubRequest.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -56,10 +56,10 @@ namespace Swift {
PubSubRequest(
IQ::Type type,
const JID& receiver,
- boost::shared_ptr<T> payload,
+ std::shared_ptr<T> payload,
IQRouter* router) :
Request(type, receiver, router) {
- boost::shared_ptr<ContainerType> wrapper = boost::make_shared<ContainerType>();
+ std::shared_ptr<ContainerType> wrapper = std::make_shared<ContainerType>();
wrapper->setPayload(payload);
setPayload(wrapper);
}
@@ -68,24 +68,24 @@ namespace Swift {
IQ::Type type,
const JID& sender,
const JID& receiver,
- boost::shared_ptr<T> payload,
+ std::shared_ptr<T> payload,
IQRouter* router) :
Request(type, sender, receiver, router) {
- boost::shared_ptr<ContainerType> wrapper = boost::make_shared<ContainerType>();
+ std::shared_ptr<ContainerType> wrapper = std::make_shared<ContainerType>();
wrapper->setPayload(payload);
setPayload(wrapper);
}
virtual void handleResponse(
- boost::shared_ptr<Payload> payload, ErrorPayload::ref error) {
- boost::shared_ptr<ResponseType> result;
- if (boost::shared_ptr<ContainerType> container = boost::dynamic_pointer_cast<ContainerType>(payload)) {
- result = boost::dynamic_pointer_cast<ResponseType>(container->getPayload());
+ std::shared_ptr<Payload> payload, ErrorPayload::ref error) {
+ std::shared_ptr<ResponseType> result;
+ if (std::shared_ptr<ContainerType> container = std::dynamic_pointer_cast<ContainerType>(payload)) {
+ result = std::dynamic_pointer_cast<ResponseType>(container->getPayload());
}
onResponse(result, error);
}
public:
- boost::signal<void (boost::shared_ptr<ResponseType>, ErrorPayload::ref)> onResponse;
+ boost::signal<void (std::shared_ptr<ResponseType>, ErrorPayload::ref)> onResponse;
};
}
diff --git a/Swiften/Queries/RawRequest.h b/Swiften/Queries/RawRequest.h
index c4ab85c..90290e8 100644
--- a/Swiften/Queries/RawRequest.h
+++ b/Swiften/Queries/RawRequest.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <typeinfo>
-#include <boost/smart_ptr/make_shared.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/ErrorPayload.h>
@@ -22,7 +21,7 @@
namespace Swift {
class SWIFTEN_API RawRequest : public Request {
public:
- typedef boost::shared_ptr<RawRequest> ref;
+ typedef std::shared_ptr<RawRequest> ref;
static ref create(IQ::Type type, const JID& recipient, const std::string& data, IQRouter* router) {
return ref(new RawRequest(type, recipient, data, router));
@@ -31,10 +30,10 @@ namespace Swift {
boost::signal<void (const std::string&)> onResponse;
private:
- RawRequest(IQ::Type type, const JID& receiver, const std::string& data, IQRouter* router) : Request(type, receiver, boost::make_shared<RawXMLPayload>(data), router) {
+ RawRequest(IQ::Type type, const JID& receiver, const std::string& data, IQRouter* router) : Request(type, receiver, std::make_shared<RawXMLPayload>(data), router) {
}
- virtual void handleResponse(boost::shared_ptr<Payload> payload, ErrorPayload::ref error) {
+ virtual void handleResponse(std::shared_ptr<Payload> payload, ErrorPayload::ref error) {
if (error) {
onResponse(ErrorSerializer(&serializers).serializePayload(error));
}
diff --git a/Swiften/Queries/Request.cpp b/Swiften/Queries/Request.cpp
index a8dff24..12eaae5 100644
--- a/Swiften/Queries/Request.cpp
+++ b/Swiften/Queries/Request.cpp
@@ -12,13 +12,13 @@
namespace Swift {
-Request::Request(IQ::Type type, const JID& receiver, boost::shared_ptr<Payload> payload, IQRouter* router) : router_(router), type_(type), receiver_(receiver), payload_(payload), sent_(false) {
+Request::Request(IQ::Type type, const JID& receiver, std::shared_ptr<Payload> payload, IQRouter* router) : router_(router), type_(type), receiver_(receiver), payload_(payload), sent_(false) {
}
Request::Request(IQ::Type type, const JID& receiver, IQRouter* router) : router_(router), type_(type), receiver_(receiver), sent_(false) {
}
-Request::Request(IQ::Type type, const JID& sender, const JID& receiver, boost::shared_ptr<Payload> payload, IQRouter* router) : router_(router), type_(type), sender_(sender), receiver_(receiver), payload_(payload), sent_(false) {
+Request::Request(IQ::Type type, const JID& sender, const JID& receiver, std::shared_ptr<Payload> payload, IQRouter* router) : router_(router), type_(type), sender_(sender), receiver_(receiver), payload_(payload), sent_(false) {
}
Request::Request(IQ::Type type, const JID& sender, const JID& receiver, IQRouter* router) : router_(router), type_(type), sender_(sender), receiver_(receiver), sent_(false) {
@@ -29,7 +29,7 @@ std::string Request::send() {
assert(!sent_);
sent_ = true;
- boost::shared_ptr<IQ> iq(new IQ(type_));
+ std::shared_ptr<IQ> iq(new IQ(type_));
iq->setTo(receiver_);
iq->setFrom(sender_);
iq->addPayload(payload_);
@@ -47,14 +47,14 @@ std::string Request::send() {
return id_;
}
-bool Request::handleIQ(boost::shared_ptr<IQ> iq) {
+bool Request::handleIQ(std::shared_ptr<IQ> iq) {
bool handled = false;
if (iq->getType() == IQ::Result || iq->getType() == IQ::Error) {
if (sent_ && iq->getID() == id_) {
if (isCorrectSender(iq->getFrom())) {
if (iq->getType() == IQ::Result) {
- boost::shared_ptr<Payload> payload = iq->getPayloadOfSameType(payload_);
- if (!payload && boost::dynamic_pointer_cast<RawXMLPayload>(payload_) && !iq->getPayloads().empty()) {
+ std::shared_ptr<Payload> payload = iq->getPayloadOfSameType(payload_);
+ if (!payload && std::dynamic_pointer_cast<RawXMLPayload>(payload_) && !iq->getPayloads().empty()) {
payload = iq->getPayloads().front();
}
handleResponse(payload, ErrorPayload::ref());
@@ -62,10 +62,10 @@ bool Request::handleIQ(boost::shared_ptr<IQ> iq) {
else {
ErrorPayload::ref errorPayload = iq->getPayload<ErrorPayload>();
if (errorPayload) {
- handleResponse(boost::shared_ptr<Payload>(), errorPayload);
+ handleResponse(std::shared_ptr<Payload>(), errorPayload);
}
else {
- handleResponse(boost::shared_ptr<Payload>(), ErrorPayload::ref(new ErrorPayload(ErrorPayload::UndefinedCondition)));
+ handleResponse(std::shared_ptr<Payload>(), ErrorPayload::ref(new ErrorPayload(ErrorPayload::UndefinedCondition)));
}
}
router_->removeHandler(this);
diff --git a/Swiften/Queries/Request.h b/Swiften/Queries/Request.h
index 7ad0dd6..a62c103 100644
--- a/Swiften/Queries/Request.h
+++ b/Swiften/Queries/Request.h
@@ -6,11 +6,10 @@
#pragma once
+#include <memory>
#include <string>
-#include <boost/enable_shared_from_this.hpp>
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/ErrorPayload.h>
@@ -23,7 +22,7 @@ namespace Swift {
/**
* An IQ get/set request query.
*/
- class SWIFTEN_API Request : public IQHandler, public boost::enable_shared_from_this<Request> {
+ class SWIFTEN_API Request : public IQHandler, public std::enable_shared_from_this<Request> {
public:
std::string send();
@@ -48,7 +47,7 @@ namespace Swift {
Request(
IQ::Type type,
const JID& receiver,
- boost::shared_ptr<Payload> payload,
+ std::shared_ptr<Payload> payload,
IQRouter* router);
/**
@@ -59,7 +58,7 @@ namespace Swift {
IQ::Type type,
const JID& sender,
const JID& receiver,
- boost::shared_ptr<Payload> payload,
+ std::shared_ptr<Payload> payload,
IQRouter* router);
@@ -81,18 +80,18 @@ namespace Swift {
IQRouter* router);
- virtual void setPayload(boost::shared_ptr<Payload> payload) {
+ virtual void setPayload(std::shared_ptr<Payload> payload) {
payload_ = payload;
}
- boost::shared_ptr<Payload> getPayload() const {
+ std::shared_ptr<Payload> getPayload() const {
return payload_;
}
- virtual void handleResponse(boost::shared_ptr<Payload>, boost::shared_ptr<ErrorPayload>) = 0;
+ virtual void handleResponse(std::shared_ptr<Payload>, std::shared_ptr<ErrorPayload>) = 0;
private:
- bool handleIQ(boost::shared_ptr<IQ>);
+ bool handleIQ(std::shared_ptr<IQ>);
bool isCorrectSender(const JID& jid);
private:
@@ -100,7 +99,7 @@ namespace Swift {
IQ::Type type_;
JID sender_;
JID receiver_;
- boost::shared_ptr<Payload> payload_;
+ std::shared_ptr<Payload> payload_;
std::string id_;
bool sent_;
};
diff --git a/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h b/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h
index ad4caf7..b187fa5 100644
--- a/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h
+++ b/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h
@@ -13,7 +13,7 @@
namespace Swift {
class SWIFTEN_API GetInBandRegistrationFormRequest : public GenericRequest<InBandRegistrationPayload> {
public:
- typedef boost::shared_ptr<GetInBandRegistrationFormRequest> ref;
+ typedef std::shared_ptr<GetInBandRegistrationFormRequest> ref;
static ref create(const JID& to, IQRouter* router) {
return ref(new GetInBandRegistrationFormRequest(to, router));
diff --git a/Swiften/Queries/Requests/GetPrivateStorageRequest.h b/Swiften/Queries/Requests/GetPrivateStorageRequest.h
index eecd4d4..e5904fe 100644
--- a/Swiften/Queries/Requests/GetPrivateStorageRequest.h
+++ b/Swiften/Queries/Requests/GetPrivateStorageRequest.h
@@ -6,8 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -19,27 +18,27 @@ namespace Swift {
template<typename PAYLOAD_TYPE>
class SWIFTEN_API GetPrivateStorageRequest : public Request {
public:
- typedef boost::shared_ptr<GetPrivateStorageRequest<PAYLOAD_TYPE> > ref;
+ typedef std::shared_ptr<GetPrivateStorageRequest<PAYLOAD_TYPE> > ref;
static ref create(IQRouter* router) {
return ref(new GetPrivateStorageRequest(router));
}
private:
- GetPrivateStorageRequest(IQRouter* router) : Request(IQ::Get, JID(), boost::make_shared<PrivateStorage>(boost::shared_ptr<Payload>(new PAYLOAD_TYPE())), router) {
+ GetPrivateStorageRequest(IQRouter* router) : Request(IQ::Get, JID(), std::make_shared<PrivateStorage>(std::make_shared<PAYLOAD_TYPE>()), router) {
}
- virtual void handleResponse(boost::shared_ptr<Payload> payload, ErrorPayload::ref error) {
- boost::shared_ptr<PrivateStorage> storage = boost::dynamic_pointer_cast<PrivateStorage>(payload);
+ virtual void handleResponse(std::shared_ptr<Payload> payload, ErrorPayload::ref error) {
+ std::shared_ptr<PrivateStorage> storage = std::dynamic_pointer_cast<PrivateStorage>(payload);
if (storage) {
- onResponse(boost::dynamic_pointer_cast<PAYLOAD_TYPE>(storage->getPayload()), error);
+ onResponse(std::dynamic_pointer_cast<PAYLOAD_TYPE>(storage->getPayload()), error);
}
else {
- onResponse(boost::shared_ptr<PAYLOAD_TYPE>(), error);
+ onResponse(std::shared_ptr<PAYLOAD_TYPE>(), error);
}
}
public:
- boost::signal<void (boost::shared_ptr<PAYLOAD_TYPE>, ErrorPayload::ref)> onResponse;
+ boost::signal<void (std::shared_ptr<PAYLOAD_TYPE>, ErrorPayload::ref)> onResponse;
};
}
diff --git a/Swiften/Queries/Requests/GetSecurityLabelsCatalogRequest.h b/Swiften/Queries/Requests/GetSecurityLabelsCatalogRequest.h
index a474be5..0a3502f 100644
--- a/Swiften/Queries/Requests/GetSecurityLabelsCatalogRequest.h
+++ b/Swiften/Queries/Requests/GetSecurityLabelsCatalogRequest.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/SecurityLabelsCatalog.h>
@@ -15,7 +15,7 @@
namespace Swift {
class SWIFTEN_API GetSecurityLabelsCatalogRequest : public GenericRequest<SecurityLabelsCatalog> {
public:
- typedef boost::shared_ptr<GetSecurityLabelsCatalogRequest> ref;
+ typedef std::shared_ptr<GetSecurityLabelsCatalogRequest> ref;
static ref create(const JID& recipient, IQRouter* router) {
return ref(new GetSecurityLabelsCatalogRequest(recipient, router));
@@ -26,7 +26,7 @@ namespace Swift {
const JID& recipient,
IQRouter* router) :
GenericRequest<SecurityLabelsCatalog>(
- IQ::Get, JID(), boost::make_shared<SecurityLabelsCatalog>(recipient), router) {
+ IQ::Get, JID(), std::make_shared<SecurityLabelsCatalog>(recipient), router) {
}
};
}
diff --git a/Swiften/Queries/Requests/GetSoftwareVersionRequest.h b/Swiften/Queries/Requests/GetSoftwareVersionRequest.h
index 9533651..5660dd8 100644
--- a/Swiften/Queries/Requests/GetSoftwareVersionRequest.h
+++ b/Swiften/Queries/Requests/GetSoftwareVersionRequest.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/SoftwareVersion.h>
@@ -15,7 +15,7 @@
namespace Swift {
class SWIFTEN_API GetSoftwareVersionRequest : public GenericRequest<SoftwareVersion> {
public:
- typedef boost::shared_ptr<GetSoftwareVersionRequest> ref;
+ typedef std::shared_ptr<GetSoftwareVersionRequest> ref;
static ref create(const JID& recipient, IQRouter* router) {
return ref(new GetSoftwareVersionRequest(recipient, router));
@@ -26,7 +26,7 @@ namespace Swift {
const JID& recipient,
IQRouter* router) :
GenericRequest<SoftwareVersion>(
- IQ::Get, recipient, boost::make_shared<SoftwareVersion>(), router) {
+ IQ::Get, recipient, std::make_shared<SoftwareVersion>(), router) {
}
};
}
diff --git a/Swiften/Queries/Requests/SetPrivateStorageRequest.h b/Swiften/Queries/Requests/SetPrivateStorageRequest.h
index 703b749..7cc47fb 100644
--- a/Swiften/Queries/Requests/SetPrivateStorageRequest.h
+++ b/Swiften/Queries/Requests/SetPrivateStorageRequest.h
@@ -6,8 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -19,17 +18,17 @@ namespace Swift {
template<typename PAYLOAD_TYPE>
class SWIFTEN_API SetPrivateStorageRequest : public Request {
public:
- typedef boost::shared_ptr<SetPrivateStorageRequest<PAYLOAD_TYPE> > ref;
+ typedef std::shared_ptr<SetPrivateStorageRequest<PAYLOAD_TYPE> > ref;
- static ref create(boost::shared_ptr<PAYLOAD_TYPE> payload, IQRouter* router) {
+ static ref create(std::shared_ptr<PAYLOAD_TYPE> payload, IQRouter* router) {
return ref(new SetPrivateStorageRequest<PAYLOAD_TYPE>(payload, router));
}
private:
- SetPrivateStorageRequest(boost::shared_ptr<PAYLOAD_TYPE> payload, IQRouter* router) : Request(IQ::Set, JID(), boost::make_shared<PrivateStorage>(payload), router) {
+ SetPrivateStorageRequest(std::shared_ptr<PAYLOAD_TYPE> payload, IQRouter* router) : Request(IQ::Set, JID(), std::make_shared<PrivateStorage>(payload), router) {
}
- virtual void handleResponse(boost::shared_ptr<Payload>, ErrorPayload::ref error) {
+ virtual void handleResponse(std::shared_ptr<Payload>, ErrorPayload::ref error) {
onResponse(error);
}
diff --git a/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h b/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h
index 94a497b..e2ed751 100644
--- a/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h
+++ b/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -16,7 +16,7 @@
namespace Swift {
class SWIFTEN_API SetInBandRegistrationRequest : public Request {
public:
- typedef boost::shared_ptr<SetInBandRegistrationRequest> ref;
+ typedef std::shared_ptr<SetInBandRegistrationRequest> ref;
static ref create(const JID& to, InBandRegistrationPayload::ref payload, IQRouter* router) {
return ref(new SetInBandRegistrationRequest(to, payload, router));
@@ -26,11 +26,11 @@ namespace Swift {
SetInBandRegistrationRequest(const JID& to, InBandRegistrationPayload::ref payload, IQRouter* router) : Request(IQ::Set, to, InBandRegistrationPayload::ref(payload), router) {
}
- virtual void handleResponse(boost::shared_ptr<Payload> payload, ErrorPayload::ref error) {
+ virtual void handleResponse(std::shared_ptr<Payload> payload, ErrorPayload::ref error) {
onResponse(payload, error);
}
public:
- boost::signal<void (boost::shared_ptr<Payload>, ErrorPayload::ref)> onResponse;
+ boost::signal<void (std::shared_ptr<Payload>, ErrorPayload::ref)> onResponse;
};
}
diff --git a/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp b/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp
index 1efe523..6c4c495 100644
--- a/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp
+++ b/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp
@@ -4,8 +4,9 @@
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -49,9 +50,9 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel->iqs_.size()));
CPPUNIT_ASSERT_EQUAL(JID(), channel->iqs_[0]->getTo());
CPPUNIT_ASSERT_EQUAL(IQ::Get, channel->iqs_[0]->getType());
- boost::shared_ptr<PrivateStorage> storage = channel->iqs_[0]->getPayload<PrivateStorage>();
+ std::shared_ptr<PrivateStorage> storage = channel->iqs_[0]->getPayload<PrivateStorage>();
CPPUNIT_ASSERT(storage);
- boost::shared_ptr<MyPayload> payload = boost::dynamic_pointer_cast<MyPayload>(storage->getPayload());
+ std::shared_ptr<MyPayload> payload = std::dynamic_pointer_cast<MyPayload>(storage->getPayload());
CPPUNIT_ASSERT(payload);
}
@@ -62,7 +63,7 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture {
channel->onIQReceived(createResponse("test-id", "foo"));
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(responses.size()));
- CPPUNIT_ASSERT_EQUAL(std::string("foo"), boost::dynamic_pointer_cast<MyPayload>(responses[0])->text);
+ CPPUNIT_ASSERT_EQUAL(std::string("foo"), std::dynamic_pointer_cast<MyPayload>(responses[0])->text);
}
void testHandleResponse_Error() {
@@ -76,7 +77,7 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture {
}
private:
- void handleResponse(boost::shared_ptr<Payload> p, ErrorPayload::ref e) {
+ void handleResponse(std::shared_ptr<Payload> p, ErrorPayload::ref e) {
if (e) {
errors.push_back(*e);
}
@@ -85,17 +86,17 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture {
}
}
- boost::shared_ptr<IQ> createResponse(const std::string& id, const std::string& text) {
- boost::shared_ptr<IQ> iq(new IQ(IQ::Result));
- boost::shared_ptr<PrivateStorage> storage(new PrivateStorage());
- storage->setPayload(boost::shared_ptr<Payload>(new MyPayload(text)));
+ std::shared_ptr<IQ> createResponse(const std::string& id, const std::string& text) {
+ std::shared_ptr<IQ> iq(new IQ(IQ::Result));
+ std::shared_ptr<PrivateStorage> storage(new PrivateStorage());
+ storage->setPayload(std::make_shared<MyPayload>(text));
iq->addPayload(storage);
iq->setID(id);
return iq;
}
- boost::shared_ptr<IQ> createError(const std::string& id) {
- boost::shared_ptr<IQ> iq(new IQ(IQ::Error));
+ std::shared_ptr<IQ> createError(const std::string& id) {
+ std::shared_ptr<IQ> iq(new IQ(IQ::Error));
iq->setID(id);
return iq;
}
@@ -104,7 +105,7 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture {
IQRouter* router;
DummyIQChannel* channel;
std::vector< ErrorPayload > errors;
- std::vector< boost::shared_ptr<Payload> > responses;
+ std::vector< std::shared_ptr<Payload> > responses;
};
CPPUNIT_TEST_SUITE_REGISTRATION(GetPrivateStorageRequestTest);
diff --git a/Swiften/Queries/Responder.h b/Swiften/Queries/Responder.h
index 94195f8..0974adf 100644
--- a/Swiften/Queries/Responder.h
+++ b/Swiften/Queries/Responder.h
@@ -58,26 +58,26 @@ namespace Swift {
*
* This method is implemented in the concrete subclasses.
*/
- virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr<PAYLOAD_TYPE> payload) = 0;
+ virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr<PAYLOAD_TYPE> payload) = 0;
/**
* Handle an incoming IQ-Set request containing a payload of class PAYLOAD_TYPE.
*
* This method is implemented in the concrete subclasses.
*/
- virtual bool handleSetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr<PAYLOAD_TYPE> payload) = 0;
+ virtual bool handleSetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr<PAYLOAD_TYPE> payload) = 0;
/**
* Convenience function for sending an IQ response.
*/
- void sendResponse(const JID& to, const std::string& id, boost::shared_ptr<PAYLOAD_TYPE> payload) {
+ void sendResponse(const JID& to, const std::string& id, std::shared_ptr<PAYLOAD_TYPE> payload) {
router_->sendIQ(IQ::createResult(to, id, payload));
}
/**
* Convenience function for sending an IQ response, with a specific from address.
*/
- void sendResponse(const JID& to, const JID& from, const std::string& id, boost::shared_ptr<PAYLOAD_TYPE> payload) {
+ void sendResponse(const JID& to, const JID& from, const std::string& id, std::shared_ptr<PAYLOAD_TYPE> payload) {
router_->sendIQ(IQ::createResult(to, from, id, payload));
}
@@ -104,9 +104,9 @@ namespace Swift {
}
private:
- virtual bool handleIQ(boost::shared_ptr<IQ> iq) {
+ virtual bool handleIQ(std::shared_ptr<IQ> iq) {
if (iq->getType() == IQ::Set || iq->getType() == IQ::Get) {
- boost::shared_ptr<PAYLOAD_TYPE> payload(iq->getPayload<PAYLOAD_TYPE>());
+ std::shared_ptr<PAYLOAD_TYPE> payload(iq->getPayload<PAYLOAD_TYPE>());
if (payload) {
bool result;
if (iq->getType() == IQ::Set) {
diff --git a/Swiften/Queries/Responders/SoftwareVersionResponder.cpp b/Swiften/Queries/Responders/SoftwareVersionResponder.cpp
index df73dc6..5071f6e 100644
--- a/Swiften/Queries/Responders/SoftwareVersionResponder.cpp
+++ b/Swiften/Queries/Responders/SoftwareVersionResponder.cpp
@@ -6,7 +6,7 @@
#include <Swiften/Queries/Responders/SoftwareVersionResponder.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Queries/IQRouter.h>
@@ -21,8 +21,8 @@ void SoftwareVersionResponder::setVersion(const std::string& client, const std::
this->os = os;
}
-bool SoftwareVersionResponder::handleGetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr<SoftwareVersion>) {
- sendResponse(from, id, boost::make_shared<SoftwareVersion>(client, version, os));
+bool SoftwareVersionResponder::handleGetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr<SoftwareVersion>) {
+ sendResponse(from, id, std::make_shared<SoftwareVersion>(client, version, os));
return true;
}
diff --git a/Swiften/Queries/Responders/SoftwareVersionResponder.h b/Swiften/Queries/Responders/SoftwareVersionResponder.h
index e336341..4bb3425 100644
--- a/Swiften/Queries/Responders/SoftwareVersionResponder.h
+++ b/Swiften/Queries/Responders/SoftwareVersionResponder.h
@@ -20,7 +20,7 @@ namespace Swift {
void setVersion(const std::string& client, const std::string& version, const std::string& os = "");
private:
- virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr<SoftwareVersion> payload);
+ virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, std::shared_ptr<SoftwareVersion> payload);
private:
std::string client;
diff --git a/Swiften/Queries/SetResponder.h b/Swiften/Queries/SetResponder.h
index 44d5b66..e2842f4 100644
--- a/Swiften/Queries/SetResponder.h
+++ b/Swiften/Queries/SetResponder.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -16,6 +16,6 @@ namespace Swift {
SetResponder(IQRouter* router) : Responder<T>(router) {}
private:
- virtual bool handleGetRequest(const JID&, const JID&, const std::string&, boost::shared_ptr<T>) { return false; }
+ virtual bool handleGetRequest(const JID&, const JID&, const std::string&, std::shared_ptr<T>) { return false; }
};
}
diff --git a/Swiften/Queries/UnitTest/IQRouterTest.cpp b/Swiften/Queries/UnitTest/IQRouterTest.cpp
index d0d4911..0acb87b 100644
--- a/Swiften/Queries/UnitTest/IQRouterTest.cpp
+++ b/Swiften/Queries/UnitTest/IQRouterTest.cpp
@@ -4,9 +4,9 @@
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -45,7 +45,7 @@ class IQRouterTest : public CppUnit::TestFixture {
DummyIQHandler handler2(true, &testling);
testling.removeHandler(&handler1);
- channel_->onIQReceived(boost::make_shared<IQ>());
+ channel_->onIQReceived(std::make_shared<IQ>());
CPPUNIT_ASSERT_EQUAL(0, handler1.called);
CPPUNIT_ASSERT_EQUAL(1, handler2.called);
@@ -56,9 +56,9 @@ class IQRouterTest : public CppUnit::TestFixture {
DummyIQHandler handler2(true, &testling);
DummyIQHandler handler1(true, &testling);
- channel_->onIQReceived(boost::make_shared<IQ>());
+ channel_->onIQReceived(std::make_shared<IQ>());
testling.removeHandler(&handler1);
- channel_->onIQReceived(boost::make_shared<IQ>());
+ channel_->onIQReceived(std::make_shared<IQ>());
CPPUNIT_ASSERT_EQUAL(1, handler1.called);
CPPUNIT_ASSERT_EQUAL(1, handler2.called);
@@ -69,7 +69,7 @@ class IQRouterTest : public CppUnit::TestFixture {
DummyIQHandler handler2(false, &testling);
DummyIQHandler handler1(true, &testling);
- channel_->onIQReceived(boost::make_shared<IQ>());
+ channel_->onIQReceived(std::make_shared<IQ>());
CPPUNIT_ASSERT_EQUAL(1, handler1.called);
CPPUNIT_ASSERT_EQUAL(0, handler2.called);
@@ -81,7 +81,7 @@ class IQRouterTest : public CppUnit::TestFixture {
DummyIQHandler handler2(true, &testling);
DummyIQHandler handler1(false, &testling);
- channel_->onIQReceived(boost::make_shared<IQ>());
+ channel_->onIQReceived(std::make_shared<IQ>());
CPPUNIT_ASSERT_EQUAL(1, handler1.called);
CPPUNIT_ASSERT_EQUAL(1, handler2.called);
@@ -92,7 +92,7 @@ class IQRouterTest : public CppUnit::TestFixture {
IQRouter testling(channel_);
DummyIQHandler handler(false, &testling);
- channel_->onIQReceived(boost::make_shared<IQ>());
+ channel_->onIQReceived(std::make_shared<IQ>());
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel_->iqs_.size()));
CPPUNIT_ASSERT(channel_->iqs_[0]->getPayload<ErrorPayload>());
@@ -104,8 +104,8 @@ class IQRouterTest : public CppUnit::TestFixture {
DummyIQHandler handler2(true, &testling);
RemovingIQHandler handler1(&testling);
- channel_->onIQReceived(boost::make_shared<IQ>());
- channel_->onIQReceived(boost::make_shared<IQ>());
+ channel_->onIQReceived(std::make_shared<IQ>());
+ channel_->onIQReceived(std::make_shared<IQ>());
CPPUNIT_ASSERT_EQUAL(1, handler1.called);
CPPUNIT_ASSERT_EQUAL(2, handler2.called);
@@ -115,7 +115,7 @@ class IQRouterTest : public CppUnit::TestFixture {
IQRouter testling(channel_);
testling.setFrom(JID("foo@bar.com/baz"));
- testling.sendIQ(boost::make_shared<IQ>());
+ testling.sendIQ(std::make_shared<IQ>());
CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), channel_->iqs_[0]->getFrom());
}
@@ -123,7 +123,7 @@ class IQRouterTest : public CppUnit::TestFixture {
void testSendIQ_WithoutFrom() {
IQRouter testling(channel_);
- testling.sendIQ(boost::make_shared<IQ>());
+ testling.sendIQ(std::make_shared<IQ>());
CPPUNIT_ASSERT_EQUAL(JID(), channel_->iqs_[0]->getFrom());
}
@@ -133,7 +133,7 @@ class IQRouterTest : public CppUnit::TestFixture {
testling.setFrom(JID("foo@bar.com/baz"));
DummyIQHandler handler(false, &testling);
- channel_->onIQReceived(boost::make_shared<IQ>());
+ channel_->onIQReceived(std::make_shared<IQ>());
CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), channel_->iqs_[0]->getFrom());
}
@@ -148,7 +148,7 @@ class IQRouterTest : public CppUnit::TestFixture {
router->removeHandler(this);
}
- virtual bool handleIQ(boost::shared_ptr<IQ>) {
+ virtual bool handleIQ(std::shared_ptr<IQ>) {
called++;
return handle;
}
@@ -162,7 +162,7 @@ class IQRouterTest : public CppUnit::TestFixture {
router->addHandler(this);
}
- virtual bool handleIQ(boost::shared_ptr<IQ>) {
+ virtual bool handleIQ(std::shared_ptr<IQ>) {
called++;
router->removeHandler(this);
return false;
diff --git a/Swiften/Queries/UnitTest/RequestTest.cpp b/Swiften/Queries/UnitTest/RequestTest.cpp
index 93aa9b1..56daffa 100644
--- a/Swiften/Queries/UnitTest/RequestTest.cpp
+++ b/Swiften/Queries/UnitTest/RequestTest.cpp
@@ -4,9 +4,9 @@
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -56,25 +56,25 @@ class RequestTest : public CppUnit::TestFixture {
MyRequest(
IQ::Type type,
const JID& receiver,
- boost::shared_ptr<Payload> payload,
+ std::shared_ptr<Payload> payload,
IQRouter* router) :
Request(type, receiver, payload, router) {
}
- virtual void handleResponse(boost::shared_ptr<Payload> payload, ErrorPayload::ref error) {
+ virtual void handleResponse(std::shared_ptr<Payload> payload, ErrorPayload::ref error) {
onResponse(payload, error);
}
public:
- boost::signal<void (boost::shared_ptr<Payload>, ErrorPayload::ref)> onResponse;
+ boost::signal<void (std::shared_ptr<Payload>, ErrorPayload::ref)> onResponse;
};
public:
void setUp() {
channel_ = new DummyIQChannel();
router_ = new IQRouter(channel_);
- payload_ = boost::shared_ptr<Payload>(new MyPayload("foo"));
- responsePayload_ = boost::shared_ptr<Payload>(new MyPayload("bar"));
+ payload_ = std::make_shared<MyPayload>("foo");
+ responsePayload_ = std::make_shared<MyPayload>("bar");
responsesReceived_ = 0;
}
@@ -131,8 +131,8 @@ class RequestTest : public CppUnit::TestFixture {
testling.onResponse.connect(boost::bind(&RequestTest::handleResponse, this, _1, _2));
testling.send();
- boost::shared_ptr<IQ> error = createError(JID("foo@bar.com/baz"),"test-id");
- boost::shared_ptr<Payload> errorPayload = boost::make_shared<ErrorPayload>(ErrorPayload::InternalServerError);
+ std::shared_ptr<IQ> error = createError(JID("foo@bar.com/baz"),"test-id");
+ std::shared_ptr<Payload> errorPayload = std::make_shared<ErrorPayload>(ErrorPayload::InternalServerError);
error->addPayload(errorPayload);
channel_->onIQReceived(error);
@@ -170,7 +170,7 @@ class RequestTest : public CppUnit::TestFixture {
testling.onResponse.connect(boost::bind(&RequestTest::handleDifferentResponse, this, _1, _2));
testling.send();
- responsePayload_ = boost::make_shared<MyOtherPayload>();
+ responsePayload_ = std::make_shared<MyOtherPayload>();
channel_->onIQReceived(createResponse(JID("foo@bar.com/baz"),"test-id"));
CPPUNIT_ASSERT_EQUAL(1, responsesReceived_);
@@ -179,12 +179,12 @@ class RequestTest : public CppUnit::TestFixture {
}
void testHandleIQ_RawXMLPayload() {
- payload_ = boost::make_shared<RawXMLPayload>("<bla/>");
+ payload_ = std::make_shared<RawXMLPayload>("<bla/>");
MyRequest testling(IQ::Get, JID("foo@bar.com/baz"), payload_, router_);
testling.onResponse.connect(boost::bind(&RequestTest::handleRawXMLResponse, this, _1, _2));
testling.send();
- responsePayload_ = boost::make_shared<MyOtherPayload>();
+ responsePayload_ = std::make_shared<MyOtherPayload>();
channel_->onIQReceived(createResponse(JID("foo@bar.com/baz"),"test-id"));
CPPUNIT_ASSERT_EQUAL(1, responsesReceived_);
@@ -197,7 +197,7 @@ class RequestTest : public CppUnit::TestFixture {
testling.onResponse.connect(boost::bind(&RequestTest::handleResponse, this, _1, _2));
testling.send();
- boost::shared_ptr<IQ> response = createResponse(JID("foo@bar.com/baz"),"test-id");
+ std::shared_ptr<IQ> response = createResponse(JID("foo@bar.com/baz"),"test-id");
response->setType(IQ::Get);
channel_->onIQReceived(response);
@@ -211,7 +211,7 @@ class RequestTest : public CppUnit::TestFixture {
testling.onResponse.connect(boost::bind(&RequestTest::handleResponse, this, _1, _2));
testling.send();
- boost::shared_ptr<IQ> response = createResponse(JID("foo@bar.com/baz"), "test-id");
+ std::shared_ptr<IQ> response = createResponse(JID("foo@bar.com/baz"), "test-id");
response->setType(IQ::Set);
channel_->onIQReceived(response);
@@ -315,41 +315,41 @@ class RequestTest : public CppUnit::TestFixture {
private:
- void handleResponse(boost::shared_ptr<Payload> p, ErrorPayload::ref e) {
+ void handleResponse(std::shared_ptr<Payload> p, ErrorPayload::ref e) {
if (e) {
receivedErrors.push_back(*e);
}
else {
- boost::shared_ptr<MyPayload> payload(boost::dynamic_pointer_cast<MyPayload>(p));
+ std::shared_ptr<MyPayload> payload(std::dynamic_pointer_cast<MyPayload>(p));
CPPUNIT_ASSERT(payload);
CPPUNIT_ASSERT_EQUAL(std::string("bar"), payload->text_);
++responsesReceived_;
}
}
- void handleDifferentResponse(boost::shared_ptr<Payload> p, ErrorPayload::ref e) {
+ void handleDifferentResponse(std::shared_ptr<Payload> p, ErrorPayload::ref e) {
CPPUNIT_ASSERT(!e);
CPPUNIT_ASSERT(!p);
++responsesReceived_;
}
- void handleRawXMLResponse(boost::shared_ptr<Payload> p, ErrorPayload::ref e) {
+ void handleRawXMLResponse(std::shared_ptr<Payload> p, ErrorPayload::ref e) {
CPPUNIT_ASSERT(!e);
CPPUNIT_ASSERT(p);
- CPPUNIT_ASSERT(boost::dynamic_pointer_cast<MyOtherPayload>(p));
+ CPPUNIT_ASSERT(std::dynamic_pointer_cast<MyOtherPayload>(p));
++responsesReceived_;
}
- boost::shared_ptr<IQ> createResponse(const JID& from, const std::string& id) {
- boost::shared_ptr<IQ> iq(new IQ(IQ::Result));
+ std::shared_ptr<IQ> createResponse(const JID& from, const std::string& id) {
+ std::shared_ptr<IQ> iq(new IQ(IQ::Result));
iq->setFrom(from);
iq->addPayload(responsePayload_);
iq->setID(id);
return iq;
}
- boost::shared_ptr<IQ> createError(const JID& from, const std::string& id) {
- boost::shared_ptr<IQ> iq(new IQ(IQ::Error));
+ std::shared_ptr<IQ> createError(const JID& from, const std::string& id) {
+ std::shared_ptr<IQ> iq(new IQ(IQ::Error));
iq->setFrom(from);
iq->setID(id);
return iq;
@@ -358,8 +358,8 @@ class RequestTest : public CppUnit::TestFixture {
private:
IQRouter* router_;
DummyIQChannel* channel_;
- boost::shared_ptr<Payload> payload_;
- boost::shared_ptr<Payload> responsePayload_;
+ std::shared_ptr<Payload> payload_;
+ std::shared_ptr<Payload> responsePayload_;
int responsesReceived_;
std::vector<ErrorPayload> receivedErrors;
};
diff --git a/Swiften/Queries/UnitTest/ResponderTest.cpp b/Swiften/Queries/UnitTest/ResponderTest.cpp
index c3474f2..98c1448 100644
--- a/Swiften/Queries/UnitTest/ResponderTest.cpp
+++ b/Swiften/Queries/UnitTest/ResponderTest.cpp
@@ -4,9 +4,9 @@
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -34,7 +34,7 @@ class ResponderTest : public CppUnit::TestFixture {
void setUp() {
channel_ = new DummyIQChannel();
router_ = new IQRouter(channel_);
- payload_ = boost::make_shared<SoftwareVersion>("foo");
+ payload_ = std::make_shared<SoftwareVersion>("foo");
}
void tearDown() {
@@ -110,15 +110,15 @@ class ResponderTest : public CppUnit::TestFixture {
void testHandleIQ_NoPayload() {
MyResponder testling(router_);
- CPPUNIT_ASSERT(!dynamic_cast<IQHandler*>(&testling)->handleIQ(boost::make_shared<IQ>(IQ::Get)));
+ CPPUNIT_ASSERT(!dynamic_cast<IQHandler*>(&testling)->handleIQ(std::make_shared<IQ>(IQ::Get)));
CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(testling.getPayloads_.size()));
CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(testling.setPayloads_.size()));
}
private:
- boost::shared_ptr<IQ> createRequest(IQ::Type type) {
- boost::shared_ptr<IQ> iq(new IQ(type));
+ std::shared_ptr<IQ> createRequest(IQ::Type type) {
+ std::shared_ptr<IQ> iq(new IQ(type));
iq->addPayload(payload_);
iq->setID("myid");
iq->setFrom(JID("foo@bar.com/baz"));
@@ -130,13 +130,13 @@ class ResponderTest : public CppUnit::TestFixture {
public:
MyResponder(IQRouter* router) : Responder<SoftwareVersion>(router), getRequestResponse_(true), setRequestResponse_(true) {}
- virtual bool handleGetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr<SoftwareVersion> payload) {
+ virtual bool handleGetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr<SoftwareVersion> payload) {
CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), from);
CPPUNIT_ASSERT_EQUAL(std::string("myid"), id);
getPayloads_.push_back(payload);
return getRequestResponse_;
}
- virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr<SoftwareVersion> payload) {
+ virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr<SoftwareVersion> payload) {
CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), from);
CPPUNIT_ASSERT_EQUAL(std::string("myid"), id);
setPayloads_.push_back(payload);
@@ -145,14 +145,14 @@ class ResponderTest : public CppUnit::TestFixture {
bool getRequestResponse_;
bool setRequestResponse_;
- std::vector<boost::shared_ptr<SoftwareVersion> > getPayloads_;
- std::vector<boost::shared_ptr<SoftwareVersion> > setPayloads_;
+ std::vector<std::shared_ptr<SoftwareVersion> > getPayloads_;
+ std::vector<std::shared_ptr<SoftwareVersion> > setPayloads_;
};
private:
IQRouter* router_;
DummyIQChannel* channel_;
- boost::shared_ptr<SoftwareVersion> payload_;
+ std::shared_ptr<SoftwareVersion> payload_;
};
CPPUNIT_TEST_SUITE_REGISTRATION(ResponderTest);
diff --git a/Swiften/Roster/GetRosterRequest.h b/Swiften/Roster/GetRosterRequest.h
index 6ca16cb..1a0499f 100644
--- a/Swiften/Roster/GetRosterRequest.h
+++ b/Swiften/Roster/GetRosterRequest.h
@@ -13,7 +13,7 @@
namespace Swift {
class SWIFTEN_API GetRosterRequest : public GenericRequest<RosterPayload> {
public:
- typedef boost::shared_ptr<GetRosterRequest> ref;
+ typedef std::shared_ptr<GetRosterRequest> ref;
static ref create(IQRouter* router) {
return ref(new GetRosterRequest(router));
@@ -27,7 +27,7 @@ namespace Swift {
private:
GetRosterRequest(IQRouter* router) :
- GenericRequest<RosterPayload>(IQ::Get, JID(), boost::shared_ptr<Payload>(new RosterPayload()), router) {
+ GenericRequest<RosterPayload>(IQ::Get, JID(), std::make_shared<RosterPayload>(), router) {
}
};
}
diff --git a/Swiften/Roster/RosterMemoryStorage.cpp b/Swiften/Roster/RosterMemoryStorage.cpp
index f187116..1b72a85 100644
--- a/Swiften/Roster/RosterMemoryStorage.cpp
+++ b/Swiften/Roster/RosterMemoryStorage.cpp
@@ -1,22 +1,22 @@
/*
- * Copyright (c) 2011 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Roster/RosterMemoryStorage.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
namespace Swift {
RosterMemoryStorage::RosterMemoryStorage() {
}
-void RosterMemoryStorage::setRoster(boost::shared_ptr<RosterPayload> r) {
+void RosterMemoryStorage::setRoster(std::shared_ptr<RosterPayload> r) {
roster.reset();
if (r) {
- roster = boost::make_shared<RosterPayload>(*r);
+ roster = std::make_shared<RosterPayload>(*r);
}
}
diff --git a/Swiften/Roster/RosterMemoryStorage.h b/Swiften/Roster/RosterMemoryStorage.h
index 4058f84..19e7802 100644
--- a/Swiften/Roster/RosterMemoryStorage.h
+++ b/Swiften/Roster/RosterMemoryStorage.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -14,13 +14,13 @@ namespace Swift {
public:
RosterMemoryStorage();
- virtual boost::shared_ptr<RosterPayload> getRoster() const {
+ virtual std::shared_ptr<RosterPayload> getRoster() const {
return roster;
}
- virtual void setRoster(boost::shared_ptr<RosterPayload>);
+ virtual void setRoster(std::shared_ptr<RosterPayload>);
private:
- boost::shared_ptr<RosterPayload> roster;
+ std::shared_ptr<RosterPayload> roster;
};
}
diff --git a/Swiften/Roster/RosterPushResponder.h b/Swiften/Roster/RosterPushResponder.h
index 06ba797..10986f5 100644
--- a/Swiften/Roster/RosterPushResponder.h
+++ b/Swiften/Roster/RosterPushResponder.h
@@ -17,13 +17,13 @@ namespace Swift {
RosterPushResponder(IQRouter* router) : SetResponder<RosterPayload>(router) {}
public:
- boost::signal<void (boost::shared_ptr<RosterPayload>)> onRosterReceived;
+ boost::signal<void (std::shared_ptr<RosterPayload>)> onRosterReceived;
private:
- virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr<RosterPayload> payload) {
+ virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr<RosterPayload> payload) {
if (getIQRouter()->isAccountJID(from)) {
onRosterReceived(payload);
- sendResponse(from, id, boost::shared_ptr<RosterPayload>());
+ sendResponse(from, id, std::shared_ptr<RosterPayload>());
}
else {
sendError(from, id, ErrorPayload::NotAuthorized, ErrorPayload::Cancel);
diff --git a/Swiften/Roster/RosterStorage.h b/Swiften/Roster/RosterStorage.h
index 92c40f9..1c1461d 100644
--- a/Swiften/Roster/RosterStorage.h
+++ b/Swiften/Roster/RosterStorage.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2011 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/RosterPayload.h>
@@ -16,7 +16,7 @@ namespace Swift {
public:
virtual ~RosterStorage();
- virtual boost::shared_ptr<RosterPayload> getRoster() const = 0;
- virtual void setRoster(boost::shared_ptr<RosterPayload>) = 0;
+ virtual std::shared_ptr<RosterPayload> getRoster() const = 0;
+ virtual void setRoster(std::shared_ptr<RosterPayload>) = 0;
};
}
diff --git a/Swiften/Roster/SetRosterRequest.h b/Swiften/Roster/SetRosterRequest.h
index 64c0984..7615abc 100644
--- a/Swiften/Roster/SetRosterRequest.h
+++ b/Swiften/Roster/SetRosterRequest.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -16,7 +16,7 @@
namespace Swift {
class SWIFTEN_API SetRosterRequest : public Request {
public:
- typedef boost::shared_ptr<SetRosterRequest> ref;
+ typedef std::shared_ptr<SetRosterRequest> ref;
static ref create(RosterPayload::ref payload, IQRouter* router) {
return ref(new SetRosterRequest(JID(), payload, router));
@@ -27,10 +27,10 @@ namespace Swift {
}
private:
- SetRosterRequest(const JID& to, boost::shared_ptr<RosterPayload> payload, IQRouter* router) : Request(IQ::Set, to, boost::shared_ptr<RosterPayload>(payload), router) {
+ SetRosterRequest(const JID& to, std::shared_ptr<RosterPayload> payload, IQRouter* router) : Request(IQ::Set, to, std::shared_ptr<RosterPayload>(payload), router) {
}
- virtual void handleResponse(boost::shared_ptr<Payload> /*payload*/, ErrorPayload::ref error) {
+ virtual void handleResponse(std::shared_ptr<Payload> /*payload*/, ErrorPayload::ref error) {
onResponse(error);
}
diff --git a/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp b/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp
index 6850c21..b646aba 100644
--- a/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp
+++ b/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -61,10 +61,10 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
}
void testGet_Response() {
- boost::shared_ptr<XMPPRosterController> testling(createController());
+ std::shared_ptr<XMPPRosterController> testling(createController());
testling->requestRoster();
- boost::shared_ptr<RosterPayload> payload = boost::make_shared<RosterPayload>();
+ std::shared_ptr<RosterPayload> payload = std::make_shared<RosterPayload>();
payload->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both));
payload->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both));
channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), payload));
@@ -79,13 +79,13 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
controller.requestRoster();
- channel_->onIQReceived(IQ::createResult(JID("baz@fum.com/dum"), channel_->sentStanzas[0]->getID(), boost::shared_ptr<RosterPayload>()));
+ channel_->onIQReceived(IQ::createResult(JID("baz@fum.com/dum"), channel_->sentStanzas[0]->getID(), std::shared_ptr<RosterPayload>()));
}
void testAdd() {
XMPPRosterController controller(router_, xmppRoster_, rosterStorage_);
- boost::shared_ptr<RosterPayload> payload(new RosterPayload());
+ std::shared_ptr<RosterPayload> payload(new RosterPayload());
payload->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both));
channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "eou", payload));
@@ -97,65 +97,65 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
}
void testGet_NoRosterInStorage() {
- boost::shared_ptr<XMPPRosterController> testling(createController());
+ std::shared_ptr<XMPPRosterController> testling(createController());
testling->setUseVersioning(true);
testling->requestRoster();
- boost::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>();
+ std::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>();
CPPUNIT_ASSERT(roster->getVersion());
CPPUNIT_ASSERT_EQUAL(std::string(""), *roster->getVersion());
}
void testGet_NoVersionInStorage() {
- boost::shared_ptr<XMPPRosterController> testling(createController());
+ std::shared_ptr<XMPPRosterController> testling(createController());
testling->setUseVersioning(true);
- rosterStorage_->setRoster(boost::make_shared<RosterPayload>());
+ rosterStorage_->setRoster(std::make_shared<RosterPayload>());
testling->requestRoster();
- boost::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>();
+ std::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>();
CPPUNIT_ASSERT(roster->getVersion());
CPPUNIT_ASSERT_EQUAL(std::string(""), *roster->getVersion());
}
void testGet_VersionInStorage() {
- boost::shared_ptr<XMPPRosterController> testling(createController());
+ std::shared_ptr<XMPPRosterController> testling(createController());
testling->setUseVersioning(true);
- boost::shared_ptr<RosterPayload> payload(new RosterPayload());
+ std::shared_ptr<RosterPayload> payload(new RosterPayload());
payload->setVersion("foover");
rosterStorage_->setRoster(payload);
testling->requestRoster();
- boost::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>();
+ std::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>();
CPPUNIT_ASSERT(roster->getVersion());
CPPUNIT_ASSERT_EQUAL(std::string("foover"), *roster->getVersion());
}
void testGet_ServerDoesNotSupportVersion() {
- boost::shared_ptr<XMPPRosterController> testling(createController());
- boost::shared_ptr<RosterPayload> payload(new RosterPayload());
+ std::shared_ptr<XMPPRosterController> testling(createController());
+ std::shared_ptr<RosterPayload> payload(new RosterPayload());
payload->setVersion("foover");
rosterStorage_->setRoster(payload);
testling->requestRoster();
- boost::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>();
+ std::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>();
CPPUNIT_ASSERT(!roster->getVersion());
}
void testGet_ResponseWithoutNewVersion() {
- boost::shared_ptr<XMPPRosterController> testling(createController());
+ std::shared_ptr<XMPPRosterController> testling(createController());
testling->setUseVersioning(true);
- boost::shared_ptr<RosterPayload> storedRoster(new RosterPayload());
+ std::shared_ptr<RosterPayload> storedRoster(new RosterPayload());
storedRoster->setVersion("version10");
storedRoster->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both));
storedRoster->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both));
rosterStorage_->setRoster(storedRoster);
testling->requestRoster();
- channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), boost::shared_ptr<RosterPayload>()));
+ channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), std::shared_ptr<RosterPayload>()));
CPPUNIT_ASSERT_EQUAL(2, handler_->getEventCount());
CPPUNIT_ASSERT(xmppRoster_->getItem(jid1_));
@@ -170,15 +170,15 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
}
void testGet_ResponseWithNewVersion() {
- boost::shared_ptr<XMPPRosterController> testling(createController());
+ std::shared_ptr<XMPPRosterController> testling(createController());
testling->setUseVersioning(true);
- boost::shared_ptr<RosterPayload> storedRoster(new RosterPayload());
+ std::shared_ptr<RosterPayload> storedRoster(new RosterPayload());
storedRoster->setVersion("version10");
storedRoster->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both));
rosterStorage_->setRoster(storedRoster);
testling->requestRoster();
- boost::shared_ptr<RosterPayload> serverRoster(new RosterPayload());
+ std::shared_ptr<RosterPayload> serverRoster(new RosterPayload());
serverRoster->setVersion("version12");
serverRoster->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both));
std::vector<std::string> groups;
@@ -204,9 +204,9 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
}
void testAddFromNonAccount() {
- boost::shared_ptr<XMPPRosterController> testling(createController());
+ std::shared_ptr<XMPPRosterController> testling(createController());
- boost::shared_ptr<RosterPayload> payload(new RosterPayload());
+ std::shared_ptr<RosterPayload> payload(new RosterPayload());
payload->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both));
IQ::ref request = IQ::createRequest(IQ::Set, JID(), "eou", payload);
request->setFrom(jid2_);
@@ -217,7 +217,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
void testModify() {
XMPPRosterController controller(router_, xmppRoster_, rosterStorage_);
- boost::shared_ptr<RosterPayload> payload1(new RosterPayload());
+ std::shared_ptr<RosterPayload> payload1(new RosterPayload());
payload1->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both));
channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id1", payload1));
@@ -225,7 +225,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID());
handler_->reset();
- boost::shared_ptr<RosterPayload> payload2(new RosterPayload());
+ std::shared_ptr<RosterPayload> payload2(new RosterPayload());
payload2->addItem(RosterItemPayload(jid1_, "Bob2", RosterItemPayload::Both));
channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id2", payload2));
@@ -237,7 +237,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
void testRemove() {
XMPPRosterController controller(router_, xmppRoster_, rosterStorage_);
- boost::shared_ptr<RosterPayload> payload1(new RosterPayload());
+ std::shared_ptr<RosterPayload> payload1(new RosterPayload());
payload1->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both));
channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id1", payload1));
@@ -245,7 +245,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID());
handler_->reset();
- boost::shared_ptr<RosterPayload> payload2(new RosterPayload());
+ std::shared_ptr<RosterPayload> payload2(new RosterPayload());
payload2->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Remove));
channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id2", payload2));
CPPUNIT_ASSERT(!xmppRoster_->containsJID(jid1_));
@@ -255,17 +255,17 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
}
void testRemove_RosterStorageUpdated() {
- boost::shared_ptr<XMPPRosterController> testling(createController());
+ std::shared_ptr<XMPPRosterController> testling(createController());
testling->setUseVersioning(true);
- boost::shared_ptr<RosterPayload> storedRoster(new RosterPayload());
+ std::shared_ptr<RosterPayload> storedRoster(new RosterPayload());
storedRoster->setVersion("version10");
storedRoster->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both));
storedRoster->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both));
rosterStorage_->setRoster(storedRoster);
testling->requestRoster();
- channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), boost::shared_ptr<RosterPayload>()));
+ channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), std::shared_ptr<RosterPayload>()));
- boost::shared_ptr<RosterPayload> payload2(new RosterPayload());
+ std::shared_ptr<RosterPayload> payload2(new RosterPayload());
payload2->setVersion("version15");
payload2->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Remove));
channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id2", payload2));
@@ -279,7 +279,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
void testMany() {
XMPPRosterController controller(router_, xmppRoster_, rosterStorage_);
- boost::shared_ptr<RosterPayload> payload1(new RosterPayload());
+ std::shared_ptr<RosterPayload> payload1(new RosterPayload());
payload1->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both));
channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id1", payload1));
@@ -287,7 +287,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID());
handler_->reset();
- boost::shared_ptr<RosterPayload> payload2(new RosterPayload());
+ std::shared_ptr<RosterPayload> payload2(new RosterPayload());
payload2->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both));
channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id2", payload2));
@@ -295,7 +295,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(jid2_, handler_->getLastJID());
handler_->reset();
- boost::shared_ptr<RosterPayload> payload3(new RosterPayload());
+ std::shared_ptr<RosterPayload> payload3(new RosterPayload());
payload3->addItem(RosterItemPayload(jid1_, "Ernie", RosterItemPayload::Both));
channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id3", payload3));
@@ -303,7 +303,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID());
handler_->reset();
- boost::shared_ptr<RosterPayload> payload4(new RosterPayload());
+ std::shared_ptr<RosterPayload> payload4(new RosterPayload());
RosterItemPayload item(jid3_, "Jane", RosterItemPayload::Both);
std::string janesGroup("Jane's Group");
item.addGroup(janesGroup);
@@ -316,7 +316,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(janesGroup, xmppRoster_->getGroupsForJID(jid3_)[0]);
handler_->reset();
- boost::shared_ptr<RosterPayload> payload5(new RosterPayload());
+ std::shared_ptr<RosterPayload> payload5(new RosterPayload());
payload5->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Remove));
channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id5", payload5));
CPPUNIT_ASSERT(!xmppRoster_->containsJID(jid1_));
@@ -324,7 +324,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID());
handler_->reset();
- boost::shared_ptr<RosterPayload> payload6(new RosterPayload());
+ std::shared_ptr<RosterPayload> payload6(new RosterPayload());
RosterItemPayload item2(jid2_, "Little Alice", RosterItemPayload::Both);
std::string alicesGroup("Alice's Group");
item2.addGroup(alicesGroup);
diff --git a/Swiften/Roster/UnitTest/XMPPRosterImplTest.cpp b/Swiften/Roster/UnitTest/XMPPRosterImplTest.cpp
index f611fec..f0d92e9 100644
--- a/Swiften/Roster/UnitTest/XMPPRosterImplTest.cpp
+++ b/Swiften/Roster/UnitTest/XMPPRosterImplTest.cpp
@@ -4,8 +4,9 @@
* See the COPYING file for more information.
*/
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
diff --git a/Swiften/Roster/UnitTest/XMPPRosterSignalHandler.h b/Swiften/Roster/UnitTest/XMPPRosterSignalHandler.h
index 9c9afad..0535578 100644
--- a/Swiften/Roster/UnitTest/XMPPRosterSignalHandler.h
+++ b/Swiften/Roster/UnitTest/XMPPRosterSignalHandler.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Roster/XMPPRosterImpl.h>
enum XMPPRosterEvents {None, Add, Remove, Update};
diff --git a/Swiften/Roster/XMPPRosterController.cpp b/Swiften/Roster/XMPPRosterController.cpp
index 10803f3..b5e72f5 100644
--- a/Swiften/Roster/XMPPRosterController.cpp
+++ b/Swiften/Roster/XMPPRosterController.cpp
@@ -23,7 +23,7 @@ namespace Swift {
* The controller does not gain ownership of these parameters.
*/
XMPPRosterController::XMPPRosterController(IQRouter* iqRouter, XMPPRosterImpl* xmppRoster, RosterStorage* rosterStorage) : iqRouter_(iqRouter), rosterPushResponder_(iqRouter), xmppRoster_(xmppRoster), rosterStorage_(rosterStorage), useVersioning(false) {
- rosterPushResponder_.onRosterReceived.connect(boost::bind(&XMPPRosterController::handleRosterReceived, this, _1, false, boost::shared_ptr<RosterPayload>()));
+ rosterPushResponder_.onRosterReceived.connect(boost::bind(&XMPPRosterController::handleRosterReceived, this, _1, false, std::shared_ptr<RosterPayload>()));
rosterPushResponder_.start();
}
@@ -34,7 +34,7 @@ XMPPRosterController::~XMPPRosterController() {
void XMPPRosterController::requestRoster() {
xmppRoster_->clear();
- boost::shared_ptr<RosterPayload> storedRoster = rosterStorage_->getRoster();
+ std::shared_ptr<RosterPayload> storedRoster = rosterStorage_->getRoster();
GetRosterRequest::ref rosterRequest;
if (useVersioning) {
std::string version = "";
@@ -50,7 +50,7 @@ void XMPPRosterController::requestRoster() {
rosterRequest->send();
}
-void XMPPRosterController::handleRosterReceived(boost::shared_ptr<RosterPayload> rosterPayload, bool initial, boost::shared_ptr<RosterPayload> previousRoster) {
+void XMPPRosterController::handleRosterReceived(std::shared_ptr<RosterPayload> rosterPayload, bool initial, std::shared_ptr<RosterPayload> previousRoster) {
if (rosterPayload) {
foreach(const RosterItemPayload& item, rosterPayload->getItems()) {
//Don't worry about the updated case, the XMPPRoster sorts that out.
@@ -82,7 +82,7 @@ void XMPPRosterController::handleRosterReceived(boost::shared_ptr<RosterPayload>
void XMPPRosterController::saveRoster(const std::string& version) {
std::vector<XMPPRosterItem> items = xmppRoster_->getItems();
- boost::shared_ptr<RosterPayload> roster(new RosterPayload());
+ std::shared_ptr<RosterPayload> roster(new RosterPayload());
roster->setVersion(version);
foreach(const XMPPRosterItem& item, items) {
roster->addItem(RosterItemPayload(item.getJID(), item.getName(), item.getSubscription(), item.getGroups()));
diff --git a/Swiften/Roster/XMPPRosterController.h b/Swiften/Roster/XMPPRosterController.h
index d40ba1e..3803cd5 100644
--- a/Swiften/Roster/XMPPRosterController.h
+++ b/Swiften/Roster/XMPPRosterController.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/IQ.h>
@@ -34,7 +33,7 @@ namespace Swift {
}
private:
- void handleRosterReceived(boost::shared_ptr<RosterPayload> rosterPayload, bool initial, boost::shared_ptr<RosterPayload> previousRoster);
+ void handleRosterReceived(std::shared_ptr<RosterPayload> rosterPayload, bool initial, std::shared_ptr<RosterPayload> previousRoster);
void saveRoster(const std::string& version);
private:
diff --git a/Swiften/SASL/UnitTest/DIGESTMD5ClientAuthenticatorTest.cpp b/Swiften/SASL/UnitTest/DIGESTMD5ClientAuthenticatorTest.cpp
index 04e2df5..d29af59 100644
--- a/Swiften/SASL/UnitTest/DIGESTMD5ClientAuthenticatorTest.cpp
+++ b/Swiften/SASL/UnitTest/DIGESTMD5ClientAuthenticatorTest.cpp
@@ -26,7 +26,7 @@ class DIGESTMD5ClientAuthenticatorTest : public CppUnit::TestFixture {
public:
void setUp() {
- crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
}
void testGetInitialResponse() {
@@ -64,7 +64,7 @@ class DIGESTMD5ClientAuthenticatorTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> crypto;
};
CPPUNIT_TEST_SUITE_REGISTRATION(DIGESTMD5ClientAuthenticatorTest);
diff --git a/Swiften/SASL/UnitTest/SCRAMSHA1ClientAuthenticatorTest.cpp b/Swiften/SASL/UnitTest/SCRAMSHA1ClientAuthenticatorTest.cpp
index 3d5d161..7f408c6 100644
--- a/Swiften/SASL/UnitTest/SCRAMSHA1ClientAuthenticatorTest.cpp
+++ b/Swiften/SASL/UnitTest/SCRAMSHA1ClientAuthenticatorTest.cpp
@@ -43,8 +43,8 @@ class SCRAMSHA1ClientAuthenticatorTest : public CppUnit::TestFixture {
public:
void setUp() {
- idnConverter = boost::shared_ptr<IDNConverter>(PlatformIDNConverter::create());
- crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ idnConverter = std::shared_ptr<IDNConverter>(PlatformIDNConverter::create());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
}
void testGetInitialResponse() {
@@ -226,8 +226,8 @@ class SCRAMSHA1ClientAuthenticatorTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(!testling.getResponse());
}
- boost::shared_ptr<IDNConverter> idnConverter;
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<IDNConverter> idnConverter;
+ std::shared_ptr<CryptoProvider> crypto;
};
CPPUNIT_TEST_SUITE_REGISTRATION(SCRAMSHA1ClientAuthenticatorTest);
diff --git a/Swiften/SASL/WindowsAuthentication.cpp b/Swiften/SASL/WindowsAuthentication.cpp
index 5917b66..b86381b 100644
--- a/Swiften/SASL/WindowsAuthentication.cpp
+++ b/Swiften/SASL/WindowsAuthentication.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -15,7 +15,7 @@
#define ASSIGN_ERROR(status, errorCode) \
{ \
- errorCode = boost::make_shared<boost::system::error_code>(status, boost::system::system_category()); \
+ errorCode = std::make_shared<boost::system::error_code>(status, boost::system::system_category()); \
SWIFT_LOG(debug) << std::hex << "status: 0x" << status << ": " << errorCode->message() << std::endl; \
}
@@ -32,11 +32,11 @@
namespace Swift {
-boost::shared_ptr<boost::system::error_code> getUserNameEx(std::string& userName, std::string& clientName, std::string& serverName) {
+std::shared_ptr<boost::system::error_code> getUserNameEx(std::string& userName, std::string& clientName, std::string& serverName) {
ULONG length = 512;
DWORD status = ERROR_MORE_DATA;
bool firstCall = true;
- boost::shared_ptr<boost::system::error_code> errorCode;
+ std::shared_ptr<boost::system::error_code> errorCode;
while (status == ERROR_MORE_DATA) {
std::vector<wchar_t> value(length);
@@ -70,9 +70,9 @@ boost::shared_ptr<boost::system::error_code> getUserNameEx(std::string& userName
return errorCode;
}
-boost::shared_ptr<boost::system::error_code> acquireCredentialsHandle(PCredHandle credentialsHandle) {
+std::shared_ptr<boost::system::error_code> acquireCredentialsHandle(PCredHandle credentialsHandle) {
SECURITY_STATUS status;
- boost::shared_ptr<boost::system::error_code> errorCode;
+ std::shared_ptr<boost::system::error_code> errorCode;
TimeStamp validity;
status = AcquireCredentialsHandle(
@@ -90,9 +90,9 @@ boost::shared_ptr<boost::system::error_code> acquireCredentialsHandle(PCredHandl
return errorCode;
}
-boost::shared_ptr<boost::system::error_code> freeCredentialsHandle(PCredHandle credentialsHandle) {
+std::shared_ptr<boost::system::error_code> freeCredentialsHandle(PCredHandle credentialsHandle) {
SECURITY_STATUS status;
- boost::shared_ptr<boost::system::error_code> errorCode;
+ std::shared_ptr<boost::system::error_code> errorCode;
status = FreeCredentialsHandle(credentialsHandle);
ASSIGN_SEC_ERROR(status, errorCode);
@@ -100,9 +100,9 @@ boost::shared_ptr<boost::system::error_code> freeCredentialsHandle(PCredHandle c
return errorCode;
}
-boost::shared_ptr<boost::system::error_code> initializeSecurityContext(const boost::optional<ByteArray>& inputToken, const std::string& servicePrincipalNameString, const PCredHandle credentialsHandle, bool haveContextHandle, PCtxtHandle contextHandle, ULONG contextRequested, ULONG* contextSupported, bool* haveCompleteContext, SafeByteArray& outputToken) {
+std::shared_ptr<boost::system::error_code> initializeSecurityContext(const boost::optional<ByteArray>& inputToken, const std::string& servicePrincipalNameString, const PCredHandle credentialsHandle, bool haveContextHandle, PCtxtHandle contextHandle, ULONG contextRequested, ULONG* contextSupported, bool* haveCompleteContext, SafeByteArray& outputToken) {
SECURITY_STATUS status;
- boost::shared_ptr<boost::system::error_code> errorCode;
+ std::shared_ptr<boost::system::error_code> errorCode;
SecBufferDesc input;
SecBufferDesc output;
SecBuffer inputTokenBuffer;
@@ -164,15 +164,15 @@ boost::shared_ptr<boost::system::error_code> initializeSecurityContext(const boo
SWIFT_LOG(debug) << "outputToken.size(): " << outputToken.size() << std::endl;
freeContextBuffer(outputTokenBuffer.pvBuffer);
- return boost::shared_ptr<boost::system::error_code>(); /* success */
+ return std::shared_ptr<boost::system::error_code>(); /* success */
}
return errorCode;
}
-boost::shared_ptr<boost::system::error_code> deleteSecurityContext(PCtxtHandle contextHandle) {
+std::shared_ptr<boost::system::error_code> deleteSecurityContext(PCtxtHandle contextHandle) {
SECURITY_STATUS status;
- boost::shared_ptr<boost::system::error_code> errorCode;
+ std::shared_ptr<boost::system::error_code> errorCode;
status = DeleteSecurityContext(contextHandle);
ASSIGN_SEC_ERROR(status, errorCode);
@@ -180,9 +180,9 @@ boost::shared_ptr<boost::system::error_code> deleteSecurityContext(PCtxtHandle c
return errorCode;
}
-boost::shared_ptr<boost::system::error_code> completeAuthToken(const PCtxtHandle contextHandle, PSecBufferDesc token) {
+std::shared_ptr<boost::system::error_code> completeAuthToken(const PCtxtHandle contextHandle, PSecBufferDesc token) {
SECURITY_STATUS status;
- boost::shared_ptr<boost::system::error_code> errorCode;
+ std::shared_ptr<boost::system::error_code> errorCode;
status = CompleteAuthToken(
contextHandle, /* partial context */
@@ -192,9 +192,9 @@ boost::shared_ptr<boost::system::error_code> completeAuthToken(const PCtxtHandle
return errorCode;
}
-boost::shared_ptr<boost::system::error_code> freeContextBuffer(PVOID contextBuffer) {
+std::shared_ptr<boost::system::error_code> freeContextBuffer(PVOID contextBuffer) {
SECURITY_STATUS status;
- boost::shared_ptr<boost::system::error_code> errorCode;
+ std::shared_ptr<boost::system::error_code> errorCode;
if (contextBuffer == NULL) {
return errorCode;
@@ -206,11 +206,11 @@ boost::shared_ptr<boost::system::error_code> freeContextBuffer(PVOID contextBuff
return errorCode;
}
-boost::shared_ptr<boost::system::error_code> decryptMessage(const PCtxtHandle contextHandle, const ByteArray& message, SafeByteArray& decrypted) {
+std::shared_ptr<boost::system::error_code> decryptMessage(const PCtxtHandle contextHandle, const ByteArray& message, SafeByteArray& decrypted) {
/* Following https://msdn.microsoft.com/en-us/library/windows/desktop/aa380496%28v=vs.85%29.aspx */
SECURITY_STATUS status;
- boost::shared_ptr<boost::system::error_code> errorCode;
+ std::shared_ptr<boost::system::error_code> errorCode;
SecBufferDesc inOut;
SecBuffer messageBuffer[2];
SafeByteArray inputMessage;
@@ -253,11 +253,11 @@ boost::shared_ptr<boost::system::error_code> decryptMessage(const PCtxtHandle co
return errorCode;
}
-boost::shared_ptr<boost::system::error_code> encryptMessage(const PCtxtHandle contextHandle, const SecPkgContext_Sizes& sizes, const SafeByteArray& message, SafeByteArray& output) {
+std::shared_ptr<boost::system::error_code> encryptMessage(const PCtxtHandle contextHandle, const SecPkgContext_Sizes& sizes, const SafeByteArray& message, SafeByteArray& output) {
/* Following https://msdn.microsoft.com/en-us/library/windows/desktop/aa380496%28v=vs.85%29.aspx */
SECURITY_STATUS status;
- boost::shared_ptr<boost::system::error_code> errorCode;
+ std::shared_ptr<boost::system::error_code> errorCode;
SecBufferDesc inOut;
SecBuffer messageBuffer[3];
SafeByteArray securityTrailer(sizes.cbSecurityTrailer);
@@ -311,9 +311,9 @@ boost::shared_ptr<boost::system::error_code> encryptMessage(const PCtxtHandle co
return errorCode;
}
-boost::shared_ptr<boost::system::error_code> queryContextAttributes(const PCtxtHandle contextHandle, ULONG attribute, PVOID buffer) {
+std::shared_ptr<boost::system::error_code> queryContextAttributes(const PCtxtHandle contextHandle, ULONG attribute, PVOID buffer) {
SECURITY_STATUS status;
- boost::shared_ptr<boost::system::error_code> errorCode;
+ std::shared_ptr<boost::system::error_code> errorCode;
status = QueryContextAttributes(
contextHandle,
diff --git a/Swiften/SASL/WindowsAuthentication.h b/Swiften/SASL/WindowsAuthentication.h
index e0cf4bc..e5705a3 100644
--- a/Swiften/SASL/WindowsAuthentication.h
+++ b/Swiften/SASL/WindowsAuthentication.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -28,7 +28,7 @@ namespace Swift {
* @return NULL for success, otherwise the error code returned by
* Windows.
*/
- SWIFTEN_API boost::shared_ptr<boost::system::error_code> getUserNameEx(std::string& userName, std::string& clientName, std::string& serverName);
+ SWIFTEN_API std::shared_ptr<boost::system::error_code> getUserNameEx(std::string& userName, std::string& clientName, std::string& serverName);
/**
* Retrieves the handle to preexisting client credentials for the
@@ -42,7 +42,7 @@ namespace Swift {
* @return NULL for success, otherwise the error code returned by
* Windows.
*/
- SWIFTEN_API boost::shared_ptr<boost::system::error_code> acquireCredentialsHandle(PCredHandle credentialsHandle);
+ SWIFTEN_API std::shared_ptr<boost::system::error_code> acquireCredentialsHandle(PCredHandle credentialsHandle);
/**
* Releases the credentials handle obtained by the
@@ -55,7 +55,7 @@ namespace Swift {
* @return NULL for success, otherwise the error code returned by
* Windows.
*/
- SWIFTEN_API boost::shared_ptr<boost::system::error_code> freeCredentialsHandle(PCredHandle credentialsHandle);
+ SWIFTEN_API std::shared_ptr<boost::system::error_code> freeCredentialsHandle(PCredHandle credentialsHandle);
/**
* Builds the security context between the client and remote peer.
@@ -87,7 +87,7 @@ namespace Swift {
* @return NULL for success, otherwise the error code returned by
* Windows.
*/
- SWIFTEN_API boost::shared_ptr<boost::system::error_code> initializeSecurityContext(const boost::optional<ByteArray>& inputToken, const std::string& servicePrincipalNameString, const PCredHandle credentialsHandle, bool haveContextHandle, PCtxtHandle contextHandle, ULONG contextRequested, ULONG* contextSupported, bool* haveCompleteContext, SafeByteArray& outputToken);
+ SWIFTEN_API std::shared_ptr<boost::system::error_code> initializeSecurityContext(const boost::optional<ByteArray>& inputToken, const std::string& servicePrincipalNameString, const PCredHandle credentialsHandle, bool haveContextHandle, PCtxtHandle contextHandle, ULONG contextRequested, ULONG* contextSupported, bool* haveCompleteContext, SafeByteArray& outputToken);
/**
* Releases the context handle obtained by the
@@ -100,7 +100,7 @@ namespace Swift {
* @return NULL for success, otherwise the error code returned by
* Windows.
*/
- SWIFTEN_API boost::shared_ptr<boost::system::error_code> deleteSecurityContext(PCtxtHandle contextHandle);
+ SWIFTEN_API std::shared_ptr<boost::system::error_code> deleteSecurityContext(PCtxtHandle contextHandle);
/**
* Completes an authentication token for a partial security context.
@@ -111,7 +111,7 @@ namespace Swift {
* @return NULL for success, otherwise the error code returned by
* Windows.
*/
- SWIFTEN_API boost::shared_ptr<boost::system::error_code> completeAuthToken(const PCtxtHandle contextHandle, PSecBufferDesc token);
+ SWIFTEN_API std::shared_ptr<boost::system::error_code> completeAuthToken(const PCtxtHandle contextHandle, PSecBufferDesc token);
/**
* Frees a memory buffer allocated by the security package.
@@ -121,7 +121,7 @@ namespace Swift {
* @return NULL for success, otherwise the error code returned by
* Windows.
*/
- SWIFTEN_API boost::shared_ptr<boost::system::error_code> freeContextBuffer(PVOID contextBuffer);
+ SWIFTEN_API std::shared_ptr<boost::system::error_code> freeContextBuffer(PVOID contextBuffer);
/**
* Decrypt message (assumes that sequence numbers are not maintained).
@@ -133,7 +133,7 @@ namespace Swift {
* @return NULL for success, otherwise the error code returned by
* Windows.
*/
- SWIFTEN_API boost::shared_ptr<boost::system::error_code> decryptMessage(const PCtxtHandle contextHandle, const ByteArray& message, SafeByteArray& decrypted);
+ SWIFTEN_API std::shared_ptr<boost::system::error_code> decryptMessage(const PCtxtHandle contextHandle, const ByteArray& message, SafeByteArray& decrypted);
/**
* Produces a header or trailer for the message but does not encrypt it
@@ -147,7 +147,7 @@ namespace Swift {
* @return NULL for success, otherwise the error code returned by
* Windows.
*/
- SWIFTEN_API boost::shared_ptr<boost::system::error_code> encryptMessage(const PCtxtHandle contextHandle, const SecPkgContext_Sizes& sizes, const SafeByteArray& message, SafeByteArray& output);
+ SWIFTEN_API std::shared_ptr<boost::system::error_code> encryptMessage(const PCtxtHandle contextHandle, const SecPkgContext_Sizes& sizes, const SafeByteArray& message, SafeByteArray& output);
/**
* Queries the security package for attributes of the security context.
@@ -165,6 +165,6 @@ namespace Swift {
* @return NULL for success, otherwise the error code returned by
* Windows.
*/
- SWIFTEN_API boost::shared_ptr<boost::system::error_code> queryContextAttributes(const PCtxtHandle contextHandle, ULONG attribute, PVOID buffer);
+ SWIFTEN_API std::shared_ptr<boost::system::error_code> queryContextAttributes(const PCtxtHandle contextHandle, ULONG attribute, PVOID buffer);
}
diff --git a/Swiften/SASL/WindowsGSSAPIClientAuthenticator.h b/Swiften/SASL/WindowsGSSAPIClientAuthenticator.h
index c48d4dc..72616ed 100644
--- a/Swiften/SASL/WindowsGSSAPIClientAuthenticator.h
+++ b/Swiften/SASL/WindowsGSSAPIClientAuthenticator.h
@@ -88,7 +88,7 @@ namespace Swift {
*
* @return Error details.
*/
- boost::shared_ptr<boost::system::error_code> getErrorCode() {
+ std::shared_ptr<boost::system::error_code> getErrorCode() {
return errorCode_;
}
@@ -102,7 +102,7 @@ namespace Swift {
ServerAuthenticated
} step_;
bool error_;
- boost::shared_ptr<boost::system::error_code> errorCode_;
+ std::shared_ptr<boost::system::error_code> errorCode_;
std::string servicePrincipalNameString_;
bool haveCredentialsHandle_;
bool haveContextHandle_;
diff --git a/Swiften/Serializer/AuthChallengeSerializer.cpp b/Swiften/Serializer/AuthChallengeSerializer.cpp
index 2796a2d..8f963ff 100644
--- a/Swiften/Serializer/AuthChallengeSerializer.cpp
+++ b/Swiften/Serializer/AuthChallengeSerializer.cpp
@@ -15,8 +15,8 @@ namespace Swift {
AuthChallengeSerializer::AuthChallengeSerializer() {
}
-SafeByteArray AuthChallengeSerializer::serialize(boost::shared_ptr<ToplevelElement> element) const {
- boost::shared_ptr<AuthChallenge> authChallenge(boost::dynamic_pointer_cast<AuthChallenge>(element));
+SafeByteArray AuthChallengeSerializer::serialize(std::shared_ptr<ToplevelElement> element) const {
+ std::shared_ptr<AuthChallenge> authChallenge(std::dynamic_pointer_cast<AuthChallenge>(element));
std::string value;
boost::optional<std::vector<unsigned char> > message = authChallenge->getValue();
if (message) {
diff --git a/Swiften/Serializer/AuthChallengeSerializer.h b/Swiften/Serializer/AuthChallengeSerializer.h
index 6c88d0a..9bcf68b 100644
--- a/Swiften/Serializer/AuthChallengeSerializer.h
+++ b/Swiften/Serializer/AuthChallengeSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2014 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/AuthChallenge.h>
@@ -17,6 +17,6 @@ namespace Swift {
public:
AuthChallengeSerializer();
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement> element) const;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement> element) const;
};
}
diff --git a/Swiften/Serializer/AuthFailureSerializer.h b/Swiften/Serializer/AuthFailureSerializer.h
index fe85d2c..a410e8c 100644
--- a/Swiften/Serializer/AuthFailureSerializer.h
+++ b/Swiften/Serializer/AuthFailureSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/AuthFailure.h>
@@ -19,7 +19,7 @@ namespace Swift {
AuthFailureSerializer() : GenericElementSerializer<AuthFailure>() {
}
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement>) const {
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement>) const {
return createSafeByteArray(XMLElement("failure", "urn:ietf:params:xml:ns:xmpp-sasl").serialize());
}
};
diff --git a/Swiften/Serializer/AuthRequestSerializer.cpp b/Swiften/Serializer/AuthRequestSerializer.cpp
index f479eac..2c9a4dd 100644
--- a/Swiften/Serializer/AuthRequestSerializer.cpp
+++ b/Swiften/Serializer/AuthRequestSerializer.cpp
@@ -16,8 +16,8 @@ namespace Swift {
AuthRequestSerializer::AuthRequestSerializer() {
}
-SafeByteArray AuthRequestSerializer::serialize(boost::shared_ptr<ToplevelElement> element) const {
- boost::shared_ptr<AuthRequest> authRequest(boost::dynamic_pointer_cast<AuthRequest>(element));
+SafeByteArray AuthRequestSerializer::serialize(std::shared_ptr<ToplevelElement> element) const {
+ std::shared_ptr<AuthRequest> authRequest(std::dynamic_pointer_cast<AuthRequest>(element));
SafeByteArray value;
boost::optional<SafeByteArray> message = authRequest->getMessage();
if (message) {
diff --git a/Swiften/Serializer/AuthRequestSerializer.h b/Swiften/Serializer/AuthRequestSerializer.h
index 8522c35..ae85cf6 100644
--- a/Swiften/Serializer/AuthRequestSerializer.h
+++ b/Swiften/Serializer/AuthRequestSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2014 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/AuthRequest.h>
@@ -17,6 +17,6 @@ namespace Swift {
public:
AuthRequestSerializer();
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement> element) const;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement> element) const;
};
}
diff --git a/Swiften/Serializer/AuthResponseSerializer.cpp b/Swiften/Serializer/AuthResponseSerializer.cpp
index b4be521..9d3e2e0 100644
--- a/Swiften/Serializer/AuthResponseSerializer.cpp
+++ b/Swiften/Serializer/AuthResponseSerializer.cpp
@@ -16,8 +16,8 @@ namespace Swift {
AuthResponseSerializer::AuthResponseSerializer() {
}
-SafeByteArray AuthResponseSerializer::serialize(boost::shared_ptr<ToplevelElement> element) const {
- boost::shared_ptr<AuthResponse> authResponse(boost::dynamic_pointer_cast<AuthResponse>(element));
+SafeByteArray AuthResponseSerializer::serialize(std::shared_ptr<ToplevelElement> element) const {
+ std::shared_ptr<AuthResponse> authResponse(std::dynamic_pointer_cast<AuthResponse>(element));
SafeByteArray value;
boost::optional<SafeByteArray> message = authResponse->getValue();
if (message) {
diff --git a/Swiften/Serializer/AuthResponseSerializer.h b/Swiften/Serializer/AuthResponseSerializer.h
index 2017f75..25ffbbb 100644
--- a/Swiften/Serializer/AuthResponseSerializer.h
+++ b/Swiften/Serializer/AuthResponseSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2014 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/AuthResponse.h>
@@ -17,6 +17,6 @@ namespace Swift {
public:
AuthResponseSerializer();
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement> element) const;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement> element) const;
};
}
diff --git a/Swiften/Serializer/AuthSuccessSerializer.cpp b/Swiften/Serializer/AuthSuccessSerializer.cpp
index 78fe6a1..48d512b 100644
--- a/Swiften/Serializer/AuthSuccessSerializer.cpp
+++ b/Swiften/Serializer/AuthSuccessSerializer.cpp
@@ -15,8 +15,8 @@ namespace Swift {
AuthSuccessSerializer::AuthSuccessSerializer() {
}
-SafeByteArray AuthSuccessSerializer::serialize(boost::shared_ptr<ToplevelElement> element) const {
- boost::shared_ptr<AuthSuccess> authSuccess(boost::dynamic_pointer_cast<AuthSuccess>(element));
+SafeByteArray AuthSuccessSerializer::serialize(std::shared_ptr<ToplevelElement> element) const {
+ std::shared_ptr<AuthSuccess> authSuccess(std::dynamic_pointer_cast<AuthSuccess>(element));
std::string value;
boost::optional<std::vector<unsigned char> > message = authSuccess->getValue();
if (message) {
diff --git a/Swiften/Serializer/AuthSuccessSerializer.h b/Swiften/Serializer/AuthSuccessSerializer.h
index 99133fa..102e6a0 100644
--- a/Swiften/Serializer/AuthSuccessSerializer.h
+++ b/Swiften/Serializer/AuthSuccessSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2014 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/AuthSuccess.h>
@@ -17,6 +17,6 @@ namespace Swift {
public:
AuthSuccessSerializer();
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement> element) const;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement> element) const;
};
}
diff --git a/Swiften/Serializer/ComponentHandshakeSerializer.cpp b/Swiften/Serializer/ComponentHandshakeSerializer.cpp
index 1ac1ce7..0e94917 100644
--- a/Swiften/Serializer/ComponentHandshakeSerializer.cpp
+++ b/Swiften/Serializer/ComponentHandshakeSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2014 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,8 +13,8 @@ namespace Swift {
ComponentHandshakeSerializer::ComponentHandshakeSerializer() {
}
-SafeByteArray ComponentHandshakeSerializer::serialize(boost::shared_ptr<ToplevelElement> element) const {
- boost::shared_ptr<ComponentHandshake> handshake(boost::dynamic_pointer_cast<ComponentHandshake>(element));
+SafeByteArray ComponentHandshakeSerializer::serialize(std::shared_ptr<ToplevelElement> element) const {
+ std::shared_ptr<ComponentHandshake> handshake(std::dynamic_pointer_cast<ComponentHandshake>(element));
return createSafeByteArray("<handshake>" + handshake->getData() + "</handshake>");
}
diff --git a/Swiften/Serializer/ComponentHandshakeSerializer.h b/Swiften/Serializer/ComponentHandshakeSerializer.h
index 651903f..d6ee156 100644
--- a/Swiften/Serializer/ComponentHandshakeSerializer.h
+++ b/Swiften/Serializer/ComponentHandshakeSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/ComponentHandshake.h>
@@ -17,6 +17,6 @@ namespace Swift {
public:
ComponentHandshakeSerializer();
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement> element) const;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement> element) const;
};
}
diff --git a/Swiften/Serializer/CompressFailureSerializer.h b/Swiften/Serializer/CompressFailureSerializer.h
index 154f167..045c7d2 100644
--- a/Swiften/Serializer/CompressFailureSerializer.h
+++ b/Swiften/Serializer/CompressFailureSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/CompressFailure.h>
@@ -19,7 +19,7 @@ namespace Swift {
CompressFailureSerializer() : GenericElementSerializer<CompressFailure>() {
}
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement>) const {
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement>) const {
return createSafeByteArray(XMLElement("failure", "http://jabber.org/protocol/compress").serialize());
}
};
diff --git a/Swiften/Serializer/CompressRequestSerializer.cpp b/Swiften/Serializer/CompressRequestSerializer.cpp
index e6bc4ff..9deb702 100644
--- a/Swiften/Serializer/CompressRequestSerializer.cpp
+++ b/Swiften/Serializer/CompressRequestSerializer.cpp
@@ -13,13 +13,13 @@ namespace Swift {
CompressRequestSerializer::CompressRequestSerializer() {
}
-SafeByteArray CompressRequestSerializer::serialize(boost::shared_ptr<ToplevelElement> element) const {
- boost::shared_ptr<CompressRequest> compressRequest(boost::dynamic_pointer_cast<CompressRequest>(element));
+SafeByteArray CompressRequestSerializer::serialize(std::shared_ptr<ToplevelElement> element) const {
+ std::shared_ptr<CompressRequest> compressRequest(std::dynamic_pointer_cast<CompressRequest>(element));
return createSafeByteArray("<compress xmlns='http://jabber.org/protocol/compress'><method>" + compressRequest->getMethod() + "</method></compress>");
}
-bool CompressRequestSerializer::canSerialize(boost::shared_ptr<ToplevelElement> element) const {
- return boost::dynamic_pointer_cast<CompressRequest>(element) != nullptr;
+bool CompressRequestSerializer::canSerialize(std::shared_ptr<ToplevelElement> element) const {
+ return std::dynamic_pointer_cast<CompressRequest>(element) != nullptr;
}
}
diff --git a/Swiften/Serializer/CompressRequestSerializer.h b/Swiften/Serializer/CompressRequestSerializer.h
index 1472a81..d768023 100644
--- a/Swiften/Serializer/CompressRequestSerializer.h
+++ b/Swiften/Serializer/CompressRequestSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Serializer/ElementSerializer.h>
@@ -16,7 +16,7 @@ namespace Swift {
public:
CompressRequestSerializer();
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement> element) const;
- virtual bool canSerialize(boost::shared_ptr<ToplevelElement> element) const;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement> element) const;
+ virtual bool canSerialize(std::shared_ptr<ToplevelElement> element) const;
};
}
diff --git a/Swiften/Serializer/ElementSerializer.h b/Swiften/Serializer/ElementSerializer.h
index 15f69da..3bef58b 100644
--- a/Swiften/Serializer/ElementSerializer.h
+++ b/Swiften/Serializer/ElementSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/SafeByteArray.h>
#include <Swiften/Elements/ToplevelElement.h>
@@ -16,7 +16,7 @@ namespace Swift {
public:
virtual ~ElementSerializer();
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement> element) const = 0;
- virtual bool canSerialize(boost::shared_ptr<ToplevelElement> element) const = 0;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement> element) const = 0;
+ virtual bool canSerialize(std::shared_ptr<ToplevelElement> element) const = 0;
};
}
diff --git a/Swiften/Serializer/EnableStreamManagementSerializer.h b/Swiften/Serializer/EnableStreamManagementSerializer.h
index ffbcf8b..ba92843 100644
--- a/Swiften/Serializer/EnableStreamManagementSerializer.h
+++ b/Swiften/Serializer/EnableStreamManagementSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/EnableStreamManagement.h>
@@ -19,7 +19,7 @@ namespace Swift {
EnableStreamManagementSerializer() : GenericElementSerializer<EnableStreamManagement>() {
}
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement>) const {
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement>) const {
return createSafeByteArray(XMLElement("enable", "urn:xmpp:sm:2").serialize());
}
};
diff --git a/Swiften/Serializer/GenericElementSerializer.h b/Swiften/Serializer/GenericElementSerializer.h
index 053a163..b5f4119 100644
--- a/Swiften/Serializer/GenericElementSerializer.h
+++ b/Swiften/Serializer/GenericElementSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Serializer/ElementSerializer.h>
@@ -15,10 +15,10 @@ namespace Swift {
template<typename T>
class SWIFTEN_API GenericElementSerializer : public ElementSerializer {
public:
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement> element) const = 0;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement> element) const = 0;
- virtual bool canSerialize(boost::shared_ptr<ToplevelElement> element) const {
- return !!boost::dynamic_pointer_cast<T>(element);
+ virtual bool canSerialize(std::shared_ptr<ToplevelElement> element) const {
+ return !!std::dynamic_pointer_cast<T>(element);
}
};
}
diff --git a/Swiften/Serializer/GenericPayloadSerializer.h b/Swiften/Serializer/GenericPayloadSerializer.h
index 080d04b..804ccaf 100644
--- a/Swiften/Serializer/GenericPayloadSerializer.h
+++ b/Swiften/Serializer/GenericPayloadSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Serializer/PayloadSerializer.h>
@@ -15,14 +15,14 @@ namespace Swift {
template<typename PAYLOAD_TYPE>
class GenericPayloadSerializer : public PayloadSerializer {
public:
- virtual std::string serialize(boost::shared_ptr<Payload> element) const {
- return serializePayload(boost::dynamic_pointer_cast<PAYLOAD_TYPE>(element));
+ virtual std::string serialize(std::shared_ptr<Payload> element) const {
+ return serializePayload(std::dynamic_pointer_cast<PAYLOAD_TYPE>(element));
}
- virtual bool canSerialize(boost::shared_ptr<Payload> element) const {
- return !!boost::dynamic_pointer_cast<PAYLOAD_TYPE>(element);
+ virtual bool canSerialize(std::shared_ptr<Payload> element) const {
+ return !!std::dynamic_pointer_cast<PAYLOAD_TYPE>(element);
}
- virtual std::string serializePayload(boost::shared_ptr<PAYLOAD_TYPE>) const = 0;
+ virtual std::string serializePayload(std::shared_ptr<PAYLOAD_TYPE>) const = 0;
};
}
diff --git a/Swiften/Serializer/GenericStanzaSerializer.h b/Swiften/Serializer/GenericStanzaSerializer.h
index 32fcbe9..badd55c 100644
--- a/Swiften/Serializer/GenericStanzaSerializer.h
+++ b/Swiften/Serializer/GenericStanzaSerializer.h
@@ -15,19 +15,19 @@ namespace Swift {
public:
GenericStanzaSerializer(const std::string& tag, PayloadSerializerCollection* payloadSerializers, const boost::optional<std::string>& explicitNS = boost::optional<std::string>()) : StanzaSerializer(tag, payloadSerializers, explicitNS) {}
- virtual bool canSerialize(boost::shared_ptr<ToplevelElement> element) const {
+ virtual bool canSerialize(std::shared_ptr<ToplevelElement> element) const {
return dynamic_cast<STANZA_TYPE*>(element.get()) != nullptr;
}
virtual void setStanzaSpecificAttributes(
- boost::shared_ptr<ToplevelElement> stanza,
+ std::shared_ptr<ToplevelElement> stanza,
XMLElement& element) const {
setStanzaSpecificAttributesGeneric(
- boost::dynamic_pointer_cast<STANZA_TYPE>(stanza), element);
+ std::dynamic_pointer_cast<STANZA_TYPE>(stanza), element);
}
virtual void setStanzaSpecificAttributesGeneric(
- boost::shared_ptr<STANZA_TYPE>,
+ std::shared_ptr<STANZA_TYPE>,
XMLElement&) const = 0;
};
}
diff --git a/Swiften/Serializer/IQSerializer.h b/Swiften/Serializer/IQSerializer.h
index db052fb..1bdbb07 100644
--- a/Swiften/Serializer/IQSerializer.h
+++ b/Swiften/Serializer/IQSerializer.h
@@ -22,7 +22,7 @@ namespace Swift {
private:
virtual void setStanzaSpecificAttributesGeneric(
- boost::shared_ptr<IQ> iq,
+ std::shared_ptr<IQ> iq,
XMLElement& element) const {
switch (iq->getType()) {
case IQ::Get: element.setAttribute("type","get"); break;
diff --git a/Swiften/Serializer/MessageSerializer.cpp b/Swiften/Serializer/MessageSerializer.cpp
index fb16393..774d9a3 100644
--- a/Swiften/Serializer/MessageSerializer.cpp
+++ b/Swiften/Serializer/MessageSerializer.cpp
@@ -15,7 +15,7 @@ MessageSerializer::MessageSerializer(PayloadSerializerCollection* payloadSeriali
}
void MessageSerializer::setStanzaSpecificAttributesGeneric(
- boost::shared_ptr<Message> message,
+ std::shared_ptr<Message> message,
XMLElement& element) const {
if (message->getType() == Message::Chat) {
element.setAttribute("type", "chat");
diff --git a/Swiften/Serializer/MessageSerializer.h b/Swiften/Serializer/MessageSerializer.h
index 50df353..812b647 100644
--- a/Swiften/Serializer/MessageSerializer.h
+++ b/Swiften/Serializer/MessageSerializer.h
@@ -21,7 +21,7 @@ namespace Swift {
private:
void setStanzaSpecificAttributesGeneric(
- boost::shared_ptr<Message> message,
+ std::shared_ptr<Message> message,
XMLElement& element) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializer.h b/Swiften/Serializer/PayloadSerializer.h
index 642247d..fe14e3d 100644
--- a/Swiften/Serializer/PayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializer.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
namespace Swift {
@@ -19,7 +18,7 @@ namespace Swift {
public:
virtual ~PayloadSerializer();
- virtual bool canSerialize(boost::shared_ptr<Payload>) const = 0;
- virtual std::string serialize(boost::shared_ptr<Payload>) const = 0;
+ virtual bool canSerialize(std::shared_ptr<Payload>) const = 0;
+ virtual std::string serialize(std::shared_ptr<Payload>) const = 0;
};
}
diff --git a/Swiften/Serializer/PayloadSerializerCollection.cpp b/Swiften/Serializer/PayloadSerializerCollection.cpp
index 05fe445..dd20364 100644
--- a/Swiften/Serializer/PayloadSerializerCollection.cpp
+++ b/Swiften/Serializer/PayloadSerializerCollection.cpp
@@ -25,7 +25,7 @@ void PayloadSerializerCollection::removeSerializer(PayloadSerializer* serializer
serializers_.erase(std::remove(serializers_.begin(), serializers_.end(), serializer), serializers_.end());
}
-PayloadSerializer* PayloadSerializerCollection::getPayloadSerializer(boost::shared_ptr<Payload> payload) const {
+PayloadSerializer* PayloadSerializerCollection::getPayloadSerializer(std::shared_ptr<Payload> payload) const {
std::vector<PayloadSerializer*>::const_iterator i = std::find_if(
serializers_.begin(), serializers_.end(),
boost::bind(&PayloadSerializer::canSerialize, _1, payload));
diff --git a/Swiften/Serializer/PayloadSerializerCollection.h b/Swiften/Serializer/PayloadSerializerCollection.h
index 47ba6a1..a0fe2ea 100644
--- a/Swiften/Serializer/PayloadSerializerCollection.h
+++ b/Swiften/Serializer/PayloadSerializerCollection.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
@@ -23,7 +22,7 @@ namespace Swift {
void addSerializer(PayloadSerializer* factory);
void removeSerializer(PayloadSerializer* factory);
- PayloadSerializer* getPayloadSerializer(boost::shared_ptr<Payload>) const;
+ PayloadSerializer* getPayloadSerializer(std::shared_ptr<Payload>) const;
private:
std::vector<PayloadSerializer*> serializers_;
diff --git a/Swiften/Serializer/PayloadSerializers/BlockSerializer.h b/Swiften/Serializer/PayloadSerializers/BlockSerializer.h
index 7490e4f..86aa321 100644
--- a/Swiften/Serializer/PayloadSerializers/BlockSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/BlockSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/JID/JID.h>
@@ -20,11 +20,11 @@ namespace Swift {
BlockSerializer(std::string tag) : GenericPayloadSerializer<BLOCK_ELEMENT>(), tag(tag) {
}
- virtual std::string serializePayload(boost::shared_ptr<BLOCK_ELEMENT> payload) const {
+ virtual std::string serializePayload(std::shared_ptr<BLOCK_ELEMENT> payload) const {
XMLElement element(tag, "urn:xmpp:blocking");
const std::vector<JID>& items = payload->getItems();
for (std::vector<JID>::const_iterator i = items.begin(); i != items.end(); ++i) {
- boost::shared_ptr<XMLElement> item = boost::make_shared<XMLElement>("item");
+ std::shared_ptr<XMLElement> item = std::make_shared<XMLElement>("item");
item->setAttribute("jid", *i);
element.addNode(item);
}
diff --git a/Swiften/Serializer/PayloadSerializers/BodySerializer.h b/Swiften/Serializer/PayloadSerializers/BodySerializer.h
index f2d7a8d..faad411 100644
--- a/Swiften/Serializer/PayloadSerializers/BodySerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/BodySerializer.h
@@ -16,7 +16,7 @@ namespace Swift {
public:
BodySerializer() : GenericPayloadSerializer<Body>() {}
- virtual std::string serializePayload(boost::shared_ptr<Body> body) const {
+ virtual std::string serializePayload(std::shared_ptr<Body> body) const {
XMLTextNode textNode(body->getText());
return "<body>" + textNode.serialize() + "</body>";
}
diff --git a/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp
index b5218ee..93eab75 100644
--- a/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp
@@ -6,8 +6,9 @@
#include <Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
@@ -18,11 +19,11 @@ namespace Swift {
BytestreamsSerializer::BytestreamsSerializer() {
}
-std::string BytestreamsSerializer::serializePayload(boost::shared_ptr<Bytestreams> bytestreams) const {
+std::string BytestreamsSerializer::serializePayload(std::shared_ptr<Bytestreams> bytestreams) const {
XMLElement queryElement("query", "http://jabber.org/protocol/bytestreams");
queryElement.setAttribute("sid", bytestreams->getStreamID());
foreach(const Bytestreams::StreamHost& streamHost, bytestreams->getStreamHosts()) {
- boost::shared_ptr<XMLElement> streamHostElement(new XMLElement("streamhost"));
+ std::shared_ptr<XMLElement> streamHostElement(new XMLElement("streamhost"));
streamHostElement->setAttribute("host", streamHost.host);
streamHostElement->setAttribute("jid", streamHost.jid.toString());
streamHostElement->setAttribute("port", boost::lexical_cast<std::string>(streamHost.port));
@@ -30,7 +31,7 @@ std::string BytestreamsSerializer::serializePayload(boost::shared_ptr<Bytestream
}
if (bytestreams->getUsedStreamHost()) {
- boost::shared_ptr<XMLElement> streamHostElement(new XMLElement("streamhost-used"));
+ std::shared_ptr<XMLElement> streamHostElement(new XMLElement("streamhost-used"));
streamHostElement->setAttribute("jid", *bytestreams->getUsedStreamHost());
queryElement.addNode(streamHostElement);
}
diff --git a/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h b/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h
index 6056cad..533be61 100644
--- a/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.h
@@ -17,6 +17,6 @@ namespace Swift {
public:
BytestreamsSerializer();
- virtual std::string serializePayload(boost::shared_ptr<Bytestreams>) const;
+ virtual std::string serializePayload(std::shared_ptr<Bytestreams>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp
index 799e662..19f8a27 100644
--- a/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -15,7 +15,7 @@ namespace Swift {
CapsInfoSerializer::CapsInfoSerializer() : GenericPayloadSerializer<CapsInfo>() {
}
-std::string CapsInfoSerializer::serializePayload(boost::shared_ptr<CapsInfo> capsInfo) const {
+std::string CapsInfoSerializer::serializePayload(std::shared_ptr<CapsInfo> capsInfo) const {
XMLElement capsElement("c", "http://jabber.org/protocol/caps");
capsElement.setAttribute("node", capsInfo->getNode());
capsElement.setAttribute("hash", capsInfo->getHash());
diff --git a/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h b/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h
index bbf4c09..ac168e4 100644
--- a/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h
@@ -15,6 +15,6 @@ namespace Swift {
public:
CapsInfoSerializer();
- virtual std::string serializePayload(boost::shared_ptr<CapsInfo>) const;
+ virtual std::string serializePayload(std::shared_ptr<CapsInfo>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.cpp
index 406fdbc..9938bd9 100644
--- a/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -17,7 +17,7 @@ namespace Swift {
}
- std::string CarbonsDisableSerializer::serializePayload(boost::shared_ptr<CarbonsDisable>) const {
+ std::string CarbonsDisableSerializer::serializePayload(std::shared_ptr<CarbonsDisable>) const {
XMLElement element("disable", "urn:xmpp:carbons:2");
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.h b/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.h
index da01ead..a6bf16f 100644
--- a/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/CarbonsDisableSerializer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -16,6 +16,6 @@ namespace Swift {
CarbonsDisableSerializer();
virtual ~CarbonsDisableSerializer();
- virtual std::string serializePayload(boost::shared_ptr<CarbonsDisable>) const;
+ virtual std::string serializePayload(std::shared_ptr<CarbonsDisable>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.cpp
index a2520f9..424c6fc 100644
--- a/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -16,7 +16,7 @@ namespace Swift {
}
- std::string CarbonsEnableSerializer::serializePayload(boost::shared_ptr<CarbonsEnable>) const {
+ std::string CarbonsEnableSerializer::serializePayload(std::shared_ptr<CarbonsEnable>) const {
XMLElement element("enable", "urn:xmpp:carbons:2");
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.h b/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.h
index 8b26901..eb0f6fa 100644
--- a/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/CarbonsEnableSerializer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -17,6 +17,6 @@ namespace Swift {
CarbonsEnableSerializer();
virtual ~CarbonsEnableSerializer();
- virtual std::string serializePayload(boost::shared_ptr<CarbonsEnable>) const;
+ virtual std::string serializePayload(std::shared_ptr<CarbonsEnable>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.cpp
index 6fbfc26..fb92017 100644
--- a/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -16,7 +16,7 @@ namespace Swift {
}
- std::string CarbonsPrivateSerializer::serializePayload(boost::shared_ptr<CarbonsPrivate>) const {
+ std::string CarbonsPrivateSerializer::serializePayload(std::shared_ptr<CarbonsPrivate>) const {
XMLElement element("private", "urn:xmpp:carbons:2");
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.h b/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.h
index a93d87f..d148a26 100644
--- a/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/CarbonsPrivateSerializer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -17,6 +17,6 @@ namespace Swift {
CarbonsPrivateSerializer();
virtual ~CarbonsPrivateSerializer();
- virtual std::string serializePayload(boost::shared_ptr<CarbonsPrivate>) const;
+ virtual std::string serializePayload(std::shared_ptr<CarbonsPrivate>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.cpp
index 981421b..cc87929 100644
--- a/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.cpp
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.h>
-#include <boost/make_shared.hpp>
+#include <memory>
namespace Swift {
CarbonsReceivedSerializer::CarbonsReceivedSerializer(PayloadSerializerCollection* serializers) : GenericPayloadSerializer<CarbonsReceived>(), serializers_(serializers) {
@@ -15,10 +15,10 @@ namespace Swift {
CarbonsReceivedSerializer::~CarbonsReceivedSerializer() {
}
- std::string CarbonsReceivedSerializer::serializePayload(boost::shared_ptr<CarbonsReceived> received) const {
+ std::string CarbonsReceivedSerializer::serializePayload(std::shared_ptr<CarbonsReceived> received) const {
XMLElement element("received", "urn:xmpp:carbons:2");
if (received->getForwarded()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(ForwardedSerializer(serializers_).serialize(received->getForwarded())));
+ element.addNode(std::make_shared<XMLRawTextNode>(ForwardedSerializer(serializers_).serialize(received->getForwarded())));
}
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.h b/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.h
index 719e84a..017b187 100644
--- a/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/CarbonsReceivedSerializer.h
@@ -20,7 +20,7 @@ namespace Swift {
CarbonsReceivedSerializer(PayloadSerializerCollection* serializers);
virtual ~CarbonsReceivedSerializer();
- virtual std::string serializePayload(boost::shared_ptr<CarbonsReceived> received) const;
+ virtual std::string serializePayload(std::shared_ptr<CarbonsReceived> received) const;
private:
PayloadSerializerCollection* serializers_;
diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.cpp
index f71208f..986edcb 100644
--- a/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,10 +13,10 @@ namespace Swift {
CarbonsSentSerializer::~CarbonsSentSerializer() {
}
- std::string CarbonsSentSerializer::serializePayload(boost::shared_ptr<CarbonsSent> sent) const {
+ std::string CarbonsSentSerializer::serializePayload(std::shared_ptr<CarbonsSent> sent) const {
XMLElement element("sent", "urn:xmpp:carbons:2");
if (sent->getForwarded()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(ForwardedSerializer(serializers_).serialize(sent->getForwarded())));
+ element.addNode(std::make_shared<XMLRawTextNode>(ForwardedSerializer(serializers_).serialize(sent->getForwarded())));
}
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.h b/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.h
index cecb3b8..16db398 100644
--- a/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/CarbonsSent.h>
@@ -22,7 +22,7 @@ namespace Swift {
CarbonsSentSerializer(PayloadSerializerCollection* serializers);
virtual ~CarbonsSentSerializer();
- virtual std::string serializePayload(boost::shared_ptr<CarbonsSent> sent) const;
+ virtual std::string serializePayload(std::shared_ptr<CarbonsSent> sent) const;
private:
PayloadSerializerCollection* serializers_;
diff --git a/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.cpp
index 325215a..17f8be0 100644
--- a/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -11,7 +11,7 @@ namespace Swift {
ChatStateSerializer::ChatStateSerializer() : GenericPayloadSerializer<ChatState>() {
}
-std::string ChatStateSerializer::serializePayload(boost::shared_ptr<ChatState> chatState) const {
+std::string ChatStateSerializer::serializePayload(std::shared_ptr<ChatState> chatState) const {
std::string result("<");
switch (chatState->getChatState()) {
case ChatState::Active: result += "active"; break;
diff --git a/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.h b/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.h
index cfdaf83..3b9f315 100644
--- a/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/ChatStateSerializer.h
@@ -15,6 +15,6 @@ namespace Swift {
public:
ChatStateSerializer();
- virtual std::string serializePayload(boost::shared_ptr<ChatState> error) const;
+ virtual std::string serializePayload(std::shared_ptr<ChatState> error) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/CommandSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CommandSerializer.cpp
index 9ed17dc..e1dd6ed 100644
--- a/Swiften/Serializer/PayloadSerializers/CommandSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/CommandSerializer.cpp
@@ -6,8 +6,7 @@
#include <Swiften/Serializer/PayloadSerializers/CommandSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/PayloadSerializers/FormSerializer.h>
@@ -20,7 +19,7 @@ namespace Swift {
CommandSerializer::CommandSerializer() {
}
-std::string CommandSerializer::serializePayload(boost::shared_ptr<Command> command) const {
+std::string CommandSerializer::serializePayload(std::shared_ptr<Command> command) const {
XMLElement commandElement("command", "http://jabber.org/protocol/commands");
commandElement.setAttribute("node", command->getNode());
@@ -55,11 +54,11 @@ std::string CommandSerializer::serializePayload(boost::shared_ptr<Command> comma
actions += "<" + actionToString(action) + "/>";
}
actions += "</actions>";
- commandElement.addNode(boost::make_shared<XMLRawTextNode>(actions));
+ commandElement.addNode(std::make_shared<XMLRawTextNode>(actions));
}
foreach (Command::Note note, command->getNotes()) {
- boost::shared_ptr<XMLElement> noteElement(new XMLElement("note"));
+ std::shared_ptr<XMLElement> noteElement(new XMLElement("note"));
std::string type;
switch (note.type) {
case Command::Note::Info: type = "info"; break;
@@ -69,13 +68,13 @@ std::string CommandSerializer::serializePayload(boost::shared_ptr<Command> comma
if (!type.empty()) {
noteElement->setAttribute("type", type);
}
- noteElement->addNode(boost::make_shared<XMLTextNode>(note.note));
+ noteElement->addNode(std::make_shared<XMLTextNode>(note.note));
commandElement.addNode(noteElement);
}
Form::ref form = command->getForm();
if (form) {
- commandElement.addNode(boost::make_shared<XMLRawTextNode>(FormSerializer().serialize(form)));
+ commandElement.addNode(std::make_shared<XMLRawTextNode>(FormSerializer().serialize(form)));
}
return commandElement.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/CommandSerializer.h b/Swiften/Serializer/PayloadSerializers/CommandSerializer.h
index bc3642d..e1f0b24 100644
--- a/Swiften/Serializer/PayloadSerializers/CommandSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/CommandSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
CommandSerializer();
- virtual std::string serializePayload(boost::shared_ptr<Command>) const;
+ virtual std::string serializePayload(std::shared_ptr<Command>) const;
private:
std::string actionToString(Command::Action action) const;
diff --git a/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp b/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp
index 428b565..b168fdc 100644
--- a/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp
@@ -6,8 +6,9 @@
#include <Swiften/Serializer/PayloadSerializers/DelaySerializer.h>
+#include <memory>
+
#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/DateTime.h>
#include <Swiften/Base/String.h>
@@ -18,7 +19,7 @@ namespace Swift {
DelaySerializer::DelaySerializer() : GenericPayloadSerializer<Delay>() {
}
-std::string DelaySerializer::serializePayload(boost::shared_ptr<Delay> delay) const {
+std::string DelaySerializer::serializePayload(std::shared_ptr<Delay> delay) const {
XMLElement delayElement("delay", "urn:xmpp:delay");
if (delay->getFrom() && delay->getFrom()->isValid()) {
delayElement.setAttribute("from", delay->getFrom()->toString());
diff --git a/Swiften/Serializer/PayloadSerializers/DelaySerializer.h b/Swiften/Serializer/PayloadSerializers/DelaySerializer.h
index 71039f2..86fde42 100644
--- a/Swiften/Serializer/PayloadSerializers/DelaySerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/DelaySerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
DelaySerializer();
- virtual std::string serializePayload(boost::shared_ptr<Delay>) const;
+ virtual std::string serializePayload(std::shared_ptr<Delay>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.cpp b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.cpp
index 887502a..8183b7f 100644
--- a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.cpp
@@ -20,7 +20,7 @@ namespace Swift {
DeliveryReceiptRequestSerializer::DeliveryReceiptRequestSerializer() : GenericPayloadSerializer<DeliveryReceiptRequest>() {
}
-std::string DeliveryReceiptRequestSerializer::serializePayload(boost::shared_ptr<DeliveryReceiptRequest> /* request*/) const {
+std::string DeliveryReceiptRequestSerializer::serializePayload(std::shared_ptr<DeliveryReceiptRequest> /* request*/) const {
XMLElement requestXML("request", "urn:xmpp:receipts");
return requestXML.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.h b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.h
index 97377d6..a3e76eb 100644
--- a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.h
@@ -21,6 +21,6 @@ namespace Swift {
public:
DeliveryReceiptRequestSerializer();
- virtual std::string serializePayload(boost::shared_ptr<DeliveryReceiptRequest> request) const;
+ virtual std::string serializePayload(std::shared_ptr<DeliveryReceiptRequest> request) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.cpp b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.cpp
index d3e1480..d392d17 100644
--- a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.cpp
@@ -19,7 +19,7 @@ namespace Swift {
DeliveryReceiptSerializer::DeliveryReceiptSerializer() : GenericPayloadSerializer<DeliveryReceipt>() {
}
-std::string DeliveryReceiptSerializer::serializePayload(boost::shared_ptr<DeliveryReceipt> receipt) const {
+std::string DeliveryReceiptSerializer::serializePayload(std::shared_ptr<DeliveryReceipt> receipt) const {
XMLElement received("received", "urn:xmpp:receipts");
received.setAttribute("id", receipt->getReceivedID());
return received.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.h b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.h
index 943f4b9..6153de1 100644
--- a/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/DeliveryReceiptSerializer.h
@@ -21,6 +21,6 @@ namespace Swift {
public:
DeliveryReceiptSerializer();
- virtual std::string serializePayload(boost::shared_ptr<DeliveryReceipt> receipt) const;
+ virtual std::string serializePayload(std::shared_ptr<DeliveryReceipt> receipt) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp
index e57fd12..73e2585 100644
--- a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp
@@ -6,8 +6,7 @@
#include <Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/PayloadSerializers/FormSerializer.h>
@@ -19,13 +18,13 @@ namespace Swift {
DiscoInfoSerializer::DiscoInfoSerializer() : GenericPayloadSerializer<DiscoInfo>() {
}
-std::string DiscoInfoSerializer::serializePayload(boost::shared_ptr<DiscoInfo> discoInfo) const {
+std::string DiscoInfoSerializer::serializePayload(std::shared_ptr<DiscoInfo> discoInfo) const {
XMLElement queryElement("query", "http://jabber.org/protocol/disco#info");
if (!discoInfo->getNode().empty()) {
queryElement.setAttribute("node", discoInfo->getNode());
}
foreach(const DiscoInfo::Identity& identity, discoInfo->getIdentities()) {
- boost::shared_ptr<XMLElement> identityElement(new XMLElement("identity"));
+ std::shared_ptr<XMLElement> identityElement(new XMLElement("identity"));
if (!identity.getLanguage().empty()) {
identityElement->setAttribute("xml:lang", identity.getLanguage());
}
@@ -35,12 +34,12 @@ std::string DiscoInfoSerializer::serializePayload(boost::shared_ptr<DiscoInfo> d
queryElement.addNode(identityElement);
}
foreach(const std::string& feature, discoInfo->getFeatures()) {
- boost::shared_ptr<XMLElement> featureElement(new XMLElement("feature"));
+ std::shared_ptr<XMLElement> featureElement(new XMLElement("feature"));
featureElement->setAttribute("var", feature);
queryElement.addNode(featureElement);
}
foreach(const Form::ref extension, discoInfo->getExtensions()) {
- queryElement.addNode(boost::make_shared<XMLRawTextNode>(FormSerializer().serialize(extension)));
+ queryElement.addNode(std::make_shared<XMLRawTextNode>(FormSerializer().serialize(extension)));
}
return queryElement.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h
index 9850714..21648d6 100644
--- a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h
@@ -15,6 +15,6 @@ namespace Swift {
public:
DiscoInfoSerializer();
- virtual std::string serializePayload(boost::shared_ptr<DiscoInfo>) const;
+ virtual std::string serializePayload(std::shared_ptr<DiscoInfo>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.cpp
index f537f40..1b734dc 100644
--- a/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.cpp
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -16,13 +16,13 @@ namespace Swift {
DiscoItemsSerializer::DiscoItemsSerializer() : GenericPayloadSerializer<DiscoItems>() {
}
-std::string DiscoItemsSerializer::serializePayload(boost::shared_ptr<DiscoItems> discoItems) const {
+std::string DiscoItemsSerializer::serializePayload(std::shared_ptr<DiscoItems> discoItems) const {
XMLElement queryElement("query", "http://jabber.org/protocol/disco#items");
if (!discoItems->getNode().empty()) {
queryElement.setAttribute("node", discoItems->getNode());
}
foreach(const DiscoItems::Item& item, discoItems->getItems()) {
- boost::shared_ptr<XMLElement> itemElement(new XMLElement("item"));
+ std::shared_ptr<XMLElement> itemElement(new XMLElement("item"));
itemElement->setAttribute("name", item.getName());
itemElement->setAttribute("jid", item.getJID());
if (!item.getNode().empty()) {
diff --git a/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h b/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h
index acc5a7b..ca88cb0 100644
--- a/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/DiscoItemsSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
DiscoItemsSerializer();
- virtual std::string serializePayload(boost::shared_ptr<DiscoItems>) const;
+ virtual std::string serializePayload(std::shared_ptr<DiscoItems>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/ErrorSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ErrorSerializer.cpp
index 1ed60d1..26686f0 100644
--- a/Swiften/Serializer/PayloadSerializers/ErrorSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/ErrorSerializer.cpp
@@ -14,7 +14,7 @@ namespace Swift {
ErrorSerializer::ErrorSerializer(PayloadSerializerCollection* serializers) : GenericPayloadSerializer<ErrorPayload>(), serializers(serializers) {
}
-std::string ErrorSerializer::serializePayload(boost::shared_ptr<ErrorPayload> error) const {
+std::string ErrorSerializer::serializePayload(std::shared_ptr<ErrorPayload> error) const {
std::string result("<error type=\"");
switch (error->getType()) {
case ErrorPayload::Continue: result += "continue"; break;
diff --git a/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h b/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h
index 2ccd5df..df7791e 100644
--- a/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h
@@ -17,7 +17,7 @@ namespace Swift {
public:
ErrorSerializer(PayloadSerializerCollection* serializers);
- virtual std::string serializePayload(boost::shared_ptr<ErrorPayload> error) const;
+ virtual std::string serializePayload(std::shared_ptr<ErrorPayload> error) const;
private:
PayloadSerializerCollection* serializers;
diff --git a/Swiften/Serializer/PayloadSerializers/FormSerializer.cpp b/Swiften/Serializer/PayloadSerializers/FormSerializer.cpp
index cc6339c..9a05431 100644
--- a/Swiften/Serializer/PayloadSerializers/FormSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/FormSerializer.cpp
@@ -7,11 +7,9 @@
#include <Swiften/Serializer/PayloadSerializers/FormSerializer.h>
#include <iostream>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
-
#include <Swiften/Base/Algorithm.h>
#include <Swiften/Base/String.h>
#include <Swiften/Base/foreach.h>
@@ -21,10 +19,10 @@
using namespace Swift;
namespace {
- template<typename T> void serializeValueAsString(boost::shared_ptr<FormField> field, boost::shared_ptr<XMLElement> parent) {
- std::string value = boost::dynamic_pointer_cast<T>(field)->getValue();
+ template<typename T> void serializeValueAsString(std::shared_ptr<FormField> field, std::shared_ptr<XMLElement> parent) {
+ std::string value = std::dynamic_pointer_cast<T>(field)->getValue();
if (!value.empty()) {
- boost::shared_ptr<XMLElement> valueElement(new XMLElement("value"));
+ std::shared_ptr<XMLElement> valueElement(new XMLElement("value"));
valueElement->addNode(XMLTextNode::create(value));
parent->addNode(valueElement);
}
@@ -35,12 +33,12 @@ namespace Swift {
FormSerializer::FormSerializer() : GenericPayloadSerializer<Form>() {}
-std::string FormSerializer::serializePayload(boost::shared_ptr<Form> form) const {
+std::string FormSerializer::serializePayload(std::shared_ptr<Form> form) const {
if (!form) {
return "";
}
- boost::shared_ptr<XMLElement> formElement(new XMLElement("x", "jabber:x:data"));
+ std::shared_ptr<XMLElement> formElement(new XMLElement("x", "jabber:x:data"));
std::string type;
switch (form->getType()) {
case Form::FormType: type = "form"; break;
@@ -55,14 +53,14 @@ std::string FormSerializer::serializePayload(boost::shared_ptr<Form> form) cons
if (!form->getInstructions().empty()) {
multiLineify(form->getInstructions(), "instructions", formElement);
}
- foreach(boost::shared_ptr<FormPage> page, form->getPages()) {
+ foreach(std::shared_ptr<FormPage> page, form->getPages()) {
formElement->addNode(pageToXML(page));
}
- foreach(boost::shared_ptr<FormField> field, form->getFields()) {
+ foreach(std::shared_ptr<FormField> field, form->getFields()) {
formElement->addNode(fieldToXML(field, true));
}
if (!form->getReportedFields().empty()) {
- boost::shared_ptr<XMLElement> reportedElement(new XMLElement("reported"));
+ std::shared_ptr<XMLElement> reportedElement(new XMLElement("reported"));
foreach(FormField::ref field, form->getReportedFields()) {
reportedElement->addNode(fieldToXML(field, true));
}
@@ -70,7 +68,7 @@ std::string FormSerializer::serializePayload(boost::shared_ptr<Form> form) cons
}
foreach(Form::FormItem item, form->getItems()) {
- boost::shared_ptr<XMLElement> itemElement(new XMLElement("item"));
+ std::shared_ptr<XMLElement> itemElement(new XMLElement("item"));
foreach(FormField::ref field, item) {
itemElement->addNode(fieldToXML(field, false));
}
@@ -81,27 +79,27 @@ std::string FormSerializer::serializePayload(boost::shared_ptr<Form> form) cons
formElement->addNode(textToXML(text));
}
- foreach (boost::shared_ptr<FormField> field, fields_) {
+ foreach (std::shared_ptr<FormField> field, fields_) {
formElement->addNode(fieldToXML(field,true));
}
return formElement->serialize();
}
-boost::shared_ptr<XMLElement> FormSerializer::textToXML(boost::shared_ptr<FormText> text) const {
- boost::shared_ptr<XMLElement> textElement (new XMLElement("text"));
- textElement->addNode(boost::make_shared<XMLTextNode>(text->getTextString()));
+std::shared_ptr<XMLElement> FormSerializer::textToXML(std::shared_ptr<FormText> text) const {
+ std::shared_ptr<XMLElement> textElement (new XMLElement("text"));
+ textElement->addNode(std::make_shared<XMLTextNode>(text->getTextString()));
return textElement;
}
-boost::shared_ptr<XMLElement> FormSerializer::fieldRefToXML(const std::string& ref) const {
- boost::shared_ptr<XMLElement> fieldRefElement(new XMLElement("fieldref"));
+std::shared_ptr<XMLElement> FormSerializer::fieldRefToXML(const std::string& ref) const {
+ std::shared_ptr<XMLElement> fieldRefElement(new XMLElement("fieldref"));
fieldRefElement->setAttribute("var", ref);
return fieldRefElement;
}
-boost::shared_ptr<XMLElement> FormSerializer::pageToXML(boost::shared_ptr<FormPage> page) const {
- boost::shared_ptr<XMLElement> pageElement(new XMLElement("page"));
+std::shared_ptr<XMLElement> FormSerializer::pageToXML(std::shared_ptr<FormPage> page) const {
+ std::shared_ptr<XMLElement> pageElement(new XMLElement("page"));
pageElement->setAttribute("xmlns", "http://jabber.org/protocol/xdata-layout");
if (!page->getLabel().empty()) {
pageElement->setAttribute("label", page->getLabel());
@@ -109,12 +107,12 @@ boost::shared_ptr<XMLElement> FormSerializer::pageToXML(boost::shared_ptr<FormPa
foreach(const FormText::text text, page->getTextElements()) {
pageElement->addNode(textToXML(text));
}
- foreach (const boost::shared_ptr<FormField> field, page->getFields()) {
+ foreach (const std::shared_ptr<FormField> field, page->getFields()) {
pageElement->addNode(fieldRefToXML(field->getName()));
fields_.push_back(field);
}
foreach(const FormReportedRef::ref reportedRef, page->getReportedRefs()) {
- pageElement->addNode(boost::make_shared<XMLElement>("reportedref"));
+ pageElement->addNode(std::make_shared<XMLElement>("reportedref"));
}
foreach(const FormSection::section section, page->getChildSections()) {
pageElement->addNode(sectionToXML(section));
@@ -122,20 +120,20 @@ boost::shared_ptr<XMLElement> FormSerializer::pageToXML(boost::shared_ptr<FormPa
return pageElement;
}
-boost::shared_ptr<XMLElement> FormSerializer::sectionToXML(boost::shared_ptr<FormSection> section) const {
- boost::shared_ptr<XMLElement> sectionElement(new XMLElement("section"));
+std::shared_ptr<XMLElement> FormSerializer::sectionToXML(std::shared_ptr<FormSection> section) const {
+ std::shared_ptr<XMLElement> sectionElement(new XMLElement("section"));
if (!section->getLabel().empty()) {
sectionElement->setAttribute("label", section->getLabel());
}
foreach(const FormText::text text, section->getTextElements()) {
sectionElement->addNode(textToXML(text));
}
- foreach(const boost::shared_ptr<FormField> field, section->getFields()) {
+ foreach(const std::shared_ptr<FormField> field, section->getFields()) {
sectionElement->addNode(fieldRefToXML(field->getName()));
fields_.push_back(field);
}
foreach(const FormReportedRef::ref reportedRef, section->getReportedRefs()) {
- sectionElement->addNode(boost::make_shared<XMLElement>("reportedref"));
+ sectionElement->addNode(std::make_shared<XMLElement>("reportedref"));
}
foreach(const FormSection::section childSection, section->getChildSections()) {
sectionElement->addNode(sectionToXML(childSection));
@@ -143,8 +141,8 @@ boost::shared_ptr<XMLElement> FormSerializer::sectionToXML(boost::shared_ptr<For
return sectionElement;
}
-boost::shared_ptr<XMLElement> FormSerializer::fieldToXML(boost::shared_ptr<FormField> field, bool withTypeAttribute) const {
- boost::shared_ptr<XMLElement> fieldElement(new XMLElement("field"));
+std::shared_ptr<XMLElement> FormSerializer::fieldToXML(std::shared_ptr<FormField> field, bool withTypeAttribute) const {
+ std::shared_ptr<XMLElement> fieldElement(new XMLElement("field"));
if (!field->getName().empty()) {
fieldElement->setAttribute("var", field->getName());
}
@@ -152,11 +150,11 @@ boost::shared_ptr<XMLElement> FormSerializer::fieldToXML(boost::shared_ptr<FormF
fieldElement->setAttribute("label", field->getLabel());
}
if (field->getRequired()) {
- fieldElement->addNode(boost::make_shared<XMLElement>("required"));
+ fieldElement->addNode(std::make_shared<XMLElement>("required"));
}
if (!field->getDescription().empty()) {
- boost::shared_ptr<XMLElement> descriptionElement(new XMLElement("desc"));
- descriptionElement->addNode(boost::make_shared<XMLTextNode>(field->getDescription()));
+ std::shared_ptr<XMLElement> descriptionElement(new XMLElement("desc"));
+ descriptionElement->addNode(std::make_shared<XMLTextNode>(field->getDescription()));
fieldElement->addNode(descriptionElement);
}
@@ -179,18 +177,18 @@ boost::shared_ptr<XMLElement> FormSerializer::fieldToXML(boost::shared_ptr<FormF
fieldElement->setAttribute("type", fieldType);
}
foreach (const std::string& value, field->getValues()) {
- boost::shared_ptr<XMLElement> valueElement = boost::make_shared<XMLElement>("value");
- valueElement->addNode(boost::make_shared<XMLTextNode>(value));
+ std::shared_ptr<XMLElement> valueElement = std::make_shared<XMLElement>("value");
+ valueElement->addNode(std::make_shared<XMLTextNode>(value));
fieldElement->addNode(valueElement);
}
foreach (const FormField::Option& option, field->getOptions()) {
- boost::shared_ptr<XMLElement> optionElement(new XMLElement("option"));
+ std::shared_ptr<XMLElement> optionElement(new XMLElement("option"));
if (!option.label.empty()) {
optionElement->setAttribute("label", option.label);
}
- boost::shared_ptr<XMLElement> valueElement(new XMLElement("value"));
+ std::shared_ptr<XMLElement> valueElement(new XMLElement("value"));
valueElement->addNode(XMLTextNode::create(option.value));
optionElement->addNode(valueElement);
fieldElement->addNode(optionElement);
@@ -198,13 +196,13 @@ boost::shared_ptr<XMLElement> FormSerializer::fieldToXML(boost::shared_ptr<FormF
return fieldElement;
}
-void FormSerializer::multiLineify(const std::string& text, const std::string& elementName, boost::shared_ptr<XMLElement> element) const {
+void FormSerializer::multiLineify(const std::string& text, const std::string& elementName, std::shared_ptr<XMLElement> element) const {
std::string unRdText(text);
erase(unRdText, '\r');
std::vector<std::string> lines = String::split(unRdText, '\n');
foreach (std::string line, lines) {
- boost::shared_ptr<XMLElement> lineElement(new XMLElement(elementName));
- lineElement->addNode(boost::make_shared<XMLTextNode>(line));
+ std::shared_ptr<XMLElement> lineElement(new XMLElement(elementName));
+ lineElement->addNode(std::make_shared<XMLTextNode>(line));
element->addNode(lineElement);
}
}
diff --git a/Swiften/Serializer/PayloadSerializers/FormSerializer.h b/Swiften/Serializer/PayloadSerializers/FormSerializer.h
index 62f6484..590fce4 100644
--- a/Swiften/Serializer/PayloadSerializers/FormSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/FormSerializer.h
@@ -18,16 +18,16 @@ namespace Swift {
class SWIFTEN_API FormSerializer : public GenericPayloadSerializer<Form> {
public:
FormSerializer();
- virtual std::string serializePayload(boost::shared_ptr<Form>) const;
+ virtual std::string serializePayload(std::shared_ptr<Form>) const;
private:
- boost::shared_ptr<XMLElement> textToXML(boost::shared_ptr<FormText> textElement) const;
- boost::shared_ptr<XMLElement> fieldRefToXML(const std::string& ref) const;
- boost::shared_ptr<XMLElement> reportedRefToXML(boost::shared_ptr<FormReportedRef> reportedRef) const;
- boost::shared_ptr<XMLElement> pageToXML(boost::shared_ptr<FormPage> page) const;
- boost::shared_ptr<XMLElement> sectionToXML(boost::shared_ptr<FormSection> section) const;
- boost::shared_ptr<XMLElement> fieldToXML(boost::shared_ptr<FormField> field, bool withTypeAttribute) const;
- void multiLineify(const std::string& text, const std::string& elementName, boost::shared_ptr<XMLElement> parent) const;
- mutable std::vector<boost::shared_ptr<FormField> > fields_;
+ std::shared_ptr<XMLElement> textToXML(std::shared_ptr<FormText> textElement) const;
+ std::shared_ptr<XMLElement> fieldRefToXML(const std::string& ref) const;
+ std::shared_ptr<XMLElement> reportedRefToXML(std::shared_ptr<FormReportedRef> reportedRef) const;
+ std::shared_ptr<XMLElement> pageToXML(std::shared_ptr<FormPage> page) const;
+ std::shared_ptr<XMLElement> sectionToXML(std::shared_ptr<FormSection> section) const;
+ std::shared_ptr<XMLElement> fieldToXML(std::shared_ptr<FormField> field, bool withTypeAttribute) const;
+ void multiLineify(const std::string& text, const std::string& elementName, std::shared_ptr<XMLElement> parent) const;
+ mutable std::vector<std::shared_ptr<FormField> > fields_;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.cpp
index 8df5793..58660d7 100644
--- a/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.cpp
@@ -6,8 +6,9 @@
#include <Swiften/Serializer/PayloadSerializers/ForwardedSerializer.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Elements/Delay.h>
#include <Swiften/Elements/IQ.h>
@@ -30,7 +31,7 @@ ForwardedSerializer::ForwardedSerializer(PayloadSerializerCollection* serializer
ForwardedSerializer::~ForwardedSerializer() {
}
-std::string ForwardedSerializer::serializePayload(boost::shared_ptr<Forwarded> payload) const {
+std::string ForwardedSerializer::serializePayload(std::shared_ptr<Forwarded> payload) const {
if (!payload) {
return "";
}
@@ -38,20 +39,20 @@ std::string ForwardedSerializer::serializePayload(boost::shared_ptr<Forwarded> p
XMLElement element("forwarded", "urn:xmpp:forward:0");
if (payload->getDelay()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(DelaySerializer().serialize(payload->getDelay())));
+ element.addNode(std::make_shared<XMLRawTextNode>(DelaySerializer().serialize(payload->getDelay())));
}
if (payload->getStanza()) { /* find out what type of stanza we are dealing with and branch into the correct serializer*/
- boost::shared_ptr<IQ> iq;
- boost::shared_ptr<Message> message;
- boost::shared_ptr<Presence> presence;
+ std::shared_ptr<IQ> iq;
+ std::shared_ptr<Message> message;
+ std::shared_ptr<Presence> presence;
const std::string ns = "jabber:client";
- if ((iq = boost::dynamic_pointer_cast<IQ>(payload->getStanza()))) {
- element.addNode(boost::make_shared<XMLRawTextNode>(safeByteArrayToString(IQSerializer(serializers_).serialize(iq, ns))));
- } else if ((message = boost::dynamic_pointer_cast<Message>(payload->getStanza()))) {
- element.addNode(boost::make_shared<XMLRawTextNode>(safeByteArrayToString(MessageSerializer(serializers_).serialize(message, ns))));
- } else if ((presence = boost::dynamic_pointer_cast<Presence>(payload->getStanza()))) {
- element.addNode(boost::make_shared<XMLRawTextNode>(safeByteArrayToString(PresenceSerializer(serializers_).serialize(presence, ns))));
+ if ((iq = std::dynamic_pointer_cast<IQ>(payload->getStanza()))) {
+ element.addNode(std::make_shared<XMLRawTextNode>(safeByteArrayToString(IQSerializer(serializers_).serialize(iq, ns))));
+ } else if ((message = std::dynamic_pointer_cast<Message>(payload->getStanza()))) {
+ element.addNode(std::make_shared<XMLRawTextNode>(safeByteArrayToString(MessageSerializer(serializers_).serialize(message, ns))));
+ } else if ((presence = std::dynamic_pointer_cast<Presence>(payload->getStanza()))) {
+ element.addNode(std::make_shared<XMLRawTextNode>(safeByteArrayToString(PresenceSerializer(serializers_).serialize(presence, ns))));
}
}
diff --git a/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.h b/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.h
index 08b82b9..f3eb6fb 100644
--- a/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/ForwardedSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
ForwardedSerializer(PayloadSerializerCollection* serializers);
virtual ~ForwardedSerializer();
- virtual std::string serializePayload(boost::shared_ptr<Forwarded>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<Forwarded>) const SWIFTEN_OVERRIDE;
private:
PayloadSerializerCollection* serializers_;
diff --git a/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp b/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp
index 53ae0d2..36d82a2 100644
--- a/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp
@@ -7,10 +7,9 @@
#include <Swiften/Serializer/PayloadSerializers/IBBSerializer.h>
#include <cassert>
+#include <memory>
#include <boost/lexical_cast.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -22,7 +21,7 @@ namespace Swift {
IBBSerializer::IBBSerializer() {
}
-std::string IBBSerializer::serializePayload(boost::shared_ptr<IBB> ibb) const {
+std::string IBBSerializer::serializePayload(std::shared_ptr<IBB> ibb) const {
switch(ibb->getAction()) {
case IBB::Data: {
XMLElement ibbElement("data", "http://jabber.org/protocol/ibb");
@@ -30,7 +29,7 @@ std::string IBBSerializer::serializePayload(boost::shared_ptr<IBB> ibb) const {
if (ibb->getSequenceNumber() >= 0) {
ibbElement.setAttribute("seq", boost::lexical_cast<std::string>(ibb->getSequenceNumber()));
}
- ibbElement.addNode(boost::make_shared<XMLTextNode>(Base64::encode(ibb->getData())));
+ ibbElement.addNode(std::make_shared<XMLTextNode>(Base64::encode(ibb->getData())));
return ibbElement.serialize();
}
case IBB::Open: {
diff --git a/Swiften/Serializer/PayloadSerializers/IBBSerializer.h b/Swiften/Serializer/PayloadSerializers/IBBSerializer.h
index fe45eac..0ef1680 100644
--- a/Swiften/Serializer/PayloadSerializers/IBBSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/IBBSerializer.h
@@ -15,6 +15,6 @@ namespace Swift {
public:
IBBSerializer();
- virtual std::string serializePayload(boost::shared_ptr<IBB>) const;
+ virtual std::string serializePayload(std::shared_ptr<IBB>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/IdleSerializer.h b/Swiften/Serializer/PayloadSerializers/IdleSerializer.h
index 1a832a1..4e1a953 100644
--- a/Swiften/Serializer/PayloadSerializers/IdleSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/IdleSerializer.h
@@ -22,7 +22,7 @@ namespace Swift {
public:
IdleSerializer() : GenericPayloadSerializer<Idle>() {}
- virtual std::string serializePayload(boost::shared_ptr<Idle> idle) const {
+ virtual std::string serializePayload(std::shared_ptr<Idle> idle) const {
return "<idle xmlns='urn:xmpp:idle:1' since='" + dateTimeToString(idle->getSince()) + "'/>";
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.cpp
index 5f275f1..31b023f 100644
--- a/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.cpp
@@ -6,8 +6,7 @@
#include <Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/PayloadSerializers/FormSerializer.h>
@@ -19,7 +18,7 @@ namespace Swift {
InBandRegistrationPayloadSerializer::InBandRegistrationPayloadSerializer() {
}
-std::string InBandRegistrationPayloadSerializer::serializePayload(boost::shared_ptr<InBandRegistrationPayload> registration) const {
+std::string InBandRegistrationPayloadSerializer::serializePayload(std::shared_ptr<InBandRegistrationPayload> registration) const {
XMLElement registerElement("query", "jabber:iq:register");
if (registration->isRegistered()) {
@@ -104,7 +103,7 @@ std::string InBandRegistrationPayloadSerializer::serializePayload(boost::shared_
}
if (Form::ref form = registration->getForm()) {
- registerElement.addNode(boost::make_shared<XMLRawTextNode>(FormSerializer().serialize(form)));
+ registerElement.addNode(std::make_shared<XMLRawTextNode>(FormSerializer().serialize(form)));
}
return registerElement.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h
index 45eb2f5..d5f6cce 100644
--- a/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/InBandRegistrationPayloadSerializer.h
@@ -16,6 +16,6 @@ namespace Swift {
public:
InBandRegistrationPayloadSerializer();
- virtual std::string serializePayload(boost::shared_ptr<InBandRegistrationPayload>) const;
+ virtual std::string serializePayload(std::shared_ptr<InBandRegistrationPayload>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.cpp b/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.cpp
index 243ebc0..000c1bf 100644
--- a/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/XML/XMLRawTextNode.h>
@@ -21,12 +21,12 @@ IsodeIQDelegationSerializer::IsodeIQDelegationSerializer(PayloadSerializerCollec
IsodeIQDelegationSerializer::~IsodeIQDelegationSerializer() {
}
-std::string IsodeIQDelegationSerializer::serializePayload(boost::shared_ptr<IsodeIQDelegation> payload) const {
+std::string IsodeIQDelegationSerializer::serializePayload(std::shared_ptr<IsodeIQDelegation> payload) const {
if (!payload) {
return "";
}
XMLElement element("delegate", "http://isode.com/iq_delegation");
- element.addNode(boost::make_shared<XMLRawTextNode>(serializers->getPayloadSerializer(payload->getForward())->serialize(payload->getForward())));
+ element.addNode(std::make_shared<XMLRawTextNode>(serializers->getPayloadSerializer(payload->getForward())->serialize(payload->getForward())));
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.h b/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.h
index 47a9ddc..e7cfef9 100644
--- a/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/IsodeIQDelegationSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
IsodeIQDelegationSerializer(PayloadSerializerCollection* serializers);
virtual ~IsodeIQDelegationSerializer();
- virtual std::string serializePayload(boost::shared_ptr<IsodeIQDelegation>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<IsodeIQDelegation>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.cpp
index c006a93..02e0f2a 100644
--- a/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.cpp
@@ -12,9 +12,7 @@
#include <Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/intrusive_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/Log.h>
#include <Swiften/Base/foreach.h>
@@ -30,7 +28,7 @@ namespace Swift {
JingleContentPayloadSerializer::JingleContentPayloadSerializer() {
}
-std::string JingleContentPayloadSerializer::serializePayload(boost::shared_ptr<JingleContentPayload> payload) const {
+std::string JingleContentPayloadSerializer::serializePayload(std::shared_ptr<JingleContentPayload> payload) const {
XMLElement payloadXML("content");
payloadXML.setAttribute("creator", creatorToString(payload->getCreator()));
payloadXML.setAttribute("name", payload->getName());
@@ -41,8 +39,8 @@ std::string JingleContentPayloadSerializer::serializePayload(boost::shared_ptr<J
JingleFileTransferDescription::ref filetransfer;
foreach(JingleDescription::ref desc, payload->getDescriptions()) {
- if ((filetransfer = boost::dynamic_pointer_cast<JingleFileTransferDescription>(desc))) {
- payloadXML.addNode(boost::make_shared<XMLRawTextNode>(ftSerializer.serializePayload(filetransfer)));
+ if ((filetransfer = std::dynamic_pointer_cast<JingleFileTransferDescription>(desc))) {
+ payloadXML.addNode(std::make_shared<XMLRawTextNode>(ftSerializer.serializePayload(filetransfer)));
}
}
}
@@ -57,10 +55,10 @@ std::string JingleContentPayloadSerializer::serializePayload(boost::shared_ptr<J
JingleS5BTransportPayload::ref s5b;
foreach(JingleTransportPayload::ref transport, payload->getTransports()) {
- if ((ibb = boost::dynamic_pointer_cast<JingleIBBTransportPayload>(transport))) {
- payloadXML.addNode(boost::make_shared<XMLRawTextNode>(ibbSerializer.serializePayload(ibb)));
- } else if ((s5b = boost::dynamic_pointer_cast<JingleS5BTransportPayload>(transport))) {
- payloadXML.addNode(boost::make_shared<XMLRawTextNode>(s5bSerializer.serializePayload(s5b)));
+ if ((ibb = std::dynamic_pointer_cast<JingleIBBTransportPayload>(transport))) {
+ payloadXML.addNode(std::make_shared<XMLRawTextNode>(ibbSerializer.serializePayload(ibb)));
+ } else if ((s5b = std::dynamic_pointer_cast<JingleS5BTransportPayload>(transport))) {
+ payloadXML.addNode(std::make_shared<XMLRawTextNode>(s5bSerializer.serializePayload(s5b)));
}
}
}
diff --git a/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.h
index ff0185e..825a67c 100644
--- a/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.h
@@ -24,7 +24,7 @@ namespace Swift {
public:
JingleContentPayloadSerializer();
- virtual std::string serializePayload(boost::shared_ptr<JingleContentPayload>) const;
+ virtual std::string serializePayload(std::shared_ptr<JingleContentPayload>) const;
private:
std::string creatorToString(JingleContentPayload::Creator creator) const;
diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.cpp
index b0bb78d..b002482 100644
--- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.cpp
@@ -12,9 +12,9 @@
#include <Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/DateTime.h>
#include <Swiften/Base/foreach.h>
@@ -29,11 +29,11 @@ namespace Swift {
JingleFileTransferDescriptionSerializer::JingleFileTransferDescriptionSerializer() {
}
-std::string JingleFileTransferDescriptionSerializer::serializePayload(boost::shared_ptr<JingleFileTransferDescription> payload) const {
+std::string JingleFileTransferDescriptionSerializer::serializePayload(std::shared_ptr<JingleFileTransferDescription> payload) const {
XMLElement description("description", "urn:xmpp:jingle:apps:file-transfer:4");
JingleFileTransferFileInfoSerializer fileInfoSerializer;
- boost::shared_ptr<XMLRawTextNode> fileInfoXML = boost::make_shared<XMLRawTextNode>(fileInfoSerializer.serialize(boost::make_shared<JingleFileTransferFileInfo>(payload->getFileInfo())));
+ std::shared_ptr<XMLRawTextNode> fileInfoXML = std::make_shared<XMLRawTextNode>(fileInfoSerializer.serialize(std::make_shared<JingleFileTransferFileInfo>(payload->getFileInfo())));
description.addNode(fileInfoXML);
return description.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.h b/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.h
index 53199f6..65e757b 100644
--- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.h
@@ -25,6 +25,6 @@ namespace Swift {
public:
JingleFileTransferDescriptionSerializer();
- virtual std::string serializePayload(boost::shared_ptr<JingleFileTransferDescription>) const;
+ virtual std::string serializePayload(std::shared_ptr<JingleFileTransferDescription>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.cpp
index 7fcf452..d78d7df 100644
--- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.cpp
@@ -6,9 +6,9 @@
#include <Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/DateTime.h>
#include <Swiften/Base/foreach.h>
@@ -22,28 +22,28 @@ namespace Swift {
JingleFileTransferFileInfoSerializer::JingleFileTransferFileInfoSerializer() {
}
-std::string JingleFileTransferFileInfoSerializer::serializePayload(boost::shared_ptr<JingleFileTransferFileInfo> fileInfo) const {
+std::string JingleFileTransferFileInfoSerializer::serializePayload(std::shared_ptr<JingleFileTransferFileInfo> fileInfo) const {
XMLElement fileElement("file", "");
if (fileInfo->getDate() != stringToDateTime("")) {
- fileElement.addNode(boost::make_shared<XMLElement>("date", "", dateTimeToString(fileInfo->getDate())));
+ fileElement.addNode(std::make_shared<XMLElement>("date", "", dateTimeToString(fileInfo->getDate())));
}
if (!fileInfo->getDescription().empty()) {
- fileElement.addNode(boost::make_shared<XMLElement>("desc", "", fileInfo->getDescription()));
+ fileElement.addNode(std::make_shared<XMLElement>("desc", "", fileInfo->getDescription()));
}
if (!fileInfo->getMediaType().empty()) {
- fileElement.addNode(boost::make_shared<XMLElement>("media-type", "", fileInfo->getMediaType()));
+ fileElement.addNode(std::make_shared<XMLElement>("media-type", "", fileInfo->getMediaType()));
}
if (!fileInfo->getName().empty()) {
- fileElement.addNode(boost::make_shared<XMLElement>("name", "", fileInfo->getName()));
+ fileElement.addNode(std::make_shared<XMLElement>("name", "", fileInfo->getName()));
}
if (fileInfo->getSupportsRangeRequests()) {
- boost::shared_ptr<XMLElement> range = boost::make_shared<XMLElement>("range");
+ std::shared_ptr<XMLElement> range = std::make_shared<XMLElement>("range");
if (fileInfo->getRangeOffset() != 0) {
range->setAttribute("offset", boost::lexical_cast<std::string>(fileInfo->getRangeOffset()));
}
@@ -51,11 +51,11 @@ std::string JingleFileTransferFileInfoSerializer::serializePayload(boost::shared
}
if (fileInfo->getSize() > 0) {
- fileElement.addNode(boost::make_shared<XMLElement>("size", "", boost::lexical_cast<std::string>(fileInfo->getSize())));
+ fileElement.addNode(std::make_shared<XMLElement>("size", "", boost::lexical_cast<std::string>(fileInfo->getSize())));
}
foreach (JingleFileTransferFileInfo::HashElementMap::value_type hashElement, fileInfo->getHashes()) {
- boost::shared_ptr<XMLElement> hash = boost::make_shared<XMLElement>("hash", "urn:xmpp:hashes:1", Base64::encode(hashElement.second));
+ std::shared_ptr<XMLElement> hash = std::make_shared<XMLElement>("hash", "urn:xmpp:hashes:1", Base64::encode(hashElement.second));
hash->setAttribute("algo", hashElement.first);
fileElement.addNode(hash);
}
diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.h b/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.h
index bd4d8cd..6b80235 100644
--- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.h
@@ -18,6 +18,6 @@ namespace Swift {
public:
JingleFileTransferFileInfoSerializer();
- virtual std::string serializePayload(boost::shared_ptr<JingleFileTransferFileInfo>) const;
+ virtual std::string serializePayload(std::shared_ptr<JingleFileTransferFileInfo>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.cpp
index 4db5f0c..1f6ead7 100644
--- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.cpp
@@ -13,11 +13,9 @@
#include <Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.h>
#include <map>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
-
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -29,7 +27,7 @@ namespace Swift {
JingleFileTransferHashSerializer::JingleFileTransferHashSerializer() {
}
-std::string JingleFileTransferHashSerializer::serializePayload(boost::shared_ptr<JingleFileTransferHash> payload) const {
+std::string JingleFileTransferHashSerializer::serializePayload(std::shared_ptr<JingleFileTransferHash> payload) const {
// code for version urn:xmpp:jingle:apps:file-transfer:2
//XMLElement hash("hash", "urn:xmpp:jingle:apps:file-transfer:info:2", payload->getHash());
@@ -38,7 +36,7 @@ std::string JingleFileTransferHashSerializer::serializePayload(boost::shared_ptr
JingleFileTransferFileInfoSerializer fileSerializer;
- boost::shared_ptr<XMLRawTextNode> file = boost::make_shared<XMLRawTextNode>(fileSerializer.serialize(boost::make_shared<JingleFileTransferFileInfo>(payload->getFileInfo())));
+ std::shared_ptr<XMLRawTextNode> file = std::make_shared<XMLRawTextNode>(fileSerializer.serialize(std::make_shared<JingleFileTransferFileInfo>(payload->getFileInfo())));
checksum.addNode(file);
diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.h b/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.h
index 5434c17..bb6eabc 100644
--- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.h
@@ -25,6 +25,6 @@ namespace Swift {
public:
JingleFileTransferHashSerializer();
- virtual std::string serializePayload(boost::shared_ptr<JingleFileTransferHash>) const;
+ virtual std::string serializePayload(std::shared_ptr<JingleFileTransferHash>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.cpp
index 0574ea7..52e6c16 100644
--- a/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.cpp
@@ -12,9 +12,9 @@
#include <Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -26,7 +26,7 @@ namespace Swift {
JingleIBBTransportPayloadSerializer::JingleIBBTransportPayloadSerializer() {
}
-std::string JingleIBBTransportPayloadSerializer::serializePayload(boost::shared_ptr<JingleIBBTransportPayload> payload) const {
+std::string JingleIBBTransportPayloadSerializer::serializePayload(std::shared_ptr<JingleIBBTransportPayload> payload) const {
XMLElement payloadXML("transport", "urn:xmpp:jingle:transports:ibb:1");
if (payload->getBlockSize()) {
payloadXML.setAttribute("block-size", boost::lexical_cast<std::string>(*payload->getBlockSize()));
diff --git a/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.h
index 1b77666..e94fb52 100644
--- a/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.h
@@ -25,6 +25,6 @@ namespace Swift {
public:
JingleIBBTransportPayloadSerializer();
- virtual std::string serializePayload(boost::shared_ptr<JingleIBBTransportPayload>) const;
+ virtual std::string serializePayload(std::shared_ptr<JingleIBBTransportPayload>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp
index a5bd60a..8b37929 100644
--- a/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp
@@ -12,9 +12,7 @@
#include <Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/intrusive_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/Log.h>
#include <Swiften/Base/foreach.h>
@@ -35,27 +33,27 @@ namespace Swift {
JinglePayloadSerializer::JinglePayloadSerializer(PayloadSerializerCollection* serializers) : serializers(serializers) {
}
-std::string JinglePayloadSerializer::serializePayload(boost::shared_ptr<JinglePayload> payload) const {
+std::string JinglePayloadSerializer::serializePayload(std::shared_ptr<JinglePayload> payload) const {
XMLElement jinglePayload("jingle", "urn:xmpp:jingle:1");
jinglePayload.setAttribute("action", actionToString(payload->getAction()));
jinglePayload.setAttribute("initiator", payload->getInitiator());
jinglePayload.setAttribute("sid", payload->getSessionID());
- std::vector<boost::shared_ptr<Payload> > payloads = payload->getPayloads();
+ std::vector<std::shared_ptr<Payload> > payloads = payload->getPayloads();
if (!payloads.empty()) {
- foreach(boost::shared_ptr<Payload> subPayload, payloads) {
+ foreach(std::shared_ptr<Payload> subPayload, payloads) {
PayloadSerializer* serializer = serializers->getPayloadSerializer(subPayload);
if (serializer) {
- jinglePayload.addNode(boost::make_shared<XMLRawTextNode>(serializer->serialize(subPayload)));
+ jinglePayload.addNode(std::make_shared<XMLRawTextNode>(serializer->serialize(subPayload)));
}
}
}
if (payload->getReason().is_initialized()) {
- boost::shared_ptr<XMLElement> reason = boost::make_shared<XMLElement>("reason");
- reason->addNode(boost::make_shared<XMLElement>(reasonTypeToString(payload->getReason()->type)));
+ std::shared_ptr<XMLElement> reason = std::make_shared<XMLElement>("reason");
+ reason->addNode(std::make_shared<XMLElement>(reasonTypeToString(payload->getReason()->type)));
if (!payload->getReason()->text.empty()) {
- reason->addNode(boost::make_shared<XMLElement>("desc", "", payload->getReason()->text));
+ reason->addNode(std::make_shared<XMLElement>("desc", "", payload->getReason()->text));
}
jinglePayload.addNode(reason);
}
diff --git a/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.h
index 9b36626..a846ebe 100644
--- a/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.h
@@ -25,7 +25,7 @@ namespace Swift {
public:
JinglePayloadSerializer(PayloadSerializerCollection*);
- virtual std::string serializePayload(boost::shared_ptr<JinglePayload>) const;
+ virtual std::string serializePayload(std::shared_ptr<JinglePayload>) const;
private:
std::string actionToString(JinglePayload::Action action) const;
diff --git a/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp
index 66e6515..61447cd 100644
--- a/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp
@@ -12,9 +12,9 @@
#include <Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/Log.h>
#include <Swiften/Base/foreach.h>
@@ -27,7 +27,7 @@ namespace Swift {
JingleS5BTransportPayloadSerializer::JingleS5BTransportPayloadSerializer() {
}
-std::string JingleS5BTransportPayloadSerializer::serializePayload(boost::shared_ptr<JingleS5BTransportPayload> payload) const {
+std::string JingleS5BTransportPayloadSerializer::serializePayload(std::shared_ptr<JingleS5BTransportPayload> payload) const {
XMLElement payloadXML("transport", "urn:xmpp:jingle:transports:s5b:1");
payloadXML.setAttribute("sid", payload->getSessionID());
payloadXML.setAttribute("mode", modeToString(payload->getMode()));
@@ -36,7 +36,7 @@ std::string JingleS5BTransportPayloadSerializer::serializePayload(boost::shared_
}
foreach(JingleS5BTransportPayload::Candidate candidate, payload->getCandidates()) {
- boost::shared_ptr<XMLElement> candidateXML = boost::make_shared<XMLElement>("candidate");
+ std::shared_ptr<XMLElement> candidateXML = std::make_shared<XMLElement>("candidate");
candidateXML->setAttribute("cid", candidate.cid);
candidateXML->setAttribute("host", candidate.hostPort.getAddress().toString());
candidateXML->setAttribute("jid", candidate.jid.toString());
@@ -47,19 +47,19 @@ std::string JingleS5BTransportPayloadSerializer::serializePayload(boost::shared_
}
if (payload->hasCandidateError()) {
- payloadXML.addNode(boost::make_shared<XMLElement>("candidate-error"));
+ payloadXML.addNode(std::make_shared<XMLElement>("candidate-error"));
}
if (payload->hasProxyError()) {
- payloadXML.addNode(boost::make_shared<XMLElement>("proxy-error"));
+ payloadXML.addNode(std::make_shared<XMLElement>("proxy-error"));
}
if (!payload->getActivated().empty()) {
- boost::shared_ptr<XMLElement> activatedXML = boost::make_shared<XMLElement>("activated");
+ std::shared_ptr<XMLElement> activatedXML = std::make_shared<XMLElement>("activated");
activatedXML->setAttribute("cid", payload->getActivated());
payloadXML.addNode(activatedXML);
}
if (!payload->getCandidateUsed().empty()) {
- boost::shared_ptr<XMLElement> candusedXML = boost::make_shared<XMLElement>("candidate-used");
+ std::shared_ptr<XMLElement> candusedXML = std::make_shared<XMLElement>("candidate-used");
candusedXML->setAttribute("cid", payload->getCandidateUsed());
payloadXML.addNode(candusedXML);
}
diff --git a/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.h
index 684423e..cca2f4e 100644
--- a/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.h
@@ -25,7 +25,7 @@ namespace Swift {
public:
JingleS5BTransportPayloadSerializer();
- virtual std::string serializePayload(boost::shared_ptr<JingleS5BTransportPayload>) const;
+ virtual std::string serializePayload(std::shared_ptr<JingleS5BTransportPayload>) const;
private:
std::string modeToString(JingleS5BTransportPayload::Mode) const;
diff --git a/Swiften/Serializer/PayloadSerializers/LastSerializer.h b/Swiften/Serializer/PayloadSerializers/LastSerializer.h
index 6c831eb..1710bc0 100644
--- a/Swiften/Serializer/PayloadSerializers/LastSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/LastSerializer.h
@@ -17,7 +17,7 @@ namespace Swift {
public:
LastSerializer() : GenericPayloadSerializer<Last>() {}
- virtual std::string serializePayload(boost::shared_ptr<Last> last) const {
+ virtual std::string serializePayload(std::shared_ptr<Last> last) const {
return "<query xmlns='jabber:iq:last' seconds='" + boost::lexical_cast<std::string>(last->getSeconds()) + "'/>";
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp
index d15038c..6f40277 100644
--- a/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp
@@ -6,8 +6,9 @@
#include <Swiften/Serializer/PayloadSerializers/MAMFinSerializer.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/ResultSetSerializer.h>
@@ -22,7 +23,7 @@ MAMFinSerializer::MAMFinSerializer() {
MAMFinSerializer::~MAMFinSerializer() {
}
-std::string MAMFinSerializer::serializePayload(boost::shared_ptr<MAMFin> payload) const {
+std::string MAMFinSerializer::serializePayload(std::shared_ptr<MAMFin> payload) const {
if (!payload) {
return "";
}
@@ -42,7 +43,7 @@ std::string MAMFinSerializer::serializePayload(boost::shared_ptr<MAMFin> payload
}
if (payload->getResultSet()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(ResultSetSerializer().serialize(payload->getResultSet())));
+ element.addNode(std::make_shared<XMLRawTextNode>(ResultSetSerializer().serialize(payload->getResultSet())));
}
return element.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.h b/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.h
index 2be6981..7e2a7c7 100644
--- a/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,6 +21,6 @@ namespace Swift {
MAMFinSerializer();
virtual ~MAMFinSerializer();
- virtual std::string serializePayload(boost::shared_ptr<MAMFin>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<MAMFin>) const SWIFTEN_OVERRIDE;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp b/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp
index d503d0b..0b61c04 100644
--- a/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp
@@ -6,8 +6,9 @@
#include <Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/FormSerializer.h>
@@ -24,7 +25,7 @@ MAMQuerySerializer::MAMQuerySerializer() {
MAMQuerySerializer::~MAMQuerySerializer() {
}
-std::string MAMQuerySerializer::serializePayload(boost::shared_ptr<MAMQuery> payload) const {
+std::string MAMQuerySerializer::serializePayload(std::shared_ptr<MAMQuery> payload) const {
if (!payload) {
return "";
}
@@ -40,11 +41,11 @@ std::string MAMQuerySerializer::serializePayload(boost::shared_ptr<MAMQuery> pay
}
if (payload->getForm()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getForm())));
+ element.addNode(std::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getForm())));
}
if (payload->getResultSet()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(ResultSetSerializer().serialize(payload->getResultSet())));
+ element.addNode(std::make_shared<XMLRawTextNode>(ResultSetSerializer().serialize(payload->getResultSet())));
}
return element.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.h b/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.h
index 8b5e270..6af979b 100644
--- a/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,6 +21,6 @@ namespace Swift {
MAMQuerySerializer();
virtual ~MAMQuerySerializer();
- virtual std::string serializePayload(boost::shared_ptr<MAMQuery>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<MAMQuery>) const SWIFTEN_OVERRIDE;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.cpp
index 4bf25c6..7ef2102 100644
--- a/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.cpp
@@ -6,8 +6,9 @@
#include <Swiften/Serializer/PayloadSerializers/MAMResultSerializer.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/ForwardedSerializer.h>
@@ -22,7 +23,7 @@ MAMResultSerializer::MAMResultSerializer(PayloadSerializerCollection* serializer
MAMResultSerializer::~MAMResultSerializer() {
}
-std::string MAMResultSerializer::serializePayload(boost::shared_ptr<MAMResult> payload) const {
+std::string MAMResultSerializer::serializePayload(std::shared_ptr<MAMResult> payload) const {
if (!payload) {
return "";
}
@@ -35,7 +36,7 @@ std::string MAMResultSerializer::serializePayload(boost::shared_ptr<MAMResult> p
element.setAttribute("queryid", *payload->getQueryID());
}
- element.addNode(boost::make_shared<XMLRawTextNode>(ForwardedSerializer(serializers_).serialize(payload->getPayload())));
+ element.addNode(std::make_shared<XMLRawTextNode>(ForwardedSerializer(serializers_).serialize(payload->getPayload())));
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.h b/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.h
index 4d8168c..f4fc054 100644
--- a/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/MAMResultSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
MAMResultSerializer(PayloadSerializerCollection* serializers);
virtual ~MAMResultSerializer();
- virtual std::string serializePayload(boost::shared_ptr<MAMResult>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<MAMResult>) const SWIFTEN_OVERRIDE;
private:
PayloadSerializerCollection* serializers_;
diff --git a/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.cpp
index 5bd4b01..385c181 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.cpp
@@ -6,11 +6,9 @@
#include <Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.h>
+#include <memory>
#include <sstream>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
-
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/PayloadSerializers/MUCItemSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -21,7 +19,7 @@ namespace Swift {
MUCAdminPayloadSerializer::MUCAdminPayloadSerializer() : GenericPayloadSerializer<MUCAdminPayload>() {
}
-std::string MUCAdminPayloadSerializer::serializePayload(boost::shared_ptr<MUCAdminPayload> payload) const {
+std::string MUCAdminPayloadSerializer::serializePayload(std::shared_ptr<MUCAdminPayload> payload) const {
XMLElement mucElement("query", "http://jabber.org/protocol/muc#admin");
foreach (const MUCItem& item, payload->getItems()) {
mucElement.addNode(MUCItemSerializer::itemToElement(item));
diff --git a/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.h
index b1e1ed1..c077d2e 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.h
@@ -17,7 +17,7 @@ namespace Swift {
std::string affiliationToString(MUCOccupant::Affiliation affiliation) const;
std::string roleToString(MUCOccupant::Role role) const;
- virtual std::string serializePayload(boost::shared_ptr<MUCAdminPayload> version) const;
+ virtual std::string serializePayload(std::shared_ptr<MUCAdminPayload> version) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.cpp
index 86d684e..3d807be 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.cpp
@@ -1,13 +1,12 @@
/*
- * Copyright (c) 2011 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -18,11 +17,11 @@ namespace Swift {
MUCDestroyPayloadSerializer::MUCDestroyPayloadSerializer() : GenericPayloadSerializer<MUCDestroyPayload>() {
}
-std::string MUCDestroyPayloadSerializer::serializePayload(boost::shared_ptr<MUCDestroyPayload> payload) const {
+std::string MUCDestroyPayloadSerializer::serializePayload(std::shared_ptr<MUCDestroyPayload> payload) const {
XMLElement mucElement("destroy", "");
if (!payload->getReason().empty()) {
- XMLElement::ref reason = boost::make_shared<XMLElement>("reason", "");
- reason->addNode(boost::make_shared<XMLTextNode>(payload->getReason()));
+ XMLElement::ref reason = std::make_shared<XMLElement>("reason", "");
+ reason->addNode(std::make_shared<XMLTextNode>(payload->getReason()));
mucElement.addNode(reason);
}
if (payload->getNewVenue().isValid()) {
diff --git a/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.h
index c6175fb..2ce8ccc 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/MUCDestroyPayloadSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
class SWIFTEN_API MUCDestroyPayloadSerializer : public GenericPayloadSerializer<MUCDestroyPayload> {
public:
MUCDestroyPayloadSerializer();
- virtual std::string serializePayload(boost::shared_ptr<MUCDestroyPayload> version) const;
+ virtual std::string serializePayload(std::shared_ptr<MUCDestroyPayload> version) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.cpp
index 4695f63..4b978af 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.cpp
@@ -6,8 +6,7 @@
#include <Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/PayloadSerializers/MUCItemSerializer.h>
@@ -19,7 +18,7 @@ namespace Swift {
MUCInvitationPayloadSerializer::MUCInvitationPayloadSerializer() : GenericPayloadSerializer<MUCInvitationPayload>() {
}
-std::string MUCInvitationPayloadSerializer::serializePayload(boost::shared_ptr<MUCInvitationPayload> payload) const {
+std::string MUCInvitationPayloadSerializer::serializePayload(std::shared_ptr<MUCInvitationPayload> payload) const {
XMLElement mucElement("x", "jabber:x:conference");
if (payload->getIsContinuation()) {
mucElement.setAttribute("continue", "true");
@@ -37,7 +36,7 @@ std::string MUCInvitationPayloadSerializer::serializePayload(boost::shared_ptr<M
mucElement.setAttribute("thread", payload->getThread());
}
if (payload->getIsImpromptu()) {
- mucElement.addNode(boost::make_shared<XMLElement>("impromptu", "http://swift.im/impromptu"));
+ mucElement.addNode(std::make_shared<XMLElement>("impromptu", "http://swift.im/impromptu"));
}
return mucElement.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.h
index a2d27b0..be21177 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/MUCInvitationPayloadSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
MUCInvitationPayloadSerializer();
- virtual std::string serializePayload(boost::shared_ptr<MUCInvitationPayload> version) const;
+ virtual std::string serializePayload(std::shared_ptr<MUCInvitationPayload> version) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/MUCItemSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCItemSerializer.h
index 016caf4..22f7859 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCItemSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/MUCItemSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Elements/MUCItem.h>
#include <Swiften/Serializer/GenericPayloadSerializer.h>
@@ -40,8 +40,8 @@ namespace Swift {
}
- static boost::shared_ptr<XMLElement> itemToElement(const MUCItem& item) {
- boost::shared_ptr<XMLElement> itemElement(new XMLElement("item"));
+ static std::shared_ptr<XMLElement> itemToElement(const MUCItem& item) {
+ std::shared_ptr<XMLElement> itemElement(new XMLElement("item"));
if (item.affiliation) {
itemElement->setAttribute("affiliation", affiliationToString(item.affiliation.get()));
}
@@ -55,13 +55,13 @@ namespace Swift {
itemElement->setAttribute("nick", item.nick.get());
}
if (item.actor) {
- boost::shared_ptr<XMLElement> actorElement(new XMLElement("actor"));
+ std::shared_ptr<XMLElement> actorElement(new XMLElement("actor"));
actorElement->setAttribute("jid", item.actor->toString());
itemElement->addNode(actorElement);
}
if (item.reason) {
- boost::shared_ptr<XMLElement> reasonElement(new XMLElement("reason"));
- reasonElement->addNode(boost::make_shared<XMLTextNode>(*item.reason));
+ std::shared_ptr<XMLElement> reasonElement(new XMLElement("reason"));
+ reasonElement->addNode(std::make_shared<XMLTextNode>(*item.reason));
itemElement->addNode(reasonElement);
}
return itemElement;
diff --git a/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.cpp
index 348f9f5..f385e91 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.cpp
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -17,13 +17,13 @@ namespace Swift {
MUCOwnerPayloadSerializer::MUCOwnerPayloadSerializer(PayloadSerializerCollection* serializers) : GenericPayloadSerializer<MUCOwnerPayload>(), serializers(serializers) {
}
-std::string MUCOwnerPayloadSerializer::serializePayload(boost::shared_ptr<MUCOwnerPayload> mucOwner) const {
+std::string MUCOwnerPayloadSerializer::serializePayload(std::shared_ptr<MUCOwnerPayload> mucOwner) const {
XMLElement mucElement("query", "http://jabber.org/protocol/muc#owner");
- boost::shared_ptr<Payload> payload = mucOwner->getPayload();
+ std::shared_ptr<Payload> payload = mucOwner->getPayload();
if (payload) {
PayloadSerializer* serializer = serializers->getPayloadSerializer(payload);
if (serializer) {
- mucElement.addNode(boost::make_shared<XMLRawTextNode>(serializer->serialize(payload)));
+ mucElement.addNode(std::make_shared<XMLRawTextNode>(serializer->serialize(payload)));
}
}
return mucElement.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h
index bbe919a..8e2e856 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/MUCOwnerPayloadSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
class SWIFTEN_API MUCOwnerPayloadSerializer : public GenericPayloadSerializer<MUCOwnerPayload> {
public:
MUCOwnerPayloadSerializer(PayloadSerializerCollection* serializers);
- virtual std::string serializePayload(boost::shared_ptr<MUCOwnerPayload> version) const;
+ virtual std::string serializePayload(std::shared_ptr<MUCOwnerPayload> version) const;
private:
PayloadSerializerCollection* serializers;
};
diff --git a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp
index 9af2f15..4f0f637 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp
@@ -6,9 +6,10 @@
#include <Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h>
+#include <memory>
+
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/lexical_cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/String.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -19,9 +20,9 @@ namespace Swift {
MUCPayloadSerializer::MUCPayloadSerializer() : GenericPayloadSerializer<MUCPayload>() {
}
-std::string MUCPayloadSerializer::serializePayload(boost::shared_ptr<MUCPayload> muc) const {
+std::string MUCPayloadSerializer::serializePayload(std::shared_ptr<MUCPayload> muc) const {
XMLElement mucElement("x", "http://jabber.org/protocol/muc");
- boost::shared_ptr<XMLElement> historyElement(new XMLElement("history"));
+ std::shared_ptr<XMLElement> historyElement(new XMLElement("history"));
bool history = false;
if (muc->getMaxChars() >= 0) {
historyElement->setAttribute("maxchars", boost::lexical_cast<std::string>(muc->getMaxChars()));
@@ -44,8 +45,8 @@ std::string MUCPayloadSerializer::serializePayload(boost::shared_ptr<MUCPayload>
}
if (muc->getPassword()) {
std::string password = *muc->getPassword();
- boost::shared_ptr<XMLElement> passwordElement(new XMLElement("password"));
- passwordElement->addNode(boost::make_shared<XMLTextNode>(password));
+ std::shared_ptr<XMLElement> passwordElement(new XMLElement("password"));
+ passwordElement->addNode(std::make_shared<XMLTextNode>(password));
mucElement.addNode(passwordElement);
}
if (history) {
diff --git a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h
index fa3a11c..6b0247d 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.h
@@ -14,7 +14,7 @@ namespace Swift {
class SWIFTEN_API MUCPayloadSerializer : public GenericPayloadSerializer<MUCPayload> {
public:
MUCPayloadSerializer();
- virtual std::string serializePayload(boost::shared_ptr<MUCPayload> version) const;
+ virtual std::string serializePayload(std::shared_ptr<MUCPayload> version) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp
index d0c3b2b..52ab489 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp
@@ -6,11 +6,9 @@
#include <Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h>
+#include <memory>
#include <sstream>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
-
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/MUCItemSerializer.h>
@@ -23,10 +21,10 @@ namespace Swift {
MUCUserPayloadSerializer::MUCUserPayloadSerializer(PayloadSerializerCollection* serializers) : GenericPayloadSerializer<MUCUserPayload>(), serializers(serializers) {
}
-std::string MUCUserPayloadSerializer::serializePayload(boost::shared_ptr<MUCUserPayload> payload) const {
+std::string MUCUserPayloadSerializer::serializePayload(std::shared_ptr<MUCUserPayload> payload) const {
XMLElement mucElement("x", "http://jabber.org/protocol/muc#user");
foreach (const MUCUserPayload::StatusCode statusCode, payload->getStatusCodes()) {
- boost::shared_ptr<XMLElement> statusElement(new XMLElement("status"));
+ std::shared_ptr<XMLElement> statusElement(new XMLElement("status"));
std::ostringstream code;
code << statusCode.code;
statusElement->setAttribute("code", code.str());
@@ -37,13 +35,13 @@ std::string MUCUserPayloadSerializer::serializePayload(boost::shared_ptr<MUCUser
}
if (payload->getPassword()) {
- boost::shared_ptr<XMLElement> passwordElement = boost::make_shared<XMLElement>("password");
- passwordElement->addNode(boost::make_shared<XMLTextNode>(*payload->getPassword()));
+ std::shared_ptr<XMLElement> passwordElement = std::make_shared<XMLElement>("password");
+ passwordElement->addNode(std::make_shared<XMLTextNode>(*payload->getPassword()));
}
if (payload->getInvite()) {
MUCUserPayload::Invite invite = *payload->getInvite();
- boost::shared_ptr<XMLElement> inviteElement = boost::make_shared<XMLElement>("invite");
+ std::shared_ptr<XMLElement> inviteElement = std::make_shared<XMLElement>("invite");
if (invite.to.isValid()) {
inviteElement->setAttribute("to", invite.to.toString());
}
@@ -51,17 +49,17 @@ std::string MUCUserPayloadSerializer::serializePayload(boost::shared_ptr<MUCUser
inviteElement->setAttribute("from", invite.from.toString());
}
if (!invite.reason.empty()) {
- boost::shared_ptr<XMLElement> reasonElement = boost::make_shared<XMLElement>("reason");
- reasonElement->addNode(boost::make_shared<XMLTextNode>(invite.reason));
+ std::shared_ptr<XMLElement> reasonElement = std::make_shared<XMLElement>("reason");
+ reasonElement->addNode(std::make_shared<XMLTextNode>(invite.reason));
}
mucElement.addNode(inviteElement);
}
- boost::shared_ptr<Payload> childPayload = payload->getPayload();
+ std::shared_ptr<Payload> childPayload = payload->getPayload();
if (childPayload) {
PayloadSerializer* serializer = serializers->getPayloadSerializer(childPayload);
if (serializer) {
- mucElement.addNode(boost::make_shared<XMLRawTextNode>(serializer->serialize(childPayload)));
+ mucElement.addNode(std::make_shared<XMLRawTextNode>(serializer->serialize(childPayload)));
}
}
return mucElement.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h
index 91b2ae6..ea4b74b 100644
--- a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.h
@@ -16,7 +16,7 @@ namespace Swift {
public:
MUCUserPayloadSerializer(PayloadSerializerCollection* serializers);
- virtual std::string serializePayload(boost::shared_ptr<MUCUserPayload> version) const;
+ virtual std::string serializePayload(std::shared_ptr<MUCUserPayload> version) const;
private:
PayloadSerializerCollection* serializers;
};
diff --git a/Swiften/Serializer/PayloadSerializers/NicknameSerializer.cpp b/Swiften/Serializer/PayloadSerializers/NicknameSerializer.cpp
index 3b927f4..7bd8931 100644
--- a/Swiften/Serializer/PayloadSerializers/NicknameSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/NicknameSerializer.cpp
@@ -1,13 +1,12 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Serializer/PayloadSerializers/NicknameSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/XML/XMLElement.h>
#include <Swiften/Serializer/XML/XMLTextNode.h>
@@ -17,9 +16,9 @@ namespace Swift {
NicknameSerializer::NicknameSerializer() : GenericPayloadSerializer<Nickname>() {
}
-std::string NicknameSerializer::serializePayload(boost::shared_ptr<Nickname> nick) const {
+std::string NicknameSerializer::serializePayload(std::shared_ptr<Nickname> nick) const {
XMLElement nickElement("nick", "http://jabber.org/protocol/nick");
- nickElement.addNode(boost::make_shared<XMLTextNode>(nick->getNickname()));
+ nickElement.addNode(std::make_shared<XMLTextNode>(nick->getNickname()));
return nickElement.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/NicknameSerializer.h b/Swiften/Serializer/PayloadSerializers/NicknameSerializer.h
index d1b6e81..efea9c2 100644
--- a/Swiften/Serializer/PayloadSerializers/NicknameSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/NicknameSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
NicknameSerializer();
- virtual std::string serializePayload(boost::shared_ptr<Nickname>) const;
+ virtual std::string serializePayload(std::shared_ptr<Nickname>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h b/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h
index d7f0957..687d07f 100644
--- a/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h
@@ -17,7 +17,7 @@ namespace Swift {
public:
PrioritySerializer() : GenericPayloadSerializer<Priority>() {}
- virtual std::string serializePayload(boost::shared_ptr<Priority> priority) const {
+ virtual std::string serializePayload(std::shared_ptr<Priority> priority) const {
return "<priority>" + boost::lexical_cast<std::string>(priority->getPriority()) + "</priority>";
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.cpp
index 2d03e1b..87a2eeb 100644
--- a/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.cpp
@@ -6,8 +6,7 @@
#include <Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
@@ -20,13 +19,13 @@ namespace Swift {
PrivateStorageSerializer::PrivateStorageSerializer(PayloadSerializerCollection* serializers) : serializers(serializers) {
}
-std::string PrivateStorageSerializer::serializePayload(boost::shared_ptr<PrivateStorage> storage) const {
+std::string PrivateStorageSerializer::serializePayload(std::shared_ptr<PrivateStorage> storage) const {
XMLElement storageElement("query", "jabber:iq:private");
- boost::shared_ptr<Payload> payload = storage->getPayload();
+ std::shared_ptr<Payload> payload = storage->getPayload();
if (payload) {
PayloadSerializer* serializer = serializers->getPayloadSerializer(payload);
if (serializer) {
- storageElement.addNode(boost::make_shared<XMLRawTextNode>(serializer->serialize(payload)));
+ storageElement.addNode(std::make_shared<XMLRawTextNode>(serializer->serialize(payload)));
}
}
return storageElement.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h b/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h
index a014e52..f2f9d90 100644
--- a/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PrivateStorageSerializer.h
@@ -17,7 +17,7 @@ namespace Swift {
public:
PrivateStorageSerializer(PayloadSerializerCollection* serializers);
- virtual std::string serializePayload(boost::shared_ptr<PrivateStorage>) const;
+ virtual std::string serializePayload(std::shared_ptr<PrivateStorage>) const;
private:
PayloadSerializerCollection* serializers;
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.cpp
index 8e58ff5..4814c59 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubAffiliationSerializer::PubSubAffiliationSerializer(PayloadSerializerCollec
PubSubAffiliationSerializer::~PubSubAffiliationSerializer() {
}
-std::string PubSubAffiliationSerializer::serializePayload(boost::shared_ptr<PubSubAffiliation> payload) const {
+std::string PubSubAffiliationSerializer::serializePayload(std::shared_ptr<PubSubAffiliation> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.h
index d451745..622db09 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubAffiliationSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubAffiliationSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubAffiliation>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubAffiliation>) const SWIFTEN_OVERRIDE;
private:
static std::string serializeType(PubSubAffiliation::Type);
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.cpp
index eba96aa..9673710 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Base/foreach.h>
@@ -23,7 +23,7 @@ PubSubAffiliationsSerializer::PubSubAffiliationsSerializer(PayloadSerializerColl
PubSubAffiliationsSerializer::~PubSubAffiliationsSerializer() {
}
-std::string PubSubAffiliationsSerializer::serializePayload(boost::shared_ptr<PubSubAffiliations> payload) const {
+std::string PubSubAffiliationsSerializer::serializePayload(std::shared_ptr<PubSubAffiliations> payload) const {
if (!payload) {
return "";
}
@@ -31,8 +31,8 @@ std::string PubSubAffiliationsSerializer::serializePayload(boost::shared_ptr<Pub
if (payload->getNode()) {
element.setAttribute("node", *payload->getNode());
}
- foreach(boost::shared_ptr<PubSubAffiliation> item, payload->getAffiliations()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(PubSubAffiliationSerializer(serializers).serialize(item)));
+ foreach(std::shared_ptr<PubSubAffiliation> item, payload->getAffiliations()) {
+ element.addNode(std::make_shared<XMLRawTextNode>(PubSubAffiliationSerializer(serializers).serialize(item)));
}
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.h
index 211d957..c51d70e 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubAffiliationsSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubAffiliationsSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubAffiliationsSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubAffiliations>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubAffiliations>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.cpp
index 1853c1c..6ae4711 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/FormSerializer.h>
@@ -22,12 +22,12 @@ PubSubConfigureSerializer::PubSubConfigureSerializer(PayloadSerializerCollection
PubSubConfigureSerializer::~PubSubConfigureSerializer() {
}
-std::string PubSubConfigureSerializer::serializePayload(boost::shared_ptr<PubSubConfigure> payload) const {
+std::string PubSubConfigureSerializer::serializePayload(std::shared_ptr<PubSubConfigure> payload) const {
if (!payload) {
return "";
}
XMLElement element("configure", "http://jabber.org/protocol/pubsub");
- element.addNode(boost::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getData())));
+ element.addNode(std::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getData())));
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.h
index 3d800d8..fa0aecf 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubConfigureSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubConfigureSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubConfigure>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubConfigure>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.cpp
index 8b38fc1..e5c0e67 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubCreateSerializer::PubSubCreateSerializer(PayloadSerializerCollection* seri
PubSubCreateSerializer::~PubSubCreateSerializer() {
}
-std::string PubSubCreateSerializer::serializePayload(boost::shared_ptr<PubSubCreate> payload) const {
+std::string PubSubCreateSerializer::serializePayload(std::shared_ptr<PubSubCreate> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.h
index 67b19bf..92965f2 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubCreateSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubCreateSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubCreateSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubCreate>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubCreate>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.cpp
index aba1cae..3681dd0 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubDefaultSerializer::PubSubDefaultSerializer(PayloadSerializerCollection* se
PubSubDefaultSerializer::~PubSubDefaultSerializer() {
}
-std::string PubSubDefaultSerializer::serializePayload(boost::shared_ptr<PubSubDefault> payload) const {
+std::string PubSubDefaultSerializer::serializePayload(std::shared_ptr<PubSubDefault> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.h
index 5dc774f..1ec20c7 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubDefaultSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubDefaultSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubDefaultSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubDefault>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubDefault>) const SWIFTEN_OVERRIDE;
private:
static std::string serializeType(PubSubDefault::Type);
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.cpp
index d14db49..5f85fd5 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.cpp
@@ -17,7 +17,7 @@ PubSubErrorSerializer::PubSubErrorSerializer() {
PubSubErrorSerializer::~PubSubErrorSerializer() {
}
-std::string PubSubErrorSerializer::serializePayload(boost::shared_ptr<PubSubError> payload) const {
+std::string PubSubErrorSerializer::serializePayload(std::shared_ptr<PubSubError> payload) const {
if (payload->getType() == PubSubError::UnknownType) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.h
index b6750e9..6b0882e 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubErrorSerializer.h
@@ -19,7 +19,7 @@ namespace Swift {
PubSubErrorSerializer();
virtual ~PubSubErrorSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubError>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubError>) const SWIFTEN_OVERRIDE;
private:
static std::string serializeType(PubSubError::Type);
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.cpp
index c855977..25d57fe 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubEventAssociateSerializer::PubSubEventAssociateSerializer(PayloadSerializer
PubSubEventAssociateSerializer::~PubSubEventAssociateSerializer() {
}
-std::string PubSubEventAssociateSerializer::serializePayload(boost::shared_ptr<PubSubEventAssociate> payload) const {
+std::string PubSubEventAssociateSerializer::serializePayload(std::shared_ptr<PubSubEventAssociate> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.h
index 03025fb..5056c63 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubEventAssociateSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubEventAssociateSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubEventAssociate>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubEventAssociate>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.cpp
index df255d2..da9feb8 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/PubSubEventAssociateSerializer.h>
@@ -23,7 +23,7 @@ PubSubEventCollectionSerializer::PubSubEventCollectionSerializer(PayloadSerializ
PubSubEventCollectionSerializer::~PubSubEventCollectionSerializer() {
}
-std::string PubSubEventCollectionSerializer::serializePayload(boost::shared_ptr<PubSubEventCollection> payload) const {
+std::string PubSubEventCollectionSerializer::serializePayload(std::shared_ptr<PubSubEventCollection> payload) const {
if (!payload) {
return "";
}
@@ -31,8 +31,8 @@ std::string PubSubEventCollectionSerializer::serializePayload(boost::shared_ptr<
if (payload->getNode()) {
element.setAttribute("node", *payload->getNode());
}
- element.addNode(boost::make_shared<XMLRawTextNode>(PubSubEventDisassociateSerializer(serializers).serialize(payload->getDisassociate())));
- element.addNode(boost::make_shared<XMLRawTextNode>(PubSubEventAssociateSerializer(serializers).serialize(payload->getAssociate())));
+ element.addNode(std::make_shared<XMLRawTextNode>(PubSubEventDisassociateSerializer(serializers).serialize(payload->getDisassociate())));
+ element.addNode(std::make_shared<XMLRawTextNode>(PubSubEventAssociateSerializer(serializers).serialize(payload->getAssociate())));
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.h
index 6e6817d..33144e9 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventCollectionSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubEventCollectionSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubEventCollectionSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubEventCollection>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubEventCollection>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.cpp
index 3e2d18b..a758ce6 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/FormSerializer.h>
@@ -22,13 +22,13 @@ PubSubEventConfigurationSerializer::PubSubEventConfigurationSerializer(PayloadSe
PubSubEventConfigurationSerializer::~PubSubEventConfigurationSerializer() {
}
-std::string PubSubEventConfigurationSerializer::serializePayload(boost::shared_ptr<PubSubEventConfiguration> payload) const {
+std::string PubSubEventConfigurationSerializer::serializePayload(std::shared_ptr<PubSubEventConfiguration> payload) const {
if (!payload) {
return "";
}
XMLElement element("configuration", "http://jabber.org/protocol/pubsub#event");
element.setAttribute("node", payload->getNode());
- element.addNode(boost::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getData())));
+ element.addNode(std::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getData())));
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.h
index 6309e04..9823292 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubEventConfigurationSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubEventConfigurationSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubEventConfiguration>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubEventConfiguration>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.cpp
index 4dcd734..cd8fc53 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.h>
@@ -22,13 +22,13 @@ PubSubEventDeleteSerializer::PubSubEventDeleteSerializer(PayloadSerializerCollec
PubSubEventDeleteSerializer::~PubSubEventDeleteSerializer() {
}
-std::string PubSubEventDeleteSerializer::serializePayload(boost::shared_ptr<PubSubEventDelete> payload) const {
+std::string PubSubEventDeleteSerializer::serializePayload(std::shared_ptr<PubSubEventDelete> payload) const {
if (!payload) {
return "";
}
XMLElement element("delete", "http://jabber.org/protocol/pubsub#event");
element.setAttribute("node", payload->getNode());
- element.addNode(boost::make_shared<XMLRawTextNode>(PubSubEventRedirectSerializer(serializers).serialize(payload->getRedirects())));
+ element.addNode(std::make_shared<XMLRawTextNode>(PubSubEventRedirectSerializer(serializers).serialize(payload->getRedirects())));
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.h
index 6d937aa..e02d44c 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventDeleteSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubEventDeleteSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubEventDeleteSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubEventDelete>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubEventDelete>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.cpp
index 0818dee..8ef62bd 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubEventDisassociateSerializer::PubSubEventDisassociateSerializer(PayloadSeri
PubSubEventDisassociateSerializer::~PubSubEventDisassociateSerializer() {
}
-std::string PubSubEventDisassociateSerializer::serializePayload(boost::shared_ptr<PubSubEventDisassociate> payload) const {
+std::string PubSubEventDisassociateSerializer::serializePayload(std::shared_ptr<PubSubEventDisassociate> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.h
index 9313ab2..77ca55d 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventDisassociateSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubEventDisassociateSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubEventDisassociateSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubEventDisassociate>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubEventDisassociate>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.cpp
index 4bc8815..3d1a9cb 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Base/foreach.h>
@@ -22,7 +22,7 @@ PubSubEventItemSerializer::PubSubEventItemSerializer(PayloadSerializerCollection
PubSubEventItemSerializer::~PubSubEventItemSerializer() {
}
-std::string PubSubEventItemSerializer::serializePayload(boost::shared_ptr<PubSubEventItem> payload) const {
+std::string PubSubEventItemSerializer::serializePayload(std::shared_ptr<PubSubEventItem> payload) const {
if (!payload) {
return "";
}
@@ -33,8 +33,8 @@ std::string PubSubEventItemSerializer::serializePayload(boost::shared_ptr<PubSub
if (payload->getPublisher()) {
element.setAttribute("publisher", *payload->getPublisher());
}
- foreach(boost::shared_ptr<Payload> item, payload->getData()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(serializers->getPayloadSerializer(item)->serialize(item)));
+ foreach(std::shared_ptr<Payload> item, payload->getData()) {
+ element.addNode(std::make_shared<XMLRawTextNode>(serializers->getPayloadSerializer(item)->serialize(item)));
}
if (payload->getID()) {
element.setAttribute("id", *payload->getID());
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.h
index 6666c6b..f292a53 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventItemSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubEventItemSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubEventItemSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubEventItem>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubEventItem>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.cpp
index 7128314..2e0799b 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Base/foreach.h>
@@ -24,17 +24,17 @@ PubSubEventItemsSerializer::PubSubEventItemsSerializer(PayloadSerializerCollecti
PubSubEventItemsSerializer::~PubSubEventItemsSerializer() {
}
-std::string PubSubEventItemsSerializer::serializePayload(boost::shared_ptr<PubSubEventItems> payload) const {
+std::string PubSubEventItemsSerializer::serializePayload(std::shared_ptr<PubSubEventItems> payload) const {
if (!payload) {
return "";
}
XMLElement element("items", "http://jabber.org/protocol/pubsub#event");
element.setAttribute("node", payload->getNode());
- foreach(boost::shared_ptr<PubSubEventItem> item, payload->getItems()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(PubSubEventItemSerializer(serializers).serialize(item)));
+ foreach(std::shared_ptr<PubSubEventItem> item, payload->getItems()) {
+ element.addNode(std::make_shared<XMLRawTextNode>(PubSubEventItemSerializer(serializers).serialize(item)));
}
- foreach(boost::shared_ptr<PubSubEventRetract> item, payload->getRetracts()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(PubSubEventRetractSerializer(serializers).serialize(item)));
+ foreach(std::shared_ptr<PubSubEventRetract> item, payload->getRetracts()) {
+ element.addNode(std::make_shared<XMLRawTextNode>(PubSubEventRetractSerializer(serializers).serialize(item)));
}
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.h
index d174f30..7220fde 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventItemsSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubEventItemsSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubEventItemsSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubEventItems>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubEventItems>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.cpp
index 86c7635..e0153ec 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubEventPurgeSerializer::PubSubEventPurgeSerializer(PayloadSerializerCollecti
PubSubEventPurgeSerializer::~PubSubEventPurgeSerializer() {
}
-std::string PubSubEventPurgeSerializer::serializePayload(boost::shared_ptr<PubSubEventPurge> payload) const {
+std::string PubSubEventPurgeSerializer::serializePayload(std::shared_ptr<PubSubEventPurge> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.h
index c80c703..991f2c6 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventPurgeSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubEventPurgeSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubEventPurgeSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubEventPurge>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubEventPurge>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.cpp
index a7fcd20..8169205 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubEventRedirectSerializer::PubSubEventRedirectSerializer(PayloadSerializerCo
PubSubEventRedirectSerializer::~PubSubEventRedirectSerializer() {
}
-std::string PubSubEventRedirectSerializer::serializePayload(boost::shared_ptr<PubSubEventRedirect> payload) const {
+std::string PubSubEventRedirectSerializer::serializePayload(std::shared_ptr<PubSubEventRedirect> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.h
index fe0f16e..26b6246 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventRedirectSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubEventRedirectSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubEventRedirectSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubEventRedirect>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubEventRedirect>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.cpp
index 6a132cc..0147648 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubEventRetractSerializer::PubSubEventRetractSerializer(PayloadSerializerColl
PubSubEventRetractSerializer::~PubSubEventRetractSerializer() {
}
-std::string PubSubEventRetractSerializer::serializePayload(boost::shared_ptr<PubSubEventRetract> payload) const {
+std::string PubSubEventRetractSerializer::serializePayload(std::shared_ptr<PubSubEventRetract> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.h
index 2c393c2..088c263 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventRetractSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubEventRetractSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubEventRetractSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubEventRetract>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubEventRetract>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.cpp
index 7305d29..c084a36 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/PubSubEventConfigurationSerializer.h>
@@ -23,26 +23,26 @@
using namespace Swift;
PubSubEventSerializer::PubSubEventSerializer(PayloadSerializerCollection* serializers) : serializers(serializers) {
- pubsubSerializers.push_back(boost::make_shared<PubSubEventSubscriptionSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubEventPurgeSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubEventCollectionSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubEventDeleteSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubEventItemsSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubEventConfigurationSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubEventSubscriptionSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubEventPurgeSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubEventCollectionSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubEventDeleteSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubEventItemsSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubEventConfigurationSerializer>(serializers));
}
PubSubEventSerializer::~PubSubEventSerializer() {
}
-std::string PubSubEventSerializer::serializePayload(boost::shared_ptr<PubSubEvent> payload) const {
+std::string PubSubEventSerializer::serializePayload(std::shared_ptr<PubSubEvent> payload) const {
if (!payload) {
return "";
}
XMLElement element("event", "http://jabber.org/protocol/pubsub#event");
- boost::shared_ptr<PubSubEventPayload> p = payload->getPayload();
- foreach(boost::shared_ptr<PayloadSerializer> serializer, pubsubSerializers) {
+ std::shared_ptr<PubSubEventPayload> p = payload->getPayload();
+ foreach(std::shared_ptr<PayloadSerializer> serializer, pubsubSerializers) {
if (serializer->canSerialize(p)) {
- element.addNode(boost::make_shared<XMLRawTextNode>(serializer->serialize(p)));
+ element.addNode(std::make_shared<XMLRawTextNode>(serializer->serialize(p)));
}
}
return element.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.h
index 2b50e95..5d2d5d7 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventSerializer.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubEvent.h>
@@ -23,13 +22,13 @@ namespace Swift {
PubSubEventSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubEventSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubEvent>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubEvent>) const SWIFTEN_OVERRIDE;
private:
private:
PayloadSerializerCollection* serializers;
- std::vector< boost::shared_ptr<PayloadSerializer> > pubsubSerializers;
+ std::vector< std::shared_ptr<PayloadSerializer> > pubsubSerializers;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp
index 322b482..212d9ca 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubEventSubscriptionSerializer::PubSubEventSubscriptionSerializer(PayloadSeri
PubSubEventSubscriptionSerializer::~PubSubEventSubscriptionSerializer() {
}
-std::string PubSubEventSubscriptionSerializer::serializePayload(boost::shared_ptr<PubSubEventSubscription> payload) const {
+std::string PubSubEventSubscriptionSerializer::serializePayload(std::shared_ptr<PubSubEventSubscription> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.h
index 74e3062..2b13ee2 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubEventSubscriptionSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubEventSubscriptionSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubEventSubscription>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubEventSubscription>) const SWIFTEN_OVERRIDE;
private:
static std::string serializeSubscriptionType(PubSubEventSubscription::SubscriptionType);
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp
index e32f17a..4b9176e 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Base/foreach.h>
@@ -22,13 +22,13 @@ PubSubItemSerializer::PubSubItemSerializer(PayloadSerializerCollection* serializ
PubSubItemSerializer::~PubSubItemSerializer() {
}
-std::string PubSubItemSerializer::serializePayload(boost::shared_ptr<PubSubItem> payload) const {
+std::string PubSubItemSerializer::serializePayload(std::shared_ptr<PubSubItem> payload) const {
if (!payload) {
return "";
}
XMLElement element("item", "http://jabber.org/protocol/pubsub");
- foreach(boost::shared_ptr<Payload> item, payload->getData()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(serializers->getPayloadSerializer(item)->serialize(item)));
+ foreach(std::shared_ptr<Payload> item, payload->getData()) {
+ element.addNode(std::make_shared<XMLRawTextNode>(serializers->getPayloadSerializer(item)->serialize(item)));
}
if (!payload->getID().empty()) {
element.setAttribute("id", payload->getID());
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.h
index e6dbb83..866d09b 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubItemSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubItemSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubItem>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubItem>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.cpp
index 75d32f5..bde7315 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -9,7 +9,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
#include <boost/lexical_cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Base/foreach.h>
@@ -25,7 +25,7 @@ PubSubItemsSerializer::PubSubItemsSerializer(PayloadSerializerCollection* serial
PubSubItemsSerializer::~PubSubItemsSerializer() {
}
-std::string PubSubItemsSerializer::serializePayload(boost::shared_ptr<PubSubItems> payload) const {
+std::string PubSubItemsSerializer::serializePayload(std::shared_ptr<PubSubItems> payload) const {
if (!payload) {
return "";
}
@@ -34,8 +34,8 @@ std::string PubSubItemsSerializer::serializePayload(boost::shared_ptr<PubSubItem
SWIFT_LOG(warning) << "Serializing PubSubItems with empty node attribute";
}
element.setAttribute("node", payload->getNode());
- foreach(boost::shared_ptr<PubSubItem> item, payload->getItems()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(PubSubItemSerializer(serializers).serialize(item)));
+ foreach(std::shared_ptr<PubSubItem> item, payload->getItems()) {
+ element.addNode(std::make_shared<XMLRawTextNode>(PubSubItemSerializer(serializers).serialize(item)));
}
if (payload->getMaximumItems()) {
element.setAttribute("max_items", boost::lexical_cast<std::string>(*payload->getMaximumItems()));
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.h
index 28b923f..51b0578 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubItemsSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubItemsSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubItems>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubItems>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp
index 09f72ef..c291866 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/FormSerializer.h>
@@ -22,14 +22,14 @@ PubSubOptionsSerializer::PubSubOptionsSerializer(PayloadSerializerCollection* se
PubSubOptionsSerializer::~PubSubOptionsSerializer() {
}
-std::string PubSubOptionsSerializer::serializePayload(boost::shared_ptr<PubSubOptions> payload) const {
+std::string PubSubOptionsSerializer::serializePayload(std::shared_ptr<PubSubOptions> payload) const {
if (!payload) {
return "";
}
XMLElement element("options", "http://jabber.org/protocol/pubsub");
element.setAttribute("node", payload->getNode());
element.setAttribute("jid", payload->getJID());
- element.addNode(boost::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getData())));
+ element.addNode(std::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getData())));
if (payload->getSubscriptionID()) {
element.setAttribute("subid", *payload->getSubscriptionID());
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.h
index 91dabab..3e0fde0 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubOptionsSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubOptionsSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubOptions>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubOptions>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.cpp
index 82980ff..602eb34 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubOwnerAffiliationSerializer::PubSubOwnerAffiliationSerializer(PayloadSerial
PubSubOwnerAffiliationSerializer::~PubSubOwnerAffiliationSerializer() {
}
-std::string PubSubOwnerAffiliationSerializer::serializePayload(boost::shared_ptr<PubSubOwnerAffiliation> payload) const {
+std::string PubSubOwnerAffiliationSerializer::serializePayload(std::shared_ptr<PubSubOwnerAffiliation> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.h
index ef0decf..ad1c963 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubOwnerAffiliationSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubOwnerAffiliationSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubOwnerAffiliation>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubOwnerAffiliation>) const SWIFTEN_OVERRIDE;
private:
static std::string serializeType(PubSubOwnerAffiliation::Type);
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.cpp
index 12873e5..3df3686 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Base/foreach.h>
@@ -23,14 +23,14 @@ PubSubOwnerAffiliationsSerializer::PubSubOwnerAffiliationsSerializer(PayloadSeri
PubSubOwnerAffiliationsSerializer::~PubSubOwnerAffiliationsSerializer() {
}
-std::string PubSubOwnerAffiliationsSerializer::serializePayload(boost::shared_ptr<PubSubOwnerAffiliations> payload) const {
+std::string PubSubOwnerAffiliationsSerializer::serializePayload(std::shared_ptr<PubSubOwnerAffiliations> payload) const {
if (!payload) {
return "";
}
XMLElement element("affiliations", "http://jabber.org/protocol/pubsub#owner");
element.setAttribute("node", payload->getNode());
- foreach(boost::shared_ptr<PubSubOwnerAffiliation> item, payload->getAffiliations()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(PubSubOwnerAffiliationSerializer(serializers).serialize(item)));
+ foreach(std::shared_ptr<PubSubOwnerAffiliation> item, payload->getAffiliations()) {
+ element.addNode(std::make_shared<XMLRawTextNode>(PubSubOwnerAffiliationSerializer(serializers).serialize(item)));
}
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.h
index 70ba66f..6c53189 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerAffiliationsSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubOwnerAffiliationsSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubOwnerAffiliationsSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubOwnerAffiliations>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubOwnerAffiliations>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.cpp
index 94e6860..51e302e 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/FormSerializer.h>
@@ -22,7 +22,7 @@ PubSubOwnerConfigureSerializer::PubSubOwnerConfigureSerializer(PayloadSerializer
PubSubOwnerConfigureSerializer::~PubSubOwnerConfigureSerializer() {
}
-std::string PubSubOwnerConfigureSerializer::serializePayload(boost::shared_ptr<PubSubOwnerConfigure> payload) const {
+std::string PubSubOwnerConfigureSerializer::serializePayload(std::shared_ptr<PubSubOwnerConfigure> payload) const {
if (!payload) {
return "";
}
@@ -30,7 +30,7 @@ std::string PubSubOwnerConfigureSerializer::serializePayload(boost::shared_ptr<P
if (payload->getNode()) {
element.setAttribute("node", *payload->getNode());
}
- element.addNode(boost::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getData())));
+ element.addNode(std::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getData())));
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.h
index be75a00..c5cac8d 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerConfigureSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubOwnerConfigureSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubOwnerConfigureSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubOwnerConfigure>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubOwnerConfigure>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.cpp
index 4b91a81..01e370b 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/FormSerializer.h>
@@ -22,12 +22,12 @@ PubSubOwnerDefaultSerializer::PubSubOwnerDefaultSerializer(PayloadSerializerColl
PubSubOwnerDefaultSerializer::~PubSubOwnerDefaultSerializer() {
}
-std::string PubSubOwnerDefaultSerializer::serializePayload(boost::shared_ptr<PubSubOwnerDefault> payload) const {
+std::string PubSubOwnerDefaultSerializer::serializePayload(std::shared_ptr<PubSubOwnerDefault> payload) const {
if (!payload) {
return "";
}
XMLElement element("default", "http://jabber.org/protocol/pubsub#owner");
- element.addNode(boost::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getData())));
+ element.addNode(std::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getData())));
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.h
index 9d2916f..09703e1 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDefaultSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubOwnerDefaultSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubOwnerDefaultSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubOwnerDefault>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubOwnerDefault>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.cpp
index fbf9a24..faf991c 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.h>
@@ -22,13 +22,13 @@ PubSubOwnerDeleteSerializer::PubSubOwnerDeleteSerializer(PayloadSerializerCollec
PubSubOwnerDeleteSerializer::~PubSubOwnerDeleteSerializer() {
}
-std::string PubSubOwnerDeleteSerializer::serializePayload(boost::shared_ptr<PubSubOwnerDelete> payload) const {
+std::string PubSubOwnerDeleteSerializer::serializePayload(std::shared_ptr<PubSubOwnerDelete> payload) const {
if (!payload) {
return "";
}
XMLElement element("delete", "http://jabber.org/protocol/pubsub#owner");
element.setAttribute("node", payload->getNode());
- element.addNode(boost::make_shared<XMLRawTextNode>(PubSubOwnerRedirectSerializer(serializers).serialize(payload->getRedirect())));
+ element.addNode(std::make_shared<XMLRawTextNode>(PubSubOwnerRedirectSerializer(serializers).serialize(payload->getRedirect())));
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.h
index 3a96e80..c06a916 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubOwnerDeleteSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubOwnerDeleteSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubOwnerDelete>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubOwnerDelete>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.cpp
index 25b38d0..f1dc2ae 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/PubSubOwnerDeleteSerializer.h>
@@ -23,26 +23,26 @@
using namespace Swift;
PubSubOwnerPubSubSerializer::PubSubOwnerPubSubSerializer(PayloadSerializerCollection* serializers) : serializers(serializers) {
- pubsubSerializers.push_back(boost::make_shared<PubSubOwnerConfigureSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubOwnerSubscriptionsSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubOwnerDefaultSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubOwnerPurgeSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubOwnerAffiliationsSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubOwnerDeleteSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubOwnerConfigureSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubOwnerSubscriptionsSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubOwnerDefaultSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubOwnerPurgeSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubOwnerAffiliationsSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubOwnerDeleteSerializer>(serializers));
}
PubSubOwnerPubSubSerializer::~PubSubOwnerPubSubSerializer() {
}
-std::string PubSubOwnerPubSubSerializer::serializePayload(boost::shared_ptr<PubSubOwnerPubSub> payload) const {
+std::string PubSubOwnerPubSubSerializer::serializePayload(std::shared_ptr<PubSubOwnerPubSub> payload) const {
if (!payload) {
return "";
}
XMLElement element("pubsub", "http://jabber.org/protocol/pubsub#owner");
- boost::shared_ptr<PubSubOwnerPayload> p = payload->getPayload();
- foreach(boost::shared_ptr<PayloadSerializer> serializer, pubsubSerializers) {
+ std::shared_ptr<PubSubOwnerPayload> p = payload->getPayload();
+ foreach(std::shared_ptr<PayloadSerializer> serializer, pubsubSerializers) {
if (serializer->canSerialize(p)) {
- element.addNode(boost::make_shared<XMLRawTextNode>(serializer->serialize(p)));
+ element.addNode(std::make_shared<XMLRawTextNode>(serializer->serialize(p)));
}
}
return element.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.h
index 2dd8400..c93eb04 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPubSubSerializer.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubOwnerPubSub.h>
@@ -23,13 +22,13 @@ namespace Swift {
PubSubOwnerPubSubSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubOwnerPubSubSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubOwnerPubSub>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubOwnerPubSub>) const SWIFTEN_OVERRIDE;
private:
private:
PayloadSerializerCollection* serializers;
- std::vector< boost::shared_ptr<PayloadSerializer> > pubsubSerializers;
+ std::vector< std::shared_ptr<PayloadSerializer> > pubsubSerializers;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.cpp
index f934c4e..8bc19e9 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubOwnerPurgeSerializer::PubSubOwnerPurgeSerializer(PayloadSerializerCollecti
PubSubOwnerPurgeSerializer::~PubSubOwnerPurgeSerializer() {
}
-std::string PubSubOwnerPurgeSerializer::serializePayload(boost::shared_ptr<PubSubOwnerPurge> payload) const {
+std::string PubSubOwnerPurgeSerializer::serializePayload(std::shared_ptr<PubSubOwnerPurge> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.h
index 64be235..31f8c52 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerPurgeSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubOwnerPurgeSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubOwnerPurgeSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubOwnerPurge>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubOwnerPurge>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.cpp
index f933a06..cdd101f 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubOwnerRedirectSerializer::PubSubOwnerRedirectSerializer(PayloadSerializerCo
PubSubOwnerRedirectSerializer::~PubSubOwnerRedirectSerializer() {
}
-std::string PubSubOwnerRedirectSerializer::serializePayload(boost::shared_ptr<PubSubOwnerRedirect> payload) const {
+std::string PubSubOwnerRedirectSerializer::serializePayload(std::shared_ptr<PubSubOwnerRedirect> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.h
index b183f46..826ebbe 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerRedirectSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubOwnerRedirectSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubOwnerRedirectSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubOwnerRedirect>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubOwnerRedirect>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.cpp
index 923c160..5f6b505 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubOwnerSubscriptionSerializer::PubSubOwnerSubscriptionSerializer(PayloadSeri
PubSubOwnerSubscriptionSerializer::~PubSubOwnerSubscriptionSerializer() {
}
-std::string PubSubOwnerSubscriptionSerializer::serializePayload(boost::shared_ptr<PubSubOwnerSubscription> payload) const {
+std::string PubSubOwnerSubscriptionSerializer::serializePayload(std::shared_ptr<PubSubOwnerSubscription> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.h
index 1bba67f..df025e0 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubOwnerSubscriptionSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubOwnerSubscriptionSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubOwnerSubscription>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubOwnerSubscription>) const SWIFTEN_OVERRIDE;
private:
static std::string serializeSubscriptionType(PubSubOwnerSubscription::SubscriptionType);
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.cpp
index 088f6c2..106efaa 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Base/foreach.h>
@@ -23,14 +23,14 @@ PubSubOwnerSubscriptionsSerializer::PubSubOwnerSubscriptionsSerializer(PayloadSe
PubSubOwnerSubscriptionsSerializer::~PubSubOwnerSubscriptionsSerializer() {
}
-std::string PubSubOwnerSubscriptionsSerializer::serializePayload(boost::shared_ptr<PubSubOwnerSubscriptions> payload) const {
+std::string PubSubOwnerSubscriptionsSerializer::serializePayload(std::shared_ptr<PubSubOwnerSubscriptions> payload) const {
if (!payload) {
return "";
}
XMLElement element("subscriptions", "http://jabber.org/protocol/pubsub#owner");
element.setAttribute("node", payload->getNode());
- foreach(boost::shared_ptr<PubSubOwnerSubscription> item, payload->getSubscriptions()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(PubSubOwnerSubscriptionSerializer(serializers).serialize(item)));
+ foreach(std::shared_ptr<PubSubOwnerSubscription> item, payload->getSubscriptions()) {
+ element.addNode(std::make_shared<XMLRawTextNode>(PubSubOwnerSubscriptionSerializer(serializers).serialize(item)));
}
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.h
index 70ea7b2..0c282b4 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubOwnerSubscriptionsSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubOwnerSubscriptionsSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubOwnerSubscriptionsSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubOwnerSubscriptions>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubOwnerSubscriptions>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.cpp
index efae018..0b30849 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Base/foreach.h>
@@ -23,14 +23,14 @@ PubSubPublishSerializer::PubSubPublishSerializer(PayloadSerializerCollection* se
PubSubPublishSerializer::~PubSubPublishSerializer() {
}
-std::string PubSubPublishSerializer::serializePayload(boost::shared_ptr<PubSubPublish> payload) const {
+std::string PubSubPublishSerializer::serializePayload(std::shared_ptr<PubSubPublish> payload) const {
if (!payload) {
return "";
}
XMLElement element("publish", "http://jabber.org/protocol/pubsub");
element.setAttribute("node", payload->getNode());
- foreach(boost::shared_ptr<PubSubItem> item, payload->getItems()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(PubSubItemSerializer(serializers).serialize(item)));
+ foreach(std::shared_ptr<PubSubItem> item, payload->getItems()) {
+ element.addNode(std::make_shared<XMLRawTextNode>(PubSubItemSerializer(serializers).serialize(item)));
}
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.h
index c576225..fb1af2e 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubPublishSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubPublishSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubPublishSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubPublish>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubPublish>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.cpp
index 9a84959..752c234 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Base/foreach.h>
@@ -23,14 +23,14 @@ PubSubRetractSerializer::PubSubRetractSerializer(PayloadSerializerCollection* se
PubSubRetractSerializer::~PubSubRetractSerializer() {
}
-std::string PubSubRetractSerializer::serializePayload(boost::shared_ptr<PubSubRetract> payload) const {
+std::string PubSubRetractSerializer::serializePayload(std::shared_ptr<PubSubRetract> payload) const {
if (!payload) {
return "";
}
XMLElement element("retract", "http://jabber.org/protocol/pubsub");
element.setAttribute("node", payload->getNode());
- foreach(boost::shared_ptr<PubSubItem> item, payload->getItems()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(PubSubItemSerializer(serializers).serialize(item)));
+ foreach(std::shared_ptr<PubSubItem> item, payload->getItems()) {
+ element.addNode(std::make_shared<XMLRawTextNode>(PubSubItemSerializer(serializers).serialize(item)));
}
element.setAttribute("notify", payload->isNotify() ? "true" : "false");
return element.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.h
index 60acb6e..0cb12e4 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubRetractSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubRetractSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubRetractSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubRetract>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubRetract>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubSerializer.cpp
index 9562edb..6c110e2 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/PubSubConfigureSerializer.h>
@@ -30,36 +30,36 @@
using namespace Swift;
PubSubSerializer::PubSubSerializer(PayloadSerializerCollection* serializers) : serializers(serializers) {
- pubsubSerializers.push_back(boost::make_shared<PubSubItemsSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubCreateSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubPublishSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubOptionsSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubAffiliationsSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubRetractSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubDefaultSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubSubscriptionsSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubSubscribeSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubUnsubscribeSerializer>(serializers));
- pubsubSerializers.push_back(boost::make_shared<PubSubSubscriptionSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubItemsSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubCreateSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubPublishSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubOptionsSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubAffiliationsSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubRetractSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubDefaultSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubSubscriptionsSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubSubscribeSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubUnsubscribeSerializer>(serializers));
+ pubsubSerializers.push_back(std::make_shared<PubSubSubscriptionSerializer>(serializers));
}
PubSubSerializer::~PubSubSerializer() {
}
-std::string PubSubSerializer::serializePayload(boost::shared_ptr<PubSub> payload) const {
+std::string PubSubSerializer::serializePayload(std::shared_ptr<PubSub> payload) const {
if (!payload) {
return "";
}
XMLElement element("pubsub", "http://jabber.org/protocol/pubsub");
- boost::shared_ptr<PubSubPayload> p = payload->getPayload();
- foreach(boost::shared_ptr<PayloadSerializer> serializer, pubsubSerializers) {
+ std::shared_ptr<PubSubPayload> p = payload->getPayload();
+ foreach(std::shared_ptr<PayloadSerializer> serializer, pubsubSerializers) {
if (serializer->canSerialize(p)) {
- element.addNode(boost::make_shared<XMLRawTextNode>(serializer->serialize(p)));
- if (boost::shared_ptr<PubSubCreate> create = boost::dynamic_pointer_cast<PubSubCreate>(p)) {
- element.addNode(boost::make_shared<XMLRawTextNode>(boost::make_shared<PubSubConfigureSerializer>(serializers)->serialize(create->getConfigure())));
+ element.addNode(std::make_shared<XMLRawTextNode>(serializer->serialize(p)));
+ if (std::shared_ptr<PubSubCreate> create = std::dynamic_pointer_cast<PubSubCreate>(p)) {
+ element.addNode(std::make_shared<XMLRawTextNode>(std::make_shared<PubSubConfigureSerializer>(serializers)->serialize(create->getConfigure())));
}
- if (boost::shared_ptr<PubSubSubscribe> subscribe = boost::dynamic_pointer_cast<PubSubSubscribe>(p)) {
- element.addNode(boost::make_shared<XMLRawTextNode>(boost::make_shared<PubSubConfigureSerializer>(serializers)->serialize(subscribe->getOptions())));
+ if (std::shared_ptr<PubSubSubscribe> subscribe = std::dynamic_pointer_cast<PubSubSubscribe>(p)) {
+ element.addNode(std::make_shared<XMLRawTextNode>(std::make_shared<PubSubConfigureSerializer>(serializers)->serialize(subscribe->getOptions())));
}
}
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubSerializer.h
index 0721d13..829f827 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,10 +21,10 @@ namespace Swift {
PubSubSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSub>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSub>) const SWIFTEN_OVERRIDE;
private:
- std::vector< boost::shared_ptr<PayloadSerializer> > pubsubSerializers;
+ std::vector< std::shared_ptr<PayloadSerializer> > pubsubSerializers;
PayloadSerializerCollection* serializers;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.cpp
index 2e3987e..3fba52e 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -21,12 +21,12 @@ PubSubSubscribeOptionsSerializer::PubSubSubscribeOptionsSerializer(PayloadSerial
PubSubSubscribeOptionsSerializer::~PubSubSubscribeOptionsSerializer() {
}
-std::string PubSubSubscribeOptionsSerializer::serializePayload(boost::shared_ptr<PubSubSubscribeOptions> payload) const {
+std::string PubSubSubscribeOptionsSerializer::serializePayload(std::shared_ptr<PubSubSubscribeOptions> payload) const {
if (!payload) {
return "";
}
XMLElement element("subscribe-options", "http://jabber.org/protocol/pubsub");
- element.addNode(payload->isRequired() ? boost::make_shared<XMLElement>("required", "") : boost::shared_ptr<XMLElement>());
+ element.addNode(payload->isRequired() ? std::make_shared<XMLElement>("required", "") : std::shared_ptr<XMLElement>());
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.h
index 663d91b..dc9b55a 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubSubscribeOptionsSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubSubscribeOptionsSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubSubscribeOptions>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubSubscribeOptions>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.cpp
index dcc7ab1..81fc71d 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubSubscribeSerializer::PubSubSubscribeSerializer(PayloadSerializerCollection
PubSubSubscribeSerializer::~PubSubSubscribeSerializer() {
}
-std::string PubSubSubscribeSerializer::serializePayload(boost::shared_ptr<PubSubSubscribe> payload) const {
+std::string PubSubSubscribeSerializer::serializePayload(std::shared_ptr<PubSubSubscribe> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.h
index c655464..1c8bfaa 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscribeSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubSubscribeSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubSubscribeSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubSubscribe>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubSubscribe>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.cpp
index cadfce9..644ac07 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/PubSubSubscribeOptionsSerializer.h>
@@ -22,7 +22,7 @@ PubSubSubscriptionSerializer::PubSubSubscriptionSerializer(PayloadSerializerColl
PubSubSubscriptionSerializer::~PubSubSubscriptionSerializer() {
}
-std::string PubSubSubscriptionSerializer::serializePayload(boost::shared_ptr<PubSubSubscription> payload) const {
+std::string PubSubSubscriptionSerializer::serializePayload(std::shared_ptr<PubSubSubscription> payload) const {
if (!payload) {
return "";
}
@@ -34,7 +34,7 @@ std::string PubSubSubscriptionSerializer::serializePayload(boost::shared_ptr<Pub
element.setAttribute("subid", *payload->getSubscriptionID());
}
element.setAttribute("jid", payload->getJID());
- element.addNode(boost::make_shared<XMLRawTextNode>(PubSubSubscribeOptionsSerializer(serializers).serialize(payload->getOptions())));
+ element.addNode(std::make_shared<XMLRawTextNode>(PubSubSubscribeOptionsSerializer(serializers).serialize(payload->getOptions())));
element.setAttribute("subscription", serializeSubscriptionType(payload->getSubscription()));
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.h
index 7d96a06..5a5f847 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubSubscriptionSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubSubscriptionSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubSubscription>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubSubscription>) const SWIFTEN_OVERRIDE;
private:
static std::string serializeSubscriptionType(PubSubSubscription::SubscriptionType);
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.cpp
index 3347187..511c8e8 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
#include <Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Base/foreach.h>
@@ -23,7 +23,7 @@ PubSubSubscriptionsSerializer::PubSubSubscriptionsSerializer(PayloadSerializerCo
PubSubSubscriptionsSerializer::~PubSubSubscriptionsSerializer() {
}
-std::string PubSubSubscriptionsSerializer::serializePayload(boost::shared_ptr<PubSubSubscriptions> payload) const {
+std::string PubSubSubscriptionsSerializer::serializePayload(std::shared_ptr<PubSubSubscriptions> payload) const {
if (!payload) {
return "";
}
@@ -31,8 +31,8 @@ std::string PubSubSubscriptionsSerializer::serializePayload(boost::shared_ptr<Pu
if (payload->getNode()) {
element.setAttribute("node", *payload->getNode());
}
- foreach(boost::shared_ptr<PubSubSubscription> item, payload->getSubscriptions()) {
- element.addNode(boost::make_shared<XMLRawTextNode>(PubSubSubscriptionSerializer(serializers).serialize(item)));
+ foreach(std::shared_ptr<PubSubSubscription> item, payload->getSubscriptions()) {
+ element.addNode(std::make_shared<XMLRawTextNode>(PubSubSubscriptionSerializer(serializers).serialize(item)));
}
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.h
index cc64483..caeb3ef 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubSubscriptionsSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubSubscriptionsSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubSubscriptionsSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubSubscriptions>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubSubscriptions>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.cpp
index e9a16d6..6296d9e 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -21,7 +21,7 @@ PubSubUnsubscribeSerializer::PubSubUnsubscribeSerializer(PayloadSerializerCollec
PubSubUnsubscribeSerializer::~PubSubUnsubscribeSerializer() {
}
-std::string PubSubUnsubscribeSerializer::serializePayload(boost::shared_ptr<PubSubUnsubscribe> payload) const {
+std::string PubSubUnsubscribeSerializer::serializePayload(std::shared_ptr<PubSubUnsubscribe> payload) const {
if (!payload) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.h b/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.h
index ab9a053..cc98cf5 100644
--- a/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/PubSubUnsubscribeSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
PubSubUnsubscribeSerializer(PayloadSerializerCollection* serializers);
virtual ~PubSubUnsubscribeSerializer();
- virtual std::string serializePayload(boost::shared_ptr<PubSubUnsubscribe>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<PubSubUnsubscribe>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h
index 21ca59f..1f07e37 100644
--- a/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/RawXMLPayloadSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
RawXMLPayloadSerializer() : GenericPayloadSerializer<RawXMLPayload>() {}
- virtual std::string serializePayload(boost::shared_ptr<RawXMLPayload> p) const {
+ virtual std::string serializePayload(std::shared_ptr<RawXMLPayload> p) const {
return p->getRawXML();
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/ReplaceSerializer.h b/Swiften/Serializer/PayloadSerializers/ReplaceSerializer.h
index a16f52b..3487b16 100644
--- a/Swiften/Serializer/PayloadSerializers/ReplaceSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/ReplaceSerializer.h
@@ -22,7 +22,7 @@ namespace Swift {
public:
ReplaceSerializer() : GenericPayloadSerializer<Replace>() {}
- virtual std::string serializePayload(boost::shared_ptr<Replace> replace) const {
+ virtual std::string serializePayload(std::shared_ptr<Replace> replace) const {
return "<replace id = '" + replace->getID() + "' xmlns='urn:xmpp:message-correct:0'/>";
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp
index c737102..95a0084 100644
--- a/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp
@@ -1,13 +1,12 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/XML/XMLElement.h>
#include <Swiften/Serializer/XML/XMLTextNode.h>
@@ -17,16 +16,16 @@ namespace Swift {
ResourceBindSerializer::ResourceBindSerializer() : GenericPayloadSerializer<ResourceBind>() {
}
-std::string ResourceBindSerializer::serializePayload(boost::shared_ptr<ResourceBind> resourceBind) const {
+std::string ResourceBindSerializer::serializePayload(std::shared_ptr<ResourceBind> resourceBind) const {
XMLElement bindElement("bind", "urn:ietf:params:xml:ns:xmpp-bind");
if (resourceBind->getJID().isValid()) {
- boost::shared_ptr<XMLElement> jidNode(new XMLElement("jid"));
- jidNode->addNode(boost::make_shared<XMLTextNode>(resourceBind->getJID().toString()));
+ std::shared_ptr<XMLElement> jidNode(new XMLElement("jid"));
+ jidNode->addNode(std::make_shared<XMLTextNode>(resourceBind->getJID().toString()));
bindElement.addNode(jidNode);
}
else if (!resourceBind->getResource().empty()) {
- boost::shared_ptr<XMLElement> resourceNode(new XMLElement("resource"));
- resourceNode->addNode(boost::make_shared<XMLTextNode>(resourceBind->getResource()));
+ std::shared_ptr<XMLElement> resourceNode(new XMLElement("resource"));
+ resourceNode->addNode(std::make_shared<XMLTextNode>(resourceBind->getResource()));
bindElement.addNode(resourceNode);
}
return bindElement.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h b/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h
index 2878c34..bea3ff1 100644
--- a/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.h
@@ -15,6 +15,6 @@ namespace Swift {
public:
ResourceBindSerializer();
- virtual std::string serializePayload(boost::shared_ptr<ResourceBind>) const;
+ virtual std::string serializePayload(std::shared_ptr<ResourceBind>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp
index 205d9e0..3302863 100644
--- a/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp
@@ -6,8 +6,9 @@
#include <Swiften/Serializer/PayloadSerializers/ResultSetSerializer.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Serializer/XML/XMLElement.h>
#include <Swiften/Serializer/XML/XMLRawTextNode.h>
@@ -20,7 +21,7 @@ ResultSetSerializer::ResultSetSerializer() {
ResultSetSerializer::~ResultSetSerializer() {
}
-std::string ResultSetSerializer::serializePayload(boost::shared_ptr<ResultSet> payload) const {
+std::string ResultSetSerializer::serializePayload(std::shared_ptr<ResultSet> payload) const {
if (!payload) {
return "";
}
@@ -28,19 +29,19 @@ std::string ResultSetSerializer::serializePayload(boost::shared_ptr<ResultSet> p
XMLElement element("set", "http://jabber.org/protocol/rsm");
if (payload->getMaxItems()) {
- element.addNode(boost::make_shared<XMLElement>("max", "", boost::lexical_cast<std::string>(*payload->getMaxItems())));
+ element.addNode(std::make_shared<XMLElement>("max", "", boost::lexical_cast<std::string>(*payload->getMaxItems())));
}
if (payload->getCount()) {
- element.addNode(boost::make_shared<XMLElement>("count", "", boost::lexical_cast<std::string>(*payload->getCount())));
+ element.addNode(std::make_shared<XMLElement>("count", "", boost::lexical_cast<std::string>(*payload->getCount())));
}
if (payload->getIndex()) {
- element.addNode(boost::make_shared<XMLElement>("index", "", boost::lexical_cast<std::string>(*payload->getIndex())));
+ element.addNode(std::make_shared<XMLElement>("index", "", boost::lexical_cast<std::string>(*payload->getIndex())));
}
if (payload->getFirstID()) {
- boost::shared_ptr<XMLElement> firstElement = boost::make_shared<XMLElement>("first", "", *payload->getFirstID());
+ std::shared_ptr<XMLElement> firstElement = std::make_shared<XMLElement>("first", "", *payload->getFirstID());
if (payload->getFirstIDIndex()) {
firstElement->setAttribute("index", boost::lexical_cast<std::string>(*payload->getFirstIDIndex()));
}
@@ -48,15 +49,15 @@ std::string ResultSetSerializer::serializePayload(boost::shared_ptr<ResultSet> p
}
if (payload->getLastID()) {
- element.addNode(boost::make_shared<XMLElement>("last", "", *payload->getLastID()));
+ element.addNode(std::make_shared<XMLElement>("last", "", *payload->getLastID()));
}
if (payload->getBefore()) {
- element.addNode(boost::make_shared<XMLElement>("before", "", *payload->getBefore()));
+ element.addNode(std::make_shared<XMLElement>("before", "", *payload->getBefore()));
}
if (payload->getAfter()) {
- element.addNode(boost::make_shared<XMLElement>("after", "", *payload->getAfter()));
+ element.addNode(std::make_shared<XMLElement>("after", "", *payload->getAfter()));
}
return element.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.h b/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.h
index 9d8e24d..e75b443 100644
--- a/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,6 +21,6 @@ namespace Swift {
ResultSetSerializer();
virtual ~ResultSetSerializer();
- virtual std::string serializePayload(boost::shared_ptr<ResultSet>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<ResultSet>) const SWIFTEN_OVERRIDE;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.cpp b/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.cpp
index f0b19e1..24cc301 100644
--- a/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.cpp
@@ -12,8 +12,7 @@
#include <Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -25,10 +24,10 @@ namespace Swift {
RosterItemExchangeSerializer::RosterItemExchangeSerializer() : GenericPayloadSerializer<RosterItemExchangePayload>() {
}
-std::string RosterItemExchangeSerializer::serializePayload(boost::shared_ptr<RosterItemExchangePayload> roster) const {
+std::string RosterItemExchangeSerializer::serializePayload(std::shared_ptr<RosterItemExchangePayload> roster) const {
XMLElement queryElement("x", "http://jabber.org/protocol/rosterx");
foreach(const RosterItemExchangePayload::Item& item, roster->getItems()) {
- boost::shared_ptr<XMLElement> itemElement(new XMLElement("item"));
+ std::shared_ptr<XMLElement> itemElement(new XMLElement("item"));
itemElement->setAttribute("jid", item.getJID());
itemElement->setAttribute("name", item.getName());
@@ -39,8 +38,8 @@ std::string RosterItemExchangeSerializer::serializePayload(boost::shared_ptr<Ros
}
foreach(const std::string& group, item.getGroups()) {
- boost::shared_ptr<XMLElement> groupElement(new XMLElement("group"));
- groupElement->addNode(boost::make_shared<XMLTextNode>(group));
+ std::shared_ptr<XMLElement> groupElement(new XMLElement("group"));
+ groupElement->addNode(std::make_shared<XMLTextNode>(group));
itemElement->addNode(groupElement);
}
diff --git a/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.h b/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.h
index ec4e81e..6212998 100644
--- a/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/RosterItemExchangeSerializer.h
@@ -21,6 +21,6 @@ namespace Swift {
public:
RosterItemExchangeSerializer();
- virtual std::string serializePayload(boost::shared_ptr<RosterItemExchangePayload>) const;
+ virtual std::string serializePayload(std::shared_ptr<RosterItemExchangePayload>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/RosterSerializer.cpp b/Swiften/Serializer/PayloadSerializers/RosterSerializer.cpp
index 1094f2d..8c857ab 100644
--- a/Swiften/Serializer/PayloadSerializers/RosterSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/RosterSerializer.cpp
@@ -6,8 +6,7 @@
#include <Swiften/Serializer/PayloadSerializers/RosterSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -19,13 +18,13 @@ namespace Swift {
RosterSerializer::RosterSerializer() : GenericPayloadSerializer<RosterPayload>() {
}
-std::string RosterSerializer::serializePayload(boost::shared_ptr<RosterPayload> roster) const {
+std::string RosterSerializer::serializePayload(std::shared_ptr<RosterPayload> roster) const {
XMLElement queryElement("query", "jabber:iq:roster");
if (roster->getVersion()) {
queryElement.setAttribute("ver", *roster->getVersion());
}
foreach(const RosterItemPayload& item, roster->getItems()) {
- boost::shared_ptr<XMLElement> itemElement(new XMLElement("item"));
+ std::shared_ptr<XMLElement> itemElement(new XMLElement("item"));
itemElement->setAttribute("jid", item.getJID());
itemElement->setAttribute("name", item.getName());
@@ -42,13 +41,13 @@ std::string RosterSerializer::serializePayload(boost::shared_ptr<RosterPayload>
}
foreach(const std::string& group, item.getGroups()) {
- boost::shared_ptr<XMLElement> groupElement(new XMLElement("group"));
- groupElement->addNode(boost::make_shared<XMLTextNode>(group));
+ std::shared_ptr<XMLElement> groupElement(new XMLElement("group"));
+ groupElement->addNode(std::make_shared<XMLTextNode>(group));
itemElement->addNode(groupElement);
}
if (!item.getUnknownContent().empty()) {
- itemElement->addNode(boost::make_shared<XMLRawTextNode>(item.getUnknownContent()));
+ itemElement->addNode(std::make_shared<XMLRawTextNode>(item.getUnknownContent()));
}
diff --git a/Swiften/Serializer/PayloadSerializers/RosterSerializer.h b/Swiften/Serializer/PayloadSerializers/RosterSerializer.h
index 799d88f..834f723 100644
--- a/Swiften/Serializer/PayloadSerializers/RosterSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/RosterSerializer.h
@@ -15,6 +15,6 @@ namespace Swift {
public:
RosterSerializer();
- virtual std::string serializePayload(boost::shared_ptr<RosterPayload>) const;
+ virtual std::string serializePayload(std::shared_ptr<RosterPayload>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/S5BProxyRequestSerializer.h b/Swiften/Serializer/PayloadSerializers/S5BProxyRequestSerializer.h
index f10bcfc..7058ac1 100644
--- a/Swiften/Serializer/PayloadSerializers/S5BProxyRequestSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/S5BProxyRequestSerializer.h
@@ -5,15 +5,16 @@
*/
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/S5BProxyRequest.h>
@@ -25,17 +26,17 @@ namespace Swift {
class SWIFTEN_API S5BProxyRequestSerializer : public GenericPayloadSerializer<S5BProxyRequest> {
public:
- virtual std::string serializePayload(boost::shared_ptr<S5BProxyRequest> s5bProxyRequest) const {
+ virtual std::string serializePayload(std::shared_ptr<S5BProxyRequest> s5bProxyRequest) const {
XMLElement queryElement("query", "http://jabber.org/protocol/bytestreams");
if (s5bProxyRequest && s5bProxyRequest->getStreamHost()) {
- boost::shared_ptr<XMLElement> streamHost = boost::make_shared<XMLElement>("streamhost");
+ std::shared_ptr<XMLElement> streamHost = std::make_shared<XMLElement>("streamhost");
streamHost->setAttribute("host", s5bProxyRequest->getStreamHost().get().host);
streamHost->setAttribute("port", boost::lexical_cast<std::string>(s5bProxyRequest->getStreamHost().get().port));
streamHost->setAttribute("jid", s5bProxyRequest->getStreamHost().get().jid.toString());
queryElement.addNode(streamHost);
} else if (s5bProxyRequest && s5bProxyRequest->getActivate()) {
queryElement.setAttribute("sid", s5bProxyRequest->getSID());
- boost::shared_ptr<XMLElement> activate = boost::make_shared<XMLElement>("activate", "", s5bProxyRequest->getActivate().get().toString());
+ std::shared_ptr<XMLElement> activate = std::make_shared<XMLElement>("activate", "", s5bProxyRequest->getActivate().get().toString());
queryElement.addNode(activate);
}
return queryElement.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.cpp
index de036df..6e55f46 100644
--- a/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.cpp
@@ -6,8 +6,7 @@
#include <Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/PayloadSerializers/FormSerializer.h>
@@ -19,7 +18,7 @@ namespace Swift {
SearchPayloadSerializer::SearchPayloadSerializer() {
}
-std::string SearchPayloadSerializer::serializePayload(boost::shared_ptr<SearchPayload> searchPayload) const {
+std::string SearchPayloadSerializer::serializePayload(std::shared_ptr<SearchPayload> searchPayload) const {
XMLElement searchElement("query", "jabber:iq:search");
if (searchPayload->getInstructions()) {
@@ -54,7 +53,7 @@ std::string SearchPayloadSerializer::serializePayload(boost::shared_ptr<SearchPa
}
if (Form::ref form = searchPayload->getForm()) {
- searchElement.addNode(boost::make_shared<XMLRawTextNode>(FormSerializer().serialize(form)));
+ searchElement.addNode(std::make_shared<XMLRawTextNode>(FormSerializer().serialize(form)));
}
return searchElement.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h b/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h
index 594e5d7..51f4227 100644
--- a/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h
@@ -18,6 +18,6 @@ namespace Swift {
public:
SearchPayloadSerializer();
- virtual std::string serializePayload(boost::shared_ptr<SearchPayload>) const;
+ virtual std::string serializePayload(std::shared_ptr<SearchPayload>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp b/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp
index 9b35952..97c5411 100644
--- a/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp
@@ -6,7 +6,7 @@
#include <Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -18,27 +18,27 @@ namespace Swift {
SecurityLabelSerializer::SecurityLabelSerializer() : GenericPayloadSerializer<SecurityLabel>() {
}
-std::string SecurityLabelSerializer::serializePayload(boost::shared_ptr<SecurityLabel> label) const {
+std::string SecurityLabelSerializer::serializePayload(std::shared_ptr<SecurityLabel> label) const {
XMLElement element("securitylabel", "urn:xmpp:sec-label:0");
if (!label->getDisplayMarking().empty()) {
- boost::shared_ptr<XMLElement> displayMarking(new XMLElement("displaymarking"));
+ std::shared_ptr<XMLElement> displayMarking(new XMLElement("displaymarking"));
if (!label->getForegroundColor().empty()) {
displayMarking->setAttribute("fgcolor", label->getForegroundColor());
}
if (!label->getBackgroundColor().empty()) {
displayMarking->setAttribute("bgcolor", label->getBackgroundColor());
}
- displayMarking->addNode(boost::make_shared<XMLTextNode>(label->getDisplayMarking()));
+ displayMarking->addNode(std::make_shared<XMLTextNode>(label->getDisplayMarking()));
element.addNode(displayMarking);
}
- boost::shared_ptr<XMLElement> labelElement(new XMLElement("label"));
- labelElement->addNode(boost::make_shared<XMLRawTextNode>(label->getLabel()));
+ std::shared_ptr<XMLElement> labelElement(new XMLElement("label"));
+ labelElement->addNode(std::make_shared<XMLRawTextNode>(label->getLabel()));
element.addNode(labelElement);
foreach(const std::string& equivalentLabel, label->getEquivalentLabels()) {
- boost::shared_ptr<XMLElement> equivalentLabelElement(new XMLElement("equivalentlabel"));
- equivalentLabelElement->addNode(boost::make_shared<XMLRawTextNode>(equivalentLabel));
+ std::shared_ptr<XMLElement> equivalentLabelElement(new XMLElement("equivalentlabel"));
+ equivalentLabelElement->addNode(std::make_shared<XMLRawTextNode>(equivalentLabel));
element.addNode(equivalentLabelElement);
}
return element.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h b/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h
index 23f50f4..b1eaaed 100644
--- a/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h
@@ -15,6 +15,6 @@ namespace Swift {
public:
SecurityLabelSerializer();
- virtual std::string serializePayload(boost::shared_ptr<SecurityLabel> version) const;
+ virtual std::string serializePayload(std::shared_ptr<SecurityLabel> version) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp b/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp
index 2bf6bbb..e8d2a1b 100644
--- a/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp
@@ -6,7 +6,7 @@
#include <Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h>
@@ -18,7 +18,7 @@ namespace Swift {
SecurityLabelsCatalogSerializer::SecurityLabelsCatalogSerializer() : GenericPayloadSerializer<SecurityLabelsCatalog>() {
}
-std::string SecurityLabelsCatalogSerializer::serializePayload(boost::shared_ptr<SecurityLabelsCatalog> catalog) const {
+std::string SecurityLabelsCatalogSerializer::serializePayload(std::shared_ptr<SecurityLabelsCatalog> catalog) const {
XMLElement element("catalog", "urn:xmpp:sec-label:catalog:2");
if (!catalog->getName().empty()) {
element.setAttribute("name", catalog->getName());
@@ -30,14 +30,14 @@ std::string SecurityLabelsCatalogSerializer::serializePayload(boost::shared_ptr<
element.setAttribute("desc", catalog->getDescription());
}
foreach (const SecurityLabelsCatalog::Item& item, catalog->getItems()) {
- boost::shared_ptr<XMLElement> itemElement(new XMLElement("item"));
+ std::shared_ptr<XMLElement> itemElement(new XMLElement("item"));
itemElement->setAttribute("selector", item.getSelector());
if (item.getIsDefault()) {
itemElement->setAttribute("default", "true");
}
if (item.getLabel()) {
std::string serializedLabel = SecurityLabelSerializer().serialize(item.getLabel());
- itemElement->addNode(boost::make_shared<XMLRawTextNode>(serializedLabel));
+ itemElement->addNode(std::make_shared<XMLRawTextNode>(serializedLabel));
}
element.addNode(itemElement);
}
diff --git a/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h b/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h
index da3b7f3..c3efc1e 100644
--- a/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h
@@ -15,6 +15,6 @@ namespace Swift {
public:
SecurityLabelsCatalogSerializer();
- virtual std::string serializePayload(boost::shared_ptr<SecurityLabelsCatalog> version) const;
+ virtual std::string serializePayload(std::shared_ptr<SecurityLabelsCatalog> version) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp
index 05beaae..2245030 100644
--- a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -11,7 +11,7 @@ namespace Swift {
SoftwareVersionSerializer::SoftwareVersionSerializer() : GenericPayloadSerializer<SoftwareVersion>() {
}
-std::string SoftwareVersionSerializer::serializePayload(boost::shared_ptr<SoftwareVersion> version) const {
+std::string SoftwareVersionSerializer::serializePayload(std::shared_ptr<SoftwareVersion> version) const {
std::string result("<query xmlns=\"jabber:iq:version\">");
if (!version->getName().empty()) {
result += "<name>" + version->getName() + "</name>";
diff --git a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h
index 6c03c84..7f0875b 100644
--- a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h
@@ -15,6 +15,6 @@ namespace Swift {
public:
SoftwareVersionSerializer();
- virtual std::string serializePayload(boost::shared_ptr<SoftwareVersion> version) const;
+ virtual std::string serializePayload(std::shared_ptr<SoftwareVersion> version) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h b/Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h
index 086652f..12e6994 100644
--- a/Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -18,7 +18,7 @@ namespace Swift {
public:
StartSessionSerializer() : GenericPayloadSerializer<StartSession>() {}
- virtual std::string serializePayload(boost::shared_ptr<StartSession>) const {
+ virtual std::string serializePayload(std::shared_ptr<StartSession>) const {
return XMLElement("session", "urn:ietf:params:xml:ns:xmpp-session").serialize();
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/StatusSerializer.h b/Swiften/Serializer/PayloadSerializers/StatusSerializer.h
index 8247e28..0e81a26 100644
--- a/Swiften/Serializer/PayloadSerializers/StatusSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/StatusSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Status.h>
@@ -19,9 +19,9 @@ namespace Swift {
public:
StatusSerializer() : GenericPayloadSerializer<Status>() {}
- virtual std::string serializePayload(boost::shared_ptr<Status> status) const {
+ virtual std::string serializePayload(std::shared_ptr<Status> status) const {
XMLElement element("status");
- element.addNode(boost::make_shared<XMLTextNode>(status->getText()));
+ element.addNode(std::make_shared<XMLTextNode>(status->getText()));
return element.serialize();
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/StatusShowSerializer.h b/Swiften/Serializer/PayloadSerializers/StatusShowSerializer.h
index 24fbe1b..155b645 100644
--- a/Swiften/Serializer/PayloadSerializers/StatusShowSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/StatusShowSerializer.h
@@ -15,7 +15,7 @@ namespace Swift {
public:
StatusShowSerializer() : GenericPayloadSerializer<StatusShow>() {}
- virtual std::string serializePayload(boost::shared_ptr<StatusShow> statusShow) const {
+ virtual std::string serializePayload(std::shared_ptr<StatusShow> statusShow) const {
if (statusShow->getType () == StatusShow::Online || statusShow->getType() == StatusShow::None) {
return "";
}
diff --git a/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp b/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp
index 64ea62c..31720f7 100644
--- a/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/StorageSerializer.cpp
@@ -1,13 +1,12 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Serializer/PayloadSerializers/StorageSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -18,29 +17,29 @@ namespace Swift {
StorageSerializer::StorageSerializer() : GenericPayloadSerializer<Storage>() {
}
-std::string StorageSerializer::serializePayload(boost::shared_ptr<Storage> storage) const {
+std::string StorageSerializer::serializePayload(std::shared_ptr<Storage> storage) const {
XMLElement storageElement("storage", "storage:bookmarks");
foreach(const Storage::Room& room, storage->getRooms()) {
- boost::shared_ptr<XMLElement> conferenceElement(new XMLElement("conference"));
+ std::shared_ptr<XMLElement> conferenceElement(new XMLElement("conference"));
conferenceElement->setAttribute("name", room.name);
conferenceElement->setAttribute("jid", room.jid);
conferenceElement->setAttribute("autojoin", room.autoJoin ? "1" : "0");
if (!room.nick.empty()) {
- boost::shared_ptr<XMLElement> nickElement(new XMLElement("nick"));
- nickElement->addNode(boost::make_shared<XMLTextNode>(room.nick));
+ std::shared_ptr<XMLElement> nickElement(new XMLElement("nick"));
+ nickElement->addNode(std::make_shared<XMLTextNode>(room.nick));
conferenceElement->addNode(nickElement);
}
if (room.password) {
- boost::shared_ptr<XMLElement> passwordElement(new XMLElement("password"));
- passwordElement->addNode(boost::make_shared<XMLTextNode>(*room.password));
+ std::shared_ptr<XMLElement> passwordElement(new XMLElement("password"));
+ passwordElement->addNode(std::make_shared<XMLTextNode>(*room.password));
conferenceElement->addNode(passwordElement);
}
storageElement.addNode(conferenceElement);
}
foreach(const Storage::URL& url, storage->getURLs()) {
- boost::shared_ptr<XMLElement> urlElement(new XMLElement("url"));
+ std::shared_ptr<XMLElement> urlElement(new XMLElement("url"));
urlElement->setAttribute("name", url.name);
urlElement->setAttribute("url", url.url);
storageElement.addNode(urlElement);
diff --git a/Swiften/Serializer/PayloadSerializers/StorageSerializer.h b/Swiften/Serializer/PayloadSerializers/StorageSerializer.h
index a3a55f4..9f88fa1 100644
--- a/Swiften/Serializer/PayloadSerializers/StorageSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/StorageSerializer.h
@@ -15,6 +15,6 @@ namespace Swift {
public:
StorageSerializer();
- virtual std::string serializePayload(boost::shared_ptr<Storage>) const;
+ virtual std::string serializePayload(std::shared_ptr<Storage>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.cpp b/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.cpp
index a64d7ae..e15ab77 100644
--- a/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.cpp
@@ -12,9 +12,9 @@
#include <Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/DateTime.h>
#include <Swiften/Base/foreach.h>
@@ -27,7 +27,7 @@ namespace Swift {
StreamInitiationFileInfoSerializer::StreamInitiationFileInfoSerializer() {
}
-std::string StreamInitiationFileInfoSerializer::serializePayload(boost::shared_ptr<StreamInitiationFileInfo> fileInfo) const {
+std::string StreamInitiationFileInfoSerializer::serializePayload(std::shared_ptr<StreamInitiationFileInfo> fileInfo) const {
XMLElement fileElement("file", "http://jabber.org/protocol/si/profile/file-transfer");
if (fileInfo->getDate() != stringToDateTime("")) {
@@ -44,11 +44,11 @@ std::string StreamInitiationFileInfoSerializer::serializePayload(boost::shared_p
fileElement.setAttribute("size", boost::lexical_cast<std::string>(fileInfo->getSize()));
}
if (!fileInfo->getDescription().empty()) {
- boost::shared_ptr<XMLElement> desc = boost::make_shared<XMLElement>("desc", "", fileInfo->getDescription());
+ std::shared_ptr<XMLElement> desc = std::make_shared<XMLElement>("desc", "", fileInfo->getDescription());
fileElement.addNode(desc);
}
if (fileInfo->getSupportsRangeRequests()) {
- boost::shared_ptr<XMLElement> range = boost::make_shared<XMLElement>("range");
+ std::shared_ptr<XMLElement> range = std::make_shared<XMLElement>("range");
if (fileInfo->getRangeOffset() != 0) {
range->setAttribute("offset", boost::lexical_cast<std::string>(fileInfo->getRangeOffset()));
}
diff --git a/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.h b/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.h
index e7714f0..de54313 100644
--- a/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.h
@@ -25,6 +25,6 @@ namespace Swift {
public:
StreamInitiationFileInfoSerializer();
- virtual std::string serializePayload(boost::shared_ptr<StreamInitiationFileInfo>) const;
+ virtual std::string serializePayload(std::shared_ptr<StreamInitiationFileInfo>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp b/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp
index 824569a..fcfb063 100644
--- a/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp
@@ -1,13 +1,13 @@
/*
- * Copyright (c) 2010-2013 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
+#include <memory>
#include <boost/lexical_cast.hpp>
#include <Swiften/Base/foreach.h>
@@ -25,7 +25,7 @@ namespace Swift {
StreamInitiationSerializer::StreamInitiationSerializer() {
}
-std::string StreamInitiationSerializer::serializePayload(boost::shared_ptr<StreamInitiation> streamInitiation) const {
+std::string StreamInitiationSerializer::serializePayload(std::shared_ptr<StreamInitiation> streamInitiation) const {
assert(streamInitiation->getIsFileTransfer());
XMLElement siElement("si", "http://jabber.org/protocol/si");
@@ -36,37 +36,37 @@ std::string StreamInitiationSerializer::serializePayload(boost::shared_ptr<Strea
if (streamInitiation->getFileInfo()) {
StreamInitiationFileInfo file = *streamInitiation->getFileInfo();
- boost::shared_ptr<XMLElement> fileElement(new XMLElement("file", "http://jabber.org/protocol/si/profile/file-transfer"));
+ std::shared_ptr<XMLElement> fileElement(new XMLElement("file", "http://jabber.org/protocol/si/profile/file-transfer"));
fileElement->setAttribute("name", file.getName());
if (file.getSize() != 0) {
fileElement->setAttribute("size", boost::lexical_cast<std::string>(file.getSize()));
}
if (!file.getDescription().empty()) {
- boost::shared_ptr<XMLElement> descElement(new XMLElement("desc"));
- descElement->addNode(boost::make_shared<XMLTextNode>(file.getDescription()));
+ std::shared_ptr<XMLElement> descElement(new XMLElement("desc"));
+ descElement->addNode(std::make_shared<XMLTextNode>(file.getDescription()));
fileElement->addNode(descElement);
}
siElement.addNode(fileElement);
}
- boost::shared_ptr<XMLElement> featureElement(new XMLElement("feature", FEATURE_NEG_NS));
+ std::shared_ptr<XMLElement> featureElement(new XMLElement("feature", FEATURE_NEG_NS));
if (streamInitiation->getProvidedMethods().size() > 0) {
Form::ref form(new Form(Form::FormType));
- FormField::ref field = boost::make_shared<FormField>(FormField::ListSingleType);
+ FormField::ref field = std::make_shared<FormField>(FormField::ListSingleType);
field->setName("stream-method");
foreach(const std::string& method, streamInitiation->getProvidedMethods()) {
field->addOption(FormField::Option("", method));
}
form->addField(field);
- featureElement->addNode(boost::make_shared<XMLRawTextNode>(FormSerializer().serialize(form)));
+ featureElement->addNode(std::make_shared<XMLRawTextNode>(FormSerializer().serialize(form)));
}
else if (!streamInitiation->getRequestedMethod().empty()) {
Form::ref form(new Form(Form::SubmitType));
- FormField::ref field = boost::make_shared<FormField>(FormField::ListSingleType);
+ FormField::ref field = std::make_shared<FormField>(FormField::ListSingleType);
field->addValue(streamInitiation->getRequestedMethod());
field->setName("stream-method");
form->addField(field);
- featureElement->addNode(boost::make_shared<XMLRawTextNode>(FormSerializer().serialize(form)));
+ featureElement->addNode(std::make_shared<XMLRawTextNode>(FormSerializer().serialize(form)));
}
siElement.addNode(featureElement);
return siElement.serialize();
diff --git a/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h b/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h
index 056806e..73dbc39 100644
--- a/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.h
@@ -15,6 +15,6 @@ namespace Swift {
public:
StreamInitiationSerializer();
- virtual std::string serializePayload(boost::shared_ptr<StreamInitiation>) const;
+ virtual std::string serializePayload(std::shared_ptr<StreamInitiation>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h b/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h
index 9f90ce0..20f95fd 100644
--- a/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/SubjectSerializer.h
@@ -16,7 +16,7 @@ namespace Swift {
public:
SubjectSerializer() : GenericPayloadSerializer<Subject>() {}
- virtual std::string serializePayload(boost::shared_ptr<Subject> subject) const {
+ virtual std::string serializePayload(std::shared_ptr<Subject> subject) const {
XMLTextNode textNode(subject->getText());
return "<subject>" + textNode.serialize() + "</subject>";
}
diff --git a/Swiften/Serializer/PayloadSerializers/ThreadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ThreadSerializer.cpp
index 61b91ae..5914cf2 100644
--- a/Swiften/Serializer/PayloadSerializers/ThreadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/ThreadSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -15,7 +15,7 @@ namespace Swift {
ThreadSerializer::~ThreadSerializer() {
}
- std::string ThreadSerializer::serializePayload(boost::shared_ptr<Thread> thread) const {
+ std::string ThreadSerializer::serializePayload(std::shared_ptr<Thread> thread) const {
XMLElement threadNode("thread", "", thread->getText());
if (!thread->getParent().empty()) {
threadNode.setAttribute("parent", thread->getParent());
diff --git a/Swiften/Serializer/PayloadSerializers/ThreadSerializer.h b/Swiften/Serializer/PayloadSerializers/ThreadSerializer.h
index 264faba..07ecb82 100644
--- a/Swiften/Serializer/PayloadSerializers/ThreadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/ThreadSerializer.h
@@ -17,6 +17,6 @@ namespace Swift {
ThreadSerializer();
virtual ~ThreadSerializer();
- virtual std::string serializePayload(boost::shared_ptr<Thread> thread) const;
+ virtual std::string serializePayload(std::shared_ptr<Thread> thread) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp
index 1dc97f8..9b9e00d 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp
@@ -34,7 +34,7 @@ class BlockSerializerTest : public CppUnit::TestFixture
void testExample4() {
BlockSerializer<BlockListPayload> testling("blocklist");
- boost::shared_ptr<BlockListPayload> blocklist = boost::make_shared<BlockListPayload>();
+ std::shared_ptr<BlockListPayload> blocklist = std::make_shared<BlockListPayload>();
blocklist->addItem(JID("romeo@montague.net"));
blocklist->addItem(JID("iago@shakespeare.lit"));
@@ -43,7 +43,7 @@ class BlockSerializerTest : public CppUnit::TestFixture
void testExample6() {
BlockSerializer<BlockPayload> testling("block");
- boost::shared_ptr<BlockPayload> block = boost::make_shared<BlockPayload>();
+ std::shared_ptr<BlockPayload> block = std::make_shared<BlockPayload>();
block->addItem(JID("romeo@montague.net"));
CPPUNIT_ASSERT_EQUAL(std::string("<block xmlns=\"urn:xmpp:blocking\"><item jid=\"romeo@montague.net\"/></block>"), testling.serialize(block));
@@ -51,7 +51,7 @@ class BlockSerializerTest : public CppUnit::TestFixture
void testExample10() {
BlockSerializer<UnblockPayload> testling("unblock");
- boost::shared_ptr<UnblockPayload> unblock = boost::make_shared<UnblockPayload>();
+ std::shared_ptr<UnblockPayload> unblock = std::make_shared<UnblockPayload>();
unblock->addItem(JID("romeo@montague.net"));
CPPUNIT_ASSERT_EQUAL(std::string("<unblock xmlns=\"urn:xmpp:blocking\"><item jid=\"romeo@montague.net\"/></unblock>"), testling.serialize(unblock));
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp
index 517e98b..c4e3ad8 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,7 +22,7 @@ class CapsInfoSerializerTest : public CppUnit::TestFixture
void testSerialize() {
CapsInfoSerializer testling;
- boost::shared_ptr<CapsInfo> priority(new CapsInfo("http://swift.im", "myversion", "sha-1"));
+ std::shared_ptr<CapsInfo> priority(new CapsInfo("http://swift.im", "myversion", "sha-1"));
CPPUNIT_ASSERT_EQUAL(std::string("<c hash=\"sha-1\" node=\"http://swift.im\" ver=\"myversion\" xmlns=\"http://jabber.org/protocol/caps\"/>"), testling.serialize(priority));
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/CarbonsSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/CarbonsSerializerTest.cpp
index a0c49a6..9ac8416 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/CarbonsSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/CarbonsSerializerTest.cpp
@@ -43,7 +43,7 @@ class CarbonsSerializerTest : public CppUnit::TestFixture {
void testSerializeExample3() {
CarbonsEnableSerializer testling;
- CPPUNIT_ASSERT_EQUAL(std::string("<enable xmlns=\"urn:xmpp:carbons:2\"/>"), testling.serialize(boost::make_shared<CarbonsEnable>()));
+ CPPUNIT_ASSERT_EQUAL(std::string("<enable xmlns=\"urn:xmpp:carbons:2\"/>"), testling.serialize(std::make_shared<CarbonsEnable>()));
}
/*
@@ -52,7 +52,7 @@ class CarbonsSerializerTest : public CppUnit::TestFixture {
void testSerializeExample6() {
CarbonsDisableSerializer testling;
- CPPUNIT_ASSERT_EQUAL(std::string("<disable xmlns=\"urn:xmpp:carbons:2\"/>"), testling.serialize(boost::make_shared<CarbonsDisable>()));
+ CPPUNIT_ASSERT_EQUAL(std::string("<disable xmlns=\"urn:xmpp:carbons:2\"/>"), testling.serialize(std::make_shared<CarbonsDisable>()));
}
/*
@@ -61,15 +61,15 @@ class CarbonsSerializerTest : public CppUnit::TestFixture {
void testSerializeExample12() {
CarbonsReceivedSerializer testling(&serializers);
- CarbonsReceived::ref received = boost::make_shared<CarbonsReceived>();
+ CarbonsReceived::ref received = std::make_shared<CarbonsReceived>();
- boost::shared_ptr<Forwarded> forwarded = boost::make_shared<Forwarded>();
+ std::shared_ptr<Forwarded> forwarded = std::make_shared<Forwarded>();
- Message::ref message = boost::make_shared<Message>();
+ Message::ref message = std::make_shared<Message>();
message->setFrom(JID("juliet@capulet.example/balcony"));
message->setTo(JID("romeo@montague.example/garden"));
message->setBody("What man art thou that, thus bescreen'd in night, so stumblest on my counsel?");
- message->addPayload(boost::make_shared<Thread>("0e3141cd80894871a68e6fe6b1ec56fa"));
+ message->addPayload(std::make_shared<Thread>("0e3141cd80894871a68e6fe6b1ec56fa"));
forwarded->setStanza(message);
received->setForwarded(forwarded);
@@ -94,15 +94,15 @@ class CarbonsSerializerTest : public CppUnit::TestFixture {
void testSerializeExample14() {
CarbonsSentSerializer testling(&serializers);
- CarbonsSent::ref sent = boost::make_shared<CarbonsSent>();
+ CarbonsSent::ref sent = std::make_shared<CarbonsSent>();
- boost::shared_ptr<Forwarded> forwarded = boost::make_shared<Forwarded>();
+ std::shared_ptr<Forwarded> forwarded = std::make_shared<Forwarded>();
- Message::ref message = boost::make_shared<Message>();
+ Message::ref message = std::make_shared<Message>();
message->setTo(JID("juliet@capulet.example/balcony"));
message->setFrom(JID("romeo@montague.example/home"));
message->setBody("Neither, fair saint, if either thee dislike.");
- message->addPayload(boost::make_shared<Thread>("0e3141cd80894871a68e6fe6b1ec56fa"));
+ message->addPayload(std::make_shared<Thread>("0e3141cd80894871a68e6fe6b1ec56fa"));
forwarded->setStanza(message);
sent->setForwarded(forwarded);
@@ -127,7 +127,7 @@ class CarbonsSerializerTest : public CppUnit::TestFixture {
void testSerializeExample15() {
CarbonsPrivateSerializer testling;
- CPPUNIT_ASSERT_EQUAL(std::string("<private xmlns=\"urn:xmpp:carbons:2\"/>"), testling.serialize(boost::make_shared<CarbonsPrivate>()));
+ CPPUNIT_ASSERT_EQUAL(std::string("<private xmlns=\"urn:xmpp:carbons:2\"/>"), testling.serialize(std::make_shared<CarbonsPrivate>()));
}
private:
FullPayloadSerializerCollection serializers;
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ChatStateSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ChatStateSerializerTest.cpp
index 85b067f..018d2cc 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ChatStateSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ChatStateSerializerTest.cpp
@@ -4,6 +4,12 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -26,27 +32,27 @@ class ChatStateSerializerTest : public CppUnit::TestFixture
ChatStateSerializer testling;
void testSerialize_ActiveState() {
- boost::shared_ptr<ChatState> priority(new ChatState(ChatState::Active));
+ std::shared_ptr<ChatState> priority(new ChatState(ChatState::Active));
CPPUNIT_ASSERT_EQUAL(std::string("<active xmlns=\"http://jabber.org/protocol/chatstates\"/>"), testling.serialize(priority));
}
void testSerialize_GoneState() {
- boost::shared_ptr<ChatState> priority(new ChatState(ChatState::Gone));
+ std::shared_ptr<ChatState> priority(new ChatState(ChatState::Gone));
CPPUNIT_ASSERT_EQUAL(std::string("<gone xmlns=\"http://jabber.org/protocol/chatstates\"/>"), testling.serialize(priority));
}
void testSerialize_ComposingState() {
- boost::shared_ptr<ChatState> priority(new ChatState(ChatState::Composing));
+ std::shared_ptr<ChatState> priority(new ChatState(ChatState::Composing));
CPPUNIT_ASSERT_EQUAL(std::string("<composing xmlns=\"http://jabber.org/protocol/chatstates\"/>"), testling.serialize(priority));
}
void testSerialize_PausedState() {
- boost::shared_ptr<ChatState> priority(new ChatState(ChatState::Paused));
+ std::shared_ptr<ChatState> priority(new ChatState(ChatState::Paused));
CPPUNIT_ASSERT_EQUAL(std::string("<paused xmlns=\"http://jabber.org/protocol/chatstates\"/>"), testling.serialize(priority));
}
void testSerialize_InacativeState() {
- boost::shared_ptr<ChatState> priority(new ChatState(ChatState::Inactive));
+ std::shared_ptr<ChatState> priority(new ChatState(ChatState::Inactive));
CPPUNIT_ASSERT_EQUAL(std::string("<inactive xmlns=\"http://jabber.org/protocol/chatstates\"/>"), testling.serialize(priority));
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp
index bda9ab7..7ed9421 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp
@@ -10,8 +10,7 @@
* See the COPYING file for more information.
*/
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -31,18 +30,18 @@ class DeliveryReceiptSerializerTest : public CppUnit::TestFixture {
void testSerialize_XEP0184Example3() {
std::string expected = "<request xmlns=\"urn:xmpp:receipts\"/>";
- DeliveryReceiptRequest::ref receipt = boost::make_shared<DeliveryReceiptRequest>();
+ DeliveryReceiptRequest::ref receipt = std::make_shared<DeliveryReceiptRequest>();
- boost::shared_ptr<DeliveryReceiptRequestSerializer> serializer = boost::make_shared<DeliveryReceiptRequestSerializer>();
+ std::shared_ptr<DeliveryReceiptRequestSerializer> serializer = std::make_shared<DeliveryReceiptRequestSerializer>();
CPPUNIT_ASSERT_EQUAL(expected, serializer->serializePayload(receipt));
}
void testSerialize_XEP0184Example4() {
std::string expected = "<received id=\"richard2-4.1.247\" xmlns=\"urn:xmpp:receipts\"/>";
- DeliveryReceipt::ref receipt = boost::make_shared<DeliveryReceipt>("richard2-4.1.247");
+ DeliveryReceipt::ref receipt = std::make_shared<DeliveryReceipt>("richard2-4.1.247");
- boost::shared_ptr<DeliveryReceiptSerializer> serializer = boost::make_shared<DeliveryReceiptSerializer>();
+ std::shared_ptr<DeliveryReceiptSerializer> serializer = std::make_shared<DeliveryReceiptSerializer>();
CPPUNIT_ASSERT_EQUAL(expected, serializer->serializePayload(receipt));
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp
index 14b1a34..318c3d7 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/DiscoInfoSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -23,7 +23,7 @@ class DiscoInfoSerializerTest : public CppUnit::TestFixture
void testSerialize() {
DiscoInfoSerializer testling;
- boost::shared_ptr<DiscoInfo> discoInfo(new DiscoInfo());
+ std::shared_ptr<DiscoInfo> discoInfo(new DiscoInfo());
discoInfo->addIdentity(DiscoInfo::Identity("Swift", "client", "pc"));
discoInfo->addIdentity(DiscoInfo::Identity("Vlug", "client", "pc", "nl"));
discoInfo->addFeature("http://jabber.org/protocol/caps");
@@ -43,10 +43,10 @@ class DiscoInfoSerializerTest : public CppUnit::TestFixture
void testSerialize_Form() {
DiscoInfoSerializer testling;
- boost::shared_ptr<DiscoInfo> discoInfo(new DiscoInfo());
+ std::shared_ptr<DiscoInfo> discoInfo(new DiscoInfo());
discoInfo->addFeature("http://jabber.org/protocol/caps");
discoInfo->addFeature("http://jabber.org/protocol/disco#info");
- boost::shared_ptr<Form> form(new Form(Form::FormType));
+ std::shared_ptr<Form> form(new Form(Form::FormType));
form->setTitle("Bot Configuration");
discoInfo->addExtension(form);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp
index 13d9e3c..68a72b8 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ErrorSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -24,15 +24,15 @@ class ErrorSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize() {
ErrorSerializer testling(&serializers);
- boost::shared_ptr<ErrorPayload> error(new ErrorPayload(ErrorPayload::BadRequest, ErrorPayload::Cancel, "My Error"));
+ std::shared_ptr<ErrorPayload> error(new ErrorPayload(ErrorPayload::BadRequest, ErrorPayload::Cancel, "My Error"));
CPPUNIT_ASSERT_EQUAL(std::string("<error type=\"cancel\"><bad-request xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/><text xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">My Error</text></error>"), testling.serialize(error));
}
void testSerialize_Payload() {
ErrorSerializer testling(&serializers);
- boost::shared_ptr<ErrorPayload> error = boost::make_shared<ErrorPayload>();
- error->setPayload(boost::make_shared<Delay>());
+ std::shared_ptr<ErrorPayload> error = std::make_shared<ErrorPayload>();
+ error->setPayload(std::make_shared<Delay>());
CPPUNIT_ASSERT_EQUAL(std::string(
"<error type=\"cancel\"><undefined-condition xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/><delay stamp=\"not-a-date-timeZ\" xmlns=\"urn:xmpp:delay\"/></error>"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp
index 8bd16cd..6534dce 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -22,7 +22,7 @@ class FormSerializerTest : public CppUnit::TestFixture {
public:
void testSerializeFormInformation() {
FormSerializer testling;
- boost::shared_ptr<Form> form(new Form(Form::FormType));
+ std::shared_ptr<Form> form(new Form(Form::FormType));
form->setTitle("Bot Configuration");
form->setInstructions("Hello!\nFill out this form to configure your new bot!");
@@ -36,39 +36,39 @@ class FormSerializerTest : public CppUnit::TestFixture {
void testSerializeLayout() {
FormSerializer testling;
- boost::shared_ptr<Form> form(new Form(Form::FormType));
+ std::shared_ptr<Form> form(new Form(Form::FormType));
- FormPage::page page = boost::make_shared<FormPage>();
+ FormPage::page page = std::make_shared<FormPage>();
page->setLabel("P1");
- FormReportedRef::ref reportedRef = boost::make_shared<FormReportedRef>();
+ FormReportedRef::ref reportedRef = std::make_shared<FormReportedRef>();
page->addReportedRef(reportedRef);
- FormText::text formText = boost::make_shared<FormText>();
+ FormText::text formText = std::make_shared<FormText>();
formText->setTextString("P1T1");
page->addTextElement(formText);
- FormField::ref field = boost::make_shared<FormField>(FormField::TextSingleType);
+ FormField::ref field = std::make_shared<FormField>(FormField::TextSingleType);
field->setName("P1F1");
field->setLabel("field one");
page->addField(field);
- FormSection::section section = boost::make_shared<FormSection>();
+ FormSection::section section = std::make_shared<FormSection>();
section->setLabel("P1S1");
- formText = boost::make_shared<FormText>();
+ formText = std::make_shared<FormText>();
formText->setTextString("P1S1T1");
section->addTextElement(formText);
- field = boost::make_shared<FormField>(FormField::TextSingleType);
+ field = std::make_shared<FormField>(FormField::TextSingleType);
field->setName("P1S1F1");
field->setLabel("field two");
section->addField(field);
page->addChildSection(section);
form->addPage(page);
- page = boost::make_shared<FormPage>();
+ page = std::make_shared<FormPage>();
page->setLabel("P2");
- section = boost::make_shared<FormSection>();
+ section = std::make_shared<FormSection>();
section->setLabel("P2S1");
- FormSection::section subSection = boost::make_shared<FormSection>();
+ FormSection::section subSection = std::make_shared<FormSection>();
subSection->setLabel("P2S2");
- FormSection::section subSection2 = boost::make_shared<FormSection>();
+ FormSection::section subSection2 = std::make_shared<FormSection>();
subSection2->setLabel("P2S3");
subSection->addChildSection(subSection2);
section->addChildSection(subSection);
@@ -101,37 +101,37 @@ class FormSerializerTest : public CppUnit::TestFixture {
void testSerializeFields() {
FormSerializer testling;
- boost::shared_ptr<Form> form(new Form(Form::FormType));
+ std::shared_ptr<Form> form(new Form(Form::FormType));
- FormField::ref field = boost::make_shared<FormField>(FormField::HiddenType, "jabber:bot");
+ FormField::ref field = std::make_shared<FormField>(FormField::HiddenType, "jabber:bot");
field->setName("FORM_TYPE");
form->addField(field);
- form->addField(boost::make_shared<FormField>(FormField::FixedType, "Section 1: Bot Info"));
+ form->addField(std::make_shared<FormField>(FormField::FixedType, "Section 1: Bot Info"));
- field = boost::make_shared<FormField>(FormField::TextSingleType);
+ field = std::make_shared<FormField>(FormField::TextSingleType);
field->setName("botname");
field->setLabel("The name of your bot");
form->addField(field);
- field = boost::make_shared<FormField>(FormField::TextMultiType);
+ field = std::make_shared<FormField>(FormField::TextMultiType);
field->setTextMultiValue("This is a bot.\nA quite good one actually");
field->setName("description");
field->setLabel("Helpful description of your bot");
form->addField(field);
- field = boost::make_shared<FormField>(FormField::BooleanType, "1");
+ field = std::make_shared<FormField>(FormField::BooleanType, "1");
field->setName("public");
field->setLabel("Public bot?");
field->setRequired(true);
form->addField(field);
- field = boost::make_shared<FormField>(FormField::TextPrivateType);
+ field = std::make_shared<FormField>(FormField::TextPrivateType);
field->setName("password");
field->setLabel("Password for special access");
form->addField(field);
- field = boost::make_shared<FormField>(FormField::ListMultiType);
+ field = std::make_shared<FormField>(FormField::ListMultiType);
field->addValue("news");
field->addValue("search");
field->setName("features");
@@ -143,7 +143,7 @@ class FormSerializerTest : public CppUnit::TestFixture {
field->addOption(FormField::Option("Search", "search"));
form->addField(field);
- field = boost::make_shared<FormField>(FormField::ListSingleType, "20");
+ field = std::make_shared<FormField>(FormField::ListSingleType, "20");
field->setName("maxsubs");
field->setLabel("Maximum number of subscribers");
field->addOption(FormField::Option("10", "10"));
@@ -155,7 +155,7 @@ class FormSerializerTest : public CppUnit::TestFixture {
form->addField(field);
std::vector<JID> jids;
- field = boost::make_shared<FormField>(FormField::JIDMultiType);
+ field = std::make_shared<FormField>(FormField::JIDMultiType);
field->addValue("foo@bar.com");
field->addValue("baz@fum.org");
field->setName("invitelist");
@@ -204,64 +204,64 @@ class FormSerializerTest : public CppUnit::TestFixture {
void testSerializeFormItems() {
FormSerializer testling;
- boost::shared_ptr<Form> form(new Form(Form::ResultType));
+ std::shared_ptr<Form> form(new Form(Form::ResultType));
- FormField::ref field = boost::make_shared<FormField>(FormField::HiddenType, "jabber:iq:search");
+ FormField::ref field = std::make_shared<FormField>(FormField::HiddenType, "jabber:iq:search");
field->setName("FORM_TYPE");
form->addField(field);
// reported fields
- field = boost::make_shared<FormField>(FormField::TextSingleType);
+ field = std::make_shared<FormField>(FormField::TextSingleType);
field->setName("first");
field->setLabel("Given Name");
form->addReportedField(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType);
+ field = std::make_shared<FormField>(FormField::TextSingleType);
field->setName("last");
field->setLabel("Family Name");
form->addReportedField(field);
- field = boost::make_shared<FormField>(FormField::JIDSingleType);
+ field = std::make_shared<FormField>(FormField::JIDSingleType);
field->setName("jid");
field->setLabel("Jabber ID");
form->addReportedField(field);
- field = boost::make_shared<FormField>(FormField::ListSingleType);
+ field = std::make_shared<FormField>(FormField::ListSingleType);
field->setName("x-gender");
field->setLabel("Gender");
form->addReportedField(field);
Form::FormItem firstItem;
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Benvolio");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Benvolio");
field->setName("first");
firstItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Montague");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Montague");
field->setName("last");
firstItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::JIDSingleType, JID("benvolio@montague.net"));
+ field = std::make_shared<FormField>(FormField::JIDSingleType, JID("benvolio@montague.net"));
field->setName("jid");
firstItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::ListSingleType, "male");
+ field = std::make_shared<FormField>(FormField::ListSingleType, "male");
field->setName("x-gender");
firstItem.push_back(field);
Form::FormItem secondItem;
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Romeo");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Romeo");
field->setName("first");
secondItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Montague");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Montague");
field->setName("last");
secondItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::JIDSingleType, JID("romeo@montague.net"));
+ field = std::make_shared<FormField>(FormField::JIDSingleType, JID("romeo@montague.net"));
field->setName("jid");
secondItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::ListSingleType, "male");
+ field = std::make_shared<FormField>(FormField::ListSingleType, "male");
field->setName("x-gender");
secondItem.push_back(field);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp
index d7aed26..b0f41d4 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp
@@ -1,10 +1,10 @@
/*
- * Copyright (c) 2014 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -32,11 +32,11 @@ class ForwardedSerializerTest : public CppUnit::TestFixture {
void testSerializeIQ() {
ForwardedSerializer serializer(&serializers);
- boost::shared_ptr<IQ> iq = IQ::createResult(JID("juliet@capulet.lit/balcony"), JID("romeo@montague.lit/orchard"), "id0");
+ std::shared_ptr<IQ> iq = IQ::createResult(JID("juliet@capulet.lit/balcony"), JID("romeo@montague.lit/orchard"), "id0");
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(iq);
- forwarded->setDelay(boost::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
+ forwarded->setDelay(std::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
std::string expectedResult =
"<forwarded xmlns=\"urn:xmpp:forward:0\">"
@@ -50,15 +50,15 @@ class ForwardedSerializerTest : public CppUnit::TestFixture {
void testSerializeMessage() {
ForwardedSerializer serializer(&serializers);
- boost::shared_ptr<Message> message(boost::make_shared<Message>());
+ std::shared_ptr<Message> message(std::make_shared<Message>());
message->setType(Message::Chat);
message->setTo(JID("juliet@capulet.lit/balcony"));
message->setFrom(JID("romeo@montague.lit/orchard"));
message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.");
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(message);
- forwarded->setDelay(boost::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
+ forwarded->setDelay(std::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
std::string expectedResult =
"<forwarded xmlns=\"urn:xmpp:forward:0\">"
@@ -74,13 +74,13 @@ class ForwardedSerializerTest : public CppUnit::TestFixture {
void testSerializeMessageNoDelay() {
ForwardedSerializer serializer(&serializers);
- boost::shared_ptr<Message> message(boost::make_shared<Message>());
+ std::shared_ptr<Message> message(std::make_shared<Message>());
message->setType(Message::Chat);
message->setTo(JID("juliet@capulet.lit/balcony"));
message->setFrom(JID("romeo@montague.lit/orchard"));
message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.");
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(message);
std::string expectedResult =
@@ -96,12 +96,12 @@ class ForwardedSerializerTest : public CppUnit::TestFixture {
void testSerializePresence() {
ForwardedSerializer serializer(&serializers);
- boost::shared_ptr<Presence> presence(boost::make_shared<Presence>());
+ std::shared_ptr<Presence> presence(std::make_shared<Presence>());
presence->setType(Presence::Subscribe);
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(presence);
- forwarded->setDelay(boost::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
+ forwarded->setDelay(std::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
std::string expectedResult =
"<forwarded xmlns=\"urn:xmpp:forward:0\">"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/IBBSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/IBBSerializerTest.cpp
index 45badea..84412c9 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/IBBSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/IBBSerializerTest.cpp
@@ -30,7 +30,7 @@ class IBBSerializerTest : public CppUnit::TestFixture
void testSerialize_data() {
IBBSerializer testling;
- boost::shared_ptr<IBB> ibb = boost::make_shared<IBB>();
+ std::shared_ptr<IBB> ibb = std::make_shared<IBB>();
ibb->setAction(IBB::Data);
ibb->setData(createByteArray("abcdefgihjklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\x0a"));
ibb->setSequenceNumber(4);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp
index 147c7be..46598da 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp
@@ -10,7 +10,7 @@
* See the COPYING file for more information.
*/
-#include <boost/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -29,7 +29,7 @@ class IdleSerializerTest : public CppUnit::TestFixture {
void testSerialize() {
IdleSerializer testling;
- Idle::ref idle = boost::make_shared<Idle>(stringToDateTime("1969-07-21T02:56:15Z"));
+ Idle::ref idle = std::make_shared<Idle>(stringToDateTime("1969-07-21T02:56:15Z"));
CPPUNIT_ASSERT_EQUAL(std::string("<idle xmlns='urn:xmpp:idle:1' since='1969-07-21T02:56:15Z'/>"), testling.serialize(idle));
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp
index b1b0c45..44ac7a1 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -22,7 +22,7 @@ class InBandRegistrationPayloadSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize() {
InBandRegistrationPayloadSerializer testling;
- boost::shared_ptr<InBandRegistrationPayload> registration(new InBandRegistrationPayload());
+ std::shared_ptr<InBandRegistrationPayload> registration(new InBandRegistrationPayload());
registration->setRegistered(true);
std::string expectedResult =
@@ -34,13 +34,13 @@ class InBandRegistrationPayloadSerializerTest : public CppUnit::TestFixture {
}
void testSerialize_Form() {
InBandRegistrationPayloadSerializer testling;
- boost::shared_ptr<InBandRegistrationPayload> registration(new InBandRegistrationPayload());
+ std::shared_ptr<InBandRegistrationPayload> registration(new InBandRegistrationPayload());
registration->setInstructions("Use the enclosed form to register.");
- boost::shared_ptr<Form> form(new Form(Form::FormType));
+ std::shared_ptr<Form> form(new Form(Form::FormType));
form->setTitle("Contest Registration");
- FormField::ref field = boost::make_shared<FormField>(FormField::HiddenType, "jabber:iq:register");
+ FormField::ref field = std::make_shared<FormField>(FormField::HiddenType, "jabber:iq:register");
field->setName("FORM_TYPE");
form->addField(field);
registration->setForm(form);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/IsodeIQDelegationSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/IsodeIQDelegationSerializerTest.cpp
index 8f46ca8..4a466ba 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/IsodeIQDelegationSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/IsodeIQDelegationSerializerTest.cpp
@@ -41,13 +41,13 @@ class IsodeIQDelegationSerializerTest : public CppUnit::TestFixture
void testSerialize_Forwarded_IQ() {
IsodeIQDelegationSerializer testling(&serializers);
- boost::shared_ptr<IsodeIQDelegation> isodeIQDelegation = boost::make_shared<IsodeIQDelegation>();
+ std::shared_ptr<IsodeIQDelegation> isodeIQDelegation = std::make_shared<IsodeIQDelegation>();
- boost::shared_ptr<IQ> iq = IQ::createResult(JID("juliet@capulet.lit/balcony"), JID("romeo@montague.lit/orchard"), "id0", boost::make_shared<Subject>("text"));
+ std::shared_ptr<IQ> iq = IQ::createResult(JID("juliet@capulet.lit/balcony"), JID("romeo@montague.lit/orchard"), "id0", std::make_shared<Subject>("text"));
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(iq);
- forwarded->setDelay(boost::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
+ forwarded->setDelay(std::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
isodeIQDelegation->setForward(forwarded);
CPPUNIT_ASSERT_EQUAL(std::string("<delegate xmlns=\"http://isode.com/iq_delegation\">"
@@ -60,17 +60,17 @@ class IsodeIQDelegationSerializerTest : public CppUnit::TestFixture
void testSerialize_Forwarded_Message() {
IsodeIQDelegationSerializer testling(&serializers);
- boost::shared_ptr<IsodeIQDelegation> isodeIQDelegation = boost::make_shared<IsodeIQDelegation>();
+ std::shared_ptr<IsodeIQDelegation> isodeIQDelegation = std::make_shared<IsodeIQDelegation>();
- boost::shared_ptr<Message> message(boost::make_shared<Message>());
+ std::shared_ptr<Message> message(std::make_shared<Message>());
message->setType(Message::Chat);
message->setTo(JID("juliet@capulet.lit/balcony"));
message->setFrom(JID("romeo@montague.lit/orchard"));
message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.");
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(message);
- forwarded->setDelay(boost::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
+ forwarded->setDelay(std::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
isodeIQDelegation->setForward(forwarded);
CPPUNIT_ASSERT_EQUAL(std::string("<delegate xmlns=\"http://isode.com/iq_delegation\">"
@@ -85,15 +85,15 @@ class IsodeIQDelegationSerializerTest : public CppUnit::TestFixture
void testSerialize_Forwarded_MessageNoDelay() {
IsodeIQDelegationSerializer testling(&serializers);
- boost::shared_ptr<IsodeIQDelegation> isodeIQDelegation = boost::make_shared<IsodeIQDelegation>();
+ std::shared_ptr<IsodeIQDelegation> isodeIQDelegation = std::make_shared<IsodeIQDelegation>();
- boost::shared_ptr<Message> message(boost::make_shared<Message>());
+ std::shared_ptr<Message> message(std::make_shared<Message>());
message->setType(Message::Chat);
message->setTo(JID("juliet@capulet.lit/balcony"));
message->setFrom(JID("romeo@montague.lit/orchard"));
message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.");
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(message);
isodeIQDelegation->setForward(forwarded);
@@ -108,14 +108,14 @@ class IsodeIQDelegationSerializerTest : public CppUnit::TestFixture
void testSerialize_Forwarded_Presence() {
IsodeIQDelegationSerializer testling(&serializers);
- boost::shared_ptr<IsodeIQDelegation> isodeIQDelegation = boost::make_shared<IsodeIQDelegation>();
+ std::shared_ptr<IsodeIQDelegation> isodeIQDelegation = std::make_shared<IsodeIQDelegation>();
- boost::shared_ptr<Presence> presence(boost::make_shared<Presence>());
+ std::shared_ptr<Presence> presence(std::make_shared<Presence>());
presence->setType(Presence::Subscribe);
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(presence);
- forwarded->setDelay(boost::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
+ forwarded->setDelay(std::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
isodeIQDelegation->setForward(forwarded);
CPPUNIT_ASSERT_EQUAL(std::string("<delegate xmlns=\"http://isode.com/iq_delegation\">"
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
index ecb68cd..00d79b3 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
@@ -10,8 +10,7 @@
* See the COPYING file for more information.
*/
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -49,8 +48,8 @@ class JingleSerializersTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE_END();
- boost::shared_ptr<JinglePayloadSerializer> createTestling() {
- return boost::make_shared<JinglePayloadSerializer>(&collection);
+ std::shared_ptr<JinglePayloadSerializer> createTestling() {
+ return std::make_shared<JinglePayloadSerializer>(&collection);
}
@@ -66,7 +65,7 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"<range/>"
"</file>";
- StreamInitiationFileInfo::ref fileInfo = boost::make_shared<StreamInitiationFileInfo>();
+ StreamInitiationFileInfo::ref fileInfo = std::make_shared<StreamInitiationFileInfo>();
fileInfo->setDate(stringToDateTime("1969-07-21T02:56:15Z"));
fileInfo->setHash("552da749930852c69ae5d2141d3766b1");
fileInfo->setSize(1022);
@@ -74,7 +73,7 @@ class JingleSerializersTest : public CppUnit::TestFixture {
fileInfo->setDescription("This is a test. If this were a real file...");
fileInfo->setSupportsRangeRequests(true);
- boost::shared_ptr<StreamInitiationFileInfoSerializer> serializer = boost::make_shared<StreamInitiationFileInfoSerializer>();
+ std::shared_ptr<StreamInitiationFileInfoSerializer> serializer = std::make_shared<StreamInitiationFileInfoSerializer>();
CPPUNIT_ASSERT_EQUAL(expected, serializer->serializePayload(fileInfo));
}
@@ -84,12 +83,12 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"<range offset=\"270336\"/>"
"</file>";
- StreamInitiationFileInfo::ref fileInfo = boost::make_shared<StreamInitiationFileInfo>();
+ StreamInitiationFileInfo::ref fileInfo = std::make_shared<StreamInitiationFileInfo>();
fileInfo->setHash("552da749930852c69ae5d2141d3766b1");
fileInfo->setSupportsRangeRequests(true);
fileInfo->setRangeOffset(270336);
- boost::shared_ptr<StreamInitiationFileInfoSerializer> serializer = boost::make_shared<StreamInitiationFileInfoSerializer>();
+ std::shared_ptr<StreamInitiationFileInfoSerializer> serializer = std::make_shared<StreamInitiationFileInfoSerializer>();
CPPUNIT_ASSERT_EQUAL(expected, serializer->serializePayload(fileInfo));
}
@@ -110,16 +109,16 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"</content>"
"</jingle>";
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setAction(JinglePayload::SessionInitiate);
payload->setSessionID("a73sjjvkla37jfea");
payload->setInitiator(JID("romeo@montague.lit/orchard"));
- JingleIBBTransportPayload::ref transport = boost::make_shared<JingleIBBTransportPayload>();
+ JingleIBBTransportPayload::ref transport = std::make_shared<JingleIBBTransportPayload>();
transport->setBlockSize(4096);
transport->setSessionID("ch3d9s71");
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(JingleContentPayload::InitiatorCreator);
content->setName("ex");
content->addTransport(transport);
@@ -143,16 +142,16 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"</content>"
"</jingle>";
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setAction(JinglePayload::TransportInfo);
payload->setInitiator(JID("romeo@montague.lit/orchard"));
payload->setSessionID("a73sjjvkla37jfea");
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(JingleContentPayload::InitiatorCreator);
content->setName("ex");
- JingleIBBTransportPayload::ref transport = boost::make_shared<JingleIBBTransportPayload>();
+ JingleIBBTransportPayload::ref transport = std::make_shared<JingleIBBTransportPayload>();
transport->setBlockSize(2048);
transport->setSessionID("bt8a71h6");
@@ -172,7 +171,7 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"<reason><success/></reason>"
"</jingle>";
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setAction(JinglePayload::SessionTerminate);
payload->setInitiator(JID("romeo@montague.lit/orchard"));
payload->setSessionID("a73sjjvkla37jfea");
@@ -193,7 +192,7 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"<hash algo=\"sha-1\" xmlns=\"urn:xmpp:hashes:1\">VS2nSZMIUsaa5dIUHTdmsQ==</hash>"
"</file>"
"</description>";
- JingleFileTransferDescription::ref desc = boost::make_shared<JingleFileTransferDescription>();
+ JingleFileTransferDescription::ref desc = std::make_shared<JingleFileTransferDescription>();
JingleFileTransferFileInfo fileInfo;
fileInfo.setDate(stringToDateTime("1969-07-21T02:56:15Z"));
@@ -205,7 +204,7 @@ class JingleSerializersTest : public CppUnit::TestFixture {
desc->setFileInfo(fileInfo);
- CPPUNIT_ASSERT_EQUAL(expected, boost::make_shared<JingleFileTransferDescriptionSerializer>()->serialize(desc));
+ CPPUNIT_ASSERT_EQUAL(expected, std::make_shared<JingleFileTransferDescriptionSerializer>()->serialize(desc));
}
// http://xmpp.org/extensions/xep-0234.html#example-3
@@ -251,16 +250,16 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"</content>"
"</jingle>";
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setAction(JinglePayload::SessionAccept);
payload->setInitiator(JID("romeo@montague.lit/orchard"));
payload->setSessionID("851ba2");
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(JingleContentPayload::InitiatorCreator);
content->setName("a-file-offer");
- JingleFileTransferDescription::ref description = boost::make_shared<JingleFileTransferDescription>();
+ JingleFileTransferDescription::ref description = std::make_shared<JingleFileTransferDescription>();
JingleFileTransferFileInfo fileInfo;
fileInfo.setName("test.txt");
fileInfo.setSize(1022);
@@ -293,12 +292,12 @@ class JingleSerializersTest : public CppUnit::TestFixture {
//"</content>"
"</jingle>";
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setAction(JinglePayload::TransportInfo);
payload->setInitiator(JID("romeo@montague.lit/orchard"));
payload->setSessionID("a73sjjvkla37jfea");
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(JingleContentPayload::InitiatorCreator);
content->setName("ex");
payload->addPayload(content);
@@ -321,12 +320,12 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"</checksum>"
"</jingle>";
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setAction(JinglePayload::SessionInfo);
payload->setInitiator(JID("romeo@montague.lit/orchard"));
payload->setSessionID("a73sjjvkla37jfea");
- JingleFileTransferHash::ref hash = boost::make_shared<JingleFileTransferHash>();
+ JingleFileTransferHash::ref hash = std::make_shared<JingleFileTransferHash>();
hash->getFileInfo().addHash(HashElement("sha-1", Base64::decode("VS2nSZMIUsaa5dIUHTdmsQ==")));
payload->addPayload(hash);
@@ -364,16 +363,16 @@ class JingleSerializersTest : public CppUnit::TestFixture {
"</content>"
"</jingle>";
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
+ JinglePayload::ref payload = std::make_shared<JinglePayload>();
payload->setAction(JinglePayload::SessionInitiate);
payload->setInitiator(JID("romeo@montague.lit/orchard"));
payload->setSessionID("a73sjjvkla37jfea");
- JingleContentPayload::ref content = boost::make_shared<JingleContentPayload>();
+ JingleContentPayload::ref content = std::make_shared<JingleContentPayload>();
content->setCreator(JingleContentPayload::InitiatorCreator);
content->setName("ex");
- JingleS5BTransportPayload::ref transport = boost::make_shared<JingleS5BTransportPayload>();
+ JingleS5BTransportPayload::ref transport = std::make_shared<JingleS5BTransportPayload>();
transport->setMode(JingleS5BTransportPayload::TCPMode);
transport->setDstAddr("1a12fb7bc625e55f3ed5b29a53dbe0e4aa7d80ba");
transport->setSessionID("vj3hs98y");
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMFinSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMFinSerializerTest.cpp
index 0eda01c..198f73c 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMFinSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMFinSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -24,7 +24,7 @@ class MAMFinSerializerTest : public CppUnit::TestFixture {
void testSerialize_XEP0313_Exmaple1() {
MAMFinSerializer serializer;
- boost::shared_ptr<MAMFin> fin = boost::make_shared<MAMFin>();
+ std::shared_ptr<MAMFin> fin = std::make_shared<MAMFin>();
fin->setQueryID("f27");
std::string expectedResult =
@@ -35,10 +35,10 @@ class MAMFinSerializerTest : public CppUnit::TestFixture {
void testSerialize_XEP0313_Exmaple9() {
MAMFinSerializer serializer;
- boost::shared_ptr<MAMFin> fin = boost::make_shared<MAMFin>();
+ std::shared_ptr<MAMFin> fin = std::make_shared<MAMFin>();
fin->setComplete(true);
- boost::shared_ptr<ResultSet> set = boost::make_shared<ResultSet>();
+ std::shared_ptr<ResultSet> set = std::make_shared<ResultSet>();
set->setFirstID(std::string("23452-4534-1"));
set->setFirstIDIndex(0);
set->setLastID(std::string("390-2342-22"));
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp
index faf788d..cc46ef9 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -27,22 +27,22 @@ class MAMQuerySerializerTest : public CppUnit::TestFixture {
void testSerialize() {
MAMQuerySerializer serializer;
- boost::shared_ptr<Form> parameters(boost::make_shared<Form>());
+ std::shared_ptr<Form> parameters(std::make_shared<Form>());
- boost::shared_ptr<FormField> fieldType = boost::make_shared<FormField>(FormField::TextSingleType);
+ std::shared_ptr<FormField> fieldType = std::make_shared<FormField>(FormField::TextSingleType);
fieldType->setName("FORM_TYPE");
fieldType->addValue("urn:xmpp:mam:0");
parameters->addField(fieldType);
- boost::shared_ptr<FormField> fieldStart = boost::make_shared<FormField>(FormField::TextSingleType);
+ std::shared_ptr<FormField> fieldStart = std::make_shared<FormField>(FormField::TextSingleType);
fieldStart->setName("start");
fieldStart->addValue("2010-08-07T00:00:00Z");
parameters->addField(fieldStart);
- boost::shared_ptr<ResultSet> set = boost::make_shared<ResultSet>();
+ std::shared_ptr<ResultSet> set = std::make_shared<ResultSet>();
set->setMaxItems(10);
- boost::shared_ptr<MAMQuery> query(boost::make_shared<MAMQuery>());
+ std::shared_ptr<MAMQuery> query(std::make_shared<MAMQuery>());
query->setQueryID(std::string("id0"));
query->setNode(std::string("node1"));
query->setForm(parameters);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp
index 40ca27d..09bec39 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -27,17 +27,17 @@ class MAMResultSerializerTest : public CppUnit::TestFixture {
void testSerialize() {
MAMResultSerializer serializer(&serializers);
- boost::shared_ptr<Message> message(boost::make_shared<Message>());
+ std::shared_ptr<Message> message(std::make_shared<Message>());
message->setType(Message::Chat);
message->setTo(JID("juliet@capulet.lit/balcony"));
message->setFrom(JID("romeo@montague.lit/orchard"));
message->setBody("Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.");
- boost::shared_ptr<Forwarded> forwarded(boost::make_shared<Forwarded>());
+ std::shared_ptr<Forwarded> forwarded(std::make_shared<Forwarded>());
forwarded->setStanza(message);
- forwarded->setDelay(boost::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
+ forwarded->setDelay(std::make_shared<Delay>(stringToDateTime(std::string("2010-07-10T23:08:25Z"))));
- boost::shared_ptr<MAMResult> result(boost::make_shared<MAMResult>());
+ std::shared_ptr<MAMResult> result(std::make_shared<MAMResult>());
result->setID("28482-98726-73623");
result->setQueryID(std::string("f27"));
result->setPayload(forwarded);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/MUCAdminPayloadSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/MUCAdminPayloadSerializerTest.cpp
index fc6b346..5aeb9dd 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/MUCAdminPayloadSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/MUCAdminPayloadSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -24,7 +24,7 @@ class MUCAdminPayloadSerializerTest : public CppUnit::TestFixture
void testSerialize() {
MUCAdminPayloadSerializer testling;
- boost::shared_ptr<MUCAdminPayload> admin = boost::make_shared<MUCAdminPayload>();
+ std::shared_ptr<MUCAdminPayload> admin = std::make_shared<MUCAdminPayload>();
MUCItem item;
item.affiliation = MUCOccupant::Owner;
item.role = MUCOccupant::Visitor;
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp
index 223e7d9..d34ea38 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -12,7 +12,7 @@
namespace Swift {
-std::string PayloadsSerializer::serialize(boost::shared_ptr<Payload> payload) {
+std::string PayloadsSerializer::serialize(std::shared_ptr<Payload> payload) {
PayloadSerializer* serializer = serializers.getPayloadSerializer(payload);
if (serializer) {
return serializer->serialize(payload);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h
index 827e9da..5e0f0c5 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.h
@@ -6,17 +6,16 @@
#pragma once
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Elements/Payload.h>
#include <Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h>
namespace Swift {
class PayloadsSerializer {
public:
- std::string serialize(boost::shared_ptr<Payload> payload);
+ std::string serialize(std::shared_ptr<Payload> payload);
private:
FullPayloadSerializerCollection serializers;
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp
index 19971c2..87d7d0f 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PrioritySerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,7 +22,7 @@ class PrioritySerializerTest : public CppUnit::TestFixture
void testSerialize() {
PrioritySerializer testling;
- boost::shared_ptr<Priority> priority(new Priority(-113));
+ std::shared_ptr<Priority> priority(new Priority(-113));
CPPUNIT_ASSERT_EQUAL(std::string("<priority>-113</priority>"), testling.serialize(priority));
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp
index 3b115b3..4e77e7d 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PrivateStorageSerializerTest.cpp
@@ -24,8 +24,8 @@ class PrivateStorageSerializerTest : public CppUnit::TestFixture {
void testSerialize() {
PayloadsSerializer serializer;
- boost::shared_ptr<PrivateStorage> privateStorage(new PrivateStorage());
- boost::shared_ptr<Storage> storage(new Storage());
+ std::shared_ptr<PrivateStorage> privateStorage(new PrivateStorage());
+ std::shared_ptr<Storage> storage(new Storage());
Storage::Room room;
room.name = "Swift";
room.jid = JID("swift@rooms.swift.im");
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp
index b835421..e8673b9 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -26,10 +26,10 @@ class PubSubItemSerializerTest : public CppUnit::TestFixture {
void testSerialize() {
PubSubItemSerializer serializer(&serializers);
- boost::shared_ptr<RawXMLPayload> payload(boost::make_shared<RawXMLPayload>());
+ std::shared_ptr<RawXMLPayload> payload(std::make_shared<RawXMLPayload>());
payload->setRawXML("<payload xmlns=\"tmp\"/>");
- boost::shared_ptr<PubSubItem> item(boost::make_shared<PubSubItem>());
+ std::shared_ptr<PubSubItem> item(std::make_shared<PubSubItem>());
item->addData(payload);
item->setID("pubsub-item-1");
@@ -44,7 +44,7 @@ class PubSubItemSerializerTest : public CppUnit::TestFixture {
void testSerializeEmptyID() {
PubSubItemSerializer serializer(&serializers);
- boost::shared_ptr<PubSubItem> item(boost::make_shared<PubSubItem>());
+ std::shared_ptr<PubSubItem> item(std::make_shared<PubSubItem>());
std::string expectedResult =
"<item xmlns=\"http://jabber.org/protocol/pubsub\"/>";
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp
index fa99202..0194553 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -26,21 +26,21 @@ class PubSubItemsSerializerTest : public CppUnit::TestFixture {
void testSerialize() {
PubSubItemsSerializer serializer(&serializers);
- boost::shared_ptr<RawXMLPayload> payload1(boost::make_shared<RawXMLPayload>());
+ std::shared_ptr<RawXMLPayload> payload1(std::make_shared<RawXMLPayload>());
payload1->setRawXML("<payload xmlns=\"tmp\"/>");
- boost::shared_ptr<PubSubItem> item1(boost::make_shared<PubSubItem>());
+ std::shared_ptr<PubSubItem> item1(std::make_shared<PubSubItem>());
item1->addData(payload1);
item1->setID("pubsub-item-1");
- boost::shared_ptr<RawXMLPayload> payload2(boost::make_shared<RawXMLPayload>());
+ std::shared_ptr<RawXMLPayload> payload2(std::make_shared<RawXMLPayload>());
payload2->setRawXML("<payload xmlns=\"other-tmp\"/>");
- boost::shared_ptr<PubSubItem> item2(boost::make_shared<PubSubItem>());
+ std::shared_ptr<PubSubItem> item2(std::make_shared<PubSubItem>());
item2->addData(payload2);
item2->setID("pubsub-item-2");
- boost::shared_ptr<PubSubItems> items(boost::make_shared<PubSubItems>());
+ std::shared_ptr<PubSubItems> items(std::make_shared<PubSubItems>());
items->setNode("test-node");
items->setSubscriptionID(std::string("sub-id"));
items->addItem(item1);
@@ -62,7 +62,7 @@ class PubSubItemsSerializerTest : public CppUnit::TestFixture {
void testSerializeEmptyItems() {
PubSubItemsSerializer serializer(&serializers);
- boost::shared_ptr<PubSubItems> items(boost::make_shared<PubSubItems>());
+ std::shared_ptr<PubSubItems> items(std::make_shared<PubSubItems>());
std::string expectedResult =
"<items node=\"\" xmlns=\"http://jabber.org/protocol/pubsub\"/>";
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ReplaceSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ReplaceSerializerTest.cpp
index 1f40b26..4aab334 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ReplaceSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ReplaceSerializerTest.cpp
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2012 Isode Limited.
+ * Copyright (c) 2012-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -27,7 +27,7 @@ class ReplaceSerializerTest: public CppUnit::TestFixture {
void testSerialize() {
ReplaceSerializer testling;
- boost::shared_ptr<Replace> replace(new Replace());
+ std::shared_ptr<Replace> replace(new Replace());
replace->setID("bad1");
CPPUNIT_ASSERT_EQUAL(std::string("<replace id = 'bad1' xmlns='urn:xmpp:message-correct:0'/>"), testling.serialize(replace));
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp
index 9bc637f..30cd6e7 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ResourceBindSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -24,7 +24,7 @@ class ResourceBindSerializerTest : public CppUnit::TestFixture
void testSerialize_JID() {
ResourceBindSerializer testling;
- boost::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
+ std::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
resourceBind->setJID(JID("somenode@example.com/someresource"));
CPPUNIT_ASSERT_EQUAL(std::string(
@@ -35,7 +35,7 @@ class ResourceBindSerializerTest : public CppUnit::TestFixture
void testSerialize_Resource() {
ResourceBindSerializer testling;
- boost::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
+ std::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
resourceBind->setResource("someresource");
CPPUNIT_ASSERT_EQUAL(std::string(
@@ -46,7 +46,7 @@ class ResourceBindSerializerTest : public CppUnit::TestFixture
void testSerialize_Empty() {
ResourceBindSerializer testling;
- boost::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
+ std::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
CPPUNIT_ASSERT_EQUAL(std::string("<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"/>"), testling.serialize(resourceBind));
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp
index 0b0163e..fecd3c5 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -28,7 +28,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture {
void testSerializeFull() {
ResultSetSerializer serializer;
- boost::shared_ptr<ResultSet> resultSet(boost::make_shared<ResultSet>());
+ std::shared_ptr<ResultSet> resultSet(std::make_shared<ResultSet>());
resultSet->setMaxItems(100);
resultSet->setCount(800);
@@ -56,7 +56,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture {
void testSerializeMaxItems() {
ResultSetSerializer serializer;
- boost::shared_ptr<ResultSet> resultSet(boost::make_shared<ResultSet>());
+ std::shared_ptr<ResultSet> resultSet(std::make_shared<ResultSet>());
resultSet->setMaxItems(100);
@@ -71,7 +71,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture {
void testSerializeEmptyBefore() {
ResultSetSerializer serializer;
- boost::shared_ptr<ResultSet> resultSet(boost::make_shared<ResultSet>());
+ std::shared_ptr<ResultSet> resultSet(std::make_shared<ResultSet>());
resultSet->setBefore(std::string());
@@ -86,7 +86,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture {
void testSerializeFirst() {
ResultSetSerializer serializer;
- boost::shared_ptr<ResultSet> resultSet(boost::make_shared<ResultSet>());
+ std::shared_ptr<ResultSet> resultSet(std::make_shared<ResultSet>());
resultSet->setFirstID(std::string("stpeter@jabber.org"));
@@ -101,7 +101,7 @@ class ResultSetSerializerTest : public CppUnit::TestFixture {
void testSerializeFirstWithIndex() {
ResultSetSerializer serializer;
- boost::shared_ptr<ResultSet> resultSet(boost::make_shared<ResultSet>());
+ std::shared_ptr<ResultSet> resultSet(std::make_shared<ResultSet>());
resultSet->setFirstID(std::string("stpeter@jabber.org"));
resultSet->setFirstIDIndex(123);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterItemExchangeSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterItemExchangeSerializerTest.cpp
index 65922f7..652becb 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterItemExchangeSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterItemExchangeSerializerTest.cpp
@@ -4,6 +4,12 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -22,7 +28,7 @@ class RosterItemExchangeSerializerTest : public CppUnit::TestFixture
void testSerialize() {
RosterItemExchangeSerializer testling;
- boost::shared_ptr<RosterItemExchangePayload> roster(new RosterItemExchangePayload());
+ std::shared_ptr<RosterItemExchangePayload> roster(new RosterItemExchangePayload());
RosterItemExchangePayload::Item item1;
item1.setJID("foo@bar.com");
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp
index 6670bb8..0c576d2 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,7 +22,7 @@ class RosterSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize() {
RosterSerializer testling;
- boost::shared_ptr<RosterPayload> roster(new RosterPayload());
+ std::shared_ptr<RosterPayload> roster(new RosterPayload());
RosterItemPayload item1;
item1.setJID(JID("foo@bar.com"));
@@ -52,7 +52,7 @@ class RosterSerializerTest : public CppUnit::TestFixture {
void testSerialize_ItemWithUnknownContent() {
RosterSerializer testling;
- boost::shared_ptr<RosterPayload> roster(new RosterPayload());
+ std::shared_ptr<RosterPayload> roster(new RosterPayload());
RosterItemPayload item;
item.setJID(JID("baz@blo.com"));
@@ -79,7 +79,7 @@ class RosterSerializerTest : public CppUnit::TestFixture {
void testSerialize_WithVersion() {
RosterSerializer testling;
- boost::shared_ptr<RosterPayload> roster(new RosterPayload());
+ std::shared_ptr<RosterPayload> roster(new RosterPayload());
roster->setVersion("ver20");
std::string expectedResult = "<query ver=\"ver20\" xmlns=\"jabber:iq:roster\"/>";
@@ -89,7 +89,7 @@ class RosterSerializerTest : public CppUnit::TestFixture {
void testSerialize_WithEmptyVersion() {
RosterSerializer testling;
- boost::shared_ptr<RosterPayload> roster(new RosterPayload());
+ std::shared_ptr<RosterPayload> roster(new RosterPayload());
roster->setVersion("");
std::string expectedResult = "<query ver=\"\" xmlns=\"jabber:iq:roster\"/>";
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp
index 0dfe0b0..3deca11 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SearchPayloadSerializerTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -78,64 +78,64 @@ class SearchPayloadSerializerTest : public CppUnit::TestFixture {
SearchPayloadSerializer testling;
SearchPayload::ref payload(new SearchPayload());
- boost::shared_ptr<Form> form(new Form(Form::ResultType));
+ std::shared_ptr<Form> form(new Form(Form::ResultType));
- FormField::ref field = boost::make_shared<FormField>(FormField::HiddenType, "jabber:iq:search");
+ FormField::ref field = std::make_shared<FormField>(FormField::HiddenType, "jabber:iq:search");
field->setName("FORM_TYPE");
form->addField(field);
// reported fields
- field = boost::make_shared<FormField>(FormField::TextSingleType);
+ field = std::make_shared<FormField>(FormField::TextSingleType);
field->setName("first");
field->setLabel("Given Name");
form->addReportedField(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType);
+ field = std::make_shared<FormField>(FormField::TextSingleType);
field->setName("last");
field->setLabel("Family Name");
form->addReportedField(field);
- field = boost::make_shared<FormField>(FormField::JIDSingleType);
+ field = std::make_shared<FormField>(FormField::JIDSingleType);
field->setName("jid");
field->setLabel("Jabber ID");
form->addReportedField(field);
- field = boost::make_shared<FormField>(FormField::ListSingleType);
+ field = std::make_shared<FormField>(FormField::ListSingleType);
field->setName("x-gender");
field->setLabel("Gender");
form->addReportedField(field);
Form::FormItem firstItem;
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Benvolio");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Benvolio");
field->setName("first");
firstItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Montague");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Montague");
field->setName("last");
firstItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "benvolio@montague.net");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "benvolio@montague.net");
field->setName("jid");
firstItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::ListSingleType, "male");
+ field = std::make_shared<FormField>(FormField::ListSingleType, "male");
field->setName("x-gender");
firstItem.push_back(field);
Form::FormItem secondItem;
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Romeo");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Romeo");
field->setName("first");
secondItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "Montague");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "Montague");
field->setName("last");
secondItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::TextSingleType, "romeo@montague.net");
+ field = std::make_shared<FormField>(FormField::TextSingleType, "romeo@montague.net");
field->setName("jid");
secondItem.push_back(field);
- field = boost::make_shared<FormField>(FormField::ListSingleType, "male");
+ field = std::make_shared<FormField>(FormField::ListSingleType, "male");
field->setName("x-gender");
secondItem.push_back(field);
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp
index db482ff..6b65fd4 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -20,7 +20,7 @@ class SecurityLabelSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize() {
SecurityLabelSerializer testling;
- boost::shared_ptr<SecurityLabel> securityLabel(new SecurityLabel());
+ std::shared_ptr<SecurityLabel> securityLabel(new SecurityLabel());
securityLabel->setDisplayMarking("SECRET");
securityLabel->setForegroundColor("black");
securityLabel->setBackgroundColor("red");
@@ -45,7 +45,7 @@ class SecurityLabelSerializerTest : public CppUnit::TestFixture {
void testSerialize_EmptyLabel() {
SecurityLabelSerializer testling;
- boost::shared_ptr<SecurityLabel> securityLabel(new SecurityLabel());
+ std::shared_ptr<SecurityLabel> securityLabel(new SecurityLabel());
securityLabel->setDisplayMarking("SECRET");
securityLabel->setLabel("");
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp
index 51c98c1..c3a72a5 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SecurityLabelsCatalogSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,13 +22,13 @@ class SecurityLabelsCatalogSerializerTest : public CppUnit::TestFixture
void testSerialize() {
SecurityLabelsCatalogSerializer testling;
- boost::shared_ptr<SecurityLabelsCatalog> catalog(new SecurityLabelsCatalog());
+ std::shared_ptr<SecurityLabelsCatalog> catalog(new SecurityLabelsCatalog());
catalog->setTo(JID("example.com"));
catalog->setName("Default");
catalog->setDescription("an example set of labels");
SecurityLabelsCatalog::Item item1;
- boost::shared_ptr<SecurityLabel> securityLabel1(new SecurityLabel());
+ std::shared_ptr<SecurityLabel> securityLabel1(new SecurityLabel());
item1.setLabel(securityLabel1);
securityLabel1->setDisplayMarking("SECRET");
securityLabel1->setForegroundColor("black");
@@ -39,7 +39,7 @@ class SecurityLabelsCatalogSerializerTest : public CppUnit::TestFixture
catalog->addItem(item1);
SecurityLabelsCatalog::Item item2;
- boost::shared_ptr<SecurityLabel> securityLabel2(new SecurityLabel());
+ std::shared_ptr<SecurityLabel> securityLabel2(new SecurityLabel());
item2.setLabel(securityLabel2);
securityLabel2->setDisplayMarking("CONFIDENTIAL");
securityLabel2->setForegroundColor("black");
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp
index 5643e1e..a20efb7 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/SoftwareVersionSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,7 +22,7 @@ class SoftwareVersionSerializerTest : public CppUnit::TestFixture
void testSerialize() {
SoftwareVersionSerializer testling;
- boost::shared_ptr<SoftwareVersion> softwareVersion(new SoftwareVersion("Swift", "0.1", "Mac OS X"));
+ std::shared_ptr<SoftwareVersion> softwareVersion(new SoftwareVersion("Swift", "0.1", "Mac OS X"));
CPPUNIT_ASSERT_EQUAL(std::string("<query xmlns=\"jabber:iq:version\"><name>Swift</name><version>0.1</version><os>Mac OS X</os></query>"), testling.serialize(softwareVersion));
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp
index c8c2156..03a3ef5 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,7 +22,7 @@ class StatusSerializerTest : public CppUnit::TestFixture
void testSerialize() {
StatusSerializer testling;
- boost::shared_ptr<Status> status(new Status("I am away"));
+ std::shared_ptr<Status> status(new Status("I am away"));
CPPUNIT_ASSERT_EQUAL(std::string("<status>I am away</status>"), testling.serialize(status));
}
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp
index 9fda49e..eb3b221 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StatusShowSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -26,37 +26,37 @@ class StatusShowSerializerTest : public CppUnit::TestFixture
void testSerialize_Online() {
StatusShowSerializer testling;
- boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::Online));
+ std::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::Online));
CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(statusShow));
}
void testSerialize_Away() {
StatusShowSerializer testling;
- boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::Away));
+ std::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::Away));
CPPUNIT_ASSERT_EQUAL(std::string("<show>away</show>"), testling.serialize(statusShow));
}
void testSerialize_FFC() {
StatusShowSerializer testling;
- boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::FFC));
+ std::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::FFC));
CPPUNIT_ASSERT_EQUAL(std::string("<show>chat</show>"), testling.serialize(statusShow));
}
void testSerialize_XA() {
StatusShowSerializer testling;
- boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::XA));
+ std::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::XA));
CPPUNIT_ASSERT_EQUAL(std::string("<show>xa</show>"), testling.serialize(statusShow));
}
void testSerialize_DND() {
StatusShowSerializer testling;
- boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::DND));
+ std::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::DND));
CPPUNIT_ASSERT_EQUAL(std::string("<show>dnd</show>"), testling.serialize(statusShow));
}
void testSerialize_None() {
StatusShowSerializer testling;
- boost::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::None));
+ std::shared_ptr<StatusShow> statusShow(new StatusShow(StatusShow::None));
CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(statusShow));
}
};
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp
index e98ee3a..33c63cb 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StorageSerializerTest.cpp
@@ -23,7 +23,7 @@ class StorageSerializerTest : public CppUnit::TestFixture {
void testSerialize() {
PayloadsSerializer serializer;
- boost::shared_ptr<Storage> storage(new Storage());
+ std::shared_ptr<Storage> storage(new Storage());
Storage::Room room;
room.name = "Council of Oberon";
room.autoJoin = true;
@@ -51,7 +51,7 @@ class StorageSerializerTest : public CppUnit::TestFixture {
void testSerialize_NoNickOrPassword() {
PayloadsSerializer serializer;
- boost::shared_ptr<Storage> storage(new Storage());
+ std::shared_ptr<Storage> storage(new Storage());
Storage::Room room;
room.name = "Council of Oberon";
room.autoJoin = true;
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp
index ada65a9..a38295c 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/StreamInitiationSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -20,7 +20,7 @@ class StreamInitiationSerializerTest : public CppUnit::TestFixture{
public:
void testSerialize_Request() {
StreamInitiationSerializer testling;
- boost::shared_ptr<StreamInitiation> streamInitiation(new StreamInitiation());
+ std::shared_ptr<StreamInitiation> streamInitiation(new StreamInitiation());
StreamInitiationFileInfo fileInfo("test.txt", "This is info about the file.", 1022);
streamInitiation->setID("a0");
streamInitiation->setFileInfo(fileInfo);
@@ -48,7 +48,7 @@ class StreamInitiationSerializerTest : public CppUnit::TestFixture{
void testSerialize_Response() {
StreamInitiationSerializer testling;
- boost::shared_ptr<StreamInitiation> streamInitiation(new StreamInitiation());
+ std::shared_ptr<StreamInitiation> streamInitiation(new StreamInitiation());
streamInitiation->setRequestedMethod("http://jabber.org/protocol/bytestreams");
CPPUNIT_ASSERT_EQUAL(std::string(
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/UserLocationSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/UserLocationSerializerTest.cpp
index 3aed450..4c2121f 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/UserLocationSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/UserLocationSerializerTest.cpp
@@ -10,7 +10,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -31,7 +31,7 @@ class UserLocationSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize_withAllVariablesSet() {
UserLocationSerializer testling(&serializers);
- boost::shared_ptr<UserLocation> userLocation(new UserLocation());
+ std::shared_ptr<UserLocation> userLocation(new UserLocation());
userLocation->setArea(boost::optional<std::string>("Barbaric"));
userLocation->setAltitude(5.75F);
userLocation->setLocality(boost::optional<std::string>("Near"));
@@ -70,7 +70,7 @@ class UserLocationSerializerTest : public CppUnit::TestFixture {
void testSerialize_withSomeVariablesSet() {
UserLocationSerializer testling(&serializers);
- boost::shared_ptr<UserLocation> userLocation(new UserLocation());
+ std::shared_ptr<UserLocation> userLocation(new UserLocation());
userLocation->setArea(boost::optional<std::string>("Barbaric"));
userLocation->setAltitude(5.75F);
userLocation->setLocality(boost::optional<std::string>("Near"));
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/UserTuneSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/UserTuneSerializerTest.cpp
index 50f2a54..df79f0d 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/UserTuneSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/UserTuneSerializerTest.cpp
@@ -10,7 +10,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -31,7 +31,7 @@ class UserTuneSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize_withAllVariablesSet() {
UserTuneSerializer testling(&serializers);
- boost::shared_ptr<UserTune> userTune(new UserTune());
+ std::shared_ptr<UserTune> userTune(new UserTune());
userTune->setRating(5);
userTune->setTitle(boost::optional<std::string>("Minion"));
userTune->setTrack(boost::optional<std::string>("Yellow"));
@@ -49,7 +49,7 @@ class UserTuneSerializerTest : public CppUnit::TestFixture {
void testSerialize_withSomeVariablesSet() {
UserTuneSerializer testling(&serializers);
- boost::shared_ptr<UserTune> userTune(new UserTune());
+ std::shared_ptr<UserTune> userTune(new UserTune());
userTune->setTitle(boost::optional<std::string>("Minion"));
userTune->setTrack(boost::optional<std::string>("Yellow"));
userTune->setArtist(boost::optional<std::string>("Ice"));
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp
index c4a8156..49402ec 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -20,7 +20,7 @@ class VCardSerializerTest : public CppUnit::TestFixture
public:
void testSerialize() {
VCardSerializer testling;
- boost::shared_ptr<VCard> vcard(new VCard());
+ std::shared_ptr<VCard> vcard(new VCard());
vcard->setVersion("2.0");
vcard->setFullName("Alice In Wonderland");
vcard->setPrefix("Mrs");
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp
index ed0500a..e3fc5ff 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/VCardUpdateSerializerTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,7 +22,7 @@ class VCardUpdateSerializerTest : public CppUnit::TestFixture
void testSerialize() {
VCardUpdateSerializer testling;
- boost::shared_ptr<VCardUpdate> update(new VCardUpdate());
+ std::shared_ptr<VCardUpdate> update(new VCardUpdate());
update->setPhotoHash("sha1-hash-of-image");
std::string expectedResult =
diff --git a/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.cpp b/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.cpp
index 2383cc8..c53342c 100644
--- a/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -10,7 +10,7 @@
#include <Swiften/Serializer/XML/XMLElement.h>
#include <Swiften/Base/DateTime.h>
#include <boost/lexical_cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -23,76 +23,76 @@ UserLocationSerializer::UserLocationSerializer(PayloadSerializerCollection* seri
UserLocationSerializer::~UserLocationSerializer() {
}
-std::string UserLocationSerializer::serializePayload(boost::shared_ptr<UserLocation> payload) const {
+std::string UserLocationSerializer::serializePayload(std::shared_ptr<UserLocation> payload) const {
if (!payload) {
return "";
}
XMLElement element("geoloc", "http://jabber.org/protocol/geoloc");
if (payload->getArea()) {
- element.addNode(boost::make_shared<XMLElement>("area", "", *payload->getArea()));
+ element.addNode(std::make_shared<XMLElement>("area", "", *payload->getArea()));
}
if (payload->getAltitude()) {
- element.addNode(boost::make_shared<XMLElement>("alt", "", boost::lexical_cast<std::string>(*payload->getAltitude())));
+ element.addNode(std::make_shared<XMLElement>("alt", "", boost::lexical_cast<std::string>(*payload->getAltitude())));
}
if (payload->getLocality()) {
- element.addNode(boost::make_shared<XMLElement>("locality", "", *payload->getLocality()));
+ element.addNode(std::make_shared<XMLElement>("locality", "", *payload->getLocality()));
}
if (payload->getLatitude()) {
- element.addNode(boost::make_shared<XMLElement>("lat", "", boost::lexical_cast<std::string>(*payload->getLatitude())));
+ element.addNode(std::make_shared<XMLElement>("lat", "", boost::lexical_cast<std::string>(*payload->getLatitude())));
}
if (payload->getAccuracy()) {
- element.addNode(boost::make_shared<XMLElement>("accuracy", "", boost::lexical_cast<std::string>(*payload->getAccuracy())));
+ element.addNode(std::make_shared<XMLElement>("accuracy", "", boost::lexical_cast<std::string>(*payload->getAccuracy())));
}
if (payload->getDescription()) {
- element.addNode(boost::make_shared<XMLElement>("description", "", *payload->getDescription()));
+ element.addNode(std::make_shared<XMLElement>("description", "", *payload->getDescription()));
}
if (payload->getCountryCode()) {
- element.addNode(boost::make_shared<XMLElement>("countrycode", "", *payload->getCountryCode()));
+ element.addNode(std::make_shared<XMLElement>("countrycode", "", *payload->getCountryCode()));
}
if (payload->getTimestamp()) {
- element.addNode(boost::make_shared<XMLElement>("timestamp", "", dateTimeToString(*payload->getTimestamp())));
+ element.addNode(std::make_shared<XMLElement>("timestamp", "", dateTimeToString(*payload->getTimestamp())));
}
if (payload->getFloor()) {
- element.addNode(boost::make_shared<XMLElement>("floor", "", *payload->getFloor()));
+ element.addNode(std::make_shared<XMLElement>("floor", "", *payload->getFloor()));
}
if (payload->getBuilding()) {
- element.addNode(boost::make_shared<XMLElement>("building", "", *payload->getBuilding()));
+ element.addNode(std::make_shared<XMLElement>("building", "", *payload->getBuilding()));
}
if (payload->getRoom()) {
- element.addNode(boost::make_shared<XMLElement>("room", "", *payload->getRoom()));
+ element.addNode(std::make_shared<XMLElement>("room", "", *payload->getRoom()));
}
if (payload->getCountry()) {
- element.addNode(boost::make_shared<XMLElement>("country", "", *payload->getCountry()));
+ element.addNode(std::make_shared<XMLElement>("country", "", *payload->getCountry()));
}
if (payload->getRegion()) {
- element.addNode(boost::make_shared<XMLElement>("region", "", *payload->getRegion()));
+ element.addNode(std::make_shared<XMLElement>("region", "", *payload->getRegion()));
}
if (payload->getURI()) {
- element.addNode(boost::make_shared<XMLElement>("uri", "", *payload->getURI()));
+ element.addNode(std::make_shared<XMLElement>("uri", "", *payload->getURI()));
}
if (payload->getLongitude()) {
- element.addNode(boost::make_shared<XMLElement>("lon", "", boost::lexical_cast<std::string>(*payload->getLongitude())));
+ element.addNode(std::make_shared<XMLElement>("lon", "", boost::lexical_cast<std::string>(*payload->getLongitude())));
}
if (payload->getError()) {
- element.addNode(boost::make_shared<XMLElement>("error", "", boost::lexical_cast<std::string>(*payload->getError())));
+ element.addNode(std::make_shared<XMLElement>("error", "", boost::lexical_cast<std::string>(*payload->getError())));
}
if (payload->getPostalCode()) {
- element.addNode(boost::make_shared<XMLElement>("postalcode", "", *payload->getPostalCode()));
+ element.addNode(std::make_shared<XMLElement>("postalcode", "", *payload->getPostalCode()));
}
if (payload->getBearing()) {
- element.addNode(boost::make_shared<XMLElement>("bearing", "", boost::lexical_cast<std::string>(*payload->getBearing())));
+ element.addNode(std::make_shared<XMLElement>("bearing", "", boost::lexical_cast<std::string>(*payload->getBearing())));
}
if (payload->getText()) {
- element.addNode(boost::make_shared<XMLElement>("text", "", *payload->getText()));
+ element.addNode(std::make_shared<XMLElement>("text", "", *payload->getText()));
}
if (payload->getDatum()) {
- element.addNode(boost::make_shared<XMLElement>("datum", "", *payload->getDatum()));
+ element.addNode(std::make_shared<XMLElement>("datum", "", *payload->getDatum()));
}
if (payload->getStreet()) {
- element.addNode(boost::make_shared<XMLElement>("street", "", *payload->getStreet()));
+ element.addNode(std::make_shared<XMLElement>("street", "", *payload->getStreet()));
}
if (payload->getSpeed()) {
- element.addNode(boost::make_shared<XMLElement>("speed", "", boost::lexical_cast<std::string>(*payload->getSpeed())));
+ element.addNode(std::make_shared<XMLElement>("speed", "", boost::lexical_cast<std::string>(*payload->getSpeed())));
}
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.h b/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.h
index 4b17628..a7ed772 100644
--- a/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/UserLocationSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
UserLocationSerializer(PayloadSerializerCollection* serializers);
virtual ~UserLocationSerializer();
- virtual std::string serializePayload(boost::shared_ptr<UserLocation>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<UserLocation>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp b/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp
index eeab2b7..bbae0a3 100644
--- a/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -9,7 +9,7 @@
#include <Swiften/Serializer/PayloadSerializers/UserTuneSerializer.h>
#include <Swiften/Serializer/XML/XMLElement.h>
#include <boost/lexical_cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -22,31 +22,31 @@ UserTuneSerializer::UserTuneSerializer(PayloadSerializerCollection* serializers)
UserTuneSerializer::~UserTuneSerializer() {
}
-std::string UserTuneSerializer::serializePayload(boost::shared_ptr<UserTune> payload) const {
+std::string UserTuneSerializer::serializePayload(std::shared_ptr<UserTune> payload) const {
if (!payload) {
return "";
}
XMLElement element("tune", "http://jabber.org/protocol/tune");
if (payload->getRating()) {
- element.addNode(boost::make_shared<XMLElement>("rating", "", boost::lexical_cast<std::string>(*payload->getRating())));
+ element.addNode(std::make_shared<XMLElement>("rating", "", boost::lexical_cast<std::string>(*payload->getRating())));
}
if (payload->getTitle()) {
- element.addNode(boost::make_shared<XMLElement>("title", "", *payload->getTitle()));
+ element.addNode(std::make_shared<XMLElement>("title", "", *payload->getTitle()));
}
if (payload->getTrack()) {
- element.addNode(boost::make_shared<XMLElement>("track", "", *payload->getTrack()));
+ element.addNode(std::make_shared<XMLElement>("track", "", *payload->getTrack()));
}
if (payload->getArtist()) {
- element.addNode(boost::make_shared<XMLElement>("artist", "", *payload->getArtist()));
+ element.addNode(std::make_shared<XMLElement>("artist", "", *payload->getArtist()));
}
if (payload->getURI()) {
- element.addNode(boost::make_shared<XMLElement>("uri", "", *payload->getURI()));
+ element.addNode(std::make_shared<XMLElement>("uri", "", *payload->getURI()));
}
if (payload->getSource()) {
- element.addNode(boost::make_shared<XMLElement>("source", "", *payload->getSource()));
+ element.addNode(std::make_shared<XMLElement>("source", "", *payload->getSource()));
}
if (payload->getLength()) {
- element.addNode(boost::make_shared<XMLElement>("length", "", boost::lexical_cast<std::string>(*payload->getLength())));
+ element.addNode(std::make_shared<XMLElement>("length", "", boost::lexical_cast<std::string>(*payload->getLength())));
}
return element.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.h b/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.h
index 1d3c76b..565bd71 100644
--- a/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Override.h>
@@ -21,7 +21,7 @@ namespace Swift {
UserTuneSerializer(PayloadSerializerCollection* serializers);
virtual ~UserTuneSerializer();
- virtual std::string serializePayload(boost::shared_ptr<UserTune>) const SWIFTEN_OVERRIDE;
+ virtual std::string serializePayload(std::shared_ptr<UserTune>) const SWIFTEN_OVERRIDE;
private:
diff --git a/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp b/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp
index 98597e4..a1393cb 100644
--- a/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp
@@ -6,8 +6,7 @@
#include <Swiften/Serializer/PayloadSerializers/VCardSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/DateTime.h>
#include <Swiften/Base/foreach.h>
@@ -21,229 +20,229 @@ namespace Swift {
VCardSerializer::VCardSerializer() : GenericPayloadSerializer<VCard>() {
}
-std::string VCardSerializer::serializePayload(boost::shared_ptr<VCard> vcard) const {
+std::string VCardSerializer::serializePayload(std::shared_ptr<VCard> vcard) const {
XMLElement queryElement("vCard", "vcard-temp");
if (!vcard->getVersion().empty()) {
- queryElement.addNode(boost::make_shared<XMLElement>("VERSION", "", vcard->getVersion()));
+ queryElement.addNode(std::make_shared<XMLElement>("VERSION", "", vcard->getVersion()));
}
if (!vcard->getFullName().empty()) {
- queryElement.addNode(boost::make_shared<XMLElement>("FN", "", vcard->getFullName()));
+ queryElement.addNode(std::make_shared<XMLElement>("FN", "", vcard->getFullName()));
}
if (!vcard->getGivenName().empty() || !vcard->getFamilyName().empty() || !vcard->getMiddleName().empty() || !vcard->getPrefix().empty() || !vcard->getSuffix().empty()) {
- boost::shared_ptr<XMLElement> nameElement(new XMLElement("N"));
+ std::shared_ptr<XMLElement> nameElement(new XMLElement("N"));
if (!vcard->getFamilyName().empty()) {
- nameElement->addNode(boost::make_shared<XMLElement>("FAMILY", "", vcard->getFamilyName()));
+ nameElement->addNode(std::make_shared<XMLElement>("FAMILY", "", vcard->getFamilyName()));
}
if (!vcard->getGivenName().empty()) {
- nameElement->addNode(boost::make_shared<XMLElement>("GIVEN", "", vcard->getGivenName()));
+ nameElement->addNode(std::make_shared<XMLElement>("GIVEN", "", vcard->getGivenName()));
}
if (!vcard->getMiddleName().empty()) {
- nameElement->addNode(boost::make_shared<XMLElement>("MIDDLE", "", vcard->getMiddleName()));
+ nameElement->addNode(std::make_shared<XMLElement>("MIDDLE", "", vcard->getMiddleName()));
}
if (!vcard->getPrefix().empty()) {
- nameElement->addNode(boost::make_shared<XMLElement>("PREFIX", "", vcard->getPrefix()));
+ nameElement->addNode(std::make_shared<XMLElement>("PREFIX", "", vcard->getPrefix()));
}
if (!vcard->getSuffix().empty()) {
- nameElement->addNode(boost::make_shared<XMLElement>("SUFFIX", "", vcard->getSuffix()));
+ nameElement->addNode(std::make_shared<XMLElement>("SUFFIX", "", vcard->getSuffix()));
}
queryElement.addNode(nameElement);
}
foreach(const VCard::EMailAddress& emailAddress, vcard->getEMailAddresses()) {
- boost::shared_ptr<XMLElement> emailElement(new XMLElement("EMAIL"));
- emailElement->addNode(boost::make_shared<XMLElement>("USERID", "", emailAddress.address));
+ std::shared_ptr<XMLElement> emailElement(new XMLElement("EMAIL"));
+ emailElement->addNode(std::make_shared<XMLElement>("USERID", "", emailAddress.address));
if (emailAddress.isHome) {
- emailElement->addNode(boost::make_shared<XMLElement>("HOME"));
+ emailElement->addNode(std::make_shared<XMLElement>("HOME"));
}
if (emailAddress.isWork) {
- emailElement->addNode(boost::make_shared<XMLElement>("WORK"));
+ emailElement->addNode(std::make_shared<XMLElement>("WORK"));
}
if (emailAddress.isInternet) {
- emailElement->addNode(boost::make_shared<XMLElement>("INTERNET"));
+ emailElement->addNode(std::make_shared<XMLElement>("INTERNET"));
}
if (emailAddress.isPreferred) {
- emailElement->addNode(boost::make_shared<XMLElement>("PREF"));
+ emailElement->addNode(std::make_shared<XMLElement>("PREF"));
}
if (emailAddress.isX400) {
- emailElement->addNode(boost::make_shared<XMLElement>("X400"));
+ emailElement->addNode(std::make_shared<XMLElement>("X400"));
}
queryElement.addNode(emailElement);
}
if (!vcard->getNickname().empty()) {
- queryElement.addNode(boost::make_shared<XMLElement>("NICKNAME", "", vcard->getNickname()));
+ queryElement.addNode(std::make_shared<XMLElement>("NICKNAME", "", vcard->getNickname()));
}
if (!vcard->getPhoto().empty() || !vcard->getPhotoType().empty()) {
XMLElement::ref photoElement(new XMLElement("PHOTO"));
if (!vcard->getPhotoType().empty()) {
- photoElement->addNode(boost::make_shared<XMLElement>("TYPE", "", vcard->getPhotoType()));
+ photoElement->addNode(std::make_shared<XMLElement>("TYPE", "", vcard->getPhotoType()));
}
if (!vcard->getPhoto().empty()) {
- photoElement->addNode(boost::make_shared<XMLElement>("BINVAL", "", Base64::encode(vcard->getPhoto())));
+ photoElement->addNode(std::make_shared<XMLElement>("BINVAL", "", Base64::encode(vcard->getPhoto())));
}
queryElement.addNode(photoElement);
}
if (!vcard->getBirthday().is_not_a_date_time()) {
- queryElement.addNode(boost::make_shared<XMLElement>("BDAY", "", dateTimeToString(vcard->getBirthday())));
+ queryElement.addNode(std::make_shared<XMLElement>("BDAY", "", dateTimeToString(vcard->getBirthday())));
}
foreach(const VCard::Telephone& telephone, vcard->getTelephones()) {
- boost::shared_ptr<XMLElement> telElement(new XMLElement("TEL"));
- telElement->addNode(boost::make_shared<XMLElement>("NUMBER", "", telephone.number));
+ std::shared_ptr<XMLElement> telElement(new XMLElement("TEL"));
+ telElement->addNode(std::make_shared<XMLElement>("NUMBER", "", telephone.number));
if (telephone.isHome) {
- telElement->addNode(boost::make_shared<XMLElement>("HOME"));
+ telElement->addNode(std::make_shared<XMLElement>("HOME"));
}
if (telephone.isWork) {
- telElement->addNode(boost::make_shared<XMLElement>("WORK"));
+ telElement->addNode(std::make_shared<XMLElement>("WORK"));
}
if (telephone.isVoice) {
- telElement->addNode(boost::make_shared<XMLElement>("VOICE"));
+ telElement->addNode(std::make_shared<XMLElement>("VOICE"));
}
if (telephone.isFax) {
- telElement->addNode(boost::make_shared<XMLElement>("FAX"));
+ telElement->addNode(std::make_shared<XMLElement>("FAX"));
}
if (telephone.isPager) {
- telElement->addNode(boost::make_shared<XMLElement>("PAGER"));
+ telElement->addNode(std::make_shared<XMLElement>("PAGER"));
}
if (telephone.isMSG) {
- telElement->addNode(boost::make_shared<XMLElement>("MSG"));
+ telElement->addNode(std::make_shared<XMLElement>("MSG"));
}
if (telephone.isCell) {
- telElement->addNode(boost::make_shared<XMLElement>("CELL"));
+ telElement->addNode(std::make_shared<XMLElement>("CELL"));
}
if (telephone.isVideo) {
- telElement->addNode(boost::make_shared<XMLElement>("VIDEO"));
+ telElement->addNode(std::make_shared<XMLElement>("VIDEO"));
}
if (telephone.isBBS) {
- telElement->addNode(boost::make_shared<XMLElement>("BBS"));
+ telElement->addNode(std::make_shared<XMLElement>("BBS"));
}
if (telephone.isModem) {
- telElement->addNode(boost::make_shared<XMLElement>("MODEM"));
+ telElement->addNode(std::make_shared<XMLElement>("MODEM"));
}
if (telephone.isISDN) {
- telElement->addNode(boost::make_shared<XMLElement>("ISDN"));
+ telElement->addNode(std::make_shared<XMLElement>("ISDN"));
}
if (telephone.isPCS) {
- telElement->addNode(boost::make_shared<XMLElement>("PCS"));
+ telElement->addNode(std::make_shared<XMLElement>("PCS"));
}
if (telephone.isPreferred) {
- telElement->addNode(boost::make_shared<XMLElement>("PREF"));
+ telElement->addNode(std::make_shared<XMLElement>("PREF"));
}
queryElement.addNode(telElement);
}
foreach(const VCard::Address& address, vcard->getAddresses()) {
- boost::shared_ptr<XMLElement> adrElement = boost::make_shared<XMLElement>("ADR");
+ std::shared_ptr<XMLElement> adrElement = std::make_shared<XMLElement>("ADR");
if (!address.poBox.empty()) {
- adrElement->addNode(boost::make_shared<XMLElement>("POBOX", "", address.poBox));
+ adrElement->addNode(std::make_shared<XMLElement>("POBOX", "", address.poBox));
}
if (!address.addressExtension.empty()) {
- adrElement->addNode(boost::make_shared<XMLElement>("EXTADD", "", address.addressExtension));
+ adrElement->addNode(std::make_shared<XMLElement>("EXTADD", "", address.addressExtension));
}
if (!address.street.empty()) {
- adrElement->addNode(boost::make_shared<XMLElement>("STREET", "", address.street));
+ adrElement->addNode(std::make_shared<XMLElement>("STREET", "", address.street));
}
if (!address.locality.empty()) {
- adrElement->addNode(boost::make_shared<XMLElement>("LOCALITY", "", address.locality));
+ adrElement->addNode(std::make_shared<XMLElement>("LOCALITY", "", address.locality));
}
if (!address.region.empty()) {
- adrElement->addNode(boost::make_shared<XMLElement>("REGION", "", address.region));
+ adrElement->addNode(std::make_shared<XMLElement>("REGION", "", address.region));
}
if (!address.postalCode.empty()) {
- adrElement->addNode(boost::make_shared<XMLElement>("PCODE", "", address.postalCode));
+ adrElement->addNode(std::make_shared<XMLElement>("PCODE", "", address.postalCode));
}
if (!address.country.empty()) {
- adrElement->addNode(boost::make_shared<XMLElement>("CTRY", "", address.country));
+ adrElement->addNode(std::make_shared<XMLElement>("CTRY", "", address.country));
}
if (address.isHome) {
- adrElement->addNode(boost::make_shared<XMLElement>("HOME"));
+ adrElement->addNode(std::make_shared<XMLElement>("HOME"));
}
if (address.isWork) {
- adrElement->addNode(boost::make_shared<XMLElement>("WORK"));
+ adrElement->addNode(std::make_shared<XMLElement>("WORK"));
}
if (address.isPostal) {
- adrElement->addNode(boost::make_shared<XMLElement>("POSTAL"));
+ adrElement->addNode(std::make_shared<XMLElement>("POSTAL"));
}
if (address.isParcel) {
- adrElement->addNode(boost::make_shared<XMLElement>("PARCEL"));
+ adrElement->addNode(std::make_shared<XMLElement>("PARCEL"));
}
if (address.deliveryType == VCard::DomesticDelivery) {
- adrElement->addNode(boost::make_shared<XMLElement>("DOM"));
+ adrElement->addNode(std::make_shared<XMLElement>("DOM"));
}
if (address.deliveryType == VCard::InternationalDelivery) {
- adrElement->addNode(boost::make_shared<XMLElement>("INTL"));
+ adrElement->addNode(std::make_shared<XMLElement>("INTL"));
}
if (address.isPreferred) {
- adrElement->addNode(boost::make_shared<XMLElement>("PREF"));
+ adrElement->addNode(std::make_shared<XMLElement>("PREF"));
}
queryElement.addNode(adrElement);
}
foreach(const VCard::AddressLabel& addressLabel, vcard->getAddressLabels()) {
- boost::shared_ptr<XMLElement> labelElement = boost::make_shared<XMLElement>("LABEL");
+ std::shared_ptr<XMLElement> labelElement = std::make_shared<XMLElement>("LABEL");
foreach(const std::string& line, addressLabel.lines) {
- labelElement->addNode(boost::make_shared<XMLElement>("LINE", "", line));
+ labelElement->addNode(std::make_shared<XMLElement>("LINE", "", line));
}
if (addressLabel.isHome) {
- labelElement->addNode(boost::make_shared<XMLElement>("HOME"));
+ labelElement->addNode(std::make_shared<XMLElement>("HOME"));
}
if (addressLabel.isWork) {
- labelElement->addNode(boost::make_shared<XMLElement>("WORK"));
+ labelElement->addNode(std::make_shared<XMLElement>("WORK"));
}
if (addressLabel.isPostal) {
- labelElement->addNode(boost::make_shared<XMLElement>("POSTAL"));
+ labelElement->addNode(std::make_shared<XMLElement>("POSTAL"));
}
if (addressLabel.isParcel) {
- labelElement->addNode(boost::make_shared<XMLElement>("PARCEL"));
+ labelElement->addNode(std::make_shared<XMLElement>("PARCEL"));
}
if (addressLabel.deliveryType == VCard::DomesticDelivery) {
- labelElement->addNode(boost::make_shared<XMLElement>("DOM"));
+ labelElement->addNode(std::make_shared<XMLElement>("DOM"));
}
if (addressLabel.deliveryType == VCard::InternationalDelivery) {
- labelElement->addNode(boost::make_shared<XMLElement>("INTL"));
+ labelElement->addNode(std::make_shared<XMLElement>("INTL"));
}
if (addressLabel.isPreferred) {
- labelElement->addNode(boost::make_shared<XMLElement>("PREF"));
+ labelElement->addNode(std::make_shared<XMLElement>("PREF"));
}
queryElement.addNode(labelElement);
}
foreach(const JID& jid, vcard->getJIDs()) {
- queryElement.addNode(boost::make_shared<XMLElement>("JID", "", jid.toString()));
+ queryElement.addNode(std::make_shared<XMLElement>("JID", "", jid.toString()));
}
if (!vcard->getDescription().empty()) {
- queryElement.addNode(boost::make_shared<XMLElement>("DESC", "", vcard->getDescription()));
+ queryElement.addNode(std::make_shared<XMLElement>("DESC", "", vcard->getDescription()));
}
foreach(const VCard::Organization& org, vcard->getOrganizations()) {
- boost::shared_ptr<XMLElement> orgElement = boost::make_shared<XMLElement>("ORG");
+ std::shared_ptr<XMLElement> orgElement = std::make_shared<XMLElement>("ORG");
if (!org.name.empty()) {
- orgElement->addNode(boost::make_shared<XMLElement>("ORGNAME", "", org.name));
+ orgElement->addNode(std::make_shared<XMLElement>("ORGNAME", "", org.name));
}
if (!org.units.empty()) {
foreach(const std::string& unit, org.units) {
- orgElement->addNode(boost::make_shared<XMLElement>("ORGUNIT", "", unit));
+ orgElement->addNode(std::make_shared<XMLElement>("ORGUNIT", "", unit));
}
}
queryElement.addNode(orgElement);
}
foreach(const std::string& title, vcard->getTitles()) {
- queryElement.addNode(boost::make_shared<XMLElement>("TITLE", "", title));
+ queryElement.addNode(std::make_shared<XMLElement>("TITLE", "", title));
}
foreach(const std::string& role, vcard->getRoles()) {
- queryElement.addNode(boost::make_shared<XMLElement>("ROLE", "", role));
+ queryElement.addNode(std::make_shared<XMLElement>("ROLE", "", role));
}
foreach(const std::string& url, vcard->getURLs()) {
- queryElement.addNode(boost::make_shared<XMLElement>("URL", "", url));
+ queryElement.addNode(std::make_shared<XMLElement>("URL", "", url));
}
if (!vcard->getUnknownContent().empty()) {
- queryElement.addNode(boost::make_shared<XMLRawTextNode>(vcard->getUnknownContent()));
+ queryElement.addNode(std::make_shared<XMLRawTextNode>(vcard->getUnknownContent()));
}
return queryElement.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/VCardSerializer.h b/Swiften/Serializer/PayloadSerializers/VCardSerializer.h
index e84252d..ad83f9a 100644
--- a/Swiften/Serializer/PayloadSerializers/VCardSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/VCardSerializer.h
@@ -15,6 +15,6 @@ namespace Swift {
public:
VCardSerializer();
- virtual std::string serializePayload(boost::shared_ptr<VCard>) const;
+ virtual std::string serializePayload(std::shared_ptr<VCard>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.cpp b/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.cpp
index 8fb1e3f..607cf72 100644
--- a/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.cpp
@@ -1,13 +1,12 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/XML/XMLElement.h>
#include <Swiften/Serializer/XML/XMLTextNode.h>
@@ -17,10 +16,10 @@ namespace Swift {
VCardUpdateSerializer::VCardUpdateSerializer() : GenericPayloadSerializer<VCardUpdate>() {
}
-std::string VCardUpdateSerializer::serializePayload(boost::shared_ptr<VCardUpdate> vcardUpdate) const {
+std::string VCardUpdateSerializer::serializePayload(std::shared_ptr<VCardUpdate> vcardUpdate) const {
XMLElement updateElement("x", "vcard-temp:x:update");
- boost::shared_ptr<XMLElement> photoElement(new XMLElement("photo"));
- photoElement->addNode(boost::make_shared<XMLTextNode>(vcardUpdate->getPhotoHash()));
+ std::shared_ptr<XMLElement> photoElement(new XMLElement("photo"));
+ photoElement->addNode(std::make_shared<XMLTextNode>(vcardUpdate->getPhotoHash()));
updateElement.addNode(photoElement);
return updateElement.serialize();
}
diff --git a/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h b/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h
index 777da3e..cea8ebd 100644
--- a/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/VCardUpdateSerializer.h
@@ -15,6 +15,6 @@ namespace Swift {
public:
VCardUpdateSerializer();
- virtual std::string serializePayload(boost::shared_ptr<VCardUpdate>) const;
+ virtual std::string serializePayload(std::shared_ptr<VCardUpdate>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp
index 27d3f57..5aebca3 100644
--- a/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp
@@ -13,9 +13,9 @@
#include <Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h>
#include <iostream>
+#include <memory>
#include <boost/lexical_cast.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h>
#include <Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h>
@@ -24,7 +24,7 @@
namespace Swift {
void WhiteboardElementSerializingVisitor::visit(WhiteboardLineElement& line) {
- element = boost::make_shared<XMLElement>("line");
+ element = std::make_shared<XMLElement>("line");
try {
element->setAttribute("x1", boost::lexical_cast<std::string>(line.x1()));
element->setAttribute("y1", boost::lexical_cast<std::string>(line.y1()));
@@ -39,7 +39,7 @@ namespace Swift {
}
void WhiteboardElementSerializingVisitor::visit(WhiteboardFreehandPathElement& path) {
- element = boost::make_shared<XMLElement>("path");
+ element = std::make_shared<XMLElement>("path");
element->setAttribute("id", path.getID());
element->setAttribute("stroke", path.getColor().toHex());
try {
@@ -59,7 +59,7 @@ namespace Swift {
}
void WhiteboardElementSerializingVisitor::visit(WhiteboardRectElement& rect) {
- element = boost::make_shared<XMLElement>("rect");
+ element = std::make_shared<XMLElement>("rect");
try {
element->setAttribute("x", boost::lexical_cast<std::string>(rect.getX()));
element->setAttribute("y", boost::lexical_cast<std::string>(rect.getY()));
@@ -76,7 +76,7 @@ namespace Swift {
}
void WhiteboardElementSerializingVisitor::visit(WhiteboardPolygonElement& polygon) {
- element = boost::make_shared<XMLElement>("polygon");
+ element = std::make_shared<XMLElement>("polygon");
try {
element->setAttribute("id", polygon.getID());
element->setAttribute("stroke", polygon.getPenColor().toHex());
@@ -95,7 +95,7 @@ namespace Swift {
}
void WhiteboardElementSerializingVisitor::visit(WhiteboardTextElement& text) {
- element = boost::make_shared<XMLElement>("text");
+ element = std::make_shared<XMLElement>("text");
try {
element->setAttribute("x", boost::lexical_cast<std::string>(text.getX()));
element->setAttribute("y", boost::lexical_cast<std::string>(text.getY()));
@@ -103,13 +103,13 @@ namespace Swift {
element->setAttribute("id", text.getID());
element->setAttribute("fill", text.getColor().toHex());
element->setAttribute("opacity", alphaToOpacity(text.getColor().getAlpha()));
- element->addNode(boost::make_shared<XMLTextNode>(text.getText()));
+ element->addNode(std::make_shared<XMLTextNode>(text.getText()));
} catch (boost::bad_lexical_cast&) {
}
}
void WhiteboardElementSerializingVisitor::visit(WhiteboardEllipseElement& ellipse) {
- element = boost::make_shared<XMLElement>("ellipse");
+ element = std::make_shared<XMLElement>("ellipse");
try {
element->setAttribute("cx", boost::lexical_cast<std::string>(ellipse.getCX()));
element->setAttribute("cy", boost::lexical_cast<std::string>(ellipse.getCY()));
@@ -138,13 +138,13 @@ namespace Swift {
}
}
- std::string WhiteboardSerializer::serializePayload(boost::shared_ptr<WhiteboardPayload> payload) const {
+ std::string WhiteboardSerializer::serializePayload(std::shared_ptr<WhiteboardPayload> payload) const {
XMLElement element("wb", "http://swift.im/whiteboard");
if (payload->getType() == WhiteboardPayload::Data) {
- XMLElement::ref operationNode = boost::make_shared<XMLElement>("operation");
+ XMLElement::ref operationNode = std::make_shared<XMLElement>("operation");
WhiteboardElementSerializingVisitor visitor;
// payload->getElement()->accept(visitor);
- WhiteboardInsertOperation::ref insertOp = boost::dynamic_pointer_cast<WhiteboardInsertOperation>(payload->getOperation());
+ WhiteboardInsertOperation::ref insertOp = std::dynamic_pointer_cast<WhiteboardInsertOperation>(payload->getOperation());
if (insertOp) {
try {
operationNode->setAttribute("type", "insert");
@@ -156,7 +156,7 @@ namespace Swift {
insertOp->getElement()->accept(visitor);
operationNode->addNode(visitor.getResult());
}
- WhiteboardUpdateOperation::ref updateOp = boost::dynamic_pointer_cast<WhiteboardUpdateOperation>(payload->getOperation());
+ WhiteboardUpdateOperation::ref updateOp = std::dynamic_pointer_cast<WhiteboardUpdateOperation>(payload->getOperation());
if (updateOp) {
try {
operationNode->setAttribute("type", "update");
@@ -171,7 +171,7 @@ namespace Swift {
}
- WhiteboardDeleteOperation::ref deleteOp = boost::dynamic_pointer_cast<WhiteboardDeleteOperation>(payload->getOperation());
+ WhiteboardDeleteOperation::ref deleteOp = std::dynamic_pointer_cast<WhiteboardDeleteOperation>(payload->getOperation());
if (deleteOp) {
try {
operationNode->setAttribute("type", "delete");
diff --git a/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h
index 70aef1e..1fde636 100644
--- a/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h
@@ -43,7 +43,7 @@ namespace Swift {
class SWIFTEN_API WhiteboardSerializer : public GenericPayloadSerializer<WhiteboardPayload> {
public:
- std::string serializePayload(boost::shared_ptr<WhiteboardPayload> payload) const;
+ std::string serializePayload(std::shared_ptr<WhiteboardPayload> payload) const;
private:
std::string typeToString(WhiteboardPayload::Type type) const;
diff --git a/Swiften/Serializer/PresenceSerializer.cpp b/Swiften/Serializer/PresenceSerializer.cpp
index 24c4365..fc398a4 100644
--- a/Swiften/Serializer/PresenceSerializer.cpp
+++ b/Swiften/Serializer/PresenceSerializer.cpp
@@ -6,7 +6,7 @@
#include <Swiften/Serializer/PresenceSerializer.h>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/Log.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -19,7 +19,7 @@ PresenceSerializer::PresenceSerializer(PayloadSerializerCollection* payloadSeria
}
void PresenceSerializer::setStanzaSpecificAttributesGeneric(
- boost::shared_ptr<Presence> presence,
+ std::shared_ptr<Presence> presence,
XMLElement& element) const {
switch (presence->getType()) {
case Presence::Unavailable: element.setAttribute("type","unavailable"); break;
diff --git a/Swiften/Serializer/PresenceSerializer.h b/Swiften/Serializer/PresenceSerializer.h
index e40b9c2..b0e1a4f 100644
--- a/Swiften/Serializer/PresenceSerializer.h
+++ b/Swiften/Serializer/PresenceSerializer.h
@@ -20,7 +20,7 @@ namespace Swift {
private:
virtual void setStanzaSpecificAttributesGeneric(
- boost::shared_ptr<Presence> presence,
+ std::shared_ptr<Presence> presence,
XMLElement& element) const;
};
}
diff --git a/Swiften/Serializer/StanzaAckRequestSerializer.h b/Swiften/Serializer/StanzaAckRequestSerializer.h
index b178db1..f738231 100644
--- a/Swiften/Serializer/StanzaAckRequestSerializer.h
+++ b/Swiften/Serializer/StanzaAckRequestSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/StanzaAckRequest.h>
@@ -19,7 +19,7 @@ namespace Swift {
StanzaAckRequestSerializer() : GenericElementSerializer<StanzaAckRequest>() {
}
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement>) const {
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement>) const {
return createSafeByteArray(XMLElement("r", "urn:xmpp:sm:2").serialize());
}
};
diff --git a/Swiften/Serializer/StanzaAckSerializer.h b/Swiften/Serializer/StanzaAckSerializer.h
index 7ca6ab8..f5a27dc 100644
--- a/Swiften/Serializer/StanzaAckSerializer.h
+++ b/Swiften/Serializer/StanzaAckSerializer.h
@@ -6,8 +6,9 @@
#pragma once
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/StanzaAck.h>
@@ -20,8 +21,8 @@ namespace Swift {
StanzaAckSerializer() : GenericElementSerializer<StanzaAck>() {
}
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement> element) const {
- StanzaAck::ref stanzaAck(boost::dynamic_pointer_cast<StanzaAck>(element));
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement> element) const {
+ StanzaAck::ref stanzaAck(std::dynamic_pointer_cast<StanzaAck>(element));
assert(stanzaAck->isValid());
XMLElement result("a", "urn:xmpp:sm:2");
result.setAttribute("h", std::string(boost::lexical_cast<std::string>(stanzaAck->getHandledStanzasCount())));
diff --git a/Swiften/Serializer/StanzaSerializer.cpp b/Swiften/Serializer/StanzaSerializer.cpp
index 002f2c3..de1e8f1 100644
--- a/Swiften/Serializer/StanzaSerializer.cpp
+++ b/Swiften/Serializer/StanzaSerializer.cpp
@@ -22,7 +22,7 @@ namespace Swift {
StanzaSerializer::StanzaSerializer(const std::string& tag, PayloadSerializerCollection* payloadSerializers, const boost::optional<std::string>& explicitNS) : tag_(tag), payloadSerializers_(payloadSerializers), explicitDefaultNS_(explicitNS) {
}
-SafeByteArray StanzaSerializer::serialize(boost::shared_ptr<ToplevelElement> element) const {
+SafeByteArray StanzaSerializer::serialize(std::shared_ptr<ToplevelElement> element) const {
if (explicitDefaultNS_) {
return serialize(element, explicitDefaultNS_.get());
}
@@ -31,8 +31,8 @@ SafeByteArray StanzaSerializer::serialize(boost::shared_ptr<ToplevelElement> ele
}
}
-SafeByteArray StanzaSerializer::serialize(boost::shared_ptr<ToplevelElement> element, const std::string& xmlns) const {
- boost::shared_ptr<Stanza> stanza(boost::dynamic_pointer_cast<Stanza>(element));
+SafeByteArray StanzaSerializer::serialize(std::shared_ptr<ToplevelElement> element, const std::string& xmlns) const {
+ std::shared_ptr<Stanza> stanza(std::dynamic_pointer_cast<Stanza>(element));
XMLElement stanzaElement(tag_, explicitDefaultNS_ ? explicitDefaultNS_.get() : xmlns);
if (stanza->getFrom().isValid()) {
@@ -47,7 +47,7 @@ SafeByteArray StanzaSerializer::serialize(boost::shared_ptr<ToplevelElement> ele
setStanzaSpecificAttributes(stanza, stanzaElement);
std::string serializedPayloads;
- foreach (const boost::shared_ptr<Payload>& payload, stanza->getPayloads()) {
+ foreach (const std::shared_ptr<Payload>& payload, stanza->getPayloads()) {
PayloadSerializer* serializer = payloadSerializers_->getPayloadSerializer(payload);
if (serializer) {
serializedPayloads += serializer->serialize(payload);
@@ -57,7 +57,7 @@ SafeByteArray StanzaSerializer::serialize(boost::shared_ptr<ToplevelElement> ele
}
}
if (!serializedPayloads.empty()) {
- stanzaElement.addNode(boost::shared_ptr<XMLNode>(new XMLRawTextNode(serializedPayloads)));
+ stanzaElement.addNode(std::make_shared<XMLRawTextNode>(serializedPayloads));
}
return createSafeByteArray(stanzaElement.serialize());
diff --git a/Swiften/Serializer/StanzaSerializer.h b/Swiften/Serializer/StanzaSerializer.h
index 34aab9e..b2e051c 100644
--- a/Swiften/Serializer/StanzaSerializer.h
+++ b/Swiften/Serializer/StanzaSerializer.h
@@ -22,9 +22,9 @@ namespace Swift {
public:
StanzaSerializer(const std::string& tag, PayloadSerializerCollection* payloadSerializers, const boost::optional<std::string>& explicitNS = boost::optional<std::string>());
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement> element) const;
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement> element, const std::string& xmlns) const;
- virtual void setStanzaSpecificAttributes(boost::shared_ptr<ToplevelElement>, XMLElement&) const = 0;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement> element) const;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement> element, const std::string& xmlns) const;
+ virtual void setStanzaSpecificAttributes(std::shared_ptr<ToplevelElement>, XMLElement&) const = 0;
private:
std::string tag_;
diff --git a/Swiften/Serializer/StartTLSFailureSerializer.h b/Swiften/Serializer/StartTLSFailureSerializer.h
index f7f7296..77f904c 100644
--- a/Swiften/Serializer/StartTLSFailureSerializer.h
+++ b/Swiften/Serializer/StartTLSFailureSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/StartTLSFailure.h>
@@ -19,7 +19,7 @@ namespace Swift {
StartTLSFailureSerializer() : GenericElementSerializer<StartTLSFailure>() {
}
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement>) const {
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement>) const {
return createSafeByteArray(XMLElement("failure", "urn:ietf:params:xml:ns:xmpp-tls").serialize());
}
};
diff --git a/Swiften/Serializer/StartTLSRequestSerializer.h b/Swiften/Serializer/StartTLSRequestSerializer.h
index cc8e3d5..ee2a76f 100644
--- a/Swiften/Serializer/StartTLSRequestSerializer.h
+++ b/Swiften/Serializer/StartTLSRequestSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/StartTLSRequest.h>
@@ -19,7 +19,7 @@ namespace Swift {
StartTLSRequestSerializer() : GenericElementSerializer<StartTLSRequest>() {
}
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement>) const {
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement>) const {
return createSafeByteArray(XMLElement("starttls", "urn:ietf:params:xml:ns:xmpp-tls").serialize());
}
};
diff --git a/Swiften/Serializer/StreamErrorSerializer.cpp b/Swiften/Serializer/StreamErrorSerializer.cpp
index 3cad478..66a71ca 100644
--- a/Swiften/Serializer/StreamErrorSerializer.cpp
+++ b/Swiften/Serializer/StreamErrorSerializer.cpp
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2014 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Serializer/StreamErrorSerializer.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -15,8 +15,8 @@ namespace Swift {
StreamErrorSerializer::StreamErrorSerializer() : GenericElementSerializer<StreamError>() {
}
-SafeByteArray StreamErrorSerializer::serialize(boost::shared_ptr<ToplevelElement> element) const {
- StreamError::ref error = boost::dynamic_pointer_cast<StreamError>(element);
+SafeByteArray StreamErrorSerializer::serialize(std::shared_ptr<ToplevelElement> element) const {
+ StreamError::ref error = std::dynamic_pointer_cast<StreamError>(element);
XMLElement errorElement("error", "http://etherx.jabber.org/streams");
std::string typeTag;
@@ -47,10 +47,10 @@ SafeByteArray StreamErrorSerializer::serialize(boost::shared_ptr<ToplevelElement
case StreamError::UnsupportedStanzaType: typeTag = "unsupported-stanza-type"; break;
case StreamError::UnsupportedVersion: typeTag = "unsupported-version"; break;
}
- errorElement.addNode(boost::make_shared<XMLElement>(typeTag, "urn:ietf:params:xml:ns:xmpp-streams"));
+ errorElement.addNode(std::make_shared<XMLElement>(typeTag, "urn:ietf:params:xml:ns:xmpp-streams"));
if (!error->getText().empty()) {
- errorElement.addNode(boost::make_shared<XMLElement>("text", "urn:ietf:params:xml:ns:xmpp-streams", error->getText()));
+ errorElement.addNode(std::make_shared<XMLElement>("text", "urn:ietf:params:xml:ns:xmpp-streams", error->getText()));
}
return createSafeByteArray(errorElement.serialize());
diff --git a/Swiften/Serializer/StreamErrorSerializer.h b/Swiften/Serializer/StreamErrorSerializer.h
index f578005..7277903 100644
--- a/Swiften/Serializer/StreamErrorSerializer.h
+++ b/Swiften/Serializer/StreamErrorSerializer.h
@@ -15,6 +15,6 @@ namespace Swift {
public:
StreamErrorSerializer();
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement> error) const;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement> error) const;
};
}
diff --git a/Swiften/Serializer/StreamFeaturesSerializer.cpp b/Swiften/Serializer/StreamFeaturesSerializer.cpp
index ed042ec..820b96c 100644
--- a/Swiften/Serializer/StreamFeaturesSerializer.cpp
+++ b/Swiften/Serializer/StreamFeaturesSerializer.cpp
@@ -6,7 +6,7 @@
#include <Swiften/Serializer/StreamFeaturesSerializer.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/foreach.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -17,42 +17,42 @@ namespace Swift {
StreamFeaturesSerializer::StreamFeaturesSerializer() {
}
-SafeByteArray StreamFeaturesSerializer::serialize(boost::shared_ptr<ToplevelElement> element) const {
- boost::shared_ptr<StreamFeatures> streamFeatures(boost::dynamic_pointer_cast<StreamFeatures>(element));
+SafeByteArray StreamFeaturesSerializer::serialize(std::shared_ptr<ToplevelElement> element) const {
+ std::shared_ptr<StreamFeatures> streamFeatures(std::dynamic_pointer_cast<StreamFeatures>(element));
XMLElement streamFeaturesElement("stream:features");
if (streamFeatures->hasStartTLS()) {
- streamFeaturesElement.addNode(boost::make_shared<XMLElement>("starttls", "urn:ietf:params:xml:ns:xmpp-tls"));
+ streamFeaturesElement.addNode(std::make_shared<XMLElement>("starttls", "urn:ietf:params:xml:ns:xmpp-tls"));
}
if (!streamFeatures->getCompressionMethods().empty()) {
- boost::shared_ptr<XMLElement> compressionElement(new XMLElement("compression", "http://jabber.org/features/compress"));
+ std::shared_ptr<XMLElement> compressionElement(new XMLElement("compression", "http://jabber.org/features/compress"));
foreach(const std::string& method, streamFeatures->getCompressionMethods()) {
- boost::shared_ptr<XMLElement> methodElement(new XMLElement("method"));
- methodElement->addNode(boost::make_shared<XMLTextNode>(method));
+ std::shared_ptr<XMLElement> methodElement(new XMLElement("method"));
+ methodElement->addNode(std::make_shared<XMLTextNode>(method));
compressionElement->addNode(methodElement);
}
streamFeaturesElement.addNode(compressionElement);
}
if (!streamFeatures->getAuthenticationMechanisms().empty()) {
- boost::shared_ptr<XMLElement> mechanismsElement(new XMLElement("mechanisms", "urn:ietf:params:xml:ns:xmpp-sasl"));
+ std::shared_ptr<XMLElement> mechanismsElement(new XMLElement("mechanisms", "urn:ietf:params:xml:ns:xmpp-sasl"));
foreach(const std::string& mechanism, streamFeatures->getAuthenticationMechanisms()) {
- boost::shared_ptr<XMLElement> mechanismElement(new XMLElement("mechanism"));
- mechanismElement->addNode(boost::make_shared<XMLTextNode>(mechanism));
+ std::shared_ptr<XMLElement> mechanismElement(new XMLElement("mechanism"));
+ mechanismElement->addNode(std::make_shared<XMLTextNode>(mechanism));
mechanismsElement->addNode(mechanismElement);
}
streamFeaturesElement.addNode(mechanismsElement);
}
if (streamFeatures->hasResourceBind()) {
- streamFeaturesElement.addNode(boost::make_shared<XMLElement>("bind", "urn:ietf:params:xml:ns:xmpp-bind"));
+ streamFeaturesElement.addNode(std::make_shared<XMLElement>("bind", "urn:ietf:params:xml:ns:xmpp-bind"));
}
if (streamFeatures->hasSession()) {
- streamFeaturesElement.addNode(boost::make_shared<XMLElement>("session", "urn:ietf:params:xml:ns:xmpp-session"));
+ streamFeaturesElement.addNode(std::make_shared<XMLElement>("session", "urn:ietf:params:xml:ns:xmpp-session"));
}
if (streamFeatures->hasStreamManagement()) {
- streamFeaturesElement.addNode(boost::make_shared<XMLElement>("sm", "urn:xmpp:sm:2"));
+ streamFeaturesElement.addNode(std::make_shared<XMLElement>("sm", "urn:xmpp:sm:2"));
}
if (streamFeatures->hasRosterVersioning()) {
- streamFeaturesElement.addNode(boost::make_shared<XMLElement>("ver", "urn:xmpp:features:rosterver"));
+ streamFeaturesElement.addNode(std::make_shared<XMLElement>("ver", "urn:xmpp:features:rosterver"));
}
return createSafeByteArray(streamFeaturesElement.serialize());
}
diff --git a/Swiften/Serializer/StreamFeaturesSerializer.h b/Swiften/Serializer/StreamFeaturesSerializer.h
index f2328a5..b1cc2f7 100644
--- a/Swiften/Serializer/StreamFeaturesSerializer.h
+++ b/Swiften/Serializer/StreamFeaturesSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2014 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/StreamFeatures.h>
@@ -17,6 +17,6 @@ namespace Swift {
public:
StreamFeaturesSerializer();
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement> element) const;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement> element) const;
};
}
diff --git a/Swiften/Serializer/StreamManagementEnabledSerializer.cpp b/Swiften/Serializer/StreamManagementEnabledSerializer.cpp
index b03196c..4f4ca2e 100644
--- a/Swiften/Serializer/StreamManagementEnabledSerializer.cpp
+++ b/Swiften/Serializer/StreamManagementEnabledSerializer.cpp
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2014 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Serializer/StreamManagementEnabledSerializer.h>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Elements/StreamManagementEnabled.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -16,8 +16,8 @@ using namespace Swift;
StreamManagementEnabledSerializer::StreamManagementEnabledSerializer() : GenericElementSerializer<StreamManagementEnabled>() {
}
-SafeByteArray StreamManagementEnabledSerializer::serialize(boost::shared_ptr<ToplevelElement> el) const {
- boost::shared_ptr<StreamManagementEnabled> e(boost::dynamic_pointer_cast<StreamManagementEnabled>(el));
+SafeByteArray StreamManagementEnabledSerializer::serialize(std::shared_ptr<ToplevelElement> el) const {
+ std::shared_ptr<StreamManagementEnabled> e(std::dynamic_pointer_cast<StreamManagementEnabled>(el));
XMLElement element("enabled", "urn:xmpp:sm:2");
if (!e->getResumeID().empty()) {
element.setAttribute("id", e->getResumeID());
diff --git a/Swiften/Serializer/StreamManagementEnabledSerializer.h b/Swiften/Serializer/StreamManagementEnabledSerializer.h
index 9ffe233..f139dc8 100644
--- a/Swiften/Serializer/StreamManagementEnabledSerializer.h
+++ b/Swiften/Serializer/StreamManagementEnabledSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/StreamManagementEnabled.h>
@@ -17,6 +17,6 @@ namespace Swift {
public:
StreamManagementEnabledSerializer();
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement>) const;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement>) const;
};
}
diff --git a/Swiften/Serializer/StreamManagementFailedSerializer.h b/Swiften/Serializer/StreamManagementFailedSerializer.h
index b189bd8..29dd0ab 100644
--- a/Swiften/Serializer/StreamManagementFailedSerializer.h
+++ b/Swiften/Serializer/StreamManagementFailedSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/StreamManagementFailed.h>
@@ -19,7 +19,7 @@ namespace Swift {
StreamManagementFailedSerializer() : GenericElementSerializer<StreamManagementFailed>() {
}
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement>) const {
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement>) const {
return createSafeByteArray(XMLElement("failed", "urn:xmpp:sm:2").serialize());
}
};
diff --git a/Swiften/Serializer/StreamResumeSerializer.cpp b/Swiften/Serializer/StreamResumeSerializer.cpp
index c660083..619ac9c 100644
--- a/Swiften/Serializer/StreamResumeSerializer.cpp
+++ b/Swiften/Serializer/StreamResumeSerializer.cpp
@@ -6,8 +6,9 @@
#include <Swiften/Serializer/StreamResumeSerializer.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Elements/StreamResume.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -17,8 +18,8 @@ using namespace Swift;
StreamResumeSerializer::StreamResumeSerializer() : GenericElementSerializer<StreamResume>() {
}
-SafeByteArray StreamResumeSerializer::serialize(boost::shared_ptr<ToplevelElement> el) const {
- boost::shared_ptr<StreamResume> e(boost::dynamic_pointer_cast<StreamResume>(el));
+SafeByteArray StreamResumeSerializer::serialize(std::shared_ptr<ToplevelElement> el) const {
+ std::shared_ptr<StreamResume> e(std::dynamic_pointer_cast<StreamResume>(el));
XMLElement element("resume", "urn:xmpp:sm:2");
element.setAttribute("previd", e->getResumeID());
if (e->getHandledStanzasCount()) {
diff --git a/Swiften/Serializer/StreamResumeSerializer.h b/Swiften/Serializer/StreamResumeSerializer.h
index 5e7c58d..ad13b2b 100644
--- a/Swiften/Serializer/StreamResumeSerializer.h
+++ b/Swiften/Serializer/StreamResumeSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/StreamResume.h>
@@ -17,6 +17,6 @@ namespace Swift {
public:
StreamResumeSerializer();
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement>) const;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement>) const;
};
}
diff --git a/Swiften/Serializer/StreamResumedSerializer.cpp b/Swiften/Serializer/StreamResumedSerializer.cpp
index 9778338..5b88ded 100644
--- a/Swiften/Serializer/StreamResumedSerializer.cpp
+++ b/Swiften/Serializer/StreamResumedSerializer.cpp
@@ -6,8 +6,9 @@
#include <Swiften/Serializer/StreamResumedSerializer.h>
+#include <memory>
+
#include <boost/lexical_cast.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Elements/StreamResumed.h>
#include <Swiften/Serializer/XML/XMLElement.h>
@@ -17,8 +18,8 @@ using namespace Swift;
StreamResumedSerializer::StreamResumedSerializer() : GenericElementSerializer<StreamResumed>() {
}
-SafeByteArray StreamResumedSerializer::serialize(boost::shared_ptr<ToplevelElement> el) const {
- boost::shared_ptr<StreamResumed> e(boost::dynamic_pointer_cast<StreamResumed>(el));
+SafeByteArray StreamResumedSerializer::serialize(std::shared_ptr<ToplevelElement> el) const {
+ std::shared_ptr<StreamResumed> e(std::dynamic_pointer_cast<StreamResumed>(el));
XMLElement element("resumed", "urn:xmpp:sm:2");
element.setAttribute("previd", e->getResumeID());
if (e->getHandledStanzasCount()) {
diff --git a/Swiften/Serializer/StreamResumedSerializer.h b/Swiften/Serializer/StreamResumedSerializer.h
index 82a66d7..324282b 100644
--- a/Swiften/Serializer/StreamResumedSerializer.h
+++ b/Swiften/Serializer/StreamResumedSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/StreamResumed.h>
@@ -17,6 +17,6 @@ namespace Swift {
public:
StreamResumedSerializer();
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement>) const;
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement>) const;
};
}
diff --git a/Swiften/Serializer/TLSProceedSerializer.h b/Swiften/Serializer/TLSProceedSerializer.h
index e9af0a2..f99aefd 100644
--- a/Swiften/Serializer/TLSProceedSerializer.h
+++ b/Swiften/Serializer/TLSProceedSerializer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/TLSProceed.h>
@@ -19,7 +19,7 @@ namespace Swift {
TLSProceedSerializer() : GenericElementSerializer<TLSProceed>() {
}
- virtual SafeByteArray serialize(boost::shared_ptr<ToplevelElement>) const {
+ virtual SafeByteArray serialize(std::shared_ptr<ToplevelElement>) const {
return createSafeByteArray(XMLElement("proceed", "urn:ietf:params:xml:ns:xmpp-tls").serialize());
}
};
diff --git a/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp
index 1d41e81..d313b42 100644
--- a/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/AuthChallengeSerializerTest.cpp
@@ -24,7 +24,7 @@ class AuthChallengeSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize() {
AuthChallengeSerializer testling;
- boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge());
+ std::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge());
authChallenge->setValue(createByteArray("foo"));
CPPUNIT_ASSERT_EQUAL(createSafeByteArray(
@@ -35,7 +35,7 @@ class AuthChallengeSerializerTest : public CppUnit::TestFixture {
void testSerialize_NoMessage() {
AuthChallengeSerializer testling;
- boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge());
+ std::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge());
CPPUNIT_ASSERT_EQUAL(createSafeByteArray(
"<challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
@@ -44,7 +44,7 @@ class AuthChallengeSerializerTest : public CppUnit::TestFixture {
void testSerialize_EmptyMessage() {
AuthChallengeSerializer testling;
- boost::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge());
+ std::shared_ptr<AuthChallenge> authChallenge(new AuthChallenge());
authChallenge->setValue(std::vector<unsigned char>());
CPPUNIT_ASSERT_EQUAL(createSafeByteArray(
diff --git a/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp
index 95460b2..2dc71fb 100644
--- a/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/AuthRequestSerializerTest.cpp
@@ -24,7 +24,7 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize() {
AuthRequestSerializer testling;
- boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN"));
+ std::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN"));
authRequest->setMessage(createSafeByteArray("foo"));
CPPUNIT_ASSERT_EQUAL(createSafeByteArray(
@@ -35,7 +35,7 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture {
void testSerialize_NoMessage() {
AuthRequestSerializer testling;
- boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN"));
+ std::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN"));
CPPUNIT_ASSERT_EQUAL(createSafeByteArray(
"<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"PLAIN\">"
@@ -44,7 +44,7 @@ class AuthRequestSerializerTest : public CppUnit::TestFixture {
void testSerialize_EmptyMessage() {
AuthRequestSerializer testling;
- boost::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN"));
+ std::shared_ptr<AuthRequest> authRequest(new AuthRequest("PLAIN"));
authRequest->setMessage(SafeByteArray());
CPPUNIT_ASSERT_EQUAL(createSafeByteArray(
diff --git a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp
index 67c6f16..1ee4b62 100644
--- a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp
@@ -24,7 +24,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize() {
AuthResponseSerializer testling;
- boost::shared_ptr<AuthResponse> authResponse(new AuthResponse());
+ std::shared_ptr<AuthResponse> authResponse(new AuthResponse());
authResponse->setValue(createSafeByteArray("foo"));
CPPUNIT_ASSERT_EQUAL(createSafeByteArray(
@@ -35,7 +35,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture {
void testSerialize_NoMessage() {
AuthResponseSerializer testling;
- boost::shared_ptr<AuthResponse> authResponse(new AuthResponse());
+ std::shared_ptr<AuthResponse> authResponse(new AuthResponse());
CPPUNIT_ASSERT_EQUAL(createSafeByteArray(
"<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
@@ -44,7 +44,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture {
void testSerialize_EmptyMessage() {
AuthResponseSerializer testling;
- boost::shared_ptr<AuthResponse> authResponse(new AuthResponse());
+ std::shared_ptr<AuthResponse> authResponse(new AuthResponse());
authResponse->setValue(SafeByteArray());
CPPUNIT_ASSERT_EQUAL(createSafeByteArray(
diff --git a/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp
index 228bd9b..3c4bb1b 100644
--- a/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/AuthSuccessSerializerTest.cpp
@@ -24,7 +24,7 @@ class AuthSuccessSerializerTest : public CppUnit::TestFixture {
public:
void testSerialize() {
AuthSuccessSerializer testling;
- boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess());
+ std::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess());
authSuccess->setValue(createByteArray("foo"));
CPPUNIT_ASSERT_EQUAL(createSafeByteArray(
@@ -35,7 +35,7 @@ class AuthSuccessSerializerTest : public CppUnit::TestFixture {
void testSerialize_NoMessage() {
AuthSuccessSerializer testling;
- boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess());
+ std::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess());
CPPUNIT_ASSERT_EQUAL(createSafeByteArray(
"<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
@@ -44,7 +44,7 @@ class AuthSuccessSerializerTest : public CppUnit::TestFixture {
void testSerialize_EmptyMessage() {
AuthSuccessSerializer testling;
- boost::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess());
+ std::shared_ptr<AuthSuccess> authSuccess(new AuthSuccess());
authSuccess->setValue(std::vector<unsigned char>());
CPPUNIT_ASSERT_EQUAL(createSafeByteArray(
diff --git a/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp b/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp
index 5f4f821..dd3d6c3 100644
--- a/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/StreamFeaturesSerializerTest.cpp
@@ -24,7 +24,7 @@ class StreamFeaturesSerializerTest : public CppUnit::TestFixture
void testSerialize() {
StreamFeaturesSerializer testling;
- boost::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures());
+ std::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures());
streamFeatures->setHasStartTLS();
streamFeatures->addCompressionMethod("zlib");
streamFeatures->addCompressionMethod("lzw");
diff --git a/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp b/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp
index 3eaeef0..93205fc 100644
--- a/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/XMPPSerializerTest.cpp
@@ -31,7 +31,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture {
}
void testSerializeHeader_Client() {
- boost::shared_ptr<XMPPSerializer> testling(createSerializer(ClientStreamType));
+ std::shared_ptr<XMPPSerializer> testling(createSerializer(ClientStreamType));
ProtocolHeader protocolHeader;
protocolHeader.setFrom("bla@foo.com");
protocolHeader.setTo("foo.com");
@@ -42,7 +42,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture {
}
void testSerializeHeader_Component() {
- boost::shared_ptr<XMPPSerializer> testling(createSerializer(ComponentStreamType));
+ std::shared_ptr<XMPPSerializer> testling(createSerializer(ComponentStreamType));
ProtocolHeader protocolHeader;
protocolHeader.setFrom("bla@foo.com");
protocolHeader.setTo("foo.com");
@@ -53,7 +53,7 @@ class XMPPSerializerTest : public CppUnit::TestFixture {
}
void testSerializeHeader_Server() {
- boost::shared_ptr<XMPPSerializer> testling(createSerializer(ServerStreamType));
+ std::shared_ptr<XMPPSerializer> testling(createSerializer(ServerStreamType));
ProtocolHeader protocolHeader;
protocolHeader.setFrom("bla@foo.com");
protocolHeader.setTo("foo.com");
diff --git a/Swiften/Serializer/XML/UnitTest/XMLElementTest.cpp b/Swiften/Serializer/XML/UnitTest/XMLElementTest.cpp
index edd1b0e..ed3f8ab 100644
--- a/Swiften/Serializer/XML/UnitTest/XMLElementTest.cpp
+++ b/Swiften/Serializer/XML/UnitTest/XMLElementTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -29,11 +29,11 @@ class XMLElementTest : public CppUnit::TestFixture
void testSerialize() {
XMLElement testling("foo", "http://example.com");
testling.setAttribute("myatt", "myval");
- boost::shared_ptr<XMLElement> barElement(new XMLElement("bar"));
- barElement->addNode(boost::make_shared<XMLTextNode>("Blo"));
+ std::shared_ptr<XMLElement> barElement(new XMLElement("bar"));
+ barElement->addNode(std::make_shared<XMLTextNode>("Blo"));
testling.addNode(barElement);
- boost::shared_ptr<XMLElement> bazElement(new XMLElement("baz"));
- bazElement->addNode(boost::make_shared<XMLTextNode>("Bli&</stream>"));
+ std::shared_ptr<XMLElement> bazElement(new XMLElement("baz"));
+ bazElement->addNode(std::make_shared<XMLTextNode>("Bli&</stream>"));
testling.addNode(bazElement);
std::string result = testling.serialize();
diff --git a/Swiften/Serializer/XML/XMLElement.cpp b/Swiften/Serializer/XML/XMLElement.cpp
index fc5e470..4a874ab 100644
--- a/Swiften/Serializer/XML/XMLElement.cpp
+++ b/Swiften/Serializer/XML/XMLElement.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -30,7 +30,7 @@ std::string XMLElement::serialize() {
if (!childNodes_.empty()) {
result += ">";
- foreach (boost::shared_ptr<XMLNode> node, childNodes_) {
+ foreach (std::shared_ptr<XMLNode> node, childNodes_) {
result += node->serialize();
}
result += "</" + tag_ + ">";
@@ -51,7 +51,7 @@ void XMLElement::setAttribute(const std::string& attribute, const std::string& v
attributes_[attribute] = escapedValue;
}
-void XMLElement::addNode(boost::shared_ptr<XMLNode> node) {
+void XMLElement::addNode(std::shared_ptr<XMLNode> node) {
if (node) {
childNodes_.push_back(node);
}
diff --git a/Swiften/Serializer/XML/XMLElement.h b/Swiften/Serializer/XML/XMLElement.h
index e7507f2..54de041 100644
--- a/Swiften/Serializer/XML/XMLElement.h
+++ b/Swiften/Serializer/XML/XMLElement.h
@@ -7,29 +7,28 @@
#pragma once
#include <map>
+#include <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Serializer/XML/XMLNode.h>
namespace Swift {
class SWIFTEN_API XMLElement : public XMLNode {
public:
- typedef boost::shared_ptr<XMLElement> ref;
+ typedef std::shared_ptr<XMLElement> ref;
XMLElement(const std::string& tag, const std::string& xmlns = "", const std::string& text = "");
void setAttribute(const std::string& attribute, const std::string& value);
- void addNode(boost::shared_ptr<XMLNode> node);
+ void addNode(std::shared_ptr<XMLNode> node);
virtual std::string serialize();
private:
std::string tag_;
std::map<std::string, std::string> attributes_;
- std::vector< boost::shared_ptr<XMLNode> > childNodes_;
+ std::vector< std::shared_ptr<XMLNode> > childNodes_;
};
}
diff --git a/Swiften/Serializer/XML/XMLTextNode.h b/Swiften/Serializer/XML/XMLTextNode.h
index b0f8d01..44970bf 100644
--- a/Swiften/Serializer/XML/XMLTextNode.h
+++ b/Swiften/Serializer/XML/XMLTextNode.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/String.h>
@@ -15,7 +15,7 @@
namespace Swift {
class SWIFTEN_API XMLTextNode : public XMLNode {
public:
- typedef boost::shared_ptr<XMLTextNode> ref;
+ typedef std::shared_ptr<XMLTextNode> ref;
XMLTextNode(const std::string& text) : text_(text) {
String::replaceAll(text_, '&', "&amp;"); // Should come first
diff --git a/Swiften/Serializer/XMPPSerializer.cpp b/Swiften/Serializer/XMPPSerializer.cpp
index b17e31b..8b2fd5c 100644
--- a/Swiften/Serializer/XMPPSerializer.cpp
+++ b/Swiften/Serializer/XMPPSerializer.cpp
@@ -8,9 +8,9 @@
#include <cassert>
#include <iostream>
+#include <memory>
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/foreach.h>
#include <Swiften/Elements/ProtocolHeader.h>
@@ -41,29 +41,29 @@
namespace Swift {
XMPPSerializer::XMPPSerializer(PayloadSerializerCollection* payloadSerializers, StreamType type, bool setExplictNSonTopLevelElements) : type_(type) {
- serializers_.push_back(boost::make_shared<PresenceSerializer>(payloadSerializers, setExplictNSonTopLevelElements ? getDefaultNamespace() : boost::optional<std::string>()));
- serializers_.push_back(boost::make_shared<IQSerializer>(payloadSerializers, setExplictNSonTopLevelElements ? getDefaultNamespace() : boost::optional<std::string>()));
- serializers_.push_back(boost::make_shared<MessageSerializer>(payloadSerializers, setExplictNSonTopLevelElements ? getDefaultNamespace() : boost::optional<std::string>()));
- serializers_.push_back(boost::make_shared<CompressRequestSerializer>());
- serializers_.push_back(boost::make_shared<CompressFailureSerializer>());
- serializers_.push_back(boost::make_shared<AuthRequestSerializer>());
- serializers_.push_back(boost::make_shared<AuthFailureSerializer>());
- serializers_.push_back(boost::make_shared<AuthSuccessSerializer>());
- serializers_.push_back(boost::make_shared<AuthChallengeSerializer>());
- serializers_.push_back(boost::make_shared<AuthResponseSerializer>());
- serializers_.push_back(boost::make_shared<StartTLSRequestSerializer>());
- serializers_.push_back(boost::make_shared<StartTLSFailureSerializer>());
- serializers_.push_back(boost::make_shared<TLSProceedSerializer>());
- serializers_.push_back(boost::make_shared<StreamFeaturesSerializer>());
- serializers_.push_back(boost::make_shared<StreamErrorSerializer>());
- serializers_.push_back(boost::make_shared<EnableStreamManagementSerializer>());
- serializers_.push_back(boost::make_shared<StreamManagementEnabledSerializer>());
- serializers_.push_back(boost::make_shared<StreamManagementFailedSerializer>());
- serializers_.push_back(boost::make_shared<StreamResumeSerializer>());
- serializers_.push_back(boost::make_shared<StreamResumedSerializer>());
- serializers_.push_back(boost::make_shared<StanzaAckSerializer>());
- serializers_.push_back(boost::make_shared<StanzaAckRequestSerializer>());
- serializers_.push_back(boost::make_shared<ComponentHandshakeSerializer>());
+ serializers_.push_back(std::make_shared<PresenceSerializer>(payloadSerializers, setExplictNSonTopLevelElements ? getDefaultNamespace() : boost::optional<std::string>()));
+ serializers_.push_back(std::make_shared<IQSerializer>(payloadSerializers, setExplictNSonTopLevelElements ? getDefaultNamespace() : boost::optional<std::string>()));
+ serializers_.push_back(std::make_shared<MessageSerializer>(payloadSerializers, setExplictNSonTopLevelElements ? getDefaultNamespace() : boost::optional<std::string>()));
+ serializers_.push_back(std::make_shared<CompressRequestSerializer>());
+ serializers_.push_back(std::make_shared<CompressFailureSerializer>());
+ serializers_.push_back(std::make_shared<AuthRequestSerializer>());
+ serializers_.push_back(std::make_shared<AuthFailureSerializer>());
+ serializers_.push_back(std::make_shared<AuthSuccessSerializer>());
+ serializers_.push_back(std::make_shared<AuthChallengeSerializer>());
+ serializers_.push_back(std::make_shared<AuthResponseSerializer>());
+ serializers_.push_back(std::make_shared<StartTLSRequestSerializer>());
+ serializers_.push_back(std::make_shared<StartTLSFailureSerializer>());
+ serializers_.push_back(std::make_shared<TLSProceedSerializer>());
+ serializers_.push_back(std::make_shared<StreamFeaturesSerializer>());
+ serializers_.push_back(std::make_shared<StreamErrorSerializer>());
+ serializers_.push_back(std::make_shared<EnableStreamManagementSerializer>());
+ serializers_.push_back(std::make_shared<StreamManagementEnabledSerializer>());
+ serializers_.push_back(std::make_shared<StreamManagementFailedSerializer>());
+ serializers_.push_back(std::make_shared<StreamResumeSerializer>());
+ serializers_.push_back(std::make_shared<StreamResumedSerializer>());
+ serializers_.push_back(std::make_shared<StanzaAckSerializer>());
+ serializers_.push_back(std::make_shared<StanzaAckRequestSerializer>());
+ serializers_.push_back(std::make_shared<ComponentHandshakeSerializer>());
}
std::string XMPPSerializer::serializeHeader(const ProtocolHeader& header) const {
@@ -84,8 +84,8 @@ std::string XMPPSerializer::serializeHeader(const ProtocolHeader& header) const
return result;
}
-SafeByteArray XMPPSerializer::serializeElement(boost::shared_ptr<ToplevelElement> element) const {
- std::vector< boost::shared_ptr<ElementSerializer> >::const_iterator i = std::find_if(serializers_.begin(), serializers_.end(), boost::bind(&ElementSerializer::canSerialize, _1, element));
+SafeByteArray XMPPSerializer::serializeElement(std::shared_ptr<ToplevelElement> element) const {
+ std::vector< std::shared_ptr<ElementSerializer> >::const_iterator i = std::find_if(serializers_.begin(), serializers_.end(), boost::bind(&ElementSerializer::canSerialize, _1, element));
if (i != serializers_.end()) {
return (*i)->serialize(element);
}
diff --git a/Swiften/Serializer/XMPPSerializer.h b/Swiften/Serializer/XMPPSerializer.h
index a771fdd..8c182e3 100644
--- a/Swiften/Serializer/XMPPSerializer.h
+++ b/Swiften/Serializer/XMPPSerializer.h
@@ -6,11 +6,10 @@
#pragma once
+#include <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Elements/StreamType.h>
#include <Swiften/Elements/ToplevelElement.h>
@@ -26,7 +25,7 @@ namespace Swift {
XMPPSerializer(PayloadSerializerCollection*, StreamType type, bool setExplictNSonTopLevelElements);
std::string serializeHeader(const ProtocolHeader&) const;
- SafeByteArray serializeElement(boost::shared_ptr<ToplevelElement> stanza) const;
+ SafeByteArray serializeElement(std::shared_ptr<ToplevelElement> stanza) const;
std::string serializeFooter() const;
private:
@@ -34,6 +33,6 @@ namespace Swift {
private:
StreamType type_;
- std::vector< boost::shared_ptr<ElementSerializer> > serializers_;
+ std::vector< std::shared_ptr<ElementSerializer> > serializers_;
};
}
diff --git a/Swiften/Session/BOSHSessionStream.cpp b/Swiften/Session/BOSHSessionStream.cpp
index dd6e83a..635fd69 100644
--- a/Swiften/Session/BOSHSessionStream.cpp
+++ b/Swiften/Session/BOSHSessionStream.cpp
@@ -40,7 +40,7 @@ BOSHSessionStream::BOSHSessionStream(const URL& boshURL,
const SafeString& boshHTTPConnectProxyAuthID,
const SafeString& boshHTTPConnectProxyAuthPassword,
const TLSOptions& tlsOptions,
- boost::shared_ptr<HTTPTrafficFilter> trafficFilter) :
+ std::shared_ptr<HTTPTrafficFilter> trafficFilter) :
available(false),
eventLoop(eventLoop),
firstHeader(true) {
@@ -92,7 +92,7 @@ void BOSHSessionStream::handlePoolXMPPDataRead(const SafeByteArray& data) {
xmppLayer->handleDataRead(data);
}
-void BOSHSessionStream::writeElement(boost::shared_ptr<ToplevelElement> element) {
+void BOSHSessionStream::writeElement(std::shared_ptr<ToplevelElement> element) {
assert(available);
xmppLayer->writeElement(element);
}
@@ -134,7 +134,7 @@ std::vector<Certificate::ref> BOSHSessionStream::getPeerCertificateChain() const
return connectionPool->getPeerCertificateChain();
}
-boost::shared_ptr<CertificateVerificationError> BOSHSessionStream::getPeerCertificateVerificationError() const {
+std::shared_ptr<CertificateVerificationError> BOSHSessionStream::getPeerCertificateVerificationError() const {
return connectionPool->getPeerCertificateVerificationError();
}
@@ -162,13 +162,13 @@ void BOSHSessionStream::handleStreamStartReceived(const ProtocolHeader& header)
onStreamStartReceived(header);
}
-void BOSHSessionStream::handleElementReceived(boost::shared_ptr<ToplevelElement> element) {
+void BOSHSessionStream::handleElementReceived(std::shared_ptr<ToplevelElement> element) {
onElementReceived(element);
}
void BOSHSessionStream::handleXMPPError() {
available = false;
- onClosed(boost::make_shared<SessionStreamError>(SessionStreamError::ParseError));
+ onClosed(std::make_shared<SessionStreamError>(SessionStreamError::ParseError));
}
void BOSHSessionStream::handlePoolSessionStarted() {
diff --git a/Swiften/Session/BOSHSessionStream.h b/Swiften/Session/BOSHSessionStream.h
index 17292f4..0c26848 100644
--- a/Swiften/Session/BOSHSessionStream.h
+++ b/Swiften/Session/BOSHSessionStream.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeByteArray.h>
@@ -30,7 +30,7 @@ namespace Swift {
class XMLParserFactory;
class XMPPLayer;
- class SWIFTEN_API BOSHSessionStream : public SessionStream, public EventOwner, public boost::enable_shared_from_this<BOSHSessionStream> {
+ class SWIFTEN_API BOSHSessionStream : public SessionStream, public EventOwner, public std::enable_shared_from_this<BOSHSessionStream> {
public:
BOSHSessionStream(
const URL& boshURL,
@@ -47,7 +47,7 @@ namespace Swift {
const SafeString& boshHTTPConnectProxyAuthID,
const SafeString& boshHTTPConnectProxyAuthPassword,
const TLSOptions& tlsOptions,
- boost::shared_ptr<HTTPTrafficFilter> trafficFilter
+ std::shared_ptr<HTTPTrafficFilter> trafficFilter
);
virtual ~BOSHSessionStream();
@@ -56,7 +56,7 @@ namespace Swift {
virtual bool isOpen();
virtual void writeHeader(const ProtocolHeader& header);
- virtual void writeElement(boost::shared_ptr<ToplevelElement>);
+ virtual void writeElement(std::shared_ptr<ToplevelElement>);
virtual void writeFooter();
virtual void writeData(const std::string& data);
@@ -68,7 +68,7 @@ namespace Swift {
virtual bool isTLSEncrypted();
virtual Certificate::ref getPeerCertificate() const;
virtual std::vector<Certificate::ref> getPeerCertificateChain() const;
- virtual boost::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const;
+ virtual std::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const;
virtual ByteArray getTLSFinishMessage() const;
virtual void setWhitespacePingEnabled(bool);
@@ -78,7 +78,7 @@ namespace Swift {
private:
void handleXMPPError();
void handleStreamStartReceived(const ProtocolHeader&);
- void handleElementReceived(boost::shared_ptr<ToplevelElement>);
+ void handleElementReceived(std::shared_ptr<ToplevelElement>);
void handlePoolXMPPDataRead(const SafeByteArray& data);
void handleXMPPLayerDataWritten(const SafeByteArray& data);
void handlePoolSessionStarted();
diff --git a/Swiften/Session/BasicSessionStream.cpp b/Swiften/Session/BasicSessionStream.cpp
index a6f1421..402f642 100644
--- a/Swiften/Session/BasicSessionStream.cpp
+++ b/Swiften/Session/BasicSessionStream.cpp
@@ -6,8 +6,9 @@
#include <Swiften/Session/BasicSessionStream.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/StreamStack/CompressionLayer.h>
#include <Swiften/StreamStack/ConnectionLayer.h>
@@ -22,7 +23,7 @@ namespace Swift {
BasicSessionStream::BasicSessionStream(
StreamType streamType,
- boost::shared_ptr<Connection> connection,
+ std::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
TLSContextFactory* tlsContextFactory,
@@ -79,7 +80,7 @@ void BasicSessionStream::writeHeader(const ProtocolHeader& header) {
xmppLayer->writeHeader(header);
}
-void BasicSessionStream::writeElement(boost::shared_ptr<ToplevelElement> element) {
+void BasicSessionStream::writeElement(std::shared_ptr<ToplevelElement> element) {
assert(available);
xmppLayer->writeElement(element);
}
@@ -110,7 +111,7 @@ void BasicSessionStream::addTLSEncryption() {
assert(available);
tlsLayer = new TLSLayer(tlsContextFactory, tlsOptions_);
if (hasTLSCertificate() && !tlsLayer->setClientCertificate(getTLSCertificate())) {
- onClosed(boost::make_shared<SessionStreamError>(SessionStreamError::InvalidTLSCertificateError));
+ onClosed(std::make_shared<SessionStreamError>(SessionStreamError::InvalidTLSCertificateError));
}
else {
streamStack->addLayer(tlsLayer);
@@ -132,7 +133,7 @@ std::vector<Certificate::ref> BasicSessionStream::getPeerCertificateChain() cons
return tlsLayer->getPeerCertificateChain();
}
-boost::shared_ptr<CertificateVerificationError> BasicSessionStream::getPeerCertificateVerificationError() const {
+std::shared_ptr<CertificateVerificationError> BasicSessionStream::getPeerCertificateVerificationError() const {
return tlsLayer->getPeerCertificateVerificationError();
}
@@ -170,20 +171,20 @@ void BasicSessionStream::handleStreamStartReceived(const ProtocolHeader& header)
onStreamStartReceived(header);
}
-void BasicSessionStream::handleElementReceived(boost::shared_ptr<ToplevelElement> element) {
+void BasicSessionStream::handleElementReceived(std::shared_ptr<ToplevelElement> element) {
onElementReceived(element);
}
void BasicSessionStream::handleXMPPError() {
available = false;
- onClosed(boost::make_shared<SessionStreamError>(SessionStreamError::ParseError));
+ onClosed(std::make_shared<SessionStreamError>(SessionStreamError::ParseError));
}
void BasicSessionStream::handleTLSConnected() {
onTLSEncrypted();
}
-void BasicSessionStream::handleTLSError(boost::shared_ptr<TLSError> error) {
+void BasicSessionStream::handleTLSError(std::shared_ptr<TLSError> error) {
available = false;
onClosed(error);
}
@@ -191,13 +192,13 @@ void BasicSessionStream::handleTLSError(boost::shared_ptr<TLSError> error) {
void BasicSessionStream::handleConnectionFinished(const boost::optional<Connection::Error>& error) {
available = false;
if (error == Connection::ReadError) {
- onClosed(boost::make_shared<SessionStreamError>(SessionStreamError::ConnectionReadError));
+ onClosed(std::make_shared<SessionStreamError>(SessionStreamError::ConnectionReadError));
}
else if (error) {
- onClosed(boost::make_shared<SessionStreamError>(SessionStreamError::ConnectionWriteError));
+ onClosed(std::make_shared<SessionStreamError>(SessionStreamError::ConnectionWriteError));
}
else {
- onClosed(boost::shared_ptr<SessionStreamError>());
+ onClosed(std::shared_ptr<SessionStreamError>());
}
}
diff --git a/Swiften/Session/BasicSessionStream.h b/Swiften/Session/BasicSessionStream.h
index db4a7e0..1806cef 100644
--- a/Swiften/Session/BasicSessionStream.h
+++ b/Swiften/Session/BasicSessionStream.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeByteArray.h>
@@ -33,7 +33,7 @@ namespace Swift {
public:
BasicSessionStream(
StreamType streamType,
- boost::shared_ptr<Connection> connection,
+ std::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
TLSContextFactory* tlsContextFactory,
@@ -47,7 +47,7 @@ namespace Swift {
virtual bool isOpen();
virtual void writeHeader(const ProtocolHeader& header);
- virtual void writeElement(boost::shared_ptr<ToplevelElement>);
+ virtual void writeElement(std::shared_ptr<ToplevelElement>);
virtual void writeFooter();
virtual void writeData(const std::string& data);
@@ -60,7 +60,7 @@ namespace Swift {
virtual Certificate::ref getPeerCertificate() const;
virtual std::vector<Certificate::ref> getPeerCertificateChain() const;
- virtual boost::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const;
+ virtual std::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const;
virtual ByteArray getTLSFinishMessage() const;
virtual void setWhitespacePingEnabled(bool);
@@ -71,15 +71,15 @@ namespace Swift {
void handleConnectionFinished(const boost::optional<Connection::Error>& error);
void handleXMPPError();
void handleTLSConnected();
- void handleTLSError(boost::shared_ptr<TLSError>);
+ void handleTLSError(std::shared_ptr<TLSError>);
void handleStreamStartReceived(const ProtocolHeader&);
- void handleElementReceived(boost::shared_ptr<ToplevelElement>);
+ void handleElementReceived(std::shared_ptr<ToplevelElement>);
void handleDataRead(const SafeByteArray& data);
void handleDataWritten(const SafeByteArray& data);
private:
bool available;
- boost::shared_ptr<Connection> connection;
+ std::shared_ptr<Connection> connection;
TLSContextFactory* tlsContextFactory;
TimerFactory* timerFactory;
XMPPLayer* xmppLayer;
diff --git a/Swiften/Session/Session.cpp b/Swiften/Session/Session.cpp
index 82514c1..ebdb5d1 100644
--- a/Swiften/Session/Session.cpp
+++ b/Swiften/Session/Session.cpp
@@ -14,7 +14,7 @@
namespace Swift {
Session::Session(
- boost::shared_ptr<Connection> connection,
+ std::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
XMLParserFactory* xmlParserFactory) :
@@ -76,7 +76,7 @@ void Session::initializeStreamStack() {
streamStack = new StreamStack(xmppLayer, connectionLayer);
}
-void Session::sendElement(boost::shared_ptr<ToplevelElement> stanza) {
+void Session::sendElement(std::shared_ptr<ToplevelElement> stanza) {
xmppLayer->writeElement(stanza);
}
diff --git a/Swiften/Session/Session.h b/Swiften/Session/Session.h
index d01833d..911bd34 100644
--- a/Swiften/Session/Session.h
+++ b/Swiften/Session/Session.h
@@ -6,9 +6,9 @@
#pragma once
-#include <boost/enable_shared_from_this.hpp>
+#include <memory>
+
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeByteArray.h>
@@ -28,7 +28,7 @@ namespace Swift {
class XMPPLayer;
class XMLParserFactory;
- class SWIFTEN_API Session : public boost::enable_shared_from_this<Session> {
+ class SWIFTEN_API Session : public std::enable_shared_from_this<Session> {
public:
enum SessionError {
ConnectionReadError,
@@ -45,7 +45,7 @@ namespace Swift {
};
Session(
- boost::shared_ptr<Connection> connection,
+ std::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
XMLParserFactory* xmlParserFactory);
@@ -54,7 +54,7 @@ namespace Swift {
void startSession();
void finishSession();
- void sendElement(boost::shared_ptr<ToplevelElement>);
+ void sendElement(std::shared_ptr<ToplevelElement>);
const JID& getLocalJID() const {
return localJID;
@@ -64,7 +64,7 @@ namespace Swift {
return remoteJID;
}
- boost::signal<void (boost::shared_ptr<ToplevelElement>)> onElementReceived;
+ boost::signal<void (std::shared_ptr<ToplevelElement>)> onElementReceived;
boost::signal<void (const boost::optional<SessionError>&)> onSessionFinished;
boost::signal<void (const SafeByteArray&)> onDataWritten;
boost::signal<void (const SafeByteArray&)> onDataRead;
@@ -82,7 +82,7 @@ namespace Swift {
virtual void handleSessionStarted() {}
virtual void handleSessionFinished(const boost::optional<SessionError>&) {}
- virtual void handleElement(boost::shared_ptr<ToplevelElement>) = 0;
+ virtual void handleElement(std::shared_ptr<ToplevelElement>) = 0;
virtual void handleStreamStart(const ProtocolHeader&) = 0;
void initializeStreamStack();
@@ -103,7 +103,7 @@ namespace Swift {
private:
JID localJID;
JID remoteJID;
- boost::shared_ptr<Connection> connection;
+ std::shared_ptr<Connection> connection;
PayloadParserFactoryCollection* payloadParserFactories;
PayloadSerializerCollection* payloadSerializers;
XMLParserFactory* xmlParserFactory;
diff --git a/Swiften/Session/SessionStream.h b/Swiften/Session/SessionStream.h
index 18404c6..4b86cee 100644
--- a/Swiften/Session/SessionStream.h
+++ b/Swiften/Session/SessionStream.h
@@ -6,8 +6,9 @@
#pragma once
+#include <memory>
+
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Error.h>
@@ -46,7 +47,7 @@ namespace Swift {
virtual void writeHeader(const ProtocolHeader& header) = 0;
virtual void writeFooter() = 0;
- virtual void writeElement(boost::shared_ptr<ToplevelElement>) = 0;
+ virtual void writeElement(std::shared_ptr<ToplevelElement>) = 0;
virtual void writeData(const std::string& data) = 0;
virtual bool supportsZLibCompression() = 0;
@@ -69,13 +70,13 @@ namespace Swift {
virtual Certificate::ref getPeerCertificate() const = 0;
virtual std::vector<Certificate::ref> getPeerCertificateChain() const = 0;
- virtual boost::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const = 0;
+ virtual std::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const = 0;
virtual ByteArray getTLSFinishMessage() const = 0;
boost::signal<void (const ProtocolHeader&)> onStreamStartReceived;
- boost::signal<void (boost::shared_ptr<ToplevelElement>)> onElementReceived;
- boost::signal<void (boost::shared_ptr<Error>)> onClosed;
+ boost::signal<void (std::shared_ptr<ToplevelElement>)> onElementReceived;
+ boost::signal<void (std::shared_ptr<Error>)> onClosed;
boost::signal<void ()> onTLSEncrypted;
boost::signal<void (const SafeByteArray&)> onDataRead;
boost::signal<void (const SafeByteArray&)> onDataWritten;
diff --git a/Swiften/Session/SessionTracer.cpp b/Swiften/Session/SessionTracer.cpp
index aa44b9c..49b369d 100644
--- a/Swiften/Session/SessionTracer.cpp
+++ b/Swiften/Session/SessionTracer.cpp
@@ -12,7 +12,7 @@
namespace Swift {
-SessionTracer::SessionTracer(boost::shared_ptr<Session> session) : session(session) {
+SessionTracer::SessionTracer(std::shared_ptr<Session> session) : session(session) {
session->onDataRead.connect(boost::bind(&SessionTracer::printData, this, '<', _1));
session->onDataWritten.connect(boost::bind(&SessionTracer::printData, this, '>', _1));
}
diff --git a/Swiften/Session/SessionTracer.h b/Swiften/Session/SessionTracer.h
index 3993a87..8e73c16 100644
--- a/Swiften/Session/SessionTracer.h
+++ b/Swiften/Session/SessionTracer.h
@@ -15,11 +15,11 @@
namespace Swift {
class SWIFTEN_API SessionTracer {
public:
- SessionTracer(boost::shared_ptr<Session> session);
+ SessionTracer(std::shared_ptr<Session> session);
private:
void printData(char direction, const SafeByteArray& data);
- boost::shared_ptr<Session> session;
+ std::shared_ptr<Session> session;
};
}
diff --git a/Swiften/StreamManagement/StanzaAckRequester.cpp b/Swiften/StreamManagement/StanzaAckRequester.cpp
index ceafe28..8e9e7f3 100644
--- a/Swiften/StreamManagement/StanzaAckRequester.cpp
+++ b/Swiften/StreamManagement/StanzaAckRequester.cpp
@@ -20,9 +20,9 @@ StanzaAckRequester::StanzaAckRequester() : lastHandledStanzasCount(0) {
}
-void StanzaAckRequester::handleStanzaSent(boost::shared_ptr<Stanza> stanza) {
+void StanzaAckRequester::handleStanzaSent(std::shared_ptr<Stanza> stanza) {
unackedStanzas.push_back(stanza);
- if (boost::dynamic_pointer_cast<Message>(stanza)) {
+ if (std::dynamic_pointer_cast<Message>(stanza)) {
onRequestAck();
}
}
@@ -34,7 +34,7 @@ void StanzaAckRequester::handleAckReceived(unsigned int handledStanzasCount) {
std::cerr << "Warning: Server acked more stanzas than we sent" << std::endl;
break;
}
- boost::shared_ptr<Stanza> ackedStanza = unackedStanzas.front();
+ std::shared_ptr<Stanza> ackedStanza = unackedStanzas.front();
unackedStanzas.pop_front();
onStanzaAcked(ackedStanza);
i = (i == MAX_HANDLED_STANZA_COUNT ? 0 : i + 1);
diff --git a/Swiften/StreamManagement/StanzaAckRequester.h b/Swiften/StreamManagement/StanzaAckRequester.h
index 4d913bb..dda1395 100644
--- a/Swiften/StreamManagement/StanzaAckRequester.h
+++ b/Swiften/StreamManagement/StanzaAckRequester.h
@@ -7,8 +7,7 @@
#pragma once
#include <deque>
-
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
@@ -19,17 +18,17 @@ namespace Swift {
public:
StanzaAckRequester();
- void handleStanzaSent(boost::shared_ptr<Stanza> stanza);
+ void handleStanzaSent(std::shared_ptr<Stanza> stanza);
void handleAckReceived(unsigned int handledStanzasCount);
public:
boost::signal<void ()> onRequestAck;
- boost::signal<void (boost::shared_ptr<Stanza>)> onStanzaAcked;
+ boost::signal<void (std::shared_ptr<Stanza>)> onStanzaAcked;
private:
friend class StanzaAckRequesterTest;
unsigned int lastHandledStanzasCount;
- std::deque<boost::shared_ptr<Stanza> > unackedStanzas;
+ std::deque<std::shared_ptr<Stanza> > unackedStanzas;
};
}
diff --git a/Swiften/StreamManagement/StanzaAckResponder.h b/Swiften/StreamManagement/StanzaAckResponder.h
index 16c8825..389606e 100644
--- a/Swiften/StreamManagement/StanzaAckResponder.h
+++ b/Swiften/StreamManagement/StanzaAckResponder.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
diff --git a/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp b/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp
index 55e6012..b1bc7c2 100644
--- a/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp
+++ b/Swiften/StreamManagement/UnitTest/StanzaAckRequesterTest.cpp
@@ -37,28 +37,28 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
}
void testHandleStanzaSent_MessageRequestsAck() {
- boost::shared_ptr<StanzaAckRequester> testling(createRequester());
+ std::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createMessage("m1"));
CPPUNIT_ASSERT_EQUAL(1, acksRequested);
}
void testHandleStanzaSent_IQDoesNotRequestAck() {
- boost::shared_ptr<StanzaAckRequester> testling(createRequester());
+ std::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createIQ("iq1"));
CPPUNIT_ASSERT_EQUAL(0, acksRequested);
}
void testHandleStanzaSent_PresenceDoesNotRequestAck() {
- boost::shared_ptr<StanzaAckRequester> testling(createRequester());
+ std::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createPresence("p1"));
CPPUNIT_ASSERT_EQUAL(0, acksRequested);
}
void testHandleAckReceived_AcksStanza() {
- boost::shared_ptr<StanzaAckRequester> testling(createRequester());
+ std::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createMessage("m1"));
testling->handleAckReceived(1);
@@ -68,7 +68,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
}
void testHandleAckReceived_AcksMultipleMessages() {
- boost::shared_ptr<StanzaAckRequester> testling(createRequester());
+ std::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createMessage("m1"));
testling->handleStanzaSent(createMessage("m2"));
@@ -80,7 +80,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
}
void testHandleAckReceived_AcksMultipleStanzas() {
- boost::shared_ptr<StanzaAckRequester> testling(createRequester());
+ std::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createIQ("iq1"));
testling->handleStanzaSent(createPresence("p1"));
testling->handleStanzaSent(createMessage("m1"));
@@ -94,7 +94,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
}
void testHandleAckReceived_MultipleAcks() {
- boost::shared_ptr<StanzaAckRequester> testling(createRequester());
+ std::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->handleStanzaSent(createMessage("m1"));
testling->handleAckReceived(1);
@@ -110,7 +110,7 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
// Handle stanza ack count wrapping, as per the XEP
void testHandleAckReceived_WrapAround() {
- boost::shared_ptr<StanzaAckRequester> testling(createRequester());
+ std::shared_ptr<StanzaAckRequester> testling(createRequester());
testling->lastHandledStanzasCount = boost::numeric_cast<unsigned int>((1ULL<<32) - 1);
testling->handleStanzaSent(createMessage("m1"));
testling->handleStanzaSent(createMessage("m2"));
@@ -152,13 +152,13 @@ class StanzaAckRequesterTest : public CppUnit::TestFixture {
acksRequested++;
}
- void handleStanzaAcked(boost::shared_ptr<Stanza> stanza) {
+ void handleStanzaAcked(std::shared_ptr<Stanza> stanza) {
ackedStanzas.push_back(stanza);
}
private:
int acksRequested;
- std::vector< boost::shared_ptr<Stanza> > ackedStanzas;
+ std::vector< std::shared_ptr<Stanza> > ackedStanzas;
};
}
diff --git a/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp b/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp
index 70cd8fc..ffdabe9 100644
--- a/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp
+++ b/Swiften/StreamManagement/UnitTest/StanzaAckResponderTest.cpp
@@ -27,7 +27,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture {
public:
void testHandleAckRequestReceived_AcksStanza() {
- boost::shared_ptr<StanzaAckResponder> testling(createResponder());
+ std::shared_ptr<StanzaAckResponder> testling(createResponder());
testling->handleStanzaReceived();
testling->handleAckRequestReceived();
@@ -37,7 +37,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture {
}
void testHandleAckRequestReceived_AcksMultipleStanzas() {
- boost::shared_ptr<StanzaAckResponder> testling(createResponder());
+ std::shared_ptr<StanzaAckResponder> testling(createResponder());
testling->handleStanzaReceived();
testling->handleStanzaReceived();
@@ -48,7 +48,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture {
}
void testHandleAckRequestReceived_MultipleAcks() {
- boost::shared_ptr<StanzaAckResponder> testling(createResponder());
+ std::shared_ptr<StanzaAckResponder> testling(createResponder());
testling->handleStanzaReceived();
testling->handleAckRequestReceived();
@@ -62,7 +62,7 @@ class StanzaAckResponderTest : public CppUnit::TestFixture {
// Handle stanza ack count wrapping, as per the XEP
void testHandleAckRequestReceived_WrapAround() {
- boost::shared_ptr<StanzaAckResponder> testling(createResponder());
+ std::shared_ptr<StanzaAckResponder> testling(createResponder());
testling->handledStanzasCount = boost::numeric_cast<unsigned int>((1ULL<<32) - 1);
testling->handleStanzaReceived();
testling->handleStanzaReceived();
diff --git a/Swiften/StreamStack/ConnectionLayer.cpp b/Swiften/StreamStack/ConnectionLayer.cpp
index 09b6f87..b0c4deb 100644
--- a/Swiften/StreamStack/ConnectionLayer.cpp
+++ b/Swiften/StreamStack/ConnectionLayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -10,7 +10,7 @@
namespace Swift {
-ConnectionLayer::ConnectionLayer(boost::shared_ptr<Connection> connection) : connection(connection) {
+ConnectionLayer::ConnectionLayer(std::shared_ptr<Connection> connection) : connection(connection) {
connection->onDataRead.connect(boost::bind(&ConnectionLayer::handleDataRead, this, _1));
}
@@ -18,7 +18,7 @@ ConnectionLayer::~ConnectionLayer() {
connection->onDataRead.disconnect(boost::bind(&ConnectionLayer::handleDataRead, this, _1));
}
-void ConnectionLayer::handleDataRead(boost::shared_ptr<SafeByteArray> data) {
+void ConnectionLayer::handleDataRead(std::shared_ptr<SafeByteArray> data) {
writeDataToParentLayer(*data);
}
diff --git a/Swiften/StreamStack/ConnectionLayer.h b/Swiften/StreamStack/ConnectionLayer.h
index c2d0fde..d1775ee 100644
--- a/Swiften/StreamStack/ConnectionLayer.h
+++ b/Swiften/StreamStack/ConnectionLayer.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Network/Connection.h>
@@ -15,7 +15,7 @@
namespace Swift {
class SWIFTEN_API ConnectionLayer : public LowLayer {
public:
- ConnectionLayer(boost::shared_ptr<Connection> connection);
+ ConnectionLayer(std::shared_ptr<Connection> connection);
virtual ~ConnectionLayer();
void writeData(const SafeByteArray& data) {
@@ -23,9 +23,9 @@ namespace Swift {
}
private:
- void handleDataRead(boost::shared_ptr<SafeByteArray>);
+ void handleDataRead(std::shared_ptr<SafeByteArray>);
private:
- boost::shared_ptr<Connection> connection;
+ std::shared_ptr<Connection> connection;
};
}
diff --git a/Swiften/StreamStack/StreamStack.h b/Swiften/StreamStack/StreamStack.h
index 74b92d7..718aa32 100644
--- a/Swiften/StreamStack/StreamStack.h
+++ b/Swiften/StreamStack/StreamStack.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/Stanza.h>
diff --git a/Swiften/StreamStack/TLSLayer.cpp b/Swiften/StreamStack/TLSLayer.cpp
index 3ab885a..ced879e 100644
--- a/Swiften/StreamStack/TLSLayer.cpp
+++ b/Swiften/StreamStack/TLSLayer.cpp
@@ -49,7 +49,7 @@ std::vector<Certificate::ref> TLSLayer::getPeerCertificateChain() const {
return context->getPeerCertificateChain();
}
-boost::shared_ptr<CertificateVerificationError> TLSLayer::getPeerCertificateVerificationError() const {
+std::shared_ptr<CertificateVerificationError> TLSLayer::getPeerCertificateVerificationError() const {
return context->getPeerCertificateVerificationError();
}
diff --git a/Swiften/StreamStack/TLSLayer.h b/Swiften/StreamStack/TLSLayer.h
index b9072f3..8782753 100644
--- a/Swiften/StreamStack/TLSLayer.h
+++ b/Swiften/StreamStack/TLSLayer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -30,7 +30,7 @@ namespace Swift {
Certificate::ref getPeerCertificate() const;
std::vector<Certificate::ref> getPeerCertificateChain() const;
- boost::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const;
+ std::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const;
void writeData(const SafeByteArray& data);
void handleDataRead(const SafeByteArray& data);
@@ -40,7 +40,7 @@ namespace Swift {
}
public:
- boost::signal<void (boost::shared_ptr<TLSError>)> onError;
+ boost::signal<void (std::shared_ptr<TLSError>)> onError;
boost::signal<void ()> onConnected;
private:
diff --git a/Swiften/StreamStack/UnitTest/StreamStackTest.cpp b/Swiften/StreamStack/UnitTest/StreamStackTest.cpp
index 7044ad9..6d50b77 100644
--- a/Swiften/StreamStack/UnitTest/StreamStackTest.cpp
+++ b/Swiften/StreamStack/UnitTest/StreamStackTest.cpp
@@ -61,7 +61,7 @@ class StreamStackTest : public CppUnit::TestFixture {
void testWriteData_OneIntermediateStream() {
StreamStack testling(xmppStream_, physicalStream_);
- boost::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("X"));
+ std::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("X"));
testling.addLayer(xStream.get());
xmppStream_->writeData("foo");
@@ -72,8 +72,8 @@ class StreamStackTest : public CppUnit::TestFixture {
void testWriteData_TwoIntermediateStreamStack() {
StreamStack testling(xmppStream_, physicalStream_);
- boost::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("X"));
- boost::shared_ptr<MyStreamLayer> yStream(new MyStreamLayer("Y"));
+ std::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("X"));
+ std::shared_ptr<MyStreamLayer> yStream(new MyStreamLayer("Y"));
testling.addLayer(xStream.get());
testling.addLayer(yStream.get());
@@ -95,7 +95,7 @@ class StreamStackTest : public CppUnit::TestFixture {
void testReadData_OneIntermediateStream() {
StreamStack testling(xmppStream_, physicalStream_);
xmppStream_->onElement.connect(boost::bind(&StreamStackTest::handleElement, this, _1));
- boost::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("<"));
+ std::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("<"));
testling.addLayer(xStream.get());
physicalStream_->onDataRead(createSafeByteArray("stream:stream xmlns:stream='http://etherx.jabber.org/streams'><presence/>"));
@@ -106,8 +106,8 @@ class StreamStackTest : public CppUnit::TestFixture {
void testReadData_TwoIntermediateStreamStack() {
StreamStack testling(xmppStream_, physicalStream_);
xmppStream_->onElement.connect(boost::bind(&StreamStackTest::handleElement, this, _1));
- boost::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("s"));
- boost::shared_ptr<MyStreamLayer> yStream(new MyStreamLayer("<"));
+ std::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("s"));
+ std::shared_ptr<MyStreamLayer> yStream(new MyStreamLayer("<"));
testling.addLayer(xStream.get());
testling.addLayer(yStream.get());
@@ -119,7 +119,7 @@ class StreamStackTest : public CppUnit::TestFixture {
void testAddLayer_ExistingOnWriteDataSlot() {
StreamStack testling(xmppStream_, physicalStream_);
xmppStream_->onWriteData.connect(boost::bind(&StreamStackTest::handleWriteData, this, _1));
- boost::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("X"));
+ std::shared_ptr<MyStreamLayer> xStream(new MyStreamLayer("X"));
testling.addLayer(xStream.get());
xmppStream_->writeData("foo");
@@ -127,7 +127,7 @@ class StreamStackTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, dataWriteReceived_);
}
- void handleElement(boost::shared_ptr<ToplevelElement>) {
+ void handleElement(std::shared_ptr<ToplevelElement>) {
++elementsReceived_;
}
diff --git a/Swiften/StreamStack/UnitTest/XMPPLayerTest.cpp b/Swiften/StreamStack/UnitTest/XMPPLayerTest.cpp
index 86e02ba..6d1d537 100644
--- a/Swiften/StreamStack/UnitTest/XMPPLayerTest.cpp
+++ b/Swiften/StreamStack/UnitTest/XMPPLayerTest.cpp
@@ -85,7 +85,7 @@ class XMPPLayerTest : public CppUnit::TestFixture {
}
void testWriteElement() {
- testling_->writeElement(boost::make_shared<Presence>());
+ testling_->writeElement(std::make_shared<Presence>());
CPPUNIT_ASSERT_EQUAL(std::string("<presence/>"), lowLayer_->writtenData);
}
@@ -96,11 +96,11 @@ class XMPPLayerTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(std::string("</stream:stream>"), lowLayer_->writtenData);
}
- void handleElement(boost::shared_ptr<ToplevelElement>) {
+ void handleElement(std::shared_ptr<ToplevelElement>) {
++elementsReceived_;
}
- void handleElementAndReset(boost::shared_ptr<ToplevelElement>) {
+ void handleElementAndReset(std::shared_ptr<ToplevelElement>) {
++elementsReceived_;
testling_->resetParser();
}
diff --git a/Swiften/StreamStack/WhitespacePingLayer.h b/Swiften/StreamStack/WhitespacePingLayer.h
index 41189ba..c9ffe92 100644
--- a/Swiften/StreamStack/WhitespacePingLayer.h
+++ b/Swiften/StreamStack/WhitespacePingLayer.h
@@ -6,8 +6,9 @@
#pragma once
+#include <memory>
+
#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/StreamStack/StreamLayer.h>
@@ -35,6 +36,6 @@ namespace Swift {
private:
bool isActive;
- boost::shared_ptr<Timer> timer;
+ std::shared_ptr<Timer> timer;
};
}
diff --git a/Swiften/StreamStack/XMPPLayer.cpp b/Swiften/StreamStack/XMPPLayer.cpp
index e0d683c..2eed906 100644
--- a/Swiften/StreamStack/XMPPLayer.cpp
+++ b/Swiften/StreamStack/XMPPLayer.cpp
@@ -41,7 +41,7 @@ void XMPPLayer::writeFooter() {
writeDataInternal(createSafeByteArray(xmppSerializer_->serializeFooter()));
}
-void XMPPLayer::writeElement(boost::shared_ptr<ToplevelElement> element) {
+void XMPPLayer::writeElement(std::shared_ptr<ToplevelElement> element) {
writeDataInternal(xmppSerializer_->serializeElement(element));
}
@@ -81,7 +81,7 @@ void XMPPLayer::handleStreamStart(const ProtocolHeader& header) {
onStreamStart(header);
}
-void XMPPLayer::handleElement(boost::shared_ptr<ToplevelElement> stanza) {
+void XMPPLayer::handleElement(std::shared_ptr<ToplevelElement> stanza) {
onElement(stanza);
}
diff --git a/Swiften/StreamStack/XMPPLayer.h b/Swiften/StreamStack/XMPPLayer.h
index 25d48bf..74ea519 100644
--- a/Swiften/StreamStack/XMPPLayer.h
+++ b/Swiften/StreamStack/XMPPLayer.h
@@ -6,8 +6,9 @@
#pragma once
+#include <memory>
+
#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeByteArray.h>
@@ -39,7 +40,7 @@ namespace Swift {
void writeHeader(const ProtocolHeader& header);
void writeFooter();
- void writeElement(boost::shared_ptr<ToplevelElement>);
+ void writeElement(std::shared_ptr<ToplevelElement>);
void writeData(const std::string& data);
void resetParser();
@@ -50,14 +51,14 @@ namespace Swift {
public:
boost::signal<void (const ProtocolHeader&)> onStreamStart;
- boost::signal<void (boost::shared_ptr<ToplevelElement>)> onElement;
+ boost::signal<void (std::shared_ptr<ToplevelElement>)> onElement;
boost::signal<void (const SafeByteArray&)> onWriteData;
boost::signal<void (const SafeByteArray&)> onDataRead;
boost::signal<void ()> onError;
private:
void handleStreamStart(const ProtocolHeader&);
- void handleElement(boost::shared_ptr<ToplevelElement>);
+ void handleElement(std::shared_ptr<ToplevelElement>);
void handleStreamEnd();
void doResetParser();
diff --git a/Swiften/StringCodecs/UnitTest/PBKDF2Test.cpp b/Swiften/StringCodecs/UnitTest/PBKDF2Test.cpp
index 343c170..43866cb 100644
--- a/Swiften/StringCodecs/UnitTest/PBKDF2Test.cpp
+++ b/Swiften/StringCodecs/UnitTest/PBKDF2Test.cpp
@@ -25,7 +25,7 @@ class PBKDF2Test : public CppUnit::TestFixture {
public:
void setUp() {
- crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
}
void testGetResult_I1() {
@@ -47,7 +47,7 @@ class PBKDF2Test : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> crypto;
};
CPPUNIT_TEST_SUITE_REGISTRATION(PBKDF2Test);
diff --git a/Swiften/TLS/CAPICertificate.cpp b/Swiften/TLS/CAPICertificate.cpp
index 29bb338..a46b9f6 100644
--- a/Swiften/TLS/CAPICertificate.cpp
+++ b/Swiften/TLS/CAPICertificate.cpp
@@ -20,7 +20,7 @@
#define DEBUG_SCARD_STATUS(function, status) \
{ \
- boost::shared_ptr<boost::system::error_code> errorCode = boost::make_shared<boost::system::error_code>(status, boost::system::system_category()); \
+ std::shared_ptr<boost::system::error_code> errorCode = std::make_shared<boost::system::error_code>(status, boost::system::system_category()); \
SWIFT_LOG(debug) << std::hex << function << ": status: 0x" << status << ": " << errorCode->message() << std::endl; \
}
diff --git a/Swiften/TLS/CAPICertificate.h b/Swiften/TLS/CAPICertificate.h
index e0b5488..5322a03 100644
--- a/Swiften/TLS/CAPICertificate.h
+++ b/Swiften/TLS/CAPICertificate.h
@@ -4,6 +4,12 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
#include <Swiften/Base/API.h>
@@ -58,7 +64,7 @@ namespace Swift {
std::string certStore_;
std::string certName_;
std::string smartCardReaderName_;
- boost::shared_ptr<Timer> smartCardTimer_;
+ std::shared_ptr<Timer> smartCardTimer_;
TimerFactory* timerFactory_;
bool lastPollingResult_;
diff --git a/Swiften/TLS/Certificate.h b/Swiften/TLS/Certificate.h
index 0b45479..dbc61ad 100644
--- a/Swiften/TLS/Certificate.h
+++ b/Swiften/TLS/Certificate.h
@@ -1,16 +1,15 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/ByteArray.h>
@@ -19,7 +18,7 @@ namespace Swift {
class SWIFTEN_API Certificate {
public:
- typedef boost::shared_ptr<Certificate> ref;
+ typedef std::shared_ptr<Certificate> ref;
virtual ~Certificate();
diff --git a/Swiften/TLS/CertificateTrustChecker.h b/Swiften/TLS/CertificateTrustChecker.h
index bf2b891..dd2b3ec 100644
--- a/Swiften/TLS/CertificateTrustChecker.h
+++ b/Swiften/TLS/CertificateTrustChecker.h
@@ -6,11 +6,10 @@
#pragma once
+#include <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/TLS/Certificate.h>
diff --git a/Swiften/TLS/CertificateVerificationError.h b/Swiften/TLS/CertificateVerificationError.h
index 0079e4f..02b4cca 100644
--- a/Swiften/TLS/CertificateVerificationError.h
+++ b/Swiften/TLS/CertificateVerificationError.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Error.h>
@@ -14,7 +14,7 @@
namespace Swift {
class SWIFTEN_API CertificateVerificationError : public Error {
public:
- typedef boost::shared_ptr<CertificateVerificationError> ref;
+ typedef std::shared_ptr<CertificateVerificationError> ref;
enum Type {
UnknownError,
diff --git a/Swiften/TLS/CertificateWithKey.h b/Swiften/TLS/CertificateWithKey.h
index 3d95e5b..8414938 100644
--- a/Swiften/TLS/CertificateWithKey.h
+++ b/Swiften/TLS/CertificateWithKey.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -12,7 +12,7 @@
namespace Swift {
class SWIFTEN_API CertificateWithKey {
public:
- typedef boost::shared_ptr<CertificateWithKey> ref;
+ typedef std::shared_ptr<CertificateWithKey> ref;
CertificateWithKey() {}
virtual ~CertificateWithKey() {}
diff --git a/Swiften/TLS/OpenSSL/OpenSSLCertificate.cpp b/Swiften/TLS/OpenSSL/OpenSSLCertificate.cpp
index 3110813..17ac8cc 100644
--- a/Swiften/TLS/OpenSSL/OpenSSLCertificate.cpp
+++ b/Swiften/TLS/OpenSSL/OpenSSLCertificate.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2013 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -19,7 +19,7 @@
namespace Swift {
-OpenSSLCertificate::OpenSSLCertificate(boost::shared_ptr<X509> cert) : cert(cert) {
+OpenSSLCertificate::OpenSSLCertificate(std::shared_ptr<X509> cert) : cert(cert) {
parse();
}
@@ -30,7 +30,7 @@ OpenSSLCertificate::OpenSSLCertificate(const ByteArray& der) {
#else
const unsigned char* p = vecptr(der);
#endif
- cert = boost::shared_ptr<X509>(d2i_X509(NULL, &p, der.size()), X509_free);
+ cert = std::shared_ptr<X509>(d2i_X509(NULL, &p, der.size()), X509_free);
if (!cert) {
SWIFT_LOG(warning) << "Error creating certificate from DER data" << std::endl;
}
@@ -75,9 +75,9 @@ void OpenSSLCertificate::parse() {
int subjectAltNameLoc = X509_get_ext_by_NID(cert.get(), NID_subject_alt_name, -1);
if(subjectAltNameLoc != -1) {
X509_EXTENSION* extension = X509_get_ext(cert.get(), subjectAltNameLoc);
- boost::shared_ptr<GENERAL_NAMES> generalNames(reinterpret_cast<GENERAL_NAMES*>(X509V3_EXT_d2i(extension)), GENERAL_NAMES_free);
- boost::shared_ptr<ASN1_OBJECT> xmppAddrObject(OBJ_txt2obj(ID_ON_XMPPADDR_OID, 1), ASN1_OBJECT_free);
- boost::shared_ptr<ASN1_OBJECT> dnsSRVObject(OBJ_txt2obj(ID_ON_DNSSRV_OID, 1), ASN1_OBJECT_free);
+ std::shared_ptr<GENERAL_NAMES> generalNames(reinterpret_cast<GENERAL_NAMES*>(X509V3_EXT_d2i(extension)), GENERAL_NAMES_free);
+ std::shared_ptr<ASN1_OBJECT> xmppAddrObject(OBJ_txt2obj(ID_ON_XMPPADDR_OID, 1), ASN1_OBJECT_free);
+ std::shared_ptr<ASN1_OBJECT> dnsSRVObject(OBJ_txt2obj(ID_ON_DNSSRV_OID, 1), ASN1_OBJECT_free);
for (int i = 0; i < sk_GENERAL_NAME_num(generalNames.get()); ++i) {
GENERAL_NAME* generalName = sk_GENERAL_NAME_value(generalNames.get(), i);
if (generalName->type == GEN_OTHERNAME) {
diff --git a/Swiften/TLS/OpenSSL/OpenSSLCertificate.h b/Swiften/TLS/OpenSSL/OpenSSLCertificate.h
index 4b8b32c..186caea 100644
--- a/Swiften/TLS/OpenSSL/OpenSSLCertificate.h
+++ b/Swiften/TLS/OpenSSL/OpenSSLCertificate.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <openssl/ssl.h>
#include <Swiften/TLS/Certificate.h>
@@ -17,7 +16,7 @@
namespace Swift {
class OpenSSLCertificate : public Certificate {
public:
- OpenSSLCertificate(boost::shared_ptr<X509>);
+ OpenSSLCertificate(std::shared_ptr<X509>);
OpenSSLCertificate(const ByteArray& der);
std::string getSubjectName() const {
@@ -42,7 +41,7 @@ namespace Swift {
ByteArray toDER() const;
- boost::shared_ptr<X509> getInternalX509() const {
+ std::shared_ptr<X509> getInternalX509() const {
return cert;
}
@@ -62,7 +61,7 @@ namespace Swift {
}
private:
- boost::shared_ptr<X509> cert;
+ std::shared_ptr<X509> cert;
std::string subjectName;
std::vector<std::string> commonNames;
std::vector<std::string> dnsNames;
diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
index cc420e6..b7496a0 100644
--- a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
+++ b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2013 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,7 +13,7 @@
#include <vector>
#include <openssl/err.h>
#include <openssl/pkcs12.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#if defined(SWIFTEN_PLATFORM_MACOSX)
#include <Security/Security.h>
@@ -147,7 +147,7 @@ void OpenSSLContext::doConnect() {
break;
default:
state_ = Error;
- onError(boost::make_shared<TLSError>());
+ onError(std::make_shared<TLSError>());
}
}
@@ -181,7 +181,7 @@ void OpenSSLContext::handleDataFromApplication(const SafeByteArray& data) {
}
else {
state_ = Error;
- onError(boost::make_shared<TLSError>());
+ onError(std::make_shared<TLSError>());
}
}
@@ -197,12 +197,12 @@ void OpenSSLContext::sendPendingDataToApplication() {
}
if (ret < 0 && SSL_get_error(handle_, ret) != SSL_ERROR_WANT_READ) {
state_ = Error;
- onError(boost::make_shared<TLSError>());
+ onError(std::make_shared<TLSError>());
}
}
bool OpenSSLContext::setClientCertificate(CertificateWithKey::ref certificate) {
- boost::shared_ptr<PKCS12Certificate> pkcs12Certificate = boost::dynamic_pointer_cast<PKCS12Certificate>(certificate);
+ std::shared_ptr<PKCS12Certificate> pkcs12Certificate = std::dynamic_pointer_cast<PKCS12Certificate>(certificate);
if (!pkcs12Certificate || pkcs12Certificate->isNull()) {
return false;
}
@@ -210,7 +210,7 @@ bool OpenSSLContext::setClientCertificate(CertificateWithKey::ref certificate) {
// Create a PKCS12 structure
BIO* bio = BIO_new(BIO_s_mem());
BIO_write(bio, vecptr(pkcs12Certificate->getData()), pkcs12Certificate->getData().size());
- boost::shared_ptr<PKCS12> pkcs12(d2i_PKCS12_bio(bio, NULL), PKCS12_free);
+ std::shared_ptr<PKCS12> pkcs12(d2i_PKCS12_bio(bio, NULL), PKCS12_free);
BIO_free(bio);
if (!pkcs12) {
return false;
@@ -226,9 +226,9 @@ bool OpenSSLContext::setClientCertificate(CertificateWithKey::ref certificate) {
if (result != 1) {
return false;
}
- boost::shared_ptr<X509> cert(certPtr, X509_free);
- boost::shared_ptr<EVP_PKEY> privateKey(privateKeyPtr, EVP_PKEY_free);
- boost::shared_ptr<STACK_OF(X509)> caCerts(caCertsPtr, freeX509Stack);
+ std::shared_ptr<X509> cert(certPtr, X509_free);
+ std::shared_ptr<EVP_PKEY> privateKey(privateKeyPtr, EVP_PKEY_free);
+ std::shared_ptr<STACK_OF(X509)> caCerts(caCertsPtr, freeX509Stack);
// Use the key & certificates
if (SSL_CTX_use_certificate(context_, cert.get()) != 1) {
@@ -247,21 +247,21 @@ std::vector<Certificate::ref> OpenSSLContext::getPeerCertificateChain() const {
std::vector<Certificate::ref> result;
STACK_OF(X509)* chain = SSL_get_peer_cert_chain(handle_);
for (int i = 0; i < sk_X509_num(chain); ++i) {
- boost::shared_ptr<X509> x509Cert(X509_dup(sk_X509_value(chain, i)), X509_free);
+ std::shared_ptr<X509> x509Cert(X509_dup(sk_X509_value(chain, i)), X509_free);
- Certificate::ref cert = boost::make_shared<OpenSSLCertificate>(x509Cert);
+ Certificate::ref cert = std::make_shared<OpenSSLCertificate>(x509Cert);
result.push_back(cert);
}
return result;
}
-boost::shared_ptr<CertificateVerificationError> OpenSSLContext::getPeerCertificateVerificationError() const {
+std::shared_ptr<CertificateVerificationError> OpenSSLContext::getPeerCertificateVerificationError() const {
int verifyResult = SSL_get_verify_result(handle_);
if (verifyResult != X509_V_OK) {
- return boost::make_shared<CertificateVerificationError>(getVerificationErrorTypeForResult(verifyResult));
+ return std::make_shared<CertificateVerificationError>(getVerificationErrorTypeForResult(verifyResult));
}
else {
- return boost::shared_ptr<CertificateVerificationError>();
+ return std::shared_ptr<CertificateVerificationError>();
}
}
diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.h b/Swiften/TLS/OpenSSL/OpenSSLContext.h
index 7fd5af7..54a8dcb 100644
--- a/Swiften/TLS/OpenSSL/OpenSSLContext.h
+++ b/Swiften/TLS/OpenSSL/OpenSSLContext.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -29,7 +29,7 @@ namespace Swift {
void handleDataFromApplication(const SafeByteArray&);
std::vector<Certificate::ref> getPeerCertificateChain() const;
- boost::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const;
+ std::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const;
virtual ByteArray getFinishMessage() const;
diff --git a/Swiften/TLS/Schannel/SchannelCertificate.cpp b/Swiften/TLS/Schannel/SchannelCertificate.cpp
index 68dd0cf..23c2479 100644
--- a/Swiften/TLS/Schannel/SchannelCertificate.cpp
+++ b/Swiften/TLS/Schannel/SchannelCertificate.cpp
@@ -4,6 +4,12 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include "Swiften/TLS/Schannel/SchannelCertificate.h"
#include "Swiften/Base/ByteArray.h"
@@ -160,9 +166,9 @@ void SchannelCertificate::parse()
// int subjectAltNameLoc = X509_get_ext_by_NID(cert.get(), NID_subject_alt_name, -1);
// if(subjectAltNameLoc != -1) {
// X509_EXTENSION* extension = X509_get_ext(cert.get(), subjectAltNameLoc);
- // boost::shared_ptr<GENERAL_NAMES> generalNames(reinterpret_cast<GENERAL_NAMES*>(X509V3_EXT_d2i(extension)), GENERAL_NAMES_free);
- // boost::shared_ptr<ASN1_OBJECT> xmppAddrObject(OBJ_txt2obj(ID_ON_XMPPADDR_OID, 1), ASN1_OBJECT_free);
- // boost::shared_ptr<ASN1_OBJECT> dnsSRVObject(OBJ_txt2obj(ID_ON_DNSSRV_OID, 1), ASN1_OBJECT_free);
+ // std::shared_ptr<GENERAL_NAMES> generalNames(reinterpret_cast<GENERAL_NAMES*>(X509V3_EXT_d2i(extension)), GENERAL_NAMES_free);
+ // std::shared_ptr<ASN1_OBJECT> xmppAddrObject(OBJ_txt2obj(ID_ON_XMPPADDR_OID, 1), ASN1_OBJECT_free);
+ // std::shared_ptr<ASN1_OBJECT> dnsSRVObject(OBJ_txt2obj(ID_ON_DNSSRV_OID, 1), ASN1_OBJECT_free);
// for (int i = 0; i < sk_GENERAL_NAME_num(generalNames.get()); ++i) {
// GENERAL_NAME* generalName = sk_GENERAL_NAME_value(generalNames.get(), i);
// if (generalName->type == GEN_OTHERNAME) {
diff --git a/Swiften/TLS/Schannel/SchannelCertificate.h b/Swiften/TLS/Schannel/SchannelCertificate.h
index 814f344..d3bd66c 100644
--- a/Swiften/TLS/Schannel/SchannelCertificate.h
+++ b/Swiften/TLS/Schannel/SchannelCertificate.h
@@ -12,7 +12,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/String.h>
#include <Swiften/TLS/Certificate.h>
@@ -23,7 +23,7 @@ namespace Swift
class SchannelCertificate : public Certificate
{
public:
- typedef boost::shared_ptr<SchannelCertificate> ref;
+ typedef std::shared_ptr<SchannelCertificate> ref;
public:
SchannelCertificate(const ScopedCertContext& certCtxt);
diff --git a/Swiften/TLS/Schannel/SchannelContext.cpp b/Swiften/TLS/Schannel/SchannelContext.cpp
index 7b67f4c..5799157 100644
--- a/Swiften/TLS/Schannel/SchannelContext.cpp
+++ b/Swiften/TLS/Schannel/SchannelContext.cpp
@@ -61,14 +61,14 @@ void SchannelContext::connect() {
if (myCertStore_ == NULL) {
myCertStore_ = CertOpenSystemStore(0, certStoreName_.c_str());
if (!myCertStore_) {
- indicateError(boost::make_shared<TLSError>(TLSError::UnknownError));
+ indicateError(std::make_shared<TLSError>(TLSError::UnknownError));
return;
}
}
pCertContext = findCertificateInStore( myCertStore_, certName_ );
if (pCertContext == NULL) {
- indicateError(boost::make_shared<TLSError>(TLSError::UnknownError));
+ indicateError(std::make_shared<TLSError>(TLSError::UnknownError));
return;
}
}
@@ -115,7 +115,7 @@ void SchannelContext::connect() {
if (status != SEC_E_OK) {
// We failed to obtain the credentials handle
- indicateError(boost::make_shared<TLSError>(TLSError::UnknownError));
+ indicateError(std::make_shared<TLSError>(TLSError::UnknownError));
return;
}
@@ -158,7 +158,7 @@ void SchannelContext::connect() {
if (status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) {
// We failed to initialize the security context
handleCertError(status);
- indicateError(boost::make_shared<TLSError>(TLSError::UnknownError));
+ indicateError(std::make_shared<TLSError>(TLSError::UnknownError));
return;
}
@@ -181,7 +181,7 @@ void SchannelContext::connect() {
//------------------------------------------------------------------------
SECURITY_STATUS SchannelContext::validateServerCertificate() {
- SchannelCertificate::ref pServerCert = boost::dynamic_pointer_cast<SchannelCertificate>( getPeerCertificate() );
+ SchannelCertificate::ref pServerCert = std::dynamic_pointer_cast<SchannelCertificate>( getPeerCertificate() );
if (!pServerCert) {
return SEC_E_WRONG_PRINCIPAL;
}
@@ -359,7 +359,7 @@ void SchannelContext::continueHandshake(const SafeByteArray& data) {
else {
// We failed to initialize the security context
handleCertError(status);
- indicateError(boost::make_shared<TLSError>(TLSError::UnknownError));
+ indicateError(std::make_shared<TLSError>(TLSError::UnknownError));
return;
}
}
@@ -459,7 +459,7 @@ void SchannelContext::handleDataFromNetwork(const SafeByteArray& data) {
//------------------------------------------------------------------------
-void SchannelContext::indicateError(boost::shared_ptr<TLSError> error) {
+void SchannelContext::indicateError(std::shared_ptr<TLSError> error) {
state_ = Error;
receivedData_.clear();
onError(error);
@@ -505,15 +505,15 @@ void SchannelContext::decryptAndProcessData(const SafeByteArray& data) {
}
else if (status == SEC_I_RENEGOTIATE) {
// TODO: Handle renegotiation scenarios
- indicateError(boost::make_shared<TLSError>(TLSError::UnknownError));
+ indicateError(std::make_shared<TLSError>(TLSError::UnknownError));
break;
}
else if (status == SEC_I_CONTEXT_EXPIRED) {
- indicateError(boost::make_shared<TLSError>(TLSError::UnknownError));
+ indicateError(std::make_shared<TLSError>(TLSError::UnknownError));
break;
}
else if (status != SEC_E_OK) {
- indicateError(boost::make_shared<TLSError>(TLSError::UnknownError));
+ indicateError(std::make_shared<TLSError>(TLSError::UnknownError));
break;
}
@@ -596,7 +596,7 @@ void SchannelContext::encryptAndSendData(const SafeByteArray& data) {
SECURITY_STATUS status = EncryptMessage(contextHandle_, 0, &outBufferDesc, 0);
if (status != SEC_E_OK) {
- indicateError(boost::make_shared<TLSError>(TLSError::UnknownError));
+ indicateError(std::make_shared<TLSError>(TLSError::UnknownError));
return;
}
@@ -609,7 +609,7 @@ void SchannelContext::encryptAndSendData(const SafeByteArray& data) {
//------------------------------------------------------------------------
bool SchannelContext::setClientCertificate(CertificateWithKey::ref certificate) {
- boost::shared_ptr<CAPICertificate> capiCertificate = boost::dynamic_pointer_cast<CAPICertificate>(certificate);
+ std::shared_ptr<CAPICertificate> capiCertificate = std::dynamic_pointer_cast<CAPICertificate>(certificate);
if (!capiCertificate || capiCertificate->isNull()) {
return false;
}
@@ -631,7 +631,7 @@ bool SchannelContext::setClientCertificate(CertificateWithKey::ref certificate)
//------------------------------------------------------------------------
void SchannelContext::handleCertificateCardRemoved() {
if (disconnectOnCardRemoval_) {
- indicateError(boost::make_shared<TLSError>(TLSError::CertificateCardRemoved));
+ indicateError(std::make_shared<TLSError>(TLSError::CertificateCardRemoved));
}
}
@@ -647,7 +647,7 @@ std::vector<Certificate::ref> SchannelContext::getPeerCertificateChain() const {
if (status != SEC_E_OK) {
return certificateChain;
}
- certificateChain.push_back(boost::make_shared<SchannelCertificate>(pServerCert));
+ certificateChain.push_back(std::make_shared<SchannelCertificate>(pServerCert));
pCurrentCert = pServerCert;
while(pCurrentCert.GetPointer()) {
@@ -656,7 +656,7 @@ std::vector<Certificate::ref> SchannelContext::getPeerCertificateChain() const {
if (!(*pIssuerCert.GetPointer())) {
break;
}
- certificateChain.push_back(boost::make_shared<SchannelCertificate>(pIssuerCert));
+ certificateChain.push_back(std::make_shared<SchannelCertificate>(pIssuerCert));
pCurrentCert = pIssuerCert;
pIssuerCert = NULL;
@@ -667,7 +667,7 @@ std::vector<Certificate::ref> SchannelContext::getPeerCertificateChain() const {
//------------------------------------------------------------------------
CertificateVerificationError::ref SchannelContext::getPeerCertificateVerificationError() const {
- return verificationError_ ? boost::make_shared<CertificateVerificationError>(*verificationError_) : CertificateVerificationError::ref();
+ return verificationError_ ? std::make_shared<CertificateVerificationError>(*verificationError_) : CertificateVerificationError::ref();
}
//------------------------------------------------------------------------
diff --git a/Swiften/TLS/Schannel/SchannelContext.h b/Swiften/TLS/Schannel/SchannelContext.h
index 2c6a3ff..4cb086e 100644
--- a/Swiften/TLS/Schannel/SchannelContext.h
+++ b/Swiften/TLS/Schannel/SchannelContext.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2012-2015 Isode Limited.
+ * Copyright (c) 2012-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -34,7 +34,7 @@ namespace Swift
class SchannelContext : public TLSContext, boost::noncopyable
{
public:
- typedef boost::shared_ptr<SchannelContext> sp_t;
+ typedef std::shared_ptr<SchannelContext> sp_t;
public:
SchannelContext(bool tls1_0Workaround);
@@ -62,9 +62,9 @@ namespace Swift
private:
void determineStreamSizes();
void continueHandshake(const SafeByteArray& data);
- void indicateError(boost::shared_ptr<TLSError> error);
+ void indicateError(std::shared_ptr<TLSError> error);
//FIXME: Remove
- void indicateError() {indicateError(boost::make_shared<TLSError>());}
+ void indicateError() {indicateError(std::make_shared<TLSError>());}
void handleCertError(SECURITY_STATUS status) ;
void sendDataOnNetwork(const void* pData, size_t dataSize);
@@ -104,7 +104,7 @@ namespace Swift
std::string certName_;
////Not needed, most likely
std::string smartCardReader_; //Can be empty string for non SmartCard certificates
- boost::shared_ptr<CAPICertificate> userCertificate_;
+ std::shared_ptr<CAPICertificate> userCertificate_;
bool checkCertificateRevocation_;
bool tls1_0Workaround_;
bool disconnectOnCardRemoval_;
diff --git a/Swiften/TLS/Schannel/SchannelUtil.h b/Swiften/TLS/Schannel/SchannelUtil.h
index 194ec35..ec71d9d 100644
--- a/Swiften/TLS/Schannel/SchannelUtil.h
+++ b/Swiften/TLS/Schannel/SchannelUtil.h
@@ -4,6 +4,12 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
#define SECURITY_WIN32
@@ -92,7 +98,7 @@ namespace Swift
}
private:
- boost::shared_ptr<HandleContext> m_pHandle;
+ std::shared_ptr<HandleContext> m_pHandle;
};
//------------------------------------------------------------------------
@@ -168,7 +174,7 @@ namespace Swift
}
private:
- boost::shared_ptr<HandleContext> m_pHandle;
+ std::shared_ptr<HandleContext> m_pHandle;
};
//------------------------------------------------------------------------
@@ -303,7 +309,7 @@ namespace Swift
}
private:
- boost::shared_ptr<HandleContext> m_pHandle;
+ std::shared_ptr<HandleContext> m_pHandle;
};
//------------------------------------------------------------------------
@@ -420,6 +426,6 @@ namespace Swift
}
private:
- boost::shared_ptr<HandleContext> m_pHandle;
+ std::shared_ptr<HandleContext> m_pHandle;
};
}
diff --git a/Swiften/TLS/SecureTransport/SecureTransportCertificate.h b/Swiften/TLS/SecureTransport/SecureTransportCertificate.h
index 625c2ae..7faf3be 100644
--- a/Swiften/TLS/SecureTransport/SecureTransportCertificate.h
+++ b/Swiften/TLS/SecureTransport/SecureTransportCertificate.h
@@ -1,12 +1,13 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
+
#include <boost/type_traits.hpp>
#include <Security/SecCertificate.h>
@@ -34,7 +35,7 @@ private:
typedef boost::remove_pointer<SecCertificateRef>::type SecCertificate;
private:
- boost::shared_ptr<SecCertificate> certificateHandle_;
+ std::shared_ptr<SecCertificate> certificateHandle_;
std::string subjectName_;
std::vector<std::string> commonNames_;
std::vector<std::string> srvNames_;
diff --git a/Swiften/TLS/SecureTransport/SecureTransportCertificate.mm b/Swiften/TLS/SecureTransport/SecureTransportCertificate.mm
index ed47f56..db0af89 100644
--- a/Swiften/TLS/SecureTransport/SecureTransportCertificate.mm
+++ b/Swiften/TLS/SecureTransport/SecureTransportCertificate.mm
@@ -43,7 +43,7 @@ namespace Swift {
SecureTransportCertificate::SecureTransportCertificate(SecCertificateRef certificate) {
assert(certificate);
CFRetain(certificate);
- certificateHandle_ = boost::shared_ptr<SecCertificate>(certificate, CFRelease);
+ certificateHandle_ = std::shared_ptr<SecCertificate>(certificate, CFRelease);
parse();
}
@@ -53,7 +53,7 @@ SecureTransportCertificate::SecureTransportCertificate(const ByteArray& der) {
// certificate will take ownership of derData and free it on its release.
SecCertificateRef certificate = SecCertificateCreateWithData(nullptr, derData);
if (certificate) {
- certificateHandle_ = boost::shared_ptr<SecCertificate>(certificate, CFRelease);
+ certificateHandle_ = std::shared_ptr<SecCertificate>(certificate, CFRelease);
parse();
}
}
diff --git a/Swiften/TLS/SecureTransport/SecureTransportContext.h b/Swiften/TLS/SecureTransport/SecureTransportContext.h
index 4d45f52..3942904 100644
--- a/Swiften/TLS/SecureTransport/SecureTransportContext.h
+++ b/Swiften/TLS/SecureTransport/SecureTransportContext.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -38,16 +38,16 @@ class SecureTransportContext : public TLSContext {
static std::string stateToString(State state);
void setState(State newState);
- static boost::shared_ptr<TLSError> nativeToTLSError(OSStatus error);
- boost::shared_ptr<CertificateVerificationError> CSSMErrorToVerificationError(OSStatus resultCode);
+ static std::shared_ptr<TLSError> nativeToTLSError(OSStatus error);
+ std::shared_ptr<CertificateVerificationError> CSSMErrorToVerificationError(OSStatus resultCode);
void processHandshake();
void verifyServerCertificate();
- void fatalError(boost::shared_ptr<TLSError> error, boost::shared_ptr<CertificateVerificationError> certificateError);
+ void fatalError(std::shared_ptr<TLSError> error, std::shared_ptr<CertificateVerificationError> certificateError);
private:
- boost::shared_ptr<SSLContext> sslContext_;
+ std::shared_ptr<SSLContext> sslContext_;
SafeByteArray readingBuffer_;
State state_;
CertificateVerificationError::ref verificationError_;
diff --git a/Swiften/TLS/SecureTransport/SecureTransportContext.mm b/Swiften/TLS/SecureTransport/SecureTransportContext.mm
index 1c5e3ab..970d270 100644
--- a/Swiften/TLS/SecureTransport/SecureTransportContext.mm
+++ b/Swiften/TLS/SecureTransport/SecureTransportContext.mm
@@ -39,7 +39,7 @@ namespace {
CFArrayRef CreateClientCertificateChainAsCFArrayRef(CertificateWithKey::ref key) {
- boost::shared_ptr<PKCS12Certificate> pkcs12 = boost::dynamic_pointer_cast<PKCS12Certificate>(key);
+ std::shared_ptr<PKCS12Certificate> pkcs12 = std::dynamic_pointer_cast<PKCS12Certificate>(key);
if (!key) {
return nullptr;
}
@@ -104,7 +104,7 @@ CFArrayRef CreateClientCertificateChainAsCFArrayRef(CertificateWithKey::ref key)
}
SecureTransportContext::SecureTransportContext(bool checkCertificateRevocation) : state_(None), checkCertificateRevocation_(checkCertificateRevocation) {
- sslContext_ = boost::shared_ptr<SSLContext>(SSLCreateContext(nullptr, kSSLClientSide, kSSLStreamType), CFRelease);
+ sslContext_ = std::shared_ptr<SSLContext>(SSLCreateContext(nullptr, kSSLClientSide, kSSLStreamType), CFRelease);
OSStatus error = noErr;
// set IO callbacks
@@ -163,7 +163,7 @@ void SecureTransportContext::connect() {
if (clientCertificate_) {
CFArrayRef certs = CreateClientCertificateChainAsCFArrayRef(clientCertificate_);
if (certs) {
- boost::shared_ptr<CFArray> certRefs(certs, CFRelease);
+ std::shared_ptr<CFArray> certRefs(certs, CFRelease);
OSStatus result = SSLSetCertificate(sslContext_.get(), certRefs.get());
if (result != noErr) {
SWIFT_LOG(error) << "SSLSetCertificate failed with error " << result << "." << std::endl;
@@ -191,7 +191,7 @@ void SecureTransportContext::processHandshake() {
}
else {
SWIFT_LOG(debug) << "Error returned from SSLHandshake call is " << error << "." << std::endl;
- fatalError(nativeToTLSError(error), boost::make_shared<CertificateVerificationError>());
+ fatalError(nativeToTLSError(error), std::make_shared<CertificateVerificationError>());
}
}
@@ -203,15 +203,15 @@ void SecureTransportContext::verifyServerCertificate() {
SecTrustRef trust = nullptr;
OSStatus error = SSLCopyPeerTrust(sslContext_.get(), &trust);
if (error != noErr) {
- fatalError(boost::make_shared<TLSError>(), boost::make_shared<CertificateVerificationError>());
+ fatalError(std::make_shared<TLSError>(), std::make_shared<CertificateVerificationError>());
return;
}
- boost::shared_ptr<SecTrust> trustRef = boost::shared_ptr<SecTrust>(trust, CFRelease);
+ std::shared_ptr<SecTrust> trustRef = std::shared_ptr<SecTrust>(trust, CFRelease);
if (checkCertificateRevocation_) {
error = SecTrustSetOptions(trust, kSecTrustOptionRequireRevPerCert | kSecTrustOptionFetchIssuerFromNet);
if (error != noErr) {
- fatalError(boost::make_shared<TLSError>(), boost::make_shared<CertificateVerificationError>());
+ fatalError(std::make_shared<TLSError>(), std::make_shared<CertificateVerificationError>());
return;
}
}
@@ -219,7 +219,7 @@ void SecureTransportContext::verifyServerCertificate() {
SecTrustResultType trustResult;
error = SecTrustEvaluate(trust, &trustResult);
if (error != errSecSuccess) {
- fatalError(boost::make_shared<TLSError>(), boost::make_shared<CertificateVerificationError>());
+ fatalError(std::make_shared<TLSError>(), std::make_shared<CertificateVerificationError>());
return;
}
@@ -242,7 +242,7 @@ void SecureTransportContext::verifyServerCertificate() {
CSSM_TP_APPLE_EVIDENCE_INFO* statusChain;
error = SecTrustGetResult(trustRef.get(), &trustResult, &certChain, &statusChain);
if (error == errSecSuccess) {
- boost::shared_ptr<CFArray> certChainRef = boost::shared_ptr<CFArray>(certChain, CFRelease);
+ std::shared_ptr<CFArray> certChainRef = std::shared_ptr<CFArray>(certChain, CFRelease);
for (CFIndex index = 0; index < CFArrayGetCount(certChainRef.get()); index++) {
for (CFIndex n = 0; n < statusChain[index].NumStatusCodes; n++) {
// Even though Secure Transport reported CSSMERR_APPLETP_INCOMPLETE_REVOCATION_CHECK on the whole certificate
@@ -259,11 +259,11 @@ void SecureTransportContext::verifyServerCertificate() {
}
}
else {
- verificationError_ = boost::make_shared<CertificateVerificationError>(CertificateVerificationError::UnknownError);
+ verificationError_ = std::make_shared<CertificateVerificationError>(CertificateVerificationError::UnknownError);
}
break;
case kSecTrustResultOtherError:
- verificationError_ = boost::make_shared<CertificateVerificationError>(CertificateVerificationError::UnknownError);
+ verificationError_ = std::make_shared<CertificateVerificationError>(CertificateVerificationError::UnknownError);
break;
default:
SWIFT_LOG(warning) << "Unhandled trust result " << trustResult << "." << std::endl;
@@ -321,7 +321,7 @@ void SecureTransportContext::handleDataFromNetwork(const SafeByteArray& data) {
}
else {
SWIFT_LOG(error) << "SSLRead failed with error " << error << ", read bytes: " << bytesRead << "." << std::endl;
- fatalError(boost::make_shared<TLSError>(), boost::make_shared<CertificateVerificationError>());
+ fatalError(std::make_shared<TLSError>(), std::make_shared<CertificateVerificationError>());
return;
}
@@ -353,7 +353,7 @@ void SecureTransportContext::handleDataFromApplication(const SafeByteArray& data
return;
default:
SWIFT_LOG(warning) << "SSLWrite returned error code: " << error << ", processed bytes: " << processedBytes << std::endl;
- fatalError(boost::make_shared<TLSError>(), boost::shared_ptr<CertificateVerificationError>());
+ fatalError(std::make_shared<TLSError>(), std::shared_ptr<CertificateVerificationError>());
}
}
@@ -362,18 +362,18 @@ std::vector<Certificate::ref> SecureTransportContext::getPeerCertificateChain()
if (sslContext_) {
typedef boost::remove_pointer<SecTrustRef>::type SecTrust;
- boost::shared_ptr<SecTrust> securityTrust;
+ std::shared_ptr<SecTrust> securityTrust;
SecTrustRef secTrust = nullptr;;
OSStatus error = SSLCopyPeerTrust(sslContext_.get(), &secTrust);
if (error == noErr) {
- securityTrust = boost::shared_ptr<SecTrust>(secTrust, CFRelease);
+ securityTrust = std::shared_ptr<SecTrust>(secTrust, CFRelease);
CFIndex chainSize = SecTrustGetCertificateCount(securityTrust.get());
for (CFIndex n = 0; n < chainSize; n++) {
SecCertificateRef certificate = SecTrustGetCertificateAtIndex(securityTrust.get(), n);
if (certificate) {
- peerCertificateChain.push_back(boost::make_shared<SecureTransportCertificate>(certificate));
+ peerCertificateChain.push_back(std::make_shared<SecureTransportCertificate>(certificate));
}
}
}
@@ -431,30 +431,30 @@ OSStatus SecureTransportContext::SSLSocketWriteCallback(SSLConnectionRef connect
return retValue;
}
-boost::shared_ptr<TLSError> SecureTransportContext::nativeToTLSError(OSStatus /* error */) {
- boost::shared_ptr<TLSError> swiftenError;
- swiftenError = boost::make_shared<TLSError>();
+std::shared_ptr<TLSError> SecureTransportContext::nativeToTLSError(OSStatus /* error */) {
+ std::shared_ptr<TLSError> swiftenError;
+ swiftenError = std::make_shared<TLSError>();
return swiftenError;
}
-boost::shared_ptr<CertificateVerificationError> SecureTransportContext::CSSMErrorToVerificationError(OSStatus resultCode) {
- boost::shared_ptr<CertificateVerificationError> error;
+std::shared_ptr<CertificateVerificationError> SecureTransportContext::CSSMErrorToVerificationError(OSStatus resultCode) {
+ std::shared_ptr<CertificateVerificationError> error;
switch(resultCode) {
case CSSMERR_TP_NOT_TRUSTED:
SWIFT_LOG(debug) << "CSSM result code: CSSMERR_TP_NOT_TRUSTED" << std::endl;
- error = boost::make_shared<CertificateVerificationError>(CertificateVerificationError::Untrusted);
+ error = std::make_shared<CertificateVerificationError>(CertificateVerificationError::Untrusted);
break;
case CSSMERR_TP_CERT_NOT_VALID_YET:
SWIFT_LOG(debug) << "CSSM result code: CSSMERR_TP_CERT_NOT_VALID_YET" << std::endl;
- error = boost::make_shared<CertificateVerificationError>(CertificateVerificationError::NotYetValid);
+ error = std::make_shared<CertificateVerificationError>(CertificateVerificationError::NotYetValid);
break;
case CSSMERR_TP_CERT_EXPIRED:
SWIFT_LOG(debug) << "CSSM result code: CSSMERR_TP_CERT_EXPIRED" << std::endl;
- error = boost::make_shared<CertificateVerificationError>(CertificateVerificationError::Expired);
+ error = std::make_shared<CertificateVerificationError>(CertificateVerificationError::Expired);
break;
case CSSMERR_TP_CERT_REVOKED:
SWIFT_LOG(debug) << "CSSM result code: CSSMERR_TP_CERT_REVOKED" << std::endl;
- error = boost::make_shared<CertificateVerificationError>(CertificateVerificationError::Revoked);
+ error = std::make_shared<CertificateVerificationError>(CertificateVerificationError::Revoked);
break;
case CSSMERR_TP_VERIFY_ACTION_FAILED:
SWIFT_LOG(debug) << "CSSM result code: CSSMERR_TP_VERIFY_ACTION_FAILED" << std::endl;
@@ -462,28 +462,28 @@ boost::shared_ptr<CertificateVerificationError> SecureTransportContext::CSSMErro
case CSSMERR_APPLETP_INCOMPLETE_REVOCATION_CHECK:
SWIFT_LOG(debug) << "CSSM result code: CSSMERR_APPLETP_INCOMPLETE_REVOCATION_CHECK" << std::endl;
if (checkCertificateRevocation_) {
- error = boost::make_shared<CertificateVerificationError>(CertificateVerificationError::RevocationCheckFailed);
+ error = std::make_shared<CertificateVerificationError>(CertificateVerificationError::RevocationCheckFailed);
}
break;
case CSSMERR_APPLETP_OCSP_UNAVAILABLE:
SWIFT_LOG(debug) << "CSSM result code: CSSMERR_APPLETP_OCSP_UNAVAILABLE" << std::endl;
if (checkCertificateRevocation_) {
- error = boost::make_shared<CertificateVerificationError>(CertificateVerificationError::RevocationCheckFailed);
+ error = std::make_shared<CertificateVerificationError>(CertificateVerificationError::RevocationCheckFailed);
}
break;
case CSSMERR_APPLETP_SSL_BAD_EXT_KEY_USE:
SWIFT_LOG(debug) << "CSSM result code: CSSMERR_APPLETP_SSL_BAD_EXT_KEY_USE" << std::endl;
- error = boost::make_shared<CertificateVerificationError>(CertificateVerificationError::InvalidPurpose);
+ error = std::make_shared<CertificateVerificationError>(CertificateVerificationError::InvalidPurpose);
break;
default:
SWIFT_LOG(warning) << "unhandled CSSM error: " << resultCode << ", CSSM_TP_BASE_TP_ERROR: " << CSSM_TP_BASE_TP_ERROR << std::endl;
- error = boost::make_shared<CertificateVerificationError>(CertificateVerificationError::UnknownError);
+ error = std::make_shared<CertificateVerificationError>(CertificateVerificationError::UnknownError);
break;
}
return error;
}
-void SecureTransportContext::fatalError(boost::shared_ptr<TLSError> error, boost::shared_ptr<CertificateVerificationError> certificateError) {
+void SecureTransportContext::fatalError(std::shared_ptr<TLSError> error, std::shared_ptr<CertificateVerificationError> certificateError) {
setState(Error);
if (sslContext_) {
SSLClose(sslContext_.get());
diff --git a/Swiften/TLS/ServerIdentityVerifier.h b/Swiften/TLS/ServerIdentityVerifier.h
index ca92180..f40c683 100644
--- a/Swiften/TLS/ServerIdentityVerifier.h
+++ b/Swiften/TLS/ServerIdentityVerifier.h
@@ -6,10 +6,9 @@
#pragma once
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/JID/JID.h>
#include <Swiften/TLS/Certificate.h>
diff --git a/Swiften/TLS/SimpleCertificate.h b/Swiften/TLS/SimpleCertificate.h
index 4dbf847..08cf1e3 100644
--- a/Swiften/TLS/SimpleCertificate.h
+++ b/Swiften/TLS/SimpleCertificate.h
@@ -14,7 +14,7 @@
namespace Swift {
class SWIFTEN_API SimpleCertificate : public Certificate {
public:
- typedef boost::shared_ptr<SimpleCertificate> ref;
+ typedef std::shared_ptr<SimpleCertificate> ref;
void setSubjectName(const std::string& name) {
subjectName = name;
diff --git a/Swiften/TLS/TLSContext.h b/Swiften/TLS/TLSContext.h
index d7b33d4..b0d9296 100644
--- a/Swiften/TLS/TLSContext.h
+++ b/Swiften/TLS/TLSContext.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeByteArray.h>
@@ -38,7 +38,7 @@ namespace Swift {
public:
boost::signal<void (const SafeByteArray&)> onDataForNetwork;
boost::signal<void (const SafeByteArray&)> onDataForApplication;
- boost::signal<void (boost::shared_ptr<TLSError>)> onError;
+ boost::signal<void (std::shared_ptr<TLSError>)> onError;
boost::signal<void ()> onConnected;
};
}
diff --git a/Swiften/TLS/TLSError.h b/Swiften/TLS/TLSError.h
index bed5be9..ae775e6 100644
--- a/Swiften/TLS/TLSError.h
+++ b/Swiften/TLS/TLSError.h
@@ -6,7 +6,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/Error.h>
@@ -14,7 +14,7 @@
namespace Swift {
class SWIFTEN_API TLSError : public Error {
public:
- typedef boost::shared_ptr<TLSError> ref;
+ typedef std::shared_ptr<TLSError> ref;
enum Type {
UnknownError,
diff --git a/Swiften/TLS/UnitTest/CertificateTest.cpp b/Swiften/TLS/UnitTest/CertificateTest.cpp
index f7bb93e..2483dae 100644
--- a/Swiften/TLS/UnitTest/CertificateTest.cpp
+++ b/Swiften/TLS/UnitTest/CertificateTest.cpp
@@ -4,7 +4,7 @@
* See the COPYING file for more information.
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -24,10 +24,10 @@ class CertificateTest : public CppUnit::TestFixture {
public:
void testGetSHA1Fingerprint() {
- SimpleCertificate::ref testling = boost::make_shared<SimpleCertificate>();
+ SimpleCertificate::ref testling = std::make_shared<SimpleCertificate>();
testling->setDER(createByteArray("abcdefg"));
- CPPUNIT_ASSERT_EQUAL(std::string("2f:b5:e1:34:19:fc:89:24:68:65:e7:a3:24:f4:76:ec:62:4e:87:40"), Certificate::getSHA1Fingerprint(testling, boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create()).get()));
+ CPPUNIT_ASSERT_EQUAL(std::string("2f:b5:e1:34:19:fc:89:24:68:65:e7:a3:24:f4:76:ec:62:4e:87:40"), Certificate::getSHA1Fingerprint(testling, std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create()).get()));
}
};
diff --git a/Swiften/TLS/UnitTest/ServerIdentityVerifierTest.cpp b/Swiften/TLS/UnitTest/ServerIdentityVerifierTest.cpp
index 1fe936d..30fe423 100644
--- a/Swiften/TLS/UnitTest/ServerIdentityVerifierTest.cpp
+++ b/Swiften/TLS/UnitTest/ServerIdentityVerifierTest.cpp
@@ -39,7 +39,7 @@ class ServerIdentityVerifierTest : public CppUnit::TestFixture {
public:
void setUp() {
- idnConverter = boost::shared_ptr<IDNConverter>(PlatformIDNConverter::create());
+ idnConverter = std::shared_ptr<IDNConverter>(PlatformIDNConverter::create());
}
void testCertificateVerifies_WithoutMatchingDNSName() {
@@ -172,7 +172,7 @@ class ServerIdentityVerifierTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(!testling.certificateVerifies(certificate));
}
- boost::shared_ptr<IDNConverter> idnConverter;
+ std::shared_ptr<IDNConverter> idnConverter;
};
CPPUNIT_TEST_SUITE_REGISTRATION(ServerIdentityVerifierTest);
diff --git a/Swiften/VCards/GetVCardRequest.h b/Swiften/VCards/GetVCardRequest.h
index 5d6fc17..1b575c0 100644
--- a/Swiften/VCards/GetVCardRequest.h
+++ b/Swiften/VCards/GetVCardRequest.h
@@ -13,14 +13,14 @@
namespace Swift {
class SWIFTEN_API GetVCardRequest : public GenericRequest<VCard> {
public:
- typedef boost::shared_ptr<GetVCardRequest> ref;
+ typedef std::shared_ptr<GetVCardRequest> ref;
static ref create(const JID& jid, IQRouter* router) {
return ref(new GetVCardRequest(jid, router));
}
private:
- GetVCardRequest(const JID& jid, IQRouter* router) : GenericRequest<VCard>(IQ::Get, jid, boost::shared_ptr<Payload>(new VCard()), router) {
+ GetVCardRequest(const JID& jid, IQRouter* router) : GenericRequest<VCard>(IQ::Get, jid, std::make_shared<VCard>(), router) {
}
};
}
diff --git a/Swiften/VCards/SetVCardRequest.h b/Swiften/VCards/SetVCardRequest.h
index b9621ab..15cc78b 100644
--- a/Swiften/VCards/SetVCardRequest.h
+++ b/Swiften/VCards/SetVCardRequest.h
@@ -13,7 +13,7 @@
namespace Swift {
class SWIFTEN_API SetVCardRequest : public GenericRequest<VCard> {
public:
- typedef boost::shared_ptr<SetVCardRequest> ref;
+ typedef std::shared_ptr<SetVCardRequest> ref;
static ref create(VCard::ref vcard, IQRouter* router) {
return ref(new SetVCardRequest(vcard, router));
diff --git a/Swiften/VCards/UnitTest/VCardManagerTest.cpp b/Swiften/VCards/UnitTest/VCardManagerTest.cpp
index 3784c6c..3d5338d 100644
--- a/Swiften/VCards/UnitTest/VCardManagerTest.cpp
+++ b/Swiften/VCards/UnitTest/VCardManagerTest.cpp
@@ -1,13 +1,13 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
+#include <memory>
#include <vector>
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -41,7 +41,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
changes.clear();
ownChanges.clear();
ownJID = JID("baz@fum.com/dum");
- crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
+ crypto = std::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create());
stanzaChannel = new DummyStanzaChannel();
iqRouter = new IQRouter(stanzaChannel);
vcardStorage = new VCardMemoryStorage(crypto.get());
@@ -54,7 +54,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testGet_NewVCardRequestsVCard() {
- boost::shared_ptr<VCardManager> testling = createManager();
+ std::shared_ptr<VCardManager> testling = createManager();
VCard::ref result = testling->getVCardAndRequestWhenNeeded(JID("foo@bar.com/baz"));
CPPUNIT_ASSERT(!result);
@@ -63,7 +63,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testGet_ExistingVCard() {
- boost::shared_ptr<VCardManager> testling = createManager();
+ std::shared_ptr<VCardManager> testling = createManager();
VCard::ref vcard(new VCard());
vcard->setFullName("Foo Bar");
vcardStorage->setVCard(JID("foo@bar.com/baz"), vcard);
@@ -75,7 +75,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testRequest_RequestsVCard() {
- boost::shared_ptr<VCardManager> testling = createManager();
+ std::shared_ptr<VCardManager> testling = createManager();
testling->requestVCard(JID("foo@bar.com/baz"));
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(stanzaChannel->sentStanzas.size()));
@@ -83,7 +83,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testRequest_ReceiveEmitsNotification() {
- boost::shared_ptr<VCardManager> testling = createManager();
+ std::shared_ptr<VCardManager> testling = createManager();
testling->requestVCard(JID("foo@bar.com/baz"));
stanzaChannel->onIQReceived(createVCardResult());
@@ -96,7 +96,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testRequest_Error() {
- boost::shared_ptr<VCardManager> testling = createManager();
+ std::shared_ptr<VCardManager> testling = createManager();
testling->requestVCard(JID("foo@bar.com/baz"));
stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID()));
@@ -105,7 +105,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testRequest_VCardAlreadyRequested() {
- boost::shared_ptr<VCardManager> testling = createManager();
+ std::shared_ptr<VCardManager> testling = createManager();
testling->requestVCard(JID("foo@bar.com/baz"));
VCard::ref result = testling->getVCardAndRequestWhenNeeded(JID("foo@bar.com/baz"));
@@ -114,7 +114,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testRequest_AfterPreviousRequest() {
- boost::shared_ptr<VCardManager> testling = createManager();
+ std::shared_ptr<VCardManager> testling = createManager();
testling->requestVCard(JID("foo@bar.com/baz"));
stanzaChannel->onIQReceived(createVCardResult());
testling->requestVCard(JID("foo@bar.com/baz"));
@@ -124,7 +124,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testRequestOwnVCard() {
- boost::shared_ptr<VCardManager> testling = createManager();
+ std::shared_ptr<VCardManager> testling = createManager();
testling->requestVCard(ownJID);
stanzaChannel->onIQReceived(createOwnVCardResult());
@@ -140,8 +140,8 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testCreateSetVCardRequest() {
- boost::shared_ptr<VCardManager> testling = createManager();
- VCard::ref vcard = boost::make_shared<VCard>();
+ std::shared_ptr<VCardManager> testling = createManager();
+ VCard::ref vcard = std::make_shared<VCard>();
vcard->setFullName("New Name");
SetVCardRequest::ref request = testling->createSetVCardRequest(vcard);
request->send();
@@ -154,8 +154,8 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
void testCreateSetVCardRequest_Error() {
- boost::shared_ptr<VCardManager> testling = createManager();
- VCard::ref vcard = boost::make_shared<VCard>();
+ std::shared_ptr<VCardManager> testling = createManager();
+ VCard::ref vcard = std::make_shared<VCard>();
vcard->setFullName("New Name");
SetVCardRequest::ref request = testling->createSetVCardRequest(vcard);
request->send();
@@ -166,8 +166,8 @@ class VCardManagerTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<VCardManager> createManager() {
- boost::shared_ptr<VCardManager> manager(new VCardManager(ownJID, iqRouter, vcardStorage));
+ std::shared_ptr<VCardManager> createManager() {
+ std::shared_ptr<VCardManager> manager(new VCardManager(ownJID, iqRouter, vcardStorage));
manager->onVCardChanged.connect(boost::bind(&VCardManagerTest::handleVCardChanged, this, _1, _2));
manager->onOwnVCardChanged.connect(boost::bind(&VCardManagerTest::handleOwnVCardChanged, this, _1));
return manager;
@@ -205,7 +205,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
VCardMemoryStorage* vcardStorage;
std::vector< std::pair<JID, VCard::ref> > changes;
std::vector<VCard::ref> ownChanges;
- boost::shared_ptr<CryptoProvider> crypto;
+ std::shared_ptr<CryptoProvider> crypto;
};
CPPUNIT_TEST_SUITE_REGISTRATION(VCardManagerTest);
diff --git a/Swiften/VCards/VCardMemoryStorage.h b/Swiften/VCards/VCardMemoryStorage.h
index d4df639..9a79edc 100644
--- a/Swiften/VCards/VCardMemoryStorage.h
+++ b/Swiften/VCards/VCardMemoryStorage.h
@@ -7,8 +7,7 @@
#pragma once
#include <map>
-
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/JID/JID.h>
diff --git a/Swiften/VCards/VCardStorage.h b/Swiften/VCards/VCardStorage.h
index 7314559..632e9e3 100644
--- a/Swiften/VCards/VCardStorage.h
+++ b/Swiften/VCards/VCardStorage.h
@@ -6,10 +6,10 @@
#pragma once
+#include <memory>
#include <string>
#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/VCard.h>
diff --git a/Swiften/Whiteboard/IncomingWhiteboardSession.cpp b/Swiften/Whiteboard/IncomingWhiteboardSession.cpp
index 206e10b..462bf21 100644
--- a/Swiften/Whiteboard/IncomingWhiteboardSession.cpp
+++ b/Swiften/Whiteboard/IncomingWhiteboardSession.cpp
@@ -12,7 +12,7 @@
#include <Swiften/Whiteboard/IncomingWhiteboardSession.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h>
#include <Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h>
@@ -27,8 +27,8 @@ namespace Swift {
}
void IncomingWhiteboardSession::accept() {
- boost::shared_ptr<WhiteboardPayload> payload = boost::make_shared<WhiteboardPayload>(WhiteboardPayload::SessionAccept);
- boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_);
+ std::shared_ptr<WhiteboardPayload> payload = std::make_shared<WhiteboardPayload>(WhiteboardPayload::SessionAccept);
+ std::shared_ptr<GenericRequest<WhiteboardPayload> > request = std::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_);
request->send();
onRequestAccepted(toJID_);
}
@@ -43,7 +43,7 @@ namespace Swift {
}
if (pairResult.server) {
- WhiteboardPayload::ref payload = boost::make_shared<WhiteboardPayload>();
+ WhiteboardPayload::ref payload = std::make_shared<WhiteboardPayload>();
payload->setOperation(pairResult.server);
sendPayload(payload);
}
@@ -57,7 +57,7 @@ namespace Swift {
WhiteboardOperation::ref result = client.handleLocalOperationReceived(operation);
if (result) {
- WhiteboardPayload::ref payload = boost::make_shared<WhiteboardPayload>();
+ WhiteboardPayload::ref payload = std::make_shared<WhiteboardPayload>();
payload->setOperation(result);
sendPayload(payload);
}
diff --git a/Swiften/Whiteboard/IncomingWhiteboardSession.h b/Swiften/Whiteboard/IncomingWhiteboardSession.h
index f6c1f49..0f43cea 100644
--- a/Swiften/Whiteboard/IncomingWhiteboardSession.h
+++ b/Swiften/Whiteboard/IncomingWhiteboardSession.h
@@ -12,7 +12,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Whiteboard/WhiteboardClient.h>
@@ -21,7 +21,7 @@
namespace Swift {
class SWIFTEN_API IncomingWhiteboardSession : public WhiteboardSession {
public:
- typedef boost::shared_ptr<IncomingWhiteboardSession> ref;
+ typedef std::shared_ptr<IncomingWhiteboardSession> ref;
public:
IncomingWhiteboardSession(const JID& jid, IQRouter* router);
diff --git a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp
index 2bfc434..49f48aa 100644
--- a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp
+++ b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp
@@ -12,8 +12,9 @@
#include <Swiften/Whiteboard/OutgoingWhiteboardSession.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h>
#include <Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h>
@@ -28,13 +29,13 @@ namespace Swift {
}
void OutgoingWhiteboardSession::startSession() {
- boost::shared_ptr<WhiteboardPayload> payload = boost::make_shared<WhiteboardPayload>(WhiteboardPayload::SessionRequest);
- boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_);
+ std::shared_ptr<WhiteboardPayload> payload = std::make_shared<WhiteboardPayload>(WhiteboardPayload::SessionRequest);
+ std::shared_ptr<GenericRequest<WhiteboardPayload> > request = std::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_);
request->onResponse.connect(boost::bind(&OutgoingWhiteboardSession::handleRequestResponse, this, _1, _2));
request->send();
}
- void OutgoingWhiteboardSession::handleRequestResponse(boost::shared_ptr<WhiteboardPayload> /*payload*/, ErrorPayload::ref error) {
+ void OutgoingWhiteboardSession::handleRequestResponse(std::shared_ptr<WhiteboardPayload> /*payload*/, ErrorPayload::ref error) {
if (error) {
onRequestRejected(toJID_);
}
@@ -47,7 +48,7 @@ namespace Swift {
}
lastOpID = op->getID();
- WhiteboardPayload::ref payload = boost::make_shared<WhiteboardPayload>();
+ WhiteboardPayload::ref payload = std::make_shared<WhiteboardPayload>();
payload->setOperation(op);
sendPayload(payload);
}
@@ -58,7 +59,7 @@ namespace Swift {
lastOpID = operation->getID();
server.handleLocalOperationReceived(operation);
- WhiteboardPayload::ref payload = boost::make_shared<WhiteboardPayload>();
+ WhiteboardPayload::ref payload = std::make_shared<WhiteboardPayload>();
payload->setOperation(operation);
sendPayload(payload);
}
diff --git a/Swiften/Whiteboard/OutgoingWhiteboardSession.h b/Swiften/Whiteboard/OutgoingWhiteboardSession.h
index dd8623a..52fb1db 100644
--- a/Swiften/Whiteboard/OutgoingWhiteboardSession.h
+++ b/Swiften/Whiteboard/OutgoingWhiteboardSession.h
@@ -12,7 +12,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Queries/GenericRequest.h>
@@ -22,7 +22,7 @@
namespace Swift {
class SWIFTEN_API OutgoingWhiteboardSession : public WhiteboardSession {
public:
- typedef boost::shared_ptr<OutgoingWhiteboardSession> ref;
+ typedef std::shared_ptr<OutgoingWhiteboardSession> ref;
public:
OutgoingWhiteboardSession(const JID& jid, IQRouter* router);
@@ -30,7 +30,7 @@ namespace Swift {
void startSession();
private:
- void handleRequestResponse(boost::shared_ptr<WhiteboardPayload> /*payload*/, ErrorPayload::ref error);
+ void handleRequestResponse(std::shared_ptr<WhiteboardPayload> /*payload*/, ErrorPayload::ref error);
void handleIncomingOperation(WhiteboardOperation::ref operation);
void sendOperation(WhiteboardOperation::ref operation);
diff --git a/Swiften/Whiteboard/UnitTest/WhiteboardClientTest.cpp b/Swiften/Whiteboard/UnitTest/WhiteboardClientTest.cpp
index 9534c60..fd26825 100644
--- a/Swiften/Whiteboard/UnitTest/WhiteboardClientTest.cpp
+++ b/Swiften/Whiteboard/UnitTest/WhiteboardClientTest.cpp
@@ -11,7 +11,7 @@
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -46,7 +46,7 @@ public:
WhiteboardInsertOperation::ref serverOp;
serverOp = createInsertOperation("0", "", 0);
WhiteboardClient::Result pairResult = client.handleServerOperationReceived(serverOp);
- CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
+ CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server);
//Client receives first local operation, because it's parented off "0" which exists
@@ -54,7 +54,7 @@ public:
//so this operation could be send
WhiteboardInsertOperation::ref clientOp;
clientOp = createInsertOperation("a", "0", 1);
- WhiteboardEllipseElement::ref aElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref aElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setElement(aElement);
WhiteboardInsertOperation::ref result;
checkOperation(client.handleLocalOperationReceived(clientOp), "a", "0", 1, aElement);
@@ -63,7 +63,7 @@ public:
//so it have to be transformed against local operations and then transformed value can
//be returned to draw
serverOp = createInsertOperation("b", "0", 1);
- WhiteboardEllipseElement::ref bElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref bElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
serverOp->setElement(bElement);
pairResult = client.handleServerOperationReceived(serverOp);
checkOperation(pairResult.client, "b", "a", 2, bElement);
@@ -82,7 +82,7 @@ public:
//but operation returned to send to the server should be parented off last server
//operation, which is "b"
clientOp = createInsertOperation("c", "b", 3);
- WhiteboardEllipseElement::ref cElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref cElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setElement(cElement);
checkOperation(client.handleLocalOperationReceived(clientOp), "c", "a", 3, cElement);
@@ -123,21 +123,21 @@ public:
WhiteboardInsertOperation::ref serverOp;
serverOp = createInsertOperation("0", "", 0);
WhiteboardClient::Result pairResult = client.handleServerOperationReceived(serverOp);
- CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
+ CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server);
//Client receives first local operation, because it's parented off "0" which exists
//in server history and client doesn't wait for any operation ack from server,
//so this operation could be send
WhiteboardInsertOperation::ref clientOp = createInsertOperation("c", "0", 1);
- WhiteboardEllipseElement::ref cElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref cElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setElement(cElement);
checkOperation(client.handleLocalOperationReceived(clientOp), "c", "0", 1, cElement);
//Client receives second local operation, client didn't receive ack about previous
//operation from the server so it can't be send.
clientOp = createInsertOperation("d", "c", 2);
- WhiteboardEllipseElement::ref dElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref dElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setElement(dElement);
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), client.handleLocalOperationReceived(clientOp));
@@ -162,11 +162,11 @@ public:
//the end of local history so it doesn't have to be transformed, so operation
//to pass to window should be the same
serverOp = createInsertOperation("e", "d", 3);
- WhiteboardEllipseElement::ref eElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref eElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
serverOp->setElement(eElement);
pairResult = client.handleServerOperationReceived(serverOp);
- WhiteboardInsertOperation::ref result = boost::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client);
- CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
+ WhiteboardInsertOperation::ref result = std::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client);
+ CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server);
@@ -196,7 +196,7 @@ public:
WhiteboardInsertOperation::ref serverOp;
serverOp = createInsertOperation("0", "", 0);
WhiteboardClient::Result pairResult = client.handleServerOperationReceived(serverOp);
- CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
+ CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server);
//Client receives first local operation, because it's parented off "0" which exists
@@ -204,14 +204,14 @@ public:
//so this operation could be send
WhiteboardInsertOperation::ref clientOp;
clientOp = createInsertOperation("a", "0", 1);
- WhiteboardEllipseElement::ref aElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref aElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setElement(aElement);
checkOperation(client.handleLocalOperationReceived(clientOp), "a", "0", 1, aElement);
//Client receives second local operation, client didn't receive ack about previous
//operation from the server so it can't be send.
clientOp = createInsertOperation("b", "a", 2);
- WhiteboardEllipseElement::ref bElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref bElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setElement(bElement);
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), client.handleLocalOperationReceived(clientOp));
@@ -219,7 +219,7 @@ public:
//"a" and "b" before adding to local operations history because it's parented off "0".
//Because client is waiting for ack of "a", there is no operation to send to server
serverOp = createInsertOperation("c", "0", 1);
- WhiteboardEllipseElement::ref cElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref cElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
serverOp->setElement(cElement);
pairResult = client.handleServerOperationReceived(serverOp);
checkOperation(pairResult.client, "c", "b", 3, cElement);
@@ -230,7 +230,7 @@ public:
//"c" existing in local history.
//Because client is waiting for ack of "a", there is no operation to send to server
serverOp = createInsertOperation("d", "c", 2);
- WhiteboardEllipseElement::ref dElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref dElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
serverOp->setElement(dElement);
pairResult = client.handleServerOperationReceived(serverOp);
checkOperation(pairResult.client, "d", "c", 4, dElement);
@@ -282,7 +282,7 @@ public:
WhiteboardInsertOperation::ref serverOp;
serverOp = createInsertOperation("0", "", 0);
WhiteboardClient::Result pairResult = client.handleServerOperationReceived(serverOp);
- CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
+ CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server);
//Client receives first local operation, because it's parented off "0" which exists
@@ -290,14 +290,14 @@ public:
//so this operation could be send
WhiteboardInsertOperation::ref clientOp;
clientOp = createInsertOperation("a", "0", 1);
- WhiteboardEllipseElement::ref aElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref aElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setElement(aElement);
checkOperation(client.handleLocalOperationReceived(clientOp), "a", "0", 1, aElement);
//Client receives second local operation, client didn't receive ack about previous
//operation from the server so it can't be send.
clientOp = createInsertOperation("b", "a", 2);
- WhiteboardEllipseElement::ref bElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref bElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setElement(bElement);
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), client.handleLocalOperationReceived(clientOp));
@@ -305,7 +305,7 @@ public:
//"a" and "b" before adding to local operations history because it's parented off "0".
//Because client is waiting for ack of "a", there is no operation to send to server
serverOp = createInsertOperation("c", "0", 1);
- WhiteboardEllipseElement::ref cElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref cElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
serverOp->setElement(cElement);
pairResult = client.handleServerOperationReceived(serverOp);
checkOperation(pairResult.client, "c", "b", 3, cElement);
@@ -314,7 +314,7 @@ public:
//Client receives new local operation, client is still waiting for ack so, it
//should return nothing
clientOp = createInsertOperation("e", "a", 4);
- WhiteboardEllipseElement::ref eElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref eElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setElement(eElement);
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), client.handleLocalOperationReceived(clientOp));
@@ -322,7 +322,7 @@ public:
//against result of previous transformations and operation "e", returned operation should
//be parented off "e", which was last local operation
serverOp = createInsertOperation("d", "c", 2);
- WhiteboardEllipseElement::ref dElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref dElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
serverOp->setElement(dElement);
pairResult = client.handleServerOperationReceived(serverOp);
checkOperation(pairResult.client, "d", "e", 5, dElement);
@@ -383,7 +383,7 @@ public:
WhiteboardInsertOperation::ref serverOp;
serverOp = createInsertOperation("0", "", 0);
WhiteboardClient::Result pairResult = client.handleServerOperationReceived(serverOp);
- CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
+ CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server);
//Client receives first local operation, because it's parented off "0" which exists
@@ -391,14 +391,14 @@ public:
//so this operation could be send
WhiteboardInsertOperation::ref clientOp;
clientOp = createInsertOperation("a", "0", 1);
- WhiteboardEllipseElement::ref aElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref aElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setElement(aElement);
checkOperation(client.handleLocalOperationReceived(clientOp), "a", "0", 1, aElement);
//Client receives second local operation, client didn't receive ack about previous
//operation from the server so it can't be send.
clientOp = createInsertOperation("b", "a", 2);
- WhiteboardEllipseElement::ref bElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref bElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setElement(bElement);
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), client.handleLocalOperationReceived(clientOp));
@@ -406,7 +406,7 @@ public:
//"a" and "b" before adding to local operations history because it's parented off "0".
//Because client is waiting for ack of "a", there is no operation to send to server
serverOp = createInsertOperation("c", "0", 1);
- WhiteboardEllipseElement::ref cElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref cElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
serverOp->setElement(cElement);
pairResult = client.handleServerOperationReceived(serverOp);
checkOperation(pairResult.client, "c", "b", 3, cElement);
@@ -425,7 +425,7 @@ public:
//against result of previous transformation(but only with transformation of "b"), returned
//operation should be parented off "c", which was last local operation
serverOp = createInsertOperation("d", "a", 3);
- WhiteboardEllipseElement::ref dElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref dElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
serverOp->setElement(dElement);
pairResult = client.handleServerOperationReceived(serverOp);
checkOperation(pairResult.client, "d", "c", 4, dElement);
@@ -471,7 +471,7 @@ public:
WhiteboardInsertOperation::ref serverOp;
serverOp = createInsertOperation("0", "", 0);
WhiteboardClient::Result pairResult = client.handleServerOperationReceived(serverOp);
- CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
+ CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server);
//Client receives first local operation, because it's parented off "0" which exists
@@ -479,14 +479,14 @@ public:
//so this operation could be send
WhiteboardInsertOperation::ref clientOp;
clientOp = createInsertOperation("a", "0", 1);
- WhiteboardEllipseElement::ref aElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref aElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setElement(aElement);
checkOperation(client.handleLocalOperationReceived(clientOp), "a", "0", 1, aElement);
//Client receives second local operation, client didn't receive ack about previous
//operation from the server so it can't be send.
WhiteboardUpdateOperation::ref clientUpdateOp = createUpdateOperation("b", "a", 0);
- WhiteboardEllipseElement::ref bElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref bElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientUpdateOp->setElement(bElement);
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), client.handleLocalOperationReceived(clientUpdateOp));
@@ -494,7 +494,7 @@ public:
//"a" and "b" before adding to local operations history because it's parented off "0".
//Because client is waiting for ack of "a", there is no operation to send to server
WhiteboardUpdateOperation::ref serverUpdateOp = createUpdateOperation("c", "0", 0);
- WhiteboardEllipseElement::ref cElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref cElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
serverUpdateOp->setElement(cElement);
pairResult = client.handleServerOperationReceived(serverUpdateOp);
checkOperation(pairResult.client, "c", "b", 0, cElement);
@@ -505,7 +505,7 @@ public:
//"c" existing in local history.
//Because client is waiting for ack of "a", there is no operation to send to server
serverOp = createInsertOperation("d", "c", 1);
- WhiteboardEllipseElement::ref dElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref dElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
serverOp->setElement(dElement);
pairResult = client.handleServerOperationReceived(serverOp);
checkOperation(pairResult.client, "d", "c", 2, dElement);
@@ -556,12 +556,12 @@ public:
WhiteboardInsertOperation::ref serverOp;
serverOp = createInsertOperation("0", "", 0);
WhiteboardClient::Result pairResult = client.handleServerOperationReceived(serverOp);
- CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
+ CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server);
serverOp = createInsertOperation("1", "0", 1);
pairResult = client.handleServerOperationReceived(serverOp);
- CPPUNIT_ASSERT_EQUAL(serverOp, boost::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
+ CPPUNIT_ASSERT_EQUAL(serverOp, std::dynamic_pointer_cast<WhiteboardInsertOperation>(pairResult.client));
CPPUNIT_ASSERT_EQUAL(WhiteboardOperation::ref(), pairResult.server);
//Client receives first local operation, because it's parented off "0" which exists
//in server history and client doesn't wait for any operation ack from server,
@@ -570,7 +570,7 @@ public:
WhiteboardUpdateOperation::ref clientUpdateOp;
WhiteboardDeleteOperation::ref clientDeleteOp;
clientUpdateOp = createUpdateOperation("a", "1", 0);
- WhiteboardEllipseElement::ref aElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref aElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientUpdateOp->setElement(aElement);
checkOperation(client.handleLocalOperationReceived(clientUpdateOp), "a", "1", 0, aElement);
@@ -583,7 +583,7 @@ public:
//"a" and "b" before adding to local operations history because it's parented off "0".
//Because client is waiting for ack of "a", there is no operation to send to server
serverOp = createInsertOperation("c", "1", 2);
- WhiteboardEllipseElement::ref cElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref cElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
serverOp->setElement(cElement);
pairResult = client.handleServerOperationReceived(serverOp);
checkOperation(pairResult.client, "c", "b", 1, cElement);
@@ -594,7 +594,7 @@ public:
//"c" existing in local history.
//Because client is waiting for ack of "a", there is no operation to send to server
WhiteboardUpdateOperation::ref serverUpdateOp = createUpdateOperation("d", "c", 0);
- WhiteboardEllipseElement::ref dElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardEllipseElement::ref dElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
serverUpdateOp->setElement(dElement);
pairResult = client.handleServerOperationReceived(serverUpdateOp);
checkOperation(pairResult.client, "d", "c", 0, dElement);
@@ -636,7 +636,7 @@ public:
WhiteboardInsertOperation::ref createInsertOperation(std::string id, std::string parent, int pos) {
- WhiteboardInsertOperation::ref operation = boost::make_shared<WhiteboardInsertOperation>();
+ WhiteboardInsertOperation::ref operation = std::make_shared<WhiteboardInsertOperation>();
operation->setParentID(parent);
operation->setID(id);
operation->setPos(pos);
@@ -644,7 +644,7 @@ public:
}
WhiteboardUpdateOperation::ref createUpdateOperation(std::string id, std::string parent, int pos) {
- WhiteboardUpdateOperation::ref operation = boost::make_shared<WhiteboardUpdateOperation>();
+ WhiteboardUpdateOperation::ref operation = std::make_shared<WhiteboardUpdateOperation>();
operation->setParentID(parent);
operation->setID(id);
operation->setPos(pos);
@@ -652,7 +652,7 @@ public:
}
WhiteboardDeleteOperation::ref createDeleteOperation(std::string id, std::string parent, int pos) {
- WhiteboardDeleteOperation::ref operation = boost::make_shared<WhiteboardDeleteOperation>();
+ WhiteboardDeleteOperation::ref operation = std::make_shared<WhiteboardDeleteOperation>();
operation->setParentID(parent);
operation->setID(id);
operation->setPos(pos);
@@ -667,12 +667,12 @@ public:
}
if (element) {
- WhiteboardInsertOperation::ref insertOp = boost::dynamic_pointer_cast<WhiteboardInsertOperation>(operation);
+ WhiteboardInsertOperation::ref insertOp = std::dynamic_pointer_cast<WhiteboardInsertOperation>(operation);
if (insertOp) {
CPPUNIT_ASSERT_EQUAL(element, insertOp->getElement());
}
- WhiteboardUpdateOperation::ref updateOp = boost::dynamic_pointer_cast<WhiteboardUpdateOperation>(operation);
+ WhiteboardUpdateOperation::ref updateOp = std::dynamic_pointer_cast<WhiteboardUpdateOperation>(operation);
if (updateOp) {
CPPUNIT_ASSERT_EQUAL(element, updateOp->getElement());
}
diff --git a/Swiften/Whiteboard/UnitTest/WhiteboardServerTest.cpp b/Swiften/Whiteboard/UnitTest/WhiteboardServerTest.cpp
index 58b8c19..e868968 100644
--- a/Swiften/Whiteboard/UnitTest/WhiteboardServerTest.cpp
+++ b/Swiften/Whiteboard/UnitTest/WhiteboardServerTest.cpp
@@ -11,7 +11,7 @@
*/
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -34,44 +34,44 @@ class WhiteboardServerTest : public CppUnit::TestFixture {
public:
void testSimpleOp() {
WhiteboardServer server;
- WhiteboardInsertOperation::ref firstOp = boost::make_shared<WhiteboardInsertOperation>();
+ WhiteboardInsertOperation::ref firstOp = std::make_shared<WhiteboardInsertOperation>();
firstOp->setID("0");
server.handleLocalOperationReceived(firstOp);
- WhiteboardInsertOperation::ref serverOp = boost::make_shared<WhiteboardInsertOperation>();
+ WhiteboardInsertOperation::ref serverOp = std::make_shared<WhiteboardInsertOperation>();
serverOp->setID("b");
serverOp->setParentID("0");
serverOp->setPos(1);
server.handleLocalOperationReceived(serverOp);
- WhiteboardInsertOperation::ref clientOp = boost::make_shared<WhiteboardInsertOperation>();
- WhiteboardEllipseElement::ref clientElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardInsertOperation::ref clientOp = std::make_shared<WhiteboardInsertOperation>();
+ WhiteboardEllipseElement::ref clientElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setID("a");
clientOp->setParentID("0");
clientOp->setPos(1);
clientOp->setElement(clientElement);
- WhiteboardInsertOperation::ref op = boost::dynamic_pointer_cast<WhiteboardInsertOperation>(server.handleClientOperationReceived(clientOp));
+ WhiteboardInsertOperation::ref op = std::dynamic_pointer_cast<WhiteboardInsertOperation>(server.handleClientOperationReceived(clientOp));
CPPUNIT_ASSERT_EQUAL(std::string("b"), op->getParentID());
CPPUNIT_ASSERT_EQUAL(std::string("a"), op->getID());
CPPUNIT_ASSERT_EQUAL(1, op->getPos());
- CPPUNIT_ASSERT_EQUAL(clientElement, boost::dynamic_pointer_cast<WhiteboardEllipseElement>(op->getElement()));
+ CPPUNIT_ASSERT_EQUAL(clientElement, std::dynamic_pointer_cast<WhiteboardEllipseElement>(op->getElement()));
}
void testSimpleOp1() {
WhiteboardServer server;
- WhiteboardInsertOperation::ref firstOp = boost::make_shared<WhiteboardInsertOperation>();
+ WhiteboardInsertOperation::ref firstOp = std::make_shared<WhiteboardInsertOperation>();
firstOp->setID("0");
server.handleLocalOperationReceived(firstOp);
- WhiteboardDeleteOperation::ref serverOp = boost::make_shared<WhiteboardDeleteOperation>();
+ WhiteboardDeleteOperation::ref serverOp = std::make_shared<WhiteboardDeleteOperation>();
serverOp->setID("b");
serverOp->setParentID("0");
serverOp->setPos(1);
server.handleLocalOperationReceived(serverOp);
- WhiteboardUpdateOperation::ref clientOp = boost::make_shared<WhiteboardUpdateOperation>();
- WhiteboardEllipseElement::ref clientElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardUpdateOperation::ref clientOp = std::make_shared<WhiteboardUpdateOperation>();
+ WhiteboardEllipseElement::ref clientElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setID("a");
clientOp->setParentID("0");
clientOp->setPos(1);
clientOp->setElement(clientElement);
- WhiteboardDeleteOperation::ref op = boost::dynamic_pointer_cast<WhiteboardDeleteOperation>(server.handleClientOperationReceived(clientOp));
+ WhiteboardDeleteOperation::ref op = std::dynamic_pointer_cast<WhiteboardDeleteOperation>(server.handleClientOperationReceived(clientOp));
CPPUNIT_ASSERT_EQUAL(std::string("b"), op->getParentID());
CPPUNIT_ASSERT_EQUAL(std::string("a"), op->getID());
CPPUNIT_ASSERT_EQUAL(-1, op->getPos());
@@ -79,19 +79,19 @@ public:
void testSimpleOp2() {
WhiteboardServer server;
- WhiteboardInsertOperation::ref firstOp = boost::make_shared<WhiteboardInsertOperation>();
+ WhiteboardInsertOperation::ref firstOp = std::make_shared<WhiteboardInsertOperation>();
firstOp->setID("0");
server.handleLocalOperationReceived(firstOp);
- WhiteboardUpdateOperation::ref serverOp = boost::make_shared<WhiteboardUpdateOperation>();
+ WhiteboardUpdateOperation::ref serverOp = std::make_shared<WhiteboardUpdateOperation>();
serverOp->setID("b");
serverOp->setParentID("0");
serverOp->setPos(1);
server.handleLocalOperationReceived(serverOp);
- WhiteboardDeleteOperation::ref clientOp = boost::make_shared<WhiteboardDeleteOperation>();
+ WhiteboardDeleteOperation::ref clientOp = std::make_shared<WhiteboardDeleteOperation>();
clientOp->setID("a");
clientOp->setParentID("0");
clientOp->setPos(1);
- WhiteboardDeleteOperation::ref op = boost::dynamic_pointer_cast<WhiteboardDeleteOperation>(server.handleClientOperationReceived(clientOp));
+ WhiteboardDeleteOperation::ref op = std::dynamic_pointer_cast<WhiteboardDeleteOperation>(server.handleClientOperationReceived(clientOp));
CPPUNIT_ASSERT_EQUAL(std::string("b"), op->getParentID());
CPPUNIT_ASSERT_EQUAL(std::string("a"), op->getID());
CPPUNIT_ASSERT_EQUAL(1, op->getPos());
@@ -100,35 +100,35 @@ public:
void testFewSimpleOps() {
WhiteboardServer server;
- WhiteboardInsertOperation::ref firstOp = boost::make_shared<WhiteboardInsertOperation>();
+ WhiteboardInsertOperation::ref firstOp = std::make_shared<WhiteboardInsertOperation>();
firstOp->setID("0");
server.handleLocalOperationReceived(firstOp);
- WhiteboardInsertOperation::ref serverOp = boost::make_shared<WhiteboardInsertOperation>();
+ WhiteboardInsertOperation::ref serverOp = std::make_shared<WhiteboardInsertOperation>();
serverOp->setID("a");
serverOp->setParentID("0");
serverOp->setPos(1);
server.handleLocalOperationReceived(serverOp);
- serverOp = boost::make_shared<WhiteboardInsertOperation>();
+ serverOp = std::make_shared<WhiteboardInsertOperation>();
serverOp->setID("b");
serverOp->setParentID("a");
serverOp->setPos(2);
server.handleLocalOperationReceived(serverOp);
- serverOp = boost::make_shared<WhiteboardInsertOperation>();
+ serverOp = std::make_shared<WhiteboardInsertOperation>();
serverOp->setID("c");
serverOp->setParentID("b");
serverOp->setPos(3);
server.handleLocalOperationReceived(serverOp);
- WhiteboardInsertOperation::ref clientOp = boost::make_shared<WhiteboardInsertOperation>();
- WhiteboardEllipseElement::ref clientElement = boost::make_shared<WhiteboardEllipseElement>(0,0,0,0);
+ WhiteboardInsertOperation::ref clientOp = std::make_shared<WhiteboardInsertOperation>();
+ WhiteboardEllipseElement::ref clientElement = std::make_shared<WhiteboardEllipseElement>(0,0,0,0);
clientOp->setID("d");
clientOp->setParentID("0");
clientOp->setPos(1);
clientOp->setElement(clientElement);
- WhiteboardInsertOperation::ref op = boost::dynamic_pointer_cast<WhiteboardInsertOperation>(server.handleClientOperationReceived(clientOp));
+ WhiteboardInsertOperation::ref op = std::dynamic_pointer_cast<WhiteboardInsertOperation>(server.handleClientOperationReceived(clientOp));
CPPUNIT_ASSERT_EQUAL(std::string("c"), op->getParentID());
CPPUNIT_ASSERT_EQUAL(std::string("d"), op->getID());
CPPUNIT_ASSERT_EQUAL(1, op->getPos());
- CPPUNIT_ASSERT_EQUAL(clientElement, boost::dynamic_pointer_cast<WhiteboardEllipseElement>(op->getElement()));
+ CPPUNIT_ASSERT_EQUAL(clientElement, std::dynamic_pointer_cast<WhiteboardEllipseElement>(op->getElement()));
}
};
diff --git a/Swiften/Whiteboard/WhiteboardClient.cpp b/Swiften/Whiteboard/WhiteboardClient.cpp
index f272a8c..d7ed3ad 100644
--- a/Swiften/Whiteboard/WhiteboardClient.cpp
+++ b/Swiften/Whiteboard/WhiteboardClient.cpp
@@ -13,8 +13,7 @@
#include <Swiften/Whiteboard/WhiteboardClient.h>
#include <iostream>
-
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Whiteboard/WhiteboardTransformer.h>
@@ -23,17 +22,17 @@ namespace Swift {
localOperations_.push_back(operation);
WhiteboardOperation::ref op;
- WhiteboardInsertOperation::ref insertOp = boost::dynamic_pointer_cast<WhiteboardInsertOperation>(operation);
+ WhiteboardInsertOperation::ref insertOp = std::dynamic_pointer_cast<WhiteboardInsertOperation>(operation);
if (insertOp) {
- op = boost::make_shared<WhiteboardInsertOperation>(*insertOp);
+ op = std::make_shared<WhiteboardInsertOperation>(*insertOp);
}
- WhiteboardUpdateOperation::ref updateOp = boost::dynamic_pointer_cast<WhiteboardUpdateOperation>(operation);
+ WhiteboardUpdateOperation::ref updateOp = std::dynamic_pointer_cast<WhiteboardUpdateOperation>(operation);
if (updateOp) {
- op = boost::make_shared<WhiteboardUpdateOperation>(*updateOp);
+ op = std::make_shared<WhiteboardUpdateOperation>(*updateOp);
}
- WhiteboardDeleteOperation::ref deleteOp = boost::dynamic_pointer_cast<WhiteboardDeleteOperation>(operation);
+ WhiteboardDeleteOperation::ref deleteOp = std::dynamic_pointer_cast<WhiteboardDeleteOperation>(operation);
if (deleteOp) {
- op = boost::make_shared<WhiteboardDeleteOperation>(*deleteOp);
+ op = std::make_shared<WhiteboardDeleteOperation>(*deleteOp);
}
if (!bridge_.empty()) {
@@ -43,17 +42,17 @@ namespace Swift {
if (lastSentOperationID_.empty())
{
- WhiteboardInsertOperation::ref insertOp = boost::dynamic_pointer_cast<WhiteboardInsertOperation>(operation);
+ WhiteboardInsertOperation::ref insertOp = std::dynamic_pointer_cast<WhiteboardInsertOperation>(operation);
if (insertOp) {
- op = boost::make_shared<WhiteboardInsertOperation>(*insertOp);
+ op = std::make_shared<WhiteboardInsertOperation>(*insertOp);
}
- WhiteboardUpdateOperation::ref updateOp = boost::dynamic_pointer_cast<WhiteboardUpdateOperation>(operation);
+ WhiteboardUpdateOperation::ref updateOp = std::dynamic_pointer_cast<WhiteboardUpdateOperation>(operation);
if (updateOp) {
- op = boost::make_shared<WhiteboardUpdateOperation>(*updateOp);
+ op = std::make_shared<WhiteboardUpdateOperation>(*updateOp);
}
- WhiteboardDeleteOperation::ref deleteOp = boost::dynamic_pointer_cast<WhiteboardDeleteOperation>(operation);
+ WhiteboardDeleteOperation::ref deleteOp = std::dynamic_pointer_cast<WhiteboardDeleteOperation>(operation);
if (deleteOp) {
- op = boost::make_shared<WhiteboardDeleteOperation>(*deleteOp);
+ op = std::make_shared<WhiteboardDeleteOperation>(*deleteOp);
}
diff --git a/Swiften/Whiteboard/WhiteboardResponder.cpp b/Swiften/Whiteboard/WhiteboardResponder.cpp
index b0b3e6c..f9df709 100644
--- a/Swiften/Whiteboard/WhiteboardResponder.cpp
+++ b/Swiften/Whiteboard/WhiteboardResponder.cpp
@@ -12,7 +12,7 @@
#include <Swiften/Whiteboard/WhiteboardResponder.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Queries/IQRouter.h>
#include <Swiften/Whiteboard/IncomingWhiteboardSession.h>
@@ -23,17 +23,17 @@ namespace Swift {
WhiteboardResponder::WhiteboardResponder(WhiteboardSessionManager* sessionManager, IQRouter* router) : SetResponder<WhiteboardPayload>(router), sessionManager_(sessionManager), router_(router) {
}
- bool WhiteboardResponder::handleSetRequest(const JID& from, const JID& /*to*/, const std::string& id, boost::shared_ptr<WhiteboardPayload> payload) {
+ bool WhiteboardResponder::handleSetRequest(const JID& from, const JID& /*to*/, const std::string& id, std::shared_ptr<WhiteboardPayload> payload) {
if (payload->getType() == WhiteboardPayload::SessionRequest) {
if (sessionManager_->getSession(from)) {
sendError(from, id, ErrorPayload::Conflict, ErrorPayload::Cancel);
} else {
- sendResponse(from, id, boost::shared_ptr<WhiteboardPayload>());
- IncomingWhiteboardSession::ref session = boost::make_shared<IncomingWhiteboardSession>(from, router_);
+ sendResponse(from, id, std::shared_ptr<WhiteboardPayload>());
+ IncomingWhiteboardSession::ref session = std::make_shared<IncomingWhiteboardSession>(from, router_);
sessionManager_->handleIncomingSession(session);
}
} else {
- sendResponse(from, id, boost::shared_ptr<WhiteboardPayload>());
+ sendResponse(from, id, std::shared_ptr<WhiteboardPayload>());
WhiteboardSession::ref session = sessionManager_->getSession(from);
if (session != nullptr) {
session->handleIncomingAction(payload);
diff --git a/Swiften/Whiteboard/WhiteboardResponder.h b/Swiften/Whiteboard/WhiteboardResponder.h
index 0821a9f..ac44664 100644
--- a/Swiften/Whiteboard/WhiteboardResponder.h
+++ b/Swiften/Whiteboard/WhiteboardResponder.h
@@ -23,7 +23,7 @@ namespace Swift {
class SWIFTEN_API WhiteboardResponder : public SetResponder<WhiteboardPayload> {
public:
WhiteboardResponder(WhiteboardSessionManager* sessionManager, IQRouter* router);
- bool handleSetRequest(const JID& from, const JID& /*to*/, const std::string& id, boost::shared_ptr<WhiteboardPayload> payload);
+ bool handleSetRequest(const JID& from, const JID& /*to*/, const std::string& id, std::shared_ptr<WhiteboardPayload> payload);
private:
WhiteboardSessionManager* sessionManager_;
diff --git a/Swiften/Whiteboard/WhiteboardSession.cpp b/Swiften/Whiteboard/WhiteboardSession.cpp
index 23ca312..befef4f 100644
--- a/Swiften/Whiteboard/WhiteboardSession.cpp
+++ b/Swiften/Whiteboard/WhiteboardSession.cpp
@@ -13,8 +13,7 @@
#include <Swiften/Whiteboard/WhiteboardSession.h>
#include <iostream>
-
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Elements/ErrorPayload.h>
#include <Swiften/Elements/WhiteboardPayload.h>
@@ -27,7 +26,7 @@ namespace Swift {
WhiteboardSession::~WhiteboardSession() {
}
- void WhiteboardSession::handleIncomingAction(boost::shared_ptr<WhiteboardPayload> payload) {
+ void WhiteboardSession::handleIncomingAction(std::shared_ptr<WhiteboardPayload> payload) {
switch (payload->getType()) {
case WhiteboardPayload::Data:
handleIncomingOperation(payload->getOperation());
@@ -48,21 +47,21 @@ namespace Swift {
}
void WhiteboardSession::sendElement(const WhiteboardElement::ref element) {
- boost::shared_ptr<WhiteboardPayload> payload = boost::make_shared<WhiteboardPayload>();
+ std::shared_ptr<WhiteboardPayload> payload = std::make_shared<WhiteboardPayload>();
payload->setElement(element);
- boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_);
+ std::shared_ptr<GenericRequest<WhiteboardPayload> > request = std::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_);
request->send();
}
- void WhiteboardSession::sendPayload(boost::shared_ptr<WhiteboardPayload> payload) {
- boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_);
+ void WhiteboardSession::sendPayload(std::shared_ptr<WhiteboardPayload> payload) {
+ std::shared_ptr<GenericRequest<WhiteboardPayload> > request = std::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_);
request->send();
}
void WhiteboardSession::cancel() {
if (router_->isAvailable()) {
- boost::shared_ptr<WhiteboardPayload> payload = boost::make_shared<WhiteboardPayload>(WhiteboardPayload::SessionTerminate);
- boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_);
+ std::shared_ptr<WhiteboardPayload> payload = std::make_shared<WhiteboardPayload>(WhiteboardPayload::SessionTerminate);
+ std::shared_ptr<GenericRequest<WhiteboardPayload> > request = std::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_);
request->send();
}
onSessionTerminated(toJID_);
diff --git a/Swiften/Whiteboard/WhiteboardSession.h b/Swiften/Whiteboard/WhiteboardSession.h
index da927b3..63d9670 100644
--- a/Swiften/Whiteboard/WhiteboardSession.h
+++ b/Swiften/Whiteboard/WhiteboardSession.h
@@ -12,7 +12,7 @@
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Base/IDGenerator.h>
@@ -29,12 +29,12 @@ namespace Swift {
class SWIFTEN_API WhiteboardSession {
public:
- typedef boost::shared_ptr<WhiteboardSession> ref;
+ typedef std::shared_ptr<WhiteboardSession> ref;
public:
WhiteboardSession(const JID& jid, IQRouter* router);
virtual ~WhiteboardSession();
- void handleIncomingAction(boost::shared_ptr<WhiteboardPayload> payload);
+ void handleIncomingAction(std::shared_ptr<WhiteboardPayload> payload);
void sendElement(const WhiteboardElement::ref element);
virtual void sendOperation(WhiteboardOperation::ref operation) = 0;
void cancel();
@@ -51,7 +51,7 @@ namespace Swift {
virtual void handleIncomingOperation(WhiteboardOperation::ref operation) = 0;
protected:
- void sendPayload(boost::shared_ptr<WhiteboardPayload> payload);
+ void sendPayload(std::shared_ptr<WhiteboardPayload> payload);
JID toJID_;
IQRouter* router_;
diff --git a/Swiften/Whiteboard/WhiteboardSessionManager.cpp b/Swiften/Whiteboard/WhiteboardSessionManager.cpp
index 36f02cc..66b5ef8 100644
--- a/Swiften/Whiteboard/WhiteboardSessionManager.cpp
+++ b/Swiften/Whiteboard/WhiteboardSessionManager.cpp
@@ -13,8 +13,9 @@
#include <Swiften/Whiteboard/WhiteboardSessionManager.h>
+#include <memory>
+
#include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Base/foreach.h>
#include <Swiften/Disco/EntityCapsProvider.h>
@@ -37,7 +38,7 @@ namespace Swift {
WhiteboardSession::ref WhiteboardSessionManager::getSession(const JID& to) {
if (sessions_.find(to) == sessions_.end()) {
- return boost::shared_ptr<WhiteboardSession>();
+ return std::shared_ptr<WhiteboardSession>();
}
return sessions_[to];
}
@@ -47,7 +48,7 @@ namespace Swift {
if (fullJID.isBare()) {
fullJID = getFullJID(fullJID);
}
- OutgoingWhiteboardSession::ref session = boost::make_shared<OutgoingWhiteboardSession>(fullJID, router_);
+ OutgoingWhiteboardSession::ref session = std::make_shared<OutgoingWhiteboardSession>(fullJID, router_);
sessions_[fullJID] = session;
session->onSessionTerminated.connect(boost::bind(&WhiteboardSessionManager::deleteSessionEntry, this, _1));
session->onRequestRejected.connect(boost::bind(&WhiteboardSessionManager::deleteSessionEntry, this, _1));
diff --git a/Swiften/Whiteboard/WhiteboardSessionManager.h b/Swiften/Whiteboard/WhiteboardSessionManager.h
index 44ec087..44ce14a 100644
--- a/Swiften/Whiteboard/WhiteboardSessionManager.h
+++ b/Swiften/Whiteboard/WhiteboardSessionManager.h
@@ -50,7 +50,7 @@ namespace Swift {
void deleteSessionEntry(const JID& contact);
private:
- std::map<JID, boost::shared_ptr<WhiteboardSession> > sessions_;
+ std::map<JID, std::shared_ptr<WhiteboardSession> > sessions_;
IQRouter* router_;
StanzaChannel* stanzaChannel_;
PresenceOracle* presenceOracle_;
diff --git a/Swiften/Whiteboard/WhiteboardTransformer.cpp b/Swiften/Whiteboard/WhiteboardTransformer.cpp
index 40e364b..1d519f4 100644
--- a/Swiften/Whiteboard/WhiteboardTransformer.cpp
+++ b/Swiften/Whiteboard/WhiteboardTransformer.cpp
@@ -12,16 +12,16 @@
#include <Swiften/Whiteboard/WhiteboardTransformer.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
namespace Swift {
std::pair<WhiteboardOperation::ref, WhiteboardOperation::ref> WhiteboardTransformer::transform(WhiteboardOperation::ref clientOp, WhiteboardOperation::ref serverOp) {
- WhiteboardInsertOperation::ref clientInsert = boost::dynamic_pointer_cast<WhiteboardInsertOperation>(clientOp);
- WhiteboardInsertOperation::ref serverInsert = boost::dynamic_pointer_cast<WhiteboardInsertOperation>(serverOp);
- WhiteboardUpdateOperation::ref clientUpdate = boost::dynamic_pointer_cast<WhiteboardUpdateOperation>(clientOp);
- WhiteboardUpdateOperation::ref serverUpdate = boost::dynamic_pointer_cast<WhiteboardUpdateOperation>(serverOp);
- WhiteboardDeleteOperation::ref clientDelete = boost::dynamic_pointer_cast<WhiteboardDeleteOperation>(clientOp);
- WhiteboardDeleteOperation::ref serverDelete = boost::dynamic_pointer_cast<WhiteboardDeleteOperation>(serverOp);
+ WhiteboardInsertOperation::ref clientInsert = std::dynamic_pointer_cast<WhiteboardInsertOperation>(clientOp);
+ WhiteboardInsertOperation::ref serverInsert = std::dynamic_pointer_cast<WhiteboardInsertOperation>(serverOp);
+ WhiteboardUpdateOperation::ref clientUpdate = std::dynamic_pointer_cast<WhiteboardUpdateOperation>(clientOp);
+ WhiteboardUpdateOperation::ref serverUpdate = std::dynamic_pointer_cast<WhiteboardUpdateOperation>(serverOp);
+ WhiteboardDeleteOperation::ref clientDelete = std::dynamic_pointer_cast<WhiteboardDeleteOperation>(clientOp);
+ WhiteboardDeleteOperation::ref serverDelete = std::dynamic_pointer_cast<WhiteboardDeleteOperation>(serverOp);
if (clientInsert && serverInsert) {
return transform(clientInsert, serverInsert);
} else if (clientUpdate && serverUpdate) {
@@ -47,9 +47,9 @@ namespace Swift {
std::pair<WhiteboardOperation::ref, WhiteboardOperation::ref> WhiteboardTransformer::transform(WhiteboardInsertOperation::ref clientOp, WhiteboardInsertOperation::ref serverOp) {
std::pair<WhiteboardInsertOperation::ref, WhiteboardInsertOperation::ref> result;
- result.first = boost::make_shared<WhiteboardInsertOperation>(*serverOp);
+ result.first = std::make_shared<WhiteboardInsertOperation>(*serverOp);
result.first->setParentID(clientOp->getID());
- result.second = boost::make_shared<WhiteboardInsertOperation>(*clientOp);
+ result.second = std::make_shared<WhiteboardInsertOperation>(*clientOp);
result.second->setParentID(serverOp->getID());
if (clientOp->getPos() <= serverOp->getPos()) {
result.first->setPos(result.first->getPos()+1);
@@ -61,15 +61,15 @@ namespace Swift {
std::pair<WhiteboardOperation::ref, WhiteboardOperation::ref> WhiteboardTransformer::transform(WhiteboardUpdateOperation::ref clientOp, WhiteboardUpdateOperation::ref serverOp) {
std::pair<WhiteboardUpdateOperation::ref, WhiteboardUpdateOperation::ref> result;
- result.first = boost::make_shared<WhiteboardUpdateOperation>(*serverOp);
+ result.first = std::make_shared<WhiteboardUpdateOperation>(*serverOp);
result.first->setParentID(clientOp->getID());
if (clientOp->getPos() == serverOp->getPos()) {
- result.second = boost::make_shared<WhiteboardUpdateOperation>(*serverOp);
+ result.second = std::make_shared<WhiteboardUpdateOperation>(*serverOp);
result.second->setID(clientOp->getID());
result.second->setParentID(serverOp->getID());
} else {
- result.second = boost::make_shared<WhiteboardUpdateOperation>(*clientOp);
+ result.second = std::make_shared<WhiteboardUpdateOperation>(*clientOp);
result.second->setParentID(serverOp->getID());
}
@@ -95,9 +95,9 @@ namespace Swift {
std::pair<WhiteboardOperation::ref, WhiteboardOperation::ref> WhiteboardTransformer::transform(WhiteboardUpdateOperation::ref clientOp, WhiteboardInsertOperation::ref serverOp) {
std::pair<WhiteboardInsertOperation::ref, WhiteboardUpdateOperation::ref> result;
- result.first = boost::make_shared<WhiteboardInsertOperation>(*serverOp);
+ result.first = std::make_shared<WhiteboardInsertOperation>(*serverOp);
result.first->setParentID(clientOp->getID());
- result.second = boost::make_shared<WhiteboardUpdateOperation>(*clientOp);
+ result.second = std::make_shared<WhiteboardUpdateOperation>(*clientOp);
result.second->setParentID(serverOp->getID());
if (serverOp->getPos() <= clientOp->getPos()) {
result.second->setPos(result.second->getPos()+1);
@@ -107,9 +107,9 @@ namespace Swift {
std::pair<WhiteboardOperation::ref, WhiteboardOperation::ref> WhiteboardTransformer::transform(WhiteboardInsertOperation::ref clientOp, WhiteboardUpdateOperation::ref serverOp) {
std::pair<WhiteboardUpdateOperation::ref, WhiteboardInsertOperation::ref> result;
- result.first = boost::make_shared<WhiteboardUpdateOperation>(*serverOp);
+ result.first = std::make_shared<WhiteboardUpdateOperation>(*serverOp);
result.first->setParentID(clientOp->getID());
- result.second = boost::make_shared<WhiteboardInsertOperation>(*clientOp);
+ result.second = std::make_shared<WhiteboardInsertOperation>(*clientOp);
result.second->setParentID(serverOp->getID());
if (serverOp->getPos() >= clientOp->getPos()) {
result.first->setPos(result.first->getPos()+1);
@@ -119,9 +119,9 @@ namespace Swift {
std::pair<WhiteboardOperation::ref, WhiteboardOperation::ref> WhiteboardTransformer::transform(WhiteboardDeleteOperation::ref clientOp, WhiteboardDeleteOperation::ref serverOp) {
std::pair<WhiteboardDeleteOperation::ref, WhiteboardDeleteOperation::ref> result;
- result.first = boost::make_shared<WhiteboardDeleteOperation>(*serverOp);
+ result.first = std::make_shared<WhiteboardDeleteOperation>(*serverOp);
result.first->setParentID(clientOp->getID());
- result.second = boost::make_shared<WhiteboardDeleteOperation>(*clientOp);
+ result.second = std::make_shared<WhiteboardDeleteOperation>(*clientOp);
result.second->setParentID(serverOp->getID());
if (clientOp->getPos() == -1) {
result.second->setPos(-1);
@@ -142,9 +142,9 @@ namespace Swift {
std::pair<WhiteboardOperation::ref, WhiteboardOperation::ref> WhiteboardTransformer::transform(WhiteboardInsertOperation::ref clientOp, WhiteboardDeleteOperation::ref serverOp) {
std::pair<WhiteboardDeleteOperation::ref, WhiteboardInsertOperation::ref> result;
- result.first = boost::make_shared<WhiteboardDeleteOperation>(*serverOp);
+ result.first = std::make_shared<WhiteboardDeleteOperation>(*serverOp);
result.first->setParentID(clientOp->getID());
- result.second = boost::make_shared<WhiteboardInsertOperation>(*clientOp);
+ result.second = std::make_shared<WhiteboardInsertOperation>(*clientOp);
result.second->setParentID(serverOp->getID());
if (clientOp->getPos() <= serverOp->getPos()) {
result.first->setPos(result.first->getPos()+1);
@@ -156,9 +156,9 @@ namespace Swift {
std::pair<WhiteboardOperation::ref, WhiteboardOperation::ref> WhiteboardTransformer::transform(WhiteboardDeleteOperation::ref clientOp, WhiteboardInsertOperation::ref serverOp) {
std::pair<WhiteboardInsertOperation::ref, WhiteboardDeleteOperation::ref> result;
- result.first = boost::make_shared<WhiteboardInsertOperation>(*serverOp);
+ result.first = std::make_shared<WhiteboardInsertOperation>(*serverOp);
result.first->setParentID(clientOp->getID());
- result.second = boost::make_shared<WhiteboardDeleteOperation>(*clientOp);
+ result.second = std::make_shared<WhiteboardDeleteOperation>(*clientOp);
result.second->setParentID(serverOp->getID());
if (serverOp->getPos() <= clientOp->getPos()) {
result.second->setPos(result.second->getPos()+1);
@@ -170,13 +170,13 @@ namespace Swift {
std::pair<WhiteboardOperation::ref, WhiteboardOperation::ref> WhiteboardTransformer::transform(WhiteboardUpdateOperation::ref clientOp, WhiteboardDeleteOperation::ref serverOp) {
std::pair<WhiteboardDeleteOperation::ref, WhiteboardOperation::ref> result;
- result.first = boost::make_shared<WhiteboardDeleteOperation>(*serverOp);
+ result.first = std::make_shared<WhiteboardDeleteOperation>(*serverOp);
result.first->setParentID(clientOp->getID());
- WhiteboardUpdateOperation::ref updateOp = boost::make_shared<WhiteboardUpdateOperation>(*clientOp);
+ WhiteboardUpdateOperation::ref updateOp = std::make_shared<WhiteboardUpdateOperation>(*clientOp);
result.second = updateOp;
result.second->setParentID(serverOp->getID());
if (clientOp->getPos() == serverOp->getPos()) {
- WhiteboardDeleteOperation::ref deleteOp = boost::make_shared<WhiteboardDeleteOperation>();
+ WhiteboardDeleteOperation::ref deleteOp = std::make_shared<WhiteboardDeleteOperation>();
result.second = deleteOp;
result.second->setPos(-1);
result.second->setID(clientOp->getID());
@@ -195,13 +195,13 @@ namespace Swift {
std::pair<WhiteboardOperation::ref, WhiteboardOperation::ref> WhiteboardTransformer::transform(WhiteboardDeleteOperation::ref clientOp, WhiteboardUpdateOperation::ref serverOp) {
std::pair<WhiteboardOperation::ref, WhiteboardDeleteOperation::ref> result;
- WhiteboardUpdateOperation::ref updateOp = boost::make_shared<WhiteboardUpdateOperation>(*serverOp);
+ WhiteboardUpdateOperation::ref updateOp = std::make_shared<WhiteboardUpdateOperation>(*serverOp);
result.first = updateOp;
result.first->setParentID(clientOp->getID());
- result.second = boost::make_shared<WhiteboardDeleteOperation>(*clientOp);
+ result.second = std::make_shared<WhiteboardDeleteOperation>(*clientOp);
result.second->setParentID(serverOp->getID());
if (clientOp->getPos() == serverOp->getPos()) {
- WhiteboardDeleteOperation::ref deleteOp = boost::make_shared<WhiteboardDeleteOperation>();
+ WhiteboardDeleteOperation::ref deleteOp = std::make_shared<WhiteboardDeleteOperation>();
result.first = deleteOp;
result.first->setPos(-1);
result.first->setID(serverOp->getID());