Unit ziptypes

Classes

Functions

Upper - rudimentary "uppercase" function

Types

buftype
nWord
pReportRec
TDirtype
TReportRec
TZipRec
UnzipQuestionProc
UnzipReportProc

Constants

file_completed
file_Failure
file_starting
file_unzipping
tBufSize
tFSize
UnzipActions
Unzipmethods
unzip_completed
unzip_CRCErr
unzip_Encrypted
unzip_FileError
unzip_InternalError
unzip_InUse
unzip_MissingParameter
unzip_NoMoreItems
unzip_NotSupported
unzip_NotZipfile
unzip_Ok
unzip_ReadErr
unzip_SeriousError
unzip_starting
unzip_UserAbort
unzip_WriteErr
unzip_ZipFileErr

Variables


Functions


FUNCTION Upper ( s : String ) : String;

rudimentary "uppercase" function

Types


buftype  = ARRAY [ 0..tBufSize ] of char;
filename length} { Record for UNZIP
nWord   = longint
Type definitions for UNZIP * original version by Christian Ghisler * extended and amended for Win32 by Dr Abimbola Olowofoyeku (The African Chief) Homepage: http://ourworld.compuserve.com/homepages/African_Chief {$i unzip.inc
pReportRec = ^TReportRec
TZipRec } { record for callback progress Reports, etc.
TDirtype = ARRAY [ 0..tFSize ] of char;

TReportRec = record
FileName : tdirtype;
Time : Longint;
Size : Longint;
CompressSize : Longint;
Attr : integer;
PackMethod : Word;
Ratio : byte;
Status : longint;
end;
passed to callback functions
TZipRec = record
buf : ^buftype;
bufsize : word;
localstart : word;
Time : Longint;
Size : Longint;
CompressSize : Longint;
headeroffset : Longint;
FileName : tdirtype;
PackMethod : word;
Attr : Byte;
end;

UnzipQuestionProc = FUNCTION ( Rec : pReportRec ) : Boolean
procedural type for "Report" callback: the callback function (if any) is called several times during the unzip process Error codes are sent to the callback in "Retcode". Other details are sent in the record pointed to by "Rec". * Note particularly Rec^.Status - this contains information about the current status or stage of the unzip process. It can have any of the following values; (archive status) unzip_starting = starting with a new ZIP archive (rec^.filename) unzip_completed = finished with the ZIP archive (rec^.filename) (file status) file_starting = starting to unzip (extract) a file (from archive) file_unzipping = continuing to unzip a file (from archive) (when this status value is reported, the actual number of bytes written to the file are reported in "Retcode"; this is valuable for updating any progress bar) file_completed = finshed unzip a file (from archive) file_Failure = could not extract the file (from archive)
UnzipReportProc  = PROCEDURE ( Retcode : longint;Rec : pReportRec )
completed this ZIP file} { procedural types for callbacks

Constants

file_completed = -1002

continuing the unzip process; file

file_Failure = -1003

completed the unzip process; file

file_starting = -1000

TReportRec} { callback status codes

file_unzipping = -1001

beginning the unzip process; file

tBufSize = {$ifdef Win32}256 * 1024

tFSize = {$ifdef Win32}259

buffer size

UnzipActions = ( 'copying', 'unshrinking', 'unreducing 1', 'unreducing 2', 'unreducing 3', 'unreducing 4', 'exploding', 'un-tokenizing', 'inflating', 'skipping' )

unzip actions being undertaken

Unzipmethods = ( 'stored', 'shrunk', 'reduced 1', 'reduced 2', 'reduced 3', 'reduced 4', 'imploded', 'tokenized', 'deflated', 'skipped' )

missing parameter} { the various unzip methods

unzip_completed = -1005

starting with a new ZIP file

unzip_CRCErr = -1

unzip_Encrypted = -7

unzip_FileError = -11

unzip_InternalError = -9

unzip_InUse = -8

unzip_MissingParameter = -500

serious error

unzip_NoMoreItems = -10

Error in zip format

unzip_NotSupported = -6

unzip_NotZipfile = -12

Error Accessing file

unzip_Ok = 0

procedural type for "Question" callback:if a file already exists, the callback (if any) will be called to ask whether the file should be overwritten by the one in the ZIP file; the details of the file in the ZIP archive are supplied in the record pointed to by "Rec" in your callback function, you should; return TRUE if you want the existing file to be overwritten return FALSE is you want the existing file to be skipped {Error codes returned by the main unzip functions

unzip_ReadErr = -3

unzip_SeriousError = -100

not a zip file

unzip_starting = -1004

failure in unzipping file

unzip_UserAbort = -5

unzip_WriteErr = -2

unzip_ZipFileErr = -4


Variables