Comments (2)
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.
from bit7z.
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:
- Total callback (signature:
void( uint64_t )
), whose argument is the total size of the archive to be extracted or of the files to be compressed (it is called at the beginning of any operation). - Progress callback (signature:
void( uint64_t )
), whose argument is the current processed size; calculating the ratio between the processed size and the total size (given by the total callback) gives the current operation progress (e.g.static_cast<int>( ( 100.0 * completed ) / total )
) - Ratio callback (signature:
void( uint64_t, uint64_t )
), in which the two arguments are, respectively, the input size and output size (e.g. compression ratio can be calculated asstatic_cast<int>( ( 100.0 * out_size ) / in_size )
). - File callback (signature:
void( wstring )
), whose argument is the name of the file currently being processed. - Password callback (signature:
wstring()
), which is called when a password was not specified in code (e.g. throughsetPassword
method) but it is needed in order to open and/or extract the archive; the callback must return awstring
containing the password entered by the user.
Callbacks are stored as std::function
s, hence callbacks can be lambdas, free functions, member functions, etc...
Obviously I'm open to any suggestion of improvement of the API!
from bit7z.
Related Issues (20)
- [Feature Request]: custom suffix format HOT 1
- [Bug]: Issues regarding the Fat32 and Exfat file systems HOT 8
- [Bug]: Errors related to file compression HOT 4
- [Feature Request]: Can you provide a method for setting the file time HOT 1
- [build-error]: Failed to open the archive file: No such process HOT 2
- [Bug]: UpdateMode::Update not working as expected, throwing exception HOT 3
- [Feature Request]: Creation or extraction archive file in one line HOT 1
- [Feature Request]: Support for compressed packages in four formats: ace, img, uue, and war HOT 2
- [Feature Request]: Extracting files whose names contain forbidden characters HOT 1
- Do I need to build 7zip myself? HOT 6
- [Bug]:
- [Bug]: Multiple Definition Linker Error for IID_IUnknown HOT 10
- [Bug]: BIT7Z_DISABLE_USE_STD_FILESYSTEM not working HOT 4
- [Bug]: Compile error when bit7z.lib is introduced into the project. HOT 11
- [Feature Request]: Is "tstring_to_path" forgotten here? HOT 1
- [Bug]: HOT 3
- [Feature Request]: Compresses files open for writing by another applications HOT 1
- [Bug]: CreateObject 函数调用异常
- [Bug]: core dump with BitArchiveWriter HOT 9
- [Bug]: Some zip file names are garbled HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bit7z.