zeus::TZippedFileEntry Class Reference

#include <ZipDataSource.h>

Inheritance diagram for zeus::TZippedFileEntry:

zeus::TZObject zeus::IZUnknown

List of all members.

Public Member Functions

 TZippedFileEntry (const IString &rFileEntryName, TypeFile &rEntry)
 TZippedFileEntry (const IString &rFileEntryName, const IString &rFileNameToCompress)
Retval compressFile (const IString &rPassword, Int iZipLevel=4)
Uint32 getChecksum () const
 returns the check sum
Uint getCompressedSize () const
 returns the compressed size of the source
ECompressionMethod getCompressionMethod () const
 returns the compression method
Float getCompressionRate () const
TString getComment () const
 returns the comment
TString getFileEntryName () const
 Returns the name of the file entry.
Timeval getModificationTime () const
Uint64 getSize () const
Retval getUnzippedData (IByteArray &rData) const
Retval getUnzippedData (IByteArray &rData, const IString &rPassword) const
bool isCompressed () const
 checks if the file entry is compressed
bool isDirectory () const
bool isEncrypted () const
void setComment (const IString &rValue)
 Sets the file comment.

Protected Member Functions

virtual ~TZippedFileEntry ()
Uint generateOutput (IOutputStream &rOutStream)
Uint generateOutputForCentralDirectory (IOutputStream &rOutStream, Uint uiOffsetToLocalHeader)
TypeFilegetFileEntryStructure ()
void setSourceFile (const IString &rFileName)

Friends

class TZipDataSource


Detailed Description

class wrapping a zipped file entry

Constructor & Destructor Documentation

TZippedFileEntry::TZippedFileEntry ( const IString rFileEntryName,
TypeFile rEntry 
)

Creates a zipped file entry out of read data from zip file.

Parameters:
rEntry : attached file structure pointer. The structure will be deleted, if this object dies.

TZippedFileEntry::TZippedFileEntry ( const IString rFileEntryName,
const IString rFileName 
)

Creates a new zipped file entry

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

Destroys the zipped file entry


Member Function Documentation

Retval TZippedFileEntry::compressFile ( const IString rPassword,
Int  iZipLevel = 4 
)

Compresses a file entry. The file entry must be created manualy giving a valid file name as data source.

Parameters:
rPassword : Password to encrypt (password not empty)
iZipLevel : Compression level must be set between 0 and 9. 0 = no compression; 1 = best speed and 9 = best compression (default is 4)
Return values:
RET_NOERROR : file entry compressed
RET_REQUEST_FAILED : Invalid file name
RET_ACCESS_DENIED : Could not read file

Uint32 zeus::TZippedFileEntry::getChecksum (  )  const [inline]

returns the check sum

Uint zeus::TZippedFileEntry::getCompressedSize (  )  const [inline]

returns the compressed size of the source

ECompressionMethod zeus::TZippedFileEntry::getCompressionMethod (  )  const [inline]

returns the compression method

Float TZippedFileEntry::getCompressionRate (  )  const

returns the compression rate of the file entry

TString zeus::TZippedFileEntry::getComment (  )  const [inline]

returns the comment

TString zeus::TZippedFileEntry::getFileEntryName (  )  const [inline]

Returns the name of the file entry.

Timeval TZippedFileEntry::getModificationTime (  )  const

Returns the modification time value.

Uint64 TZippedFileEntry::getSize (  )  const

returns the uncompressed size of the source

Retval zeus::TZippedFileEntry::getUnzippedData ( IByteArray rData  )  const [inline]

returns the unzipped data using no password

Retval TZippedFileEntry::getUnzippedData ( IByteArray rData,
const IString rPassword 
) const

returns the unzipped data

Return values:
RET_NOERROR : Data unzipped
RET_REQUEST_FAILED : No data to be uncompressed (directory)
RET_INVALID_DATA : Check sum error
RET_FEATURE_UNAVAILABLE : Compression method not available yet

bool zeus::TZippedFileEntry::isCompressed (  )  const [inline]

checks if the file entry is compressed

bool zeus::TZippedFileEntry::isDirectory (  )  const [inline]

bool zeus::TZippedFileEntry::isEncrypted (  )  const [inline]

void zeus::TZippedFileEntry::setComment ( const IString rValue  )  [inline]

Sets the file comment.

Uint TZippedFileEntry::generateOutput ( IOutputStream rOutStream  )  [protected]

writes the file entry out to the out-stream and returns the number of bytes written

Uint TZippedFileEntry::generateOutputForCentralDirectory ( IOutputStream rOutStream,
Uint  uiOffsetToLocalHeader 
) [protected]

writes the file entry out to the out-stream and returns the number of bytes written

TypeFile& zeus::TZippedFileEntry::getFileEntryStructure (  )  [inline, protected]

void zeus::TZippedFileEntry::setSourceFile ( const IString rFileName  )  [inline, protected]


Friends And Related Function Documentation

friend class TZipDataSource [friend]


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