From 94e476e947cf4cb0734fbd0563286e8443c75b96 Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Thu, 29 Jun 2023 19:08:01 -0400 Subject: Pass KeyValueStore ValueHash through the API --- database.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'database.cpp') diff --git a/database.cpp b/database.cpp index dd258967..33f22714 100644 --- a/database.cpp +++ b/database.cpp @@ -86,6 +86,17 @@ Json::Value KeyValueStore::GetValue(const std::string& name) const } +DataBuffer KeyValueStore::GetValueHash(const std::string& name) const +{ + BNDataBuffer* buffer = BNGetKeyValueStoreValueHash(m_object, name.c_str()); + if (buffer == nullptr) + { + throw DatabaseException("Unknown key"); + } + return DataBuffer(buffer); +} + + DataBuffer KeyValueStore::GetBuffer(const std::string& name) const { BNDataBuffer* buffer = BNGetKeyValueStoreBuffer(m_object, name.c_str()); -- cgit v1.3.1