BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bdlbb::OutBlobStreamBuf Class Reference

#include <bdlbb_blobstreambuf.h>

Inheritance diagram for bdlbb::OutBlobStreamBuf:

Detailed Description

This class implements the output functionality of the basic_streambuf protocol, using a client-supplied bdlbb::Blob.

See bdlbb_blobstreambuf

Public Member Functions

 OutBlobStreamBuf (bdlbb::Blob *blob)
 
 ~OutBlobStreamBuf () BSLS_KEYWORD_OVERRIDE
 
bdlbb::Blobdata ()
 
void reset (bdlbb::Blob *blob=0)
 
int currentBufferIndex () const
 
const bdlbb::Blobdata () const
 
int previousBuffersLength () const
 

Protected Member Functions

int_type overflow (int_type c=bsl::streambuf::traits_type::eof()) BSLS_KEYWORD_OVERRIDE
 
int_type pbackfail (int_type c=bsl::streambuf::traits_type::eof()) BSLS_KEYWORD_OVERRIDE
 
pos_type seekoff (off_type offset, bsl::ios_base::seekdir fixedPosition, bsl::ios_base::openmode which=bsl::ios_base::in|bsl::ios_base::out) BSLS_KEYWORD_OVERRIDE
 
pos_type seekpos (pos_type position, bsl::ios_base::openmode which=bsl::ios_base::in|bsl::ios_base::out) BSLS_KEYWORD_OVERRIDE
 
bsl::streamsize showmanyc () BSLS_KEYWORD_OVERRIDE
 
int sync () BSLS_KEYWORD_OVERRIDE
 
int_type underflow () BSLS_KEYWORD_OVERRIDE
 
bsl::streamsize xsgetn (char_type *destination, bsl::streamsize numChars) BSLS_KEYWORD_OVERRIDE
 
bsl::streamsize xsputn (const char_type *source, bsl::streamsize numChars) BSLS_KEYWORD_OVERRIDE
 

Constructor & Destructor Documentation

◆ OutBlobStreamBuf()

bdlbb::OutBlobStreamBuf::OutBlobStreamBuf ( bdlbb::Blob blob)
explicit

Create a OutBlobStreamBuf using the specified blob, and set the location at which the next write operation will occur to blob->length().

Precondition
The behavior is undefined unless blob remains valid and externally unmodified for the lifetime of this streambuf.

◆ ~OutBlobStreamBuf()

bdlbb::OutBlobStreamBuf::~OutBlobStreamBuf ( )

Destroy this stream buffer.

Member Function Documentation

◆ currentBufferIndex()

int bdlbb::OutBlobStreamBuf::currentBufferIndex ( ) const
inline

Return the index of the current buffer.

Precondition
The behavior is undefined unless the "streamed" blob has at least one buffer.

◆ data() [1/2]

bdlbb::Blob * bdlbb::OutBlobStreamBuf::data ( )
inline

Return the address of the blob held by this stream buffer.

◆ data() [2/2]

const bdlbb::Blob * bdlbb::OutBlobStreamBuf::data ( ) const
inline

Return the address of the blob held by this stream buffer.

◆ overflow()

int_type bdlbb::OutBlobStreamBuf::overflow ( int_type  c = bsl::streambuf::traits_type::eof())
protected

Append the optionally specified character c to this streambuf, and return c. By default, traits_type::eof() is appended.

◆ pbackfail()

int_type bdlbb::OutBlobStreamBuf::pbackfail ( int_type  c = bsl::streambuf::traits_type::eof())
protected

Return traits_type::eof() unconditionally.

◆ previousBuffersLength()

int bdlbb::OutBlobStreamBuf::previousBuffersLength ( ) const
inline

Return the number of bytes contained in the buffers located before the current one.

Precondition
The behavior is undefined unless the "streamed" blob has at least one buffer.

◆ reset()

void bdlbb::OutBlobStreamBuf::reset ( bdlbb::Blob blob = 0)
inline

Reset the put position of this buffer to the first location, available for writing in the underlying bdlbb::Blob. Optionally specify a blob used to change current underlying bdlbb::Blob value for.

Precondition
The behavior is undefined unless blob remains valid and externally unmodified for the lifetime of this streambuf.

◆ seekoff()

pos_type bdlbb::OutBlobStreamBuf::seekoff ( off_type  offset,
bsl::ios_base::seekdir  fixedPosition,
bsl::ios_base::openmode  which = bsl::ios_base::in|bsl::ios_base::out 
)
protected

Set the location from which the next I/O operation indicated by the optionally specified which mode will occur to the specified offset position from the location indicated by the specified fixedPosition. Return the new offset on success, and off_type(-1) otherwise. offset may be negative.

Note
Note that this method will fail if bsl::ios_base::in is set.

◆ seekpos()

pos_type bdlbb::OutBlobStreamBuf::seekpos ( pos_type  position,
bsl::ios_base::openmode  which = bsl::ios_base::in|bsl::ios_base::out 
)
protected

Set the location from which the next I/O operation indicated by the optionally specified which mode will occur to the specified position. Return position on success, and off_type(-1) otherwise.

Note
Note that this method will fail if bsl::ios_base::in is set.

◆ showmanyc()

bsl::streamsize bdlbb::OutBlobStreamBuf::showmanyc ( )
protected

Return 0 unconditionally.

◆ sync()

int bdlbb::OutBlobStreamBuf::sync ( )
protected

Synchronize the put position in the blob of this stream buffer. Return 0 unconditionally.

◆ underflow()

int_type bdlbb::OutBlobStreamBuf::underflow ( )
protected

Return traits_type::eof() unconditionally.

◆ xsgetn()

bsl::streamsize bdlbb::OutBlobStreamBuf::xsgetn ( char_type *  destination,
bsl::streamsize  numChars 
)
protected

Return 0 unconditionally.

◆ xsputn()

bsl::streamsize bdlbb::OutBlobStreamBuf::xsputn ( const char_type *  source,
bsl::streamsize  numChars 
)
protected

Copy the specified numChars from the specified source to the blob held by this streambuf, starting at the current put area location.

Precondition
The behavior is undefined unless 0 <= numChars.

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