Output streambuf using a client buffer and an overflow allocator.

Synopsis

Declared in <bdlsb_overflowmemoutstreambuf.h>

class OverflowMemOutStreamBuf
    : public std::streambuf

Description

This class implements the output functionality of the bsl::basic_streambuf protocol, using client‐supplied memory and client‐supplied allocator if additional memory is needed.

Base Classes

Name

Description

std::streambuf

Member Functions

Name

Description

OverflowMemOutStreamBuf [constructor]

Create an empty stream buffer with the specified initial output buffer.

~OverflowMemOutStreamBuf [destructor] [virtual]

Destroy this stream buffer.

dataLength

Return the number of bytes written to this stream.

dataLengthInInitialBuffer

Return the length of data in the initial buffer, i.e., dataLength() if there is no overflow buffer, or initialBufferSize() if there is one.

dataLengthInOverflowBuffer

Return the length of the data in the overflow buffer, i.e., 0 if there is no overflow buffer, or dataLength() ‐ initialBufferSize() if there is one.

initialBuffer

Return a pointer to the non‐modifiable buffer supplied at construction.

initialBufferSize

Return the size of the buffer supplied at construction.

overflowBuffer

Return a pointer to the non‐modifiable overflow buffer if there is one, or 0 otherwise.

overflowBufferSize

Return the size of the overflow buffer, or 0 if there is no overflow buffer.

operator BloombergLP::bslmf::NestedTraitDeclaration<OverflowMemOutStreamBuf, UsesBslmaAllocator>

Declare that this type uses a bslma allocator.

Protected Member Functions

Name

Description

overflow [virtual]

Put c at the next put position, growing the buffer if needed.

seekoff [virtual]

Set the put position relative to the specified base and return it.

seekpos [virtual]

Set the put position to the specified absolute position and return it.

sync [virtual]

Update the cached data length from the current put position.

xsputn [virtual]

Write characters from a buffer into this stream buffer.

Created with MrDocs