diff options
Diffstat (limited to 'Swiften/Queries')
28 files changed, 77 insertions, 86 deletions
diff --git a/Swiften/Queries/DummyIQChannel.h b/Swiften/Queries/DummyIQChannel.h index f740b5c..6adcdb1 100644 --- a/Swiften/Queries/DummyIQChannel.h +++ b/Swiften/Queries/DummyIQChannel.h @@ -8,7 +8,7 @@ #include <vector> -#include "Swiften/Queries/IQChannel.h" +#include <Swiften/Queries/IQChannel.h> namespace Swift { class DummyIQChannel : public IQChannel { diff --git a/Swiften/Queries/GenericRequest.h b/Swiften/Queries/GenericRequest.h index a8e3409..64c509c 100644 --- a/Swiften/Queries/GenericRequest.h +++ b/Swiften/Queries/GenericRequest.h @@ -6,9 +6,9 @@ #pragma once -#include "Swiften/Base/boost_bsignals.h" +#include <Swiften/Base/boost_bsignals.h> -#include "Swiften/Queries/Request.h" +#include <Swiften/Queries/Request.h> namespace Swift { template<typename PAYLOAD_TYPE> diff --git a/Swiften/Queries/GetResponder.h b/Swiften/Queries/GetResponder.h index ca3b677..bca507a 100644 --- a/Swiften/Queries/GetResponder.h +++ b/Swiften/Queries/GetResponder.h @@ -6,7 +6,7 @@ #pragma once -#include "Swiften/Queries/Responder.h" +#include <Swiften/Queries/Responder.h> namespace Swift { template<typename T> diff --git a/Swiften/Queries/IQChannel.cpp b/Swiften/Queries/IQChannel.cpp index 959d87d..815a617 100644 --- a/Swiften/Queries/IQChannel.cpp +++ b/Swiften/Queries/IQChannel.cpp @@ -4,7 +4,7 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "Swiften/Queries/IQChannel.h" +#include <Swiften/Queries/IQChannel.h> namespace Swift { diff --git a/Swiften/Queries/IQChannel.h b/Swiften/Queries/IQChannel.h index 22b7572..71a6dd4 100644 --- a/Swiften/Queries/IQChannel.h +++ b/Swiften/Queries/IQChannel.h @@ -4,14 +4,13 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#ifndef SWIFTEN_IQChannel_H -#define SWIFTEN_IQChannel_H +#pragma once -#include "Swiften/Base/boost_bsignals.h" +#include <Swiften/Base/boost_bsignals.h> #include <boost/shared_ptr.hpp> #include <string> -#include "Swiften/Elements/IQ.h" +#include <Swiften/Elements/IQ.h> namespace Swift { class IQChannel { @@ -26,5 +25,3 @@ namespace Swift { boost::signal<void (boost::shared_ptr<IQ>)> onIQReceived; }; } - -#endif diff --git a/Swiften/Queries/IQHandler.cpp b/Swiften/Queries/IQHandler.cpp index fe65c71..01e4387 100644 --- a/Swiften/Queries/IQHandler.cpp +++ b/Swiften/Queries/IQHandler.cpp @@ -4,8 +4,8 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "Swiften/Queries/IQHandler.h" -#include "Swiften/Queries/IQRouter.h" +#include <Swiften/Queries/IQHandler.h> +#include <Swiften/Queries/IQRouter.h> namespace Swift { diff --git a/Swiften/Queries/IQHandler.h b/Swiften/Queries/IQHandler.h index 616f9fa..c9af5ea 100644 --- a/Swiften/Queries/IQHandler.h +++ b/Swiften/Queries/IQHandler.h @@ -4,12 +4,11 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#ifndef SWIFTEN_IQHandler_H -#define SWIFTEN_IQHandler_H +#pragma once #include <boost/shared_ptr.hpp> -#include "Swiften/Elements/IQ.h" +#include <Swiften/Elements/IQ.h> namespace Swift { class IQRouter; @@ -21,5 +20,3 @@ namespace Swift { virtual bool handleIQ(boost::shared_ptr<IQ>) = 0; }; } - -#endif diff --git a/Swiften/Queries/IQRouter.cpp b/Swiften/Queries/IQRouter.cpp index 1bfff70..65f9d7f 100644 --- a/Swiften/Queries/IQRouter.cpp +++ b/Swiften/Queries/IQRouter.cpp @@ -4,15 +4,15 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "Swiften/Queries/IQRouter.h" +#include <Swiften/Queries/IQRouter.h> -#include <algorithm> #include <boost/bind.hpp> -#include "Swiften/Base/foreach.h" -#include "Swiften/Queries/IQHandler.h" -#include "Swiften/Queries/IQChannel.h" -#include "Swiften/Elements/ErrorPayload.h" +#include <Swiften/Base/Algorithm.h> +#include <Swiften/Base/foreach.h> +#include <Swiften/Queries/IQHandler.h> +#include <Swiften/Queries/IQChannel.h> +#include <Swiften/Elements/ErrorPayload.h> namespace Swift { @@ -54,7 +54,7 @@ void IQRouter::handleIQ(boost::shared_ptr<IQ> iq) { void IQRouter::processPendingRemoves() { foreach(boost::shared_ptr<IQHandler> handler, queuedRemoves_) { - handlers_.erase(std::remove(handlers_.begin(), handlers_.end(), handler), handlers_.end()); + erase(handlers_, handler); } queuedRemoves_.clear(); } @@ -76,7 +76,7 @@ void IQRouter::removeHandler(boost::shared_ptr<IQHandler> handler) { queuedRemoves_.push_back(handler); } else { - handlers_.erase(std::remove(handlers_.begin(), handlers_.end(), handler), handlers_.end()); + erase(handlers_, handler); } } diff --git a/Swiften/Queries/IQRouter.h b/Swiften/Queries/IQRouter.h index 312dca8..80d623c 100644 --- a/Swiften/Queries/IQRouter.h +++ b/Swiften/Queries/IQRouter.h @@ -10,7 +10,7 @@ #include <vector> #include <string> -#include "Swiften/Elements/IQ.h" +#include <Swiften/Elements/IQ.h> namespace Swift { class IQChannel; diff --git a/Swiften/Queries/RawRequest.h b/Swiften/Queries/RawRequest.h index 477952f..e5b3a1d 100644 --- a/Swiften/Queries/RawRequest.h +++ b/Swiften/Queries/RawRequest.h @@ -31,7 +31,7 @@ namespace Swift { RawRequest(IQ::Type type, const JID& receiver, const std::string& data, IQRouter* router) : Request(type, receiver, boost::make_shared<RawXMLPayload>(data), router) { } - virtual void handleResponse(Payload::ref payload, ErrorPayload::ref error) { + virtual void handleResponse(boost::shared_ptr<Payload> payload, ErrorPayload::ref error) { if (error) { onResponse(ErrorSerializer().serializePayload(error)); } diff --git a/Swiften/Queries/Request.cpp b/Swiften/Queries/Request.cpp index 6c47725..7adf13c 100644 --- a/Swiften/Queries/Request.cpp +++ b/Swiften/Queries/Request.cpp @@ -4,8 +4,8 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "Swiften/Queries/Request.h" -#include "Swiften/Queries/IQRouter.h" +#include <Swiften/Queries/Request.h> +#include <Swiften/Queries/IQRouter.h> #include <Swiften/Elements/RawXMLPayload.h> namespace Swift { diff --git a/Swiften/Queries/Request.h b/Swiften/Queries/Request.h index eee89e9..19687c1 100644 --- a/Swiften/Queries/Request.h +++ b/Swiften/Queries/Request.h @@ -4,19 +4,18 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#ifndef SWIFTEN_Request_H -#define SWIFTEN_Request_H +#pragma once #include <boost/shared_ptr.hpp> #include <boost/optional.hpp> #include <boost/enable_shared_from_this.hpp> #include <string> -#include "Swiften/Queries/IQHandler.h" -#include "Swiften/Elements/IQ.h" -#include "Swiften/Elements/Payload.h" -#include "Swiften/Elements/ErrorPayload.h" -#include "Swiften/JID/JID.h" +#include <Swiften/Queries/IQHandler.h> +#include <Swiften/Elements/IQ.h> +#include <Swiften/Elements/Payload.h> +#include <Swiften/Elements/ErrorPayload.h> +#include <Swiften/JID/JID.h> namespace Swift { /** @@ -48,15 +47,15 @@ namespace Swift { const JID& receiver, IQRouter* router); - virtual void setPayload(Payload::ref payload) { + virtual void setPayload(boost::shared_ptr<Payload> payload) { payload_ = payload; } - Payload::ref getPayload() const { + boost::shared_ptr<Payload> getPayload() const { return payload_; } - virtual void handleResponse(Payload::ref, ErrorPayload::ref) = 0; + virtual void handleResponse(boost::shared_ptr<Payload>, boost::shared_ptr<ErrorPayload>) = 0; private: bool handleIQ(boost::shared_ptr<IQ>); @@ -70,5 +69,3 @@ namespace Swift { bool sent_; }; } - -#endif diff --git a/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.cpp b/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.cpp index 5f6be03..337375e 100644 --- a/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.cpp +++ b/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.cpp @@ -4,4 +4,4 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h" +#include <Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h> diff --git a/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h b/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h index aa0866a..c0488ad 100644 --- a/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h +++ b/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h @@ -6,8 +6,8 @@ #pragma once -#include "Swiften/Queries/GenericRequest.h" -#include "Swiften/Elements/InBandRegistrationPayload.h" +#include <Swiften/Queries/GenericRequest.h> +#include <Swiften/Elements/InBandRegistrationPayload.h> namespace Swift { diff --git a/Swiften/Queries/Requests/GetPrivateStorageRequest.h b/Swiften/Queries/Requests/GetPrivateStorageRequest.h index f0b95d8..b0eefb2 100644 --- a/Swiften/Queries/Requests/GetPrivateStorageRequest.h +++ b/Swiften/Queries/Requests/GetPrivateStorageRequest.h @@ -6,12 +6,12 @@ #pragma once -#include "Swiften/Base/boost_bsignals.h" +#include <Swiften/Base/boost_bsignals.h> #include <boost/shared_ptr.hpp> -#include "Swiften/Queries/Request.h" -#include "Swiften/Elements/PrivateStorage.h" -#include "Swiften/Elements/ErrorPayload.h" +#include <Swiften/Queries/Request.h> +#include <Swiften/Elements/PrivateStorage.h> +#include <Swiften/Elements/ErrorPayload.h> namespace Swift { template<typename PAYLOAD_TYPE> diff --git a/Swiften/Queries/Requests/GetSecurityLabelsCatalogRequest.h b/Swiften/Queries/Requests/GetSecurityLabelsCatalogRequest.h index 51794da..a6f782b 100644 --- a/Swiften/Queries/Requests/GetSecurityLabelsCatalogRequest.h +++ b/Swiften/Queries/Requests/GetSecurityLabelsCatalogRequest.h @@ -6,8 +6,8 @@ #pragma once -#include "Swiften/Queries/GenericRequest.h" -#include "Swiften/Elements/SecurityLabelsCatalog.h" +#include <Swiften/Queries/GenericRequest.h> +#include <Swiften/Elements/SecurityLabelsCatalog.h> namespace Swift { diff --git a/Swiften/Queries/Requests/GetSoftwareVersionRequest.h b/Swiften/Queries/Requests/GetSoftwareVersionRequest.h index 442ec88..18461bb 100644 --- a/Swiften/Queries/Requests/GetSoftwareVersionRequest.h +++ b/Swiften/Queries/Requests/GetSoftwareVersionRequest.h @@ -6,8 +6,8 @@ #pragma once -#include "Swiften/Queries/GenericRequest.h" -#include "Swiften/Elements/SoftwareVersion.h" +#include <Swiften/Queries/GenericRequest.h> +#include <Swiften/Elements/SoftwareVersion.h> #include <boost/smart_ptr/make_shared.hpp> diff --git a/Swiften/Queries/Requests/SetPrivateStorageRequest.h b/Swiften/Queries/Requests/SetPrivateStorageRequest.h index 69eb001..f795742 100644 --- a/Swiften/Queries/Requests/SetPrivateStorageRequest.h +++ b/Swiften/Queries/Requests/SetPrivateStorageRequest.h @@ -6,12 +6,12 @@ #pragma once -#include "Swiften/Base/boost_bsignals.h" +#include <Swiften/Base/boost_bsignals.h> #include <boost/shared_ptr.hpp> -#include "Swiften/Queries/Request.h" -#include "Swiften/Elements/PrivateStorage.h" -#include "Swiften/Elements/ErrorPayload.h" +#include <Swiften/Queries/Request.h> +#include <Swiften/Elements/PrivateStorage.h> +#include <Swiften/Elements/ErrorPayload.h> namespace Swift { template<typename PAYLOAD_TYPE> diff --git a/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.cpp b/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.cpp index f28c878..f010e96 100644 --- a/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.cpp +++ b/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.cpp @@ -4,4 +4,4 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h" +#include <Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h> diff --git a/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h b/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h index 0700c65..8e0862b 100644 --- a/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h +++ b/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h @@ -6,11 +6,11 @@ #pragma once -#include "Swiften/Base/boost_bsignals.h" +#include <Swiften/Base/boost_bsignals.h> #include <boost/shared_ptr.hpp> -#include "Swiften/Queries/Request.h" -#include "Swiften/Elements/InBandRegistrationPayload.h" +#include <Swiften/Queries/Request.h> +#include <Swiften/Elements/InBandRegistrationPayload.h> namespace Swift { @@ -26,11 +26,11 @@ namespace Swift { SetInBandRegistrationRequest(const JID& to, InBandRegistrationPayload::ref payload, IQRouter* router) : Request(IQ::Set, to, InBandRegistrationPayload::ref(payload), router) { } - virtual void handleResponse(Payload::ref payload, ErrorPayload::ref error) { + virtual void handleResponse(boost::shared_ptr<Payload> payload, ErrorPayload::ref error) { onResponse(payload, error); } public: - boost::signal<void (Payload::ref, ErrorPayload::ref)> onResponse; + boost::signal<void (boost::shared_ptr<Payload>, ErrorPayload::ref)> onResponse; }; } diff --git a/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp b/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp index b7c36cb..f3ecfb7 100644 --- a/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp +++ b/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp @@ -9,10 +9,10 @@ #include <boost/shared_ptr.hpp> #include <boost/bind.hpp> -#include "Swiften/Queries/Requests/GetPrivateStorageRequest.h" -#include "Swiften/Queries/IQRouter.h" -#include "Swiften/Queries/DummyIQChannel.h" -#include "Swiften/Elements/Payload.h" +#include <Swiften/Queries/Requests/GetPrivateStorageRequest.h> +#include <Swiften/Queries/IQRouter.h> +#include <Swiften/Queries/DummyIQChannel.h> +#include <Swiften/Elements/Payload.h> using namespace Swift; diff --git a/Swiften/Queries/Responder.h b/Swiften/Queries/Responder.h index 2ce8f10..a9aab17 100644 --- a/Swiften/Queries/Responder.h +++ b/Swiften/Queries/Responder.h @@ -6,9 +6,9 @@ #pragma once -#include "Swiften/Queries/IQHandler.h" -#include "Swiften/Queries/IQRouter.h" -#include "Swiften/Elements/ErrorPayload.h" +#include <Swiften/Queries/IQHandler.h> +#include <Swiften/Queries/IQRouter.h> +#include <Swiften/Elements/ErrorPayload.h> namespace Swift { /** diff --git a/Swiften/Queries/Responders/SoftwareVersionResponder.cpp b/Swiften/Queries/Responders/SoftwareVersionResponder.cpp index 445dcc7..3f9616a 100644 --- a/Swiften/Queries/Responders/SoftwareVersionResponder.cpp +++ b/Swiften/Queries/Responders/SoftwareVersionResponder.cpp @@ -4,8 +4,8 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "Swiften/Queries/Responders/SoftwareVersionResponder.h" -#include "Swiften/Queries/IQRouter.h" +#include <Swiften/Queries/Responders/SoftwareVersionResponder.h> +#include <Swiften/Queries/IQRouter.h> namespace Swift { diff --git a/Swiften/Queries/Responders/SoftwareVersionResponder.h b/Swiften/Queries/Responders/SoftwareVersionResponder.h index cbda54c..a2929df 100644 --- a/Swiften/Queries/Responders/SoftwareVersionResponder.h +++ b/Swiften/Queries/Responders/SoftwareVersionResponder.h @@ -6,8 +6,8 @@ #pragma once -#include "Swiften/Queries/GetResponder.h" -#include "Swiften/Elements/SoftwareVersion.h" +#include <Swiften/Queries/GetResponder.h> +#include <Swiften/Elements/SoftwareVersion.h> namespace Swift { class IQRouter; diff --git a/Swiften/Queries/SetResponder.h b/Swiften/Queries/SetResponder.h index ec3460c..331aa46 100644 --- a/Swiften/Queries/SetResponder.h +++ b/Swiften/Queries/SetResponder.h @@ -6,7 +6,7 @@ #pragma once -#include "Swiften/Queries/Responder.h" +#include <Swiften/Queries/Responder.h> namespace Swift { template<typename T> diff --git a/Swiften/Queries/UnitTest/IQRouterTest.cpp b/Swiften/Queries/UnitTest/IQRouterTest.cpp index ef5da23..f06b967 100644 --- a/Swiften/Queries/UnitTest/IQRouterTest.cpp +++ b/Swiften/Queries/UnitTest/IQRouterTest.cpp @@ -9,9 +9,9 @@ #include <boost/shared_ptr.hpp> #include <boost/bind.hpp> -#include "Swiften/Queries/IQHandler.h" -#include "Swiften/Queries/IQRouter.h" -#include "Swiften/Queries/DummyIQChannel.h" +#include <Swiften/Queries/IQHandler.h> +#include <Swiften/Queries/IQRouter.h> +#include <Swiften/Queries/DummyIQChannel.h> using namespace Swift; diff --git a/Swiften/Queries/UnitTest/RequestTest.cpp b/Swiften/Queries/UnitTest/RequestTest.cpp index 34d07c9..c2e2390 100644 --- a/Swiften/Queries/UnitTest/RequestTest.cpp +++ b/Swiften/Queries/UnitTest/RequestTest.cpp @@ -10,10 +10,10 @@ #include <boost/bind.hpp> #include <boost/smart_ptr/make_shared.hpp> -#include "Swiften/Queries/GenericRequest.h" -#include "Swiften/Queries/IQRouter.h" -#include "Swiften/Queries/DummyIQChannel.h" -#include "Swiften/Elements/Payload.h" +#include <Swiften/Queries/GenericRequest.h> +#include <Swiften/Queries/IQRouter.h> +#include <Swiften/Queries/DummyIQChannel.h> +#include <Swiften/Elements/Payload.h> #include <Swiften/Elements/RawXMLPayload.h> using namespace Swift; diff --git a/Swiften/Queries/UnitTest/ResponderTest.cpp b/Swiften/Queries/UnitTest/ResponderTest.cpp index c087827..a256346 100644 --- a/Swiften/Queries/UnitTest/ResponderTest.cpp +++ b/Swiften/Queries/UnitTest/ResponderTest.cpp @@ -9,10 +9,10 @@ #include <boost/shared_ptr.hpp> #include <boost/bind.hpp> -#include "Swiften/Queries/Responder.h" -#include "Swiften/Queries/IQRouter.h" -#include "Swiften/Queries/DummyIQChannel.h" -#include "Swiften/Elements/SoftwareVersion.h" +#include <Swiften/Queries/Responder.h> +#include <Swiften/Queries/IQRouter.h> +#include <Swiften/Queries/DummyIQChannel.h> +#include <Swiften/Elements/SoftwareVersion.h> using namespace Swift; |