streambuf::overflow | virtual protected member function |
int overflow ( int c = EOF ); |
Write character in the case of overflow
For the purpose of the streambuf class, overflows happen when a new character is to be written at the put pointer pptr position, but this has reached the end pointer epptr, indicating that apparently no room is currently available at the internal output array.
This function is expected either to modify the pbase, pptr and epptr pointers that define the internal output array in such a way that room is made available for more characters, or otherwise fail.
The specific behavior depends on each derived class, but it normally attempts to write some of the characters to the controlled output sequence to make room for more characters in the internal output array. Its default behavior in streambuf is to do nothing and return EOF (or traits::eof() for other traits).
This protected member function is automatically called by sputc and sputn member functions when overflows happen.
Parameters
- c
- Character to be written.
Return Value
A value different than EOF (or traits::eof() for other traits) signals success.If the function fails, either EOF (or traits::eof() for other traits) is returned or an exception is thrown.
Basic template member declaration
( basic_streambuf<charT,traits> )
typedef traits::int_type int_type;
int_type overflow ( int_type c = traits::eof() );
|
See also.
streambuf::sputc | Store character at current put position and increase put pointer (public member function) |
streambuf::sputn | Write a sequence of characters (public member function) |