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