zipper
zipper copied to clipboard
Remove exception
Confusing API: either return false or throw exception. We should use a single poison :) When returning false could be nice to have a sterror/errno method to return a human readble error message.
If we want to do it more C++, then C. We can model it after the std::filesystem calls. Where you can give in an std::error_code that holds this information.
Unzipper zipfile("example.zip");
std::error_code err;
if(!zipfile.extract("someFolder", err) || err != 0){
//Something went wrong
std::cout << "Error extracting, got Zipper error msg: " << err.message() << "\n";
}
This allows us to just have multiple call, and keep the old API, and not break it.
This I belive I can start to implement that, but I am not familliar enough with the implementation of the C style getLastError
.. etc
Good point on using std::error :)
Closing since implemented on Unzipper for the v2.x.y branch. In gestation: the Zipper classe