Quantcast

boost::archive::iterators::base64_from_binary

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

boost::archive::iterators::base64_from_binary

Dmitry Timoshenko
Hello.
 
I encountered a problem when tried to use base64_from_binary and
binary_from_base64.

* **typedef* vector<unsigned char> RawData_t;

**

*typedef* base64_from_binary<transform_width<RawData_t::const_iterator,
6, 8> > to_base64_transformer;

**

*typedef* transform_width<binary_from_base64<RawData_t::const_iterator>,
8, 6 > to_binary_transformer;

RawData_t unicomm::files::base64encode(*const* RawData_t& src)

{

*return* RawData_t(to_base64_transformer(src.begin()),
to_base64_transformer(src.end()));

}

The problem is in that source sequence should be multiple of 3. When I
try to use sequence with different size
I get assertion failure in std::vector class which tells: iterator is
not dereferencable.
 
It seems those dataflow iterators try to look for data after the
input sequence end().
 
The problem is already discussed here:
http://lists.boost.org/boost-users/2008/08/39790.php
 
But, there is (above) no any valuable information about the problem.
Is it bug or feature?
 
How can I resove the problem?
 
It is an abiltity to complete the input collection to make it multiple
of 3 and
on other side remove that dummy information added before.
But, it is wanted that it would be more correctly resolved.
 
Did anybody have any solution?
 
Thank you.
 

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: boost::archive::iterators::base64_from_binary

Robert Ramey
Dmitry Timoshenko wrote:
can I resove the problem?
>
> It is an abiltity to complete the input collection to make it multiple
> of 3 and
> on other side remove that dummy information added before.

I think this is the only real solution to this problem.

Robert Ramey

> But, it is wanted that it would be more correctly resolved.
>
> Did anybody have any solution?
>
> Thank you.



_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Loading...