ZIPFILE Class Reference
A class for reading ZIP files.
More...
#include <mi32/zipfile.h>
List of all members.
Public Member Functions |
| | ZIPFILE () |
| | ~ZIPFILE () |
| ERRVALUE | AddDirectory (const FILEPATH &zippath, const FILEPATH &directory, bool DoSubDirectories=false, bool DoDeleteFiles=false, bool IncludeDirectory=false) |
| ERRVALUE | AddFile (const FILEPATH &zippath, const FILEPATH &filepath, const MISTRING &name, bool DoDeleteFiles=false) |
| ERRVALUE | AddFile (const FILEPATH &zippath, const FILEPATH &filepath, bool DoDeleteFiles=false) |
| void | Close () |
| bool | Find (const MISTRING &filename) |
| ERRVALUE | GetFileList (MISTRINGLIST &FileNameList) |
| ERRVALUE | GetGlobalComment (MISTRING &comment) |
| MISTRING | GetNext () const |
| ERRVALUE | Open (const FILEPATH &filepath, const MISTRING &filename, const char *password=0, FILE_ACCESS access=FILE_ACCESS_Read, FILE_SHARE share=FILE_SHARE_Any) |
| ERRVALUE | Open (const FILEPATH &filepath, FILE_ACCESS access=FILE_ACCESS_Read, FILE_SHARE share=FILE_SHARE_Any) |
| ERRVALUE | OpenCurrentFile () |
| ERRVALUE | OpenInZip (const MISTRING &filename) |
| void | SetCompression (int compression=9) |
| ERRVALUE | Unzip (const FILEPATH &filepath, const FILEPATH &output, bool bDeleteAfterUnzip) |
Detailed Description
A class for reading ZIP files.
Constructor & Destructor Documentation
Member Function Documentation
| ERRVALUE ZIPFILE::AddDirectory |
( |
const FILEPATH & |
zippath, |
|
|
const FILEPATH & |
directory, |
|
|
bool |
DoSubDirectories = false, |
|
|
bool |
DoDeleteFiles = false, |
|
|
bool |
IncludeDirectory = false | |
|
) |
| | |
Add a directory and its files to a zip file.
- Parameters:
-
| zippath | Filepath of target zipfile |
| directory | Filepath of directory containing files to zip |
| DoSubDirectories | Process all sub-folders and files |
| DoDeleteFiles | Delete source file after adding to zip file |
| IncludeDirectory | Include the directory itself in zipfile |
Add a file to a zip file.
- Parameters:
-
| zippath | Filepath of target zipfile |
| filepath | Filepath of file to add to zip |
| name | Name to give file in zip |
| DoDeleteFiles | Delete source file after adding to zip file |
Add a file to a zip file.
- Parameters:
-
| zippath | Filepath of target zipfile |
| filepath | Filepath of file to add to zip |
| DoDeleteFiles | Delete source file after adding to zip file |
| bool ZIPFILE::Find |
( |
const MISTRING & |
filename |
) |
|
Find a file with a zip file.
Tries the next file from current pointer. If not correct file, then locates the file by iterating through list.
- Parameters:
-
| filename | Name of the file within the file |
Get a list of files in this zip file.
The file must be open in order to get the list
Get the global comment string for the zip file.
The file must be open
Move current pointer to next file and return name of file.
Open a file within a zip file.
Note: the only access modes supported are Read and Create. There is no way to write an existing file in the zip file nor to delete one.
- Parameters:
-
| filename | Name of the file within the file |
| password | Password if neccessary |
Open a zip file.
This only gives access to the directory of the file. To open a particular file within the zip file, call another method.
Open a file within a zip file.
This method requires that zipfile be already open for write
- Parameters:
-
| filename | Name of the file within the file |
| void ZIPFILE::SetCompression |
( |
int |
compression = 9 |
) |
|
Value ranges from 0(Z_NO_COMPRESSION) to 9(Z_BEST_COMPRESSION) and 1 is Z_BEST_SPEED.
- Parameters:
-
| compression | Most usefull usually. |
Unzip contents to location.
- Parameters:
-
| filepath | Location of zipfile |
| output | Location to unzip to |
| bDeleteAfterUnzip | Delete zipfile after unzipping |
The documentation for this class was generated from the following file: