From d15f64ae5d02d3109a0a2b239bb3ed4cb72eb979 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 27 Aug 2016 12:09:57 +0200 Subject: [PATCH] fs/io/BufferedReader: add method Reset() --- src/fs/io/BufferedReader.hxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/fs/io/BufferedReader.hxx b/src/fs/io/BufferedReader.hxx index fcbef0f11..c33995a76 100644 --- a/src/fs/io/BufferedReader.hxx +++ b/src/fs/io/BufferedReader.hxx @@ -44,6 +44,16 @@ public: :reader(_reader), buffer(4096), eof(false), line_number(0) {} + /** + * Reset the internal state. Should be called after rewinding + * the underlying #Reader. + */ + void Reset() { + buffer.Clear(); + eof = false; + line_number = 0; + } + bool Fill(bool need_more); gcc_pure