Re: [boost] Re: Interest in library generating streambufs fromobjects

2003-06-12 Thread Larry Evans
Larry Evans wrote:

[snip]
Any comments?  Maybe this method could be used
Yeah.  What happens when ostream destructor is called.
Since this probably calls the streambuf destructor,
and if the streambuf is actually a fwd_streambuf,
and the ~fwd_streambuf resets the ostream.rdbuf,
this just may be a problem :(.
IOW, OOPS.

___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Interest in library generating streambufs fromobjects

2003-06-12 Thread Larry Evans
Larry Evans wrote:
[snip]
The prototype of the "using overflow+sputc" method is in
files/col_io/test_fwd_streambuf.zip.
A more complete marg_ostream example is in
files/col_io/test_marg_ostreambuf.zip.  It
shows how an ostream indentation can be changed
without resorting to a wrapper class like
marg_ostream in col_io/col_io.zip.  It also
shows how to change the indentation with
use of dynamic_cast and call to marg_ostreambuf
member function.  It also shows how the
original status of the ostream can be restored
by simply deleting the result of ostream::rdbuf.
Any comments?  Maybe this method could be used
with Maxim's adaptors?
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Interest in library generating streambufs fromobjects

2003-06-12 Thread Larry Evans
Larry Evans wrote:
[snip]
with buffered input.  After thinking some more, I thought about just
using overflow and sputc to "pipe" the output to the next streambuf.
This greatly simplified the code.  Would something similar work with
[snip]

The prototype of the "using overflow+sputc" method is in
files/col_io/test_fwd_streambuf.zip.
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Interest in library generating streambufs fromobjects

2003-06-12 Thread Larry Evans
Maxim Egorushkin wrote:
[snip]
I posted here a while ago streambuf adapters. There was no any answer. May
be you might find it intresting.
Sorry I overlooked it.

The main idea is simple: to present any linear sequence as
std::basic_streambuf<>.
It sounds like what people, in particular Robert Ramey , wants.

Here are the file.

I had a brief look and it looks promising.  However, I'm wondering
if some of the complexity can be avoided.  I had a hard time figuring
out just how to get marg_ostreambuf in files/col_io/col_io.zip to work
with buffered input.  After thinking some more, I thought about just
using overflow and sputc to "pipe" the output to the next streambuf.
This greatly simplified the code.  Would something similar work with
your code.  In particular, can you create an equivalent to marg_ostream
from files/col_io/col_io.zip by using your, I guess, stream buffer
redirectors?  I'd like to see that.  Maybe  Reece Dunn would also since
he's "interested in indentation facilities."
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] RE: Interest in library generating streambufs fromobjects

2003-06-10 Thread John Torjo


> Thanks for your interest. I have posted the library at
> http://groups.yahoo.com/group/boost/files/streambuf_lib/.
> 
Wow! I have not had too much time, but by the looks of it, it's great!
I'm sure interested in this!

Best,
John


___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] RE: Interest in library generating streambufs fromobjects

2003-06-09 Thread Larry Evans
Larry Evans wrote:
[snip]
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.
Maybe a modification to double_streambuf or bi_directional_streambuf
could be used simlar to pipes in unix.  Another template parameter, e.g.
one named "Xform", would contain the code to do any transformations on 
the characters.  For example, if Xform=marg_buffer_put, then this would
create marg_ostreambuf.  This could be the input stream to another
such buffer, thus forming the next link in the pipe of streambufs.

Does this make sense?

___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] RE: Interest in library generating streambufs fromobjects

2003-06-09 Thread Larry Evans
Jonathan D. Turkanis wrote:
Thanks for your interest. I have posted the library at
http://groups.yahoo.com/group/boost/files/streambuf_lib/.
[snip]
Robert Ramey wrote:

[snip]
out of streambuf and a streambuf built that can use any "adaptable
sequence".

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.

___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost