]>
git.saurik.com Git - wxWidgets.git/blob - src/common/fs_zip.cpp
2bd3b224ed2beef7727e6216d67905e1ede9d3ed
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: ZIP file system
4 // Author: Vaclav Slavik
5 // Copyright: (c) 1999 Vaclav Slavik
6 // Licence: wxWindows Licence
7 /////////////////////////////////////////////////////////////////////////////
11 #pragma implementation
14 #include <wx/wxprec.h>
24 #include "wx/filesys.h"
25 #include "wx/zipstream.h"
26 #include "wx/fs_zip.h"
29 //--------------------------------------------------------------------------------
31 //--------------------------------------------------------------------------------
35 bool wxZipFSHandler::CanOpen(const wxString
& location
)
37 wxString p
= GetProtocol(location
);
44 wxFSFile
* wxZipFSHandler::OpenFile(wxFileSystem
& WXUNUSED(fs
), const wxString
& location
)
46 wxString right
= GetRightLocation(location
);
47 wxString left
= GetLeftLocation(location
);
50 if (GetProtocol(left
) != "file") {
54 s
= new wxZipInputStream(left
, right
);
55 if (s
&& (s
-> LastError() == wxStream_NOERROR
)) {
56 return new wxFSFile(s
,
57 left
+ "#zip:" + right
,
58 GetMimeTypeFromExt(location
),
66 wxZipFSHandler::~wxZipFSHandler()