Unziping a zip file with boost and Visual C++ 2005

2019-06-25 05:47发布

Is there a library in boost that can be used to unzip a zip file?

3条回答
做个烂人
2楼-- · 2019-06-25 06:13

I don't think boost can do it.

I'd suggest zlib, but you might find it hard to use. If you need a very simple (yet powerful) C++ wrapper (handling zip files directly unlike zlib), then ZIP Archive will do the trick ;) (the code needs a few adjustments but works well, I've ported it to Visual C++ 2008 and removed the ATL dependency, it's pretty straightforward).

查看更多
做个烂人
3楼-- · 2019-06-25 06:21

Why does it have to be boost? Can you not use zlib?

查看更多
一纸荒年 Trace。
4楼-- · 2019-06-25 06:37

boost::iostreams has a gzip filter that you can use. As a point of note, it only works on individually compressed files, not archives. In other words, it does not understand it if the archive has an internal directory structure (multiple files) instead of just compressing a single file. If you need the full archive functionality, then zlib is your best bet.

查看更多
登录 后发表回答