From 849ed122c78a80a7852beddc38d62bd86b69d501 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 14 Jul 2022 17:35:56 +0200 Subject: [PATCH] fs/Path: document GetExtension() --- src/fs/AllocatedPath.hxx | 4 ++++ src/fs/Path.hxx | 4 ++++ 2 files changed, 8 insertions(+) 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; };