From a8e0846a7c111a8d5b5cf8592ecb9b9bbd15ce26 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 22 Sep 2020 22:46:29 +0200 Subject: Initial file manager implementation, with thumbnail caching --- include/Path.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/Path.hpp') 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 -- cgit v1.2.3-70-g09d2