1 #ifndef LIBJSON_GUARD_BASE64_H
2 #define LIBJSON_GUARD_BASE64_H
5 #if defined(JSON_BINARY) || defined(JSON_EXPOSE_BASE64) //if this is not needed, don't waste space compiling it
7 #include "../Dependencies/libbase64++/libbase64++.h"
11 inline static json_string json_encode64(
const unsigned char * binary,
size_t bytes) json_nothrow json_cold;
12 inline static std::string json_decode64(
const json_string & encoded) json_nothrow json_cold;
17 json_string JSONBase64::json_encode64(
const unsigned char * binary,
size_t bytes) json_nothrow {
18 #if defined JSON_DEBUG || defined JSON_SAFE
19 return libbase64::encode<json_string, json_char, json_uchar, true>(binary, bytes);
21 return libbase64::encode<json_string, json_char, json_uchar, false>(binary, bytes);
25 std::string JSONBase64::json_decode64(
const json_string & encoded) json_nothrow {
26 #if defined JSON_DEBUG || defined JSON_SAFE
27 return libbase64::decode<json_string, json_char, json_uchar, true>(encoded);
29 return libbase64::decode<json_string, json_char, json_uchar, false>(encoded);