Open wallclimber21 opened 9 years ago
Can you rename the method to be "enumerate" instead of "iterate" to be consistent with NSArray, NSFileManager, NSFastEnumeration etc.
Not sure if it will automatically show up here, but there was a crucial bug in the unzip code, that I fixed after renaming the iterate to enumerate. It's already present in my tree.
This patch adds the following iterator function:
It loops over all entires in a zip file. For each entry, it first calls the CheckDecompressBlock to see if the file should be decompressed, and if so, then call the dataAcceptBlock with the decompressed data.
For some cases, this reduces the peak memory usage by orders of magnitude. (E.g. I have a .zip file with a thousand smaller entries that need to be imported into a sqlite database.)
The patch also refactors UnzipFileToMemory and getZipFileContents to use this iterator.