summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Client')
-rw-r--r--Swiften/Client/Client.cpp4
-rw-r--r--Swiften/Client/Client.h4
-rw-r--r--Swiften/Client/ClientSession.cpp4
-rw-r--r--Swiften/Client/ClientSession.h4
-rw-r--r--Swiften/Client/ClientSessionStanzaChannel.cpp2
-rw-r--r--Swiften/Client/ClientSessionStanzaChannel.h2
-rw-r--r--Swiften/Client/ClientXMLTracer.h2
-rw-r--r--Swiften/Client/CoreClient.cpp12
-rw-r--r--Swiften/Client/CoreClient.h20
-rw-r--r--Swiften/Client/DummyNickManager.h4
-rw-r--r--Swiften/Client/DummyStanzaChannel.h2
-rw-r--r--Swiften/Client/FileStorages.cpp4
-rw-r--r--Swiften/Client/NickManager.h8
-rw-r--r--Swiften/Client/NickManagerImpl.cpp8
-rw-r--r--Swiften/Client/NickManagerImpl.h8
-rw-r--r--Swiften/Client/NickResolver.cpp22
-rw-r--r--Swiften/Client/NickResolver.h10
-rw-r--r--Swiften/Client/UnitTest/ClientSessionTest.cpp4
-rw-r--r--Swiften/Client/UnitTest/NickResolverTest.cpp30
19 files changed, 77 insertions, 77 deletions
diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp
index 168c357..904f722 100644
--- a/Swiften/Client/Client.cpp
+++ b/Swiften/Client/Client.cpp
@@ -28,7 +28,7 @@
namespace Swift {
-Client::Client(const JID& jid, const String& password, NetworkFactories* networkFactories, Storages* storages) : CoreClient(jid, password, networkFactories), storages(storages) {
+Client::Client(const JID& jid, const std::string& password, NetworkFactories* networkFactories, Storages* storages) : CoreClient(jid, password, networkFactories), storages(storages) {
memoryStorages = new MemoryStorages();
softwareVersionResponder = new SoftwareVersionResponder(getIQRouter());
@@ -93,7 +93,7 @@ XMPPRoster* Client::getRoster() const {
return roster;
}
-void Client::setSoftwareVersion(const String& name, const String& version) {
+void Client::setSoftwareVersion(const std::string& name, const std::string& version) {
softwareVersionResponder->setVersion(name, version);
}
diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h
index 4725d50..868c9c4 100644
--- a/Swiften/Client/Client.h
+++ b/Swiften/Client/Client.h
@@ -47,7 +47,7 @@ namespace Swift {
* this is NULL,
* all data will be stored in memory (and be lost on shutdown)
*/
- Client(const JID& jid, const String& password, NetworkFactories* networkFactories, Storages* storages = NULL);
+ Client(const JID& jid, const std::string& password, NetworkFactories* networkFactories, Storages* storages = NULL);
~Client();
@@ -56,7 +56,7 @@ namespace Swift {
*
* This will be used to respond to version queries from other entities.
*/
- void setSoftwareVersion(const String& name, const String& version);
+ void setSoftwareVersion(const std::string& name, const std::string& version);
/**
* Returns a representation of the roster.
diff --git a/Swiften/Client/ClientSession.cpp b/Swiften/Client/ClientSession.cpp
index 49334a3..98e3065 100644
--- a/Swiften/Client/ClientSession.cpp
+++ b/Swiften/Client/ClientSession.cpp
@@ -304,7 +304,7 @@ void ClientSession::continueSessionInitialization() {
if (needResourceBind) {
state = BindingResource;
boost::shared_ptr<ResourceBind> resourceBind(new ResourceBind());
- if (!localJID.getResource().isEmpty()) {
+ if (!localJID.getResource().empty()) {
resourceBind->setResource(localJID.getResource());
}
sendStanza(IQ::createRequest(IQ::Set, JID(), "session-bind", resourceBind));
@@ -331,7 +331,7 @@ bool ClientSession::checkState(State state) {
return true;
}
-void ClientSession::sendCredentials(const String& password) {
+void ClientSession::sendCredentials(const std::string& password) {
assert(WaitingForCredentials);
state = Authenticating;
authenticator->setCredentials(localJID.getNode(), password);
diff --git a/Swiften/Client/ClientSession.h b/Swiften/Client/ClientSession.h
index be0f89e..e15a707 100644
--- a/Swiften/Client/ClientSession.h
+++ b/Swiften/Client/ClientSession.h
@@ -12,7 +12,7 @@
#include "Swiften/Base/Error.h"
#include "Swiften/Session/SessionStream.h"
-#include "Swiften/Base/String.h"
+#include <string>
#include "Swiften/JID/JID.h"
#include "Swiften/Elements/Element.h"
#include "Swiften/StreamManagement/StanzaAckRequester.h"
@@ -86,7 +86,7 @@ namespace Swift {
return getState() == Finished;
}
- void sendCredentials(const String& password);
+ void sendCredentials(const std::string& password);
void sendStanza(boost::shared_ptr<Stanza>);
void setCertificateTrustChecker(CertificateTrustChecker* checker) {
diff --git a/Swiften/Client/ClientSessionStanzaChannel.cpp b/Swiften/Client/ClientSessionStanzaChannel.cpp
index 996196b..6b32b3d 100644
--- a/Swiften/Client/ClientSessionStanzaChannel.cpp
+++ b/Swiften/Client/ClientSessionStanzaChannel.cpp
@@ -31,7 +31,7 @@ void ClientSessionStanzaChannel::sendPresence(boost::shared_ptr<Presence> presen
send(presence);
}
-String ClientSessionStanzaChannel::getNewIQID() {
+std::string ClientSessionStanzaChannel::getNewIQID() {
return idGenerator.generateID();
}
diff --git a/Swiften/Client/ClientSessionStanzaChannel.h b/Swiften/Client/ClientSessionStanzaChannel.h
index d3fd093..8a56301 100644
--- a/Swiften/Client/ClientSessionStanzaChannel.h
+++ b/Swiften/Client/ClientSessionStanzaChannel.h
@@ -33,7 +33,7 @@ namespace Swift {
}
private:
- String getNewIQID();
+ std::string getNewIQID();
void send(boost::shared_ptr<Stanza> stanza);
void handleSessionFinished(boost::shared_ptr<Error> error);
void handleStanza(boost::shared_ptr<Stanza> stanza);
diff --git a/Swiften/Client/ClientXMLTracer.h b/Swiften/Client/ClientXMLTracer.h
index 43fdda3..bca2a54 100644
--- a/Swiften/Client/ClientXMLTracer.h
+++ b/Swiften/Client/ClientXMLTracer.h
@@ -19,7 +19,7 @@ namespace Swift {
}
private:
- static void printData(char direction, const String& data) {
+ static void printData(char direction, const std::string& data) {
printLine(direction);
std::cerr << data << std::endl;
}
diff --git a/Swiften/Client/CoreClient.cpp b/Swiften/Client/CoreClient.cpp
index 2bd22c8..edb7643 100644
--- a/Swiften/Client/CoreClient.cpp
+++ b/Swiften/Client/CoreClient.cpp
@@ -22,7 +22,7 @@
namespace Swift {
-CoreClient::CoreClient(const JID& jid, const String& password, NetworkFactories* networkFactories) : jid_(jid), password_(password), networkFactories(networkFactories), disconnectRequested_(false), certificateTrustChecker(NULL) {
+CoreClient::CoreClient(const JID& jid, const std::string& password, NetworkFactories* networkFactories) : jid_(jid), password_(password), networkFactories(networkFactories), disconnectRequested_(false), certificateTrustChecker(NULL) {
stanzaChannel_ = new ClientSessionStanzaChannel();
stanzaChannel_->onMessageReceived.connect(boost::bind(&CoreClient::handleMessageReceived, this, _1));
stanzaChannel_->onPresenceReceived.connect(boost::bind(&CoreClient::handlePresenceReceived, this, _1));
@@ -52,7 +52,7 @@ void CoreClient::connect() {
connect(jid_.getDomain());
}
-void CoreClient::connect(const String& host) {
+void CoreClient::connect(const std::string& host) {
SWIFT_LOG(debug) << "Connecting to host " << host << std::endl;
disconnectRequested_ = false;
assert(!connector_);
@@ -74,7 +74,7 @@ void CoreClient::handleConnectorFinished(boost::shared_ptr<Connection> connectio
assert(!sessionStream_);
sessionStream_ = boost::shared_ptr<BasicSessionStream>(new BasicSessionStream(ClientStreamType, connection_, getPayloadParserFactories(), getPayloadSerializers(), tlsFactories->getTLSContextFactory(), networkFactories->getTimerFactory()));
- if (!certificate_.isEmpty()) {
+ if (!certificate_.empty()) {
sessionStream_->setTLSCertificate(PKCS12Certificate(certificate_, password_));
}
sessionStream_->onDataRead.connect(boost::bind(&CoreClient::handleDataRead, this, _1));
@@ -101,7 +101,7 @@ void CoreClient::disconnect() {
}
}
-void CoreClient::setCertificate(const String& certificate) {
+void CoreClient::setCertificate(const std::string& certificate) {
certificate_ = certificate;
}
@@ -219,11 +219,11 @@ void CoreClient::handleNeedCredentials() {
session_->sendCredentials(password_);
}
-void CoreClient::handleDataRead(const String& data) {
+void CoreClient::handleDataRead(const std::string& data) {
onDataRead(data);
}
-void CoreClient::handleDataWritten(const String& data) {
+void CoreClient::handleDataWritten(const std::string& data) {
onDataWritten(data);
}
diff --git a/Swiften/Client/CoreClient.h b/Swiften/Client/CoreClient.h
index 5ecf2c9..92cd197 100644
--- a/Swiften/Client/CoreClient.h
+++ b/Swiften/Client/CoreClient.h
@@ -17,7 +17,7 @@
#include "Swiften/Elements/Presence.h"
#include "Swiften/Elements/Message.h"
#include "Swiften/JID/JID.h"
-#include "Swiften/Base/String.h"
+#include <string>
#include "Swiften/Client/StanzaChannel.h"
#include "Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h"
#include "Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h"
@@ -52,10 +52,10 @@ namespace Swift {
* Constructs a client for the given JID with the given password.
* The given eventLoop will be used to post events to.
*/
- CoreClient(const JID& jid, const String& password, NetworkFactories* networkFactories);
+ CoreClient(const JID& jid, const std::string& password, NetworkFactories* networkFactories);
~CoreClient();
- void setCertificate(const String& certificate);
+ void setCertificate(const std::string& certificate);
/**
* Connects the client to the server.
@@ -70,7 +70,7 @@ namespace Swift {
*/
void disconnect();
- void connect(const String& host);
+ void connect(const std::string& host);
/**
* Sends a message.
@@ -164,7 +164,7 @@ namespace Swift {
* This signal is emitted before the XML data is parsed,
* so this data is unformatted.
*/
- boost::signal<void (const String&)> onDataRead;
+ boost::signal<void (const std::string&)> onDataRead;
/**
* Emitted when the client sends data.
@@ -172,7 +172,7 @@ namespace Swift {
* This signal is emitted after the XML was serialized, and
* is unformatted.
*/
- boost::signal<void (const String&)> onDataWritten;
+ boost::signal<void (const std::string&)> onDataWritten;
/**
* Emitted when a message is received.
@@ -197,15 +197,15 @@ namespace Swift {
void handleStanzaChannelAvailableChanged(bool available);
void handleSessionFinished(boost::shared_ptr<Error>);
void handleNeedCredentials();
- void handleDataRead(const String&);
- void handleDataWritten(const String&);
+ void handleDataRead(const std::string&);
+ void handleDataWritten(const std::string&);
void handlePresenceReceived(Presence::ref);
void handleMessageReceived(Message::ref);
void handleStanzaAcked(Stanza::ref);
private:
JID jid_;
- String password_;
+ std::string password_;
NetworkFactories* networkFactories;
ClientSessionStanzaChannel* stanzaChannel_;
IQRouter* iqRouter_;
@@ -214,7 +214,7 @@ namespace Swift {
boost::shared_ptr<Connection> connection_;
boost::shared_ptr<BasicSessionStream> sessionStream_;
boost::shared_ptr<ClientSession> session_;
- String certificate_;
+ std::string certificate_;
bool disconnectRequested_;
CertificateTrustChecker* certificateTrustChecker;
};
diff --git a/Swiften/Client/DummyNickManager.h b/Swiften/Client/DummyNickManager.h
index b746f88..0e3ff50 100644
--- a/Swiften/Client/DummyNickManager.h
+++ b/Swiften/Client/DummyNickManager.h
@@ -13,11 +13,11 @@ namespace Swift {
class DummyNickManager : public NickManager {
public:
- String getOwnNick() const {
+ std::string getOwnNick() const {
return "";
}
- void setOwnNick(const String&) {
+ void setOwnNick(const std::string&) {
}
};
}
diff --git a/Swiften/Client/DummyStanzaChannel.h b/Swiften/Client/DummyStanzaChannel.h
index 5784788..b9f05c3 100644
--- a/Swiften/Client/DummyStanzaChannel.h
+++ b/Swiften/Client/DummyStanzaChannel.h
@@ -36,7 +36,7 @@ namespace Swift {
sentStanzas.push_back(presence);
}
- virtual String getNewIQID() {
+ virtual std::string getNewIQID() {
return "test-id";
}
diff --git a/Swiften/Client/FileStorages.cpp b/Swiften/Client/FileStorages.cpp
index 9f2dda0..ad8b130 100644
--- a/Swiften/Client/FileStorages.cpp
+++ b/Swiften/Client/FileStorages.cpp
@@ -12,8 +12,8 @@
namespace Swift {
FileStorages::FileStorages(const boost::filesystem::path& baseDir, const JID& jid) {
- String profile = jid.toBare();
- vcardStorage = new VCardFileStorage(baseDir / profile.getUTF8String() / "vcards");
+ std::string profile = jid.toBare();
+ vcardStorage = new VCardFileStorage(baseDir / profile / "vcards");
capsStorage = new CapsFileStorage(baseDir / "caps");
avatarStorage = new AvatarFileStorage(baseDir / "avatars");
}
diff --git a/Swiften/Client/NickManager.h b/Swiften/Client/NickManager.h
index e918b07..288aa7b 100644
--- a/Swiften/Client/NickManager.h
+++ b/Swiften/Client/NickManager.h
@@ -7,16 +7,16 @@
#pragma once
#include <Swiften/Base/boost_bsignals.h>
-#include <Swiften/Base/String.h>
+#include <string>
namespace Swift {
class NickManager {
public:
virtual ~NickManager();
- virtual String getOwnNick() const = 0;
- virtual void setOwnNick(const String& nick) = 0;
+ virtual std::string getOwnNick() const = 0;
+ virtual void setOwnNick(const std::string& nick) = 0;
- boost::signal<void (const String&)> onOwnNickChanged;
+ boost::signal<void (const std::string&)> onOwnNickChanged;
};
}
diff --git a/Swiften/Client/NickManagerImpl.cpp b/Swiften/Client/NickManagerImpl.cpp
index fd37222..b9ebcde 100644
--- a/Swiften/Client/NickManagerImpl.cpp
+++ b/Swiften/Client/NickManagerImpl.cpp
@@ -22,11 +22,11 @@ NickManagerImpl::~NickManagerImpl() {
vcardManager->onVCardChanged.disconnect(boost::bind(&NickManagerImpl::handleVCardReceived, this, _1, _2));
}
-String NickManagerImpl::getOwnNick() const {
+std::string NickManagerImpl::getOwnNick() const {
return ownNick;
}
-void NickManagerImpl::setOwnNick(const String&) {
+void NickManagerImpl::setOwnNick(const std::string&) {
}
void NickManagerImpl::handleVCardReceived(const JID& jid, VCard::ref vcard) {
@@ -37,8 +37,8 @@ void NickManagerImpl::handleVCardReceived(const JID& jid, VCard::ref vcard) {
}
void NickManagerImpl::updateOwnNickFromVCard(VCard::ref vcard) {
- String nick;
- if (vcard && !vcard->getNickname().isEmpty()) {
+ std::string nick;
+ if (vcard && !vcard->getNickname().empty()) {
nick = vcard->getNickname();
}
if (ownNick != nick) {
diff --git a/Swiften/Client/NickManagerImpl.h b/Swiften/Client/NickManagerImpl.h
index 8796dbe..d732987 100644
--- a/Swiften/Client/NickManagerImpl.h
+++ b/Swiften/Client/NickManagerImpl.h
@@ -9,7 +9,7 @@
#include <Swiften/Client/NickManager.h>
#include <Swiften/Elements/VCard.h>
#include <Swiften/JID/JID.h>
-#include <Swiften/Base/String.h>
+#include <string>
namespace Swift {
class VCardManager;
@@ -19,8 +19,8 @@ namespace Swift {
NickManagerImpl(const JID& ownJID, VCardManager* vcardManager);
~NickManagerImpl();
- String getOwnNick() const;
- void setOwnNick(const String& nick);
+ std::string getOwnNick() const;
+ void setOwnNick(const std::string& nick);
private:
void handleVCardReceived(const JID& jid, VCard::ref vCard);
@@ -29,6 +29,6 @@ namespace Swift {
private:
JID ownJID;
VCardManager* vcardManager;
- String ownNick;
+ std::string ownNick;
};
}
diff --git a/Swiften/Client/NickResolver.cpp b/Swiften/Client/NickResolver.cpp
index 3e1ae8e..6d5e742 100644
--- a/Swiften/Client/NickResolver.cpp
+++ b/Swiften/Client/NickResolver.cpp
@@ -31,28 +31,28 @@ NickResolver::NickResolver(const JID& ownJID, XMPPRoster* xmppRoster, VCardManag
xmppRoster_->onJIDAdded.connect(boost::bind(&NickResolver::handleJIDAdded, this, _1));
}
-void NickResolver::handleJIDUpdated(const JID& jid, const String& previousNick, const std::vector<String>& /*groups*/) {
+void NickResolver::handleJIDUpdated(const JID& jid, const std::string& previousNick, const std::vector<std::string>& /*groups*/) {
onNickChanged(jid, previousNick);
}
void NickResolver::handleJIDAdded(const JID& jid) {
- String oldNick(jidToNick(jid));
+ std::string oldNick(jidToNick(jid));
onNickChanged(jid, oldNick);
}
-String NickResolver::jidToNick(const JID& jid) {
+std::string NickResolver::jidToNick(const JID& jid) {
if (jid.toBare() == ownJID_) {
- if (!ownNick_.isEmpty()) {
+ if (!ownNick_.empty()) {
return ownNick_;
}
}
- String nick;
+ std::string nick;
if (mucRegistry_ && mucRegistry_->isMUC(jid.toBare()) ) {
- return jid.getResource().isEmpty() ? jid.toBare().toString() : jid.getResource();
+ return jid.getResource().empty() ? jid.toBare().toString() : jid.getResource();
}
- if (xmppRoster_->containsJID(jid) && !xmppRoster_->getNameForJID(jid).isEmpty()) {
+ if (xmppRoster_->containsJID(jid) && !xmppRoster_->getNameForJID(jid).empty()) {
return xmppRoster_->getNameForJID(jid);
}
@@ -63,14 +63,14 @@ void NickResolver::handleVCardReceived(const JID& jid, VCard::ref ownVCard) {
if (!jid.equals(ownJID_, JID::WithoutResource)) {
return;
}
- String initialNick = ownNick_;
+ std::string initialNick = ownNick_;
ownNick_ = ownJID_.toString();
if (ownVCard) {
- if (!ownVCard->getNickname().isEmpty()) {
+ if (!ownVCard->getNickname().empty()) {
ownNick_ = ownVCard->getNickname();
- } else if (!ownVCard->getGivenName().isEmpty()) {
+ } else if (!ownVCard->getGivenName().empty()) {
ownNick_ = ownVCard->getGivenName();
- } else if (!ownVCard->getFullName().isEmpty()) {
+ } else if (!ownVCard->getFullName().empty()) {
ownNick_ = ownVCard->getFullName();
}
}
diff --git a/Swiften/Client/NickResolver.h b/Swiften/Client/NickResolver.h
index 697409f..881362a 100644
--- a/Swiften/Client/NickResolver.h
+++ b/Swiften/Client/NickResolver.h
@@ -8,7 +8,7 @@
#include <boost/signals.hpp>
#include <boost/shared_ptr.hpp>
-#include "Swiften/Base/String.h"
+#include <string>
#include "Swiften/JID/JID.h"
#include "Swiften/Elements/VCard.h"
@@ -20,18 +20,18 @@ namespace Swift {
public:
NickResolver(const JID& ownJID, XMPPRoster* xmppRoster, VCardManager* vcardManager, MUCRegistry* mucRegistry);
- String jidToNick(const JID& jid);
+ std::string jidToNick(const JID& jid);
- boost::signal<void (const JID&, const String& /*previousNick*/)> onNickChanged;
+ boost::signal<void (const JID&, const std::string& /*previousNick*/)> onNickChanged;
private:
void handleVCardReceived(const JID& jid, VCard::ref vCard);
- void handleJIDUpdated(const JID& jid, const String& previousNick, const std::vector<String>& groups);
+ void handleJIDUpdated(const JID& jid, const std::string& previousNick, const std::vector<std::string>& groups);
void handleJIDAdded(const JID& jid);
private:
JID ownJID_;
- String ownNick_;
+ std::string ownNick_;
XMPPRoster* xmppRoster_;
MUCRegistry* mucRegistry_;
VCardManager* vcardManager_;
diff --git a/Swiften/Client/UnitTest/ClientSessionTest.cpp b/Swiften/Client/UnitTest/ClientSessionTest.cpp
index af8a4c3..21c0ffb 100644
--- a/Swiften/Client/UnitTest/ClientSessionTest.cpp
+++ b/Swiften/Client/UnitTest/ClientSessionTest.cpp
@@ -455,7 +455,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(boost::dynamic_pointer_cast<StartTLSRequest>(event.element));
}
- void receiveAuthRequest(const String& mech) {
+ void receiveAuthRequest(const std::string& mech) {
Event event = popEvent();
CPPUNIT_ASSERT(event.element);
boost::shared_ptr<AuthRequest> request(boost::dynamic_pointer_cast<AuthRequest>(event.element));
@@ -490,7 +490,7 @@ class ClientSessionTest : public CppUnit::TestFixture {
bool tlsEncrypted;
bool compressed;
bool whitespacePingEnabled;
- String bindID;
+ std::string bindID;
int resetCount;
std::deque<Event> receivedEvents;
};
diff --git a/Swiften/Client/UnitTest/NickResolverTest.cpp b/Swiften/Client/UnitTest/NickResolverTest.cpp
index 0c5c91b..bd778d4 100644
--- a/Swiften/Client/UnitTest/NickResolverTest.cpp
+++ b/Swiften/Client/UnitTest/NickResolverTest.cpp
@@ -58,34 +58,34 @@ class NickResolverTest : public CppUnit::TestFixture {
registry_->addMUC(JID("foo@bar"));
JID testJID("foo@bar/baz");
- CPPUNIT_ASSERT_EQUAL(String("baz"), resolver_->jidToNick(testJID));
+ CPPUNIT_ASSERT_EQUAL(std::string("baz"), resolver_->jidToNick(testJID));
}
void testMUCNoNick() {
registry_->addMUC(JID("foo@bar"));
JID testJID("foo@bar");
- CPPUNIT_ASSERT_EQUAL(String("foo@bar"), resolver_->jidToNick(testJID));
+ CPPUNIT_ASSERT_EQUAL(std::string("foo@bar"), resolver_->jidToNick(testJID));
}
void testNoMatch() {
JID testJID("foo@bar/baz");
- CPPUNIT_ASSERT_EQUAL(String("foo@bar"), resolver_->jidToNick(testJID));
+ CPPUNIT_ASSERT_EQUAL(std::string("foo@bar"), resolver_->jidToNick(testJID));
}
void testZeroLengthMatch() {
JID testJID("foo@bar/baz");
xmppRoster_->addContact(testJID, "", groups_, RosterItemPayload::Both);
- CPPUNIT_ASSERT_EQUAL(String("foo@bar"), resolver_->jidToNick(testJID));
+ CPPUNIT_ASSERT_EQUAL(std::string("foo@bar"), resolver_->jidToNick(testJID));
}
void testMatch() {
JID testJID("foo@bar/baz");
xmppRoster_->addContact(testJID, "Test", groups_, RosterItemPayload::Both);
- CPPUNIT_ASSERT_EQUAL(String("Test"), resolver_->jidToNick(testJID));
+ CPPUNIT_ASSERT_EQUAL(std::string("Test"), resolver_->jidToNick(testJID));
}
void testOverwrittenMatch() {
@@ -93,40 +93,40 @@ class NickResolverTest : public CppUnit::TestFixture {
xmppRoster_->addContact(testJID, "FailTest", groups_, RosterItemPayload::Both);
xmppRoster_->addContact(testJID, "Test", groups_, RosterItemPayload::Both);
- CPPUNIT_ASSERT_EQUAL(String("Test"), resolver_->jidToNick(testJID));
+ CPPUNIT_ASSERT_EQUAL(std::string("Test"), resolver_->jidToNick(testJID));
}
void testRemovedMatch() {
JID testJID("foo@bar/baz");
xmppRoster_->addContact(testJID, "FailTest", groups_, RosterItemPayload::Both);
xmppRoster_->removeContact(testJID);
- CPPUNIT_ASSERT_EQUAL(String("foo@bar"), resolver_->jidToNick(testJID));
+ CPPUNIT_ASSERT_EQUAL(std::string("foo@bar"), resolver_->jidToNick(testJID));
}
void testOwnNickFullOnly() {
populateOwnVCard("", "", "Kevin Smith");
- CPPUNIT_ASSERT_EQUAL(String("Kevin Smith"), resolver_->jidToNick(ownJID_));
+ CPPUNIT_ASSERT_EQUAL(std::string("Kevin Smith"), resolver_->jidToNick(ownJID_));
}
void testOwnNickGivenAndFull() {
populateOwnVCard("", "Kevin", "Kevin Smith");
- CPPUNIT_ASSERT_EQUAL(String("Kevin"), resolver_->jidToNick(ownJID_));
+ CPPUNIT_ASSERT_EQUAL(std::string("Kevin"), resolver_->jidToNick(ownJID_));
}
void testOwnNickNickEtAl() {
populateOwnVCard("Kev", "Kevin", "Kevin Smith");
- CPPUNIT_ASSERT_EQUAL(String("Kev"), resolver_->jidToNick(ownJID_));
+ CPPUNIT_ASSERT_EQUAL(std::string("Kev"), resolver_->jidToNick(ownJID_));
}
- void populateOwnVCard(const String& nick, const String& given, const String& full) {
+ void populateOwnVCard(const std::string& nick, const std::string& given, const std::string& full) {
VCard::ref vcard(new VCard());
- if (!nick.isEmpty()) {
+ if (!nick.empty()) {
vcard->setNickname(nick);
}
- if (!given.isEmpty()) {
+ if (!given.empty()) {
vcard->setGivenName(given);
}
- if (!full.isEmpty()) {
+ if (!full.empty()) {
vcard->setFullName(full);
}
vCardManager_->requestVCard(ownJID_);
@@ -135,7 +135,7 @@ class NickResolverTest : public CppUnit::TestFixture {
}
private:
- std::vector<String> groups_;
+ std::vector<std::string> groups_;
XMPPRosterImpl* xmppRoster_;
VCardStorage* vCardStorage_;
IQRouter* iqRouter_;