
"David Abrahams" <dave@boost-consulting.com> wrote in message news:upt8fxspr.fsf@boost-consulting.com...
"Jonathan Turkanis" <technews@kangaroologic.com> writes:
"David Abrahams" <dave@boost-consulting.com> wrote in message news:ubrk18u0m.fsf@boost-consulting.com...
"Jonathan Turkanis" <technews@kangaroologic.com> writes:
The caveat is that seeking with respect to stream positions -- i.e. values of type traits_type::pos_type rather than traits_type::off_type -- only works as expected for positions which are equivalent to integral offsets.
You lost me here. What positions aren't?
positions that record an offset and a code conversion state.
Oh. Yeah, I know nothing about that stuff.
You're better off that way -- trust me ;-) <snip>
The offsetbuf could be defined like this (assuming a narrow
stream,
for simplicity):
class offsetbuf : public streambuf_facade<offset_filter> { public: offsetbuf(std::streambuf& sb, std::streamoff first, std::streamoff last) { set_next(sb); open(offset_filter(first, last)); } };
Here offset_filter is the filter I described before.
If you say so.
Well, I realize I wrote a bunch of stuff without explaning it, and the documentation is not even available, so I shouldn't expect it to make any sense. I guess my point was that it can be done with a few lines of code.
Anyway, the library would be useful to me if it made that possible.
Good. I think I'll add it as an example application, or maybe as part of the core library. Jonathan