TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: David Nugent
from: Greg Newton
date: 1995-04-17 14:26:20
subject: C++ Streams as Filters?

G'day David,

Replying to a message of David Nugent to Greg Newton:

 >> I've got to admit this bit went by me (this time... hopefully
 >> the light bulb will come on soon).

 DN> What I'm saying is that an ostream_withassign is a neat, multipurpose
 DN> generic ostream which can use any sort of streambuf that you throw at
 DN> it. It has all of the characteristics of an ostream, except that -
 DN> unlike an ostream - it isn't an abstract base class, so you can
 DN> actually create an instance of one. Just assign any sort of streambuf
 DN> you might derive and you don't have to touch that side of the class
 DN> hierachy, only the streambuf or whatever type of streambuf you happen
 DN> to be working on.

 DN> streambuf provides you byte-level access to the stream, direct access
 DN> to the buffers themselves - everything you want. Don't worry about
 DN> fiddling with ostreams, since that's the wrong place to do what you
 DN> want to do.

I think I get it a bit better this time.

I derive a class from streambuf to do any modifications on the stream, then
use ostream_withassign to get to use all the standard output methods on my
mangled stream.


Cheers,
Greg |;^)

--- FleetStreet 1.02 #429
* Origin: (3:639/666)
SEEN-BY: 50/99 620/243 623/630 632/348 998 633/371 634/384 635/301 502 503
SEEN-BY: 635/541 544 636/100 639/100 666 711/401 409 410 430 510 807 808 809
SEEN-BY: 711/932 934 712/515 713/888 714/906 800/1 7877/2809
@PATH: 639/666 100 635/503 50/99 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.