live
Base64.hh
Go to the documentation of this file.
1/**********
2This library is free software; you can redistribute it and/or modify it under
3the terms of the GNU Lesser General Public License as published by the
4Free Software Foundation; either version 3 of the License, or (at your
5option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6
7This library is distributed in the hope that it will be useful, but WITHOUT
8ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10more details.
11
12You should have received a copy of the GNU Lesser General Public License
13along with this library; if not, write to the Free Software Foundation, Inc.,
1451 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15**********/
16// "liveMedia"
17// Copyright (c) 1996-2024 Live Networks, Inc. All rights reserved.
18// Base64 encoding and decoding
19// C++ header
20
21#ifndef _BASE64_HH
22#define _BASE64_HH
23
24#ifndef _BOOLEAN_HH
25#include "Boolean.hh"
26#endif
27
28unsigned char* base64Decode(char const* in, unsigned& resultSize,
29 Boolean trimTrailingZeros = True);
30 // returns a newly allocated array - of size "resultSize" - that
31 // the caller is responsible for delete[]ing.
32
33unsigned char* base64Decode(char const* in, unsigned inSize,
34 unsigned& resultSize,
35 Boolean trimTrailingZeros = True);
36 // As above, but includes the size of the input string (i.e., the number of bytes to decode) as a parameter.
37 // This saves an extra call to "strlen()" if we already know the length of the input string.
38
39char* base64Encode(char const* orig, unsigned origLength);
40 // returns a 0-terminated string that
41 // the caller is responsible for delete[]ing.
42
43#endif
unsigned char * base64Decode(char const *in, unsigned &resultSize, Boolean trimTrailingZeros=True)
char * base64Encode(char const *orig, unsigned origLength)
const Boolean True
Definition: Boolean.hh:31
unsigned char Boolean
Definition: Boolean.hh:25