cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : IOstream Library : stringbuf : setbuf
- -
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
stringbuf
· stringbuf::stringbuf
public members:
· stringbuf::str
virtual members:
· stringbuf::overflow
· stringbuf::pbackfail
· stringbuf::seekoff
· stringbuf::seekpos
· stringbuf::setbuf
· stringbuf::underflow

-

stringbuf::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_stringbuf<charT,traits> )
typedef charT char_type;
basic_streambuf* setbuf ( char_type* s, streamsize n );

See also

streambuf::pubsetbuf Set buffer array (public member function)
streambuf::setbuf Set buffer (virtual protected member function)

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