diff options
| author | Remko Tronçon <git@el-tramo.be> | 2011-02-14 18:57:18 (GMT) | 
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2011-02-14 21:36:32 (GMT) | 
| commit | cb05f5a908e20006c954ce38755c2e422ecc2388 (patch) | |
| tree | a793551a5fe279a57d4330119560e8542f745484 /Swiften/StringCodecs/Base64.cpp | |
| parent | cad974b45c0fb9355e68d9728e42c9ae3dbcebc7 (diff) | |
| download | swift-contrib-cb05f5a908e20006c954ce38755c2e422ecc2388.zip swift-contrib-cb05f5a908e20006c954ce38755c2e422ecc2388.tar.bz2  | |
Removed Swift::String.
Diffstat (limited to 'Swiften/StringCodecs/Base64.cpp')
| -rw-r--r-- | Swiften/StringCodecs/Base64.cpp | 11 | 
1 files changed, 6 insertions, 5 deletions
diff --git a/Swiften/StringCodecs/Base64.cpp b/Swiften/StringCodecs/Base64.cpp index 4c28f04..795d982 100644 --- a/Swiften/StringCodecs/Base64.cpp +++ b/Swiften/StringCodecs/Base64.cpp @@ -5,6 +5,7 @@   */  #include <boost/numeric/conversion/cast.hpp> +#include <algorithm>  #include "Swiften/StringCodecs/Base64.h" @@ -12,7 +13,7 @@ namespace Swift {  #pragma GCC diagnostic ignored "-Wold-style-cast" -String Base64::encode(const ByteArray &s) { +std::string Base64::encode(const ByteArray &s) {  	int i;  	int len = s.getSize();  	char tbl[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; @@ -45,11 +46,11 @@ String Base64::encode(const ByteArray &s) {  	return p;  } -ByteArray Base64::decode(const String& input) { -	String inputWithoutNewlines(input); -	inputWithoutNewlines.removeAll('\n'); +ByteArray Base64::decode(const std::string& input) { +	std::string inputWithoutNewlines(input); +	inputWithoutNewlines.erase(std::remove(inputWithoutNewlines.begin(), inputWithoutNewlines.end(), '\n'), inputWithoutNewlines.end()); -	const std::string& s = inputWithoutNewlines.getUTF8String(); +	const std::string& s = inputWithoutNewlines;  	ByteArray p;  	// -1 specifies invalid  | 
 Swift