BigSpeed Zip DLL

 Description of API functions - C++ style
 

int __stdcall zOpenZipFile(char *ZipFileName);
This function opens zip file and creates a list of items, corresponding to contents of zip file. Must be called before any other function to get access to zip file. ZipFileName is the path and full name of zip file, for example: 'C:\TEST.ZIP'. Returns zero on success.
 

int __stdcall zCloseZipFile(void);
Closes zip file, opened with zOpenZipFile or created with zCreateNewZip. Returns zero on success.
 

int __stdcall zGetTotalFiles(void);
Returns the total number of compressed files within zip file, i.e. the number of items in the list. First item has index = 0, last item has index = zGetTotalFiles-1
 

int __stdcall zGetTotalBytes(void);
Returns the sum of uncompressed file size of all files within zip file.
 

int __stdcall zGetSelectedFiles(void);
Returns the number of currently selected files.
 

int __stdcall zGetSelectedBytes(void);
Returns the sum of uncompressed file size of selected files within zip file.
 

char *  __stdcall zGetLastErrorAsText(void);
If some error occurs in the DLL, this function will return the string, describing the error.
 

int __stdcall zGetSkipedFiles(void);
After extracting operation, this function will return the number of skipped files - usually zero.
 

bool __stdcall zGetRunTimeInfo(int &ProcessedFiles,int &ProcessedBytes);
This function returns the number of currently processed files and bytes. This is necessary to calculate position of progress indicator. Returns true on success.
 

bool __stdcall zCancelOperation(void);
To cancel compress or extract operation, call this function.
 

int __stdcall zExtractOne(int ItemNo,char *ExtractDirectory,char *Password,
  bool OverwriteExisting,bool UseFolders,bool TestOnly,void (__stdcall *RTInfoFunc)(void));
Extracts only one of the file in zip file. This is useful for viewing/launching files. Parameters are:

ItemNo -  Item number of the file in the list.
0<= ItemNo <= zGetTotalFile-1

ExtractDirectory - Directory where to extract files. If empty, current directory is used.

Password - password to be used, if file is encrypted.

OverwriteExisting - if true, any existing file will be overwritten, otherwise will be skipped.

UseFolders - if true, the relative path information stored in zip file will be used to determine location of the extracting file.

TestOnly - if true, files are only tested, not saved to disk.

RTInfoFunc - pointer to the application function, which will be called periodically from library to show runtime information, for example some kind of progress bar. Within this function, application can call zGetRunTimeInfo or zCancelOperation. If nil, no runtime information will be available.

Return value is zero on success, otherwise application can call zGetLastErrorAsText to get type of error.
 

int __stdcall zExtractSelected(char *ExtractDirectory,char *Password,
  bool OverwriteExisting,bool UseFolders,bool TestOnly,void (__stdcall *RTInfoFunc)(void));
Extracts only files in the list, previously selected by zSelectFile. Parameters are the same as in zExtractOne. Returns zero on success.
 

int __stdcall zExtractAll(char *ExtractDirectory,char *Password,
  bool OverwriteExisting,bool UseFolders,bool TestOnly,void (__stdcall *RTInfoFunc)(void));
Extracts all files. Parameters are the same as in zExtractOne. Returns zero on success.
 

char *  __stdcall zGetFileName(int i);
Returns the name of the file in the list with index i.
 

char *  __stdcall zGetFileExt(int i);
Returns the extension of the file in the list with index i.
 

char *  __stdcall zGetFilePath(int i);
Returns the stored path of the file in the list with index i.
 

int __stdcall zGetFileDate(int i);
Returns the MSDOS date of the file in the list with index i.
 

int __stdcall zGetFileTime(int i);
Returns the MSDOS time of the file in the list with index i.
 

int __stdcall zGetFileSize(int i);
Returns the uncompressed size of the file in the list with index i.
 

int __stdcall zGetCompressedFileSize(int i);
Returns the compressed size of the file in the list with index i.
 

bool __stdcall zFileIsEncrypted(int i);
Returns true, if file in the list with index i is encrypted.
 

char *  __stdcall zGetLastOperResult(int i);
Returns the result of the last operation on the file in the list with index i, where  0 =< i < number of processed files . Usually 'Ok.'
 

bool __stdcall zFileIsSelected(int i);
Returns true, if file in the list with index i is selected.
 

bool __stdcall zSelectFile(int i,bool how);
Select/Unselect file in the list with index i. If how is true, the file will be selected, otherwise will be unselected.
 
 
 

 

int __stdcall zCreateNewZip(char *ZipFileName);
Creates new empty zip file witn name ZipFileName, for example: "C:\temp\test.zip". Returns zero on success.

 

int __stdcall zOrderFile(char *FileName, char *StoredName, int UpdateMode);
Call this function after zCreateNewZip or zOpenZipFile for every file, which must be included in the Zip file. The function checks if the file already exists in the archive, date and time of the file depending of the UpdateMode, and if the conditions are true, adds the file to the list of "to be compressed files". Parameters are:
 
FileName - the full path and name of the file, for example: "C:\TEMP\TEST.TXT"

StoredName - this is the path and the name, under wich the file must be stored in zip file, for example: "TEMP\TEST.TXT".

UpdateMode - points if the file must be added if it is already exists in the archive. There are 3 possible values:
 
  0 - "Add (and Replace) file", if file does not exist in the archive, it will be added, if exists, it will be replaced.
 
  1 - "Freshen file", file will be compressed only if it already exists in the archive and is newer.

  2 - "Update file", file will be compressed if does not exists in the archive or if it exists, but is newer.
 

The return value is zero if the file is succesfuly added to "Add List".
 
 

int __stdcall zCompressFiles(char *Password, int CompressionMethod,
  bool ResetArchiveAttribute, void (__stdcall *RTInfoFunc)(void));
Call this function to actually compress the files, previously requested with zOrderFile. Parameters are: 
 
Password - if is not empty, the files will be encrypted with this password.

CompressionMethod - there 4 possible values:
 
   0 : Stored, no compression
   1 : Fast compression
   2 : Normal compression
   3 : Max compression

ResetArchiveAttribute - if it is true, the Archive attribute of the file will be reset after the compressing of the file.

RTInfoFunc - pointer to the application function, which will be called periodically from library to show runtime information, for example some kind of progress bar. Within this function, application can call zGetRunTimeInfo or zCancelOperation. If nil, no runtime information will be available.
 
 
Return value is zero on success, otherwise application can call zGetLastErrorAsText to get type of error.

Just before return, this function call internally zOpenZipFile, so the zip file is opened. You can directly browse it. Do not forget to close it with zCloseZipFile.
 

 

 

(c) BigSpeedSoft, 1999