From b23589f7ee2451653895f741506602ff94e482be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Sat, 1 Oct 2011 10:26:11 +0200 Subject: Some cleanup in parser factories. diff --git a/Swiften/Parser/PayloadParsers/BytestreamsParserFactory.h b/Swiften/Parser/PayloadParsers/BytestreamsParserFactory.h deleted file mode 100644 index 06ebc4d..0000000 --- a/Swiften/Parser/PayloadParsers/BytestreamsParserFactory.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2010 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 BytestreamsParserFactory : public GenericPayloadParserFactory { - public: - BytestreamsParserFactory() : GenericPayloadParserFactory("query", "http://jabber.org/protocol/bytestreams") {} - }; -} diff --git a/Swiften/Parser/PayloadParsers/CommandParserFactory.h b/Swiften/Parser/PayloadParsers/CommandParserFactory.h deleted file mode 100644 index 47d3333..0000000 --- a/Swiften/Parser/PayloadParsers/CommandParserFactory.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2010 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 PayloadParserFactoryCollection; - - class CommandParserFactory : public PayloadParserFactory { - public: - CommandParserFactory() { - } - - virtual bool canParse(const std::string& element, const std::string& ns, const AttributeMap&) const { - return ns == "http://jabber.org/protocol/commands" && element == "command"; - } - - virtual PayloadParser* createPayloadParser() { - return new CommandParser(); - } - - }; -} diff --git a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp index ebb0f3e..9865a1e 100644 --- a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp +++ b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp @@ -30,16 +30,16 @@ #include #include #include -#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include -#include +#include +#include #include #include #include @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include #include @@ -61,65 +61,65 @@ #include #include #include - -#include "JingleIBBTransportMethodPayloadParser.h" -#include "JingleFileTransferDescriptionParser.h" +#include +#include using namespace boost; namespace Swift { FullPayloadParserFactoryCollection::FullPayloadParserFactoryCollection() { - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("", "http://jabber.org/protocol/ibb"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("show"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("status"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("replace", "http://swift.im/protocol/replace"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("query", "jabber:iq:last"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("body"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("subject"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("priority"))); - factories_.push_back(shared_ptr(new ErrorParserFactory(this))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("delay", "urn:xmpp:delay"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("query", "jabber:iq:version"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("storage", "storage:bookmarks"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("x", "http://jabber.org/protocol/rosterx"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("query", "jabber:iq:roster"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("query", "http://jabber.org/protocol/disco#info"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("query", "http://jabber.org/protocol/disco#items"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("c", "http://jabber.org/protocol/caps"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("bind", "urn:ietf:params:xml:ns:xmpp-bind"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("session", "urn:ietf:params:xml:ns:xmpp-session"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory >("block", "urn:xmpp:blocking"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory >("blocklist", "urn:xmpp:blocking"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory >("unblock", "urn:xmpp:blocking"))); - factories_.push_back(shared_ptr(new SecurityLabelParserFactory())); - factories_.push_back(shared_ptr(new SecurityLabelsCatalogParserFactory())); - factories_.push_back(shared_ptr(new FormParserFactory())); - factories_.push_back(shared_ptr(new CommandParserFactory())); - factories_.push_back(shared_ptr(new InBandRegistrationPayloadParserFactory())); - factories_.push_back(shared_ptr(new SearchPayloadParserFactory())); - factories_.push_back(shared_ptr(new StreamInitiationParserFactory())); - factories_.push_back(shared_ptr(new BytestreamsParserFactory())); - factories_.push_back(shared_ptr(new VCardUpdateParserFactory())); - factories_.push_back(shared_ptr(new VCardParserFactory())); - factories_.push_back(shared_ptr(new PrivateStorageParserFactory(this))); - factories_.push_back(shared_ptr(new ChatStateParserFactory())); - factories_.push_back(shared_ptr(new MUCUserPayloadParserFactory(this))); - factories_.push_back(shared_ptr(new MUCOwnerPayloadParserFactory(this))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("query", "http://jabber.org/protocol/muc#admin"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("destroy", "http://jabber.org/protocol/muc#user"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("destroy", "http://jabber.org/protocol/muc#owner"))); - factories_.push_back(shared_ptr(new NicknameParserFactory())); - factories_.push_back(shared_ptr(new JingleParserFactory(this))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("reason", "urn:xmpp:jingle:1"))); - factories_.push_back(shared_ptr(new JingleContentPayloadParserFactory(this))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("transport", "urn:xmpp:jingle:transports:ibb:1"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("transport", "urn:xmpp:jingle:transports:s5b:1"))); - factories_.push_back(shared_ptr(new JingleFileTransferDescriptionParserFactory(this))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("file", "http://jabber.org/protocol/si/profile/file-transfer"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("received", "urn:xmpp:jingle:apps:file-transfer:3"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("checksum"))); - factories_.push_back(shared_ptr(new GenericPayloadParserFactory("query", "http://jabber.org/protocol/bytestreams"))); + factories_.push_back(boost::make_shared >("", "http://jabber.org/protocol/ibb")); + factories_.push_back(boost::make_shared >("show")); + factories_.push_back(boost::make_shared >("status")); + factories_.push_back(boost::make_shared >("replace", "http://swift.im/protocol/replace")); + factories_.push_back(boost::make_shared >("query", "jabber:iq:last")); + factories_.push_back(boost::make_shared >("body")); + factories_.push_back(boost::make_shared >("subject")); + factories_.push_back(boost::make_shared >("priority")); + factories_.push_back(boost::make_shared(this)); + factories_.push_back(boost::make_shared >("delay", "urn:xmpp:delay")); + factories_.push_back(boost::make_shared >("query", "jabber:iq:version")); + factories_.push_back(boost::make_shared >("storage", "storage:bookmarks")); + factories_.push_back(boost::make_shared >("x", "http://jabber.org/protocol/rosterx")); + factories_.push_back(boost::make_shared >("query", "jabber:iq:roster")); + factories_.push_back(boost::make_shared >("query", "http://jabber.org/protocol/disco#info")); + factories_.push_back(boost::make_shared >("query", "http://jabber.org/protocol/disco#items")); + factories_.push_back(boost::make_shared >("c", "http://jabber.org/protocol/caps")); + factories_.push_back(boost::make_shared >("bind", "urn:ietf:params:xml:ns:xmpp-bind")); + factories_.push_back(boost::make_shared >("session", "urn:ietf:params:xml:ns:xmpp-session")); + factories_.push_back(boost::make_shared > >("block", "urn:xmpp:blocking")); + factories_.push_back(boost::make_shared > >("blocklist", "urn:xmpp:blocking")); + factories_.push_back(boost::make_shared > >("unblock", "urn:xmpp:blocking")); + factories_.push_back(boost::make_shared()); + factories_.push_back(boost::make_shared >("catalog", "urn:xmpp:sec-label:catalog:2")); + factories_.push_back(boost::make_shared()); + factories_.push_back(boost::make_shared >("command", "http://jabber.org/protocol/commands")); + factories_.push_back(boost::make_shared >("query", "jabber:iq:register")); + factories_.push_back(boost::make_shared >("query", "jabber:iq:search")); + factories_.push_back(boost::make_shared >("si", "http://jabber.org/protocol/si")); + factories_.push_back(boost::make_shared >("query", "http://jabber.org/protocol/bytestreams")); + factories_.push_back(boost::make_shared >("x", "vcard-temp:x:update")); + factories_.push_back(boost::make_shared >("vCard", "vcard-temp")); + factories_.push_back(boost::make_shared(this)); + factories_.push_back(boost::make_shared()); + factories_.push_back(boost::make_shared(this)); + factories_.push_back(boost::make_shared(this)); + factories_.push_back(boost::make_shared >("query", "http://jabber.org/protocol/muc#admin")); + factories_.push_back(boost::make_shared >("destroy", "http://jabber.org/protocol/muc#user")); + factories_.push_back(boost::make_shared >("destroy", "http://jabber.org/protocol/muc#owner")); + factories_.push_back(boost::make_shared >("nick", "http://jabber.org/protocol/nick")); + factories_.push_back(boost::make_shared(this)); + factories_.push_back(boost::make_shared >("reason", "urn:xmpp:jingle:1")); + factories_.push_back(boost::make_shared(this)); + factories_.push_back(boost::make_shared >("transport", "urn:xmpp:jingle:transports:ibb:1")); + factories_.push_back(boost::make_shared >("transport", "urn:xmpp:jingle:transports:s5b:1")); + factories_.push_back(boost::make_shared(this)); + factories_.push_back(boost::make_shared >("file", "http://jabber.org/protocol/si/profile/file-transfer")); + factories_.push_back(boost::make_shared >("received", "urn:xmpp:jingle:apps:file-transfer:3")); + factories_.push_back(boost::make_shared >("checksum")); + factories_.push_back(boost::make_shared >("query", "http://jabber.org/protocol/bytestreams")); + foreach(shared_ptr factory, factories_) { addFactory(factory.get()); } diff --git a/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParserFactory.h b/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParserFactory.h deleted file mode 100644 index 2dff18f..0000000 --- a/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParserFactory.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2010 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 InBandRegistrationPayloadParserFactory : public GenericPayloadParserFactory { - public: - InBandRegistrationPayloadParserFactory() : GenericPayloadParserFactory("query", "jabber:iq:register") {} - }; -} diff --git a/Swiften/Parser/PayloadParsers/NicknameParserFactory.h b/Swiften/Parser/PayloadParsers/NicknameParserFactory.h deleted file mode 100644 index b292513..0000000 --- a/Swiften/Parser/PayloadParsers/NicknameParserFactory.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2010 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 NicknameParserFactory : public GenericPayloadParserFactory { - public: - NicknameParserFactory() : GenericPayloadParserFactory("nick", "http://jabber.org/protocol/nick") {} - }; -} diff --git a/Swiften/Parser/PayloadParsers/SearchPayloadParserFactory.h b/Swiften/Parser/PayloadParsers/SearchPayloadParserFactory.h deleted file mode 100644 index 5130556..0000000 --- a/Swiften/Parser/PayloadParsers/SearchPayloadParserFactory.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2010 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 SearchPayloadParserFactory : public GenericPayloadParserFactory { - public: - SearchPayloadParserFactory() : GenericPayloadParserFactory("query", "jabber:iq:search") {} - }; -} diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParserFactory.h b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParserFactory.h deleted file mode 100644 index a93100a..0000000 --- a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParserFactory.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2010 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 SecurityLabelsCatalogParserFactory : public GenericPayloadParserFactory { - public: - SecurityLabelsCatalogParserFactory() : GenericPayloadParserFactory("catalog", "urn:xmpp:sec-label:catalog:2") {} - }; -} diff --git a/Swiften/Parser/PayloadParsers/StreamInitiationParserFactory.h b/Swiften/Parser/PayloadParsers/StreamInitiationParserFactory.h deleted file mode 100644 index a75cf37..0000000 --- a/Swiften/Parser/PayloadParsers/StreamInitiationParserFactory.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2010 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 StreamInitiationParserFactory : public GenericPayloadParserFactory { - public: - StreamInitiationParserFactory() : GenericPayloadParserFactory("si", "http://jabber.org/protocol/si") {} - }; -} diff --git a/Swiften/Parser/PayloadParsers/VCardParserFactory.h b/Swiften/Parser/PayloadParsers/VCardParserFactory.h deleted file mode 100644 index 8731c55..0000000 --- a/Swiften/Parser/PayloadParsers/VCardParserFactory.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2010 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 VCardParserFactory : public GenericPayloadParserFactory { - public: - VCardParserFactory() : GenericPayloadParserFactory("vCard", "vcard-temp") {} - }; -} diff --git a/Swiften/Parser/PayloadParsers/VCardUpdateParserFactory.h b/Swiften/Parser/PayloadParsers/VCardUpdateParserFactory.h deleted file mode 100644 index 8a449fb..0000000 --- a/Swiften/Parser/PayloadParsers/VCardUpdateParserFactory.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2010 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 VCardUpdateParserFactory : public GenericPayloadParserFactory { - public: - VCardUpdateParserFactory() : GenericPayloadParserFactory("x", "vcard-temp:x:update") {} - }; -} -- cgit v0.10.2-6-g49f6