diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-05-02 20:05:08 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-05-02 20:19:31 (GMT) |
commit | 7d2074bc046c38cf6947da77e1b9610c1809217d (patch) | |
tree | 3ddb60ea83873023db964b8353c58ffb5d7df250 /Swiften/StringCodecs | |
parent | 68a93082f7ff8ede37112bf9c6cb34ad2986c6c8 (diff) | |
download | swift-contrib-7d2074bc046c38cf6947da77e1b9610c1809217d.zip swift-contrib-7d2074bc046c38cf6947da77e1b9610c1809217d.tar.bz2 |
Add a generic erase() algorithm.
Diffstat (limited to 'Swiften/StringCodecs')
-rw-r--r-- | Swiften/StringCodecs/Base64.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Swiften/StringCodecs/Base64.cpp b/Swiften/StringCodecs/Base64.cpp index 214a425..a77fc93 100644 --- a/Swiften/StringCodecs/Base64.cpp +++ b/Swiften/StringCodecs/Base64.cpp @@ -5,9 +5,11 @@ */ #include <boost/numeric/conversion/cast.hpp> + #include <algorithm> #include <Swiften/StringCodecs/Base64.h> +#include <Swiften/Base/Algorithm.h> namespace Swift { @@ -48,7 +50,7 @@ std::string Base64::encode(const ByteArray &s) { ByteArray Base64::decode(const std::string& input) { std::string inputWithoutNewlines(input); - inputWithoutNewlines.erase(std::remove(inputWithoutNewlines.begin(), inputWithoutNewlines.end(), '\n'), inputWithoutNewlines.end()); + erase(inputWithoutNewlines, '\n'); const std::string& s = inputWithoutNewlines; ByteArray p; |