Symbian3/SDK/Source/GUID-95E557D0-9A84-514C-B51E-0556F26B3C98.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 11 Mar 2010 15:24:26 +0000
changeset 2 ebc84c812384
parent 0 89d6a7a84779
permissions -rw-r--r--
week 10 bug fix submission: Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-95E557D0-9A84-514C-B51E-0556F26B3C98" xml:lang="en"><title>EzlibExample:
Using EZLIB to Compress and Decompress Files</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>This overview describes the example application that demonstrates the usage
of the EZLIB API. </p>
<section id="GUID-20CDC26E-BD41-564A-A1CC-A271388CCE8C"><title>Download</title> <p>Click
on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-dd523979-cb61-4784-b344-53a63f82e63f.zip" scope="external">EzlibExample.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-dd523979-cb61-4784-b344-53a63f82e63f.html" scope="peer">browse</xref> to view the example code. </p> </section>
<section id="GUID-145D1AC6-E536-5C44-93EC-B468AC68FBF2"><title>Description</title> <p>EZLIB
is a utility API used to compress and decompress data. The API is an extension
of ZLIB compression library. For more information on ZLIB compression library,
refer to <xref href="http://www.ietf.org/rfc/rfc1950.txt" scope="external">RFC1950</xref>. </p> <p>This
example application uses the EZLIB API to extract files from a <filepath>.zip</filepath> and
a <filepath>.gz</filepath> file into specified folders, and to compress a <filepath>.wav</filepath> file
into a <filepath>.gz</filepath> file. The application reads input files and
stores the extracted files in <filepath>c:\private\E80000B7\</filepath>. </p> <p>The
application uses an object of the <xref href="GUID-E263C747-946F-35AA-9F1D-41833BD350FC.dita"><apiname>RFs</apiname></xref> class to open the <filepath>EzlibZipFolder.zip</filepath> file.
It reads the properties of each file in the archive using the <xref href="GUID-02A8BC62-D653-39A3-BE0C-92A5F3F43E85.dita"><apiname>CZipFileMember</apiname></xref> object
and prints it to the console. </p> <p>After reading all the properties of
each file in the archive, the application extracts all the files to the specified
folder using the <xref href="GUID-79C613E8-35F8-319B-BE8B-1411CBE5AF00.dita#GUID-79C613E8-35F8-319B-BE8B-1411CBE5AF00/GUID-FAD44863-E938-34A7-B1D1-BD08521535F9"><apiname>CZipFile::GetInputStreamL()</apiname></xref> method. </p> <p>Other
than extracting all the files in the archive, the application also searches
for a specific file using the <xref href="GUID-79C613E8-35F8-319B-BE8B-1411CBE5AF00.dita#GUID-79C613E8-35F8-319B-BE8B-1411CBE5AF00/GUID-3D64677E-0D19-3B29-9D22-34773FB61C73"><apiname>CZipFile::CaseInsensitiveMemberL()</apiname></xref> method
and extracts it. </p> <p>The application also opens the <filepath>icon.bmp.gz</filepath> file
and extracts its contents to the specified location. The GZip file is represented
by an object of the <xref href="GUID-8DE05785-D058-3855-A11F-7132EB4DE078.dita"><apiname>CEZGZipToFile</apiname></xref> class and its contents
are extracted using the <xref href="GUID-8DE05785-D058-3855-A11F-7132EB4DE078.dita#GUID-8DE05785-D058-3855-A11F-7132EB4DE078/GUID-4A30D99E-EC51-359F-90B5-9CFA3841A538"><apiname>CEZGZipToFile::InflateL()</apiname></xref> method. </p> <p>Finally,
the application compresses the <filepath>error.wav</filepath> file to a <filepath>.gz</filepath> file.
The GZip file being created is represented by an object of the <xref href="GUID-417AB4E0-FF07-34CB-A4A8-CEF31C48A162.dita"><apiname>CEZFileToGZip</apiname></xref> class
and the <filepath>.wav</filepath> file is compressed using the <xref href="GUID-417AB4E0-FF07-34CB-A4A8-CEF31C48A162.dita#GUID-417AB4E0-FF07-34CB-A4A8-CEF31C48A162/GUID-4E51D7C5-C624-3F27-A5CD-01E92F96F72B"><apiname>CEZFileToGZip::DeflateL()</apiname></xref> method. </p> </section>
<section id="GUID-922B4740-7F7D-4A12-B92A-FE9720E2C7CD"><title>Class Summary</title><p><xref href="GUID-79C613E8-35F8-319B-BE8B-1411CBE5AF00.dita"><apiname>CZipFile</apiname></xref></p><p><xref href="GUID-02A8BC62-D653-39A3-BE0C-92A5F3F43E85.dita"><apiname>CZipFileMember</apiname></xref></p><p><xref href="GUID-D458AE6A-EC64-3882-BCEA-A44A43DAA99A.dita"><apiname>CZipFileMemberIterator</apiname></xref></p><p><xref href="GUID-62F9728B-9C39-3496-BAEB-6E1456E6F197.dita"><apiname>RZipFileMemberReaderStream</apiname></xref></p><p><xref href="GUID-8DE05785-D058-3855-A11F-7132EB4DE078.dita"><apiname>CEZGZipToFile</apiname></xref></p><p><xref href="GUID-417AB4E0-FF07-34CB-A4A8-CEF31C48A162.dita"><apiname>CEZFileToGZip</apiname></xref></p></section>
<section id="GUID-986B5547-0C87-57E1-893C-21444F82BE45"><title>Build</title> <p>The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian build
process</xref> describes how to build an application. </p> <p>The <codeph>EzlibExample</codeph> builds
an executable file called <filepath>ezlibexample.exe</filepath> in the standard
location (<filepath>\epoc32\release\winscw\</filepath> &lt;<varname>build_variant</varname> &gt;
for CodeWarrior). After launching the executable, depending on the emulator
you are using, you may need to navigate using the application launcher or
the <codeph>eshell</codeph> screen to view the console. </p> </section>
</conbody></concept>