I'm searching for a way to extract a file in c++ by using the boost::iostreams classes.
There is an example in the boost documentation. But it outputs the content of the compressed file to std::cout. I'm looking for a way to extract it to a file structure.
Does anybody know how to do that?
Thanks!
Boost.IOStreams does not support compressed archives, just single compressed files. If you want to extract a .zip or .tar file to a directory tree, you'll need to use a different library.
The example in the documentation shows how to decompress the file and push the result to another stream.
If you want the output to be directed to an in-memory array instead, you can use a stream of type boost::iostreams::stream<boost::iostreams::array_source>
instead.
That is basically a stream-wrapper around an array.
I'm not sure what you mean when you say you want the output in "a file structure" though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With