diff options
author | Tobias Markmann <tm@ayena.de> | 2016-04-01 17:23:49 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-04-04 08:28:23 (GMT) |
commit | 741c45b74d5f634622eb5f757c49323274fb8937 (patch) | |
tree | b9cfa6c2fe2e79e03cc8cb7c1ca1e9cf45aa5328 /Swiften/Elements | |
parent | eddd92ed76ae68cb1e202602fd3ebd11b69191a2 (diff) | |
download | swift-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
Diffstat (limited to 'Swiften/Elements')
108 files changed, 494 insertions, 520 deletions
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}; |