39 size_t outlen = base64_encode_alloc (inc, inlen, out);
43 if (outlen == 0 && inlen != 0)
44 (*current_liboctave_error_handler)
45 (
"base64_encode: input array too large");
48 (
"base64_encode: memory allocation error");
61 const char *inc = &(str[0]);
66 bool ok = base64_decode_alloc (inc, str.length (), &out, &outlen);
69 (*current_liboctave_error_handler)
70 (
"base64_decode: input was not valid base64");
72 (*current_liboctave_error_handler)
73 (
"base64_decode: memory allocation error");
76 if ((outlen % (
sizeof (
double) /
sizeof (
char))) != 0)
79 (*current_liboctave_error_handler)
80 (
"base64_decode: incorrect input size");
86 double *dout =
reinterpret_cast<double*
> (out);
87 std::copy (dout, dout + len, retval.
fortran_vec ());
Array< double > octave_base64_decode(const std::string &str)
liboctave_error_handler current_liboctave_error_handler
void resize(const dim_vector &dv, const T &rfv)
Handles the reference counting for all the derived classes.
bool octave_base64_encode(const char *inc, const size_t inlen, char **out)
const T * fortran_vec(void) const