]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/mstream.cpp
Now uses proper wxUSE_xxx flags
[wxWidgets.git] / src / common / mstream.cpp
index 35e384bade7a58e8c2bd39878faf28d28469107d..c6a58a04a19263c3ef1c6b2e6e54d67c5d71a3aa 100644 (file)
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
-#include <stdlib.h>
-#include <wx/stream.h>
-#include <wx/mstream.h>
 
 #ifdef __BORLANDC__
-#pragma hdrstop
+  #pragma hdrstop
 #endif
 
+#if wxUSE_STREAMS
+
+#include <stdlib.h>
+#include <wx/stream.h>
+#include <wx/mstream.h>
+
 // ----------------------------------------------------------------------------
 // wxMemoryInputStream
 // ----------------------------------------------------------------------------
@@ -31,7 +34,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()
@@ -58,3 +63,5 @@ wxMemoryOutputStream::wxMemoryOutputStream(char *data, size_t len)
 wxMemoryOutputStream::~wxMemoryOutputStream()
 {
 }
+
+#endif