X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9d1f22e7c2002395cc609c1b51fe8351cfef2186..d2ebf0b7303be387d2d5a55ea0cd672fdf0c4f25:/src/common/fs_zip.cpp diff --git a/src/common/fs_zip.cpp b/src/common/fs_zip.cpp index d322d77547..65fbf89cc2 100644 --- a/src/common/fs_zip.cpp +++ b/src/common/fs_zip.cpp @@ -4,7 +4,7 @@ // Author: Vaclav Slavik // Copyright: (c) 1999 Vaclav Slavik // CVS-ID: $Id$ -// Licence: wxWindows Licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -26,7 +26,6 @@ #include "wx/log.h" #endif -#include "wx/hashmap.h" #include "wx/filesys.h" #include "wx/zipstrm.h" #include "wx/fs_zip.h" @@ -38,9 +37,6 @@ #include "unzip.h" #endif -WX_DECLARE_HASH_MAP_WITH_DECL( long, long, wxIntegerHash, wxIntegerEqual, - wxLongToLongHashMap, class WXDLLIMPEXP_BASE ); - //---------------------------------------------------------------------------- // wxZipFSHandler //---------------------------------------------------------------------------- @@ -51,7 +47,7 @@ wxZipFSHandler::wxZipFSHandler() : wxFileSystemHandler() { m_Archive = NULL; m_ZipFile = m_Pattern = m_BaseDir = wxEmptyString; - m_AllowDirs = m_AllowFiles = TRUE; + m_AllowDirs = m_AllowFiles = true; m_DirsFound = NULL; } @@ -96,7 +92,7 @@ wxFSFile* wxZipFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& l rightPart.Normalize(wxPATH_NORM_DOTS, wxT("/"), wxPATH_UNIX); right = rightPart.GetFullPath(wxPATH_UNIX); } - + if (right.GetChar(0) == wxT('/')) right = right.Mid(1); wxFileName leftFilename = wxFileSystem::URLToFileName(left); @@ -142,16 +138,16 @@ wxString wxZipFSHandler::FindFirst(const wxString& spec, int flags) switch (flags) { case wxFILE: - m_AllowDirs = FALSE, m_AllowFiles = TRUE; break; + m_AllowDirs = false, m_AllowFiles = true; break; case wxDIR: - m_AllowDirs = TRUE, m_AllowFiles = FALSE; break; + m_AllowDirs = true, m_AllowFiles = false; break; default: - m_AllowDirs = m_AllowFiles = TRUE; break; + m_AllowDirs = m_AllowFiles = true; break; } m_ZipFile = left; wxString nativename = wxFileSystem::URLToFileName(m_ZipFile).GetFullPath(); - m_Archive = (void*) unzOpen(nativename.fn_str()); + m_Archive = (void*) unzOpen(nativename.mb_str(wxConvFile)); m_Pattern = right.AfterLast(wxT('/')); m_BaseDir = right.BeforeLast(wxT('/')); @@ -212,7 +208,7 @@ wxString wxZipFSHandler::DoFind() filename = dir.AfterLast(wxT('/')); dir = dir.BeforeLast(wxT('/')); if (!filename.IsEmpty() && m_BaseDir == dir && - wxMatchWild(m_Pattern, filename, FALSE)) + wxMatchWild(m_Pattern, filename, false)) match = m_ZipFile + wxT("#zip:") + dir + wxT("/") + filename; } else @@ -223,7 +219,7 @@ wxString wxZipFSHandler::DoFind() filename = namestr.AfterLast(wxT('/')); dir = namestr.BeforeLast(wxT('/')); if (m_AllowFiles && !filename.IsEmpty() && m_BaseDir == dir && - wxMatchWild(m_Pattern, filename, FALSE)) + wxMatchWild(m_Pattern, filename, false)) match = m_ZipFile + wxT("#zip:") + namestr; if (unzGoToNextFile((unzFile)m_Archive) != UNZ_OK)