]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wfstream.cpp
added wxConvFileName which is a variable, not define as wxConvFile; added comments...
[wxWidgets.git] / src / common / wfstream.cpp
index 8370eebc6faac3f3332554139f29e37bfcee0aa8..9d15b4f9b65d501e7dd71a5bce998b04666b42fa 100644 (file)
@@ -183,6 +183,33 @@ wxFileOffset wxFileOutputStream::GetLength() const
     return m_file->Length();
 }
 
+// ----------------------------------------------------------------------------
+// wxTempFileOutputStream
+// ----------------------------------------------------------------------------
+
+wxTempFileOutputStream::wxTempFileOutputStream(const wxString& fileName)
+{
+    m_file = new wxTempFile(fileName);
+
+    if (!m_file->IsOpened())
+        m_lasterror = wxSTREAM_WRITE_ERROR;
+}
+
+wxTempFileOutputStream::~wxTempFileOutputStream()
+{
+    if (m_file->IsOpened())
+        Discard();
+    delete m_file;
+}
+
+size_t wxTempFileOutputStream::OnSysWrite(const void *buffer, size_t size)
+{
+    if (IsOk() && m_file->Write(buffer, size))
+        return size;
+    m_lasterror = wxSTREAM_WRITE_ERROR;
+    return 0;
+}
+
 // ----------------------------------------------------------------------------
 // wxFileStream
 // ----------------------------------------------------------------------------