#include <fstream.h>
The filebuf class is a derived class of streambuf that is specialized for buffered disk file I/O. The buffering is managed entirely within the Microsoft iostream Class Library. filebuf member functions call the run-time low-level I/O routines (the functions declared in IO.H) such as _sopen, _read, and _write.
The file stream classes, ofstream, ifstream, and fstream, use filebuf member functions to fetch and store characters. Some of these member functions are virtual functions of the streambuf class.
The reserve area, put area, and get area are introduced in the streambuf class description. The put area and the get area are always the same for filebuf objects. Also, the get pointer and put pointers are tied; when one moves, so does the other.
Construction/Destruction — Public Members
Constructs a filebuf object.
Destroys a filebuf object.
Operations — Public Members
Opens a file and attaches it to the filebuf object.
Flushes any waiting output and closes the attached file.
Sets the file’s mode to binary or text.
Attaches the filebuf object to an open file.
Status/Information — Public Members
Returns the stream’s file descriptor.
Tests whether the file is open.
See Also ifstream, ofstream, streambuf, strstreambuf, stdiobuf