]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wfstream.cpp
XRC for wxListbook [patch 1152306] and wxChoicebook. Regenerated makefiles.
[wxWidgets.git] / src / common / wfstream.cpp
index 688b8a4cdd52d793c056a9f1746e1d2fb5604cb7..8370eebc6faac3f3332554139f29e37bfcee0aa8 100644 (file)
   #pragma hdrstop
 #endif
 
-#if wxUSE_STREAMS && wxUSE_FILE
+#if wxUSE_STREAMS
 
 #include <stdio.h>
 #include "wx/stream.h"
 #include "wx/wfstream.h"
 
+#if wxUSE_FILE
+
 // ----------------------------------------------------------------------------
 // wxFileInputStream
 // ----------------------------------------------------------------------------
@@ -33,7 +35,7 @@
 wxFileInputStream::wxFileInputStream(const wxString& fileName)
   : wxInputStream()
 {
-    m_file = new wxFile(fileName.fn_str(), wxFile::read);
+    m_file = new wxFile(fileName, wxFile::read);
     m_file_destroy = true;
 }
 
@@ -109,7 +111,7 @@ wxFileOffset wxFileInputStream::OnSysTell() const
 
 wxFileOutputStream::wxFileOutputStream(const wxString& fileName)
 {
-    m_file = new wxFile(fileName.fn_str(), wxFile::write);
+    m_file = new wxFile(fileName, wxFile::write);
     m_file_destroy = true;
 
     if (!m_file->IsOpened())
@@ -191,22 +193,27 @@ wxFileStream::wxFileStream(const wxString& fileName)
     wxFileOutputStream::m_file = wxFileInputStream::m_file;
 }
 
+#endif //wxUSE_FILE
+
+#if wxUSE_FFILE
+
 // ----------------------------------------------------------------------------
 // wxFFileInputStream
 // ----------------------------------------------------------------------------
 
-wxFFileInputStream::wxFFileInputStream(const wxString& fileName)
-  : wxInputStream()
+wxFFileInputStream::wxFFileInputStream(const wxString& fileName,
+                                       const wxChar *mode)
+                  : wxInputStream()
 {
-    m_file = new wxFFile(fileName, _T("rb"));
+    m_file = new wxFFile(fileName, mode);
     m_file_destroy = true;
 }
 
 wxFFileInputStream::wxFFileInputStream()
-  : wxInputStream()
+                  : wxInputStream()
 {
-    m_file_destroy = false;
     m_file = NULL;
+    m_file_destroy = false;
 }
 
 wxFFileInputStream::wxFFileInputStream(wxFFile& file)
@@ -262,9 +269,10 @@ wxFileOffset wxFFileInputStream::OnSysTell() const
 // wxFFileOutputStream
 // ----------------------------------------------------------------------------
 
-wxFFileOutputStream::wxFFileOutputStream(const wxString& fileName)
+wxFFileOutputStream::wxFFileOutputStream(const wxString& fileName,
+                                         const wxChar *mode)
 {
-    m_file = new wxFFile(fileName, _T("w+b"));
+    m_file = new wxFFile(fileName, mode);
     m_file_destroy = true;
 
     if (!m_file->IsOpened())
@@ -285,10 +293,10 @@ wxFFileOutputStream::wxFFileOutputStream(wxFFile& file)
 }
 
 wxFFileOutputStream::wxFFileOutputStream()
-  : wxOutputStream()
+                   : wxOutputStream()
 {
-    m_file_destroy = false;
     m_file = NULL;
+    m_file_destroy = false;
 }
 
 wxFFileOutputStream::wxFFileOutputStream(FILE *file)
@@ -348,6 +356,7 @@ wxFFileStream::wxFFileStream(const wxString& fileName)
     wxFFileOutputStream::m_file = wxFFileInputStream::m_file;
 }
 
-#endif
-  // wxUSE_STREAMS && wxUSE_FILE
+#endif //wxUSE_FFILE
+
+#endif // wxUSE_STREAMS