8#ifndef INCLUDED_BDLSB_FIXEDMEMOUTPUT
9#define INCLUDED_BDLSB_FIXEDMEMOUTPUT
106#include <bdlscm_version.h>
113#include <bsl_algorithm.h>
114#include <bsl_cstdlib.h>
115#include <bsl_cstring.h>
117#include <bsl_iosfwd.h>
118#include <bsl_locale.h>
119#include <bsl_streambuf.h>
154 bsl::streamsize d_capacity;
187 bsl::locale
pubimbue(
const bsl::locale& loc);
206 bsl::ios_base::seekdir fixedPosition,
207 bsl::ios_base::openmode which =
208 bsl::ios_base::in | bsl::ios_base::out);
217 bsl::ios_base::openmode which =
218 bsl::ios_base::in | bsl::ios_base::out);
236 bsl::streamsize
sputn(
const char *s, bsl::streamsize
length);
245 const char *
data()
const;
249 bsl::streamsize
length()
const;
256 bsl::locale
getloc()
const;
270FixedMemOutput::FixedMemOutput(
char *buffer,
271 bsl::streamsize length)
290 return bsl::locale();
295 bsl::streamsize length)
317 if (d_pos >= d_capacity) {
318 return traits_type::eof();
320 d_buffer_p[
static_cast<IntPtr
>(d_pos)] = c;
322 return traits_type::to_int_type(c);
327 bsl::streamsize length)
331 length = bsl::min<bsl::streamsize>(
333 d_capacity -
static_cast<bsl::streamsize
>(d_pos));
335 bsl::memcpy(d_buffer_p +
static_cast<IntPtr
>(d_pos), s,
length);
361 return bsl::locale();
367 return bsl::streamsize(d_pos);
Definition bdlsb_fixedmemoutput.h:138
int_type sputc(char c)
Definition bdlsb_fixedmemoutput.h:315
bsl::locale pubimbue(const bsl::locale &loc)
Definition bdlsb_fixedmemoutput.h:288
bsl::locale getloc() const
Definition bdlsb_fixedmemoutput.h:359
bsl::streamsize capacity() const
Return the size in bytes of the buffer held by this stream buffer.
Definition bdlsb_fixedmemoutput.h:347
bsl::streamsize sputn(const char *s, bsl::streamsize length)
Definition bdlsb_fixedmemoutput.h:326
char char_type
Definition bdlsb_fixedmemoutput.h:142
bsl::char_traits< char > traits_type
Definition bdlsb_fixedmemoutput.h:146
FixedMemOutput * pubsetbuf(char *buffer, bsl::streamsize length)
Definition bdlsb_fixedmemoutput.h:294
bsl::char_traits< char >::int_type int_type
Definition bdlsb_fixedmemoutput.h:143
pos_type pubseekoff(off_type offset, bsl::ios_base::seekdir fixedPosition, bsl::ios_base::openmode which=bsl::ios_base::in|bsl::ios_base::out)
~FixedMemOutput()=default
Destroy this object.
bsl::char_traits< char >::off_type off_type
Definition bdlsb_fixedmemoutput.h:145
bsl::streamsize length() const
Definition bdlsb_fixedmemoutput.h:365
char * data()
Definition bdlsb_fixedmemoutput.h:282
pos_type pubseekpos(pos_type position, bsl::ios_base::openmode which=bsl::ios_base::in|bsl::ios_base::out)
bsl::char_traits< char >::pos_type pos_type
Definition bdlsb_fixedmemoutput.h:144
int pubsync()
Definition bdlsb_fixedmemoutput.h:308
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bdlsb_fixedmeminput.h:145
std::ptrdiff_t IntPtr
Definition bsls_types.h:132