Environment: Win98, VC 5.0
This article describes classes to zip and unzip files. The classes use the gzip GNU source code (gzip-1.2.4a). This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License. See the file COPYING included in the source code.
The target DLL exports two classes:
Description:
A CZip or CUnzip object is built with a file name. Then, the SwapSize() method must be called on that object (with one argument which is the target file name) in order to zip/unzip the file. SwapSize() may throw a CZipException exception. A message bound to the exception can be retrieved using the GetString() method. Exceptions are thrown when:
To use CZip or CUnzip, do the following:
Here's an example of how to zip a file:
try { CZip myFileToZip ("file_to_zip_name"); myFileToZip.SwapSize ("file_zipped_name"); } catch (CZipException e) { cout << "problem while zipping : " << e.GetString() << endl; delete pExcep; }
Notes:
Download:
CZip/CUnzip DLL source czip_source.zip (99 KB) Demo program czip_demo.zip (3 KB)
Date Updated: 2 March 1999 Date Posted: 27 February 1999
Add Comment
INSTANT EXPERTS!Savvy IT Pros report on SupportSource. Take a look inside the largest vault of multi-vendor computing specs ever assembled. Click here for an In-depth Report,. For tons of Windows technology resources, check out the Windows Programming directory. Searching the Web for tech topics just got better withTechCrawler where all results come only from popular technical sites. WINNER!!! Congratulations to James Hole, of New Mexico! The grand prize winner of EarthWeb's Flatten the Obstacles Sweepstakes and now a proud Hummer(R) owner.
WINNER!!! Congratulations to James Hole, of New Mexico! The grand prize winner of EarthWeb's Flatten the Obstacles Sweepstakes and now a proud Hummer(R) owner.