This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Support stateful encodings in basic_filebuf
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Pétur Runólfsson <peturr02 at ru dot is>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 3 Nov 2003 23:41:41 -0600
- Subject: Re: [PATCH] Support stateful encodings in basic_filebuf
- Organization: Red Hat / Chicago
- References: <07D05A69A3D0C14FAEA60C3ACE8E5564028D0E5F@mail.ru.is>
Nice work. Two small comments:
>1) Call codecvt::unshift() from close(), seekoff and seekpos iff
> _M_writing is true. Note that this is not what the standard says,
> but it has the benefit that the written file can actually be read
This is the only part of the patch that I'm a bit uneasy about, and thus
> * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc,
> * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc:
> Check that sync does *not* set _M_writing to false.
I believe, however, that this still leaves ostream::flush with behavior
that is within the expected constraints.
If possible, we really need written documentation for this kind
functionality at some point (the same can be said about other large
parts of the library, however....)