gpt4 book ai didi

c++ - 存储增量下载数据的最佳方式是什么?

转载 作者:行者123 更新时间:2023-11-28 01:11:49 26 4
gpt4 key购买 nike

灵感来自 Chromium's sha1 class ,我正在考虑使用 std::string 存储增量下载的数据

// pseudo-code
char buff[BUFF_SIZE];
std::string data;
do {
size = ReadInternetFileTo(buff,BUFF_SIZE);
data.append(buff,size);
} while (not_finished);

此方法有任何可预见的问题或更好的方法吗?

最佳答案

SGI 的好老Rope似乎非常适合,如果您的数据很大并且您可以使用 SGI 的 STL——正如他们的文档所说,

Unlike C strings, ropes are a reasonable representation for very long strings such as edit buffers or mail messages.

关于c++ - 存储增量下载数据的最佳方式是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2589674/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com