diff options
-rw-r--r-- | Swiften/StringCodecs/Base64.cpp | 7 | ||||
-rw-r--r-- | Swiften/StringCodecs/Base64.h | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/Swiften/StringCodecs/Base64.cpp b/Swiften/StringCodecs/Base64.cpp index 6eeaca9..7b5f402 100644 --- a/Swiften/StringCodecs/Base64.cpp +++ b/Swiften/StringCodecs/Base64.cpp @@ -1,38 +1,43 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swiften/StringCodecs/Base64.h> +#include <stddef.h> + +#include <Swiften/Base/ByteArray.h> +#include <Swiften/Base/SafeByteArray.h> + #pragma clang diagnostic ignored "-Wconversion" using namespace Swift; namespace { const char* encodeMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; const unsigned char decodeMap[255] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 255, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255, 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 255, 255, 255, 255, 255 }; template<typename ResultType, typename InputType> ResultType encodeDetail(const InputType& input) { ResultType result; size_t i = 0; diff --git a/Swiften/StringCodecs/Base64.h b/Swiften/StringCodecs/Base64.h index e1be4bc..fde27c0 100644 --- a/Swiften/StringCodecs/Base64.h +++ b/Swiften/StringCodecs/Base64.h @@ -1,24 +1,23 @@ /* * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include <string> -#include <vector> #include <Swiften/Base/API.h> #include <Swiften/Base/ByteArray.h> #include <Swiften/Base/SafeByteArray.h> namespace Swift { class SWIFTEN_API Base64 { public: static std::string encode(const ByteArray& s); static SafeByteArray encode(const SafeByteArray& s); static ByteArray decode(const std::string &s); }; } |