Click here to Skip to main content
Click here to Skip to main content

C++ wrapper for Gilles Vollant's Unzip API

By , 10 Dec 2002
 

Sample Image - unzip.jpg

Introduction

I've been trawling the web for ages trying to find some zip extraction code which

  1. I could understand and
  2. did not have excessive restrictions.

Then I stumbled across Gilles Vollant's excellent work on providing a multi-file API to the ZLib code base written by Jean-loup Gailly and Mark Adler.

That was yesterday. A day later I had wrapped Gilles' code in a simplified C++ wrapper with extended features.

I don't want to gush too much, but having spent the last six months looking for code such as his, I was very impressed by how simply I could understand it and work with it.

The features I've added include:

  • Navigating/extracting the embedded files/folders by index
  • Navigating/extracting the embedded files by file extension
  • Extracting the embedded files whilst ignoring the path info stored with each file. i.e., flattening the file structure

The purpose of this release is mostly to assist people like me who were looking for some code to start with. If I come up with any useful extensions then I will update the code, but feel free (as I know you will) to criticize the code in anyway you like.

p.s. The sample app which comes with the code will show how to use it.

p.s to p.s. Although the sample app is MFC, the wrapper class is pure Win32.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

.dan.g.
Software Developer Maptek
Australia Australia
Member
.dan.g. is a naturalised Australian and has been developing commercial windows software since 1998.
 
For all his latest freeware visit AbstractSpoon.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralOnly Console modemembermsadik24 Jun '05 - 3:57 
Hi all,
How can i use these sample with no graphics, in a project Console (vc++.net)
Best regardsUnsure | :~
Generalfile name directorymembersir kaber5 Mar '05 - 19:18 
hey, suppose i open a name.zip file. the code, makes a starting off folder called
Name
Name\FileExtraction.txt, etc..
 
Is there a way so that Name isn't created ?

GeneralRe: file name directorymembersir kaber5 Mar '05 - 19:19 
and the zip extraction occurs right there, no mother folder directory created..
but folder recursion occurs..
 
many thanks in advance.
GeneralRe: file name directorymemberrajalist7 Dec '06 - 19:49 
I got a same problem like this. So I want to know solution
 
Please...someone tell me about this...
 
Anybody doesn't know about this problem?????
 
thanks a lot
QuestionWhy win32?membertentons27 Aug '04 - 13:25 
A major strength of zlib is platform independence, so why make a win32 specific wrapper when it's so easy to make it more generic (and therefore useful to more people)? I'm doing cross-development, so this won't help me. Big disappointment. Sigh | :sigh:
 
tentons
 

QuestionIs this thing still alive ?sussAnonymous6 Jul '04 - 18:07 
Is this project still alive ?
 
Are there any updates being done ?
 
When was the last release (less then 12 months I hope !) ?
 
Are there bugs reported since the last release ?
 
Have the reported bugs been fixed yet ?
 
Basicaly, is this thing dead ?
QuestionCan you help me?memberAlick Xiong17 Jun '04 - 21:42 
Excuse me ,Sir
 
If I got a zip file with only many htmls compressed.How can I open a HTML file in the file list in my HtmlView? not launch IE!
 
Thank you sir.
 
Alick
QuestioneVC++?memberHameed Chishti15 May '04 - 0:48 
How to use it with eVC? Smile | :)
What do i need to change? Plz help i'm in great trouble

GeneralFolder attributs are forget too !!memberbebert2 Dec '03 - 4:07 
OMG | :OMG: this part must include the SetFileAttributesA function too!!!!!
// if the item is a folder then create it and return 'TRUE'
if (info.bFolder)
{
char szFolderPath[MAX_PATH];
_makepath(szFolderPath, NULL, szFolder, info.szFileName, NULL);
 
bool result = CreateFolder(szFolderPath);
if(result)
::SetFileAttributesA( szFolderPath,info.dwExternalAttrib);
 
return result;
}
 

QuestionWhere are file and folder attributs ??memberbebert28 Sep '03 - 22:44 
Confused | :confused:
you don't restore it !!

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 11 Dec 2002
Article Copyright 2002 by .dan.g.
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid