Compare commits

...

3 commits

Author SHA1 Message Date
2713083a82 updated CHANGELOG.md
All checks were successful
continuous-integration/drone/push Build is passing
2021-04-14 19:10:07 +10:00
48632a471a Merge branch 'master' of https://git.bune.city/lynnesbian/fif
 Conflicts:
	Cargo.lock
2021-04-14 19:08:52 +10:00
59a3042ebc added .rpa format support, new system extension set 2021-04-14 19:08:18 +10:00
4 changed files with 12 additions and 1 deletions

View file

@ -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
View file

@ -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",

View file

@ -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"],
}
}

View file

@ -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,