]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filesys.cpp
rename old wxAppConsole to wxAppConsoleBase and wxAppConsoleUnix to wxAppConsole...
[wxWidgets.git] / src / common / filesys.cpp
index 43c1ff93ae78526230ef567d0c9be30057dc1038..94a229f49c5d280494719a6459c3b710e94d5534 100644 (file)
@@ -27,7 +27,7 @@
 #include "wx/mimetype.h"
 #include "wx/filename.h"
 #include "wx/tokenzr.h"
-#include "wx/fileback.h"
+#include "wx/private/fileback.h"
 
 
 //--------------------------------------------------------------------------------
@@ -69,27 +69,27 @@ wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location)
                            wxEmptyString,
                            wxEmptyString,
                            _T("JPEG image (from fallback)"),
-                           _T("jpg"), _T("jpeg"), _T("JPG"), _T("JPEG"), NULL),
+                           _T("jpg"), _T("jpeg"), _T("JPG"), _T("JPEG"), 0),
             wxFileTypeInfo(_T("image/gif"),
                            wxEmptyString,
                            wxEmptyString,
                            _T("GIF image (from fallback)"),
-                           _T("gif"), _T("GIF"), NULL),
+                           _T("gif"), _T("GIF"), 0),
             wxFileTypeInfo(_T("image/png"),
                            wxEmptyString,
                            wxEmptyString,
                            _T("PNG image (from fallback)"),
-                           _T("png"), _T("PNG"), NULL),
+                           _T("png"), _T("PNG"), 0),
             wxFileTypeInfo(_T("image/bmp"),
                            wxEmptyString,
                            wxEmptyString,
                            _T("windows bitmap image (from fallback)"),
-                           _T("bmp"), _T("BMP"), NULL),
+                           _T("bmp"), _T("BMP"), 0),
             wxFileTypeInfo(_T("text/html"),
                            wxEmptyString,
                            wxEmptyString,
                            _T("HTML document (from fallback)"),
-                           _T("htm"), _T("html"), _T("HTM"), _T("HTML"), NULL),
+                           _T("htm"), _T("html"), _T("HTM"), _T("HTML"), 0),
             // must terminate the table with this!
             wxFileTypeInfo()
         };
@@ -385,6 +385,9 @@ wxFileSystemHandler *wxFileSystem::MakeLocal(wxFileSystemHandler *h)
 
 wxFSFile* wxFileSystem::OpenFile(const wxString& location, int flags)
 {
+    if ((flags & wxFS_READ) == 0)
+        return NULL;
+
     wxString loc = MakeCorrectPath(location);
     unsigned i, ln;
     wxChar meta;
@@ -395,7 +398,7 @@ wxFSFile* wxFileSystem::OpenFile(const wxString& location, int flags)
     meta = 0;
     for (i = 0; i < ln; i++)
     {
-        switch (loc[i])
+        switch ( loc[i].GetValue() )
         {
             case wxT('/') : case wxT(':') : case wxT('#') :
                 meta = loc[i];