Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2003-06-09 13:28:31


In the course of my work I had occasion to make a small family
of iterator adaptors for escaping/unescaping ascii text, and things
like that. I made the constuction interface so it could use
another iterator adaptor as a "source" thereby permiting me
to compose iterators in any sequence (sort of like unix pipes).
 If there is any interest I will post this.

Subsequently, I had the need to output unicode as UTF-8 which
is char based rather than wchar_t based. I used the code
in the vault by Ron Garcia. This implemented code_cvt facet
to do the transformation.

It was irksome to me that that the interface for code_cvt facet
was not mapable to my iterator adaptor set - or is it. Now that
I have invest the effort to understand stream/streambuf/facet/local/char vs wchar_t/
charsets/etc. I wonder if one can't make a code_cvt facet
that would be constructed with an arbitray iterator adaptor.

That's what I'm getting at.

If that's not clear - I'm not surprised. I had to invest a lot more
effort in the steam/streambuf stuff than I had orginally anticipated.

Robert Ramey

>Larry Evans <jcampbell3_at_[hidden]> wrote:
>Jonathan D. Turkanis wrote:
>> Thanks for your interest. I have posted the library at
>> http://groups.yahoo.com/group/boost/files/streambuf_lib/.
>>
[snip]
>>>out of streambuf and a streambuf built that can use any "adaptable
>>
>> This is good idea! I had thought about composing streambufs to create new
>> streambufs, and indeed this seems fairly straightforward using my approach
>> (perhaps the most difficult part is selecting suitable names for the
>> composition operations -- how about 'operator+' ?)
>>

>I hadn't thought of the "adaptable sequence" idea, but the "composition
>of streambufs" idea sounds similar to the marg_ostreambuf in
>files/col_io. The marg_ostreambuf::CTOR takes a streambuf and its
>member functions forward to that after doing some processing via the
>marg_buffer_put superclass. Maybe marg_buffer_put is a "sort-of"
>"adaptable sequence". Anyway, it might give you some ideas.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk