IStream Class Reference

#include <Pt/System/IOStream.h>

Input stream for an IODevice. More...

Inherits BasicIStream< char >.

Public Member Functions

 IStream (std::size_t bufferSize=8192, bool extend=false)
 Construct with buffer size.
 IStream (IODevice &device, std::size_t bufferSize=8192, bool extend=false)
 Construct with I/O device.
 ~IStream ()
 Destructor.
IOBufferioBuffer ()
 Returns the stream buffer.
IODevicedevice ()
 Returns the I/O device.
void attach (IODevice &dev)
 Attach to I/O device.
void detach ()
 Detach from I/O device.
void discard ()
 Discards the buffer.
void reset ()
 Discards and detaches.
std::streamsize peeksome (char *buffer, std::streamsize n)
 Peeks bytes in the stream buffer.
BasicStreamBuffer< char > * buffer ()
 Returns the buffer.
void setBuffer (BasicStreamBuffer< char > *sb)
 Sets the buffer.

Detailed Description

IStream is a C++ istream whose buffer is an IOBuffer. attach() binds an IODevice. Extraction then reads from that device.

Member Function Documentation

◆ peeksome()

std::streamsize peeksome ( char * buffer,
std::streamsize n )
inherited

The number of bytes that can be peeked depends on the current stream buffer get area and maybe less than requested, similar to istream::readsome().