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

#include <bdlsb_fixedmeminstreambuf.h>

Inheritance diagram for bdlsb::FixedMemInStreamBuf:

Public Member Functions

 FixedMemInStreamBuf (const char *buffer, bsl::size_t length)
 
 ~FixedMemInStreamBuf () BSLS_KEYWORD_OVERRIDE
 Destroy this stream buffer.
 
FixedMemInStreamBufpubsetbuf (char *buffer, bsl::streamsize length)
 
FixedMemInStreamBufpubsetbuf (const char *buffer, bsl::streamsize length)
 
const char * data () const
 
bsl::size_t length () const
 

Protected Member Functions

pos_type seekoff (off_type offset, bsl::ios_base::seekdir way, bsl::ios_base::openmode which=bsl::ios_base::in) BSLS_KEYWORD_OVERRIDE
 
pos_type seekpos (pos_type position, bsl::ios_base::openmode which=bsl::ios_base::in) BSLS_KEYWORD_OVERRIDE
 
FixedMemInStreamBufsetbuf (char *buffer, bsl::streamsize length) BSLS_KEYWORD_OVERRIDE
 
FixedMemInStreamBufsetbuf (const char *buffer, bsl::streamsize length)
 
bsl::streamsize showmanyc () BSLS_KEYWORD_OVERRIDE
 
bsl::streamsize xsgetn (char_type *destination, bsl::streamsize length) BSLS_KEYWORD_OVERRIDE
 

Detailed Description

This class implements the input functionality of the basic_streambuf protocol, using client-supplied char * memory.

See bdlsb_fixedmeminstreambuf

Constructor & Destructor Documentation

◆ FixedMemInStreamBuf()

bdlsb::FixedMemInStreamBuf::FixedMemInStreamBuf ( const char *  buffer,
bsl::size_t  length 
)
inline

Create a FixedMemInStreamBuf that provides access to the character sequence in the specified buffer of the specified length. The behavior is undefined unless buffer != 0 && length > 0 or length == 0.

◆ ~FixedMemInStreamBuf()

bdlsb::FixedMemInStreamBuf::~FixedMemInStreamBuf ( )
inline

Member Function Documentation

◆ data()

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

Return the address of the non-modifiable character buffer held by this stream buffer.

◆ length()

bsl::size_t bdlsb::FixedMemInStreamBuf::length ( ) const
inline

Return the number of characters from the current input position to the end of the stream buffer. The function returns the same value as seekoff(0, bsl::ios_base::beg). The length is modified by a call to seekpos, seekoff or by reading characters from the buffer.

◆ pubsetbuf() [1/2]

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

Reinitialize this stream buffer to use the specified character buffer having the specified length. Return the address of this modifiable stream buffer. The behavior is undefined unless buffer != 0 && length > 0 or length == 0. Upon reinitialization for use of the new buffer, neither the content nor the next input position indicator is preserved. Note that buffer is held but not owned.

◆ pubsetbuf() [2/2]

FixedMemInStreamBuf * bdlsb::FixedMemInStreamBuf::pubsetbuf ( const char *  buffer,
bsl::streamsize  length 
)
inline

◆ seekoff()

pos_type bdlsb::FixedMemInStreamBuf::seekoff ( off_type  offset,
bsl::ios_base::seekdir  way,
bsl::ios_base::openmode  which = bsl::ios_base::in 
)
protected

Set the position indicator to the relative specified offset from the base position indicated by the specified way 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::in or if the resulting absolute position is less than zero or greater than the value returned by length.

◆ seekpos()

FixedMemInStreamBuf::pos_type bdlsb::FixedMemInStreamBuf::seekpos ( pos_type  position,
bsl::ios_base::openmode  which = bsl::ios_base::in 
)
inlineprotected

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::in or if position is less then zero or greater than the value returned by length.

◆ setbuf() [1/2]

FixedMemInStreamBuf * bdlsb::FixedMemInStreamBuf::setbuf ( char *  buffer,
bsl::streamsize  length 
)
inlineprotected

◆ setbuf() [2/2]

FixedMemInStreamBuf * bdlsb::FixedMemInStreamBuf::setbuf ( const char *  buffer,
bsl::streamsize  length 
)
inlineprotected

Reinitialize this stream buffer to use the specified character buffer having the specified length. Return the pointer providing modifiable access to this stream buffer. The behavior is undefined unless buffer != 0 && length > 0 or length == 0. Upon re-initialization for use of the new buffer, neither the content nor the next input position indicator are preserved. Note that buffer is held but not owned.

◆ showmanyc()

bsl::streamsize bdlsb::FixedMemInStreamBuf::showmanyc ( )
inlineprotected

Return the number of characters currently available for reading from this stream buffer, or -1 if there are none.

◆ xsgetn()

bsl::streamsize bdlsb::FixedMemInStreamBuf::xsgetn ( char_type *  destination,
bsl::streamsize  length 
)
inlineprotected

Read the specified length number of characters into the specified destination. Return the number of characters successfully read. The behavior is undefined unless 0 <= length.


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