strstreambuf();
strstreambuf( int nBytes );
strstreambuf( char* pch, int n, char* pstart = 0 );
strstreambuf( unsigned char* puch, int n, unsigned char* pustart = 0 );
strstreambuf( signed char* psch, int n, signed char* psstart = 0 );
strstreambuf( void* (*falloc)(long), void (*ffree)(void*) );
Parameters
nBytes
The initial length of a dynamic stream buffer.
pch, puch, psch
A pointer to a character buffer that will be attached to the object. The get pointer is initialized to this value.
n
One of the following integer parameters:
pstart, pustart, psstart
The initial value of the put pointer.
falloc
A memory-allocation function with the prototype void* falloc( long ). The default is new.
ffree
A function that frees allocated memory with the prototype void ffree( void* ). The default is delete.
Remarks
The four streambuf constructors are described as follows:
Constructor | Description |
strstreambuf() | Constructs an empty strstreambuf object with dynamic buffering. The buffer is allocated internally by the class and grows as needed, unless it is frozen. |
strstreambuf( int ) | Constructs an empty strstreambuf object with a dynamic buffer n bytes long to start with. The buffer is allocated internally by the class and grows as needed, unless it is frozen. |
strstreambuf( char*, int, char* ) | Constructs a strstreambuf object from already-allocated memory as specified by the arguments. There are constructor variations for both unsigned and signed character arrays. |
strstreambuf( void*(*), void(*) ) | Constructs an empty strstreambuf object with dynamic buffering. The falloc function is called for allocation. The long parameter specifies the buffer length and the function returns the buffer address. If the falloc pointer is NULL, operator new is used. The ffree function frees memory allocated by falloc. If the ffree pointer is NULL, the operator delete is used. |