From be642f17bfa2df7cb88ddb5fb4aa37438d9e2110 Mon Sep 17 00:00:00 2001 From: Richard Maudsley Date: Mon, 28 Apr 2014 09:36:39 +0100 Subject: Create ToplevelElement to replace Element. Change-Id: I3460f6f4a2ffa9b795080664f49d9138440de72d diff --git a/Limber/Server/ServerFromClientSession.cpp b/Limber/Server/ServerFromClientSession.cpp index 71a8fef..9b1d2cf 100644 --- a/Limber/Server/ServerFromClientSession.cpp +++ b/Limber/Server/ServerFromClientSession.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -40,7 +40,7 @@ ServerFromClientSession::ServerFromClientSession( } -void ServerFromClientSession::handleElement(boost::shared_ptr element) { +void ServerFromClientSession::handleElement(boost::shared_ptr element) { if (isInitialized()) { onElementReceived(element); } diff --git a/Limber/Server/ServerFromClientSession.h b/Limber/Server/ServerFromClientSession.h index e2754b9..00dfd79 100644 --- a/Limber/Server/ServerFromClientSession.h +++ b/Limber/Server/ServerFromClientSession.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -18,7 +18,7 @@ namespace Swift { class ProtocolHeader; - class Element; + class ToplevelElement; class Stanza; class PayloadParserFactoryCollection; class PayloadSerializerCollection; @@ -43,7 +43,7 @@ namespace Swift { void setAllowSASLEXTERNAL(); private: - void handleElement(boost::shared_ptr); + void handleElement(boost::shared_ptr); void handleStreamStart(const ProtocolHeader& header); void setInitialized(); diff --git a/Limber/main.cpp b/Limber/main.cpp index 3809729..3e095d5 100644 --- a/Limber/main.cpp +++ b/Limber/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -49,7 +49,7 @@ class Server { serverFromClientSessions_.erase(std::remove(serverFromClientSessions_.begin(), serverFromClientSessions_.end(), session), serverFromClientSessions_.end()); } - void handleElementReceived(boost::shared_ptr element, boost::shared_ptr session) { + void handleElementReceived(boost::shared_ptr element, boost::shared_ptr session) { boost::shared_ptr stanza(boost::dynamic_pointer_cast(element)); if (!stanza) { return; diff --git a/Slimber/Server.cpp b/Slimber/Server.cpp index b63ca67..41b90c4 100644 --- a/Slimber/Server.cpp +++ b/Slimber/Server.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -14,7 +14,7 @@ #include "Swiften/LinkLocal/LinkLocalConnector.h" #include "Swiften/Network/Connection.h" #include "Swiften/Session/SessionTracer.h" -#include "Swiften/Elements/Element.h" +#include "Swiften/Elements/ToplevelElement.h" #include "Swiften/Elements/Presence.h" #include "Swiften/Elements/RosterPayload.h" #include "Swiften/Network/BoostConnection.h" @@ -182,7 +182,7 @@ void Server::unregisterService() { } } -void Server::handleElementReceived(boost::shared_ptr element, boost::shared_ptr session) { +void Server::handleElementReceived(boost::shared_ptr element, boost::shared_ptr session) { boost::shared_ptr stanza = boost::dynamic_pointer_cast(element); if (!stanza) { return; @@ -292,7 +292,7 @@ void Server::handleLinkLocalSessionFinished(boost::shared_ptr session) linkLocalSessions.end()); } -void Server::handleLinkLocalElementReceived(boost::shared_ptr element, boost::shared_ptr session) { +void Server::handleLinkLocalElementReceived(boost::shared_ptr element, boost::shared_ptr session) { if (boost::shared_ptr stanza = boost::dynamic_pointer_cast(element)) { JID fromJID = session->getRemoteJID(); if (!presenceManager->getServiceForJID(fromJID.toBare())) { @@ -313,7 +313,7 @@ void Server::handleConnectFinished(boost::shared_ptr connect new OutgoingLinkLocalSession( selfJID, connector->getService().getJID(), connector->getConnection(), &payloadParserFactories, &payloadSerializers, &xmlParserFactory)); - foreach(const boost::shared_ptr element, connector->getQueuedElements()) { + foreach(const boost::shared_ptr element, connector->getQueuedElements()) { outgoingSession->queueElement(element); } registerLinkLocalSession(outgoingSession); diff --git a/Slimber/Server.h b/Slimber/Server.h index 96401d9..2d520d6 100644 --- a/Slimber/Server.h +++ b/Slimber/Server.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -65,13 +65,13 @@ namespace Swift { void handleNewClientConnection(boost::shared_ptr c); void handleSessionStarted(); void handleSessionFinished(boost::shared_ptr); - void handleElementReceived(boost::shared_ptr element, boost::shared_ptr session); + void handleElementReceived(boost::shared_ptr element, boost::shared_ptr session); void handleRosterChanged(boost::shared_ptr roster); void handlePresenceChanged(boost::shared_ptr presence); void handleServiceRegistered(const DNSSDServiceID& service); void handleNewLinkLocalConnection(boost::shared_ptr connection); void handleLinkLocalSessionFinished(boost::shared_ptr session); - void handleLinkLocalElementReceived(boost::shared_ptr element, boost::shared_ptr session); + void handleLinkLocalElementReceived(boost::shared_ptr element, boost::shared_ptr session); void handleConnectFinished(boost::shared_ptr connector, bool error); void handleClientConnectionServerStopped( boost::optional); diff --git a/Swiften/Client/ClientSession.cpp b/Swiften/Client/ClientSession.cpp index b29f63d..441189e 100644 --- a/Swiften/Client/ClientSession.cpp +++ b/Swiften/Client/ClientSession.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -114,7 +114,7 @@ void ClientSession::handleStreamStart(const ProtocolHeader&) { state = Negotiating; } -void ClientSession::handleElement(boost::shared_ptr element) { +void ClientSession::handleElement(boost::shared_ptr element) { if (boost::shared_ptr stanza = boost::dynamic_pointer_cast(element)) { if (stanzaAckResponder_) { stanzaAckResponder_->handleStanzaReceived(); diff --git a/Swiften/Client/ClientSession.h b/Swiften/Client/ClientSession.h index 4b944fc..8a3deb4 100644 --- a/Swiften/Client/ClientSession.h +++ b/Swiften/Client/ClientSession.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include @@ -148,7 +148,7 @@ namespace Swift { void sendStreamHeader(); - void handleElement(boost::shared_ptr); + void handleElement(boost::shared_ptr); void handleStreamStart(const ProtocolHeader&); void handleStreamClosed(boost::shared_ptr); diff --git a/Swiften/Client/UnitTest/ClientSessionTest.cpp b/Swiften/Client/UnitTest/ClientSessionTest.cpp index 4ef6727..4e1fc31 100644 --- a/Swiften/Client/UnitTest/ClientSessionTest.cpp +++ b/Swiften/Client/UnitTest/ClientSessionTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -381,11 +381,11 @@ class ClientSessionTest : public CppUnit::TestFixture { class MockSessionStream : public SessionStream { public: struct Event { - Event(boost::shared_ptr element) : element(element), footer(false) {} + Event(boost::shared_ptr element) : element(element), footer(false) {} Event(const ProtocolHeader& header) : header(header), footer(false) {} Event() : footer(true) {} - boost::shared_ptr element; + boost::shared_ptr element; boost::optional header; bool footer; }; @@ -409,7 +409,7 @@ class ClientSessionTest : public CppUnit::TestFixture { receivedEvents.push_back(Event()); } - virtual void writeElement(boost::shared_ptr element) { + virtual void writeElement(boost::shared_ptr element) { receivedEvents.push_back(Event(element)); } diff --git a/Swiften/Component/ComponentSession.cpp b/Swiften/Component/ComponentSession.cpp index 7925b23..826451d 100644 --- a/Swiften/Component/ComponentSession.cpp +++ b/Swiften/Component/ComponentSession.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -49,7 +49,7 @@ void ComponentSession::handleStreamStart(const ProtocolHeader& header) { stream->writeElement(ComponentHandshake::ref(new ComponentHandshake(ComponentHandshakeGenerator::getHandshake(header.getID(), secret, crypto)))); } -void ComponentSession::handleElement(boost::shared_ptr element) { +void ComponentSession::handleElement(boost::shared_ptr element) { if (boost::shared_ptr stanza = boost::dynamic_pointer_cast(element)) { if (getState() == Initialized) { onStanzaReceived(stanza); diff --git a/Swiften/Component/ComponentSession.h b/Swiften/Component/ComponentSession.h index 3103335..1fa7b5c 100644 --- a/Swiften/Component/ComponentSession.h +++ b/Swiften/Component/ComponentSession.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include @@ -69,7 +69,7 @@ namespace Swift { void sendStreamHeader(); - void handleElement(boost::shared_ptr); + void handleElement(boost::shared_ptr); void handleStreamStart(const ProtocolHeader&); void handleStreamClosed(boost::shared_ptr); diff --git a/Swiften/Component/UnitTest/ComponentSessionTest.cpp b/Swiften/Component/UnitTest/ComponentSessionTest.cpp index 0533645..79d9ab3 100644 --- a/Swiften/Component/UnitTest/ComponentSessionTest.cpp +++ b/Swiften/Component/UnitTest/ComponentSessionTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -86,11 +86,11 @@ class ComponentSessionTest : public CppUnit::TestFixture { class MockSessionStream : public SessionStream { public: struct Event { - Event(boost::shared_ptr element) : element(element), footer(false) {} + Event(boost::shared_ptr element) : element(element), footer(false) {} Event(const ProtocolHeader& header) : header(header), footer(false) {} Event() : footer(true) {} - boost::shared_ptr element; + boost::shared_ptr element; boost::optional header; bool footer; }; @@ -114,7 +114,7 @@ class ComponentSessionTest : public CppUnit::TestFixture { receivedEvents.push_back(Event()); } - virtual void writeElement(boost::shared_ptr element) { + virtual void writeElement(boost::shared_ptr element) { receivedEvents.push_back(Event(element)); } diff --git a/Swiften/Elements/AuthChallenge.h b/Swiften/Elements/AuthChallenge.h index f7f2796..6332d69 100644 --- a/Swiften/Elements/AuthChallenge.h +++ b/Swiften/Elements/AuthChallenge.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -9,10 +9,10 @@ #include #include -#include +#include namespace Swift { - class AuthChallenge : public Element { + class AuthChallenge : public ToplevelElement { public: AuthChallenge() { } diff --git a/Swiften/Elements/AuthFailure.h b/Swiften/Elements/AuthFailure.h index ac40956..5088dcf 100644 --- a/Swiften/Elements/AuthFailure.h +++ b/Swiften/Elements/AuthFailure.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -8,10 +8,10 @@ #include -#include +#include namespace Swift { - class AuthFailure : public Element { + class AuthFailure : public ToplevelElement { public: typedef boost::shared_ptr ref; diff --git a/Swiften/Elements/AuthRequest.h b/Swiften/Elements/AuthRequest.h index bfc86c2..bc88b9b 100644 --- a/Swiften/Elements/AuthRequest.h +++ b/Swiften/Elements/AuthRequest.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -10,11 +10,11 @@ #include #include -#include +#include #include namespace Swift { - class AuthRequest : public Element { + class AuthRequest : public ToplevelElement { public: AuthRequest(const std::string& mechanism = "") : mechanism_(mechanism) { } diff --git a/Swiften/Elements/AuthResponse.h b/Swiften/Elements/AuthResponse.h index db2dcea..f8a075c 100644 --- a/Swiften/Elements/AuthResponse.h +++ b/Swiften/Elements/AuthResponse.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -9,11 +9,11 @@ #include #include -#include +#include #include namespace Swift { - class AuthResponse : public Element { + class AuthResponse : public ToplevelElement { public: AuthResponse() { } diff --git a/Swiften/Elements/AuthSuccess.h b/Swiften/Elements/AuthSuccess.h index 3c0f329..8e4591c 100644 --- a/Swiften/Elements/AuthSuccess.h +++ b/Swiften/Elements/AuthSuccess.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -9,10 +9,10 @@ #include #include -#include +#include namespace Swift { - class AuthSuccess : public Element { + class AuthSuccess : public ToplevelElement { public: AuthSuccess() {} diff --git a/Swiften/Elements/ComponentHandshake.h b/Swiften/Elements/ComponentHandshake.h index 5992b8c..b2f9b21 100644 --- a/Swiften/Elements/ComponentHandshake.h +++ b/Swiften/Elements/ComponentHandshake.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -9,10 +9,10 @@ #include #include -#include +#include namespace Swift { - class ComponentHandshake : public Element { + class ComponentHandshake : public ToplevelElement { public: typedef boost::shared_ptr ref; diff --git a/Swiften/Elements/CompressFailure.h b/Swiften/Elements/CompressFailure.h index 7dd8867..75e1d1d 100644 --- a/Swiften/Elements/CompressFailure.h +++ b/Swiften/Elements/CompressFailure.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -7,10 +7,10 @@ #pragma once -#include +#include namespace Swift { - class CompressFailure : public Element { + class CompressFailure : public ToplevelElement { public: CompressFailure() {} }; diff --git a/Swiften/Elements/CompressRequest.h b/Swiften/Elements/CompressRequest.h index b6fcc64..9e2e267 100644 --- a/Swiften/Elements/CompressRequest.h +++ b/Swiften/Elements/CompressRequest.h @@ -1,15 +1,15 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once -#include +#include namespace Swift { - class CompressRequest : public Element + class CompressRequest : public ToplevelElement { public: CompressRequest(const std::string& method = "") : method_(method) {} diff --git a/Swiften/Elements/Compressed.h b/Swiften/Elements/Compressed.h index 2affec5..f593412 100644 --- a/Swiften/Elements/Compressed.h +++ b/Swiften/Elements/Compressed.h @@ -1,15 +1,15 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once -#include +#include namespace Swift { - class Compressed : public Element { + class Compressed : public ToplevelElement { public: Compressed() {} }; diff --git a/Swiften/Elements/Element.cpp b/Swiften/Elements/Element.cpp deleted file mode 100644 index 94829ba..0000000 --- a/Swiften/Elements/Element.cpp +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2010 Remko Tronçon - * Licensed under the GNU General Public License v3. - * See Documentation/Licenses/GPLv3.txt for more information. - */ - -#include - -namespace Swift { - -Element::~Element() { -} - -} diff --git a/Swiften/Elements/Element.h b/Swiften/Elements/Element.h deleted file mode 100644 index 14539c1..0000000 --- a/Swiften/Elements/Element.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2010-2014 Remko Tronçon - * Licensed under the GNU General Public License v3. - * See Documentation/Licenses/GPLv3.txt for more information. - */ - -#pragma once - -#include - -namespace Swift { - class SWIFTEN_API Element { - public: - Element() {} - SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Element) - virtual ~Element(); - }; -} diff --git a/Swiften/Elements/EnableStreamManagement.h b/Swiften/Elements/EnableStreamManagement.h index 15a091e..732b225 100644 --- a/Swiften/Elements/EnableStreamManagement.h +++ b/Swiften/Elements/EnableStreamManagement.h @@ -1,16 +1,16 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once -#include +#include namespace Swift { - class EnableStreamManagement : public Element { + class EnableStreamManagement : public ToplevelElement { public: EnableStreamManagement() {} }; diff --git a/Swiften/Elements/Payload.h b/Swiften/Elements/Payload.h index 1459837..7d6789c 100644 --- a/Swiften/Elements/Payload.h +++ b/Swiften/Elements/Payload.h @@ -9,9 +9,10 @@ #include #include +#include namespace Swift { - class SWIFTEN_API Payload { + class SWIFTEN_API Payload : public ToplevelElement { public: typedef boost::shared_ptr ref; public: diff --git a/Swiften/Elements/Stanza.h b/Swiften/Elements/Stanza.h index e83f522..648c4df 100644 --- a/Swiften/Elements/Stanza.h +++ b/Swiften/Elements/Stanza.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -13,13 +13,13 @@ #include #include -#include +#include #include namespace Swift { class Payload; - class SWIFTEN_API Stanza : public Element { + class SWIFTEN_API Stanza : public ToplevelElement { public: typedef boost::shared_ptr ref; diff --git a/Swiften/Elements/StanzaAck.h b/Swiften/Elements/StanzaAck.h index 8fe64e0..0d99c5b 100644 --- a/Swiften/Elements/StanzaAck.h +++ b/Swiften/Elements/StanzaAck.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -8,10 +8,10 @@ #include -#include +#include namespace Swift { - class StanzaAck : public Element { + class StanzaAck : public ToplevelElement { public: typedef boost::shared_ptr ref; diff --git a/Swiften/Elements/StanzaAckRequest.h b/Swiften/Elements/StanzaAckRequest.h index 81b3871..0ae11ad 100644 --- a/Swiften/Elements/StanzaAckRequest.h +++ b/Swiften/Elements/StanzaAckRequest.h @@ -1,15 +1,15 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once -#include +#include namespace Swift { - class StanzaAckRequest : public Element { + class StanzaAckRequest : public ToplevelElement { }; } diff --git a/Swiften/Elements/StartTLSFailure.h b/Swiften/Elements/StartTLSFailure.h index 5e233fb..ce13fd6 100644 --- a/Swiften/Elements/StartTLSFailure.h +++ b/Swiften/Elements/StartTLSFailure.h @@ -1,15 +1,15 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once -#include +#include namespace Swift { - class StartTLSFailure : public Element { + class StartTLSFailure : public ToplevelElement { public: StartTLSFailure() {} }; diff --git a/Swiften/Elements/StartTLSRequest.h b/Swiften/Elements/StartTLSRequest.h index e284f75..4b4f1f1 100644 --- a/Swiften/Elements/StartTLSRequest.h +++ b/Swiften/Elements/StartTLSRequest.h @@ -1,15 +1,15 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once -#include +#include namespace Swift { - class StartTLSRequest : public Element { + class StartTLSRequest : public ToplevelElement { public: StartTLSRequest() {} }; diff --git a/Swiften/Elements/StreamError.h b/Swiften/Elements/StreamError.h index a58d3ae..300f1c7 100644 --- a/Swiften/Elements/StreamError.h +++ b/Swiften/Elements/StreamError.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -8,11 +8,11 @@ #include -#include +#include #include namespace Swift { - class StreamError : public Element { + class StreamError : public ToplevelElement { public: typedef boost::shared_ptr ref; diff --git a/Swiften/Elements/StreamFeatures.h b/Swiften/Elements/StreamFeatures.h index 5e7b6c9..ed40544 100644 --- a/Swiften/Elements/StreamFeatures.h +++ b/Swiften/Elements/StreamFeatures.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -11,10 +11,10 @@ #include #include -#include +#include namespace Swift { - class SWIFTEN_API StreamFeatures : public Element { + class SWIFTEN_API StreamFeatures : public ToplevelElement { public: typedef boost::shared_ptr ref; diff --git a/Swiften/Elements/StreamManagementEnabled.h b/Swiften/Elements/StreamManagementEnabled.h index 0985574..bb1f858 100644 --- a/Swiften/Elements/StreamManagementEnabled.h +++ b/Swiften/Elements/StreamManagementEnabled.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -9,10 +9,10 @@ #include #include -#include +#include namespace Swift { - class SWIFTEN_API StreamManagementEnabled : public Element { + class SWIFTEN_API StreamManagementEnabled : public ToplevelElement { public: StreamManagementEnabled(); ~StreamManagementEnabled(); diff --git a/Swiften/Elements/StreamManagementFailed.h b/Swiften/Elements/StreamManagementFailed.h index 7c6d1b7..a90bddd 100644 --- a/Swiften/Elements/StreamManagementFailed.h +++ b/Swiften/Elements/StreamManagementFailed.h @@ -1,16 +1,16 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once -#include +#include namespace Swift { - class StreamManagementFailed : public Element { + class StreamManagementFailed : public ToplevelElement { public: StreamManagementFailed() {} }; diff --git a/Swiften/Elements/StreamResume.h b/Swiften/Elements/StreamResume.h index aec0909..e87dabb 100644 --- a/Swiften/Elements/StreamResume.h +++ b/Swiften/Elements/StreamResume.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Remko Tronçon + * Copyright (c) 2011-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -9,10 +9,10 @@ #include #include -#include +#include namespace Swift { - class StreamResume : public Element { + class StreamResume : public ToplevelElement { public: StreamResume(); ~StreamResume(); diff --git a/Swiften/Elements/StreamResumed.h b/Swiften/Elements/StreamResumed.h index cf9a755..7890901 100644 --- a/Swiften/Elements/StreamResumed.h +++ b/Swiften/Elements/StreamResumed.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Remko Tronçon + * Copyright (c) 2011-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -9,10 +9,10 @@ #include #include -#include +#include namespace Swift { - class StreamResumed : public Element { + class StreamResumed : public ToplevelElement { public: StreamResumed(); ~StreamResumed(); diff --git a/Swiften/Elements/TLSProceed.h b/Swiften/Elements/TLSProceed.h index 4bd790a..27faf26 100644 --- a/Swiften/Elements/TLSProceed.h +++ b/Swiften/Elements/TLSProceed.h @@ -1,15 +1,15 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once -#include +#include namespace Swift { - class TLSProceed : public Element { + class TLSProceed : public ToplevelElement { public: TLSProceed() {} }; diff --git a/Swiften/Elements/ToplevelElement.cpp b/Swiften/Elements/ToplevelElement.cpp new file mode 100644 index 0000000..c58a914 --- /dev/null +++ b/Swiften/Elements/ToplevelElement.cpp @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2010-2014 Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#include + +namespace Swift { + +ToplevelElement::~ToplevelElement() { +} + +} diff --git a/Swiften/Elements/ToplevelElement.h b/Swiften/Elements/ToplevelElement.h new file mode 100644 index 0000000..b3f60c7 --- /dev/null +++ b/Swiften/Elements/ToplevelElement.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2010-2014 Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#pragma once + +#include + +namespace Swift { + class SWIFTEN_API ToplevelElement { + public: + ToplevelElement() {} + SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(ToplevelElement) + virtual ~ToplevelElement(); + }; +} diff --git a/Swiften/Elements/UnknownElement.h b/Swiften/Elements/UnknownElement.h index 100ba92..48072ef 100644 --- a/Swiften/Elements/UnknownElement.h +++ b/Swiften/Elements/UnknownElement.h @@ -1,15 +1,15 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once -#include +#include namespace Swift { - class UnknownElement : public Element { + class UnknownElement : public ToplevelElement { public: UnknownElement() {} }; diff --git a/Swiften/Examples/ParserTester/ParserTester.cpp b/Swiften/Examples/ParserTester/ParserTester.cpp index 009eef4..5ce44ef 100644 --- a/Swiften/Examples/ParserTester/ParserTester.cpp +++ b/Swiften/Examples/ParserTester/ParserTester.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -21,7 +21,7 @@ class MyXMPPParserClient : public XMPPParserClient { virtual void handleStreamStart(const ProtocolHeader&) { std::cout << "-> Stream start" << std::endl; } - virtual void handleElement(boost::shared_ptr element) { + virtual void handleElement(boost::shared_ptr element) { std::cout << "-> Element " << typeid(*element.get()).name() << std::endl; } virtual void handleStreamEnd() { diff --git a/Swiften/LinkLocal/IncomingLinkLocalSession.cpp b/Swiften/LinkLocal/IncomingLinkLocalSession.cpp index 610b28b..63f3ca1 100644 --- a/Swiften/LinkLocal/IncomingLinkLocalSession.cpp +++ b/Swiften/LinkLocal/IncomingLinkLocalSession.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -49,7 +49,7 @@ void IncomingLinkLocalSession::handleStreamStart(const ProtocolHeader& incomingH } } -void IncomingLinkLocalSession::handleElement(boost::shared_ptr element) { +void IncomingLinkLocalSession::handleElement(boost::shared_ptr element) { boost::shared_ptr stanza = boost::dynamic_pointer_cast(element); // If we get our first stanza before streamfeatures, our session is implicitly // initialized diff --git a/Swiften/LinkLocal/IncomingLinkLocalSession.h b/Swiften/LinkLocal/IncomingLinkLocalSession.h index f00c166..e10cd0a 100644 --- a/Swiften/LinkLocal/IncomingLinkLocalSession.h +++ b/Swiften/LinkLocal/IncomingLinkLocalSession.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -16,7 +16,7 @@ namespace Swift { class ProtocolHeader; class XMLParserFactory; - class Element; + class ToplevelElement; class PayloadParserFactoryCollection; class PayloadSerializerCollection; @@ -32,7 +32,7 @@ namespace Swift { boost::signal onSessionStarted; private: - void handleElement(boost::shared_ptr); + void handleElement(boost::shared_ptr); void handleStreamStart(const ProtocolHeader&); void setInitialized(); bool isInitialized() const { diff --git a/Swiften/LinkLocal/LinkLocalConnector.cpp b/Swiften/LinkLocal/LinkLocalConnector.cpp index af96e65..6471ca7 100644 --- a/Swiften/LinkLocal/LinkLocalConnector.cpp +++ b/Swiften/LinkLocal/LinkLocalConnector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -71,7 +71,7 @@ void LinkLocalConnector::handleConnected(bool error) { connectionConnectFinishedConnection.disconnect(); } -void LinkLocalConnector::queueElement(boost::shared_ptr element) { +void LinkLocalConnector::queueElement(boost::shared_ptr element) { queuedElements.push_back(element); } diff --git a/Swiften/LinkLocal/LinkLocalConnector.h b/Swiften/LinkLocal/LinkLocalConnector.h index 52692ef..367e972 100644 --- a/Swiften/LinkLocal/LinkLocalConnector.h +++ b/Swiften/LinkLocal/LinkLocalConnector.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -18,7 +18,7 @@ namespace Swift { class ConnectionFactory; class HostAddress; - class Element; + class ToplevelElement; class PayloadParserFactoryCollection; class PayloadSerializerCollection; class DNSSDQuerier; @@ -38,9 +38,9 @@ namespace Swift { void connect(); void cancel(); - void queueElement(boost::shared_ptr element); + void queueElement(boost::shared_ptr element); - const std::vector >& getQueuedElements() const { + const std::vector >& getQueuedElements() const { return queuedElements; } @@ -61,6 +61,6 @@ namespace Swift { boost::bsignals::connection resolveQueryHostNameResolvedConnection; boost::shared_ptr connection; boost::bsignals::connection connectionConnectFinishedConnection; - std::vector > queuedElements; + std::vector > queuedElements; }; } diff --git a/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp b/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp index 7a59715..1d280ef 100644 --- a/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp +++ b/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -35,17 +35,17 @@ void OutgoingLinkLocalSession::handleSessionStarted() { } void OutgoingLinkLocalSession::handleStreamStart(const ProtocolHeader&) { - foreach(const boost::shared_ptr& stanza, queuedElements_) { + foreach(const boost::shared_ptr& stanza, queuedElements_) { sendElement(stanza); } queuedElements_.clear(); } -void OutgoingLinkLocalSession::handleElement(boost::shared_ptr element) { +void OutgoingLinkLocalSession::handleElement(boost::shared_ptr element) { onElementReceived(element); } -void OutgoingLinkLocalSession::queueElement(boost::shared_ptr element) { +void OutgoingLinkLocalSession::queueElement(boost::shared_ptr element) { queuedElements_.push_back(element); } diff --git a/Swiften/LinkLocal/OutgoingLinkLocalSession.h b/Swiften/LinkLocal/OutgoingLinkLocalSession.h index b97f2bf..4550ae4 100644 --- a/Swiften/LinkLocal/OutgoingLinkLocalSession.h +++ b/Swiften/LinkLocal/OutgoingLinkLocalSession.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -17,7 +17,7 @@ namespace Swift { class ConnectionFactory; class XMLParserFactory; - class Element; + class ToplevelElement; class PayloadParserFactoryCollection; class PayloadSerializerCollection; @@ -31,14 +31,14 @@ namespace Swift { PayloadSerializerCollection* payloadSerializers, XMLParserFactory* xmlParserFactory); - void queueElement(boost::shared_ptr element); + void queueElement(boost::shared_ptr element); private: void handleSessionStarted(); - void handleElement(boost::shared_ptr); + void handleElement(boost::shared_ptr); void handleStreamStart(const ProtocolHeader&); private: - std::vector > queuedElements_; + std::vector > queuedElements_; }; } diff --git a/Swiften/Parser/ElementParser.h b/Swiften/Parser/ElementParser.h index 1815240..256e2dc 100644 --- a/Swiften/Parser/ElementParser.h +++ b/Swiften/Parser/ElementParser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -10,7 +10,7 @@ #include #include -#include +#include #include namespace Swift { @@ -22,6 +22,6 @@ namespace Swift { virtual void handleEndElement(const std::string& element, const std::string& ns) = 0; virtual void handleCharacterData(const std::string& data) = 0; - virtual boost::shared_ptr getElement() const = 0; + virtual boost::shared_ptr getElement() const = 0; }; } diff --git a/Swiften/Parser/GenericElementParser.h b/Swiften/Parser/GenericElementParser.h index 224c59e..4395622 100644 --- a/Swiften/Parser/GenericElementParser.h +++ b/Swiften/Parser/GenericElementParser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -22,7 +22,7 @@ namespace Swift { stanza_ = boost::make_shared(); } - virtual boost::shared_ptr getElement() const { + virtual boost::shared_ptr getElement() const { return stanza_; } diff --git a/Swiften/Parser/GenericStanzaParser.h b/Swiften/Parser/GenericStanzaParser.h index c756c9a..2aff4d5 100644 --- a/Swiften/Parser/GenericStanzaParser.h +++ b/Swiften/Parser/GenericStanzaParser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -23,7 +23,7 @@ namespace Swift { stanza_ = boost::make_shared(); } - virtual boost::shared_ptr getElement() const { + virtual boost::shared_ptr getElement() const { return stanza_; } diff --git a/Swiften/Parser/StanzaParser.h b/Swiften/Parser/StanzaParser.h index 0af6b43..fc60b47 100644 --- a/Swiften/Parser/StanzaParser.h +++ b/Swiften/Parser/StanzaParser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -28,7 +28,7 @@ namespace Swift { void handleEndElement(const std::string& element, const std::string& ns); void handleCharacterData(const std::string& data); - virtual boost::shared_ptr getElement() const = 0; + virtual boost::shared_ptr getElement() const = 0; virtual void handleStanzaAttributes(const AttributeMap&) {} virtual boost::shared_ptr getStanza() const { diff --git a/Swiften/Parser/UnitTest/StanzaParserTest.cpp b/Swiften/Parser/UnitTest/StanzaParserTest.cpp index 88e6dec..020f0ca 100644 --- a/Swiften/Parser/UnitTest/StanzaParserTest.cpp +++ b/Swiften/Parser/UnitTest/StanzaParserTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -196,7 +196,7 @@ class StanzaParserTest : public CppUnit::TestFixture { stanza_ = boost::make_shared(); } - virtual boost::shared_ptr getElement() const { + virtual boost::shared_ptr getElement() const { return stanza_; } diff --git a/Swiften/Parser/UnitTest/XMPPParserTest.cpp b/Swiften/Parser/UnitTest/XMPPParserTest.cpp index f8d60f2..7d2d3fa 100644 --- a/Swiften/Parser/UnitTest/XMPPParserTest.cpp +++ b/Swiften/Parser/UnitTest/XMPPParserTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -162,7 +162,7 @@ class XMPPParserTest : public CppUnit::TestFixture { public: enum Type { StreamStart, ElementEvent, StreamEnd }; struct Event { - Event(Type type, boost::shared_ptr element) + Event(Type type, boost::shared_ptr element) : type(type), element(element) {} Event(Type type, const ProtocolHeader& header) : type(type), header(header) {} @@ -170,7 +170,7 @@ class XMPPParserTest : public CppUnit::TestFixture { Type type; boost::optional header; - boost::shared_ptr element; + boost::shared_ptr element; }; Client() {} @@ -179,7 +179,7 @@ class XMPPParserTest : public CppUnit::TestFixture { events.push_back(Event(StreamStart, header)); } - void handleElement(boost::shared_ptr element) { + void handleElement(boost::shared_ptr element) { events.push_back(Event(ElementEvent, element)); } diff --git a/Swiften/Parser/XMPPParserClient.h b/Swiften/Parser/XMPPParserClient.h index 85e0f86..7d35968 100644 --- a/Swiften/Parser/XMPPParserClient.h +++ b/Swiften/Parser/XMPPParserClient.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -9,7 +9,7 @@ #include #include -#include +#include namespace Swift { @@ -20,7 +20,7 @@ namespace Swift { virtual ~XMPPParserClient(); virtual void handleStreamStart(const ProtocolHeader&) = 0; - virtual void handleElement(boost::shared_ptr) = 0; + virtual void handleElement(boost::shared_ptr) = 0; virtual void handleStreamEnd() = 0; }; } diff --git a/Swiften/SConscript b/Swiften/SConscript index 574b7d8..d898bfa 100644 --- a/Swiften/SConscript +++ b/Swiften/SConscript @@ -122,7 +122,7 @@ if env["SCONS_STAGE"] == "build" : "Elements/Form.cpp", "Elements/FormField.cpp", "Elements/StreamFeatures.cpp", - "Elements/Element.cpp", + "Elements/ToplevelElement.cpp", "Elements/IQ.cpp", "Elements/Payload.cpp", "Elements/PubSubPayload.cpp", diff --git a/Swiften/Serializer/AuthChallengeSerializer.cpp b/Swiften/Serializer/AuthChallengeSerializer.cpp index 1ddc165..57a79e0 100644 --- a/Swiften/Serializer/AuthChallengeSerializer.cpp +++ b/Swiften/Serializer/AuthChallengeSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -15,7 +15,7 @@ namespace Swift { AuthChallengeSerializer::AuthChallengeSerializer() { } -SafeByteArray AuthChallengeSerializer::serialize(boost::shared_ptr element) const { +SafeByteArray AuthChallengeSerializer::serialize(boost::shared_ptr element) const { boost::shared_ptr authChallenge(boost::dynamic_pointer_cast(element)); std::string value; boost::optional > message = authChallenge->getValue(); diff --git a/Swiften/Serializer/AuthChallengeSerializer.h b/Swiften/Serializer/AuthChallengeSerializer.h index 7d0b1b8..af77a5e 100644 --- a/Swiften/Serializer/AuthChallengeSerializer.h +++ b/Swiften/Serializer/AuthChallengeSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -17,6 +17,6 @@ namespace Swift { public: AuthChallengeSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(boost::shared_ptr element) const; }; } diff --git a/Swiften/Serializer/AuthFailureSerializer.h b/Swiften/Serializer/AuthFailureSerializer.h index 090f0c4..f7e48f0 100644 --- a/Swiften/Serializer/AuthFailureSerializer.h +++ b/Swiften/Serializer/AuthFailureSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -18,7 +18,7 @@ namespace Swift { AuthFailureSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(boost::shared_ptr) const { return createSafeByteArray(XMLElement("failure", "urn:ietf:params:xml:ns:xmpp-sasl").serialize()); } }; diff --git a/Swiften/Serializer/AuthRequestSerializer.cpp b/Swiften/Serializer/AuthRequestSerializer.cpp index 7f25c93..5c78e48 100644 --- a/Swiften/Serializer/AuthRequestSerializer.cpp +++ b/Swiften/Serializer/AuthRequestSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -16,7 +16,7 @@ namespace Swift { AuthRequestSerializer::AuthRequestSerializer() { } -SafeByteArray AuthRequestSerializer::serialize(boost::shared_ptr element) const { +SafeByteArray AuthRequestSerializer::serialize(boost::shared_ptr element) const { boost::shared_ptr authRequest(boost::dynamic_pointer_cast(element)); SafeByteArray value; boost::optional message = authRequest->getMessage(); diff --git a/Swiften/Serializer/AuthRequestSerializer.h b/Swiften/Serializer/AuthRequestSerializer.h index 0b49384..45c2ff8 100644 --- a/Swiften/Serializer/AuthRequestSerializer.h +++ b/Swiften/Serializer/AuthRequestSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -17,6 +17,6 @@ namespace Swift { public: AuthRequestSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(boost::shared_ptr element) const; }; } diff --git a/Swiften/Serializer/AuthResponseSerializer.cpp b/Swiften/Serializer/AuthResponseSerializer.cpp index 86b7fbe..c04fed0 100644 --- a/Swiften/Serializer/AuthResponseSerializer.cpp +++ b/Swiften/Serializer/AuthResponseSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -16,7 +16,7 @@ namespace Swift { AuthResponseSerializer::AuthResponseSerializer() { } -SafeByteArray AuthResponseSerializer::serialize(boost::shared_ptr element) const { +SafeByteArray AuthResponseSerializer::serialize(boost::shared_ptr element) const { boost::shared_ptr authResponse(boost::dynamic_pointer_cast(element)); SafeByteArray value; boost::optional message = authResponse->getValue(); diff --git a/Swiften/Serializer/AuthResponseSerializer.h b/Swiften/Serializer/AuthResponseSerializer.h index af71f59..9c9ae74 100644 --- a/Swiften/Serializer/AuthResponseSerializer.h +++ b/Swiften/Serializer/AuthResponseSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -17,6 +17,6 @@ namespace Swift { public: AuthResponseSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(boost::shared_ptr element) const; }; } diff --git a/Swiften/Serializer/AuthSuccessSerializer.cpp b/Swiften/Serializer/AuthSuccessSerializer.cpp index 26b58c3..0f4ef6e 100644 --- a/Swiften/Serializer/AuthSuccessSerializer.cpp +++ b/Swiften/Serializer/AuthSuccessSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -15,7 +15,7 @@ namespace Swift { AuthSuccessSerializer::AuthSuccessSerializer() { } -SafeByteArray AuthSuccessSerializer::serialize(boost::shared_ptr element) const { +SafeByteArray AuthSuccessSerializer::serialize(boost::shared_ptr element) const { boost::shared_ptr authSuccess(boost::dynamic_pointer_cast(element)); std::string value; boost::optional > message = authSuccess->getValue(); diff --git a/Swiften/Serializer/AuthSuccessSerializer.h b/Swiften/Serializer/AuthSuccessSerializer.h index 370afaa..7aa934e 100644 --- a/Swiften/Serializer/AuthSuccessSerializer.h +++ b/Swiften/Serializer/AuthSuccessSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -17,6 +17,6 @@ namespace Swift { public: AuthSuccessSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(boost::shared_ptr element) const; }; } diff --git a/Swiften/Serializer/ComponentHandshakeSerializer.cpp b/Swiften/Serializer/ComponentHandshakeSerializer.cpp index e7837d3..123798c 100644 --- a/Swiften/Serializer/ComponentHandshakeSerializer.cpp +++ b/Swiften/Serializer/ComponentHandshakeSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -13,7 +13,7 @@ namespace Swift { ComponentHandshakeSerializer::ComponentHandshakeSerializer() { } -SafeByteArray ComponentHandshakeSerializer::serialize(boost::shared_ptr element) const { +SafeByteArray ComponentHandshakeSerializer::serialize(boost::shared_ptr element) const { boost::shared_ptr handshake(boost::dynamic_pointer_cast(element)); return createSafeByteArray("" + handshake->getData() + ""); } diff --git a/Swiften/Serializer/ComponentHandshakeSerializer.h b/Swiften/Serializer/ComponentHandshakeSerializer.h index 1145ed9..54cd7c8 100644 --- a/Swiften/Serializer/ComponentHandshakeSerializer.h +++ b/Swiften/Serializer/ComponentHandshakeSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -16,6 +16,6 @@ namespace Swift { public: ComponentHandshakeSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(boost::shared_ptr element) const; }; } diff --git a/Swiften/Serializer/CompressFailureSerializer.h b/Swiften/Serializer/CompressFailureSerializer.h index 27a638f..2545608 100644 --- a/Swiften/Serializer/CompressFailureSerializer.h +++ b/Swiften/Serializer/CompressFailureSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -18,7 +18,7 @@ namespace Swift { CompressFailureSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(boost::shared_ptr) const { return createSafeByteArray(XMLElement("failure", "http://jabber.org/protocol/compress").serialize()); } }; diff --git a/Swiften/Serializer/CompressRequestSerializer.cpp b/Swiften/Serializer/CompressRequestSerializer.cpp index af7f7db..38f5b71 100644 --- a/Swiften/Serializer/CompressRequestSerializer.cpp +++ b/Swiften/Serializer/CompressRequestSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -13,12 +13,12 @@ namespace Swift { CompressRequestSerializer::CompressRequestSerializer() { } -SafeByteArray CompressRequestSerializer::serialize(boost::shared_ptr element) const { +SafeByteArray CompressRequestSerializer::serialize(boost::shared_ptr element) const { boost::shared_ptr compressRequest(boost::dynamic_pointer_cast(element)); return createSafeByteArray("" + compressRequest->getMethod() + ""); } -bool CompressRequestSerializer::canSerialize(boost::shared_ptr element) const { +bool CompressRequestSerializer::canSerialize(boost::shared_ptr element) const { return boost::dynamic_pointer_cast(element) != 0; } diff --git a/Swiften/Serializer/CompressRequestSerializer.h b/Swiften/Serializer/CompressRequestSerializer.h index 4d68c98..a8610d1 100644 --- a/Swiften/Serializer/CompressRequestSerializer.h +++ b/Swiften/Serializer/CompressRequestSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -15,7 +15,7 @@ namespace Swift { public: CompressRequestSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const; - virtual bool canSerialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(boost::shared_ptr element) const; + virtual bool canSerialize(boost::shared_ptr element) const; }; } diff --git a/Swiften/Serializer/ElementSerializer.h b/Swiften/Serializer/ElementSerializer.h index ba59106..76c7d20 100644 --- a/Swiften/Serializer/ElementSerializer.h +++ b/Swiften/Serializer/ElementSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -8,7 +8,7 @@ #include -#include +#include #include namespace Swift { @@ -16,7 +16,7 @@ namespace Swift { public: virtual ~ElementSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const = 0; - virtual bool canSerialize(boost::shared_ptr element) const = 0; + virtual SafeByteArray serialize(boost::shared_ptr element) const = 0; + virtual bool canSerialize(boost::shared_ptr element) const = 0; }; } diff --git a/Swiften/Serializer/EnableStreamManagementSerializer.h b/Swiften/Serializer/EnableStreamManagementSerializer.h index 384753b..a41df81 100644 --- a/Swiften/Serializer/EnableStreamManagementSerializer.h +++ b/Swiften/Serializer/EnableStreamManagementSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -18,7 +18,7 @@ namespace Swift { EnableStreamManagementSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(boost::shared_ptr) const { return createSafeByteArray(XMLElement("enable", "urn:xmpp:sm:2").serialize()); } }; diff --git a/Swiften/Serializer/GenericElementSerializer.h b/Swiften/Serializer/GenericElementSerializer.h index 92f7737..620ae7b 100644 --- a/Swiften/Serializer/GenericElementSerializer.h +++ b/Swiften/Serializer/GenericElementSerializer.h @@ -14,9 +14,9 @@ namespace Swift { template class GenericElementSerializer : public ElementSerializer { public: - virtual SafeByteArray serialize(boost::shared_ptr element) const = 0; + virtual SafeByteArray serialize(boost::shared_ptr element) const = 0; - virtual bool canSerialize(boost::shared_ptr element) const { + virtual bool canSerialize(boost::shared_ptr element) const { return !!boost::dynamic_pointer_cast(element); } }; diff --git a/Swiften/Serializer/GenericStanzaSerializer.h b/Swiften/Serializer/GenericStanzaSerializer.h index 4129ca8..a85d3ba 100644 --- a/Swiften/Serializer/GenericStanzaSerializer.h +++ b/Swiften/Serializer/GenericStanzaSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -14,12 +14,12 @@ namespace Swift { public: GenericStanzaSerializer(const std::string& tag, PayloadSerializerCollection* payloadSerializers) : StanzaSerializer(tag, payloadSerializers) {} - virtual bool canSerialize(boost::shared_ptr element) const { + virtual bool canSerialize(boost::shared_ptr element) const { return dynamic_cast(element.get()) != 0; } virtual void setStanzaSpecificAttributes( - boost::shared_ptr stanza, + boost::shared_ptr stanza, XMLElement& element) const { setStanzaSpecificAttributesGeneric( boost::dynamic_pointer_cast(stanza), element); diff --git a/Swiften/Serializer/StanzaAckRequestSerializer.h b/Swiften/Serializer/StanzaAckRequestSerializer.h index fff2a83..9766308 100644 --- a/Swiften/Serializer/StanzaAckRequestSerializer.h +++ b/Swiften/Serializer/StanzaAckRequestSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -18,7 +18,7 @@ namespace Swift { StanzaAckRequestSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(boost::shared_ptr) const { return createSafeByteArray(XMLElement("r", "urn:xmpp:sm:2").serialize()); } }; diff --git a/Swiften/Serializer/StanzaAckSerializer.h b/Swiften/Serializer/StanzaAckSerializer.h index ea1e8ad..ad2add6 100644 --- a/Swiften/Serializer/StanzaAckSerializer.h +++ b/Swiften/Serializer/StanzaAckSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -19,7 +19,7 @@ namespace Swift { StanzaAckSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr element) const { + virtual SafeByteArray serialize(boost::shared_ptr element) const { StanzaAck::ref stanzaAck(boost::dynamic_pointer_cast(element)); assert(stanzaAck->isValid()); XMLElement result("a", "urn:xmpp:sm:2"); diff --git a/Swiften/Serializer/StanzaSerializer.cpp b/Swiften/Serializer/StanzaSerializer.cpp index b5f0b22..358e4b8 100644 --- a/Swiften/Serializer/StanzaSerializer.cpp +++ b/Swiften/Serializer/StanzaSerializer.cpp @@ -22,11 +22,11 @@ namespace Swift { StanzaSerializer::StanzaSerializer(const std::string& tag, PayloadSerializerCollection* payloadSerializers) : tag_(tag), payloadSerializers_(payloadSerializers) { } -SafeByteArray StanzaSerializer::serialize(boost::shared_ptr element) const { +SafeByteArray StanzaSerializer::serialize(boost::shared_ptr element) const { return serialize(element, ""); } -SafeByteArray StanzaSerializer::serialize(boost::shared_ptr element, const std::string& xmlns) const { +SafeByteArray StanzaSerializer::serialize(boost::shared_ptr element, const std::string& xmlns) const { boost::shared_ptr stanza(boost::dynamic_pointer_cast(element)); XMLElement stanzaElement(tag_, xmlns); diff --git a/Swiften/Serializer/StanzaSerializer.h b/Swiften/Serializer/StanzaSerializer.h index d569d82..6b46670 100644 --- a/Swiften/Serializer/StanzaSerializer.h +++ b/Swiften/Serializer/StanzaSerializer.h @@ -18,9 +18,9 @@ namespace Swift { public: StanzaSerializer(const std::string& tag, PayloadSerializerCollection* payloadSerializers); - virtual SafeByteArray serialize(boost::shared_ptr element) const; - virtual SafeByteArray serialize(boost::shared_ptr element, const std::string& xmlns) const; - virtual void setStanzaSpecificAttributes(boost::shared_ptr, XMLElement&) const = 0; + virtual SafeByteArray serialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(boost::shared_ptr element, const std::string& xmlns) const; + virtual void setStanzaSpecificAttributes(boost::shared_ptr, XMLElement&) const = 0; private: std::string tag_; diff --git a/Swiften/Serializer/StartTLSFailureSerializer.h b/Swiften/Serializer/StartTLSFailureSerializer.h index 779be92..f924545 100644 --- a/Swiften/Serializer/StartTLSFailureSerializer.h +++ b/Swiften/Serializer/StartTLSFailureSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -18,7 +18,7 @@ namespace Swift { StartTLSFailureSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(boost::shared_ptr) const { return createSafeByteArray(XMLElement("failure", "urn:ietf:params:xml:ns:xmpp-tls").serialize()); } }; diff --git a/Swiften/Serializer/StartTLSRequestSerializer.h b/Swiften/Serializer/StartTLSRequestSerializer.h index df914ce..80745e3 100644 --- a/Swiften/Serializer/StartTLSRequestSerializer.h +++ b/Swiften/Serializer/StartTLSRequestSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -18,7 +18,7 @@ namespace Swift { StartTLSRequestSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(boost::shared_ptr) const { return createSafeByteArray(XMLElement("starttls", "urn:ietf:params:xml:ns:xmpp-tls").serialize()); } }; diff --git a/Swiften/Serializer/StreamErrorSerializer.cpp b/Swiften/Serializer/StreamErrorSerializer.cpp index b3d62a0..37ac3ca 100644 --- a/Swiften/Serializer/StreamErrorSerializer.cpp +++ b/Swiften/Serializer/StreamErrorSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -15,7 +15,7 @@ namespace Swift { StreamErrorSerializer::StreamErrorSerializer() : GenericElementSerializer() { } -SafeByteArray StreamErrorSerializer::serialize(boost::shared_ptr element) const { +SafeByteArray StreamErrorSerializer::serialize(boost::shared_ptr element) const { StreamError::ref error = boost::dynamic_pointer_cast(element); XMLElement errorElement("error", "http://etherx.jabber.org/streams"); diff --git a/Swiften/Serializer/StreamErrorSerializer.h b/Swiften/Serializer/StreamErrorSerializer.h index bdaa831..d82cd02 100644 --- a/Swiften/Serializer/StreamErrorSerializer.h +++ b/Swiften/Serializer/StreamErrorSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -14,6 +14,6 @@ namespace Swift { public: StreamErrorSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr error) const; + virtual SafeByteArray serialize(boost::shared_ptr error) const; }; } diff --git a/Swiften/Serializer/StreamFeaturesSerializer.cpp b/Swiften/Serializer/StreamFeaturesSerializer.cpp index 2344349..a93247a 100644 --- a/Swiften/Serializer/StreamFeaturesSerializer.cpp +++ b/Swiften/Serializer/StreamFeaturesSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -17,7 +17,7 @@ namespace Swift { StreamFeaturesSerializer::StreamFeaturesSerializer() { } -SafeByteArray StreamFeaturesSerializer::serialize(boost::shared_ptr element) const { +SafeByteArray StreamFeaturesSerializer::serialize(boost::shared_ptr element) const { boost::shared_ptr streamFeatures(boost::dynamic_pointer_cast(element)); XMLElement streamFeaturesElement("stream:features"); diff --git a/Swiften/Serializer/StreamFeaturesSerializer.h b/Swiften/Serializer/StreamFeaturesSerializer.h index 1bd1136..b69a218 100644 --- a/Swiften/Serializer/StreamFeaturesSerializer.h +++ b/Swiften/Serializer/StreamFeaturesSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -17,6 +17,6 @@ namespace Swift { public: StreamFeaturesSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr element) const; + virtual SafeByteArray serialize(boost::shared_ptr element) const; }; } diff --git a/Swiften/Serializer/StreamManagementEnabledSerializer.cpp b/Swiften/Serializer/StreamManagementEnabledSerializer.cpp index b559721..9d4ee94 100644 --- a/Swiften/Serializer/StreamManagementEnabledSerializer.cpp +++ b/Swiften/Serializer/StreamManagementEnabledSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -16,7 +16,7 @@ using namespace Swift; StreamManagementEnabledSerializer::StreamManagementEnabledSerializer() : GenericElementSerializer() { } -SafeByteArray StreamManagementEnabledSerializer::serialize(boost::shared_ptr el) const { +SafeByteArray StreamManagementEnabledSerializer::serialize(boost::shared_ptr el) const { boost::shared_ptr e(boost::dynamic_pointer_cast(el)); XMLElement element("enabled", "urn:xmpp:sm:2"); if (!e->getResumeID().empty()) { diff --git a/Swiften/Serializer/StreamManagementEnabledSerializer.h b/Swiften/Serializer/StreamManagementEnabledSerializer.h index 5f28a2b..ee2a980 100644 --- a/Swiften/Serializer/StreamManagementEnabledSerializer.h +++ b/Swiften/Serializer/StreamManagementEnabledSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -16,6 +16,6 @@ namespace Swift { public: StreamManagementEnabledSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr) const; + virtual SafeByteArray serialize(boost::shared_ptr) const; }; } diff --git a/Swiften/Serializer/StreamManagementFailedSerializer.h b/Swiften/Serializer/StreamManagementFailedSerializer.h index f3dcce0..f6e7b0e 100644 --- a/Swiften/Serializer/StreamManagementFailedSerializer.h +++ b/Swiften/Serializer/StreamManagementFailedSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -18,7 +18,7 @@ namespace Swift { StreamManagementFailedSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(boost::shared_ptr) const { return createSafeByteArray(XMLElement("failed", "urn:xmpp:sm:2").serialize()); } }; diff --git a/Swiften/Serializer/StreamResumeSerializer.cpp b/Swiften/Serializer/StreamResumeSerializer.cpp index e9e520d..902ab21 100644 --- a/Swiften/Serializer/StreamResumeSerializer.cpp +++ b/Swiften/Serializer/StreamResumeSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Remko Tronçon + * Copyright (c) 2011-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -17,7 +17,7 @@ using namespace Swift; StreamResumeSerializer::StreamResumeSerializer() : GenericElementSerializer() { } -SafeByteArray StreamResumeSerializer::serialize(boost::shared_ptr el) const { +SafeByteArray StreamResumeSerializer::serialize(boost::shared_ptr el) const { boost::shared_ptr e(boost::dynamic_pointer_cast(el)); XMLElement element("resume", "urn:xmpp:sm:2"); element.setAttribute("previd", e->getResumeID()); diff --git a/Swiften/Serializer/StreamResumeSerializer.h b/Swiften/Serializer/StreamResumeSerializer.h index 501d8b6..17baa44 100644 --- a/Swiften/Serializer/StreamResumeSerializer.h +++ b/Swiften/Serializer/StreamResumeSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Remko Tronçon + * Copyright (c) 2011-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -16,6 +16,6 @@ namespace Swift { public: StreamResumeSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr) const; + virtual SafeByteArray serialize(boost::shared_ptr) const; }; } diff --git a/Swiften/Serializer/StreamResumedSerializer.cpp b/Swiften/Serializer/StreamResumedSerializer.cpp index 7ae82d1..6477af9 100644 --- a/Swiften/Serializer/StreamResumedSerializer.cpp +++ b/Swiften/Serializer/StreamResumedSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Remko Tronçon + * Copyright (c) 2011-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -17,7 +17,7 @@ using namespace Swift; StreamResumedSerializer::StreamResumedSerializer() : GenericElementSerializer() { } -SafeByteArray StreamResumedSerializer::serialize(boost::shared_ptr el) const { +SafeByteArray StreamResumedSerializer::serialize(boost::shared_ptr el) const { boost::shared_ptr e(boost::dynamic_pointer_cast(el)); XMLElement element("resumed", "urn:xmpp:sm:2"); element.setAttribute("previd", e->getResumeID()); diff --git a/Swiften/Serializer/StreamResumedSerializer.h b/Swiften/Serializer/StreamResumedSerializer.h index 7828694..bdca891 100644 --- a/Swiften/Serializer/StreamResumedSerializer.h +++ b/Swiften/Serializer/StreamResumedSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Remko Tronçon + * Copyright (c) 2011-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -16,6 +16,6 @@ namespace Swift { public: StreamResumedSerializer(); - virtual SafeByteArray serialize(boost::shared_ptr) const; + virtual SafeByteArray serialize(boost::shared_ptr) const; }; } diff --git a/Swiften/Serializer/TLSProceedSerializer.h b/Swiften/Serializer/TLSProceedSerializer.h index 21a8420..15db3dc 100644 --- a/Swiften/Serializer/TLSProceedSerializer.h +++ b/Swiften/Serializer/TLSProceedSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -18,7 +18,7 @@ namespace Swift { TLSProceedSerializer() : GenericElementSerializer() { } - virtual SafeByteArray serialize(boost::shared_ptr) const { + virtual SafeByteArray serialize(boost::shared_ptr) const { return createSafeByteArray(XMLElement("proceed", "urn:ietf:params:xml:ns:xmpp-tls").serialize()); } }; diff --git a/Swiften/Serializer/XMPPSerializer.cpp b/Swiften/Serializer/XMPPSerializer.cpp index 389f7cc..e3f43cd 100644 --- a/Swiften/Serializer/XMPPSerializer.cpp +++ b/Swiften/Serializer/XMPPSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -83,7 +83,7 @@ std::string XMPPSerializer::serializeHeader(const ProtocolHeader& header) const return result; } -SafeByteArray XMPPSerializer::serializeElement(boost::shared_ptr element) const { +SafeByteArray XMPPSerializer::serializeElement(boost::shared_ptr element) const { std::vector< boost::shared_ptr >::const_iterator i = std::find_if(serializers_.begin(), serializers_.end(), boost::bind(&ElementSerializer::canSerialize, _1, element)); if (i != serializers_.end()) { return (*i)->serialize(element); diff --git a/Swiften/Serializer/XMPPSerializer.h b/Swiften/Serializer/XMPPSerializer.h index 5b5c9d6..cbcdccb 100644 --- a/Swiften/Serializer/XMPPSerializer.h +++ b/Swiften/Serializer/XMPPSerializer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include @@ -25,7 +25,7 @@ namespace Swift { XMPPSerializer(PayloadSerializerCollection*, StreamType type); std::string serializeHeader(const ProtocolHeader&) const; - SafeByteArray serializeElement(boost::shared_ptr stanza) const; + SafeByteArray serializeElement(boost::shared_ptr stanza) const; std::string serializeFooter() const; private: diff --git a/Swiften/Session/BOSHSessionStream.cpp b/Swiften/Session/BOSHSessionStream.cpp index 62261d0..8cdbdb0 100644 --- a/Swiften/Session/BOSHSessionStream.cpp +++ b/Swiften/Session/BOSHSessionStream.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Kevin Smith + * Copyright (c) 2011-2014 Kevin Smith * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -86,7 +86,7 @@ void BOSHSessionStream::handlePoolXMPPDataRead(const SafeByteArray& data) { xmppLayer->handleDataRead(data); } -void BOSHSessionStream::writeElement(boost::shared_ptr element) { +void BOSHSessionStream::writeElement(boost::shared_ptr element) { assert(available); xmppLayer->writeElement(element); } @@ -156,7 +156,7 @@ void BOSHSessionStream::handleStreamStartReceived(const ProtocolHeader& header) onStreamStartReceived(header); } -void BOSHSessionStream::handleElementReceived(boost::shared_ptr element) { +void BOSHSessionStream::handleElementReceived(boost::shared_ptr element) { onElementReceived(element); } diff --git a/Swiften/Session/BOSHSessionStream.h b/Swiften/Session/BOSHSessionStream.h index 290a4c5..e74d534 100644 --- a/Swiften/Session/BOSHSessionStream.h +++ b/Swiften/Session/BOSHSessionStream.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Kevin Smith + * Copyright (c) 2011-2014 Kevin Smith * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -50,7 +50,7 @@ namespace Swift { virtual bool isOpen(); virtual void writeHeader(const ProtocolHeader& header); - virtual void writeElement(boost::shared_ptr); + virtual void writeElement(boost::shared_ptr); virtual void writeFooter(); virtual void writeData(const std::string& data); @@ -72,7 +72,7 @@ namespace Swift { private: void handleXMPPError(); void handleStreamStartReceived(const ProtocolHeader&); - void handleElementReceived(boost::shared_ptr); + void handleElementReceived(boost::shared_ptr); void handlePoolXMPPDataRead(const SafeByteArray& data); void handleXMPPLayerDataWritten(const SafeByteArray& data); void handlePoolSessionStarted(); diff --git a/Swiften/Session/BasicSessionStream.cpp b/Swiften/Session/BasicSessionStream.cpp index 2bd8d66..7aaa5c2 100644 --- a/Swiften/Session/BasicSessionStream.cpp +++ b/Swiften/Session/BasicSessionStream.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -77,7 +77,7 @@ void BasicSessionStream::writeHeader(const ProtocolHeader& header) { xmppLayer->writeHeader(header); } -void BasicSessionStream::writeElement(boost::shared_ptr element) { +void BasicSessionStream::writeElement(boost::shared_ptr element) { assert(available); xmppLayer->writeElement(element); } @@ -168,7 +168,7 @@ void BasicSessionStream::handleStreamStartReceived(const ProtocolHeader& header) onStreamStartReceived(header); } -void BasicSessionStream::handleElementReceived(boost::shared_ptr element) { +void BasicSessionStream::handleElementReceived(boost::shared_ptr element) { onElementReceived(element); } diff --git a/Swiften/Session/BasicSessionStream.h b/Swiften/Session/BasicSessionStream.h index 389ecbe..e5f8004 100644 --- a/Swiften/Session/BasicSessionStream.h +++ b/Swiften/Session/BasicSessionStream.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -44,7 +44,7 @@ namespace Swift { virtual bool isOpen(); virtual void writeHeader(const ProtocolHeader& header); - virtual void writeElement(boost::shared_ptr); + virtual void writeElement(boost::shared_ptr); virtual void writeFooter(); virtual void writeData(const std::string& data); @@ -70,7 +70,7 @@ namespace Swift { void handleTLSConnected(); void handleTLSError(boost::shared_ptr); void handleStreamStartReceived(const ProtocolHeader&); - void handleElementReceived(boost::shared_ptr); + void handleElementReceived(boost::shared_ptr); void handleDataRead(const SafeByteArray& data); void handleDataWritten(const SafeByteArray& data); diff --git a/Swiften/Session/Session.cpp b/Swiften/Session/Session.cpp index acc73f1..de54c5f 100644 --- a/Swiften/Session/Session.cpp +++ b/Swiften/Session/Session.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -76,7 +76,7 @@ void Session::initializeStreamStack() { streamStack = new StreamStack(xmppLayer, connectionLayer); } -void Session::sendElement(boost::shared_ptr stanza) { +void Session::sendElement(boost::shared_ptr stanza) { xmppLayer->writeElement(stanza); } diff --git a/Swiften/Session/Session.h b/Swiften/Session/Session.h index 4becebf..63a6a02 100644 --- a/Swiften/Session/Session.h +++ b/Swiften/Session/Session.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include @@ -54,7 +54,7 @@ namespace Swift { void startSession(); void finishSession(); - void sendElement(boost::shared_ptr); + void sendElement(boost::shared_ptr); const JID& getLocalJID() const { return localJID; @@ -64,7 +64,7 @@ namespace Swift { return remoteJID; } - boost::signal)> onElementReceived; + boost::signal)> onElementReceived; boost::signal&)> onSessionFinished; boost::signal onDataWritten; boost::signal onDataRead; @@ -82,7 +82,7 @@ namespace Swift { virtual void handleSessionStarted() {} virtual void handleSessionFinished(const boost::optional&) {} - virtual void handleElement(boost::shared_ptr) = 0; + virtual void handleElement(boost::shared_ptr) = 0; virtual void handleStreamStart(const ProtocolHeader&) = 0; void initializeStreamStack(); diff --git a/Swiften/Session/SessionStream.h b/Swiften/Session/SessionStream.h index 501f588..2394295 100644 --- a/Swiften/Session/SessionStream.h +++ b/Swiften/Session/SessionStream.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2012 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include @@ -46,7 +46,7 @@ namespace Swift { virtual void writeHeader(const ProtocolHeader& header) = 0; virtual void writeFooter() = 0; - virtual void writeElement(boost::shared_ptr) = 0; + virtual void writeElement(boost::shared_ptr) = 0; virtual void writeData(const std::string& data) = 0; virtual bool supportsZLibCompression() = 0; @@ -74,7 +74,7 @@ namespace Swift { virtual ByteArray getTLSFinishMessage() const = 0; boost::signal onStreamStartReceived; - boost::signal)> onElementReceived; + boost::signal)> onElementReceived; boost::signal)> onClosed; boost::signal onTLSEncrypted; boost::signal onDataRead; diff --git a/Swiften/StreamStack/UnitTest/StreamStackTest.cpp b/Swiften/StreamStack/UnitTest/StreamStackTest.cpp index 213948a..35146d6 100644 --- a/Swiften/StreamStack/UnitTest/StreamStackTest.cpp +++ b/Swiften/StreamStack/UnitTest/StreamStackTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -126,7 +126,7 @@ class StreamStackTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, dataWriteReceived_); } - void handleElement(boost::shared_ptr) { + void handleElement(boost::shared_ptr) { ++elementsReceived_; } diff --git a/Swiften/StreamStack/UnitTest/XMPPLayerTest.cpp b/Swiften/StreamStack/UnitTest/XMPPLayerTest.cpp index a6098f1..ced9ec3 100644 --- a/Swiften/StreamStack/UnitTest/XMPPLayerTest.cpp +++ b/Swiften/StreamStack/UnitTest/XMPPLayerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -94,11 +94,11 @@ class XMPPLayerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(std::string(""), lowLayer_->writtenData); } - void handleElement(boost::shared_ptr) { + void handleElement(boost::shared_ptr) { ++elementsReceived_; } - void handleElementAndReset(boost::shared_ptr) { + void handleElementAndReset(boost::shared_ptr) { ++elementsReceived_; testling_->resetParser(); } diff --git a/Swiften/StreamStack/XMPPLayer.cpp b/Swiften/StreamStack/XMPPLayer.cpp index 94afcf9..59418a2 100644 --- a/Swiften/StreamStack/XMPPLayer.cpp +++ b/Swiften/StreamStack/XMPPLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -38,7 +38,7 @@ void XMPPLayer::writeFooter() { writeDataInternal(createSafeByteArray(xmppSerializer_->serializeFooter())); } -void XMPPLayer::writeElement(boost::shared_ptr element) { +void XMPPLayer::writeElement(boost::shared_ptr element) { writeDataInternal(xmppSerializer_->serializeElement(element)); } @@ -78,7 +78,7 @@ void XMPPLayer::handleStreamStart(const ProtocolHeader& header) { onStreamStart(header); } -void XMPPLayer::handleElement(boost::shared_ptr stanza) { +void XMPPLayer::handleElement(boost::shared_ptr stanza) { onElement(stanza); } diff --git a/Swiften/StreamStack/XMPPLayer.h b/Swiften/StreamStack/XMPPLayer.h index f0e88aa..bb0e498 100644 --- a/Swiften/StreamStack/XMPPLayer.h +++ b/Swiften/StreamStack/XMPPLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include @@ -38,7 +38,7 @@ namespace Swift { void writeHeader(const ProtocolHeader& header); void writeFooter(); - void writeElement(boost::shared_ptr); + void writeElement(boost::shared_ptr); void writeData(const std::string& data); void resetParser(); @@ -49,14 +49,14 @@ namespace Swift { public: boost::signal onStreamStart; - boost::signal)> onElement; + boost::signal)> onElement; boost::signal onWriteData; boost::signal onDataRead; boost::signal onError; private: void handleStreamStart(const ProtocolHeader&); - void handleElement(boost::shared_ptr); + void handleElement(boost::shared_ptr); void handleStreamEnd(); void doResetParser(); -- cgit v0.10.2-6-g49f6