Article View: gnu.gcc.help
Article #50685Re: need a class which works as a streambuf and an istream
From: Joe Buck
Date: Mon, 09 Aug 1993 19:30
Date: Mon, 09 Aug 1993 19:30
27 lines
1994 bytes
1994 bytes
ezust@IRO.UMontreal.CA (Alan Ezust) writes: >I was wondering if there is an easy way to get or create a class which >behaves internally as a streambuf (i.e. when you send stuff to it, instead >of storing to disk, ot stores in memory) but can be used as an istream in >functions (using the >> operator, etc)... Double-inheritance seems like >the right direction to go, but there would be many name conflicts.. Such a class already exists; it is called ostrstream. It is part of the standard set of "iostream" classes and the libg++ one looks just like the cfront one. >I am using libg++ 1.39 and g++ 1.40, and I am modifying a huge program >which, after spending a month trying to to recompile under the new >compiler and libraries, was not successful, so I am sticking with this >version (if it ain't broke, don't fix it). Sorry, libg++ 1.39 has "old style" streams and does not include ostrstream. Also, the language accepted by g++ 1.40 vaguely resembles an older version of C++, but differs in many respects. Your code is probably hard to port because g++ 1.40 let you violate the rules all over the place, and the new compiler complains. It's probably worth porting if you want the code to be maintainable. -- Joe Buck jbuck@ohm.EECS.Berkeley.EDU
Technical Details
Message-ID:
<2468l4$npq@agate.berkeley.edu>Path:
arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!darwin.sura.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!forney.eecs.berkeley.edu!jbuckReferences:
<1993Aug9.152344.18739@iro.umontreal.ca>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,5dabe9c65df32f8c X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-08-09 12:45:35 PST Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!darwin.sura.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!forney.eecs.berkeley.edu!jbuck From: jbuck@forney.eecs.berkeley.edu (Joe Buck) Newsgroups: gnu.gcc.help Subject: Re: need a class which works as a streambuf and an istream Date: 9 Aug 1993 19:30:44 GMT Organization: University of California at Berkeley Lines: 27 Message-ID: <2468l4$npq@agate.berkeley.edu> References: <1993Aug9.152344.18739@iro.umontreal.ca> NNTP-Posting-Host: forney.eecs.berkeley.edu