]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fstream.cpp
Removed redundant makefiles and AIAI icons. Changed dynamic sample source name from
[wxWidgets.git] / src / common / fstream.cpp
index ea50fee90a8f6f1915c4e4525c3ab8dea8f66b3f..3d0468bbb937e720db5f51e2679cb11799a2588b 100644 (file)
 #pragma hdrstop
 #endif
 
 #pragma hdrstop
 #endif
 
-
-#define BUF_TEMP_SIZE 10000
-
-#if !USE_SHARED_LIBRARY
-IMPLEMENT_CLASS(wxFileInputStream, wxInputStream)
-IMPLEMENT_CLASS(wxFileOutputStream, wxOutputStream)
-IMPLEMENT_CLASS2(wxFileStream, wxInputStream, wxOutputStream)
-#endif
-
 // ----------------------------------------------------------------------------
 // wxFileInputStream
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // wxFileInputStream
 // ----------------------------------------------------------------------------
@@ -39,25 +30,32 @@ IMPLEMENT_CLASS2(wxFileStream, wxInputStream, wxOutputStream)
 wxFileInputStream::wxFileInputStream(const wxString& fileName)
   : wxFile(fileName, read)
 {
 wxFileInputStream::wxFileInputStream(const wxString& fileName)
   : wxFile(fileName, read)
 {
-  m_lastread = 0;
+  m_i_streambuf->SetBufferIO(1024);
 }
 
 wxFileInputStream::~wxFileInputStream()
 {
 }
 
 }
 
 wxFileInputStream::~wxFileInputStream()
 {
 }
 
-wxInputStream& wxFileInputStream::Read(void *buffer, size_t size)
+char wxFileInputStream::Peek()
 {
 {
-  m_lastread = wxFile::Read(buffer, size);
-  return *this;
+  return 0;
+}
+
+size_t wxFileInputStream::DoRead(void *buffer, size_t size)
+{
+  size_t ret = wxFile::Read(buffer, size);
+  m_eof = wxFile::Eof();
+
+  return ret;
 }
 
 }
 
-off_t wxFileInputStream::SeekI(off_t pos, wxSeekMode mode)
+off_t wxFileInputStream::DoSeekInput(off_t pos, wxSeekMode mode)
 {
   return wxFile::Seek(pos, mode);
 }
 
 {
   return wxFile::Seek(pos, mode);
 }
 
-off_t wxFileInputStream::TellI() const
+off_t wxFileInputStream::DoTellInput() const
 {
   return wxFile::Tell();
 }
 {
   return wxFile::Tell();
 }
@@ -69,32 +67,34 @@ off_t wxFileInputStream::TellI() const
 wxFileOutputStream::wxFileOutputStream(const wxString& fileName)
  : wxFile(fileName, write)
 {
 wxFileOutputStream::wxFileOutputStream(const wxString& fileName)
  : wxFile(fileName, write)
 {
-  m_lastwrite = 0;
+  m_o_streambuf->SetBufferIO(1024);
 }
 
 wxFileOutputStream::~wxFileOutputStream()
 {
 }
 
 wxFileOutputStream::~wxFileOutputStream()
 {
+  Sync();
 }
 
 }
 
-wxOutputStream& wxFileOutputStream::Write(const void *buffer, size_t size)
+size_t wxFileOutputStream::DoWrite(const void *buffer, size_t size)
 {
 {
-  m_lastwrite = wxFile::Write(buffer, size);
+  size_t ret = wxFile::Write(buffer, size);
   m_bad = wxFile::Error();
   m_bad = wxFile::Error();
-  return *this;
+  return ret;
 }
 
 }
 
-off_t wxFileOutputStream::TellO() const
+off_t wxFileOutputStream::DoTellOutput() const
 {
   return wxFile::Tell();
 }
 
 {
   return wxFile::Tell();
 }
 
-off_t wxFileOutputStream::SeekO(off_t pos, wxSeekMode mode)
+off_t wxFileOutputStream::DoSeekOutput(off_t pos, wxSeekMode mode)
 {
   return wxFile::Seek(pos, mode);
 }
 
 void wxFileOutputStream::Sync()
 {
 {
   return wxFile::Seek(pos, mode);
 }
 
 void wxFileOutputStream::Sync()
 {
+  wxOutputStream::Sync();
   wxFile::Flush();
 }
 
   wxFile::Flush();
 }