7 Nokia Corporation - initial contribution. |
7 Nokia Corporation - initial contribution. |
8 Contributors: |
8 Contributors: |
9 --> |
9 --> |
10 <!DOCTYPE concept |
10 <!DOCTYPE concept |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
12 <concept id="GUID-95E557D0-9A84-514C-B51E-0556F26B3C98" xml:lang="en"><title>EzlibExample: |
12 <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> |
13 Using EZLIB to Compress and Decompress Files</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
13 <p>This overview describes the example application that demonstrates |
14 <p>This overview describes the example application that demonstrates the usage |
14 the usage of the EZLIB API. </p> |
15 of the EZLIB API. </p> |
15 <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> |
16 <section id="GUID-20CDC26E-BD41-564A-A1CC-A271388CCE8C"><title>Download</title> <p>Click |
16 <section id="GUID-145D1AC6-E536-5C44-93EC-B468AC68FBF2"><title>Description</title> <p>EZLIB is a utility API used to compress and decompress data. |
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> |
17 The API is an extension of ZLIB compression library. For more information |
18 <section id="GUID-145D1AC6-E536-5C44-93EC-B468AC68FBF2"><title>Description</title> <p>EZLIB |
18 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 |
19 is a utility API used to compress and decompress data. The API is an extension |
19 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 |
20 of ZLIB compression library. For more information on ZLIB compression library, |
20 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. |
21 refer to <xref href="http://www.ietf.org/rfc/rfc1950.txt" scope="external">RFC1950</xref>. </p> <p>This |
21 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, |
22 example application uses the EZLIB API to extract files from a <filepath>.zip</filepath> and |
22 the application extracts all the files to the specified folder using |
23 a <filepath>.gz</filepath> file into specified folders, and to compress a <filepath>.wav</filepath> file |
23 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 |
24 into a <filepath>.gz</filepath> file. The application reads input files and |
24 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 |
25 stores the extracted files in <filepath>c:\private\E80000B7\</filepath>. </p> <p>The |
25 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 |
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. |
26 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, |
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 |
27 the application compresses the <filepath>error.wav</filepath> file |
28 and prints it to the console. </p> <p>After reading all the properties of |
28 to a <filepath>.gz</filepath> file. The GZip file being created is |
29 each file in the archive, the application extracts all the files to the specified |
29 represented by an object of the <xref href="GUID-417AB4E0-FF07-34CB-A4A8-CEF31C48A162.dita"><apiname>CEZFileToGZip</apiname></xref> class |
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> |
30 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 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> |
31 <section id="GUID-922B4740-7F7D-4A12-B92A-FE9720E2C7CD"><title>Class |
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 |
32 Summary</title><ul> |
42 process</xref> describes how to build an application. </p> <p>The <codeph>EzlibExample</codeph> builds |
33 <li><p><xref href="GUID-79C613E8-35F8-319B-BE8B-1411CBE5AF00.dita"><apiname>CZipFile</apiname></xref></p></li> |
43 an executable file called <filepath>ezlibexample.exe</filepath> in the standard |
34 <li><p><xref href="GUID-02A8BC62-D653-39A3-BE0C-92A5F3F43E85.dita"><apiname>CZipFileMember</apiname></xref></p></li> |
44 location (<filepath>\epoc32\release\winscw\</filepath> <<varname>build_variant</varname> > |
35 <li><p><xref href="GUID-D458AE6A-EC64-3882-BCEA-A44A43DAA99A.dita"><apiname>CZipFileMemberIterator</apiname></xref></p></li> |
45 for CodeWarrior). After launching the executable, depending on the emulator |
36 <li><p><xref href="GUID-62F9728B-9C39-3496-BAEB-6E1456E6F197.dita"><apiname>RZipFileMemberReaderStream</apiname></xref></p></li> |
46 you are using, you may need to navigate using the application launcher or |
37 <li><p><xref href="GUID-8DE05785-D058-3855-A11F-7132EB4DE078.dita"><apiname>CEZGZipToFile</apiname></xref></p></li> |
47 the <codeph>eshell</codeph> screen to view the console. </p> </section> |
38 <li><p><xref href="GUID-417AB4E0-FF07-34CB-A4A8-CEF31C48A162.dita"><apiname>CEZFileToGZip</apiname></xref></p></li> |
|
39 </ul></section> |
|
40 <section id="GUID-986B5547-0C87-57E1-893C-21444F82BE45"><title>Build</title> <p>The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian |
|
41 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> <<varname>build_variant</varname> > for CodeWarrior). After launching |
|
42 the executable, depending on the emulator you are using, you may need |
|
43 to navigate using the application launcher or the <codeph>eshell</codeph> screen to view the console. </p> </section> |
48 </conbody></concept> |
44 </conbody></concept> |