fs/Path: add method GetSuffix()
Type-safe wrapper for uri_get_suffix().
This commit is contained in:
@@ -87,7 +87,7 @@ tag_file_scan(Path path_fs, const tag_handler &handler, void *handler_ctx)
|
||||
|
||||
/* check if there's a suffix and a plugin */
|
||||
|
||||
const char *suffix = uri_get_suffix(path_fs.c_str());
|
||||
const char *suffix = path_fs.GetSuffix();
|
||||
if (suffix == nullptr)
|
||||
return false;
|
||||
|
||||
|
@@ -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());
|
||||
}
|
||||
|
@@ -161,6 +161,9 @@ public:
|
||||
bool IsAbsolute() const {
|
||||
return PathTraitsFS::IsAbsolute(c_str());
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
const char *GetSuffix() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -35,7 +35,7 @@ playlist_open_path_suffix(Path path, Mutex &mutex, Cond &cond)
|
||||
{
|
||||
assert(!path.IsNull());
|
||||
|
||||
const char *suffix = uri_get_suffix(path.c_str());
|
||||
const char *suffix = path.GetSuffix();
|
||||
if (suffix == nullptr || !playlist_suffix_supported(suffix))
|
||||
return nullptr;
|
||||
|
||||
|
Reference in New Issue
Block a user