tuningfork:: VectorStream
#include <protobuf_nano_util.h>
vec 中提供的矢量的视图。
摘要
无所有权。
| 详细信息 | |||
|---|---|---|---|
| 参数 |
|
||
公共属性 |
|
|---|---|
it
|
size_t
解码或编码时在矢量中的当前位置。
|
vec
|
std::vector< uint8_t > *
调用
Read 或 Write 时必须有效的字节矢量。 |
公共静态函数 |
|
|---|---|
Read(pb_istream_t *stream, uint8_t *buf, size_t count)
|
bool
将数据流中的
count 字节读取至给定缓冲区。 |
Write(pb_ostream_t *stream, const uint8_t *buf, size_t count)
|
bool
将给定缓冲区中的
count 字节写入数据流。 |
公共属性
it
size_t tuningfork::VectorStream::it
解码或编码时在矢量中的当前位置。
vec
std::vector< uint8_t > * tuningfork::VectorStream::vec
调用 Read 或 Write 时必须有效的字节矢量。
矢量将根据 Write 的需要调整大小。
公共静态函数
读取
bool tuningfork::VectorStream::Read( pb_istream_t *stream, uint8_t *buf, size_t count )
将数据流中的 count 字节读取至给定缓冲区。
| 详细信息 | |||||||
|---|---|---|---|---|---|---|---|
| 参数 |
|
||||||
| 返回值 |
如果成功则为 true;如果出现读取错误则为 false。
|
||||||
Write
bool tuningfork::VectorStream::Write( pb_ostream_t *stream, const uint8_t *buf, size_t count )
将给定缓冲区中的 count 字节写入数据流。
| 详细信息 | |||||||
|---|---|---|---|---|---|---|---|
| 参数 |
|
||||||
| 返回值 |
如果成功则为 true;如果出现写入错误则为 false。
|
||||||