diff options
author | Max Kellermann <max@duempel.org> | 2013-10-21 10:26:53 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-21 10:50:22 +0200 |
commit | 83c726a34f325ae5be0d5b61b66a97cb41f6973e (patch) | |
tree | ff65ffc34bd655cce2a52b9e84d5a762ea0f021e /src/fs/Traits.hxx | |
parent | a0415f73d459b5763f59dfa4151ec89834d29526 (diff) | |
download | mpd-83c726a34f325ae5be0d5b61b66a97cb41f6973e.tar.gz mpd-83c726a34f325ae5be0d5b61b66a97cb41f6973e.tar.xz mpd-83c726a34f325ae5be0d5b61b66a97cb41f6973e.zip |
GetBaseUTF8
Diffstat (limited to 'src/fs/Traits.hxx')
-rw-r--r-- | src/fs/Traits.hxx | 17 |
1 files changed, 17 insertions, 0 deletions
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 <glib.h> #endif +#include <string> + #include <assert.h> 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 |