cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : IOstream Library : filebuf : sync
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forum
Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
IOstream Library
manipulators
classes:
· filebuf
· fstream
· ifstream
· ios
· iostream
· ios_base
· istream
· istringstream
· ofstream
· ostream
· ostringstream
· streambuf
· stringbuf
· stringstream
objects:
· cerr
· cin
· clog
· cout
types:
· fpos
· streamoff
· streampos
· streamsize
filebuf
· filebuf::filebuf
· filebuf::~filebuf
member functions:
· filebuf::close
· filebuf::is_open
· filebuf::open
virtual members:
· filebuf::imbue
· filebuf::overflow
· filebuf::pbackfail
· filebuf::seekoff
· filebuf::seekpos
· filebuf::setbuf
· filebuf::showmanyc
· filebuf::sync
· filebuf::uflow
· filebuf::underflow

-

filebuf::sync virtual protected member function
int sync ( );

Synchronize file buffer

Synchronizes the internal character sequences with the file content.

This effectively means that if the internal output sequence (which in this class acts as a memory buffer for buffered streams) contains characters that have not yet been written to the file, these are now written by calling virtual member overflow.

The public member function pubsync of the parent class streambuf calls this virtual member function, which overrides the virtual member streambuf::sync.

Parameters

none

Return Value

In case of success, zero is returned.
Errors are expected to be signaled by any other value, like -1.

Basic template member declaration

( basic_filebuf<charT,traits> )
int sync ( );

See also

streambuf::pubsync Synchronize stream buffer (public member function)

© The C++ Resources Network, 2000-2007 - All rights reserved
Spotted an error? - contact us