IOBuffer Class Reference

#include <Pt/System/IOBuffer.h>

Implements std::streambuf for I/O devices.

Inherits BasicStreamBuffer< char >, and Connectable.

Public Member Functions

 IOBuffer (std::size_t bufferSize=8192, bool extend=false)
 Construct with buffer size.
 
 IOBuffer (IODevice &ioDevice, std::size_t bufferSize=8192, bool extend=false)
 Construct with I/O device.
 
 ~IOBuffer ()
 Destructor.
 
void attach (IODevice &ioDevice)
 Attach to I/O device.
 
void beginRead ()
 Begins to read from the I/O device into the buffer.
 
void beginWrite ()
 Begins to write buffered data to the I/O device.
 
void detach ()
 Detach from I/O device.
 
IODevicedevice ()
 Returns the I/O device.
 
void discard ()
 Discards the buffer.
 
std::size_t endRead ()
 Ends to read.
 
Signal< IOBuffer & > & inputReady ()
 Notifies when input was read.
 
bool isReading () const
 Returns true if a read operation is running.
 
bool isWriting () const
 Returns true if a write operation is running.
 
std::streamsize out_avail ()
 Returns the number of characters buffered for output.
 
Signal< IOBuffer & > & outputReady ()
 Notifies when a part of the buffer was written.
 
void reset ()
 Discards and detaches.
 
std::streamsize speekn (char *buffer, std::streamsize size)
 Peek data in stream.
 

Protected Member Functions

virtual std::streamsize showfull ()
 Returns the number of characters buffered for output.