strstreambuf::strstreambuf

explicit strstreambuf(streamsize n = 0);
strstreambuf(void (*palloc)(size_t),
    void (*pfree)(void *));
strstreambuf(char *gp, streamsize n,
    char *pp = 0);
strstreambuf(signed char *gp, streamsize n,
    signed char *pp = 0);
strstreambuf(unsigned char *gp, streamsize n,
    unsigned char *pp = 0);
strstreambuf(const char *gp, streamsize n);
strstreambuf(const signed char *gp, streamsize n);
strstreambuf(const unsigned char *gp, streamsize n);

The first constructor stores a null pointer in all the pointers controlling the input buffer, the output buffer, and strstreambuf allocation. It sets the stored strstreambuf mode to make the controlled sequence modifiable and extendable.

The second constructor behaves much as the first, except that it stores palloc as the pointer to the function to call to allocate storage, and pfree as the pointer to the function to call to free that storage.

The three constructors:

strstreambuf(char *gp, streamsize n,
    char *pp = 0);
strstreambuf(signed char *gp, streamsize n,
    signed char *pp = 0);
strstreambuf(unsigned char *gp, streamsize n,
    unsigned char *pp = 0);

also behave much as the first, except that gp designates the array object used to hold the controlled sequence. (Therefore, it must not be a null pointer.) The number of elements N in the array is determined as follows:

If pp is a null pointer, the function establishes just an input buffer, by executing:

setg(gp, gp, gp + N);

Otherwise, it establishes both input and output buffers, by executing:

setg(gp, gp, pp);
setp(pp, gp + N);

In this case, pp must be in the interval [gp, gp + N].

Finally, the three constructors:

strstreambuf(const char *gp, streamsize n);
strstreambuf(const signed char *gp, streamsize n);
strstreambuf(const unsigned char *gp, streamsize n);

all behave the same as:

streambuf((char *)gp, n);

except that the stored mode makes the controlled sequence neither modifiable nor extendable.