[PATCH] Support stateful encodings in basic_filebuf

Benjamin Kosnik bkoz@redhat.com
Tue Nov 4 05:42:00 GMT 2003


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, and thus
by extension:

>	* 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....)

best,
benjamin



More information about the Libstdc++ mailing list