]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/mstream.cpp
Replaced ostream with FILE* in wxExpr.
[wxWidgets.git] / src / common / mstream.cpp
index ceec4b05bc3074705aa8249f5d47c449bab0404d..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
 // ----------------------------------------------------------------------------
 wxMemoryInputStream::wxMemoryInputStream(const char *data, size_t len)
   : wxInputStream()
 {
-  m_i_streambuf->SetBufferIO((char *)data, data+len);
+  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