Poco

template < typename ch, typename tr >

class BasicMemoryStreamBuf

Library: Foundation
Package: Streams
Header: Poco/MemoryStream.h

Description

BasicMemoryStreamBuf is a simple implementation of a stream buffer for reading and writing from a memory area.

This streambuf only supports unidirectional streams. In other words, the BasicMemoryStreamBuf can be used for the implementation of an istream or an ostream, but not for an iostream.

Inheritance

Direct Base Classes: std::basic_streambuf < ch, tr >

All Base Classes: std::basic_streambuf < ch, tr >

Member Summary

Member Functions: charsWritten, overflow, reset, sync, underflow

Types

Base protected

typedef std::basic_streambuf < ch, tr > Base;

IOS protected

typedef std::basic_ios < ch, tr > IOS;

char_traits protected

typedef tr char_traits;

char_type protected

typedef ch char_type;

int_type protected

typedef typename Base::int_type int_type;

off_type protected

typedef typename Base::off_type off_type;

pos_type protected

typedef typename Base::pos_type pos_type;

Constructors

BasicMemoryStreamBuf inline

BasicMemoryStreamBuf(
    char_type * pBuffer,
    std::streamsize bufferSize
);

Destructor

~BasicMemoryStreamBuf inline

~BasicMemoryStreamBuf();

Member Functions

charsWritten inline

std::streamsize charsWritten() const;

overflow virtual inline

virtual int_type overflow(
    int_type c
);

reset inline

void reset();

Resets the buffer so that current read and write positions will be set to the beginning of the buffer.

sync virtual inline

virtual int sync();

underflow virtual inline

virtual int_type underflow();