Quick Links:

bal | bbl | bdl | bsl

Public Member Functions | Protected Member Functions

bdlbb::InBlobStreamBuf Class Reference

#include <bdlbb_blobstreambuf.h>

List of all members.

Public Member Functions

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

Protected Member Functions

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

Detailed Description

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

See Component bdlbb_blobstreambuf


Constructor & Destructor Documentation

bdlbb::InBlobStreamBuf::InBlobStreamBuf ( const bdlbb::Blob blob  )  [explicit]

Create a BlobStreamBuf using the specified blob. The behavior is undefined unless blob remains valid and externally unmodified for the lifetime of this streambuf.

bdlbb::InBlobStreamBuf::~InBlobStreamBuf (  ) 

Destroy this stream buffer.


Member Function Documentation

virtual int_type bdlbb::InBlobStreamBuf::overflow ( int_type  c = bsl::streambuf::traits_type::eof()  )  [protected, virtual]

Return traits_type::eof() unconditionally.

virtual int_type bdlbb::InBlobStreamBuf::pbackfail ( int_type  c = bsl::streambuf::traits_type::eof()  )  [protected, virtual]

Adjust the underlying blob and put the optionally specified character c at the newly valid gptr(). Return c (or ~traits_typeeof if c == traits_type::eof) on success, and traits_type::eof() otherwise.

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

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 that this method will fail if bsl::ios_base::out is set.

virtual pos_type bdlbb::InBlobStreamBuf::seekpos ( pos_type  position,
bsl::ios_base::openmode  which = bsl::ios_base::in|bsl::ios_base::out 
) [protected, virtual]

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 that this method will fail if bsl::ios_base::out is set.

virtual bsl::streamsize bdlbb::InBlobStreamBuf::showmanyc (  )  [protected, virtual]

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

virtual int bdlbb::InBlobStreamBuf::sync (  )  [protected, virtual]

Return 0 unconditionally.

virtual int_type bdlbb::InBlobStreamBuf::underflow (  )  [protected, virtual]

Adjust the underlying blob so that the next read position is valid. Return the character at gptr() on success and traits_type::eof() otherwise.

virtual bsl::streamsize bdlbb::InBlobStreamBuf::xsgetn ( char_type *  destination,
bsl::streamsize  numChars 
) [protected, virtual]

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

virtual bsl::streamsize bdlbb::InBlobStreamBuf::xsputn ( const char_type *  source,
bsl::streamsize  numChars 
) [protected, virtual]

Return 0 unconditionally.

void bdlbb::InBlobStreamBuf::reset ( const bdlbb::Blob blob = 0  ) 

Reset the get areas. Optionally set the underlying bdlbb::Blob value to the optionally specified blob if blob is not 0. The behavior is undefined unless blob remains valid and externally unmodified for the lifetime of this streambuf.

int bdlbb::InBlobStreamBuf::currentBufferIndex (  )  const

Return the index of the current buffer. The behavior is undefined unless the "streamed" blob has at least one buffer.

const bdlbb::Blob* bdlbb::InBlobStreamBuf::data (  )  const

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

int bdlbb::InBlobStreamBuf::previousBuffersLength (  )  const

Return the number of bytes contained in the buffers located before the current one. The behavior is undefined unless the "streamed" blob has at least one buffer.


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