ZIPFILE Class Reference

A class for reading ZIP files. More...

#include <mi32/zipfile.h>

Inheritance diagram for ZIPFILE:
Inheritance graph
[legend]

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

ZIPFILE::ZIPFILE (  ) 
ZIPFILE::~ZIPFILE (  ) 

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
ERRVALUE ZIPFILE::AddFile ( const FILEPATH zippath,
const FILEPATH filepath,
const MISTRING name,
bool  DoDeleteFiles = false 
)

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
ERRVALUE ZIPFILE::AddFile ( const FILEPATH zippath,
const FILEPATH filepath,
bool  DoDeleteFiles = false 
)

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
void ZIPFILE::Close (  ) 
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
ERRVALUE ZIPFILE::GetFileList ( MISTRINGLIST FileNameList  ) 

Get a list of files in this zip file.

The file must be open in order to get the list

ERRVALUE ZIPFILE::GetGlobalComment ( MISTRING comment  ) 

Get the global comment string for the zip file.

The file must be open

MISTRING ZIPFILE::GetNext (  )  const

Move current pointer to next file and return name of file.

ERRVALUE ZIPFILE::Open ( const FILEPATH filepath,
const MISTRING filename,
const char *  password = 0,
FILE_ACCESS  access = FILE_ACCESS_Read,
FILE_SHARE  share = FILE_SHARE_Any 
)

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
ERRVALUE ZIPFILE::Open ( const FILEPATH filepath,
FILE_ACCESS  access = FILE_ACCESS_Read,
FILE_SHARE  share = FILE_SHARE_Any 
)

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.

ERRVALUE ZIPFILE::OpenCurrentFile (  ) 

Open current file.

ERRVALUE ZIPFILE::OpenInZip ( const MISTRING filename  ) 

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.
ERRVALUE ZIPFILE::Unzip ( const FILEPATH filepath,
const FILEPATH output,
bool  bDeleteAfterUnzip 
)

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:

Generated on Sun Oct 7 21:34:02 2012 for TNTsdk 2012 by  doxygen 1.6.1