From 4cc7a50e99546fa568decc766a59f19e3fbaf192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Kubern=C3=A1t?= Date: Mon, 2 Dec 2024 12:46:24 +0100 Subject: [PATCH] Remove asBytes --- libshvchainpack/include/shv/chainpack/rpcvalue.h | 2 -- libshvchainpack/src/rpcvalue.cpp | 11 ----------- 2 files changed, 13 deletions(-) diff --git a/libshvchainpack/include/shv/chainpack/rpcvalue.h b/libshvchainpack/include/shv/chainpack/rpcvalue.h index 5b5dc1d1..822ddc41 100644 --- a/libshvchainpack/include/shv/chainpack/rpcvalue.h +++ b/libshvchainpack/include/shv/chainpack/rpcvalue.h @@ -308,8 +308,6 @@ class SHVCHAINPACK_DECL_EXPORT RpcValue const RpcValue::String &asString() const; const RpcValue::Blob &asBlob() const; - std::pair asBytes() const&; - const RpcList &asList() const; const Map &asMap() const; const IMap &asIMap() const; diff --git a/libshvchainpack/src/rpcvalue.cpp b/libshvchainpack/src/rpcvalue.cpp index d74318d7..6be0a4e4 100644 --- a/libshvchainpack/src/rpcvalue.cpp +++ b/libshvchainpack/src/rpcvalue.cpp @@ -489,17 +489,6 @@ const RpcIMap& RpcValue::asIMap() const return *try_convert_or_default(m_value, static_empty_imap()); } -std::pair RpcValue::asBytes() const& -{ - using Ret = std::pair; - if(type() == Type::Blob) { - const Blob &blob = asBlob(); - return Ret(blob.data(), blob.size()); - } - const String &s = asString(); - return Ret(reinterpret_cast(s.data()), s.size()); -} - size_t RpcValue::count() const { return std::visit([] (const auto& x) {