Yes this good. (But if you ever don't like C code, you should take a look at the 7-zip SDK, which has code in C ++ and C #.)
- All functions for viewing and unpacking files from the zip archive are located in:
unzip.h - All functions for compressing and adding files to the zip archive are located in:
zip.h
(see contrib \ minizip \ unzip.h and contrib \ minizip \ zip.h )
for example unpacking: the unzOpen() functions of your mail file return unzFile
then use unzGoToFirstFile() and unzGoToNextFile() on that unzFile to view all files in the archive.
then you will get file information for each file using unzGetCurrentFileInfo() , namely its size,
unzOpenCurrentFile() course you should call unzOpenCurrentFile() at some point.
and call unzReadCurrentFile() using the size from fileinfo to get the binary contents of the archive file.
optionally, there is an opaque structure that you can provide for using your own I / O function, but obviously there is a default win32 implementation for accessing the file, so you donβt even have to worry about that.
PS: and don't forget to call unzCloseCurrentFile ()
Stephane rolling
source share