29 #ifndef Pt_System_IOBuffer_h
30 #define Pt_System_IOBuffer_h
32 #include <Pt/System/Api.h>
33 #include <Pt/System/IODevice.h>
34 #include <Pt/Signal.h>
35 #include <Pt/StreamBuffer.h>
64 explicit IOBuffer(std::size_t bufferSize = 8192,
bool extend =
false);
68 explicit IOBuffer(
IODevice& ioDevice, std::size_t bufferSize = 8192,
bool extend =
false);
82 {
return _inputReady; }
87 {
return _outputReady; }
137 void init(std::size_t bufferSize,
bool extend);
140 virtual std::streamsize showmanyc();
149 virtual int_type underflow();
152 virtual int_type overflow(int_type ch);
155 virtual pos_type seekoff(off_type offset, std::ios::seekdir sd, std::ios::openmode mode);
158 virtual pos_type seekpos(pos_type p, std::ios::openmode mode );
161 virtual int_type pbackfail(int_type c);
167 std::size_t _ibufferSize;
169 std::size_t _obufferSize;
173 static const int _pbmax = 4;
180 #endif // Pt_System_IOBuffer_h
Core module.
Definition: Allocator.h:33
std::size_t endWrite()
Ends writing buffered data to the I/O device.
bool isReading() const
Returns true if a read operation is running.
virtual std::streamsize showfull()
Returns the number of characters buffered for output.
void reset()
Discards and detaches.
void discard()
Discards the buffer.
Multicast Signal to call multiple slots.
Definition: Signal.h:190
void beginRead()
Begins to read from the I/O device into the buffer.
IOBuffer(std::size_t bufferSize=8192, bool extend=false)
Construct with buffer size.
bool isWriting() const
Returns true if a write operation is running.
std::size_t endRead()
Ends to read.
Connection Management for Signal and Slot Objects.
Definition: Connectable.h:50
Signal< IOBuffer & > & outputReady()
Notifies when a part of the buffer was written.
Definition: IOBuffer.h:86
void attach(IODevice &ioDevice)
Attach to I/O device.
IODevice * device()
Returns the I/O device.
Definition: IOBuffer.h:76
void detach()
Detach from I/O device.
Endpoint for I/O operations.
Definition: IODevice.h:96
Buffer for input and output streams.
Definition: StreamBuffer.h:52
Signal< IOBuffer & > & inputReady()
Notifies when input was read.
Definition: IOBuffer.h:81
void beginWrite()
Begins to write buffered data to the I/O device.
Stream buffer for an IODevice.
Definition: IOBuffer.h:60
IOBuffer(IODevice &ioDevice, std::size_t bufferSize=8192, bool extend=false)
Construct with I/O device.