#include <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. Multi file zip a...
Members
Defined in CZipFile
:
Inherited from CBase
:
Inherited from CZipArchive
:
Related Topics
»
Symbian OS v9.4 »
Examples »
System Library example code »
EzlibExample: Using EZLIB API to compress and decompress files
Construction and destruction
IMPORT_C static 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.
|
|
NewL(RFs &,const TDesC &)
IMPORT_C static 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 TDesC16 &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.
|
|
CZipFile(RFs &,const TDesC &)
Interface status: |
deprecated |
in 7.0 |
IMPORT_C CZipFile(RFs &aFs, const TDesC &aFileName);
Description
Parameters
IMPORT_C virtual ~CZipFile();
Description
Destructor
ConstructL(const TDesC &)
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.
|
|
Interface status: |
deprecated |
in 7.0 |
IMPORT_C TInt OpenL(void);
Description
Return value
Interface status: |
deprecated |
in 7.0 |
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 TDesC16 &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.
|
|
CaseInsensitiveMemberL(const TDesC &)
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 TDesC16 &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(const TDesC &)
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 TDesC16 &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.
|
|
GetInputStreamL(const CZipFileMember *,RZipFileMemberReaderStream *&)
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 Stored or Deflated compression
methods are supported.
Parameters
const CZipFileMember *aMember |
The compressed file in the archive
|
RZipFileMemberReaderStream *&aStream |
On return, the stream to be used for reading the contents of the compressed file. The caller owns this object and is responsible
for deleting it.
|
|
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
:
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.
|
|