#pragma hdrstop
#endif
-#if wxUSE_STREAMS && wxUSE_FILE
+#if wxUSE_STREAMS
#include <stdio.h>
#include "wx/stream.h"
#include "wx/wfstream.h"
+#if wxUSE_FILE
+
// ----------------------------------------------------------------------------
// wxFileInputStream
// ----------------------------------------------------------------------------
return m_file->Length();
}
+// ----------------------------------------------------------------------------
+// wxTempFileOutputStream
+// ----------------------------------------------------------------------------
+
+wxTempFileOutputStream::wxTempFileOutputStream(const wxString& fileName)
+{
+ m_file = new wxTempFile(fileName);
+
+ if (!m_file->IsOpened())
+ m_lasterror = wxSTREAM_WRITE_ERROR;
+}
+
+wxTempFileOutputStream::~wxTempFileOutputStream()
+{
+ if (m_file->IsOpened())
+ Discard();
+ delete m_file;
+}
+
+size_t wxTempFileOutputStream::OnSysWrite(const void *buffer, size_t size)
+{
+ if (IsOk() && m_file->Write(buffer, size))
+ return size;
+ m_lasterror = wxSTREAM_WRITE_ERROR;
+ return 0;
+}
+
// ----------------------------------------------------------------------------
// wxFileStream
// ----------------------------------------------------------------------------
wxFileOutputStream::m_file = wxFileInputStream::m_file;
}
+#endif //wxUSE_FILE
+
+#if wxUSE_FFILE
+
// ----------------------------------------------------------------------------
// wxFFileInputStream
// ----------------------------------------------------------------------------
wxFFileOutputStream::m_file = wxFFileInputStream::m_file;
}
-#endif // wxUSE_STREAMS && wxUSE_FILE
+#endif //wxUSE_FFILE
+
+#endif // wxUSE_STREAMS