From bf97d13d0b571429b8ba4baf10d3b1a92b27a9ec Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@musicpd.org>
Date: Wed, 28 Oct 2020 14:29:45 +0100
Subject: [PATCH] fs/Traits: add GetPathSuffix()

---
 src/fs/Traits.hxx | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/fs/Traits.hxx b/src/fs/Traits.hxx
index b61de1833..32dcb4c60 100644
--- a/src/fs/Traits.hxx
+++ b/src/fs/Traits.hxx
@@ -96,6 +96,11 @@ struct PathTraitsFS {
 			: nullptr;
 	}
 
+	gcc_pure
+	static const_pointer GetPathSuffix(const_pointer path) noexcept {
+		return GetFilenameSuffix(GetBase(path));
+	}
+
 #ifdef _WIN32
 	gcc_pure gcc_nonnull_all
 	static constexpr bool IsDrive(const_pointer p) noexcept {
@@ -215,6 +220,11 @@ struct PathTraitsUTF8 {
 			: nullptr;
 	}
 
+	gcc_pure
+	static const_pointer GetPathSuffix(const_pointer path) noexcept {
+		return GetFilenameSuffix(GetBase(path));
+	}
+
 #ifdef _WIN32
 	gcc_pure gcc_nonnull_all
 	static constexpr bool IsDrive(const_pointer p) noexcept {