Recent

Author Topic: EasyZip component (request)  (Read 5106 times)

Rave

  • Full Member
  • ***
  • Posts: 160
EasyZip component (request)
« on: July 23, 2011, 12:35:30 am »
I have hard time using zlib, so I'd like to request easy to use component for handling zip (and maybe lzma) archives. I'd like to see following functions:

openArchive(filename:PChar,compressionLevel:byte;)

Opens archive with path in filename and set it's compression level to compressionLevel. Invoked by constructor.


addFile(path,pathinZip:PChar; createDirs:Boolean)

adds file in path as pathinzip, if some of directories in pathinZip are missing and createDirs=true they're created inside archive. Example:
Code: [Select]
EasyZip1.addFile('c:\letter to mom.doc','letters/letter to mom.doc');

addDirectory(path:PChar;);

adds directory in path to archive


extract(path:PChar;createDirs:Boolean)

extracts archive to specifed location. If createDirs=true and some of directories are missing in patch, they're created along the way.

closearchive();

Closes archive and writes it to disk. Invoked by destructor.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: EasyZip component (request)
« Reply #1 on: July 23, 2011, 07:58:25 am »
Sometimes searching the forum can be enlightening  :D

Does this:
http://lazarus.freepascal.org/index.php/topic,12983.msg70195.html#msg70195
help?

(You can forget about the Delphi part, but it shows there already is support for zip/unzip)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Rave

  • Full Member
  • ***
  • Posts: 160
Re: EasyZip component (request)
« Reply #2 on: July 23, 2011, 08:01:39 am »
Yeah, I thought about that, but function names are so confusing. I need only basic functionality as described in OP as I want just to make xml-based ODF-like document format and instead of keeping whole directory, keep just one file..

 

TinyPortal © 2005-2018