WG21/N0930 X3J16/96-0112 Thomas Plum Four IOstreams recommendations Four IOstreams recommendations are proposed below, interspersed amid the minutes of the IOstreams ad-hoc group. >Date: Thu, 23 May 1996 10:17:21 -0700 >From: clamage@pacific-88.Eng.Sun.COM (Steve Clamage) >Message-Id: <199605231717.KAA14983@taumet.eng.sun.com> >Subject: IOStreams working group recommendations >X-Sun-Charset: ISO-8859-1 > >To: C++ libraries mailing list >Message c++std-lib-4709 > >The following is a paper that will appear in the next mailing. > > Doc No: X3J16/96-0096 > WG21/N0914 > Date: May 23, 1996 > Project: Programming Language C++ > Reply-To: Stephen D. Clamage > stephen.clamage@eng.sun.com > > >IOstreams WG recommendations > > Re: IOstream issues list X3J16/96-0079 WG21/N0897 of May 15, 1996. > > Members of the IOstream library working group met informally on 21-22 May to review >all the outstanding Chapter 27 issues. Recommendations of this group are given below. >Each issue, except for those left open, was assigned to a person who will present a com- >plete recommendation with WP language to the full IOstream working group at Stock- >holm. ... >27-005 not_eof specification (TP) >Recommend: Yields a value which is not equal to eof. The value is unspecified. (The WP >requires that (not_eof(e)==e) if (e!=eof), and forces a change from existing practice. The >recommendation allows existing implementions to remain unchanged.) Revise description of char_traits::not_eof to specify ... Yields a value which is not equal to eof. The value is otherwise unspecified. >27-806 filebuf::seekoff description (TP) >Recommend: Accept in principle the recommendations in the public comment. Eight-bit >streams behave like stdio FILEs. For wide streams, seeks are allowed provided the exter- >nal file meets certain criteria to be worked out by TP. Effects: If the stream is opened as a text file or has state-dependent conversions, the only permissible seeks are with zero offset relative to the beginning or current position of the file. Otherwise ... [copy text from basic_stringstream]. Note: I don't find any special criteria for wide streams; binary streams are seekable just as for narrow streams. The catch is, there are no implied relationships between number of widechars read and seek position; the implementation can (and in many implementations does) use the same widechar<->multibyte encodings on a binary stream as on a text stream. But I'm not sure that this requires any WP wording. >27-811 missing filebuf::sync (TP) >Recommend: For output, perhaps adapt wording from C standard. (Intent is clear.) For >in/out, flush output then really seek to current file position. For input files, >implementation-defined. [Rather than copying C wording, I'm pointing to it; something like this ...] Effects: If pbase() is non-null, the characters between pbase() and pptr() are written to the stream; then the associated file is flushed (as if by calling std::fflush(file) ). >27-910 streampos type (TP) >Recommend: Resolve as in issues list, and add streampos to . I.e.: Add back streampos, as being the pos_type used on streams instantiated on tiny characters. Replace all references to streampos by references to pos_type throughout the iostreams chapter. (When streams are instantiated on char, pos_type == streampos.) Add streampos to .