HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Base64.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_Base64.h ( UT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __UT_Base64__
12 #define __UT_Base64__
13 
14 #include "UT_API.h"
15 
16 #include <SYS/SYS_Types.h>
17 
18 class UT_WorkBuffer;
19 class UT_IStream;
20 
22 {
23 public:
24  /// @{
25  /// Encode a stream of binary into base64 encoding. If the input is not
26  /// a multiple of three, padding is added to indicate proper size.
27  static void encode(const UT_WorkBuffer &src, UT_WorkBuffer &dst);
28  static void encode(const uint8 *src, exint src_len, UT_WorkBuffer &dst);
29  /// @}
30 
31  /// @{
32  /// Decode a base64 encoded string into binary. Returns @c false if
33  /// decoding failed (bad input character, or wrong padding). Whitespace
34  /// is ignored on parsing.
35  static bool decode(const UT_WorkBuffer &src, UT_WorkBuffer &dst);
36  static bool decode(const char *src, UT_WorkBuffer &dst);
37  static bool decode(UT_IStream &is, UT_WorkBuffer &dst);
38  /// @}
39 };
40 
41 #endif // __UT_Base64__
int64 exint
Definition: SYS_Types.h:125
#define UT_API
Definition: UT_API.h:14
unsigned char uint8
Definition: SYS_Types.h:36
GLenum GLenum dst
Definition: glcorearb.h:1793
GLenum src
Definition: glcorearb.h:1793