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) {