mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-07-08 01:31:53 +08:00
Add script type detect for paz archive
This commit is contained in:
@@ -435,6 +435,18 @@ impl<T: Read> ArchiveContent for PazFileEntry<T> {
|
|||||||
fn name(&self) -> &str {
|
fn name(&self) -> &str {
|
||||||
&self.entry.name
|
&self.entry.name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn script_type(&self) -> Option<&ScriptType> {
|
||||||
|
let ext_name = std::path::Path::new(&self.entry.name)
|
||||||
|
.extension()
|
||||||
|
.and_then(|s| s.to_str())
|
||||||
|
.unwrap_or("")
|
||||||
|
.to_lowercase();
|
||||||
|
match ext_name.as_str() {
|
||||||
|
"sc" => Some(&ScriptType::Musica),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user