X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/859906241dff9079dbfe73a39abda5c9aed2f150..ca8d899fcb677bad4ed7df5c65887b725a092482:/include/wx/wfstream.h diff --git a/include/wx/wfstream.h b/include/wx/wfstream.h index d0d50a608c..42b75669cd 100644 --- a/include/wx/wfstream.h +++ b/include/wx/wfstream.h @@ -12,10 +12,6 @@ #ifndef _WX_WXFSTREAM_H__ #define _WX_WXFSTREAM_H__ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "wfstream.h" -#endif - #include "wx/defs.h" #if wxUSE_STREAMS @@ -88,6 +84,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 {