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/VCards
parentcad974b45c0fb9355e68d9728e42c9ae3dbcebc7 (diff)
downloadswift-contrib-cb05f5a908e20006c954ce38755c2e422ecc2388.zip
swift-contrib-cb05f5a908e20006c954ce38755c2e422ecc2388.tar.bz2
Removed Swift::String.
Diffstat (limited to 'Swiften/VCards')
-rw-r--r--Swiften/VCards/UnitTest/VCardManagerTest.cpp18
-rw-r--r--Swiften/VCards/VCardFileStorage.cpp9
2 files changed, 14 insertions, 13 deletions
diff --git a/Swiften/VCards/UnitTest/VCardManagerTest.cpp b/Swiften/VCards/UnitTest/VCardManagerTest.cpp
index 1f81f8e..9274639 100644
--- a/Swiften/VCards/UnitTest/VCardManagerTest.cpp
+++ b/Swiften/VCards/UnitTest/VCardManagerTest.cpp
@@ -64,7 +64,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
VCard::ref result = testling->getVCardAndRequestWhenNeeded(JID("foo@bar.com/baz"));
- CPPUNIT_ASSERT_EQUAL(String("Foo Bar"), result->getFullName());
+ CPPUNIT_ASSERT_EQUAL(std::string("Foo Bar"), result->getFullName());
CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(stanzaChannel->sentStanzas.size()));
}
@@ -83,8 +83,8 @@ class VCardManagerTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(changes.size()));
CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), changes[0].first);
- CPPUNIT_ASSERT_EQUAL(String("Foo Bar"), changes[0].second->getFullName());
- CPPUNIT_ASSERT_EQUAL(String("Foo Bar"), vcardStorage->getVCard(JID("foo@bar.com/baz"))->getFullName());
+ CPPUNIT_ASSERT_EQUAL(std::string("Foo Bar"), changes[0].second->getFullName());
+ CPPUNIT_ASSERT_EQUAL(std::string("Foo Bar"), vcardStorage->getVCard(JID("foo@bar.com/baz"))->getFullName());
CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(ownChanges.size()));
}
@@ -96,8 +96,8 @@ class VCardManagerTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(changes.size()));
CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), changes[0].first);
- CPPUNIT_ASSERT_EQUAL(String(""), changes[0].second->getFullName());
- CPPUNIT_ASSERT_EQUAL(String(""), vcardStorage->getVCard(JID("foo@bar.com/baz"))->getFullName());
+ CPPUNIT_ASSERT_EQUAL(std::string(""), changes[0].second->getFullName());
+ CPPUNIT_ASSERT_EQUAL(std::string(""), vcardStorage->getVCard(JID("foo@bar.com/baz"))->getFullName());
}
void testRequest_VCardAlreadyRequested() {
@@ -128,11 +128,11 @@ class VCardManagerTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(stanzaChannel->isRequestAtIndex<VCard>(0, JID(), IQ::Get));
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(changes.size()));
CPPUNIT_ASSERT_EQUAL(ownJID.toBare(), changes[0].first);
- CPPUNIT_ASSERT_EQUAL(String("Myself"), changes[0].second->getFullName());
- CPPUNIT_ASSERT_EQUAL(String("Myself"), vcardStorage->getVCard(ownJID.toBare())->getFullName());
+ CPPUNIT_ASSERT_EQUAL(std::string("Myself"), changes[0].second->getFullName());
+ CPPUNIT_ASSERT_EQUAL(std::string("Myself"), vcardStorage->getVCard(ownJID.toBare())->getFullName());
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(ownChanges.size()));
- CPPUNIT_ASSERT_EQUAL(String("Myself"), ownChanges[0]->getFullName());
+ CPPUNIT_ASSERT_EQUAL(std::string("Myself"), ownChanges[0]->getFullName());
}
void testCreateSetVCardRequest() {
@@ -146,7 +146,7 @@ class VCardManagerTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(changes.size()));
CPPUNIT_ASSERT_EQUAL(ownJID.toBare(), changes[0].first);
- CPPUNIT_ASSERT_EQUAL(String("New Name"), changes[0].second->getFullName());
+ CPPUNIT_ASSERT_EQUAL(std::string("New Name"), changes[0].second->getFullName());
}
void testCreateSetVCardRequest_Error() {
diff --git a/Swiften/VCards/VCardFileStorage.cpp b/Swiften/VCards/VCardFileStorage.cpp
index abececa..63652ad 100644
--- a/Swiften/VCards/VCardFileStorage.cpp
+++ b/Swiften/VCards/VCardFileStorage.cpp
@@ -8,6 +8,7 @@
#include <boost/filesystem/fstream.hpp>
+#include <Swiften/Base/String.h>
#include "Swiften/JID/JID.h"
#include "Swiften/Base/ByteArray.h"
#include "Swiften/Elements/VCard.h"
@@ -28,7 +29,7 @@ boost::shared_ptr<VCard> VCardFileStorage::getVCard(const JID& jid) const {
VCardParser parser;
PayloadParserTester tester(&parser);
- tester.parse(String(data.getData(), data.getSize()));
+ tester.parse(std::string(data.getData(), data.getSize()));
return boost::dynamic_pointer_cast<VCard>(parser.getPayload());
}
else {
@@ -52,9 +53,9 @@ void VCardFileStorage::setVCard(const JID& jid, VCard::ref v) {
}
boost::filesystem::path VCardFileStorage::getVCardPath(const JID& jid) const {
- String file(jid.toString());
- file.replaceAll('/', "%2f");
- return boost::filesystem::path(vcardsPath / (file.getUTF8String() + ".xml"));
+ std::string file(jid.toString());
+ String::replaceAll(file, '/', "%2f");
+ return boost::filesystem::path(vcardsPath / (file + ".xml"));
}
}