diff options
author | Max Kellermann <max@duempel.org> | 2015-03-01 01:09:53 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-03-01 01:09:53 +0100 |
commit | 7ce96585f5e0a5786f17d7996252b5c58e60d0ed (patch) | |
tree | 32cba161d309fb1a8afc303d6813c55c5c707233 /src/fs | |
parent | 41cc31c124686304f2ce7098c16ab27b5f88057e (diff) | |
download | mpd-7ce96585f5e0a5786f17d7996252b5c58e60d0ed.tar.gz mpd-7ce96585f5e0a5786f17d7996252b5c58e60d0ed.tar.xz mpd-7ce96585f5e0a5786f17d7996252b5c58e60d0ed.zip |
fs/Path: add method GetSuffix()
Type-safe wrapper for uri_get_suffix().
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/Path.cxx | 7 | ||||
-rw-r--r-- | src/fs/Path.hxx | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/fs/Path.cxx b/src/fs/Path.cxx index 5a21b698f..691284313 100644 --- a/src/fs/Path.cxx +++ b/src/fs/Path.cxx @@ -20,9 +20,16 @@ #include "config.h" #include "Path.hxx" #include "Charset.hxx" +#include "util/UriUtil.hxx" std::string Path::ToUTF8() const { return ::PathToUTF8(c_str()); } + +const char * +Path::GetSuffix() const +{ + return uri_get_suffix(c_str()); +} diff --git a/src/fs/Path.hxx b/src/fs/Path.hxx index 56459723d..8126a668a 100644 --- a/src/fs/Path.hxx +++ b/src/fs/Path.hxx @@ -161,6 +161,9 @@ public: bool IsAbsolute() const { return PathTraitsFS::IsAbsolute(c_str()); } + + gcc_pure + const char *GetSuffix() const; }; #endif |