X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fc7a2a602b4bd9308be21bc07e40a680f483438e..c01920998145b5248372a124fdcd53f0ba1582d5:/include/wx/wfstream.h diff --git a/include/wx/wfstream.h b/include/wx/wfstream.h index 9778a6cda9..b26ec29f5b 100644 --- a/include/wx/wfstream.h +++ b/include/wx/wfstream.h @@ -12,7 +12,7 @@ #ifndef _WX_WXFSTREAM_H__ #define _WX_WXFSTREAM_H__ -#if defined(__GNUG__) && !defined(__APPLE__) +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "wfstream.h" #endif @@ -37,7 +37,7 @@ class WXDLLIMPEXP_BASE wxFileInputStream: public wxInputStream { wxFileInputStream(int fd); ~wxFileInputStream(); - size_t GetSize() const; + wxFileOffset GetLength() const; bool Ok() const { return m_file->IsOpened(); } @@ -45,8 +45,8 @@ class WXDLLIMPEXP_BASE wxFileInputStream: public wxInputStream { wxFileInputStream(); size_t OnSysRead(void *buffer, size_t size); - off_t OnSysSeek(off_t pos, wxSeekMode mode); - off_t OnSysTell() const; + wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode); + wxFileOffset OnSysTell() const; protected: wxFile *m_file; @@ -67,7 +67,8 @@ class WXDLLIMPEXP_BASE wxFileOutputStream: public wxOutputStream { // { return wxOutputStream::Write(buffer, size); } void Sync(); - size_t GetSize() const; + bool Close() { return m_file_destroy ? m_file->Close() : true; } + wxFileOffset GetLength() const; bool Ok() const { return m_file->IsOpened(); } @@ -75,8 +76,8 @@ class WXDLLIMPEXP_BASE wxFileOutputStream: public wxOutputStream { wxFileOutputStream(); size_t OnSysWrite(const void *buffer, size_t size); - off_t OnSysSeek(off_t pos, wxSeekMode mode); - off_t OnSysTell() const; + wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode); + wxFileOffset OnSysTell() const; protected: wxFile *m_file; @@ -106,7 +107,7 @@ class WXDLLIMPEXP_BASE wxFFileInputStream: public wxInputStream { wxFFileInputStream(FILE *file); ~wxFFileInputStream(); - size_t GetSize() const; + wxFileOffset GetLength() const; bool Ok() const { return m_file->IsOpened(); } @@ -114,8 +115,8 @@ class WXDLLIMPEXP_BASE wxFFileInputStream: public wxInputStream { wxFFileInputStream(); size_t OnSysRead(void *buffer, size_t size); - off_t OnSysSeek(off_t pos, wxSeekMode mode); - off_t OnSysTell() const; + wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode); + wxFileOffset OnSysTell() const; protected: wxFFile *m_file; @@ -136,7 +137,8 @@ class WXDLLIMPEXP_BASE wxFFileOutputStream: public wxOutputStream { // { return wxOutputStream::Write(buffer, size); } void Sync(); - size_t GetSize() const; + bool Close() { return m_file_destroy ? m_file->Close() : true; } + wxFileOffset GetLength() const; bool Ok() const { return m_file->IsOpened(); } @@ -144,8 +146,8 @@ class WXDLLIMPEXP_BASE wxFFileOutputStream: public wxOutputStream { wxFFileOutputStream(); size_t OnSysWrite(const void *buffer, size_t size); - off_t OnSysSeek(off_t pos, wxSeekMode mode); - off_t OnSysTell() const; + wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode); + wxFileOffset OnSysTell() const; protected: wxFFile *m_file;