[PATCH] Support stateful encodings in basic_filebuf

Nathan Myers ncm@cantrip.org
Tue Nov 4 14:59:00 GMT 2003


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



More information about the Libstdc++ mailing list