General Development

Compression/Decompression at runtime – jestermax

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
Hey, anyone know of a free library/SDK that will unzip/decompress an archive at runtime into memory? right now i'm fiddling with SQX but i think it'll just zip/unzip files. it's not vital at this point in time but i was wondering for the future.
steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
quote:
Originally posted by jestermax:
Hey, anyone know of a free library/SDK that will unzip/decompress an archive at runtime into memory? right now i'm fiddling with SQX but i think it'll just zip/unzip files. it's not vital at this point in time but i was wondering for the future.

Zlib does this. "zlib is designed to be a free, general-purpose, legally unencumbered -- that is, not covered by any patents -- lossless data-compression library for use on virtually any computer hardware and operating system."

zlib is used in countless applications, so it should easy to find example code. It can decompress a file into memory, just like you want. Irrlicht uses it. In fact, with one command in Irrlicht, you can specify a .zip file to load. Then, if you load any other files, it checks if the file is in the .zip first, and loads it from there. It's pretty handy. Irrlicht is open source (no strings attached) so you can see how its done there.

------------------
+---------+
|steveth45|
+---------+

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
wicked! thanks. i knew there was something out there like that but i wasn't sure what it was called.

While you're at it, you wouldn't happen to know of any decent resources for creating programs that can use plug-ins would you? i have a few but they're pretty junky in my opinion. i think i'll end up having to check out source code for existing software (ogre or irricht?)

spade89

Member

Posts: 561
From: houston,tx
Registered: 11-28-2006
if you are using dev c++ you can choose to update it and it has a zip or some sort of compression library to download (i think)

------------------
Matthew(22:36-40)"Teacher, which is the greatest commandment in the Law?" Jesus replied: " 'Love the Lord your God with all your heart and with all your soul and with all your mind. This is the first and greatest commandment. And the second is like it: 'Love your neighbor as yourself.All the Law and the Prophets hang on these two commandments."
Whose Son Is the Christ

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
although i like dev-c++, it's way out of scale for the project i'm thinking of...