Topic: i/ostreams are no streams, but only clients of the real stream(buf)s


Author: mmauhart@ping.at (Markus Mauhart)
Date: 1995/07/19
Raw View
Dear draft , dear draft writers , dear draft readers :
The trueth expressed in the subject seems to reside at most in dark
corners of subconscious for most of you .

This fact had (besides !@#$ manuals) and will have bad effects in usage
and discussion of c++ streams . Some clearing words in the draft (besides
*this* enlightning posting) should help ... i'd suggest [lib.input.output]
, p.1 . Or even let come [lib.streambuf] before [lib.iostream.*] in c++'s
draftstream . Or even rename [lib.iostream.*] to
[lib.streambuf.client.iostream.*] .

As an example some words of the posting i used as reference :

>  Since there is no longer an iostream class in the WP, how does one
>  portably open a stream for input and output?

Maybe a good question , but for me sounds heavily as a mixing of openable
resource and formatting client . What about opening the streambuf and
creating its "format service center" on demand - typically in some other
function , which sadly enough doesnt wanna know anything about the
excellent work of your specific streambuf ? Am i the only one to do
specific work in function "specific(specialEnvironment*)" , whereas
algorithmes are done in "algorithm(generalArgument&)" .

A much better reference for this unawareness of facts would have been the
often raised question :

> "Now that i wanna start seriously using c++ streams : How to create my own
>  full featured i/ostream-derivation for pipes/sockets/printers/... ?"

The solution for daily work : Create your own enough featured streambuf
derivation , use good old istream or ostream for its formatting , and
especially any other streambuf aware function for further i/o processing .


Back to comp.std.c++ : The words and the organisation of april 2xth draft
in [lib.input.output] not only fail to express the fact i recall in this
postings subject but produce the impression of the opposite ("class
streambuf as an implementation detail of class ios")


Having sputn'd so much i'll just append some demo proposal as a workaround
for you to sgetn ;-)


[PROPOSAL]-----------------------------------------------------------------
insert the following paragraphs between [lib.input.output] "1" and "2" of
the draft released for public comment :

? The standard C representation for stream resources are handles (int) .?
In C++ abstract class streambuf is the client's interface to a wide
variety of "streaming" resources (sometimes called streamable manifolds
;-)