Article View: comp.std.c++
Article #2918Re: Flush and ostrstreams
From: Steve Clamage
Date: Fri, 08 Dec 1995 16:26
Date: Fri, 08 Dec 1995 16:26
30 lines
1778 bytes
1778 bytes
In article omd@lll-winken.llnl.gov, Stan Erickson <serickson@llnl.gov> writes: > >Does flush move the buffer pointer back to the start point on an >ostrstream? Or is it non-functional? High-level view: The purpose of the ostream flush() function is to send any buffered output characters to the output device. In the case of a strstream, the internal buffer IS the output device, so there can never be anything for flush() to do. That is, just as flushing an ofstream doesn't rewind the external file, flushing an ostrstream doesn't rewind it either. Lower-level view: With traditional iostreams, flush() is a non-virtual member of ostream which is defined to call the virtual sync() function in the streambuf. The sync() function for a strstream has nothing to do, as noted above. The version of iostreams in the draft standard involves more classes and some internal name changes, but the organization is substantially the same. --- Steve Clamage, stephen.clamage@eng.sun.com [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<4a9orv$t1c@engnews1.eng.sun.com>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageReferences:
<4a7h97$omd@lll-winken.llnl.gov>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: clamage@Eng.sun.com (Steve Clamage) Newsgroups: comp.std.c++ Subject: Re: Flush and ostrstreams Date: 8 Dec 1995 16:26:13 GMT Organization: Sun Microsystems Inc. Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <4a9orv$t1c@engnews1.eng.sun.com> References: <4a7h97$omd@lll-winken.llnl.gov> Reply-To: clamage@Eng NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text X-Nntp-Posting-Host: taumet.eng.sun.com Content-Length: 988 X-Lines: 26 Originator: clamage@taumet