protected: virtual int sync();
Synchronizes the controlled character sequence (the buffers) with the associated character sequence.
sync() of the most derived class.
2) The base class version of this function has no effect. The derived classes may override this function to allow synchronizing the underlying device with the buffers.
For output streams, this typically results in writing the contents of the put area into the associated sequence, i.e. flushing of the output buffer. For input streams, this typically empties the get area and forces a re-read from the associated sequence to pick up recent changes. The default behavior (found, for example, in
std::basic_stringbuf), is to do nothing.
1) The return value of
0 on success,
-1 otherwise. The base class version returns
| synchronizes with the underlying storage device
(public member function of
| writes characters to the associated file from the put area
(virtual protected member function of
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.