#pragma hdrstop
#endif
-#ifndef WX_PRECOMP
- #include "wx/defs.h"
-#endif
-
#if wxUSE_STREAMS && wxUSE_FILE
#include <stdio.h>
-#include <wx/stream.h>
-#include <wx/wfstream.h>
+#include "wx/stream.h"
+#include "wx/wfstream.h"
// ----------------------------------------------------------------------------
// wxFileInputStream
{
m_file = new wxFile(fileName, wxFile::read);
m_file_destroy = TRUE;
- m_i_streambuf->SetBufferIO(1024);
}
wxFileInputStream::wxFileInputStream()
{
m_file = &file;
m_file_destroy = FALSE;
- m_i_streambuf->SetBufferIO(1024);
}
wxFileInputStream::wxFileInputStream(int fd)
{
m_file = new wxFile(fd);
m_file_destroy = TRUE;
- m_i_streambuf->SetBufferIO(1024);
}
wxFileInputStream::~wxFileInputStream()
size_t wxFileInputStream::OnSysRead(void *buffer, size_t size)
{
- return m_file->Read(buffer, size);
+ off_t ret;
+
+ ret = m_file->Read(buffer, size);
+
+ if (m_file->Eof())
+ m_lasterror = wxStream_EOF;
+ if (ret == wxInvalidOffset) {
+ m_lasterror = wxStream_READ_ERR;
+ ret = 0;
+ }
+
+ return ret;
}
off_t wxFileInputStream::OnSysSeek(off_t pos, wxSeekMode mode)
{
m_file = new wxFile(fileName, wxFile::write);
m_file_destroy = TRUE;
- m_o_streambuf->SetBufferIO(1024);
}
wxFileOutputStream::wxFileOutputStream(wxFile& file)
{
m_file = &file;
m_file_destroy = FALSE;
- m_o_streambuf->SetBufferIO(1024);
}
wxFileOutputStream::wxFileOutputStream()
: wxOutputStream()
{
- m_o_streambuf->SetBufferIO(1024);
m_file_destroy = FALSE;
m_file = NULL;
}
{
m_file = new wxFile(fd);
m_file_destroy = TRUE;
- m_o_streambuf->SetBufferIO(1024);
}
wxFileOutputStream::~wxFileOutputStream()
#endif
// wxUSE_STREAMS && wxUSE_FILE
+