All Projects → wqweto → ZipArchive

wqweto / ZipArchive

Licence: MIT license
A single-class pure VB6 library for zip with ASM speed

Programming Languages

Visual Basic 6.0
7 projects
c
50402 projects - #5 most used programming language
Batchfile
5799 projects

Projects that are alternatives of or similar to ZipArchive

lzbase62
LZ77(LZSS) based compression algorithm in base62 for JavaScript.
Stars: ✭ 38 (+0%)
Mutual labels:  compression, zip, zlib, compress
Zippy
Pure Nim implementation of deflate, zlib, gzip and zip.
Stars: ✭ 88 (+131.58%)
Mutual labels:  compression, zip, zlib
VszLib
7-zip VB6 Helper
Stars: ✭ 35 (-7.89%)
Mutual labels:  compression, zip, vb6
Minizip Ng
Fork of the popular zip manipulation library found in the zlib distribution.
Stars: ✭ 750 (+1873.68%)
Mutual labels:  compression, zip, zlib
Datacompression
Swift libcompression wrapper as an extension for the Data type (GZIP, ZLIB, LZFSE, LZMA, LZ4, deflate, RFC-1950, RFC-1951, RFC-1952)
Stars: ✭ 191 (+402.63%)
Mutual labels:  compression, zip, zlib
Turbobench
Compression Benchmark
Stars: ✭ 211 (+455.26%)
Mutual labels:  compression, zip, zlib
Zip
Efficient library for manipulating zip archives
Stars: ✭ 69 (+81.58%)
Mutual labels:  compression, zip
Denoflate
WebAssembly powered Deflate/Gzip/Zlib compression for Deno, written in Rust
Stars: ✭ 80 (+110.53%)
Mutual labels:  compression, zlib
Compress.js
A simple JavaScript based client-side image compression algorithm
Stars: ✭ 86 (+126.32%)
Mutual labels:  compression, compress
Gtz
A high performance and compression ratio compressor for genomic data, powered by GTXLab of Genetalks.
Stars: ✭ 137 (+260.53%)
Mutual labels:  compression, compress
Sharpcompress
SharpCompress is a fully managed C# library to deal with many compression types and formats.
Stars: ✭ 1,397 (+3576.32%)
Mutual labels:  compression, zip
Zipstorer
A Pure C# Class to Store Files in Zip
Stars: ✭ 139 (+265.79%)
Mutual labels:  compression, zip
Zipper
🗳A library to create, read and modify ZIP archive files, written in Swift.
Stars: ✭ 38 (+0%)
Mutual labels:  compression, zip
Peazip
Free Zip / Unzip software and Rar file extractor. Cross-platform file and archive manager. Features volume spanning, compression, authenticated encryption. Supports 7Z, 7-Zip sfx, ACE, ARJ, Brotli, BZ2, CAB, CHM, CPIO, DEB, GZ, ISO, JAR, LHA/LZH, NSIS, OOo, PAQ/LPAQ, PEA, QUAD, RAR, RPM, split, TAR, Z, ZIP, ZIPX, Zstandard.
Stars: ✭ 827 (+2076.32%)
Mutual labels:  compression, zip
Zlib Ng
zlib replacement with optimizations for "next generation" systems.
Stars: ✭ 807 (+2023.68%)
Mutual labels:  compression, zlib
Fast zlib
Heavily optimized zlib compression algorithm
Stars: ✭ 105 (+176.32%)
Mutual labels:  compression, zlib
Zip
Swift framework for zipping and unzipping files.
Stars: ✭ 2,120 (+5478.95%)
Mutual labels:  compression, zip
Uzlib
Radically unbloated DEFLATE/zlib/gzip compression/decompression library. Can decompress any gzip/zlib data, and offers simplified compressor which produces gzip-compatible output, while requiring much less resources (and providing less compression ratio of course).
Stars: ✭ 168 (+342.11%)
Mutual labels:  compression, zlib
Zip
A portable, simple zip library written in C
Stars: ✭ 596 (+1468.42%)
Mutual labels:  compression, zip
Leanify
lightweight lossless file minifier/optimizer
Stars: ✭ 694 (+1726.32%)
Mutual labels:  compression, zip

cZipArchive

A single-class pure VB6 library for zip archives management

Usage

Just include cZipArchive.cls to your project and start using instances of the class like this:

Simple compression

With New cZipArchive
    .AddFile App.Path & "\your_file"
    .CompressArchive App.Path & "\test.zip"
End With

Compress all files and sub-folders

With New cZipArchive
    .AddFromFolder "C:\Path\To\*.*", Recursive:=True
    .CompressArchive App.Path & "archive.zip"
End With

Decompress all files from archive

With New cZipArchive
    .OpenArchive App.Path & "\test.zip"
    .Extract "C:\Path\To\extract_folder"
End With

Method Extract can optionally filter on file mask (e.g. Filter:="*.doc"), file index (e.g. Filter:=15) or array of booleans with each entry to decompress index set to True.

Extract single file to target filename

OutputTarget can include a target new_filename to be used when extracting a specific file from the archive.

With New cZipArchive
    .OpenArchive App.Path & "\test.zip"
    .Extract "C:\Path\To\extract_folder\new_filename", Filter:="your_file"
End With

Get archive entry uncompressed size

By using FileInfo property keyed on entry filename in first parameter and zipIdxSize like this

With New cZipArchive
    .OpenArchive App.Path & "\test.zip"
    Debug.Print .FileInfo("report.pdf", zipIdxSize)
End With

List files in zip archive

By using FileInfo propery keyed on entry numeric index in first parameter like this

Dim lIdx            As Long
With New cZipArchive
    .OpenArchive App.Path & "\test.zip"
    For lIdx = 0 To .FileCount - 1
        Debug.Print "FileName=" & .FileInfo(lIdx, zipIdxFileName) & ", Size=" & .FileInfo(lIdx, zipIdxSize)
    Next
End With

Here is a list of available values for the second parameter of FileInfo:

Name
0 zipIdxFileName
1 zipIdxAttributes
2 zipIdxCrc32
3 zipIdxSize
4 zipIdxCompressedSize
5 zipIdxComment
6 zipIdxLastModified
7 zipIdxMethod
8 zipIdxOffset
9 zipIdxFlags

Encryption support

Make sure to set Conditional Compilation in Make tab in project's properties dialog to include ZIP_CRYPTO = 1 setting for crypto support to get compiled from sources. By default crypto support is not compiled to reduce footprint on the final executable size.

With New cZipArchive
    .OpenArchive App.Path & "\test.zip"
    .Extract App.Path & "\test", Password:="123456"
End With

Use Password parameter on AddFile method together with EncrStrength parameter to set crypto used when creating archive.

EncrStrength Mode
0 ZipCrypto (default)
1 AES-128
2 AES-192
3 AES-256 (recommended)

Note that default ZipCrypto encryption is weak but this is the only option which is compatible with Windows Explorer built-in zipfolders support.

In-memory operations

Sample utility function ReadBinaryFile in /test/basic/Form1.frm returns byte array with file's content.

Dim baZip() As Byte
With New cZipArchive
    .AddFile ReadBinaryFile("sample.pdf"), "report.pdf"
    .CompressArchive baZip
End With
WriteBinaryFile "test.zip", baZip

Method Extract accepts byte array target too.

Dim baOutput() As Byte
With New cZipArchive
    .OpenArchive ReadBinaryFile("test.zip")
    .Extract baOutput, Filter:=0    '--- archive's first file only
End With

ToDo (not supported yet)

- Deflate64 (de)compressor
- VBA7 (x64) support
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].