8#ifndef INCLUDED_BDLSB_FIXEDMEMINPUT
9#define INCLUDED_BDLSB_FIXEDMEMINPUT
130#include <bdlscm_version.h>
138#include <bsl_algorithm.h>
139#include <bsl_cstdlib.h>
140#include <bsl_cstring.h>
142#include <bsl_iosfwd.h>
176 const char *d_buffer_p;
177 bsl::size_t d_bufferSize;
222 bsl::ios_base::seekdir way,
223 bsl::ios_base::openmode which = bsl::ios_base::in);
232 bsl::ios_base::openmode which = bsl::ios_base::in);
281 const char *
data()
const;
287 bsl::size_t
length()
const;
300FixedMemInput::FixedMemInput(
const char *buffer, bsl::size_t length)
301: d_buffer_p(const_cast<char *>(buffer))
302, d_bufferSize(length)
313 return bsl::streamsize(-1);
315 return static_cast<bsl::streamsize
>(d_bufferSize - d_pos);
320 bsl::streamsize length)
327 d_bufferSize =
static_cast<bsl::size_t
>(
length);
336 return traits_type::eof();
338 const int_type i = traits_type::to_int_type(d_buffer_p[d_pos]);
347 return traits_type::eof();
350 return traits_type::to_int_type(d_buffer_p[d_pos]);
359 const bsl::size_t current = d_pos;
360 d_pos +=
static_cast<bsl::size_t
>(
length);
363 (d_pos < current) )) {
364 d_pos = d_bufferSize;
365 length =
static_cast<bsl::streamsize
>(d_bufferSize - current);
367 bsl::memcpy(destination, d_buffer_p+current,
length);
375 return traits_type::eof();
386 return traits_type::eof();
389 return traits_type::to_int_type(c);
396 return traits_type::eof();
399 return traits_type::to_int_type(d_buffer_p[d_pos]);
418 return (d_bufferSize - d_pos);
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlsb_fixedmeminput.h:145