Copying data out of Cord - CopyToArray/pread/memcpy like interface?
未关闭
question
- 主要语言
- C++
- 星标
- 18.1k
- 派生
- 3.2k
- 平均合并
- 20 小时 36 分钟
- 30 天内合并 PR
- 1
描述
Cord has CopyCordToString(). Could there be a helper function to copy to a char* buffer? For example,
```
// Copies the data in the cord from |offset| up to buffer |size|. Returns the actual number of bytes copied.
// Returns 0 if offset is out of bound.
size_t CopyToArray(char* buffer, size_t size, size_t offset = 0);
```
Alternatives considered: use cord.Subcord(offset, size) and iterate chunks, but Subcord() seems to have the overhead of creating new cord reps.
贡献指南
评估
这个 Issue 还没有评估数据。