summaryrefslogtreecommitdiff
path: root/src/core/Registry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/Registry.cpp')
-rw-r--r--src/core/Registry.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/Registry.cpp b/src/core/Registry.cpp
index 88babb7..044668c 100644
--- a/src/core/Registry.cpp
+++ b/src/core/Registry.cpp
@@ -97,6 +97,18 @@ std::string Registry::getMimetypeForExtension(
return std::string{};
}
+std::string Registry::getMimetypeForFilename(const std::string &filename) const
+{
+ // Fetch the file extension
+ std::string ext = Utils::extractFileExtension(path);
+ if (ext.empty()) {
+ return std::string{};
+ }
+
+ // Fetch the mimetype for the extension
+ return ctx.registry.getMimetypeForExtension(ext);
+}
+
void Registry::registerResourceLocator(ResourceLocator *locator)
{
locators.push_back(locator);