Commit 0fd6235a authored by Max Kellermann's avatar Max Kellermann

playlist/Registry: add FindPlaylistPluginBySuffix()

parent 4d117451
......@@ -274,15 +274,15 @@ playlist_list_open_stream(InputStreamPtr &&is, const char *uri)
return nullptr;
}
bool
playlist_suffix_supported(const char *suffix) noexcept
const PlaylistPlugin *
FindPlaylistPluginBySuffix(const char *suffix) noexcept
{
assert(suffix != nullptr);
playlist_plugins_for_each_enabled(plugin) {
if (plugin->SupportsSuffix(suffix))
return true;
return plugin;
}
return false;
return nullptr;
}
......@@ -78,12 +78,19 @@ playlist_list_open_stream_suffix(InputStreamPtr &&is, const char *suffix);
std::unique_ptr<SongEnumerator>
playlist_list_open_stream(InputStreamPtr &&is, const char *uri);
gcc_pure
const PlaylistPlugin *
FindPlaylistPluginBySuffix(const char *suffix) noexcept;
/**
* Determines if there is a playlist plugin which can handle the
* specified file name suffix.
*/
gcc_pure
bool
playlist_suffix_supported(const char *suffix) noexcept;
inline bool
playlist_suffix_supported(const char *suffix) noexcept
{
return FindPlaylistPluginBySuffix(suffix) != nullptr;
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment