Symbian3/SDK/Source/GUID-95E557D0-9A84-514C-B51E-0556F26B3C98.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Wed, 31 Mar 2010 11:11:55 +0100
changeset 7 51a74ef9ed63
child 8 ae94777fff8f
permissions -rw-r--r--
Week 12 contribution of API Specs and fix SDK submission
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     1
<?xml version="1.0" encoding="utf-8"?>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     2
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     3
<!-- This component and the accompanying materials are made available under the terms of the License 
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     4
"Eclipse Public License v1.0" which accompanies this distribution, 
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     5
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     6
<!-- Initial Contributors:
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     7
    Nokia Corporation - initial contribution.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     8
Contributors: 
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     9
-->
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    10
<!DOCTYPE concept
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    11
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    12
<concept id="GUID-95E557D0-9A84-514C-B51E-0556F26B3C98" xml:lang="en"><title>EzlibExample:
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    13
Using EZLIB to Compress and Decompress Files</title><prolog><metadata><keywords/></metadata></prolog><conbody>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    14
<p>This overview describes the example application that demonstrates the usage
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    15
of the EZLIB API. </p>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    16
<section id="GUID-20CDC26E-BD41-564A-A1CC-A271388CCE8C"><title>Download</title> <p>Click
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    17
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>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    18
<section id="GUID-145D1AC6-E536-5C44-93EC-B468AC68FBF2"><title>Description</title> <p>EZLIB
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    19
is a utility API used to compress and decompress data. The API is an extension
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    20
of ZLIB compression library. For more information on ZLIB compression library,
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    21
refer to <xref href="http://www.ietf.org/rfc/rfc1950.txt" scope="external">RFC1950</xref>. </p> <p>This
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    22
example application uses the EZLIB API to extract files from a <filepath>.zip</filepath> and
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    23
a <filepath>.gz</filepath> file into specified folders, and to compress a <filepath>.wav</filepath> file
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    24
into a <filepath>.gz</filepath> file. The application reads input files and
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    25
stores the extracted files in <filepath>c:\private\E80000B7\</filepath>. </p> <p>The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    26
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.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    27
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
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    28
and prints it to the console. </p> <p>After reading all the properties of
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    29
each file in the archive, the application extracts all the files to the specified
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    30
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
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    31
than extracting all the files in the archive, the application also searches
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    32
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
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    33
and extracts it. </p> <p>The application also opens the <filepath>icon.bmp.gz</filepath> file
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    34
and extracts its contents to the specified location. The GZip file is represented
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    35
by an object of the <xref href="GUID-8DE05785-D058-3855-A11F-7132EB4DE078.dita"><apiname>CEZGZipToFile</apiname></xref> class and its contents
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    36
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,
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    37
the application compresses the <filepath>error.wav</filepath> file to a <filepath>.gz</filepath> file.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    38
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
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    39
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>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    40
<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>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    41
<section id="GUID-986B5547-0C87-57E1-893C-21444F82BE45"><title>Build</title> <p>The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian build
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    42
process</xref> describes how to build an application. </p> <p>The <codeph>EzlibExample</codeph> builds
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    43
an executable file called <filepath>ezlibexample.exe</filepath> in the standard
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    44
location (<filepath>\epoc32\release\winscw\</filepath> &lt;<varname>build_variant</varname> &gt;
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    45
for CodeWarrior). After launching the executable, depending on the emulator
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    46
you are using, you may need to navigate using the application launcher or
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    47
the <codeph>eshell</codeph> screen to view the console. </p> </section>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    48
</conbody></concept>