CZipFile Class Reference
class CZipFile : public CZipArchive |
Nested Classes and Structures
Protected Member Functions |
---|
IMPORT_C void | ConstructL(const TDesC &) |
IMPORT_C void | ConstructL(RFile &) |
void | DeleteMemberPointers(void) |
TInt
| FindCentralDirectoryTrailer(TUint32 &) |
const TMemberPointer * | FindMemberPointer(const TDesC &, TBool) |
TInt
| LoadMemberPointersL(void) |
RZipFileMemberReaderStream * | MakeInputStreamL(TUint32, TUint32, TUint32, TUint32) |
CZipFileMember * | MakeMemberL(TInt) |
CZipFileMember * | MakeMemberL(const TMemberPointer &, const TLocalHeader &) |
void | OpenFileL(const TDesC &) |
TInt
| Read(TByte *, TUint32) |
TInt
| Read(TUint16 &) |
TInt
| Read(TUint32 &) |
TInt
| ReadCentralDirectoryHeaderL(TCentralDirectoryHeader &, TMemberPointer &, CCnvCharacterSetConverter *, TInt) |
TInt
| ReadCentralDirectoryTrailer(TUint32, TCentralDirectoryTrailer &) |
TInt
| ReadLocalHeader(TUint32, TLocalHeader &) |
TInt
| Seek(TInt) |
Detailed Description
A CZipFile represents a ZIP archive contained in a single file. Multi file zip archives are not supported.
Member Enumeration Documentation
Enum anonymous
ZipFile error enumeration.
Enumerator | Value | Description |
---|
KZipFileError | KZipArchiveMinError - 1 |
Cannot read file directory in the archive file
|
KZipFileNotFound | KZipFileError - 1 |
File not found error. It is not used in current implemenation
|
KZipFileIOError | KZipFileError - 2 |
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.
|
Constructor & Destructor Documentation
CZipFile ( RFs &, const TDesC & )
IMPORT_C | CZipFile | ( | RFs & | aFs, |
| const TDesC & | aFileName |
| ) | |
~CZipFile ( )
IMPORT_C | ~CZipFile | ( | ) | [virtual] |
Member Function Documentation
CaseInsensitiveMemberL ( const TDesC & )
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.
-
leave
- ... Any one of the system-wide error codes for other errors.
Parameter | Description | aName | The name of the file to be searched in the zipfile |
Returns: A pointer to a member object of zip file NULL If the file doesn't exist in the zipfile
CaseSensitiveOrCaseInsensitiveMemberL ( const TDesC & )
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.
-
leave
- ... Any one of the system-wide error codes for other errors.
Parameter | Description | aName | The name of the file to be searched in the zipfile |
Returns: A pointer to a member object of zip file NULL If the file doesn't exist in the zipfile
ConstructL ( const TDesC & )
IMPORT_C void | ConstructL | ( | const TDesC & | aFileName | ) | [protected] |
Second phase of construction. Used by filename using NewL overload
-
leave
- ... Any one of the system-wide error codes for other errors.
ConstructL ( RFile & )
IMPORT_C void | ConstructL | ( | RFile & | aFile | ) | [protected] |
Second phase of construction. Used by Rfile using NewL overload.
-
leave
- ... Any one of the system-wide error codes for other errors.
DeleteMemberPointers ( void )
void | DeleteMemberPointers | ( | void | | ) | [protected] |
FindCentralDirectoryTrailer ( TUint32 & )
TInt
| FindCentralDirectoryTrailer | ( | TUint32 & | offset | ) | [protected] |
FindMemberPointer ( const TDesC &, TBool )
GetInputStreamL ( const CZipFileMember *, RZipFileMemberReaderStream *& )
Creates and returns the input stream for a file in the archive. Only files compressed with Stored or Deflated compression methods are supported.
-
leave
- ... Any one of the system-wide error codes for other errors.
Parameter | Description | aMember | The compressed file in the archive |
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. |
Returns: KErrNone if successful KCompressionMethodNotSupported if compression format unsupported ... Any one of the system-wide error codes for other errors.
GetMembersL ( void )
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.
-
leave
- ... Any one of the system-wide error codes for other errors.
Returns: Pointer to a newly allocated CZipFileMemberIterator object
LoadMemberPointersL ( void )
TInt
| LoadMemberPointersL | ( | void | | ) | [protected] |
MakeInputStreamL ( TUint32, TUint32, TUint32, TUint32 )
MakeMemberL ( const TMemberPointer &, const TLocalHeader & )
MemberL ( const TDesC & )
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.
-
leave
- ... Any one of the system-wide error codes for other errors.
Parameter | Description | aName | The name of the file to be searched in the zipfile |
Returns: the pointer to CZipFileMember object NULL if the file doesn't exist in the zipfile
NewL ( RFs &, RFile & )
Creates a new CZipFile object using the supplied file server session and a valid file handle. The caller must have sufficient rights to access the content of the zipfile, if encrypted/protected.
-
leave
- KZipArchiveError If file cannot be accessed(invalid handle, corrupt file header, etc.)
-
leave
- KZipFileIOError If file cannot be read
-
leave
- KCentralDirectoryTrailerNotFound If zip file header doesn't contain information about files inside the archive
-
leave
- KCentralDirectoryTrailerInvalid If the information about files inside the archive is corrupt
-
leave
- KMultiDiskArchivesNotSupported If zipfile is a multi disk archive
-
leave
- ... Any one of the system-wide error codes for other errors.
Parameter | Description | aFs | File server session used for opening the zipfile |
aFile | File handle to be used for accessing the zipfile |
Returns: CZipFile object associated with the zipfile if it succeeded
NewL ( RFs &, const TDesC & )
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.
-
leave
- KZipArchiveError If file cannot be accessed(invalid handle, corrupt file header, etc.)
-
leave
- KZipFileIOError If file cannot be read
-
leave
- KCentralDirectoryTrailerNotFound If zip file header doesn't contain information about files inside the archive
-
leave
- KCentralDirectoryTrailerInvalid If the information about files inside the archive is corrupt
-
leave
- KMultiDiskArchivesNotSupported If zipfile is a multi disk archive.
-
leave
- ... Any one of the system-wide error codes for other errors.
Parameter | Description | aFs | File server session used for opening the zipfile |
aFileName | Name of the zipfile |
Returns: CZipFile object associated with the zipfile if it succeeded
OpenFileL ( const TDesC & )
void | OpenFileL | ( | const TDesC & | aFileName | ) | [protected] |
Read ( TByte *, TUint32 )
ReadCentralDirectoryHeaderL ( TCentralDirectoryHeader &, TMemberPointer &, CCnvCharacterSetConverter *, TInt )
ReadCentralDirectoryTrailer ( TUint32, TCentralDirectoryTrailer & )
ReadLocalHeader ( TUint32, TLocalHeader & )
Size ( TInt & )
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.
Parameter | Description | aSize | On return, the size of the compressed data in bytes |
Returns: 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.