Poco

template < typename ch, typename tr >

class BasicUnbufferedStreamBuf

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 protected

using Base = std::basic_streambuf < ch, tr >;

IOS protected

using IOS = std::basic_ios < ch, tr >;

char_traits protected

using char_traits = tr;

char_type protected

using char_type = ch;

int_type protected

using int_type = typename Base::int_type;

off_type protected

using off_type = typename Base::off_type;

openmode protected

using openmode = typename IOS::openmode;

pos_type protected

using pos_type = typename Base::pos_type;

Constructors

BasicUnbufferedStreamBuf inline

BasicUnbufferedStreamBuf();

BasicUnbufferedStreamBuf

BasicUnbufferedStreamBuf(
    const BasicUnbufferedStreamBuf & param409
) = delete;

Destructor

~BasicUnbufferedStreamBuf

~BasicUnbufferedStreamBuf() override = default;

Member Functions

operator =

BasicUnbufferedStreamBuf & operator = (
    const BasicUnbufferedStreamBuf & param410
) = delete;

overflow inline

int_type overflow(
    int_type c
) override;

pbackfail inline

int_type pbackfail(
    int_type c
) override;

uflow inline

int_type uflow() override;

underflow inline

int_type underflow() override;

xsgetn inline

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 protected static inline

static int_type charToInt(
    char_type c
);