diff options
Diffstat (limited to 'Swiften/Examples')
-rw-r--r-- | Swiften/Examples/BenchTool/BenchTool.cpp | 17 | ||||
-rw-r--r-- | Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp | 19 | ||||
-rw-r--r-- | Swiften/Examples/ConnectivityTest/SConscript | 10 | ||||
-rw-r--r-- | Swiften/Examples/LinkLocalTool/main.cpp | 10 | ||||
-rw-r--r-- | Swiften/Examples/ParserTester/ParserTester.cpp | 8 | ||||
-rw-r--r-- | Swiften/Examples/SendFile/ReceiveFile.cpp | 3 | ||||
-rw-r--r-- | Swiften/Examples/SendFile/SConscript | 9 | ||||
-rw-r--r-- | Swiften/Examples/SendFile/SendFile.cpp | 30 | ||||
-rw-r--r-- | Swiften/Examples/SendMessage/SConscript | 10 | ||||
-rw-r--r-- | Swiften/Examples/SendMessage/SendMessage.cpp | 16 |
10 files changed, 61 insertions, 71 deletions
diff --git a/Swiften/Examples/BenchTool/BenchTool.cpp b/Swiften/Examples/BenchTool/BenchTool.cpp index 9e54ed9..ba6cf84 100644 --- a/Swiften/Examples/BenchTool/BenchTool.cpp +++ b/Swiften/Examples/BenchTool/BenchTool.cpp @@ -6,14 +6,15 @@ #include <boost/bind.hpp> #include <boost/thread.hpp> +#include <iostream> -#include "Swiften/Client/Client.h" -#include "Swiften/Network/TimerFactory.h" -#include "Swiften/Network/BoostNetworkFactories.h" -#include "Swiften/EventLoop/EventLoop.h" -#include "Swiften/EventLoop/SimpleEventLoop.h" -#include "Swiften/Roster/GetRosterRequest.h" -#include "Swiften/Client/ClientXMLTracer.h" +#include <Swiften/Client/Client.h> +#include <Swiften/Network/TimerFactory.h> +#include <Swiften/Network/BoostNetworkFactories.h> +#include <Swiften/EventLoop/EventLoop.h> +#include <Swiften/EventLoop/SimpleEventLoop.h> +#include <Swiften/Roster/GetRosterRequest.h> +#include <Swiften/Client/ClientXMLTracer.h> #include <Swiften/Base/sleep.h> #include <Swiften/TLS/BlindCertificateTrustChecker.h> @@ -45,7 +46,7 @@ int main(int, char**) { BlindCertificateTrustChecker trustChecker; std::vector<CoreClient*> clients; for (int i = 0; i < numberOfInstances; ++i) { - CoreClient* client = new Swift::CoreClient(JID(jid), std::string(pass), &networkFactories); + CoreClient* client = new Swift::CoreClient(JID(jid), createSafeByteArray(std::string(pass)), &networkFactories); client->setCertificateTrustChecker(&trustChecker); client->onConnected.connect(&handleConnected); clients.push_back(client); diff --git a/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp b/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp index fda203a..c957481 100644 --- a/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp +++ b/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp @@ -6,15 +6,16 @@ #include <boost/bind.hpp> #include <boost/thread.hpp> +#include <iostream> -#include "Swiften/Client/Client.h" -#include "Swiften/Network/Timer.h" -#include "Swiften/Network/TimerFactory.h" -#include "Swiften/Network/BoostNetworkFactories.h" -#include "Swiften/EventLoop/EventLoop.h" -#include "Swiften/Client/ClientXMLTracer.h" -#include "Swiften/EventLoop/SimpleEventLoop.h" -#include "Swiften/Disco/GetDiscoInfoRequest.h" +#include <Swiften/Client/Client.h> +#include <Swiften/Network/Timer.h> +#include <Swiften/Network/TimerFactory.h> +#include <Swiften/Network/BoostNetworkFactories.h> +#include <Swiften/EventLoop/EventLoop.h> +#include <Swiften/Client/ClientXMLTracer.h> +#include <Swiften/EventLoop/SimpleEventLoop.h> +#include <Swiften/Disco/GetDiscoInfoRequest.h> using namespace Swift; @@ -43,7 +44,7 @@ void handleServerDiscoInfoResponse(boost::shared_ptr<DiscoInfo> /*info*/, ErrorP void handleConnected() { exitCode = NO_RESPONSE; GetDiscoInfoRequest::ref discoInfoRequest = GetDiscoInfoRequest::create(JID(), client->getIQRouter()); - discoInfoRequest->onResponse.connect(handleServerDiscoInfoResponse); + discoInfoRequest->onResponse.connect(&handleServerDiscoInfoResponse); discoInfoRequest->send(); } diff --git a/Swiften/Examples/ConnectivityTest/SConscript b/Swiften/Examples/ConnectivityTest/SConscript index f66c57f..7bc3892 100644 --- a/Swiften/Examples/ConnectivityTest/SConscript +++ b/Swiften/Examples/ConnectivityTest/SConscript @@ -2,12 +2,6 @@ Import("env") myenv = env.Clone() myenv.MergeFlags(myenv["SWIFTEN_FLAGS"]) -myenv.MergeFlags(myenv["LIBIDN_FLAGS"]) -myenv.MergeFlags(myenv["BOOST_FLAGS"]) -myenv.MergeFlags(myenv.get("SQLITE_FLAGS", {})) -myenv.MergeFlags(myenv["ZLIB_FLAGS"]) -myenv.MergeFlags(myenv["OPENSSL_FLAGS"]) -myenv.MergeFlags(myenv.get("LIBXML_FLAGS", "")) -myenv.MergeFlags(myenv.get("EXPAT_FLAGS", "")) -myenv.MergeFlags(myenv["PLATFORM_FLAGS"]) +myenv.MergeFlags(myenv["SWIFTEN_DEP_FLAGS"]) + tester = myenv.Program("ConnectivityTest", ["ConnectivityTest.cpp"]) diff --git a/Swiften/Examples/LinkLocalTool/main.cpp b/Swiften/Examples/LinkLocalTool/main.cpp index d63ef53..18e282b 100644 --- a/Swiften/Examples/LinkLocalTool/main.cpp +++ b/Swiften/Examples/LinkLocalTool/main.cpp @@ -8,11 +8,11 @@ #include <iostream> -#include "Swiften/EventLoop/SimpleEventLoop.h" -#include "Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h" -#include "Swiften/LinkLocal/DNSSD/DNSSDQuerier.h" -#include "Swiften/LinkLocal/DNSSD/DNSSDBrowseQuery.h" -#include "Swiften/LinkLocal/DNSSD/DNSSDResolveServiceQuery.h" +#include <Swiften/EventLoop/SimpleEventLoop.h> +#include <Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h> +#include <Swiften/LinkLocal/DNSSD/DNSSDQuerier.h> +#include <Swiften/LinkLocal/DNSSD/DNSSDBrowseQuery.h> +#include <Swiften/LinkLocal/DNSSD/DNSSDResolveServiceQuery.h> using namespace Swift; diff --git a/Swiften/Examples/ParserTester/ParserTester.cpp b/Swiften/Examples/ParserTester/ParserTester.cpp index 61c0eae..211d44f 100644 --- a/Swiften/Examples/ParserTester/ParserTester.cpp +++ b/Swiften/Examples/ParserTester/ParserTester.cpp @@ -8,10 +8,10 @@ #include <fstream> #include <typeinfo> -#include "Swiften/Parser/UnitTest/ParserTester.h" -#include "Swiften/Parser/XMPPParser.h" -#include "Swiften/Parser/XMPPParserClient.h" -#include "Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h" +#include <Swiften/Parser/UnitTest/ParserTester.h> +#include <Swiften/Parser/XMPPParser.h> +#include <Swiften/Parser/XMPPParserClient.h> +#include <Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h> using namespace Swift; diff --git a/Swiften/Examples/SendFile/ReceiveFile.cpp b/Swiften/Examples/SendFile/ReceiveFile.cpp index b46d790..effa1b7 100644 --- a/Swiften/Examples/SendFile/ReceiveFile.cpp +++ b/Swiften/Examples/SendFile/ReceiveFile.cpp @@ -7,7 +7,10 @@ #include <boost/bind.hpp> #include <boost/filesystem.hpp> #include <boost/smart_ptr/make_shared.hpp> +#include <iostream> +#include <Swiften/Elements/Presence.h> +#include <Swiften/Base/foreach.h> #include <Swiften/Client/Client.h> #include <Swiften/Network/BoostNetworkFactories.h> #include <Swiften/EventLoop/SimpleEventLoop.h> diff --git a/Swiften/Examples/SendFile/SConscript b/Swiften/Examples/SendFile/SConscript index 6986f22..d335513 100644 --- a/Swiften/Examples/SendFile/SConscript +++ b/Swiften/Examples/SendFile/SConscript @@ -2,14 +2,7 @@ Import("env") myenv = env.Clone() myenv.MergeFlags(myenv["SWIFTEN_FLAGS"]) -myenv.MergeFlags(myenv["LIBIDN_FLAGS"]) -myenv.MergeFlags(myenv["BOOST_FLAGS"]) -myenv.MergeFlags(myenv["ZLIB_FLAGS"]) -myenv.MergeFlags(myenv["OPENSSL_FLAGS"]) -myenv.MergeFlags(myenv.get("SQLITE_FLAGS", {})) -myenv.MergeFlags(myenv.get("LIBXML_FLAGS", "")) -myenv.MergeFlags(myenv.get("EXPAT_FLAGS", "")) -myenv.MergeFlags(myenv["PLATFORM_FLAGS"]) +myenv.MergeFlags(myenv["SWIFTEN_DEP_FLAGS"]) myenv.Program("SendFile", ["SendFile.cpp"]) myenv.Program("ReceiveFile", ["ReceiveFile.cpp"]) diff --git a/Swiften/Examples/SendFile/SendFile.cpp b/Swiften/Examples/SendFile/SendFile.cpp index 5ec00a9..205b442 100644 --- a/Swiften/Examples/SendFile/SendFile.cpp +++ b/Swiften/Examples/SendFile/SendFile.cpp @@ -6,18 +6,20 @@ #include <boost/bind.hpp> #include <boost/filesystem.hpp> - -#include "Swiften/Client/Client.h" -#include "Swiften/Network/BoostTimer.h" -#include "Swiften/Network/TimerFactory.h" -#include "Swiften/Network/BoostNetworkFactories.h" -#include "Swiften/EventLoop/EventLoop.h" -#include "Swiften/Client/ClientXMLTracer.h" -#include "Swiften/EventLoop/SimpleEventLoop.h" -#include "Swiften/FileTransfer/OutgoingFileTransfer.h" -#include "Swiften/FileTransfer/FileReadBytestream.h" -#include "Swiften/FileTransfer/SOCKS5BytestreamServer.h" -#include "Swiften/Network/BoostConnectionServer.h" +#include <iostream> + +#include <Swiften/Client/Client.h> +#include <Swiften/Elements/Presence.h> +#include <Swiften/Network/BoostTimer.h> +#include <Swiften/Network/TimerFactory.h> +#include <Swiften/Network/BoostNetworkFactories.h> +#include <Swiften/EventLoop/EventLoop.h> +#include <Swiften/Client/ClientXMLTracer.h> +#include <Swiften/EventLoop/SimpleEventLoop.h> +#include <Swiften/FileTransfer/OutgoingSIFileTransfer.h> +#include <Swiften/FileTransfer/FileReadBytestream.h> +#include <Swiften/FileTransfer/SOCKS5BytestreamServer.h> +#include <Swiften/Network/BoostConnectionServer.h> using namespace Swift; @@ -64,7 +66,7 @@ class FileSender { private: void handleConnected() { client->sendPresence(Presence::create()); - transfer = new OutgoingFileTransfer("myid", client->getJID(), recipient, file.filename(), boost::filesystem::file_size(file), "A file", boost::shared_ptr<FileReadBytestream>(new FileReadBytestream(file)), client->getIQRouter(), socksBytestreamServer); + transfer = new OutgoingSIFileTransfer("myid", client->getJID(), recipient, file.filename(), boost::filesystem::file_size(file), "A file", boost::shared_ptr<FileReadBytestream>(new FileReadBytestream(file)), client->getIQRouter(), socksBytestreamServer); transfer->onFinished.connect(boost::bind(&FileSender::handleFileTransferFinished, this, _1)); transfer->start(); } @@ -99,7 +101,7 @@ class FileSender { boost::filesystem::path file; Client* client; ClientXMLTracer* tracer; - OutgoingFileTransfer* transfer; + OutgoingSIFileTransfer* transfer; }; diff --git a/Swiften/Examples/SendMessage/SConscript b/Swiften/Examples/SendMessage/SConscript index 05ab4c3..8907d25 100644 --- a/Swiften/Examples/SendMessage/SConscript +++ b/Swiften/Examples/SendMessage/SConscript @@ -2,12 +2,6 @@ Import("env") myenv = env.Clone() myenv.MergeFlags(myenv["SWIFTEN_FLAGS"]) -myenv.MergeFlags(myenv["LIBIDN_FLAGS"]) -myenv.MergeFlags(myenv["BOOST_FLAGS"]) -myenv.MergeFlags(myenv["ZLIB_FLAGS"]) -myenv.MergeFlags(myenv["OPENSSL_FLAGS"]) -myenv.MergeFlags(myenv.get("SQLITE_FLAGS", {})) -myenv.MergeFlags(myenv.get("LIBXML_FLAGS", "")) -myenv.MergeFlags(myenv.get("EXPAT_FLAGS", "")) -myenv.MergeFlags(myenv["PLATFORM_FLAGS"]) +myenv.MergeFlags(myenv["SWIFTEN_DEP_FLAGS"]) + tester = myenv.Program("SendMessage", ["SendMessage.cpp"]) diff --git a/Swiften/Examples/SendMessage/SendMessage.cpp b/Swiften/Examples/SendMessage/SendMessage.cpp index d7f7333..f4dbf53 100644 --- a/Swiften/Examples/SendMessage/SendMessage.cpp +++ b/Swiften/Examples/SendMessage/SendMessage.cpp @@ -6,13 +6,15 @@ #include <boost/bind.hpp> #include <boost/thread.hpp> - -#include "Swiften/Client/Client.h" -#include "Swiften/Network/BoostNetworkFactories.h" -#include "Swiften/Network/TimerFactory.h" -#include "Swiften/EventLoop/EventLoop.h" -#include "Swiften/Client/ClientXMLTracer.h" -#include "Swiften/EventLoop/SimpleEventLoop.h" +#include <iostream> + +#include <Swiften/Client/Client.h> +#include <Swiften/Elements/Message.h> +#include <Swiften/Network/BoostNetworkFactories.h> +#include <Swiften/Network/TimerFactory.h> +#include <Swiften/EventLoop/EventLoop.h> +#include <Swiften/Client/ClientXMLTracer.h> +#include <Swiften/EventLoop/SimpleEventLoop.h> using namespace Swift; |