mFrame
載入中...
搜尋中...
無符合項目
Base64.h
1
7#ifndef UTIL_E64A0B4D_6CC3_4D86_9DA5_46D2D7103982
8#define UTIL_E64A0B4D_6CC3_4D86_9DA5_46D2D7103982
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15
16//----------------------------------------------------------------------------------------
17#include "./../lang/Object.h"
18
19/* ***************************************************************************************
20 * Namespace
21 */
22namespace mframe::util {
23 class Base64;
24} // namespace mframe::util
25
26/* ***************************************************************************************
27 * Class/Interface/Struct/Enum
28 */
30 /* *************************************************************************************
31 * Variable
32 */
33 public:
34 const uint8 mPiexl[256] = {
35 /* ASCII table */
36 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
37 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
38 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63,
39 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64,
40 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
41 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64,
42 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
43 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64,
44 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
45 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
46 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
47 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
48 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
49 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
50 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
51 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64};
52
53 const char mTable[65] =
54 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
55
56 /* *************************************************************************************
57 * Abstract Method
58 */
59
60 /* *************************************************************************************
61 * Construct Method
62 */
63 public:
68 Base64(void);
69
74 virtual ~Base64(void) override;
75
76 /* *************************************************************************************
77 * Operator Method
78 */
79
80 /* *************************************************************************************
81 * Public Method <Override>
82 */
83
84 /* *************************************************************************************
85 * Public Method
86 */
87 public:
97 int encode(const void* src, int srcLen, void* dst, int dstLen);
98
105 int encodeLen(int len);
106
115 int decode(const char* src, void* dst, int dstLen);
116
123 int decodeLen(const char* src);
124
125 /* *************************************************************************************
126 * Protected Method
127 */
128
129 /* *************************************************************************************
130 * Private Method
131 */
132
133 /* *************************************************************************************
134 * Static Variable
135 */
136
137 /* *************************************************************************************
138 * Static Method
139 */
140};
141
142/* ***************************************************************************************
143 * End of file
144 */
145
146#endif /* UTIL_E64A0B4D_6CC3_4D86_9DA5_46D2D7103982 */
Definition Object.h:34
Definition Base64.h:29
int decodeLen(const char *src)
int decode(const char *src, void *dst, int dstLen)
virtual ~Base64(void) override
Destroy the Base64 object.
int encode(const void *src, int srcLen, void *dst, int dstLen)
Base64(void)
Construct a new Base64 object.
int encodeLen(int len)
Definition Array.h:22