|
Boost : |
From: Daniel Mitchell (danmitchell_at_[hidden])
Date: 2006-07-06 13:16:08
On Thursday 06 July 2006 11:17, Robert Ramey wrote:
> typedef
> boost::archive::iterators::insert_linebreaks<
> boost::archive::iterators::base64_from_binary<
> boost::archive::iterators::transform_width<
> const char *,
> 6,
> 8
>
>
> ,72
> ,const char // cwpro8 needs this
>
> base64_text;
>
> Wow - just great. Now just construct an instance of base64_text - and
> we're in business. So I can do:
>
> char * address; // pointer to character buffer
> ...
> boost::archive::iterators::ostream_iterator<char> oi(os);
> std::copy(
> base64_text(address),
> base64_text(
> address + count
> ),
> oi
> );
So the advantage is the ability to construct a base64_text iterator directly
from a char const* without manually constructing each of the underlying
iterator adaptor layers. That's neat, but wouldn't a function
base64_text make_base64_text_iterator( char const* );
work just as well?
D.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk