From 83c726a34f325ae5be0d5b61b66a97cb41f6973e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 21 Oct 2013 10:26:53 +0200 Subject: GetBaseUTF8 --- src/fs/Traits.hxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/fs/Traits.hxx') diff --git a/src/fs/Traits.hxx b/src/fs/Traits.hxx index 564f6ca1a..244ab8b5c 100644 --- a/src/fs/Traits.hxx +++ b/src/fs/Traits.hxx @@ -27,6 +27,8 @@ #include #endif +#include + #include class Error; @@ -84,6 +86,21 @@ struct PathTraits { return IsSeparatorUTF8(*p); #endif } + + /** + * Determine the "base" file name of the given UTF-8 path. + * The return value points inside the given string. + */ + gcc_pure gcc_nonnull_all + static const char *GetBaseUTF8(const char *p); + + /** + * Determine the "parent" file name of the given UTF-8 path. + * As a special case, returns the string "." if there is no + * separator in the given input string. + */ + gcc_pure gcc_nonnull_all + static std::string GetParentUTF8(const char *p); }; #endif -- cgit v1.2.3