CURL C ++ and gunzip

I am working on a program that reads headers from curl, executes and searches for a specific header, and if it is found, destroy some of the content and find another line in the content. I need to implement the last part. rest is done. Is there a way to unzip the contents from a C ++ program and save the result to another line and search for that line?

code snippets will be good. thank.

+3
source share
2 answers

Use Boost Iostreams . If bufis a string containing gzip'd data,

namespace io = boost::iostreams;

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

then read from gunzip.

+4
source

gunzip , execv() gunzip stdout ( ). , , , --.

0

All Articles