Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
Miscellaneous
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::setbuf

virtual protected member function
streambuf* setbuf ( char* s, streamsize n);

Set buffer

This member is called to set a new memory buffer for the streambuf object. If both parameters are zero, and no input/output operation has yet taken place on this stream, the stream becomes unbuffered.

The inherited public member function pubsetbuf calls this overriden protected member function to perform this action.

Parameters

s
Pointer to an array of n characters already allocated in memory.
n
Length in characters of the buffer pointed by s.
This is an integer value of type streamsize.

Return Value

The function returns the pointer this.

Basic template member declaration

( basic_filebuf<charT,traits> )
1
2
typedef charT char_type;
basic_streambuf* setbuf ( char_type* s, streamsize n );


See also