This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Support stateful encodings in basic_filebuf
- From: Nathan Myers <ncm at cantrip dot org>
- To: libstdc++ at gcc dot gnu dot org
- Date: Tue, 4 Nov 2003 06:59:41 -0800
- Subject: Re: [PATCH] Support stateful encodings in basic_filebuf
- References: <07D05A69A3D0C14FAEA60C3ACE8E5564028D0E5F@mail.ru.is> <20031103234141.5fff8799.bkoz@redhat.com>
On Mon, Nov 03, 2003 at 11:41:41PM -0600, Benjamin Kosnik wrote:
>
> 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
> > again.
>
> This is the only part of the patch that I'm a bit uneasy about...
Those bits are necessary to meet the requirements, on stateful
encodings, that we inherit from C: all sequences must begin and end
in the ground state. Users have no other way to establish the end
of sequence state, even assuming they know the encoding is stateful.
Without those bits, there would be little point in adding any support
for writing stateful encodings.
Nathan Myers
ncm-nospam@cantrip.org