This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: memort stream


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!"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]