diff --git a/src/input/AsyncInputStream.cxx b/src/input/AsyncInputStream.cxx index 599aaf799..f871be26f 100644 --- a/src/input/AsyncInputStream.cxx +++ b/src/input/AsyncInputStream.cxx @@ -12,7 +12,7 @@ #include -AsyncInputStream::AsyncInputStream(EventLoop &event_loop, const char *_url, +AsyncInputStream::AsyncInputStream(EventLoop &event_loop, std::string_view _url, Mutex &_mutex, size_t _buffer_size, size_t _resume_at) noexcept diff --git a/src/input/AsyncInputStream.hxx b/src/input/AsyncInputStream.hxx index 0a1f342b1..aba4936fc 100644 --- a/src/input/AsyncInputStream.hxx +++ b/src/input/AsyncInputStream.hxx @@ -1,8 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Copyright The Music Player Daemon Project -#ifndef MPD_ASYNC_INPUT_STREAM_HXX -#define MPD_ASYNC_INPUT_STREAM_HXX +#pragma once #include "InputStream.hxx" #include "event/InjectEvent.hxx" @@ -54,7 +53,7 @@ protected: std::exception_ptr postponed_exception; public: - AsyncInputStream(EventLoop &event_loop, const char *_url, + AsyncInputStream(EventLoop &event_loop, std::string_view _url, Mutex &_mutex, size_t _buffer_size, size_t _resume_at) noexcept; @@ -155,5 +154,3 @@ private: void DeferredResume() noexcept; void DeferredSeek() noexcept; }; - -#endif diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx index d8584f896..30e226aee 100644 --- a/src/input/plugins/CurlInputPlugin.cxx +++ b/src/input/plugins/CurlInputPlugin.cxx @@ -66,7 +66,7 @@ class CurlInputStream final : public AsyncInputStream, CurlResponseHandler { public: template - CurlInputStream(EventLoop &event_loop, const char *_url, + CurlInputStream(EventLoop &event_loop, std::string_view _url, const Curl::Headers &headers, I &&_icy, Mutex &_mutex); @@ -76,7 +76,7 @@ public: CurlInputStream(const CurlInputStream &) = delete; CurlInputStream &operator=(const CurlInputStream &) = delete; - static InputStreamPtr Open(const char *url, + static InputStreamPtr Open(std::string_view url, const Curl::Headers &headers, Mutex &mutex); @@ -435,7 +435,7 @@ input_curl_finish() noexcept template inline -CurlInputStream::CurlInputStream(EventLoop &event_loop, const char *_url, +CurlInputStream::CurlInputStream(EventLoop &event_loop, std::string_view _url, const Curl::Headers &headers, I &&_icy, Mutex &_mutex) @@ -568,7 +568,7 @@ CurlInputStream::DoSeek(offset_type new_offset) } inline InputStreamPtr -CurlInputStream::Open(const char *url, +CurlInputStream::Open(std::string_view url, const Curl::Headers &headers, Mutex &mutex) { @@ -588,7 +588,7 @@ CurlInputStream::Open(const char *url, } InputStreamPtr -OpenCurlInputStream(const char *uri, const Curl::Headers &headers, +OpenCurlInputStream(std::string_view uri, const Curl::Headers &headers, Mutex &mutex) { return CurlInputStream::Open(uri, headers, mutex); diff --git a/src/input/plugins/CurlInputPlugin.hxx b/src/input/plugins/CurlInputPlugin.hxx index d92c17409..c911bc334 100644 --- a/src/input/plugins/CurlInputPlugin.hxx +++ b/src/input/plugins/CurlInputPlugin.hxx @@ -1,13 +1,14 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Copyright The Music Player Daemon Project -#ifndef MPD_INPUT_CURL_HXX -#define MPD_INPUT_CURL_HXX +#pragma once #include "lib/curl/Headers.hxx" #include "input/Ptr.hxx" #include "thread/Mutex.hxx" +#include + extern const struct InputPlugin input_plugin_curl; /** @@ -18,7 +19,5 @@ extern const struct InputPlugin input_plugin_curl; * Throws on error. */ InputStreamPtr -OpenCurlInputStream(const char *uri, const Curl::Headers &headers, +OpenCurlInputStream(std::string_view uri, const Curl::Headers &headers, Mutex &mutex); - -#endif diff --git a/src/input/plugins/NfsInputPlugin.cxx b/src/input/plugins/NfsInputPlugin.cxx index 7002d7b6f..7ab73dfa1 100644 --- a/src/input/plugins/NfsInputPlugin.cxx +++ b/src/input/plugins/NfsInputPlugin.cxx @@ -25,7 +25,7 @@ class NfsInputStream final : NfsFileReader, public AsyncInputStream { bool reconnect_on_resume = false, reconnecting = false; public: - NfsInputStream(const char *_uri, Mutex &_mutex) + NfsInputStream(std::string_view _uri, Mutex &_mutex) noexcept :AsyncInputStream(NfsFileReader::GetEventLoop(), _uri, _mutex, NFS_MAX_BUFFERED, diff --git a/src/input/plugins/UringInputPlugin.cxx b/src/input/plugins/UringInputPlugin.cxx index 6ef9affb0..9e0ecdbad 100644 --- a/src/input/plugins/UringInputPlugin.cxx +++ b/src/input/plugins/UringInputPlugin.cxx @@ -45,7 +45,7 @@ class UringInputStream final : public AsyncInputStream, Uring::ReadHandler { public: UringInputStream(EventLoop &event_loop, Uring::Queue &_uring, - const char *path, + std::string_view path, UniqueFileDescriptor &&_fd, offset_type _size, Mutex &_mutex) :AsyncInputStream(event_loop,