aboutsummaryrefslogtreecommitdiff
path: root/include/Path.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/Path.hpp')
-rw-r--r--include/Path.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/Path.hpp b/include/Path.hpp
index bd978bc..bdc31c1 100644
--- a/include/Path.hpp
+++ b/include/Path.hpp
@@ -26,6 +26,14 @@ namespace QuickMedia {
return *this;
}
+ // Returns empty string if no extension
+ const char* ext() const {
+ size_t index = data.rfind('.');
+ if(index == std::string::npos)
+ return "";
+ return data.c_str() + index;
+ }
+
std::string data;
};
} \ No newline at end of file