Skip to content

Commit

Permalink
Remove asBytes
Browse files Browse the repository at this point in the history
  • Loading branch information
syyyr committed Dec 7, 2024
1 parent 67fc286 commit aed62c7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
2 changes: 0 additions & 2 deletions libshvchainpack/include/shv/chainpack/rpcvalue.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,6 @@ class SHVCHAINPACK_DECL_EXPORT RpcValue
const RpcValue::String &asString() const;
const RpcValue::Blob &asBlob() const;

std::pair<const uint8_t*, size_t> asBytes() const&;

const RpcList &asList() const;
const Map &asMap() const;
const IMap &asIMap() const;
Expand Down
11 changes: 0 additions & 11 deletions libshvchainpack/src/rpcvalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,17 +489,6 @@ const RpcIMap& RpcValue::asIMap() const
return *try_convert_or_default(m_value, static_empty_imap());
}

std::pair<const uint8_t *, size_t> RpcValue::asBytes() const&
{
using Ret = std::pair<const uint8_t *, size_t>;
if(type() == Type::Blob) {
const Blob &blob = asBlob();
return Ret(blob.data(), blob.size());
}
const String &s = asString();
return Ret(reinterpret_cast<const uint8_t*>(s.data()), s.size());
}

size_t RpcValue::count() const
{
return std::visit([] (const auto& x) {
Expand Down

0 comments on commit aed62c7

Please sign in to comment.