26 #if defined (HAVE_CONFIG_H)
47 if (outlen == 0 && inlen != 0)
48 (*current_liboctave_error_handler)
49 (
"base64_encode: input array too large");
52 (
"base64_encode: memory allocation error");
66 std::ptrdiff_t outlen;
70 reinterpret_cast<char **
> (&out),
74 (*current_liboctave_error_handler)
75 (
"base64_decode: input was not valid base64");
78 (*current_liboctave_error_handler)
79 (
"base64_decode: memory allocation error");
81 if ((outlen % (
sizeof (
double) /
sizeof (
char))) != 0)
84 (*current_liboctave_error_handler)
85 (
"base64_decode: incorrect input size");
104 std::ptrdiff_t outlen;
111 (*current_liboctave_error_handler)
112 (
"base64_decode: input was not valid base64");
115 (*current_liboctave_error_handler)
116 (
"base64_decode: memory allocation error");
119 std::copy (out, out + outlen, retval.
fortran_vec ());
125 OCTAVE_END_NAMESPACE(
octave)
ptrdiff_t octave_base64_encode_alloc_wrapper(const char *in, ptrdiff_t inlen, char **out)
bool octave_base64_decode_alloc_wrapper(const char *in, ptrdiff_t inlen, char **out, ptrdiff_t *outlen)
T * fortran_vec()
Size of the specified dimension.
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
Vector representing the dimensions (size) of an Array.
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
Array< double > base64_decode(const std::string &str)
bool base64_encode(const char *inc, const std::size_t inlen, char **out)
intNDArray< octave_uint8 > base64_decode_bytes(const std::string &str)