This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: memort stream
- To: Phil Edwards <pedwards at disaster dot jaj dot com>,Emre Turkay <emre dot turkay at bilten dot metu dot edu dot tr>,STDC++ <libstdc++ at sources dot redhat dot com>
- Subject: Re: memort stream
- From: Levente Farkas <lfarkas at mindmaker dot hu>
- Date: Thu, 04 Oct 2001 19:33:11 +0200
- Organization: Mindmaker Ltd.
- References: <1002110794.1255.23.camel@java> <20011004131945.B306@disaster.jaj.com>
- Reply-To: lfarkas at mindmaker dot hu
Phil Edwards wrote:
>
> On Wed, Oct 03, 2001 at 03:06:34PM +0300, Emre Turkay wrote:
> > Is there a memory only stream in C++ standards or in libstdc++. Just
> > like fstream but stored in the memory instead of a file ? I don't mean
> > strstream.
>
> That's like asking, "how do I turn a car without using the steering wheel?"
> :-) The strstream classes have been replaced by stringstreams, which do
> the memory handling for you; they are based on std::string rather than
> on char*. Look for the <sstream> header.
not exactly:-( suppose I'd like to read a binary file's content into
the memory once (to save file i/o operation in order to make it faster)
than a factory create object which can initialize itself from the
binary stream. so I'd like to give the factory a stream which has
the content of the binary file. currently iy's not solvable with
stringstream (but strstream), since istringstream.rdbuf()->pubsetbuf(..)
do nothing:-( so what is the solution?
-- Levente "Si vis pacem para bellum!"