From 7758388e9a8f9ef80d5e91d8d58a2714e2350fec Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 26 Aug 2023 01:51:57 +0200 Subject: [PATCH] Document that wxStream::Peek() affects LastRead() as expected This is the case for all streams now after the changes of the previous commit. --- interface/wx/stream.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/interface/wx/stream.h b/interface/wx/stream.h index 0923a688db..40efdfa649 100644 --- a/interface/wx/stream.h +++ b/interface/wx/stream.h @@ -610,12 +610,18 @@ public: int GetC(); /** - Returns the last number of bytes read. + Returns the last number of bytes read by the last input operation. + + Such operations include Read(), GetC() and Peek(). */ virtual size_t LastRead() const; /** Returns the first character in the input queue without removing it. + + If Peek() failed, e.g. because there is nothing more to read in the + stream, LastRead() will return 0 after calling it, otherwise it will + return 1. */ virtual char Peek();