Mercurial > octave
annotate 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 |
rev | line source |
---|---|
15252
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 /* |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
3 Copyright (C) 2012 John W. Eaton |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 This file is part of Octave. |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 option) any later version. |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 for more details. |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 */ |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
23 #if !defined (octave_base64_h) |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
24 #define octave_base64_h 1 |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 #include <string> |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 template<class T> class Array; |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 extern OCTAVE_API bool |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 octave_base64_encode (const char *inc, const size_t inlen, char **out); |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 extern OCTAVE_API Array<double> |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 octave_base64_decode (const std::string& str); |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 #endif |
fa0118cb67d9
move base64 encode and decode functionality to liboctave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 |