From 7e7cdf73b9ea56352490d63228b4f6e673a12c45 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 23 Jan 2023 14:07:33 +0100 Subject: [PATCH] input/InputStream: add method GetUriView() --- src/input/BufferedInputStream.cxx | 2 +- src/input/InputStream.hxx | 4 ++++ src/input/ProxyInputStream.cxx | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/input/BufferedInputStream.cxx b/src/input/BufferedInputStream.cxx index 9ebecc6ce..b171a1d31 100644 --- a/src/input/BufferedInputStream.cxx +++ b/src/input/BufferedInputStream.cxx @@ -22,7 +22,7 @@ #include BufferedInputStream::BufferedInputStream(InputStreamPtr _input) - :InputStream(_input->GetURI(), _input->mutex), + :InputStream(_input->GetUriView(), _input->mutex), BufferingInputStream(std::move(_input)) { assert(IsEligible(GetInput())); diff --git a/src/input/InputStream.hxx b/src/input/InputStream.hxx index 9d03cd094..94b0b79a8 100644 --- a/src/input/InputStream.hxx +++ b/src/input/InputStream.hxx @@ -159,6 +159,10 @@ public: return uri.c_str(); } + std::string_view GetUriView() const noexcept { + return uri; + } + /** * Check for errors that may have occurred in the I/O thread. * Throws std::runtime_error on error. diff --git a/src/input/ProxyInputStream.cxx b/src/input/ProxyInputStream.cxx index 9afa71370..9a0cb47d6 100644 --- a/src/input/ProxyInputStream.cxx +++ b/src/input/ProxyInputStream.cxx @@ -23,7 +23,7 @@ #include ProxyInputStream::ProxyInputStream(InputStreamPtr _input) noexcept - :InputStream(_input->GetURI(), _input->mutex), + :InputStream(_input->GetUriView(), _input->mutex), input(std::move(_input)) { assert(input);