X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/34138703c3997ce676a1e713d9ff9eb020640da7..1b826605f5ab0bb680925f5e24a57b068ce2bdc5:/include/wx/fstream.h diff --git a/include/wx/fstream.h b/include/wx/fstream.h index eab87dab21..2c1f320f85 100644 --- a/include/wx/fstream.h +++ b/include/wx/fstream.h @@ -8,34 +8,52 @@ // Copyright: (c) Guilhem Lavaux // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// + #ifndef _WX_WXFSTREAM_H__ #define _WX_WXFSTREAM_H__ +#ifdef __GNUG__ +#pragma interface "fstream.h" +#endif + #include #include #include #include -class wxFileInputStream: public wxInputStream, virtual public wxFile { +// Disable warnings such as +// 'wxFileStream' : inherits 'wxFileInputStream::Peek' via dominance + +#ifdef _MSC_VER +#pragma warning(disable:4250) +#endif + +class wxFileStreamBase { +protected: + wxFile *m_file; + bool m_file_destroy; +}; + +class wxFileInputStream: public virtual wxInputStream, + public virtual wxFileStreamBase { public: wxFileInputStream(const wxString& fileName); virtual ~wxFileInputStream(); virtual char Peek(); - virtual bool Eof() const { return wxFile::Eof(); } - - bool Ok() const { return wxFile::IsOpened(); } + bool Ok() const { return m_file->IsOpened(); } protected: - wxFileInputStream() {} + wxFileInputStream(); size_t DoRead(void *buffer, size_t size); off_t DoSeekInput(off_t pos, wxSeekMode mode); off_t DoTellInput() const; }; -class wxFileOutputStream: public wxOutputStream, virtual public wxFile { +class wxFileOutputStream: public virtual wxOutputStream, + public virtual wxFileStreamBase { public: wxFileOutputStream(const wxString& fileName); virtual ~wxFileOutputStream(); @@ -46,20 +64,25 @@ class wxFileOutputStream: public wxOutputStream, virtual public wxFile { void Sync(); - bool Ok() const { return wxFile::IsOpened(); } + bool Ok() const { return m_file->IsOpened(); } protected: - wxFileOutputStream() {} + wxFileOutputStream(); size_t DoWrite(const void *buffer, size_t size); off_t DoSeekOutput(off_t pos, wxSeekMode mode); off_t DoTellOutput() const; }; -class wxFileStream: public wxFileInputStream, public wxFileOutputStream { +class wxFileStream: public wxStream, + public wxFileInputStream, public wxFileOutputStream { public: wxFileStream(const wxString& fileName); virtual ~wxFileStream(); }; +#ifdef _MSC_VER +#pragma warning(default:4250) +#endif + #endif