#include <Iguana/Utilities/classlib/iotools/ReadBuffer.h>
Public Types | |
enum | { DEFAULT_SIZE = 4096 } |
Public Member Functions | |
unsigned char * | buffer (void) const |
IOSize | capacity (void) const |
unsigned char * | current (void) const |
unsigned char * | end (void) const |
void | filled (IOSize n) |
void | get (void *data, IOSize n) |
IOSize | left (void) const |
unsigned char * | limit (void) const |
ReadBuffer & | operator= (const ReadBuffer &x) |
unsigned char * | pback (void) const |
ReadBuffer (const ReadBuffer &x) | |
ReadBuffer (IOSize bufsize=DEFAULT_SIZE) | |
void | reset (void) |
void | skip (IOSize n) |
void | unget (const void *data, IOSize n) |
~ReadBuffer (void) | |
Private Attributes | |
unsigned char * | m_buffer |
unsigned char * | m_current |
unsigned char * | m_end |
unsigned char * | m_limit |
unsigned char * | m_pback |
Clients should use get() for buffered reads from the store. If left() returns zero to indicate the buffer is exhausted, clients should copy at most capacity() bytes from the external source into end(). They should then call filled() to tell the buffer how much was added, the method updates the other pointers. It is possible to add more data even if left() does not return zero provided capacity() returns non-zero.
The buffer also maintains a push-back area. Bytes already read from the buffer can be "unread", or new data can be pushed back to be accessed on the next get(). Arbitrary amounts of data can be pushed back.
Definition at line 31 of file ReadBuffer.h.
anonymous enum |
lat::ReadBuffer::ReadBuffer | ( | IOSize | bufsize = DEFAULT_SIZE |
) |
lat::ReadBuffer::ReadBuffer | ( | const ReadBuffer & | x | ) |
lat::ReadBuffer::~ReadBuffer | ( | void | ) |
unsigned char* lat::ReadBuffer::buffer | ( | void | ) | const |
unsigned char* lat::ReadBuffer::current | ( | void | ) | const |
unsigned char* lat::ReadBuffer::end | ( | void | ) | const |
unsigned char* lat::ReadBuffer::limit | ( | void | ) | const |
ReadBuffer& lat::ReadBuffer::operator= | ( | const ReadBuffer & | x | ) |
unsigned char* lat::ReadBuffer::pback | ( | void | ) | const |
unsigned char* lat::ReadBuffer::m_buffer [private] |
Definition at line 57 of file ReadBuffer.h.
unsigned char* lat::ReadBuffer::m_current [private] |
Definition at line 58 of file ReadBuffer.h.
unsigned char* lat::ReadBuffer::m_end [private] |
Definition at line 59 of file ReadBuffer.h.
unsigned char* lat::ReadBuffer::m_limit [private] |
Definition at line 60 of file ReadBuffer.h.
unsigned char* lat::ReadBuffer::m_pback [private] |
Definition at line 61 of file ReadBuffer.h.