ZZIP_DIR * dir = zzip_dir_open("test.zip", 0);
char* data;
// Open the archive root directory.
if (dir)
{
ZZIP_DIRENT dirent;
// Loop through the files in the archive.
while(zzip_dir_read(dir, &dirent))
{
std::cout <
if (fp)
{
// File opened, allocate memory for it and read it into data.
data = (char*) malloc(dirent.st_size);
zzip_ssize_t len = zzip_file_read(fp, data, dirent.st_size);
zzip_file_close(fp);
/* do things with data ... */
std::cout << data<
}
else
{
zzip_dir_close(dir);
return 1;
}
}
zzip_dir_close(dir);
}
else
{
//something went wrong
}
No hay comentarios:
Publicar un comentario