Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-06-05 00:08:01


"David Abrahams" <dave_at_[hidden]> wrote in message
news:upt8fxspr.fsf_at_boost-consulting.com...
> "Jonathan Turkanis" <technews_at_[hidden]> writes:
>
> > "David Abrahams" <dave_at_[hidden]> wrote in message
> > news:ubrk18u0m.fsf_at_boost-consulting.com...
> >> "Jonathan Turkanis" <technews_at_[hidden]> 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


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