#include #include #include #include "Zipex/Zipex.h" #include "Zipex/zstream.h" using namespace Zipex; using namespace std; // ############################################################################################# // // # main() # // // ############################################################################################# // /** Program entry point */ int main(void) { try { // Open "hello.zip" ZipArchive hellozip("hello.zip"); // Get access to a file from the opened zip ZippedFile &worldfile = hellozip.getFile("world.zip"); // Open the nested archive directly from the file { ZipArchive worldzip(&worldfile); // Get access to a file in the nested zip archive ZippedFile &messagefile = worldzip.getFile("message.txt"); // Display the file's name and size cout << messagefile.getFilename() << endl; cout << messagefile.getSize() << " bytes" << endl; // Read and display a string of up to 32 bytes from the file char test[32] = { 0 }; messagefile.readData(test, sizeof(test) - 1); // reads less if eof encountered cout << test << endl; } } catch(const std::exception &e) { cerr << e.what() << endl; //throw; } return 0; }