X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fae05df5a988883e9c6683ccded766dfb7b84b1b..a58d5df4ef7fbbbb1c385ac63038608d49f8dfa5:/src/common/wfstream.cpp?ds=sidebyside diff --git a/src/common/wfstream.cpp b/src/common/wfstream.cpp index 5191307d4a..3bf2a080ba 100644 --- a/src/common/wfstream.cpp +++ b/src/common/wfstream.cpp @@ -20,15 +20,11 @@ #pragma hdrstop #endif -#ifndef WX_PRECOMP - #include "wx/defs.h" -#endif - #if wxUSE_STREAMS && wxUSE_FILE #include -#include -#include +#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 +