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/IDN
parentcad974b45c0fb9355e68d9728e42c9ae3dbcebc7 (diff)
downloadswift-contrib-cb05f5a908e20006c954ce38755c2e422ecc2388.zip
swift-contrib-cb05f5a908e20006c954ce38755c2e422ecc2388.tar.bz2
Removed Swift::String.
Diffstat (limited to 'Swiften/IDN')
-rw-r--r--Swiften/IDN/IDNA.cpp6
-rw-r--r--Swiften/IDN/IDNA.h4
-rw-r--r--Swiften/IDN/StringPrep.cpp7
-rw-r--r--Swiften/IDN/StringPrep.h4
4 files changed, 11 insertions, 10 deletions
diff --git a/Swiften/IDN/IDNA.cpp b/Swiften/IDN/IDNA.cpp
index 0e76c0b..6b6c7a4 100644
--- a/Swiften/IDN/IDNA.cpp
+++ b/Swiften/IDN/IDNA.cpp
@@ -13,10 +13,10 @@
namespace Swift {
-String IDNA::getEncoded(const String& domain) {
+std::string IDNA::getEncoded(const std::string& domain) {
char* output;
- if (idna_to_ascii_8z(domain.getUTF8Data(), &output, 0) == IDNA_SUCCESS) {
- String result(output);
+ if (idna_to_ascii_8z(domain.c_str(), &output, 0) == IDNA_SUCCESS) {
+ std::string result(output);
free(output);
return result;
}
diff --git a/Swiften/IDN/IDNA.h b/Swiften/IDN/IDNA.h
index cc4144b..19af1e6 100644
--- a/Swiften/IDN/IDNA.h
+++ b/Swiften/IDN/IDNA.h
@@ -6,11 +6,11 @@
#pragma once
-#include "Swiften/Base/String.h"
+#include <string>
namespace Swift {
class IDNA {
public:
- static String getEncoded(const String& s);
+ static std::string getEncoded(const std::string& s);
};
}
diff --git a/Swiften/IDN/StringPrep.cpp b/Swiften/IDN/StringPrep.cpp
index d9e061e..ff01eed 100644
--- a/Swiften/IDN/StringPrep.cpp
+++ b/Swiften/IDN/StringPrep.cpp
@@ -8,6 +8,7 @@
#include <stringprep.h>
#include <vector>
+#include <cassert>
namespace Swift {
@@ -24,12 +25,12 @@ const Stringprep_profile* getLibIDNProfile(StringPrep::Profile profile) {
return 0;
}
-String StringPrep::getPrepared(const String& s, Profile profile) {
+std::string StringPrep::getPrepared(const std::string& s, Profile profile) {
- std::vector<char> input(s.getUTF8String().begin(), s.getUTF8String().end());
+ std::vector<char> input(s.begin(), s.end());
input.resize(MAX_STRINGPREP_SIZE);
if (stringprep(&input[0], MAX_STRINGPREP_SIZE, static_cast<Stringprep_profile_flags>(0), getLibIDNProfile(profile)) == 0) {
- return String(&input[0]);
+ return std::string(&input[0]);
}
else {
return "";
diff --git a/Swiften/IDN/StringPrep.h b/Swiften/IDN/StringPrep.h
index 3b27efa..f40553b 100644
--- a/Swiften/IDN/StringPrep.h
+++ b/Swiften/IDN/StringPrep.h
@@ -6,7 +6,7 @@
#pragma once
-#include "Swiften/Base/String.h"
+#include <string>
namespace Swift {
class StringPrep {
@@ -18,6 +18,6 @@ namespace Swift {
SASLPrep,
};
- static String getPrepared(const String& s, Profile profile);
+ static std::string getPrepared(const std::string& s, Profile profile);
};
}