]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: fs_zip.h | |
3 | // Purpose: ZIP file system | |
4 | // Author: Vaclav Slavik | |
5 | // Copyright: (c) 1999 Vaclav Slavik | |
6 | // CVS-ID: $Id$ | |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #ifndef _WX_FS_ZIP_H_ | |
11 | #define _WX_FS_ZIP_H_ | |
12 | ||
13 | #include "wx/defs.h" | |
14 | ||
15 | #if wxUSE_FILESYSTEM && wxUSE_FS_ZIP && wxUSE_STREAMS | |
16 | ||
17 | #include "wx/filesys.h" | |
18 | #include "wx/hashmap.h" | |
19 | ||
20 | ||
21 | WX_DECLARE_STRING_HASH_MAP(int, wxZipFilenameHashMap); | |
22 | ||
23 | ||
24 | //--------------------------------------------------------------------------- | |
25 | // wxZipFSHandler | |
26 | //--------------------------------------------------------------------------- | |
27 | ||
28 | class WXDLLIMPEXP_BASE wxZipFSHandler : public wxFileSystemHandler | |
29 | { | |
30 | public: | |
31 | wxZipFSHandler(); | |
32 | virtual bool CanOpen(const wxString& location); | |
33 | virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location); | |
34 | virtual wxString FindFirst(const wxString& spec, int flags = 0); | |
35 | virtual wxString FindNext(); | |
36 | #if wxABI_VERSION >= 20602 /* 2.6.2+ only */ | |
37 | void Cleanup(); | |
38 | #endif | |
39 | ~wxZipFSHandler(); | |
40 | ||
41 | private: | |
42 | // these vars are used by FindFirst/Next: | |
43 | class wxZipInputStream *m_Archive; | |
44 | wxString m_Pattern, m_BaseDir, m_ZipFile; | |
45 | bool m_AllowDirs, m_AllowFiles; | |
46 | wxZipFilenameHashMap *m_DirsFound; | |
47 | ||
48 | wxString DoFind(); | |
49 | ||
50 | DECLARE_NO_COPY_CLASS(wxZipFSHandler) | |
51 | }; | |
52 | ||
53 | ||
54 | #endif | |
55 | // wxUSE_FILESYSTEM && wxUSE_FS_ZIP && wxUSE_STREAMS | |
56 | ||
57 | #endif // _WX_FS_ZIP_H_ | |
58 |