The Microsoft Input/Output Stream Classes (iostream.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
streambuf::overflow
◄streambuf► ◄Up► ◄Contents► ◄Index► ◄Back►
──The Microsoft iostream Classes────────────────────────────────────────────
virtual int overflow( int nCh = EOF ) = 0;
Parameter Description
<nCh> EOF or the character to output.
Remarks
The virtual overflow function, together with the sync and underflow
functions, defines the characteristics of the streambuf-derived class.
Each derived class might implement overflow differently, but the
interface with the calling stream class is the same.
The overflow function is most frequently called by public streambuf
functions like sputc and sputn when they sense that the put area is
full, but other classes, including the stream classes, can call overflow
anytime.
The function "consumes" the characters in the put area between the pbase
and pptr pointers and then reinitializes the put area. The overflow
function must also consume <nCh> (if <nCh> is not EOF), or it might
choose to put that character in the new put area so that it will be
consumed on the next call.
The definition of "consume" varies among derived classes. The filebuf
class, for example, writes its characters to a file. The strsteambuf
class, on the other hand, keeps them in its buffer and (if the buffer is
designated as dynamic) expands the buffer in response to a call to
overflow. This expansion is achieved by freeing the old buffer and
replacing it with a new, larger one. The pointers are adjusted as
necessary.
Default Implementation
No default implementation. Derived classes must define this function.
Return Value
EOF to indicate an error.
See Also
◄streambuf::pbase►, ◄streambuf::pptr►, ◄streambuf::setp►,
◄streambuf::sync►, ◄streambuf::underflow►
-♦-