Compressed LDraw files


Re: Compressed Library was Re: Compressed LDraw files
#22
The standard zlib library comes with minizip as sample code in the contrib/minizip directory of the source distribution. The zlib license is extremely permissive. LDView 4.2 will be using this on the Mac instead of a system call to unzip. Take a look at the section inside #ifdef HAVE_MINIZIP of the following C++ class from LDView:

http://ldview.cvs.sourceforge.net/viewvc...iew=markup

The above unzips complete.zip onto the file system, but to do that it scans the file list from the zip file and stores the results in a std::map object. If you look at scan() and extractFile(), you should have relatively clear sample code that you can convert to Objective C for loading files from a zip directly into memory. (My code uses a fixed size buffer, which is incrementally filled with the file contents and immediately written to disk, but it's trivial to modify it to read an entire file into an NSMutableArray or BYTE *.)
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Compressed LDraw files - by Roland Melkert - 2013-01-29, 20:33
Re: Compressed LDraw files - by Tim Gould - 2013-01-29, 20:44
Re: Compressed LDraw files - by Travis Cobbs - 2013-01-29, 20:49
Re: Compressed LDraw files - by Tim Gould - 2013-01-29, 22:10
Re: Compressed LDraw files - by Ben Supnik - 2013-01-30, 6:36
Re: Compressed LDraw files - by Ben Supnik - 2013-01-30, 20:59
Re: Compressed LDraw files - by Allen Smith - 2013-01-30, 17:17
Re: Compressed Library was Re: Compressed LDraw files - by Travis Cobbs - 2013-01-31, 6:27
Re: Compressed LDraw files - by Ben Supnik - 2013-01-30, 21:15
Re: Compressed LDraw files - by Allen Smith - 2013-01-31, 4:39
Re: Compressed LDraw files - by Travis Cobbs - 2013-01-31, 21:59
Re: Compressed LDraw files - by Travis Cobbs - 2013-01-29, 20:46
Re: Compressed LDraw files - by Steffen - 2013-01-29, 23:23
Re: Compressed LDraw files - by Steffen - 2013-02-03, 1:33

Forum Jump:


Users browsing this thread: 4 Guest(s)