Boost logo

Boost :

From: Paul A. Bristow (boost_at_[hidden])
Date: 2003-06-27 07:27:55


I also have an updated ('C++ 1998 STL standardized') version of James Kanze's
of filtering streambuf and filtering streams derived from his files at
www.gabi-soft.fr re-built for MSVC 7.1, (Could be posted on request).

and his illuminating articles in C++ Report 1998 (attached).

There are also several examples of Inserting (decorating - not sure this term is
an improvement) and Extracting on input, and some tests (though not Boost style
test suite, a possible TODO item).

His examples include:

Output:

prefixing each non-blank line by a timestamp.
translating each char with a mapping table.
expanding tabs.

Input:

translating each char with a mapping table.
removing 'comments' after # (say) upto the end of line.
rebuilding continuation lines.

Sadly I didn't spot much documentation or examples of Daryle's quite complex
code, which looks to have quite a lot in common with this code that Larry Evans
is threatening to use.
(More sadly, I was much impeded in trying to understand much of Larry's work in
progress on account of the bizarre layout - this would be an serious impediment
to acceptance by Boosters - see the Boost coding guidelines?)

However, both the filtering stream process, and the application to several
layout desiderata that various people have been chipping away at, seem important
items for Boost library. I'd like to encourage both of these.

Paul

Paul A Bristow, Prizet Farmhouse, Kendal, Cumbria, LA8 8AB UK
+44 1539 561830 Mobile +44 7714 33 02 04
Mobile mailto:pabristow_at_[hidden]
mailto:pbristow_at_[hidden]

| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]]On Behalf Of Daryle Walker
| Sent: Friday, June 27, 2003 6:40 AM
| To: Boost
| Subject: [boost] Someone wanted filtered/decorated streambufs?
|
|
| For the past few weeks, some posters were talking about streambufs that
| can decorate another stream buffer. I wrote up a general class at
| <http://groups.yahoo.com/group/boost/files/filter_stream.hpp>.
|
| The non-virtual filter functions act as a pass-through (i.e. no change)
| filter/monitor at the moment. We would need to figure out the points
| of customizing before adding the virtual filter functions. For
| instance, "doing_imbue" could have a virtual "do_postonly_imbue" that
| only lets the filter do its own adjusting for locale changes after the
| main stream buffer has already done its adjustments. The "doing_sync"
| method could have a virtual "do_preonly_sync" that is called before the
| main stream buffer's syncing, and the virtual method could return a
| Boolean determining if the main buffer should continue. The other
| "doings" could have pre- and post-actions (no "only," of course).
|
| One difficulty would be if the reading and/or writing overrides need
| to store extra characters. Maybe I could add reserve space in the
| filtering stream buffer....
|
| Daryle
|
| _______________________________________________
| Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
|
|




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