![]() |
PIP 5.6.1
Platform-Independent Primitives
|
CRTP interface for binary serialization streams. More...
#include <pibinarystream.h>
Public Member Functions | |
| bool | binaryStreamAppend (const void *d, size_t s) |
| Writes raw bytes to the underlying stream. | |
| bool | binaryStreamTake (void *d, size_t s) |
| Reads raw bytes from the underlying stream and sets read error state on short reads. | |
| ssize_t | binaryStreamSize () const |
| Returns remaining readable byte count. More... | |
| template<typename T > | |
| void | binaryStreamAppend (T v) |
| Writes one trivially copied value as raw bytes. | |
| int | binaryStreamTakeInt () |
Reads one int value from the stream. | |
| bool | wasReadError () const |
| Returns whether there has been an incomplete read since last resetReadError() or after the stream was created. | |
| void | resetReadError () |
| Reset incomplete read flag. | |
CRTP interface for binary serialization streams.
Derived stream classes should implement:
binaryStreamSizeImp() should return -1 when the remaining size is unknown. See details Input/Output stream.
|
inline |
Returns remaining readable byte count.
Returns -1 when the stream cannot report its remaining size.