gpt4 book ai didi

c++ - cURL c++ 和 gunzip

转载 作者:太空狗 更新时间:2023-10-29 21:07:22 26 4
gpt4 key购买 nike

我正在开发一个程序,该程序从 curl 函数读取 header 并搜索特定 header ,如果找到,则压缩内容部分并在内容中搜索另一个字符串。我需要实现最后一部分。休息完成了。有没有办法从 C++ 程序中解压缩内容并将结果保存到另一个字符串并搜索该字符串?

代码片段会很好。谢谢。

最佳答案

使用Boost Iostreams .如果 buf 是一个包含 gzip 数据的字符串,

namespace io = boost::iostreams;

io::filtering_istream gunzip;
gunzip.push(io::gzip_decompressor());
gunzip.push(std::istringstream(buf));

然后从 gunzip 读取。

关于c++ - cURL c++ 和 gunzip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5272253/

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