From 18c07b73c6fa48c7c7b4a2867bcee4c81aa82c20 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 4 Apr 1999 13:02:19 +0000 Subject: [PATCH] fixed input stream git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2042 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mstream.h | 4 ++++ src/common/mstream.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/include/wx/mstream.h b/include/wx/mstream.h index 0f73867261..3bd53e642d 100644 --- a/include/wx/mstream.h +++ b/include/wx/mstream.h @@ -14,9 +14,13 @@ #include class wxMemoryInputStream: public wxInputStream { + private: + size_t m_length; + public: wxMemoryInputStream(const char *data, size_t length); virtual ~wxMemoryInputStream(); + virtual size_t StreamSize() const { return m_length; } char Peek(); }; diff --git a/src/common/mstream.cpp b/src/common/mstream.cpp index 35e384bade..560c0fd1ae 100644 --- a/src/common/mstream.cpp +++ b/src/common/mstream.cpp @@ -31,7 +31,9 @@ wxMemoryInputStream::wxMemoryInputStream(const char *data, size_t len) : wxInputStream() { m_i_streambuf->SetBufferIO((char*) data, (char*) (data+len)); + m_i_streambuf->SetIntPosition(0); // seek to start pos m_i_streambuf->Fixed(TRUE); + m_length = len; } wxMemoryInputStream::~wxMemoryInputStream() -- 2.45.2