»
Symbian OS v9.3 »
Symbian OS reference »
C++ component reference »
System Libraries EZLIB »
CZipFile
Location:
zipfile.h
Link against: ezip.lib
class CZipFile : public CZipArchive;
Description
A CZipFile represents a ZIP archive contained in a single file. Multi file zip archives are not supported.
Derivation
CBase
- Base class for all classes to be instantiated on the heap
CZipFile
- A CZipFile represents a ZIP archive contained in a single file
Members
Defined in CZipFile
:
CZipFile()
, CaseInsensitiveMemberL()
, CaseSensitiveOrCaseInsensitiveMemberL()
, Close()
, ConstructL()
, ConstructL()
, GetInputStreamL()
, GetMembersL()
, KZipFileError
, KZipFileIOError
, KZipFileNotFound
, MemberL()
, NewL()
, NewL()
, OpenL()
, Size()
, TMemberPointer
, anonymous
, ~CZipFile()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
Inherited from CZipArchive
:
EDeflated
,
EImploded
,
EPKWAREImploded
,
EReducedCFFour
,
EReducedCFOne
,
EReducedCFThree
,
EReducedCFTwo
,
EReservedOne
,
EReservedTwo
,
EShrunk
,
EStored
,
KCentralDirectoryHeaderFixedLength
,
KCentralDirectoryHeaderSignature
,
KCentralDirectorySignature
,
KCentralDirectoryTrailerFixedLength
,
KCentralDirectoryTrailerInvalid
,
KCentralDirectoryTrailerNotFound
,
KCentralFileHeaderExtraFieldLengthOffset
,
KCentralFileHeaderFileNameLengthOffset
,
KCentralFileHeaderFileNameOffset
,
KCompressionMethodNotSupported
,
KLocalHeaderFixedLength
,
KLocalHeaderSignature
,
KLocalHeaderSignatureInvalid
,
KMaxTrailerSearchLength
,
KMemberNotFound
,
KMultiDiskArchivesNotSupported
,
KSignatureLength
,
KZipArchiveError
,
KZipArchiveMinError
,
TCentralDirectoryHeader
,
TCentralDirectoryTrailer
,
TCompressionMethod
,
TLocalHeader
Construction and destruction
static IMPORT_C CZipFile *NewL(RFs &aFs, RFile &aFile);
Description
Creates a new CZipFile object using the supplied file server session and a valid file handle. The caller must have sufficient
sufficient rights to access the content of the zipfile, if encrypted/protected.
Parameters
RFs &aFs |
File server session used for opening the zipfile
|
RFile &aFile |
File handle to be used for accessing the zipfile
|
|
Return value
CZipFile *
|
CZipFile object associated with the zipfile if it succeeded
|
|
Leave codes
KZipArchiveError |
If file cannot be accessed(invalid handle, corrupt file header, etc.)
|
KZipFileIOError |
If file cannot be read
|
KCentralDirectoryTrailerNotFound |
If zip file header doesn't contain information about files inside the archive
|
KCentralDirectoryTrailerInvalid |
If the information about files inside the archive is corrupt
|
KMultiDiskArchivesNotSupported |
If zipfile is a multi disk archive
|
... |
Any one of the system-wide error codes for other errors.
|
|
static IMPORT_C CZipFile *NewL(RFs &aFs, const TDesC &aFileName);
Description
Creates a new CZipFile object using the supplied file server session and file name. The caller must have sufficient capabilities
to access the directory. The caller must also have sufficient rights to access the content of the zipfile, if encrypted/protected.
Parameters
RFs &aFs |
File server session used for opening the zipfile
|
const TDesC &aFileName |
Name of the zipfile
|
|
Return value
CZipFile *
|
CZipFile object associated with the zipfile if it succeeded
|
|
Leave codes
KZipArchiveError |
If file cannot be accessed(invalid handle, corrupt file header, etc.)
|
KZipFileIOError |
If file cannot be read
|
KCentralDirectoryTrailerNotFound |
If zip file header doesn't contain information about files inside the archive
|
KCentralDirectoryTrailerInvalid |
If the information about files inside the archive is corrupt
|
KMultiDiskArchivesNotSupported |
If zipfile is a multi disk archive.
|
... |
Any one of the system-wide error codes for other errors.
|
|
IMPORT_C CZipFile(RFs &aFs, const TDesC &aFileName);
Description
Parameters
virtual IMPORT_C ~CZipFile();
Description
Destructor
protected: IMPORT_C void ConstructL(const TDesC &aFileName);
Description
Second phase of construction. Used by filename using NewL overload
Parameters
Leave codes
... |
Any one of the system-wide error codes for other errors.
|
|
protected: IMPORT_C void ConstructL(RFile &aFile);
Description
Second phase of construction. Used by Rfile using NewL overload.
Parameters
Leave codes
... |
Any one of the system-wide error codes for other errors.
|
|
IMPORT_C TInt OpenL(void);
Description
Return value
IMPORT_C void Close(void);
Description
IMPORT_C TInt Size(TInt &aSize) const;
Description
Gets the size of the compressed data contained in the zip file in bytes Each CZipFile object has a compressed and uncompressed
size. This method will return the compressed size of a zip file.
Parameters
TInt &aSize |
On return, the size of the compressed data in bytes
|
|
Return value
TInt
|
KErrNotReady If object hasn't been properly constructed KErrCASizeNotDetermined If size could not be determined ... Any one
of the system-wide error codes for other errors.
|
|
IMPORT_C CZipFileMember *MemberL(const TDesC &aName);
Description
Constructs and returns a CZipFileMember
object which is used to access information about a compressed file contained in the CZipFile archive. The name of the file
to be searched for in the zipfile is case-sensitive.
Parameters
const TDesC &aName |
The name of the file to be searched in the zipfile
|
|
Return value
Leave codes
... |
Any one of the system-wide error codes for other errors.
|
|
IMPORT_C CZipFileMember *CaseInsensitiveMemberL(const TDesC &aName);
Description
Constructs and returns a CZipFileMember
object which is used to access information about a compressed file contained in the CZipFile archive. The name of the file
to be searched for in the zipfile is case-insensitive.
Parameters
const TDesC &aName |
The name of the file to be searched in the zipfile
|
|
Return value
CZipFileMember *
|
A pointer to a member object of zip file NULL If the file doesn't exist in the zipfile
|
|
Leave codes
... |
Any one of the system-wide error codes for other errors.
|
|
CaseSensitiveOrCaseInsensitiveMemberL()
IMPORT_C CZipFileMember *CaseSensitiveOrCaseInsensitiveMemberL(const TDesC &aName);
Description
Constructs and returns a CZipFileMember
object which is used to access information about a compressed file contained in the CZipFile archive. An exact match for
the filename is searched for first. If a match is not found, a case-insensitive search is performed. If both filenames exist
in the archive, the case-sensitive match will be returned.
Parameters
const TDesC &aName |
The name of the file to be searched in the zipfile
|
|
Return value
CZipFileMember *
|
A pointer to a member object of zip file NULL If the file doesn't exist in the zipfile
|
|
Leave codes
... |
Any one of the system-wide error codes for other errors.
|
|
IMPORT_C TInt GetInputStreamL(const CZipFileMember *aMember, RZipFileMemberReaderStream *&aStream);
Description
Creates and returns the input stream for a file in the archive. Only files compressed with Store or Deflatem compression methods
are supported.
Parameters
Return value
TInt
|
KErrNone if successful KCompressionMethodNotSupported if compression format unsupported ... Any one of the system-wide error
codes for other errors.
|
|
Leave codes
... |
Any one of the system-wide error codes for other errors.
|
|
IMPORT_C CZipFileMemberIterator *GetMembersL(void);
Description
Gets the iterator used for iterating through the files contained in the ZIP file. It is the caller's responsibility to release
the iterator when finsihed.
Return value
Leave codes
... |
Any one of the system-wide error codes for other errors.
|
|
protected: struct TMemberPointer;
Description
Internal representation of a compressed file in a zipfile
Members
Defined in CZipFile::TMemberPointer
:
iCRC32
, iCentralHeaderOffset
, iCompressedSize
, iLocalHeaderOffset
, iName
, iUncompressedSize
Member data
iName
TFileName * iName;
Description
the name of a compressed file
iCentralHeaderOffset
TUint32 iCentralHeaderOffset;
Description
Not used in current implementation
iLocalHeaderOffset
TUint32 iLocalHeaderOffset;
Description
The local offset of header in a compressed file
iCRC32
TUint32 iCRC32;
Description
CRC with 32 bits length in a compressed file
iCompressedSize
TUint32 iCompressedSize;
Description
The size of compressed file
iUncompressedSize
TUint32 iUncompressedSize;
Description
The size of file without compressed
n/a
Description
ZipFile error enumeration.
KZipFileError |
Cannot read file directory in the archive file
|
KZipFileNotFound |
File not found error. It is not used in current implemenation
|
KZipFileIOError |
File IO error.Any error occurs during a archive file is readed. For examples, any error about reading number of disk, an offset
of signature, or the content of file is non-readable.
|
|