I/O manipulators | ||||
Print functions(C++23) | ||||
C-style I/O | ||||
Buffers | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++20) | ||||
Streams | ||||
Abstractions | ||||
File I/O | ||||
String I/O | ||||
Array I/O | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
Synchronized Output | ||||
(C++20) | ||||
Types | ||||
Error category interface | ||||
(C++11) | ||||
(C++11) |
Public member functions | ||||
(C++11) | ||||
(C++11) | ||||
(C++26) | ||||
Protected member functions | ||||
basic_filebuf::sync | ||||
Non-member functions | ||||
(C++11) |
protected: virtualint sync() | ||
If a put area exists (e.g. the file was opened for writing), callsoverflow() to write all pending output to the file, then flushes the file as if by callingstd::fflush.
If a get area exists (e.g. the file was opened for reading), the effect is implementation-defined. Typical implementation may empty out the get area and move the current file position back by the corresponding number of bytes.
Contents |
(none)
0 in case of success,-1 in case of failure.
sync()
or its equivalent is implicitly called for output streams byclose()
,seekoff()
, andseekpos()
and explicitly called bystd::basic_streambuf::pubsync()
This section is incomplete Reason: no example |
invokessync() (public member function of std::basic_streambuf<CharT,Traits> )[edit] | |
synchronizes an output stream with the actual file (function)[edit] |