From 843dad19e92f1d2cb19ad20290fcb972d0e2c971 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 24 May 2022 13:32:26 +0200 Subject: [PATCH] output/snapcast/Client: use std::string_view instead of StringView --- src/output/plugins/snapcast/Client.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/output/plugins/snapcast/Client.cxx b/src/output/plugins/snapcast/Client.cxx index 0f7e29c1c..882baa571 100644 --- a/src/output/plugins/snapcast/Client.cxx +++ b/src/output/plugins/snapcast/Client.cxx @@ -25,11 +25,11 @@ #include "event/Loop.hxx" #include "net/SocketError.hxx" #include "net/UniqueSocketDescriptor.hxx" -#include "util/StringView.hxx" #include "Log.hxx" #include #include +#include SnapcastClient::SnapcastClient(SnapcastOutput &_output, UniqueSocketDescriptor _fd) noexcept @@ -132,16 +132,16 @@ Send(SocketDescriptor s, std::string_view buffer) noexcept static bool SendServerSettings(SocketDescriptor s, const PackedBE16 id, const SnapcastBase &request, - const StringView payload) noexcept + const std::string_view payload) noexcept { - const PackedLE32 payload_size = payload.size; + const PackedLE32 payload_size = payload.size(); SnapcastBase base{}; base.type = uint16_t(SnapcastMessageType::SERVER_SETTINGS); base.id = id; base.refers_to = request.id; base.sent = ToSnapcastTimestamp(std::chrono::steady_clock::now()); - base.size = sizeof(payload_size) + payload.size; + base.size = sizeof(payload_size) + payload.size(); return SendT(s, base) && SendT(s, payload_size) && Send(s, payload); } @@ -157,10 +157,10 @@ SnapcastClient::SendServerSettings(const SnapcastBase &request) noexcept static bool SendCodecHeader(SocketDescriptor s, const PackedBE16 id, const SnapcastBase &request, - const StringView codec, + const std::string_view codec, const std::span payload) noexcept { - const PackedLE32 codec_size = codec.size; + const PackedLE32 codec_size = codec.size(); const PackedLE32 payload_size = payload.size(); SnapcastBase base{}; @@ -168,7 +168,7 @@ SendCodecHeader(SocketDescriptor s, const PackedBE16 id, base.id = id; base.refers_to = request.id; base.sent = ToSnapcastTimestamp(std::chrono::steady_clock::now()); - base.size = sizeof(codec_size) + codec.size + + base.size = sizeof(codec_size) + codec.size() + sizeof(payload_size) + payload.size(); return SendT(s, base) &&