std_fstream.h (xsputn): Don't call _M_destroy_pback...

2003-07-06  Paolo Carlini  <pcarlini@unitus.it>

	* include/std/std_fstream.h (xsputn): Don't call _M_destroy_pback:
	if output is at all possible (!_M_reading), cannot be active.

	* include/std/std_fstream.h: Tweak comments to doxygen style.

From-SVN: r69001
This commit is contained in:
Paolo Carlini 2003-07-06 13:24:43 +02:00 committed by Paolo Carlini
parent fdd9b6ba91
commit 6623b2f26d
2 changed files with 36 additions and 20 deletions

View File

@ -1,3 +1,10 @@
2003-07-06 Paolo Carlini <pcarlini@unitus.it>
* include/std/std_fstream.h (xsputn): Don't call _M_destroy_pback:
if output is at all possible (!_M_reading), cannot be active.
* include/std/std_fstream.h: Tweak comments to doxygen style.
2003-07-06 Paolo Carlini <pcarlini@unitus.it> 2003-07-06 Paolo Carlini <pcarlini@unitus.it>
* include/bits/locale_classes.h: Fully qualify standard * include/bits/locale_classes.h: Fully qualify standard

View File

@ -177,9 +177,13 @@ namespace std
// Cached codecvt facet. // Cached codecvt facet.
const __codecvt_type* _M_codecvt; const __codecvt_type* _M_codecvt;
// Initializes pback buffers, and moves normal buffers to safety. /**
// Assumptions: * @if maint
// _M_in_cur has already been moved back * Initializes pback buffers, and moves normal buffers to safety.
* Assumptions:
* _M_in_cur has already been moved back
* @endif
*/
void void
_M_create_pback() _M_create_pback()
{ {
@ -192,9 +196,13 @@ namespace std
} }
} }
// Deactivates pback buffer contents, and restores normal buffer. /**
// Assumptions: * @if maint
// The pback buffer has only moved forward. * Deactivates pback buffer contents, and restores normal buffer.
* Assumptions:
* The pback buffer has only moved forward.
* @endif
*/
void void
_M_destroy_pback() throw() _M_destroy_pback() throw()
{ {
@ -400,10 +408,7 @@ namespace std
// [documentation is inherited] // [documentation is inherited]
virtual streamsize virtual streamsize
xsputn(const char_type* __s, streamsize __n) xsputn(const char_type* __s, streamsize __n)
{ { return __streambuf_type::xsputn(__s, __n); }
_M_destroy_pback();
return __streambuf_type::xsputn(__s, __n);
}
/** /**
* @if maint * @if maint
@ -413,16 +418,20 @@ namespace std
void void
_M_output_unshift(); _M_output_unshift();
// This function sets the pointers of the internal buffer, both get /**
// and put areas. Typically: * @if maint
// * This function sets the pointers of the internal buffer, both get
// __off == egptr() - eback() upon underflow/uflow ('read' mode); * and put areas. Typically:
// __off == 0 upon overflow ('write' mode); *
// __off == -1 upon open, setbuf, seekoff/pos ('uncommitted' mode). * __off == egptr() - eback() upon underflow/uflow ('read' mode);
// * __off == 0 upon overflow ('write' mode);
// NB: epptr() - pbase() == _M_buf_size - 1, since _M_buf_size * __off == -1 upon open, setbuf, seekoff/pos ('uncommitted' mode).
// reflects the actual allocated memory and the last cell is reserved *
// for the overflow char of a full put area. * NB: epptr() - pbase() == _M_buf_size - 1, since _M_buf_size
* reflects the actual allocated memory and the last cell is reserved
* for the overflow char of a full put area.
* @endif
*/
void void
_M_set_buffer(streamsize __off) _M_set_buffer(streamsize __off)
{ {