]>
git.saurik.com Git - wxWidgets.git/blob - src/common/fs_zip.cpp
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>
26 #include "wx/filesys.h"
27 #include "wx/zipstream.h"
28 #include "wx/fs_zip.h"
31 //--------------------------------------------------------------------------------
33 //--------------------------------------------------------------------------------
37 bool wxZipFSHandler::CanOpen(const wxString
& location
)
39 wxString p
= GetProtocol(location
);
46 wxFSFile
* wxZipFSHandler::OpenFile(wxFileSystem
& WXUNUSED(fs
), const wxString
& location
)
48 wxString right
= GetRightLocation(location
);
49 wxString left
= GetLeftLocation(location
);
52 if (GetProtocol(left
) != "file") {
56 s
= new wxZipInputStream(left
, right
);
57 if (s
&& (s
-> LastError() == wxStream_NOERROR
)) {
58 return new wxFSFile(s
,
59 left
+ "#zip:" + right
,
60 GetMimeTypeFromExt(location
),
68 wxZipFSHandler::~wxZipFSHandler()
72 #endif // wxUSE_FS_ZIP