BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlsb::FixedMemOutStreamBuf Class Reference

#include <bdlsb_fixedmemoutstreambuf.h>

Inheritance diagram for bdlsb::FixedMemOutStreamBuf:

Public Member Functions

 FixedMemOutStreamBuf (char *buffer, bsl::streamsize length)
 
 ~FixedMemOutStreamBuf () BSLS_KEYWORD_OVERRIDE
 Destroy this stream buffer.
 
char * data ()
 
bsl::streamsize capacity () const
 
const char * data () const
 
bsl::streamsize length () const
 

Protected Member Functions

pos_type seekoff (off_type offset, bsl::ios_base::seekdir fixedPosition, bsl::ios_base::openmode which=bsl::ios_base::out) BSLS_KEYWORD_OVERRIDE
 
pos_type seekpos (pos_type position, bsl::ios_base::openmode which=bsl::ios_base::out) BSLS_KEYWORD_OVERRIDE
 
FixedMemOutStreamBufsetbuf (char_type *buffer, bsl::streamsize length) BSLS_KEYWORD_OVERRIDE
 

Detailed Description

This class implements the output functionality of the basic_streambuf protocol for client-supplied memory.

See bdlsb_fixedmemoutstreambuf

Constructor & Destructor Documentation

◆ FixedMemOutStreamBuf()

bdlsb::FixedMemOutStreamBuf::FixedMemOutStreamBuf ( char *  buffer,
bsl::streamsize  length 
)
inline

Create an empty stream buffer that uses the specified character buffer of the specified length. The behavior is undefined unless length == 0 or length > 0 && buffer != 0. Note that buffer is held but not owned.

◆ ~FixedMemOutStreamBuf()

bdlsb::FixedMemOutStreamBuf::~FixedMemOutStreamBuf ( )
inline

Member Function Documentation

◆ capacity()

bsl::streamsize bdlsb::FixedMemOutStreamBuf::capacity ( ) const
inline

Return the number of characters in the buffer held by this stream buffer. See length, below, for the span of bytes actually written.

◆ data() [1/2]

char * bdlsb::FixedMemOutStreamBuf::data ( )
inline

Return a pointer providing modifiable access to the character buffer held by this stream buffer (supplied at construction).

◆ data() [2/2]

const char * bdlsb::FixedMemOutStreamBuf::data ( ) const
inline

Return a pointer providing non-modifiable access to the character buffer held by this stream buffer (supplied at construction).

◆ length()

bsl::streamsize bdlsb::FixedMemOutStreamBuf::length ( ) const
inline

Return the number of characters from the beginning of the buffer to the current write position. This function returns the same value as seekoff(0, bsl::ios_base::end). The length is modified by a call to seekpos or seekoff and reset to zero by a call to pubsetbuf.

◆ seekoff()

pos_type bdlsb::FixedMemOutStreamBuf::seekoff ( off_type  offset,
bsl::ios_base::seekdir  fixedPosition,
bsl::ios_base::openmode  which = bsl::ios_base::out 
)
protected

Set the position indicator to the relative specified offset from the base position indicated by the specified fixedPosition and return the resulting absolute position on success or pos_type(-1) on failure. Optionally specify which area of the stream buffer. The seek operation will fail if which does not include the flag bsl::ios_base::out or if the resulting absolute position is less than zero or greater than the value returned by length.

◆ seekpos()

pos_type bdlsb::FixedMemOutStreamBuf::seekpos ( pos_type  position,
bsl::ios_base::openmode  which = bsl::ios_base::out 
)
protected

Set the position indicator to the specified position and return the resulting absolute position on success or pos_type(-1) on failure. Optionally specify which area of the stream buffer. The seekpos operation will fail if which does not include the flag bsl::ios_base::out or if position is less then zero or greater than the value returned by length.

◆ setbuf()

FixedMemOutStreamBuf * bdlsb::FixedMemOutStreamBuf::setbuf ( char_type *  buffer,
bsl::streamsize  length 
)
inlineprotected

The documentation for this class was generated from the following file: