-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Running the following code (in a directory containing the attached input.txt file) results in a CRC error and then throws Poco::IllegalStateException.
#include <Poco/Zip/Decompress.h>
#include <Poco/Zip/Compress.h>
#include <Poco/Delegate.h>
#include <sstream>
#include <iostream>
struct Test {
void test() {
std::stringstream output;
Poco::Zip::Compress zip(output, false);
zip.addFile("input.txt", "output.txt");
zip.close();
std::stringstream input(output.str());
Poco::Zip::Decompress unzip(input, ".");
unzip.EError += Poco::Delegate<Test, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &Test::onDecompressError);
unzip.decompressAllFiles();
}
void onDecompressError(const void* pSender, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>& info)
{
std::cout << info.second << "\n";
}
};
int main(int argc, char* argv[])
{
Test().test();
}
Reactions are currently unavailable