zipper 0.0.5
D wrapper around libzip
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
Zipper
The wrapper for libzip that allows to deal with zip-archives with ease.
Project status
Currently project is in alpha stage, thus everything may be changed.
Examples
// Read zip archive
auto zip = Zipper(Path("test-data", "test-zip.zip"));
zip.num_entries; // returns number of entries
foreach(entry; zip.entries) { // List content of zip repo
writeln(entry.name, entry.size);
}
// Read the entry from zip archive as array of chars.
// Currently there is no checks for type provided for template.
// Seems to be working with char and byte types.
zip["path/to/entry"].readFull!char;
// Extract archive to some destination
zip.extractTo(Path("path", "to", "dest"));
// There is no need to close archive, it will be closed automatically
// when last reference to zip will be destroyed (in this case when zip var
// will be destroyed
// Create new archive
auto zip = Zipper(Path("test-data", "test-zip.zip"), ZipMode.CREATE);
// Create directory inside archive
zip.addEntryDirectory("my-dir");
// Add file to archive
zip.addEntryFile(Path("path", "to", "file"), "my-dir/my-file.txt");
// Note that all changes will be written when archve close.
// Also, Zipper archive will be automatically closed when last reference
// to archive destroyed (Zipper uses RefCounted struct over libzip's zip_t
// object).
License
This library is licensed under MPL-2.0 license. The libzip library is licensed under MIT license.
- 0.0.5 released 7 months ago
- katyukha/Zipper
- MPL-2.0
- Copyright © 2023, Dmytro Katyukha
- Authors:
- Dependencies:
- thepath, bindbc-common
- Versions:
-
0.0.5 2024-May-15 0.0.4-bindbc 2023-Sep-22 0.0.3 2023-Jul-21 0.0.3-import-c 2023-Jul-25 0.0.3-bindbc 2023-Sep-22 - Download Stats:
-
-
9 downloads today
-
9 downloads this week
-
65 downloads this month
-
1769 downloads total
-
- Score:
- 1.9
- Short URL:
- zipper.dub.pm