From a9928c946f475be1c26bbc174a6bd57c0e284562 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 14 Apr 2026 10:47:44 +0200 Subject: Adding flat_{data,size} functions, preparing to make internal_{data,size} deprecated --- modules/codec/c++/data.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'modules/codec') diff --git a/modules/codec/c++/data.hpp b/modules/codec/c++/data.hpp index 3aab554..a86598a 100644 --- a/modules/codec/c++/data.hpp +++ b/modules/codec/c++/data.hpp @@ -789,6 +789,24 @@ class data, encode::Native> { return &value_[0u]; } + /** + * + */ + data flat_size() const { + return {value_.size()}; + } + + /** + * Available for contiguous encodings + */ + data* flat_data() { + if(value_.size() == 0u){ + return nullptr; + } + return &value_[0u]; + } + + private: template uint64_t get_flat_index(const U& i) const { -- cgit v1.2.3