protected virtual member function
<fstream>
int_type overflow (int_type c = traits_type::eof());
Put character on overflow
Writes the contents of the intermediate output buffer to the associated file, followed by c (unless c is traits_type::eof).
The function uses codecvt::out to convert the characters out with the proper facet. It then updates the pointers that define the intermediate output buffer (pptr, epptr and pbase) in such a way that the characters written to the file are not part of it, and -possibly- writing positions are made available at the put pointer (pptr).
If the function cannot write the characters, it returns the end-of-file value (traits_type::eof()
) to signal failure.
This function is called by public member functions of its base class such as sputc to put a character when there are no writing positions available at the put pointer (pptr).
This member function overrides the inherited virtual member basic_streambuf::overflow.
Parameters
- c
- Character to be put.
If this is the end-of-file value (traits_type::eof()
), no character is put, but the other effects of calling this function are attempted.
Member type int_type is an integral type able to represent any character value or the special end-of-file value.
Return Value
In case of success, the character put is returned, converted to a value of type int_type using member traits_type::to_int_type.
Otherwise, it returns the end-of-file value (traits_type::eof()
) either if called with this value as argument c or to signal a failure (some implementations may throw an exception instead).
Member type int_type is an integral type able to represent any character value or the special end-of-file value.
Data races
Modifies the basic_filebuf object.
Concurrent access to the same file stream buffer object may introduce data races.
Exception safety
Basic guarantee: if an exception is thrown, the file stream buffer is in a valid state.