8#ifndef INCLUDED_BDLSB_FIXEDMEMINSTREAMBUF
9#define INCLUDED_BDLSB_FIXEDMEMINSTREAMBUF
160#include <bdlscm_version.h>
167#include <bsl_cstring.h>
169#include <bsl_streambuf.h>
171#if defined(BSLS_PLATFORM_CMP_MSVC) && defined(min)
191 bsl::size_t d_bufferSize;
208 bsl::ios_base::seekdir way,
209 bsl::ios_base::openmode which = bsl::ios_base::in)
218 pos_type
seekpos(pos_type position,
219 bsl::ios_base::openmode which = bsl::ios_base::in)
240 bsl::streamsize
xsgetn(char_type *destination,
273 const
char *
data() const;
294 bsl::ios_base::openmode which)
296 return seekoff(
static_cast<off_type
>(position), bsl::ios_base::beg, which);
310 d_bufferSize =
static_cast<bsl::size_t
>(
length);
311 setg(d_buffer_p, d_buffer_p, d_buffer_p + d_bufferSize);
328 bsl::streamsize numChars = egptr() - gptr();
342 bsl::streamsize charsLeft = egptr() - gptr();
344 bsl::streamsize canCopy = charsLeft <
length ? charsLeft :
length;
346 bsl::memcpy(destination, gptr(),
static_cast<bsl::size_t
>(canCopy));
347 gbump(
static_cast<int>(canCopy));
353FixedMemInStreamBuf::FixedMemInStreamBuf(
const char *buffer,
355: d_buffer_p(const_cast<char *>(buffer))
360 setg(d_buffer_p, d_buffer_p, d_buffer_p + d_bufferSize);
371 bsl::streamsize length)
381 bsl::streamsize length)
399 return egptr() - gptr();
Definition bdlsb_fixedmeminstreambuf.h:187
FixedMemInStreamBuf * setbuf(char *buffer, bsl::streamsize length) BSLS_KEYWORD_OVERRIDE
Definition bdlsb_fixedmeminstreambuf.h:301
const char * data() const
Definition bdlsb_fixedmeminstreambuf.h:391
pos_type seekoff(off_type offset, bsl::ios_base::seekdir way, bsl::ios_base::openmode which=bsl::ios_base::in) BSLS_KEYWORD_OVERRIDE
bsl::streamsize xsgetn(char_type *destination, bsl::streamsize length) BSLS_KEYWORD_OVERRIDE
Definition bdlsb_fixedmeminstreambuf.h:336
pos_type seekpos(pos_type position, bsl::ios_base::openmode which=bsl::ios_base::in) BSLS_KEYWORD_OVERRIDE
Definition bdlsb_fixedmeminstreambuf.h:293
~FixedMemInStreamBuf() BSLS_KEYWORD_OVERRIDE
Destroy this stream buffer.
Definition bdlsb_fixedmeminstreambuf.h:364
FixedMemInStreamBuf * pubsetbuf(char *buffer, bsl::streamsize length)
Definition bdlsb_fixedmeminstreambuf.h:380
bsl::size_t length() const
Definition bdlsb_fixedmeminstreambuf.h:397
bsl::streamsize showmanyc() BSLS_KEYWORD_OVERRIDE
Definition bdlsb_fixedmeminstreambuf.h:326
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_OVERRIDE
Definition bsls_keyword.h:653
Definition bdlsb_fixedmeminput.h:145
Definition bdlb_printmethods.h:283