diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2024-08-31 22:17:16 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-11-16 10:12:49 +0100 |
commit | b3cd90262f521d9c207b395f175cd3b26d2f4363 (patch) | |
tree | 8755bb1e2f9e4e2654542f30bf2b6fede9b44dca /src/storage.cpp | |
parent | a689af61eb91dcbc135890276a3c6281166d30f9 (diff) |
Network streams, accept for data response
Changelog: Implemented streams in network protocol
Diffstat (limited to 'src/storage.cpp')
-rw-r--r-- | src/storage.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/storage.cpp b/src/storage.cpp index 19f35a9..fd985c7 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -1579,6 +1579,21 @@ optional<ObjectT<S>> ObjectT<S>::decode(const S & st, return nullopt; } +template< class S > +vector< ObjectT< S >> ObjectT< S >::decodeMany( const S & st, + const std::vector< uint8_t > & data) +{ + vector< ObjectT< S >> objects; + auto cur = data.begin(); + + while( auto pair = decodePrefix( st, cur, data.end() )) { + auto [ obj, next ] = *pair; + objects.push_back( move( obj )); + cur = next; + } + return objects; +} + template<class S> vector<uint8_t> ObjectT<S>::encode() const { |