# tuningfork::VectorStream

`#include <protobuf_nano_util.h>`

`vec` 為單位檢視向量。

## 摘要

 `vec` 使用範例：``` std::vector v; VectorStream str {&v, 0}; pb_ostream_t stream = {VectorStream::Write, &str, SIZE_MAX, 0}; pb_encode(&stream, ...);```

### 公開屬性

`it`
`size_t`

`vec`
`std::vector< uint8_t > *`

### 公開靜態函式

`Read(pb_istream_t *stream, uint8_t *buf, size_t count)`
`bool`

`Write(pb_ostream_t *stream, const uint8_t *buf, size_t count)`
`bool`

## 公開屬性

### it

`size_t tuningfork::VectorStream::it`

### vec

`std::vector< uint8_t > * tuningfork::VectorStream::vec`

`Write` 會根據需求調整向量大小。

## 公開靜態函式

### 讀取

```bool tuningfork::VectorStream::Read(
pb_istream_t *stream,
uint8_t *buf,
size_t count
)```

 `stream` 要讀取的串流。 `buf` 要寫入的緩衝區。 `count` 要讀取的位元組數。

True 表示成功，False 表示讀取錯誤。

### 寫入

```bool tuningfork::VectorStream::Write(
pb_ostream_t *stream,
const uint8_t *buf,
size_t count
)```

 `stream` 要寫入的串流。 `buf` 要從中讀取的緩衝區。 `count` 要寫入的位元組數。

True 表示成功，False 表示寫入錯誤。

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "translationIssue", "label":"Translation issue" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]