zeus::TZipFile Class Reference

#include <ZipFile.h>

Inheritance diagram for zeus::TZipFile:

zeus::TFile zeus::TZObject zeus::IZUnknown

List of all members.

Public Member Functions

 TZipFile (const TString &rFileName)
Retval addFileEntry (const IString &rEntryName, const IString &rFileName, bool bOverwriteIfExists, Int iZipLevel=4)
Retval deleteFileEntry (Int iIndex)
Retval getFileEntry (Int iIndex, TZippedFileEntry *&rpEntry) const
Retval getFileEntryByName (const IString &rEntryName, TZippedFileEntry *&rpEntry) const
Int getFileEntryCount () const
bool isValid () const
Retval removeFileEntry (const IString &rEntryName)
void createArchive ()
Retval saveArchive ()
void setPassword (const IString &rPassword)
Retval unzipAllFiles (const IString &rTargetDirectory, bool bOptUsePath=true, bool bOptOverwrite=false)
Retval unzipFiles (const IString &rTargetDirectory, const IStringList &lstEntries, bool bOptUsePath=true, bool bOptOverwrite=false)
Retval unzipSingleFile (const IString &rTargetDirectory, const IString &rFileEntry, bool bOptUsePath=true, bool bOptOverwrite=false)

Protected Member Functions

virtual ~TZipFile ()
void checkOpen () const
void close ()


Detailed Description

This class represents a zip file. Reading and writing zip files can be done using the provided methods

Constructor & Destructor Documentation

TZipFile::TZipFile ( const TString rFileName  ) 

Creates a ZipFile

TZipFile::~TZipFile (  )  [protected, virtual]

Destroys the ZipFile


Member Function Documentation

Retval TZipFile::addFileEntry ( const IString rEntryName,
const IString rFileName,
bool  bOverwriteIfExists,
Int  iZipLevel = 4 
)

Retval TZipFile::deleteFileEntry ( Int  iIndex  ) 

Retval TZipFile::getFileEntry ( Int  iIndex,
TZippedFileEntry *&  rpEntry 
) const

Retval TZipFile::getFileEntryByName ( const IString rEntryName,
TZippedFileEntry *&  rpEntry 
) const

Int TZipFile::getFileEntryCount (  )  const

bool TZipFile::isValid (  )  const

Retval TZipFile::removeFileEntry ( const IString rEntryName  ) 

void TZipFile::createArchive (  ) 

creates a new archive. Use saveArchive to store the new archive back to the HD

Retval TZipFile::saveArchive (  ) 

saves the archive

void zeus::TZipFile::setPassword ( const IString rPassword  )  [inline]

sets the password of the zip file

Retval TZipFile::unzipAllFiles ( const IString rTargetDirectory,
bool  bOptUsePath = true,
bool  bOptOverwrite = false 
)

unzips a file without any password

Retval TZipFile::unzipFiles ( const IString rTargetDirectory,
const IStringList lstEntries,
bool  bOptUsePath = true,
bool  bOptOverwrite = false 
)

Unzips all files of the zip into a directory

Parameters:
rTargetDirectory,: target directory
lstEntries : list of file entries to extract
bOptUsePath : should the internal path be used for extraction
bOptOverwrite,: should already existing file be overwritten
Return values:
RET_NOERROR : File unzipped
RET_REQUEST_FAILED : error opening the zip file
RET_INVALID_DATA : Invalid directory
RET_ACCESS_DENIED : Could not create the directory

ptrEntry->isDirectory()

Retval zeus::TZipFile::unzipSingleFile ( const IString rTargetDirectory,
const IString rFileEntry,
bool  bOptUsePath = true,
bool  bOptOverwrite = false 
) [inline]

void TZipFile::checkOpen (  )  const [protected]

Opens the Zip file if it is not open yet

void TZipFile::close (  )  [protected]

Closes the Zip file


The documentation for this class was generated from the following files:


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Wed Oct 28 21:42:36 2009