summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-02-14 18:57:18 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-02-14 21:36:32 (GMT)
commitcb05f5a908e20006c954ce38755c2e422ecc2388 (patch)
treea793551a5fe279a57d4330119560e8542f745484 /Swiften/Queries
parentcad974b45c0fb9355e68d9728e42c9ae3dbcebc7 (diff)
downloadswift-cb05f5a908e20006c954ce38755c2e422ecc2388.zip
swift-cb05f5a908e20006c954ce38755c2e422ecc2388.tar.bz2
Removed Swift::String.
Diffstat (limited to 'Swiften/Queries')
-rw-r--r--Swiften/Queries/DummyIQChannel.h2
-rw-r--r--Swiften/Queries/GetResponder.h2
-rw-r--r--Swiften/Queries/IQChannel.h4
-rw-r--r--Swiften/Queries/IQRouter.cpp2
-rw-r--r--Swiften/Queries/IQRouter.h4
-rw-r--r--Swiften/Queries/Request.h4
-rw-r--r--Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp10
-rw-r--r--Swiften/Queries/Responder.h12
-rw-r--r--Swiften/Queries/Responders/SoftwareVersionResponder.cpp4
-rw-r--r--Swiften/Queries/Responders/SoftwareVersionResponder.h8
-rw-r--r--Swiften/Queries/SetResponder.h2
-rw-r--r--Swiften/Queries/UnitTest/RequestTest.cpp12
-rw-r--r--Swiften/Queries/UnitTest/ResponderTest.cpp8
13 files changed, 37 insertions, 37 deletions
diff --git a/Swiften/Queries/DummyIQChannel.h b/Swiften/Queries/DummyIQChannel.h
index 92b7f2b..f740b5c 100644
--- a/Swiften/Queries/DummyIQChannel.h
+++ b/Swiften/Queries/DummyIQChannel.h
@@ -19,7 +19,7 @@ namespace Swift {
iqs_.push_back(iq);
}
- virtual String getNewIQID() {
+ virtual std::string getNewIQID() {
return "test-id";
}
diff --git a/Swiften/Queries/GetResponder.h b/Swiften/Queries/GetResponder.h
index 2201b95..ca3b677 100644
--- a/Swiften/Queries/GetResponder.h
+++ b/Swiften/Queries/GetResponder.h
@@ -15,6 +15,6 @@ namespace Swift {
GetResponder(IQRouter* router) : Responder<T>(router) {}
private:
- virtual bool handleSetRequest(const JID&, const JID&, const String&, boost::shared_ptr<T>) { return false; }
+ virtual bool handleSetRequest(const JID&, const JID&, const std::string&, boost::shared_ptr<T>) { return false; }
};
}
diff --git a/Swiften/Queries/IQChannel.h b/Swiften/Queries/IQChannel.h
index e700b51..22b7572 100644
--- a/Swiften/Queries/IQChannel.h
+++ b/Swiften/Queries/IQChannel.h
@@ -10,7 +10,7 @@
#include "Swiften/Base/boost_bsignals.h"
#include <boost/shared_ptr.hpp>
-#include "Swiften/Base/String.h"
+#include <string>
#include "Swiften/Elements/IQ.h"
namespace Swift {
@@ -19,7 +19,7 @@ namespace Swift {
virtual ~IQChannel();
virtual void sendIQ(boost::shared_ptr<IQ>) = 0;
- virtual String getNewIQID() = 0;
+ virtual std::string getNewIQID() = 0;
virtual bool isAvailable() const = 0;
diff --git a/Swiften/Queries/IQRouter.cpp b/Swiften/Queries/IQRouter.cpp
index a08668a..1bfff70 100644
--- a/Swiften/Queries/IQRouter.cpp
+++ b/Swiften/Queries/IQRouter.cpp
@@ -87,7 +87,7 @@ void IQRouter::sendIQ(boost::shared_ptr<IQ> iq) {
channel_->sendIQ(iq);
}
-String IQRouter::getNewIQID() {
+std::string IQRouter::getNewIQID() {
return channel_->getNewIQID();
}
diff --git a/Swiften/Queries/IQRouter.h b/Swiften/Queries/IQRouter.h
index 42fa6e9..312dca8 100644
--- a/Swiften/Queries/IQRouter.h
+++ b/Swiften/Queries/IQRouter.h
@@ -9,7 +9,7 @@
#include <boost/shared_ptr.hpp>
#include <vector>
-#include "Swiften/Base/String.h"
+#include <string>
#include "Swiften/Elements/IQ.h"
namespace Swift {
@@ -45,7 +45,7 @@ namespace Swift {
* it.
*/
void sendIQ(boost::shared_ptr<IQ> iq);
- String getNewIQID();
+ std::string getNewIQID();
bool isAvailable();
diff --git a/Swiften/Queries/Request.h b/Swiften/Queries/Request.h
index 4ed8dc2..eee89e9 100644
--- a/Swiften/Queries/Request.h
+++ b/Swiften/Queries/Request.h
@@ -11,7 +11,7 @@
#include <boost/optional.hpp>
#include <boost/enable_shared_from_this.hpp>
-#include "Swiften/Base/String.h"
+#include <string>
#include "Swiften/Queries/IQHandler.h"
#include "Swiften/Elements/IQ.h"
#include "Swiften/Elements/Payload.h"
@@ -66,7 +66,7 @@ namespace Swift {
IQ::Type type_;
JID receiver_;
boost::shared_ptr<Payload> payload_;
- String id_;
+ std::string id_;
bool sent_;
};
}
diff --git a/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp b/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp
index 71c6cf0..b7c36cb 100644
--- a/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp
+++ b/Swiften/Queries/Requests/UnitTest/GetPrivateStorageRequestTest.cpp
@@ -26,8 +26,8 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture {
public:
class MyPayload : public Payload {
public:
- MyPayload(const String& text = "") : text(text) {}
- String text;
+ MyPayload(const std::string& text = "") : text(text) {}
+ std::string text;
};
public:
@@ -61,7 +61,7 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture {
channel->onIQReceived(createResponse("test-id", "foo"));
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(responses.size()));
- CPPUNIT_ASSERT_EQUAL(String("foo"), boost::dynamic_pointer_cast<MyPayload>(responses[0])->text);
+ CPPUNIT_ASSERT_EQUAL(std::string("foo"), boost::dynamic_pointer_cast<MyPayload>(responses[0])->text);
}
void testHandleResponse_Error() {
@@ -84,7 +84,7 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture {
}
}
- boost::shared_ptr<IQ> createResponse(const String& id, const String& text) {
+ boost::shared_ptr<IQ> createResponse(const std::string& id, const std::string& text) {
boost::shared_ptr<IQ> iq(new IQ(IQ::Result));
boost::shared_ptr<PrivateStorage> storage(new PrivateStorage());
storage->setPayload(boost::shared_ptr<Payload>(new MyPayload(text)));
@@ -93,7 +93,7 @@ class GetPrivateStorageRequestTest : public CppUnit::TestFixture {
return iq;
}
- boost::shared_ptr<IQ> createError(const String& id) {
+ boost::shared_ptr<IQ> createError(const std::string& id) {
boost::shared_ptr<IQ> iq(new IQ(IQ::Error));
iq->setID(id);
return iq;
diff --git a/Swiften/Queries/Responder.h b/Swiften/Queries/Responder.h
index 322ba60..2ce8f10 100644
--- a/Swiften/Queries/Responder.h
+++ b/Swiften/Queries/Responder.h
@@ -57,40 +57,40 @@ namespace Swift {
*
* This method is implemented in the concrete subclasses.
*/
- virtual bool handleGetRequest(const JID& from, const JID& to, const String& id, boost::shared_ptr<PAYLOAD_TYPE> payload) = 0;
+ virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr<PAYLOAD_TYPE> payload) = 0;
/**
* Handle an incoming IQ-Set request containing a payload of class PAYLOAD_TYPE.
*
* This method is implemented in the concrete subclasses.
*/
- virtual bool handleSetRequest(const JID& from, const JID& to, const String& id, boost::shared_ptr<PAYLOAD_TYPE> payload) = 0;
+ virtual bool handleSetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr<PAYLOAD_TYPE> payload) = 0;
/**
* Convenience function for sending an IQ response.
*/
- void sendResponse(const JID& to, const String& id, boost::shared_ptr<PAYLOAD_TYPE> payload) {
+ void sendResponse(const JID& to, const std::string& id, boost::shared_ptr<PAYLOAD_TYPE> payload) {
router_->sendIQ(IQ::createResult(to, id, payload));
}
/**
* Convenience function for sending an IQ response, with a specific from address.
*/
- void sendResponse(const JID& to, const JID& from, const String& id, boost::shared_ptr<PAYLOAD_TYPE> payload) {
+ void sendResponse(const JID& to, const JID& from, const std::string& id, boost::shared_ptr<PAYLOAD_TYPE> payload) {
router_->sendIQ(IQ::createResult(to, from, id, payload));
}
/**
* Convenience function for responding with an error.
*/
- void sendError(const JID& to, const String& id, ErrorPayload::Condition condition, ErrorPayload::Type type) {
+ void sendError(const JID& to, const std::string& id, ErrorPayload::Condition condition, ErrorPayload::Type type) {
router_->sendIQ(IQ::createError(to, id, condition, type));
}
/**
* Convenience function for responding with an error from a specific from address.
*/
- void sendError(const JID& to, const JID& from, const String& id, ErrorPayload::Condition condition, ErrorPayload::Type type) {
+ void sendError(const JID& to, const JID& from, const std::string& id, ErrorPayload::Condition condition, ErrorPayload::Type type) {
router_->sendIQ(IQ::createError(to, from, id, condition, type));
}
diff --git a/Swiften/Queries/Responders/SoftwareVersionResponder.cpp b/Swiften/Queries/Responders/SoftwareVersionResponder.cpp
index cc58114..0b8362c 100644
--- a/Swiften/Queries/Responders/SoftwareVersionResponder.cpp
+++ b/Swiften/Queries/Responders/SoftwareVersionResponder.cpp
@@ -12,12 +12,12 @@ namespace Swift {
SoftwareVersionResponder::SoftwareVersionResponder(IQRouter* router) : GetResponder<SoftwareVersion>(router) {
}
-void SoftwareVersionResponder::setVersion(const String& client, const String& version) {
+void SoftwareVersionResponder::setVersion(const std::string& client, const std::string& version) {
this->client = client;
this->version = version;
}
-bool SoftwareVersionResponder::handleGetRequest(const JID& from, const JID&, const String& id, boost::shared_ptr<SoftwareVersion>) {
+bool SoftwareVersionResponder::handleGetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr<SoftwareVersion>) {
sendResponse(from, id, boost::shared_ptr<SoftwareVersion>(new SoftwareVersion(client, version)));
return true;
}
diff --git a/Swiften/Queries/Responders/SoftwareVersionResponder.h b/Swiften/Queries/Responders/SoftwareVersionResponder.h
index 9da82b0..f6a3d52 100644
--- a/Swiften/Queries/Responders/SoftwareVersionResponder.h
+++ b/Swiften/Queries/Responders/SoftwareVersionResponder.h
@@ -16,13 +16,13 @@ namespace Swift {
public:
SoftwareVersionResponder(IQRouter* router);
- void setVersion(const String& client, const String& version);
+ void setVersion(const std::string& client, const std::string& version);
private:
- virtual bool handleGetRequest(const JID& from, const JID& to, const String& id, boost::shared_ptr<SoftwareVersion> payload);
+ virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr<SoftwareVersion> payload);
private:
- String client;
- String version;
+ std::string client;
+ std::string version;
};
}
diff --git a/Swiften/Queries/SetResponder.h b/Swiften/Queries/SetResponder.h
index a04be64..ec3460c 100644
--- a/Swiften/Queries/SetResponder.h
+++ b/Swiften/Queries/SetResponder.h
@@ -15,6 +15,6 @@ namespace Swift {
SetResponder(IQRouter* router) : Responder<T>(router) {}
private:
- virtual bool handleGetRequest(const JID&, const JID&, const String&, boost::shared_ptr<T>) { return false; }
+ virtual bool handleGetRequest(const JID&, const JID&, const std::string&, boost::shared_ptr<T>) { return false; }
};
}
diff --git a/Swiften/Queries/UnitTest/RequestTest.cpp b/Swiften/Queries/UnitTest/RequestTest.cpp
index 5013053..e99149e 100644
--- a/Swiften/Queries/UnitTest/RequestTest.cpp
+++ b/Swiften/Queries/UnitTest/RequestTest.cpp
@@ -30,8 +30,8 @@ class RequestTest : public CppUnit::TestFixture {
public:
class MyPayload : public Payload {
public:
- MyPayload(const String& s = "") : text_(s) {}
- String text_;
+ MyPayload(const std::string& s = "") : text_(s) {}
+ std::string text_;
};
typedef GenericRequest<MyPayload> MyRequest;
@@ -57,7 +57,7 @@ class RequestTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel_->iqs_.size()));
CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), channel_->iqs_[0]->getTo());
CPPUNIT_ASSERT_EQUAL(IQ::Set, channel_->iqs_[0]->getType());
- CPPUNIT_ASSERT_EQUAL(String("test-id"), channel_->iqs_[0]->getID());
+ CPPUNIT_ASSERT_EQUAL(std::string("test-id"), channel_->iqs_[0]->getID());
}
void testSendGet() {
@@ -140,19 +140,19 @@ class RequestTest : public CppUnit::TestFixture {
else {
boost::shared_ptr<MyPayload> payload(boost::dynamic_pointer_cast<MyPayload>(p));
CPPUNIT_ASSERT(payload);
- CPPUNIT_ASSERT_EQUAL(String("bar"), payload->text_);
+ CPPUNIT_ASSERT_EQUAL(std::string("bar"), payload->text_);
++responsesReceived_;
}
}
- boost::shared_ptr<IQ> createResponse(const String& id) {
+ boost::shared_ptr<IQ> createResponse(const std::string& id) {
boost::shared_ptr<IQ> iq(new IQ(IQ::Result));
iq->addPayload(responsePayload_);
iq->setID(id);
return iq;
}
- boost::shared_ptr<IQ> createError(const String& id) {
+ boost::shared_ptr<IQ> createError(const std::string& id) {
boost::shared_ptr<IQ> iq(new IQ(IQ::Error));
iq->setID(id);
return iq;
diff --git a/Swiften/Queries/UnitTest/ResponderTest.cpp b/Swiften/Queries/UnitTest/ResponderTest.cpp
index 97eb0c6..c087827 100644
--- a/Swiften/Queries/UnitTest/ResponderTest.cpp
+++ b/Swiften/Queries/UnitTest/ResponderTest.cpp
@@ -128,15 +128,15 @@ class ResponderTest : public CppUnit::TestFixture {
public:
MyResponder(IQRouter* router) : Responder<SoftwareVersion>(router), getRequestResponse_(true), setRequestResponse_(true) {}
- virtual bool handleGetRequest(const JID& from, const JID&, const String& id, boost::shared_ptr<SoftwareVersion> payload) {
+ virtual bool handleGetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr<SoftwareVersion> payload) {
CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), from);
- CPPUNIT_ASSERT_EQUAL(String("myid"), id);
+ CPPUNIT_ASSERT_EQUAL(std::string("myid"), id);
getPayloads_.push_back(payload);
return getRequestResponse_;
}
- virtual bool handleSetRequest(const JID& from, const JID&, const String& id, boost::shared_ptr<SoftwareVersion> payload) {
+ virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr<SoftwareVersion> payload) {
CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), from);
- CPPUNIT_ASSERT_EQUAL(String("myid"), id);
+ CPPUNIT_ASSERT_EQUAL(std::string("myid"), id);
setPayloads_.push_back(payload);
return setRequestResponse_;
}