Benjamin Richner
d50dcaced7
run cargo fmt
2020-06-23 20:46:41 +02:00
Benjamin Richner
dbae003aca
Merge improvements from master
2020-06-23 20:44:18 +02:00
Plecra
e123567862
Merge branch 'master' into any-flate2-backend
2020-06-23 16:51:15 +01:00
Jeremy Aube
d382f04e5a
Change default comment to String::new() and fixed tests
2020-06-21 12:38:36 -04:00
Benjamin Richner
493afdbee1
run cargo fmt
2020-06-21 17:47:08 +02:00
Benjamin Richner
bd3ed222ac
Merge improvements from master
2020-06-21 17:43:40 +02:00
Marli Frost
e8f576e179
chore: allow internal use of deprecated items
2020-06-17 18:20:40 +01:00
Piotr Maks
d1bdd552e9
Enable deflated compression method for any flate2 backend
...
Allow using other than default flate2 backend for deflated compression
method. The motivation for this change was to allow using different
backends in dependent crates.
2020-06-17 07:23:32 +02:00
Marli Frost
9ed6904383
refactor: replace the podio crate with byteorder
2020-06-16 18:59:13 +01:00
Ryan Levick
5e76689f49
Don't run doc test since it will panic
2020-06-16 18:54:42 +02:00
Zac Pullar-Strecker
c074a3090c
run rustfmt
2020-06-16 14:45:36 +12:00
Zac Pullar-Strecker
f04e4f4a04
Changes from review
2020-06-16 14:38:35 +12:00
Zac Pullar-Strecker
178699d2d5
Add function to extract a all files in an archive to a directory
2020-06-16 14:38:35 +12:00
Ryan Levick
96354ffa09
More cleanup
2020-06-15 18:09:10 +02:00
Ryan Levick
4e4bbef51b
Merge pull request #109 from JDepooter/add_header_start
...
Add ZipFile::header_start
2020-06-15 14:49:08 +02:00
Ryan Levick
31b4b5c842
Address clippy issues
2020-06-15 11:11:17 +02:00
Ryan Levick
ebb07348ee
Run cargo fmt
2020-06-15 10:44:39 +02:00
Benjamin Richner
f9116fc9c8
Clean up whitespaces
2020-05-21 22:14:53 +02:00
Benjamin Richner
cf7ff173b3
merge edition 2018 and other improvements from master
2020-05-21 21:58:38 +02:00
Manu Thambi
91c93579f2
Added ZipArchive::file_names() method to return an iterator of all the file names
...
in the archive.
Using ZipArchive::by_index() to obtain a list of files is slow, if the files are
not read, because it creates the decompressor internally before returning ZipFile.
Fixes #122
2020-01-14 09:58:12 -05:00
Manu Thambi
69ad3bd2a4
Enable reading/writing ZIP archive comment.
2020-01-09 11:58:35 -05:00
Lachezar Lechev
29517e9a6b
run cargo fix --edition-idioms
and manually fix other things
2019-11-11 09:20:31 +02:00
Lachezar Lechev
99dba6b397
run cargo fix --edition
2019-11-11 08:58:59 +02:00
Benjamin Richner
744bb41b43
Ignore password if file not encrypted. Clean up code structure.
2019-10-20 00:58:07 +02:00
Benjamin Richner
1f87098e57
Enable decryption with file reader by_name()
2019-10-19 23:43:33 +02:00
Benjamin Richner
f9f5029fc1
Added ZipCrypto support for stored and deflated files
2019-10-19 18:59:10 +02:00
Joel Depooter
cd867ecdc2
Add ZipFile::header_start
...
This function returns the offset of the local zip header for a ZipFile object
2019-07-02 16:27:45 -07:00
jonpas
14f77b390a
Use deflate as feature name
2019-06-17 21:36:38 +02:00
jonpas
b171b915f8
Switch to flate2
2019-06-14 15:25:00 +02:00
Damien Collard
b9af51e654
Add ZipFile::is_dir() and ZipFile::is_file().
...
The naming matches that of std::fs::Metadata.
An entry is determined to be a directory based on the presence of
a trailing path separator, i.e. '/' or '\'.
This patch adds a small test zip containing files and directories.
Their names match their type so as to make testing easy.
2019-01-27 15:57:30 +01:00
Mathijs van de Nes
cfbcd768d3
Fix bug in last_modified_time
2018-11-17 11:30:00 +01:00
Mathijs van de Nes
f94d4b7a78
Change date api
...
Remove msdos_time dependency, and introduce simplified DateTime object.
This object does bounds checking to see if dates are representable in
msdos.
2018-11-17 10:26:25 +01:00
Mathijs van de Nes
4ae1db992c
Merge branch 'add-libflate' of https://github.com/xmclark/zip-rs
2018-11-13 10:33:16 +01:00
Mackenzie Clark
6528ea63d2
use the fully qualified decoder name
2018-11-09 16:20:40 -08:00
Sam Rijs
a9a3fb521e
Defer conversion to time::Tm on read
2018-11-07 00:06:42 +11:00
Sam Rijs
9e8747872b
Defer parsing of local file header
2018-11-06 23:14:23 +11:00
Mackenzie Clark
c05b6c2317
add libflate feature
2018-11-04 10:12:21 -08:00
Mathijs van de Nes
bb38674a14
Add archive_offset after processing extra fields
...
This ensures that the value will still be 0xFFFFFFFF before parsing a
zip64 extra field, and that the correction will also apply after the
parsing.
2018-10-17 11:45:41 +02:00
Mathijs van de Nes
c286a8ba16
Zip64: also support a large header_start
2018-10-17 11:39:15 +02:00
Mathijs van de Nes
dbb871245b
Fix parse_extra_field for zip64
...
The specification states that fields are only present when their
corresponding entry in the central directory is set to 0xFFFFFFFF.
2018-10-16 17:44:53 +02:00
Benedikt Rascher-Friesenhausen
804cfea51c
Replace try!
macros with ?
operator calls
...
The `?` operator exists since Rust version 1.13.0 and has since become the
standard and recommended variant over the `try!` macro (see
https://doc.rust-lang.org/std/macro.try.html where it is explicitly mentioned to
use the `?` operator instead of the `try!` macro).
I think it is especially useful to replace the `try!` usages throughout the
examples (since new users might not be familiar with the `try!` macro at all).
2018-10-02 23:12:35 +02:00
Mathijs van de Nes
1c2024c554
Derivce Clone for ZipArchive
2018-06-22 15:47:29 +02:00
Mathijs van de Nes
2fa4111042
Fix an issue parsing zip64 files
...
Offset to the start of central directory may be 0xFFFFFFFF if it is a
Zip64 file. Previously, that value was used when calculating the archive
offset. The value will now be ignored if the Zip64 central directory
could be located.
2018-06-22 15:16:04 +02:00
Mathijs van de Nes
86d9d20884
Calculate data_start after parse_extra_field
...
Some extra fields may alter offsets, e.g. Zip64.
2018-06-17 15:23:19 +02:00
Mathijs van de Nes
d2ccfc16f7
Speed up Drop of ZipFileReader
...
Skip CRC and decompression when dropping an owned ZipFileReader
2018-06-17 15:16:14 +02:00
Mathijs van de Nes
38d1699853
Improve reading from non-seekable streams
...
You can now repeatedly call a function to iterate over all files in a
zip. This may give some suboptimal results, but is useful when dealing
with an incoming data stream.
2018-06-16 14:14:34 +02:00
Mathijs van de Nes
5b17e07086
Merge branch 'sequential-read' of https://github.com/FauxFaux/zip-rs into FauxFaux-sequential-read
2018-06-15 16:59:09 +02:00
Mathijs van de Nes
39ccaab76c
Merge branch 'flate2-backends' of https://github.com/alexbool/zip-rs
2018-05-27 10:33:52 +02:00
Mathijs van de Nes
1cb79a0b91
Fix memory issues on corrupt zip files
...
Do not pre-allocate the number of files, as this might be an invalid
number.
Also give a more helpfull error message when the start of the central
directory could not be found.
Resolves #68
2018-05-23 19:43:46 +02:00
Mathijs van de Nes
00310c44d8
Expose zip file comment in ZipArchive
...
Resolves #71
2018-05-23 19:17:06 +02:00