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 ufm::util {
23 class Base64;
24} // namespace ufm::util
25
26/* ***************************************************************************************
27 * Class/Interface/Struct/Enum
28 */
29
37 /* *************************************************************************************
38 * Variable
39 */
40 public:
41 const uint8 mPiexl[256] = {
42 /* ASCII table */
43 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
44 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
45 64, 64, 64, 62, 64, 64, 64, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64,
46 64, 64, 64, 64, 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
47 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64, 64, 26, 27, 28,
48 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49 49, 50, 51, 64, 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, 64, 64, 64, 64,
51 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
52 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
53 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
54 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
55 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64};
56
57 const char mTable[65] =
58 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
59
60 /* *************************************************************************************
61 * Abstract Method
62 */
63
64 /* *************************************************************************************
65 * Construct Method
66 */
67 public:
73 Base64(void);
74
80 virtual ~Base64(void) override;
81
82 /* *************************************************************************************
83 * Operator Method
84 */
85
86 /* *************************************************************************************
87 * Override Method
88 */
89
90 /* *************************************************************************************
91 * Public Method
92 */
93 public:
105 int encode(const void* src, int srcLen, void* dst, int dstLen);
106
115 int encodeLen(int len);
116
127 int decode(const char* src, void* dst, int dstLen);
128
137 int decodeLen(const char* src);
138
139 /* *************************************************************************************
140 * Protected Method
141 */
142
143 /* *************************************************************************************
144 * Private Method
145 */
146
147 /* *************************************************************************************
148 * Static Variable
149 */
150
151 /* *************************************************************************************
152 * Static Method
153 */
154};
155
156/* ***************************************************************************************
157 * End of file
158 */
159
160#endif /* UTIL_E64A0B4D_6CC3_4D86_9DA5_46D2D7103982 */
物件基底類別
Definition Object.h:63
Base64 編碼/解碼實用類
Definition Base64.h:36
int decode(const char *src, void *dst, int dstLen)
將Base64編碼數據解碼為原始數據
virtual ~Base64(void) override
銷毀Base64對象
int encodeLen(int len)
計算Base64編碼後的長度
int decodeLen(const char *src)
計算Base64解碼後的長度
int encode(const void *src, int srcLen, void *dst, int dstLen)
將數據編碼為Base64格式
Base64(void)
構造一個新的Base64編碼/解碼器
Definition Iterable.h:28