tuningfork:: VectorStream
#include <protobuf_nano_util.h>
A view on the vector provided in vec
.
Summary
No ownership is taken.
Details | |||
---|---|---|---|
Parameters |
|
Public attributes |
|
---|---|
it
|
size_t
The current position in the vector while decoding or encoding.
|
vec
|
std::vector< uint8_t > *
A vector of bytes that must be valid while
Read or Write are called. |
Public static functions |
|
---|---|
Read(pb_istream_t *stream, uint8_t *buf, size_t count)
|
bool
Read
count bytes from the stream to the given buffer. |
Write(pb_ostream_t *stream, const uint8_t *buf, size_t count)
|
bool
Write
count bytes from the given buffer to the stream. |
Public attributes
it
size_t tuningfork::VectorStream::it
The current position in the vector while decoding or encoding.
vec
std::vector< uint8_t > * tuningfork::VectorStream::vec
A vector of bytes that must be valid while Read
or Write
are called.
The vector will be resized as needed by Write
.
Public static functions
Read
bool tuningfork::VectorStream::Read( pb_istream_t *stream, uint8_t *buf, size_t count )
Read count
bytes from the stream to the given buffer.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
true if successful, false on a read error.
|
Write
bool tuningfork::VectorStream::Write( pb_ostream_t *stream, const uint8_t *buf, size_t count )
Write count
bytes from the given buffer to the stream.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
true if successful, false on a write error.
|