rikyoz / bit7z

A C++ static library offering a clean and simple interface to the 7-zip shared libraries.
https://rikyoz.github.io/bit7z
Mozilla Public License 2.0
627 stars 114 forks source link

Support for callback when compress #4

Closed EruditePig closed 7 years ago

EruditePig commented 7 years ago

This is a great project. It make using 7z.dll more simple!

I want to add compress function to my program and with your support, I made it. it is faster than zlib. However, I want to show the compress process in UI. Can you add callback API?

Thank you for all your work!

rikyoz commented 7 years ago

You're welcome, and thank you for using it! I'm planning to add callback API in the next version 2.1.x. I hope to release it by the end of May.

rikyoz commented 7 years ago

I've implemented the API for callbacks, it is available in the develop branch (see class BitArchiveHandler, which now is the base class for every compressor and extractor class). Supported callbacks are:

Callbacks are stored as std::functions, hence callbacks can be lambdas, free functions, member functions, etc...

Obviously I'm open to any suggestion of improvement of the API!