]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filesys.cpp
Add wxUSE_TARSTREAM and wxUSE_FS_ARCHIVE.
[wxWidgets.git] / src / common / filesys.cpp
index 57fc6e3712e92e001da5e259d84a77f10a6eba5d..d63b432e72e736cfe073016f9a65bbb6a8cb9526 100644 (file)
@@ -27,6 +27,7 @@
 #include "wx/mimetype.h"
 #include "wx/filename.h"
 #include "wx/tokenzr.h"
+#include "wx/fileback.h"
 
 
 //--------------------------------------------------------------------------------
@@ -357,7 +358,7 @@ void wxFileSystem::ChangePathTo(const wxString& location, bool is_dir)
 
 
 
-wxFSFile* wxFileSystem::OpenFile(const wxString& location)
+wxFSFile* wxFileSystem::OpenFile(const wxString& location, int flags)
 {
     wxString loc = MakeCorrectPath(location);
     unsigned i, ln;
@@ -410,6 +411,15 @@ wxFSFile* wxFileSystem::OpenFile(const wxString& location)
             node = node->GetNext();
         }
     }
+
+    if (s && (flags & wxFS_SEEKABLE) != 0 && !s->GetStream()->IsSeekable())
+    {
+        wxBackedInputStream *stream;
+        stream = new wxBackedInputStream(s->DetachStream());
+        stream->FindLength();
+        s->SetStream(stream);
+    }
+
     return (s);
 }