std::strstreambuf::setbuf (3) - Linux Manuals
std::strstreambuf::setbuf: std::strstreambuf::setbuf
NAME
std::strstreambuf::setbuf - std::strstreambuf::setbuf
Synopsis
protected:
virtual streambuf<char>* setbuf(char* s, std::streamsize n);
If s is a null pointer and n is zero, this function has no effect.
Otherwise, the effect is implementation-defined: some implementations do nothing, while some implementations deallocate the dynamic member array used as the buffer and begin using the user-supplied character array of size n, whose first element is pointed to by s.
This function is protected virtual, it may only be called through pubsetbuf() or from member functions of a user-defined class derived from std::strstreambuf.
Parameters
s - pointer to the first byte in the user-provided buffer
n - the number of bytes in the user-provided buffer
Return value
this
Example
Implementation test to check if setbuf() is supported on a dynamic strstream (output obtained with Sun Studio)
// Run this code
Possible output:
See also
pubsetbuf (public member function of std::basic_streambuf<CharT,Traits>)
setbuf replaces the buffer with user-defined array, if permitted
[virtual]
setbuf attempts to replace the controlled character sequence with an array
[virtual]
setbuf provides user-supplied buffer or turns this filebuf unbuffered
[virtual]