chinmayaposwalia
chinmayaposwalia

Reputation: 243

compression API for C++

i am making an application which first compresses a file and then transfer it. I am using 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.

Upvotes: 1

Views: 719

Answers (4)

Android Eve
Android Eve

Reputation: 14974

If you don't mind adding the overhead of wxWidgets, in exchange for convenience, you may want to look at wxZlibOutputStream and wxZlibInputStream.

Upvotes: 0

Pablo
Pablo

Reputation: 8644

Like Android Eve said, if you don't mind the overhead, there's also POCO's Zip component.

Upvotes: 0

Rup
Rup

Reputation: 34408

There is a port of the 7z SDK to Linux/UNIX: xz and liblzma. It's in most recent Linux distributions.

Upvotes: 0

Erik
Erik

Reputation: 91270

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.

Upvotes: 2

Related Questions