Compare commits
3 commits
7f87f59670
...
2713083a82
Author | SHA1 | Date | |
---|---|---|---|
2713083a82 | |||
48632a471a | |||
59a3042ebc |
4 changed files with 12 additions and 1 deletions
|
@ -6,6 +6,8 @@ Dates are given in YYYY-MM-DD format.
|
|||
- Added Apple iWork document formats to documents extension set
|
||||
- Cleaned up and properly documented tests
|
||||
- Renamed `Script` (in `formats.rs`) to `Shell`, in line with renaming in `paramaters.rs`
|
||||
- Added .rpa (renpy archive) support
|
||||
- Added system extension set
|
||||
|
||||
### v0.2.12 (2021-04-14)
|
||||
#### Features
|
||||
|
|
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -340,7 +340,7 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
|
|||
[[package]]
|
||||
name = "mime_guess"
|
||||
version = "2.0.4"
|
||||
source = "git+https://github.com/Lynnesbian/mime_guess#28633a9936a9c3eb29cf85e99899e35ddd63d9c1"
|
||||
source = "git+https://github.com/Lynnesbian/mime_guess#5432b3c1991372291a5e67457cc9307c85f77bd9"
|
||||
dependencies = [
|
||||
"mime",
|
||||
"unicase",
|
||||
|
|
|
@ -18,6 +18,8 @@ pub enum ExtensionSet {
|
|||
Text,
|
||||
/// Extensions used for archive file formats, such as `zip`, `zst`, `gz`, etc.
|
||||
Archives,
|
||||
/// Extensions used for system file formats, such as `mbr`, `crash`, `dll`, etc.
|
||||
System,
|
||||
}
|
||||
|
||||
impl ExtensionSet {
|
||||
|
@ -40,6 +42,9 @@ impl ExtensionSet {
|
|||
Self::Text => mime_guess::get_mime_extensions_str("text/*").unwrap().to_vec(),
|
||||
// many compressed file types follow the name scheme "application/x.+compressed.*" - maybe this can be used
|
||||
// somehow to extract extensions for compressed files from mime_guess?
|
||||
Self::Archives => vec!["zip", "tar", "gz", "zst", "xz", "rar", "7z", "bz", "bz2", "tgz", "rpa"],
|
||||
Self::System => vec!["com", "dll", "exe", "sys", "reg", "nt", "cpl", "msi", "efi", "bio", "rcv", "mbr", "sbf", "grub", "ko", "dylib", "pdb", "hdmp", "crash",
|
||||
],
|
||||
Self::Archives => vec!["zip", "tar", "gz", "zst", "xz", "rar", "7z", "bz", "bz2", "tgz"],
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,10 @@ cfg_if! {
|
|||
open_document_check(buf, "presentation")
|
||||
});
|
||||
|
||||
info.add("application/x-rpa", "rpa", |buf| {
|
||||
buf.len() >= 34 && buf.starts_with(b"RPA-") && buf[7] == b' ' && buf[24] ==b' '
|
||||
});
|
||||
|
||||
info.add("image/svg+xml", "svg", |buf| {
|
||||
// before doing the moderately expensive SVG check, we should make sure that the input is actually SGML-ish
|
||||
// by "SGML-ish", i mean starts with anywhere from zero to ∞-1 whitespace characters, and then a less than sign,
|
||||
|
|
Loading…
Reference in a new issue