EZGZipFile Class Reference

#include <ezgzip.h>

Link against: ezlib.lib

class EZGZipFile
Public Attributes
const TUint8ID1
const TUint8ID2
Public Member Enumerations
enumanonymous { ENotGZipFile, EInvalidCompressionMethod, EBadGZipHeader, EBadGZipTrailer, EBadGZipCrc }
enumanonymous { EFText, EFHcrc, EFExtra, EFName, EFComment }
Public Member Functions
IMPORT_C TBoolIsGzipFile(RFs &, const TDesC &)
IMPORT_C TBoolIsGzipFileL(RFs &, const TDesC &)
IMPORT_C voidLocateAndReadTrailerL(RFs &, const TDesC &, TEZGZipTrailer &)
IMPORT_C voidReadHeaderL(RFile &, TEZGZipHeader &)
IMPORT_C voidReadTrailerL(RFile &, TEZGZipTrailer &)
IMPORT_C voidWriteHeaderL(RFile &, TEZGZipHeader &)
IMPORT_C voidWriteTrailerL(RFile &, TEZGZipTrailer &)

Detailed Description

The EZGZipFile class handles writing / reading of headers and trailers to / from zip files

Member Attribute Documentation

ID1

const TUint8ID1[static]

First of the header ID pair

ID2

const TUint8ID2[static]

Second of the header ID pair

Member Enumeration Documentation

Enum anonymous

Zip file error codes

EnumeratorValueDescription
ENotGZipFileKEZlibErrNotGZipFile
EInvalidCompressionMethodKEZlibErrInvalidCompression
EBadGZipHeaderKEZlibErrBadGZipHeader
EBadGZipTrailerKEZlibErrBadGZipTrailer
EBadGZipCrcKEZlibErrBadGZipCrc

Enum anonymous

Flags to determine which part of the header / trailer is being written

EnumeratorValueDescription
EFText0
EFHcrc1
EFExtra2
EFName3
EFComment4

Member Function Documentation

IsGzipFile ( RFs &, const TDesC & )

IMPORT_C TBoolIsGzipFile(RFs &aRfs,
const TDesC &aFname
)[static]

DeprecatedInterface is deprecated because it is unsafe as it may leave. It is available for backward compatibility reasons only.

See also: EZGZipFile::IsGzipFileL

IsGzipFileL ( RFs &, const TDesC & )

IMPORT_C TBoolIsGzipFileL(RFs &aRfs,
const TDesC &aFname
)[static]

Determine if the given file is a valid zip file

leave
... Any of the system wide error codes
ParameterDescription
aRfsfile server session
aFnamename of the file to check

Returns: ETrue if the file is valid zip file, EFalse otherwise

LocateAndReadTrailerL ( RFs &, const TDesC &, TEZGZipTrailer & )

IMPORT_C voidLocateAndReadTrailerL(RFs &aRfs,
const TDesC &aFname,
TEZGZipTrailer &aTrailer
)[static]

Find the zip trailer within the specified file, and read it into the TEZGZipTrailer object

leave
KEZlibErrBadGZipHeader Invalid zip header
leave
... Any of the system wide error codes
ParameterDescription
aRfsfile server session
aFnamethe file to read from
aTrailerthe target trailer object

ReadHeaderL ( RFile &, TEZGZipHeader & )

IMPORT_C voidReadHeaderL(RFile &aFile,
TEZGZipHeader &aHeader
)[static]

Read the zip header from the specified zip file into the TEZGZipHeader object

leave
KEZlibErrBadGZipHeader invalid zip header
leave
... Any of the system wide error codes
ParameterDescription
aFilethe zip file to read from
aHeaderthe target header object

ReadTrailerL ( RFile &, TEZGZipTrailer & )

IMPORT_C voidReadTrailerL(RFile &aFile,
TEZGZipTrailer &aTrailer
)[static]

Read the zip trailer from the specified zip file into the TEZGZipTrailer object

leave
KEZlibErrBadGZipTrailer invalid zip trailer
leave
... Any of the system wide error codes
ParameterDescription
aFilethe zip file to read from
aTrailerthe target trailer object

WriteHeaderL ( RFile &, TEZGZipHeader & )

IMPORT_C voidWriteHeaderL(RFile &aFile,
TEZGZipHeader &aHeader
)[static]

Write the zip header to the specified file

leave
... Any of the system wide error codes
ParameterDescription
aFilethe file to write to
aHeaderthe header object to write to the file

WriteTrailerL ( RFile &, TEZGZipTrailer & )

IMPORT_C voidWriteTrailerL(RFile &aFile,
TEZGZipTrailer &aTrailer
)[static]

Write the zip trailer to the specified file

leave
... Any of the system wide error codes
ParameterDescription
aFilethe file to write to
aTrailerthe trailer object to write to the file