Commit graph

36 commits

Author SHA1 Message Date
Marli Frost
df8f377f92
docs: warn users about DateTime implementation 2020-08-19 12:21:48 +01:00
Marli Frost
6e652446dd feat: define the crate's MSRV 2020-06-23 15:48:50 +01: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
Mathijs van de Nes
80957e2db9 Merge branch 'tm_mon-bounds-fix' of https://github.com/johannesmaibaum/zip-rs 2020-01-11 13:12:04 +01:00
Mathijs van de Nes
a85e3eb809 Fix error checking tm_mon in time::Tm conversion
Fixes #128
2020-01-06 22:27:46 +01:00
Johannes Maibaum
b2a669bd33 Fix bounds check in DateTime::from_time()
`::time::Tm.tm_mon` has number range [0, 11], see:
https://docs.rs/time/0.1.42/time/struct.Tm.html#structfield.tm_mon
2020-01-03 10:04:58 +01:00
Johannes Maibaum
120732780f Add bounds test for DateTime::from_time()
Fails for 1980-01-01 00:00:00.
2020-01-03 10:04:05 +01:00
Lachezar Lechev
99dba6b397
run cargo fix --edition 2019-11-11 08:58:59 +02:00
unknown
8a24ef994f Fix bounds check in DateTime::from_time 2019-03-05 21:43:59 -06:00
Mathijs van de Nes
ad7a0fd4e5 Fix for rust 1.20.0 2018-11-17 12:10:23 +01:00
Mathijs van de Nes
4fd5c9e509 Update DateTime API 2018-11-17 11:08:41 +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
Sam Rijs
a9a3fb521e Defer conversion to time::Tm on read 2018-11-07 00:06:42 +11:00
Johan Andersson
0b222aa958 Remove redundant type specification 2018-06-20 01:38:43 +02:00
Johan Andersson
d51a4fc1d0 Fix file name sanitization for incompatible path separators.
Zip files can contain both / and \ as separators regardless of the OS and as we want to return a sanitized PathBuf that only supports the OS separator on the let's convert incompatible separators to compatible ones.

If one doesn't do this then PathBufs will be returned that can have entire paths in the file name such as "src\\lib.rs" on Linux/Mac, instead of srv / lib.rs as 3 separate components.
2018-06-20 01:31:46 +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
602952750e Update DEFAULT_VERSION
Use a more sane 'version made by' as we can write Bzip2 files
2018-05-22 23:36:56 +02:00
Mathijs van de Nes
ab9667aa5c Properly write 'version needed' in local file header
'version made by' was used instead of version needed by accident.

Resolves #72
2018-05-22 23:36:56 +02:00
Mathijs van de Nes
806147ac9e Fix sanitized_name test for Windows 2018-04-20 13:53:07 +02:00
Mathijs van de Nes
5e8c95e6ed Make santized_name part of the library
It is a common pitfall to use the name as-is during extraction. Adding
this function may prevent some of the issues.

Resolves #65
2018-04-20 13:35:20 +02:00
Mathijs van de Nes
1831edbbdd Expose the raw file name of a file
We still do most operations with normal Strings, but a user can now also get the raw bytes.

Resolves #26
2017-02-12 17:18:40 +01:00
Mathijs van de Nes
49e506c13c Fix types::System enum
Unix had incorrectly assigned the value 1 instead of 3
2016-10-29 12:30:30 +02:00
Mathijs van de Nes
2a3fe099a6 Derive Debug for read::ZipArchive
Resolves #15
2016-08-08 17:34:02 +02:00
Mathijs van de Nes
e80213e250 Rename version to version_made_by
Also remove System for now
2016-04-27 14:30:00 +02:00
Alexander Koval
1e935672bd Replace system attribute by enum 2016-04-23 13:12:28 +03:00
Alexander Koval
a16962cd2c Support for external file attributes 2016-04-23 10:31:54 +03:00
Mathijs van de Nes
d9b83af57c Large refactoring, mostly of the reader
- Combined reader and reader_spec into read
- Alter the iteration protocol for a zip archive
- Modify some names
2015-03-01 11:32:40 +01:00
Mathijs van de Nes
f45a558dac change #[deriving(..)] to #[derive(..)] 2015-01-04 10:51:14 +01:00
Mathijs van de Nes
bdda4310e4 Implement finding files by name
Resolves #2
2014-11-22 19:28:00 +01:00
Mathijs van de Nes
0cd915f185 Split compression from types and pub use ZipFile 2014-09-15 21:33:58 +02:00
Mathijs van de Nes
723e8b0b12 Initial file name/comment encoding support 2014-09-14 17:25:40 +02:00
Mathijs van de Nes
02059ce351 Added documentation and moved types to top 2014-09-11 11:48:44 +02:00
Mathijs van de Nes
ac9301f7d9 Implemented a basic ZipWriter 2014-09-11 10:42:18 +02:00
Mathijs van de Nes
7df03b54f9 Removed some unneeded structs and simplified parse 2014-09-10 17:27:24 +02:00
Mathijs van de Nes
33efdcc539 More elegant way of enforcing single reads 2014-09-10 15:35:01 +02:00