aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-03-04 10:22:53 +0100
committerGitHub Enterprise <[email protected]>2025-03-04 10:22:53 +0100
commit7cb1de5a966aa23e0c098d2bbf9009d0f82a6477 (patch)
tree5c340a3947e27b2710968442cee7f009bc6ab439 /src/zencore/include
parentlimit and validate responses before logging the text (#292) (diff)
downloadzen-7cb1de5a966aa23e0c098d2bbf9009d0f82a6477.tar.xz
zen-7cb1de5a966aa23e0c098d2bbf9009d0f82a6477.zip
stream decompress (#293)
* clean up latency parameters and slow down rate updates * add DecompressToStream
Diffstat (limited to 'src/zencore/include')
-rw-r--r--src/zencore/include/zencore/compress.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/zencore/include/zencore/compress.h b/src/zencore/include/zencore/compress.h
index 5e761ceef..c056d7561 100644
--- a/src/zencore/include/zencore/compress.h
+++ b/src/zencore/include/zencore/compress.h
@@ -196,6 +196,16 @@ public:
*/
[[nodiscard]] ZENCORE_API CompositeBuffer DecompressToComposite() const;
+ /**
+ * Decompress into and call callback for ranges of decompressed data.
+ * The buffer in the callback will be overwritten when the callback returns.
+ *
+ * @return True if the buffer is valid and can be decompressed.
+ */
+ [[nodiscard]] ZENCORE_API bool DecompressToStream(uint64_t RawOffset,
+ uint64_t RawSize,
+ std::function<void(uint64_t Offset, const CompositeBuffer& Range)>&& Callback) const;
+
/** A null compressed buffer. */
static const CompressedBuffer Null;