10 #if !defined(__BASE64_H_INCLUDED__)
11 #define __BASE64_H_INCLUDED__ 1
20 int _base64Chars[]= {
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
21 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z',
22 '0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
26 #define _0000_0011 0x03
27 #define _1111_1100 0xFC
28 #define _1111_0000 0xF0
29 #define _0011_0000 0x30
30 #define _0011_1100 0x3C
31 #define _0000_1111 0x0F
32 #define _1100_0000 0xC0
33 #define _0011_1111 0x3F
35 #define _EQUAL_CHAR (-1)
36 #define _UNKNOWN_CHAR (-2)
38 #define _IOS_FAILBIT std::ios_base::failbit
39 #define _IOS_EOFBIT std::ios_base::eofbit
40 #define _IOS_BADBIT std::ios_base::badbit
41 #define _IOS_GOODBIT std::ios_base::goodbit
44 template<
class _E =
char,
class _Tr = std::
char_traits<_E> >
62 *_To = _Tr::to_char_type(
'\r'); ++_To;
63 *_To = _Tr::to_char_type(
'\n'); ++_To;
74 *_To = _Tr::to_char_type(
'\r'); ++_To;
75 *_To = _Tr::to_char_type(
'\n'); ++_To;
76 *_To = _Tr::to_char_type(
' '); ++_To;
157 template<
class _II,
class _OI,
class _State,
class _Endline>
158 _II
put(_II _First, _II _Last, _OI _To, _State&, _Endline)
const
163 while(_First != _Last)
167 _3to4.
set_0(*_First);
174 *_To = _Tr::to_char_type(
'='); ++_To;
175 *_To = _Tr::to_char_type(
'='); ++_To;
179 _3to4.
set_1(*_First);
187 *_To = _Tr::to_char_type(
'='); ++_To;
191 _3to4.
set_2(*_First);
199 if(line_octets == 17)
216 template<
class _II,
class _OI,
class _State>
217 _II
get(_II _First, _II _Last, _OI _To, _State& _St)
const
222 while(_First != _Last)
232 if(++_First == _Last)
249 while(++_First != _Last)
253 if(_First == _Last) {
269 while(++_First != _Last)
273 if(_First == _Last) {
285 if(++_First == _Last)
310 while(++_First != _Last)
314 if(_First == _Last) {
371 if(_Ch == _Tr::to_int_type(
'='))