Library: Foundation
Package: Streams
Header: Poco/UnbufferedStreamBuf.h
Description
This is an implementation of an unbuffered streambuf that greatly simplifies the implementation of custom streambufs of various kinds. Derived classes only have to override the methods readFromDevice() or writeToDevice().
Inheritance
Direct Base Classes: std::basic_streambuf < ch, tr >
All Base Classes: std::basic_streambuf < ch, tr >
Member Summary
Member Functions: charToInt, operator =, overflow, pbackfail, uflow, underflow, xsgetn
Types Aliases
Base
using Base = std::basic_streambuf < ch, tr >;
IOS
using IOS = std::basic_ios < ch, tr >;
char_traits
using char_traits = tr;
char_type
using char_type = ch;
int_type
using int_type = typename Base::int_type;
off_type
using off_type = typename Base::off_type;
openmode
using openmode = typename IOS::openmode;
pos_type
using pos_type = typename Base::pos_type;
Constructors
BasicUnbufferedStreamBuf
BasicUnbufferedStreamBuf
BasicUnbufferedStreamBuf(
const BasicUnbufferedStreamBuf & param409
) = delete;
Destructor
~BasicUnbufferedStreamBuf
~BasicUnbufferedStreamBuf() override = default;
Member Functions
operator =
BasicUnbufferedStreamBuf & operator = (
const BasicUnbufferedStreamBuf & param410
) = delete;
overflow
int_type overflow(
int_type c
) override;
pbackfail
int_type pbackfail(
int_type c
) override;
uflow
int_type uflow() override;
underflow
int_type underflow() override;
xsgetn
std::streamsize xsgetn(
char_type * p,
std::streamsize count
) override;
Some platforms (for example, Compaq C++) have buggy implementations of xsgetn that handle null buffers incorrectly. Anyway, it does not hurt to provide an optimized implementation of xsgetn for this streambuf implementation.
charToInt
static int_type charToInt(
char_type c
);