Public Member Functions |
template<class _II , class _OI , class _State , class _Endline > |
_II | put (_II _First, _II _Last, _OI _To, _State &_St, _Endline _Endl) const |
template<class _II , class _OI , class _State > |
_II | get (_II _First, _II _Last, _OI _To, _State &_St) const |
template<class _E = char, class _Tr = std::char_traits<_E>>
class base64< _E, _Tr >
Definition at line 42 of file base64.h.
template<class _E = char, class _Tr = std::char_traits<_E>>
template<class _II , class _OI , class _State , class _Endline >
_II base64< _E, _Tr >::put |
( |
_II |
_First, |
|
|
_II |
_Last, |
|
|
_OI |
_To, |
|
|
_State & |
_St, |
|
|
_Endline |
_Endl |
|
) |
| const |
|
inline |
Definition at line 155 of file base64.h.
Referenced by XmlRpc::XmlRpcValue::binaryToXml(), XmlRpc::XmlRpcClient::generateHeader(), and XmlRpc::XmlRpcValue::write().
{
three2four _3to4;
int line_octets = 0;
while(_First != _Last)
{
_3to4.zero();
_3to4.set_0(*_First);
_First++;
if(_First == _Last)
{
*_To = _Tr::to_char_type(
_base64Chars[_3to4.b64_0()]); ++_To;
*_To = _Tr::to_char_type(
_base64Chars[_3to4.b64_1()]); ++_To;
*_To = _Tr::to_char_type('='); ++_To;
*_To = _Tr::to_char_type('='); ++_To;
goto __end;
}
_3to4.set_1(*_First);
_First++;
if(_First == _Last)
{
*_To = _Tr::to_char_type(
_base64Chars[_3to4.b64_0()]); ++_To;
*_To = _Tr::to_char_type(
_base64Chars[_3to4.b64_1()]); ++_To;
*_To = _Tr::to_char_type(
_base64Chars[_3to4.b64_2()]); ++_To;
*_To = _Tr::to_char_type('='); ++_To;
goto __end;
}
_3to4.set_2(*_First);
_First++;
*_To = _Tr::to_char_type(
_base64Chars[_3to4.b64_0()]); ++_To;
*_To = _Tr::to_char_type(
_base64Chars[_3to4.b64_1()]); ++_To;
*_To = _Tr::to_char_type(
_base64Chars[_3to4.b64_2()]); ++_To;
*_To = _Tr::to_char_type(
_base64Chars[_3to4.b64_3()]); ++_To;
if(line_octets == 17)
{
*_To = '\n'; ++_To;
line_octets = 0;
}
else
++line_octets;
}
__end: ;
return (_First);
}