| gman.zipengine: | Constants | Functions | Types | Modinfo | Source |
| APPEND_STATUS_CREATE , UNZ_CASE_CHECK , UNZ_OK , Z_DEFLATED , Z_NO_COMPRESSION |
| bmx_set_file_mod_date_time | Sets the modified and access date of a file. Returns 0 on success or errno. |
| unzClose | Close unzip zip file. |
| unzCloseCurrentFile | Close current file. |
| unzeof | return 1 if the end of file was reached, 0 elsewhere. |
| unzGetCurrentFileSize | Gets info about the current file. |
| unzGetOffset | Get the current file offset. |
| unzLocateFile | Return status of desired file and sets the unzipped focus to it. |
| unzOpen | Open a zip file for unzip. |
| unzOpenCurrentFile | Opens the currently focused file. |
| unzOpenCurrentFilePassword | Opens the currently focused file using a password. |
| unzReadCurrentFile | Read current file, returns number of bytes. |
| unzSetOffset | Set the current file offset. |
| unztell | Give the current position in uncompressed data. |
| zipClose | Closes an open zip file. |
| zipOpen | Open new zip file (returns zipFile pointer) |
| zipOpenNewFileInZip | Open a file inside the zip file. |
| zipOpenNewFileWithPassword | Open a file inside the zip file using a password. |
| zipWriteInFileInZip | Write into a zip file. |
| tm | |
| TZipEStream | ZipEngine stream type. |
| TZipFileList | |
| ZipFile | |
| ZipReader | |
| ZipWriter |
| Const APPEND_STATUS_CREATE:Int | |
| Description | Append Modes. |
| Const UNZ_CASE_CHECK:Int | |
| Description | Compare modes. |
| Const UNZ_OK:Int | |
| Description | Result Codes. |
| Const Z_DEFLATED:Int | |
| Description | Compression methods. |
| Const Z_NO_COMPRESSION:Int | |
| Description | Compression levels. |
| Function bmx_set_file_mod_date_time:Int(filename$z, hours:Int, mins:Int, secs:Int, day:Int, month:Int, year:Int) | |
| Description | Sets the modified and access date of a file. Returns 0 on success or errno. |
| Function unzClose( zipFilePtr:Byte Ptr ) | |
| Description | Close unzip zip file. |
| Function unzCloseCurrentFile( zipFilePtr:Byte Ptr ) | |
| Description | Close current file. |
| Function unzeof:Int( zipFilePtr:Byte Ptr ) | |
| Description | return 1 if the end of file was reached, 0 elsewhere. |
| Function unzGetCurrentFileSize:Int( zipFilePtr:Byte Ptr ) | |
| Description | Gets info about the current file. |
| Function unzGetOffset:Long( zipFilePtr:Byte Ptr) | |
| Description | Get the current file offset. |
| Function unzLocateFile:Int( zipFilePtr:Byte Ptr, fileName$z, caseCheck:Int ) | |
| Description | Return status of desired file and sets the unzipped focus to it. |
| Function unzOpen:Byte Ptr( zipFileName$z ) | |
| Description | Open a zip file for unzip. |
| Function unzOpenCurrentFile:Int( zipFilePtr:Byte Ptr ) | |
| Description | Opens the currently focused file. |
| Function unzOpenCurrentFilePassword:Int(file:Byte Ptr, password$z) | |
| Description | Opens the currently focused file using a password. |
| Function unzReadCurrentFile:Int( zipFilePtr:Byte Ptr, buffer:Byte Ptr, size:Int ) | |
| Description | Read current file, returns number of bytes. |
| Function unzSetOffset:Int( zipFilePtr:Byte Ptr, pos:Long ) | |
| Description | Set the current file offset. |
| Function unztell:Int( zipFilePtr:Byte Ptr ) | |
| Description | Give the current position in uncompressed data. |
| Function zipClose( zipFilePtr:Byte Ptr, archiveName$z ) | |
| Description | Closes an open zip file. |
| Function zipOpen:Byte Ptr( fileName$z, append:Int ) | |
| Description | Open new zip file (returns zipFile pointer) |
| Function zipOpenNewFileInZip( zipFilePtr:Byte Ptr, fileName$z, zip_fileinfo:Byte Ptr, extrafield_local:Byte Ptr, size_extrafield_local:Int, extrafield_global:Byte Ptr, size_extrafield_global:Int, comment$z, compressionMethod:Int, level:Int ) | |
| Description | Open a file inside the zip file. |
| Function zipOpenNewFileWithPassword( zipFilePtr:Byte Ptr, fileName$z, zip_fileinfo:Byte Ptr, extrafield_local:Byte Ptr, size_extrafield_local:Int, extrafield_global:Byte Ptr, size_extrafield_global:Int, comment$z, compressionMethod:Int, level:Int, password$z, crc:Long ) | |
| Description | Open a file inside the zip file using a password. |
| Function zipWriteInFileInZip( zipFilePtr:Byte Ptr, buffer:Byte Ptr, bufferLength:Int ) | |
| Description | Write into a zip file. |
| Type tm |
| Type tm_zip |
| Type TZipEStream Extends TStream | |
| Description | ZipEngine stream type. |
| Information | ZipEngine has as stream wrapper so that files within the ZIP can be opened using OpenStream(). The format for the url is: zipe::zipfilename::file_in_zip::password The ::password portion is only required if the ZIP has a password. |
| Type TZipFileList |
| Methods Summary | |
|---|---|
| deletePathFromFilename | Deletes the path from a filename. |
| extractFilename | Splits filename from zip file into useful filenames And paths. |
| findFile | Locates a file entry by name and returns its SZipFileEntry. |
| getFileCount | Returns count of files in archive. |
| getFileInfo | Returns information about a file entry in the ZIP. |
| ScanCentralHeader | Scans the central header for files. Returns true if successful. |
| Functions Summary | |
|---|---|
| Create | Creates a new TZipFileList object. |
| Method deletePathFromFilename(filename:String Var) | |
| Description | Deletes the path from a filename. |
| Method extractFilename(entry:SZipFileEntry) | |
| Description | Splits filename from zip file into useful filenames And paths. |
| Method findFile:SZipFileEntry(simpleFilename:String) | |
| Description | Locates a file entry by name and returns its SZipFileEntry. |
| Method getFileCount:Int() | |
| Description | Returns count of files in archive. |
| Method getFileInfo:SZipFileEntry(index:Int) | |
| Description | Returns information about a file entry in the ZIP. |
| Method ScanCentralHeader:Int() | |
| Description | Scans the central header for files. Returns true if successful. |
| Function Create:TZipFileList(file:TStream,bIgnoreCase:Int,bIgnorePaths:Int) | |
| Description | Creates a new TZipFileList object. |
| Type ZipFile Abstract |
| Methods Summary | |
|---|---|
| clearFileList | Clears the stored list of file information. |
| getFileCount | Returns the of files contained in the zip file. |
| getFileInfo | Returns the SZipFileEntry object information for a file entry in the ZIP. |
| getFileInfoByName | Locates a file entry by name and returns its SZipFileEntry. |
| getName | Returns the name of the name of the zip. |
| readFileList | Stores information about the files in a zip file into a list. |
| setName | Stores the name of the current zip file. |
| Method clearFileList() | |
| Description | Clears the stored list of file information. |
| Method getFileCount:Int() | |
| Description | Returns the of files contained in the zip file. |
| Method getFileInfo:SZipFileEntry(index:Int) | |
| Description | Returns the SZipFileEntry object information for a file entry in the ZIP. |
| Method getFileInfoByName:SZipFileEntry(simpleFilename:String) | |
| Description | Locates a file entry by name and returns its SZipFileEntry. |
| Method getName:String() | |
| Description | Returns the name of the name of the zip. |
| Method readFileList() | |
| Description | Stores information about the files in a zip file into a list. |
| Method setName(zipName:String) | |
| Description | Stores the name of the current zip file. |
| Type ZipReader Extends ZipFile |
| Methods Summary | |
|---|---|
| CloseZip | Closes a zip file. |
| ExtractFile | Extracts a file from the zip to RAM. |
| ExtractFileToDisk | Extracts a file or directory from the zip to disk. |
| OpenZip | Opens a zip file for reading. |
| Method CloseZip() | |
| Description | Closes a zip file. |
| Method ExtractFile:TRamStream( fileName:String, caseSensitive:Int = False, password:String="" ) | |
| Description | Extracts a file from the zip to RAM. |
| Method ExtractFileToDisk:Int( fileName:String, outputFileName:String, caseSensitive:Int = False, password:String="" ) | |
| Description | Extracts a file or directory from the zip to disk. |
| Method OpenZip:Int( name:String ) | |
| Description | Opens a zip file for reading. |
| Type ZipWriter Extends ZipFile |
| Methods Summary | |
|---|---|
| AddFile | Adds a file to the zip. |
| AddFileToDest | Adds a file to the zip using a different path and/or filename. |
| AddStream | Adds a file to the zip from a stream. |
| CloseZip | Closes a zip file. |
| OpenZip | Opens a zip file for writing. |
| SetCompressionLevel | Set level of compression. |
| Method AddFile( fileName:String, password:String = "" ) | |
| Description | Adds a file to the zip. |
| Method AddFileToDest( fileName:String, destFile:String, password:String = "" ) | |
| Description | Adds a file to the zip using a different path and/or filename. |
| Method AddStream( data:TStream, fileName:String, password:String="" ) | |
| Description | Adds a file to the zip from a stream. |
| Method CloseZip( description:String = "" ) | |
| Description | Closes a zip file. |
| Method OpenZip:Int( name:String, append:Int ) | |
| Description | Opens a zip file for writing. |
| Method SetCompressionLevel( level:Int ) | |
| Description | Set level of compression. |
| Version | 2.15 |
|---|---|
| Author | gman |
| License | Public Domain |
| Credit | This mod makes use if the ZLib C functions by Gilles Vollant (http://www.winimage.com/zLibDll/unzip.html) |
| Credit | This mod was initially created by Thomas Mayer |
| Credit | Smurftra for his DateTime functions (http://www.blitzbasic.com/codearcs/codearcs.php?code=1726) |
| Credit | JoshK (and others) for the CRC functions (http://www.blitzmax.com/Community/posts.php?topic=97273) |
| History | 2005/11/14 GG - updated to be compatible with BMAX v1.12 |
| History | 2005/12/05 GG - updated to be compatible with BMAX v1.14 |
| History | 2005/12/07 GG - created new ZipRamStream and updated extractfile() to use new stream |
| History | 2005/12/14 GG - fixed bug in readFileList() where it was trying to read from an empty (new) file |
| History | 2005/12/14 GG - changed to SuperStrict and fixed all missing declarations |
| History | 2005/12/17 GG - added clearing of filename and filelist in closezip() |
| History | 2006/07/15 GG - added datetime stamps to zipped file information (reported by Grisu) |
| History | 2006/07/15 GG - fixed filecount not counting added files (reported by Lomat) |
| History | 2006/07/15 GG - added AddStream() method to allow adding a stream as a file |
| History | 2007/07/17 GG - changed to gman.ZipEngine |
| History | 2009/02/10 GG - fixed AddStream() bug found by peterigz |
| History | 2009/02/15 GG - converted to scan central headers instead of local headers |
| History | 2009/02/15 GG - Added stream wrapper for ZipEngine |
| History | 2009/02/27 GG - Updated central directory scan routine to be faster |
| History | 2010/06/30 GG - Fixed issue with AddFileToDest where destination filename was not being used |
| History | 2010/07/26 GG - Fixed issue with extracting directories to disk |
| History | 2010/07/26 GG - Fixed issue with trying to extract to an in use file. Added return value to ExtractFileToDisk. |
| History | 2010/07/27 GG - Added timestamping of extracted files. |
| History | 2010/07/28 GG - Changed to use utime instead of _utime to support MacOSX. |
| History | 2012/03/23 GG - Fixed issue with CRC check found by JoshK. |