X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/859906241dff9079dbfe73a39abda5c9aed2f150..05c3f0fc73d9124061c08e3d707b4e3d6bab4ff4:/include/wx/wfstream.h?ds=sidebyside diff --git a/include/wx/wfstream.h b/include/wx/wfstream.h index d0d50a608c..79cdb866cf 100644 --- a/include/wx/wfstream.h +++ b/include/wx/wfstream.h @@ -88,6 +88,31 @@ protected: DECLARE_NO_COPY_CLASS(wxFileOutputStream) }; +class WXDLLIMPEXP_BASE wxTempFileOutputStream : public wxOutputStream +{ +public: + wxTempFileOutputStream(const wxString& fileName); + virtual ~wxTempFileOutputStream(); + + bool Close() { return Commit(); } + virtual bool Commit() { return m_file->Commit(); } + virtual void Discard() { m_file->Discard(); } + + wxFileOffset GetLength() const { return m_file->Length(); } + bool IsSeekable() const { return true; } + +protected: + size_t OnSysWrite(const void *buffer, size_t size); + wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) + { return m_file->Seek(pos, mode); } + wxFileOffset OnSysTell() const { return m_file->Tell(); } + +private: + wxTempFile *m_file; + + DECLARE_NO_COPY_CLASS(wxTempFileOutputStream) +}; + class WXDLLIMPEXP_BASE wxFileStream : public wxFileInputStream, public wxFileOutputStream {