From 32a4b1d57c479a1c39def13df6c269c93d2fdf1a Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 28 Jul 1998 17:11:08 +0000 Subject: [PATCH] * Added Peek() to wxMemoryInputStream. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mstream.h | 2 ++ src/common/mstream.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/include/wx/mstream.h b/include/wx/mstream.h index dc8c6688d7..8c57cb0323 100644 --- a/include/wx/mstream.h +++ b/include/wx/mstream.h @@ -32,6 +32,8 @@ class wxMemoryInputStream: virtual public wxMemoryStreamBase, public wxInputStre wxMemoryInputStream(const char *data, size_t length); virtual ~wxMemoryInputStream(); + char Peek(); + protected: size_t DoRead(void *buffer, size_t size); diff --git a/src/common/mstream.cpp b/src/common/mstream.cpp index 9e1ee174f2..7f72e82db4 100644 --- a/src/common/mstream.cpp +++ b/src/common/mstream.cpp @@ -75,6 +75,13 @@ wxMemoryInputStream::~wxMemoryInputStream() { } +char wxMemoryInputStream::Peek() +{ + // wxStreamBuffer is disabled so just peek the current character. + + return m_buffer[m_position_i]; +} + size_t wxMemoryInputStream::DoRead(void *buffer, size_t size) { if (m_iolimit == 2) { -- 2.45.2