]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fs_zip.cpp
some != NULL checks
[wxWidgets.git] / src / common / fs_zip.cpp
index 96985ddc656a339342c1053894855be242bae28c..438a20a2b2ba0af47be987c5c6aec738f6faacfb 100644 (file)
@@ -17,7 +17,7 @@
 #pragma hdrstop
 #endif
 
-#if wxUSE_FS_ZIP
+#if wxUSE_FILESYSTEM && wxUSE_FS_ZIP && wxUSE_ZIPSTREAM
 
 #ifndef WXPRECOMP
 #include "wx/wx.h"
@@ -61,7 +61,7 @@ wxZipFSHandler::~wxZipFSHandler()
 bool wxZipFSHandler::CanOpen(const wxString& location)
 {
     wxString p = GetProtocol(location);
-    return (p == "zip");
+    return (p == wxT("zip") );
 }
 
 
@@ -73,16 +73,17 @@ wxFSFile* wxZipFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& l
     wxString left = GetLeftLocation(location);
     wxInputStream *s;
 
-    if (GetProtocol(left) != "file") {
+    if (GetProtocol(left) != wxT("file")) {
         return NULL;
     }
 
     s = new wxZipInputStream(left, right);
     if (s && (s -> LastError() == wxStream_NOERROR)) {
         return new wxFSFile(s,
-                            left + "#zip:" + right,
+                            left + wxT("#zip:") + right,
                             GetMimeTypeFromExt(location),
-                            GetAnchor(location));
+                            GetAnchor(location),
+                            wxDateTime(wxFileModificationTime(left)));
     }
     else return NULL;
 }
@@ -101,7 +102,7 @@ wxString wxZipFSHandler::FindFirst(const wxString& spec, int flags)
         m_Archive = NULL;
     }
 
-    if (GetProtocol(left) != "file") {
+    if (GetProtocol(left) != wxT("file")) {
         return wxEmptyString;
     }
 
@@ -146,7 +147,7 @@ wxString wxZipFSHandler::DoFind()
     while (match == wxEmptyString)
     {
         unzGetCurrentFileInfo((unzFile)m_Archive, NULL, namebuf, 1024, NULL, 0, NULL, 0);
-        for (c = namebuf; *c; c++) if (*c == '\\') *c = '/';
+        for (c = namebuf; *c; c++) if (*c == wxT('\\')) *c = wxT('/');
         fn = namebuf;
         if (fn.Last() == wxT('/')) {
             fn.RemoveLast();
@@ -176,4 +177,5 @@ wxString wxZipFSHandler::DoFind()
 
 
 
-#endif // wxUSE_FS_ZIP
+#endif 
+      //wxUSE_FILESYSTEM && wxUSE_FS_ZIP && wxUSE_ZIPSTREAM