From 44bc44dee791570909b4b3d5f6f6f9f9ac07bba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Tue, 15 Feb 2011 22:40:52 +0100 Subject: Make JID constructor with string implicit. This avoids the need to explicitly contruct a JID where a string is used. diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot0x.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot0x.cpp index 68affc3..b4ccc21 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot0x.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot0x.cpp @@ -14,8 +14,7 @@ int main(int, char**) { BoostNetworkFactories networkFactories(&eventLoop); // Initialize the client with the JID and password - Client client( - JID("echobot@wonderland.lit"), "mypass", &networkFactories); + Client client("echobot@wonderland.lit", "mypass", &networkFactories); // When the client is convnected, send out initial presence client.onConnected.connect([&] { diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot1.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot1.cpp index de58f77..4736494 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot1.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot1.cpp @@ -12,7 +12,7 @@ int main(int, char**) { SimpleEventLoop eventLoop; BoostNetworkFactories networkFactories(&eventLoop); - Client client(JID("echobot@wonderland.lit"), "mypass", &networkFactories); + Client client("echobot@wonderland.lit", "mypass", &networkFactories); client.connect(); eventLoop.run(); diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp index bf1c74a..f431245 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp @@ -21,7 +21,7 @@ int main(int, char**) { SimpleEventLoop eventLoop; BoostNetworkFactories networkFactories(&eventLoop); - client = new Client(JID("echobot@wonderland.lit"), "mypass", &networkFactories); + client = new Client("echobot@wonderland.lit", "mypass", &networkFactories); client->onConnected.connect(&handleConnected); client->onMessageReceived.connect(bind(&handleMessageReceived, _1)); client->connect(); diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot3.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot3.cpp index d815d1f..cd95b91 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot3.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot3.cpp @@ -15,7 +15,7 @@ using namespace boost; class EchoBot { public: EchoBot(NetworkFactories* networkFactories) { - client = new Client(JID("echobot@wonderland.lit"), "mypass", networkFactories); + client = new Client("echobot@wonderland.lit", "mypass", networkFactories); client->onConnected.connect(bind(&EchoBot::handleConnected, this)); client->onMessageReceived.connect( bind(&EchoBot::handleMessageReceived, this, _1)); diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot4.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot4.cpp index fc846d3..c2f555c 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot4.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot4.cpp @@ -17,7 +17,7 @@ class EchoBot { public: EchoBot(NetworkFactories* networkFactories) { //... - client = new Client(JID("echobot@wonderland.lit"), "mypass", networkFactories); + client = new Client("echobot@wonderland.lit", "mypass", networkFactories); client->onConnected.connect(bind(&EchoBot::handleConnected, this)); client->onMessageReceived.connect( bind(&EchoBot::handleMessageReceived, this, _1)); diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot5.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot5.cpp index bc4cc3b..0b00330 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot5.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot5.cpp @@ -17,7 +17,7 @@ class EchoBot { public: EchoBot(NetworkFactories* networkFactories) { //... - client = new Client(JID("echobot@wonderland.lit"), "mypass", networkFactories); + client = new Client("echobot@wonderland.lit", "mypass", networkFactories); client->onConnected.connect(bind(&EchoBot::handleConnected, this)); client->onMessageReceived.connect( bind(&EchoBot::handleMessageReceived, this, _1)); diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp index 6443438..d3587e9 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot6.cpp @@ -22,7 +22,7 @@ class EchoBot { public: EchoBot(NetworkFactories* networkFactories) { //... - client = new Client(JID("echobot@wonderland.lit"), "mypass", networkFactories); + client = new Client("echobot@wonderland.lit", "mypass", networkFactories); client->onConnected.connect(bind(&EchoBot::handleConnected, this)); client->onMessageReceived.connect( bind(&EchoBot::handleMessageReceived, this, _1)); diff --git a/Swiften/JID/JID.h b/Swiften/JID/JID.h index 78136ff..4a71841 100644 --- a/Swiften/JID/JID.h +++ b/Swiften/JID/JID.h @@ -15,8 +15,8 @@ namespace Swift { WithResource, WithoutResource }; - explicit JID(const std::string& = std::string()); - explicit JID(const char*); + JID(const std::string& = std::string()); + JID(const char*); JID(const std::string& node, const std::string& domain); JID(const std::string& node, const std::string& domain, const std::string& resource); -- cgit v0.10.2-6-g49f6