mirror of
https://github.com/boostorg/serialization.git
synced 2026-02-21 03:12:16 +00:00
base64 padding
[SVN r25853]
This commit is contained in:
@@ -72,13 +72,19 @@ void basic_text_iprimitive<IStream>::load_binary(
|
||||
);
|
||||
|
||||
char * caddr = static_cast<char *>(address);
|
||||
unsigned int padding = 2 - count % 3;
|
||||
|
||||
// take care that we don't increment anymore than necessary
|
||||
while(--count > 0){
|
||||
*caddr++ = static_cast<char>(*ti_begin);
|
||||
++ti_begin;
|
||||
}
|
||||
*caddr = static_cast<char>(*ti_begin);
|
||||
*caddr++ = static_cast<char>(*ti_begin);
|
||||
|
||||
if(padding > 1)
|
||||
++ti_begin;
|
||||
if(padding > 2)
|
||||
++ti_begin;
|
||||
}
|
||||
|
||||
template<class IStream>
|
||||
|
||||
@@ -52,13 +52,20 @@ void basic_text_oprimitive<OStream>::save_binary(
|
||||
>
|
||||
base64_text;
|
||||
|
||||
boost::archive::iterators::ostream_iterator<CharType> oi(os);
|
||||
std::copy(
|
||||
base64_text(BOOST_MAKE_PFTO_WRAPPER(static_cast<const char *>(address))),
|
||||
base64_text(
|
||||
BOOST_MAKE_PFTO_WRAPPER(static_cast<const char *>(address) + count)
|
||||
),
|
||||
boost::archive::iterators::ostream_iterator<CharType>(os)
|
||||
oi
|
||||
);
|
||||
unsigned int padding = 2 - count % 3;
|
||||
if(padding > 1)
|
||||
*oi = '=';
|
||||
if(padding > 2)
|
||||
*oi = '=';
|
||||
|
||||
}
|
||||
|
||||
template<class OStream>
|
||||
|
||||
@@ -111,8 +111,6 @@ template<class Archive>
|
||||
void basic_xml_oarchive<Archive>::save_override(const version_type & t, int)
|
||||
{
|
||||
int i = t.t; // extra .t is for borland
|
||||
if(0 == i)
|
||||
return;
|
||||
write_attribute(VERSION, i);
|
||||
}
|
||||
template<class Archive>
|
||||
|
||||
Reference in New Issue
Block a user