Boost logo

Boost Users :

Subject: [Boost-users] boost::archive::iterators::base64_from_binary
From: Dmitry Timoshenko (dimentiy2k_at_[hidden])
Date: 2009-04-15 06:10:14


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 list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net