IOStream Class Reference

#include <Pt/System/IOStream.h>

Input/Output stream for I/O devices.

Inherits BasicIOStream< char >.

Public Member Functions

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

Member Function Documentation

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

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().