From caac06f784c5d94c6a5f7d0b586f9ddbbe55c369 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 19 Sep 2024 07:57:45 -0400 Subject: [PATCH] streams: reorder/document functions --- src/streams.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/streams.h b/src/streams.h index 8a5af68dee8..e9f3562c6ce 100644 --- a/src/streams.h +++ b/src/streams.h @@ -430,9 +430,18 @@ public: /** Implementation detail, only used internally. */ std::size_t detail_fread(Span dst); + /** Wrapper around fseek(). Will throw if seeking is not possible. */ void seek(int64_t offset, int origin); + + /** Find position within the file. Will throw if unknown. */ int64_t tell(); + /** Wrapper around FileCommit(). */ + bool Commit(); + + /** Wrapper around TruncateFile(). */ + bool Truncate(unsigned size); + // // Stream subset // @@ -453,9 +462,6 @@ public: ::Unserialize(*this, obj); return *this; } - - bool Commit(); - bool Truncate(unsigned size); }; /** Wrapper around an AutoFile& that implements a ring buffer to