Re: [boost] Re: Interest in library generating streambufs fromobjects
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
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
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
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
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
Re: [boost] RE: Interest in library generating streambufs fromobjects
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