diff --git a/src/fs/AllocatedPath.hxx b/src/fs/AllocatedPath.hxx index 577dfa073..e2ff53cbd 100644 --- a/src/fs/AllocatedPath.hxx +++ b/src/fs/AllocatedPath.hxx @@ -295,6 +295,10 @@ public: return Traits::Relative(c_str(), other_fs.c_str()); } + /** + * Returns the filename extension (excluding the dot) or + * nullptr if the path does not have one. + */ [[gnu::pure]] const_pointer GetExtension() const noexcept { return Path{*this}.GetExtension(); diff --git a/src/fs/Path.hxx b/src/fs/Path.hxx index a8a0ac9b2..fceb5c3b5 100644 --- a/src/fs/Path.hxx +++ b/src/fs/Path.hxx @@ -166,6 +166,10 @@ public: return Traits::IsAbsolute(c_str()); } + /** + * Returns the filename extension (excluding the dot) or + * nullptr if the path does not have one. + */ [[gnu::pure]] const_pointer GetExtension() const noexcept; };