compression API for C++
i am making an application which first compresses a file and then transfer it. I am usi开发者_JS百科ng C++ as language in UNIX environment. I am unable to find any suitable library for my need. I checked but couldn't find any API for gunzip. Similarly 7zip also has SDK for windows only. It would be great if the library could provide percentage completed/left while the compression is in progress.
I read about Gzstream Library which is a wrapper of Zlib and also Boost IOStreams.
Please suggest the alternatives (if any) or the pros and cons of the library.
zlib or bzip2 - Easy to use and well tested. bzip2 tends to compress better, zlib tends to be faster. Or you could use QuickLZ if speed matters most of all.
There is a port of the 7z SDK to Linux/UNIX: xz and liblzma. It's in most recent Linux distributions.
Like Android Eve said, if you don't mind the overhead, there's also POCO's Zip component.
If you don't mind adding the overhead of wxWidgets, in exchange for convenience, you may want to look at wxZlibOutputStream and wxZlibInputStream.
精彩评论