]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wfstream.cpp
update from Martin Srebotnjak
[wxWidgets.git] / src / common / wfstream.cpp
index 688b8a4cdd52d793c056a9f1746e1d2fb5604cb7..f0b0178083e54f7f68967fe2287558a1333e956b 100644 (file)
@@ -33,7 +33,7 @@
 wxFileInputStream::wxFileInputStream(const wxString& fileName)
   : wxInputStream()
 {
 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;
 }
 
     m_file_destroy = true;
 }
 
@@ -109,7 +109,7 @@ wxFileOffset wxFileInputStream::OnSysTell() const
 
 wxFileOutputStream::wxFileOutputStream(const wxString& fileName)
 {
 
 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())
     m_file_destroy = true;
 
     if (!m_file->IsOpened())
@@ -195,18 +195,19 @@ wxFileStream::wxFileStream(const wxString& fileName)
 // wxFFileInputStream
 // ----------------------------------------------------------------------------
 
 // 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()
     m_file_destroy = true;
 }
 
 wxFFileInputStream::wxFFileInputStream()
-  : wxInputStream()
+                  : wxInputStream()
 {
 {
-    m_file_destroy = false;
     m_file = NULL;
     m_file = NULL;
+    m_file_destroy = false;
 }
 
 wxFFileInputStream::wxFFileInputStream(wxFFile& file)
 }
 
 wxFFileInputStream::wxFFileInputStream(wxFFile& file)
@@ -262,9 +263,10 @@ wxFileOffset wxFFileInputStream::OnSysTell() const
 // wxFFileOutputStream
 // ----------------------------------------------------------------------------
 
 // 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())
     m_file_destroy = true;
 
     if (!m_file->IsOpened())
@@ -285,10 +287,10 @@ wxFFileOutputStream::wxFFileOutputStream(wxFFile& file)
 }
 
 wxFFileOutputStream::wxFFileOutputStream()
 }
 
 wxFFileOutputStream::wxFFileOutputStream()
-  : wxOutputStream()
+                   : wxOutputStream()
 {
 {
-    m_file_destroy = false;
     m_file = NULL;
     m_file = NULL;
+    m_file_destroy = false;
 }
 
 wxFFileOutputStream::wxFFileOutputStream(FILE *file)
 }
 
 wxFFileOutputStream::wxFFileOutputStream(FILE *file)
@@ -348,6 +350,5 @@ wxFFileStream::wxFFileStream(const wxString& fileName)
     wxFFileOutputStream::m_file = wxFFileInputStream::m_file;
 }
 
     wxFFileOutputStream::m_file = wxFFileInputStream::m_file;
 }
 
-#endif
-  // wxUSE_STREAMS && wxUSE_FILE
+#endif // wxUSE_STREAMS && wxUSE_FILE