|
OpenEnroth cf228e9
|
#include <StreamBuffer.h>
Public Member Functions | |
| StreamBuffer () | |
| StreamBuffer (T *start, T *pos, T *end) | |
| void | reset (T *newStart, T *newPos, T *newEnd) |
| T * | start () const |
| T * | pos () const |
| T * | end () const |
| size_t | used () const |
| size_t | remaining () const |
| void | commit () |
| size_t | read (void *dst, size_t size) |
| size_t | read (std::string *dst, size_t size) |
| size_t | skip (size_t size) |
| size_t | write (const void *src, size_t size) |
Private Attributes | |
| T * | _start |
| T * | _pos |
| T * | _end |
Three-pointer buffer used by InputStream and OutputStream.
Maintains the invariant that all three pointers are non-null and sorted: start <= pos <= end.
A default-constructed buffer points to a valid empty sentinel. This is mainly needed so that we don't have to jump through hoops when calling memcpy (calling it with nullptr is UB even if size is 0).
| T | char for writable buffers, const char for read-only buffers. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
|
private |