pw_kvs: Return StatusWithSize from Item::Get
This change updates the item class to return a StatusWithSize when
reading a value so that the caller knows how large the value is without
requiring an additional flash read.
Change-Id: I37c8c2b5f39ecd3d2f4c37c3a7af136489ff332a
diff --git a/pw_kvs/public/pw_kvs/key_value_store.h b/pw_kvs/public/pw_kvs/key_value_store.h
index aa220be..a5aa8e5 100644
--- a/pw_kvs/public/pw_kvs/key_value_store.h
+++ b/pw_kvs/public/pw_kvs/key_value_store.h
@@ -143,8 +143,8 @@
// Guaranteed to be null-terminated
std::string_view key() const { return key_buffer_.data(); }
- Status Get(span<std::byte> value_buffer) const {
- return kvs_.Get(key(), value_buffer).status();
+ StatusWithSize Get(span<std::byte> value_buffer) const {
+ return kvs_.Get(key(), value_buffer);
}
template <typename Pointer,