Buffer class for file streams
Public member functions:
filebuf members: (constructor) Construct object is_open Check if file is open open Open file close Close file members inherited from streambuf: pubimbue Imbue locale getloc Get current locale pubsetbuf Set buffer array pubseekoff Set relative position of internal position pointer pubseekpos Set absolute position of internal position pointer pubsync Synchronize stream in_avail Get number of characters available in input buffer snextc Increase get pointer and return next character sbumpc Get current character and increase get pointer sgetc Get current character sgetn Get some characters sputbackc Put character back sungetc Decrease get pointer sputc Store character at current put position and increase put pointer sputn Write some characters
filebuf members: seekoff Set relative position of internal position pointer [virtual] seekpos Set absolute position of internal position pointer [virtual] underflow Get current character [virtual] pbackfail Put character back [virtual] overflow Put character at current put position [virtual] sync Synchronize file buffer [virtual] setbuf Set buffer [virtual] members inherited from streambuf: eback Get pointer to beginning of input sequence egptr Get pointer to end of input seuqence epptr Get pointer to end of output sequence gbump Increase get pointer gptr Return get pointer pbase Get pointer to beginning of output sequence pbump Increase put pointer pptr Return put pointer setg Set input buffer pointers setp Set output buffer pointers imbue Imbue locale [virtual] showmanyc Get number of characters availbale in input sequence [virtual] uflow Get current character [virtual] xsgetn Get some characters [virtual] xsputn Write some characters [virtual]
The objects instatiated from this class associate an input and an output sequence with a file,
allowing the input and output functionality of streams to be performed on files.
Every object of this class controls both an input and an output sequence, although some sequence may be restricted depending on the openmode used to open the file with member function open.
Once an open file is closed (member close) the filebuf object may be used to open other files.
The state of the filebuf object -wether a file is open or not- may be tested by calling member is_open.
This class overrides some virtual members inherited from streambuf to provide a specific functionality adapted to file manipulation. Plese refer to parent class streambuf for more information on streambuf-derived objects.