diff liboctave/oct-base64.h @ 15252:fa0118cb67d9

move base64 encode and decode functionality to liboctave * oct-base64.h, oct-base64.cc: New files. Extract core base64 encode and decode functionality from data.cc. * liboctave/Makefile.am (INCS): Add octave-base64.h to the list. (LIBOCTAVE_CXX_SOURCES): Add octave-base64.cc to the list. * data.cc: Don't include base64.h. Do include oct-base64.h. (do_base64_encode): Delete. (Fbase64_encode): Call octave_base64_encode, not do_base64_encode. (Fbase64_decode): Declare retval as octave_value, not octave_value_list. Simplify using octave_base64_decode.
author John W. Eaton <jwe@octave.org>
date Wed, 29 Aug 2012 16:43:25 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/liboctave/oct-base64.h	Wed Aug 29 16:43:25 2012 -0400
@@ -0,0 +1,37 @@
+/*
+
+Copyright (C) 2012 John W. Eaton
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+#if !defined (octave_base64_h)
+#define octave_base64_h 1
+
+#include <string>
+
+template<class T> class Array;
+
+extern OCTAVE_API bool
+octave_base64_encode (const char *inc, const size_t inlen, char **out);
+
+extern OCTAVE_API Array<double>
+octave_base64_decode (const std::string& str);
+
+#endif
+