]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wfstream.cpp
Added GSocket_Init and GSocket_Cleanup
[wxWidgets.git] / src / common / wfstream.cpp
index 5191307d4a22d9fa10e8c509348d8ded07d2a7ff..3bf2a080ba94475c276ecf48a4cc75f26b218427 100644 (file)
   #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
@@ -71,7 +67,7 @@ char wxFileInputStream::Peek()
   return 0;
 }
 
-size_t wxFileInputStream::StreamSize() const
+size_t wxFileInputStream::GetSize() const
 {
   return m_file->Length();
 }
@@ -142,7 +138,10 @@ wxFileOutputStream::~wxFileOutputStream()
 size_t wxFileOutputStream::OnSysWrite(const void *buffer, size_t size)
 {
   size_t ret = m_file->Write(buffer, size);
-  m_lasterror = wxStream_EOF; // TODO
+  if (m_file->Error())
+    m_lasterror = wxStream_WRITE_ERR;
+  else
+    m_lasterror = wxStream_NOERROR;
   return ret;
 }
 
@@ -162,7 +161,7 @@ void wxFileOutputStream::Sync()
   m_file->Flush();
 }
 
-size_t wxFileOutputStream::StreamSize() const
+size_t wxFileOutputStream::GetSize() const
 {
   return m_file->Length();
 }
@@ -177,3 +176,4 @@ wxFileStream::wxFileStream(const wxString& fileName)
 
 #endif
   // wxUSE_STREAMS && wxUSE_FILE
+