aboutsummaryrefslogtreecommitdiff
path: root/src/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/text')
-rw-r--r--src/text/mod.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/text/mod.rs b/src/text/mod.rs
index c3fd8f6..ac474bc 100644
--- a/src/text/mod.rs
+++ b/src/text/mod.rs
@@ -44,3 +44,9 @@ pub fn extract_text(path : &str) -> String {
let extenstion = p.extension().unwrap_or_else(|| OsStr::new("")).to_str().unwrap();
EXT.get(extenstion).unwrap_or(&(empty_extractor as ExtFn))(path)
}
+
+pub fn is_supported(path : &str) -> bool {
+ let p = Path::new(&path);
+ let extenstion = p.extension().unwrap_or_else(|| OsStr::new("")).to_str().unwrap();
+ EXT.get(extenstion).is_some()
+}