input/Plugin: pass URI as std::string_view

This commit is contained in:
Max Kellermann
2025-01-30 11:20:52 +01:00
parent aee49d1c1c
commit 715ef846b6
35 changed files with 85 additions and 92 deletions

View File

@@ -146,7 +146,7 @@ find_stream_art(std::string_view directory, Mutex &mutex)
std::string art_file = PathTraitsUTF8::Build(directory, name);
try {
return InputStream::OpenReady(art_file.c_str(), mutex);
return InputStream::OpenReady(art_file, mutex);
} catch (...) {
auto e = std::current_exception();
if (!IsFileNotFound(e))

View File

@@ -68,7 +68,7 @@ private:
void DecodeFile();
/* virtual methods from class DecoderClient */
InputStreamPtr OpenUri(const char *uri) override;
InputStreamPtr OpenUri(std::string_view uri) override;
size_t Read(InputStream &is,
std::span<std::byte> dest) noexcept override;
@@ -246,14 +246,14 @@ try {
if (!path.IsNull())
DecodeFile();
else
DecodeStream(*OpenUri(uri.c_str()));
DecodeStream(*OpenUri(uri));
ChromaprintDecoderClient::Finish();
} catch (StopDecoder) {
}
InputStreamPtr
GetChromaprintCommand::OpenUri(const char *uri2)
GetChromaprintCommand::OpenUri(std::string_view uri2)
{
if (cancel)
throw StopDecoder();