diff options
Diffstat (limited to 'src/stream.h')
-rw-r--r-- | src/stream.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/stream.h b/src/stream.h index 75a082ea..8a0f1c80 100644 --- a/src/stream.h +++ b/src/stream.h @@ -52,6 +52,7 @@ class Stream { bool has_log_stream() const { return log_stream_ != nullptr; } + void ClearOffset() { offset_ = 0; } void AddOffset(ssize_t delta); void WriteData(const void* src, @@ -147,6 +148,7 @@ class Stream { struct OutputBuffer { Result WriteToFile(string_view filename) const; + void clear() { data.clear(); } size_t size() const { return data.size(); } std::vector<uint8_t> data; @@ -162,6 +164,8 @@ class MemoryStream : public Stream { OutputBuffer& output_buffer() { return *buf_; } std::unique_ptr<OutputBuffer> ReleaseOutputBuffer(); + void Clear(); + Result WriteToFile(string_view filename) { return buf_->WriteToFile(filename); } |