Commit graph

480 commits

Author SHA1 Message Date
Chris Hennick
888e5fac16
fix: Switch padding field ID to one documented in APPNOTE 2024-06-02 16:09:19 -07:00
Alex Franchuk
a8875b0226
feat: Allow the archive offset behavior of the reader to be configured.
Aside from supporting the current behavior which allows archives to be
preceded by arbitrary data (added in fc749a09), this also allows
detection of the offset to use by checking whether a central directory
header is at the expected location. This is configurable because if the
behavior were based only on detection, there could be false positives if
archive data happened to contain a central directory header at the right
spot.
2024-05-29 13:59:20 -04:00
Chris Hennick
bf7c8d21fb
style: cargo fmt --all 2024-05-27 17:20:46 -07:00
Chris Hennick
0c7b0080f3
chore: Bug fixes for debug implementation 2024-05-27 17:18:31 -07:00
Chris Hennick
8d81cbc2c3
chore: Bug fixes for debug implementation 2024-05-27 17:11:24 -07:00
Chris Hennick
48b1adb64b
fix: Derive Debug for ZipWriter 2024-05-27 16:58:12 -07:00
Chris Hennick
fdb01c3dd2
style: cargo fmt --all 2024-05-25 15:10:31 -07:00
Chris Hennick
eb949ebdef
chore: Update unit tests 2024-05-25 15:05:02 -07:00
Chris Hennick
15f8bac454
chore: Remove unused import 2024-05-25 14:51:18 -07:00
Chris Hennick
edbb7343f5
refactor: use a MIN_VERSION constant 2024-05-25 14:29:36 -07:00
Chris Hennick
40f20d8a6b
fix: lower default version to 4.5 and use the version-needed-to-extract where feasible. 2024-05-25 14:29:35 -07:00
Chris Hennick
92012b9795
chore: Tweaks to make version_needed and version_made_by work with recently-merged changes 2024-05-24 21:55:18 -07:00
Chris Hennick
cda4712153
fix: version-needed-to-extract was incorrect in central header, and version-made-by could be lower than that (#100) 2024-05-24 21:47:06 -07:00
Chris Hennick
a28b16e69c
Apply suggestions from code review
Fix errors

Signed-off-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com>
2024-05-24 15:27:28 -07:00
Chris Hennick
df70f6a320
Fix unmatched bracket due to bad merge
Signed-off-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com>
2024-05-24 14:57:06 -07:00
Chris Hennick
6b19c877e2
Merge branch 'master' into bulk-parsing
Signed-off-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com>
2024-05-24 14:50:21 -07:00
Chris Hennick
294564c1a8
style: cargo fmt --all 2024-05-24 14:26:12 -07:00
Chris Hennick
0636bd7411
fix: version-needed-to-extract was incorrect in central header, and version-made-by could be lower than that (#100) 2024-05-24 14:24:55 -07:00
Danny McClanahan
80ca254569
fix doc comments 2024-05-24 08:15:16 -04:00
Danny McClanahan
a769e9410e
Revert "interpose ZipRawValues into ZipFileData"
This reverts commit d8d4dee5cec372878259380fa347c0ffc6cca044.
2024-05-24 08:00:04 -04:00
Danny McClanahan
4a784b5636
interpose ZipRawValues into ZipFileData 2024-05-24 07:58:05 -04:00
Danny McClanahan
0b31d9846a
review comments 2 2024-05-24 07:54:41 -04:00
Danny McClanahan
21d07e192c
add ExtraFieldMagic and Zip64ExtraFieldBlock 2024-05-24 07:54:39 -04:00
Danny McClanahan
cf2d980612
expose pub(crate) methods to convert compression methods 2024-05-24 07:53:15 -04:00
Danny McClanahan
ad1d51d099
write file comment to central directory header 2024-05-24 07:52:30 -04:00
Danny McClanahan
ea308499af
bulk parsing and bulk writing
- use blocks for reading individual file headers
- remove unnecessary option wrapping for stream entries
- create Block trait
- add coerce method to reduce some boilerplate
- add serialize method to reduce more boilerplate
- use to_le! and from_le!
- add test case
- add some docs
- rename a few structs to clarify zip32-only
2024-05-24 07:52:25 -04:00
Chris Hennick
da8be86761
style: cargo fmt --all 2024-05-23 15:53:37 -07:00
Chris Hennick
7d61377503
refactor: Change type of last_modified_time to Option<DateTime> 2024-05-23 14:15:38 -07:00
Chris Hennick
b0c666aa0c
chore: Continue to accept archives with invalid DateTime, and use now_utc() as default only when writing, not reading 2024-05-23 09:44:06 -07:00
Chris Hennick
42af7158e9
style: cargo fmt --all 2024-05-21 08:46:24 -07:00
Chris Hennick
a731f2a4c6
refactor: Merge the hidden deflate-flate2 flag into the public one 2024-05-20 18:02:30 -07:00
Chris Hennick
870f915bc5
refactor: Rename _deflate-non-zopfli to _deflate-flate2 2024-05-20 12:02:05 -07:00
Chris Hennick
6071dc13b0
perf: Change default compression implementation to flate2/zlib-ng 2024-05-20 11:55:51 -07:00
Chris Hennick
be8cb432f6
style: cargo fmt --all 2024-05-13 20:22:11 -07:00
Chris Hennick
3bf0301e39
feat: Add is_symlink method 2024-05-13 19:52:14 -07:00
Chris Hennick
8eb5a75a87
style: Merge patches from code into non_utf8.zip 2024-05-10 09:01:17 -07:00
Chris Hennick
186c89deea
chore: String has into_bytes but not into_boxed_bytes 2024-05-09 19:11:16 -07:00
Chris Hennick
f7ea2764a2
chore: &str doesn't have into_boxed_bytes, so call to_string first 2024-05-09 19:08:55 -07:00
Chris Hennick
35b3a8f257
chore: fix type mismatch in shallow_copy_file caused by last fix 2024-05-09 19:06:44 -07:00
Chris Hennick
34b99956c9
chore: shallow_copy_file needs to update file_name_raw 2024-05-09 19:04:08 -07:00
Chris Hennick
650dd9a71f
chore: More patches to binary file 2024-05-09 18:57:15 -07:00
Chris Hennick
3454f84e85
chore: Patch out-of-date binary file 2024-05-09 18:50:49 -07:00
Chris Hennick
7ba16ae622
chore: Update generic type bounds 2024-05-09 18:41:48 -07:00
Chris Hennick
e1eae16e12
style: Fix cargo fmt re trailing comma in type-constraint list 2024-05-09 18:35:28 -07:00
Chris Hennick
113d18c6a0
chore: fix typo 2024-05-09 18:34:03 -07:00
Chris Hennick
df8479ac4f
chore: Bug fix: ToOwned requires an explicit type bound 2024-05-09 18:33:41 -07:00
Chris Hennick
8e74a9da07
chore: Fix type bound so that to_owned() is available 2024-05-09 18:31:07 -07:00
Chris Hennick
dcc6850c51
style: Fix cargo fmt error re trailing comma 2024-05-09 18:27:54 -07:00
Chris Hennick
955d1eddcd
chore: Add missing to_owned
Needed so that `name` can be used to populate both `file_name` (for `insert_file_data`) and `file_name_raw` (for saving)
2024-05-09 18:26:39 -07:00
Chris Hennick
95c8b07bc2
chore: Update misleading comment 2024-05-09 18:25:23 -07:00