]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed input stream
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 4 Apr 1999 13:02:19 +0000 (13:02 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 4 Apr 1999 13:02:19 +0000 (13:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2042 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/mstream.h
src/common/mstream.cpp

index 0f73867261eef819808b952ef1bb102833603815..3bd53e642dfa35038f3e1b5f59a384b1653d475c 100644 (file)
 #include <wx/stream.h>
 
 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();
 };
index 35e384bade7a58e8c2bd39878faf28d28469107d..560c0fd1ae305c729856ae51633d9b0e25824b69 100644 (file)
@@ -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()