1999-07-07 18:04:58 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: fs_zip.h
|
|
|
|
// Purpose: ZIP file system
|
|
|
|
// Author: Vaclav Slavik
|
|
|
|
// Copyright: (c) 1999 Vaclav Slavik
|
2001-02-22 18:43:45 -05:00
|
|
|
// CVS-ID: $Id$
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-07 18:04:58 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2002-03-06 06:17:14 -05:00
|
|
|
#ifndef _WX_FS_ZIP_H_
|
|
|
|
#define _WX_FS_ZIP_H_
|
1999-07-07 18:04:58 -04:00
|
|
|
|
2004-07-25 12:44:47 -04:00
|
|
|
#include "wx/defs.h"
|
1999-07-07 18:04:58 -04:00
|
|
|
|
2000-02-27 16:06:17 -05:00
|
|
|
#if wxUSE_FILESYSTEM && wxUSE_FS_ZIP && wxUSE_STREAMS
|
1999-07-29 15:52:37 -04:00
|
|
|
|
1999-08-20 18:52:21 -04:00
|
|
|
#include "wx/filesys.h"
|
2004-05-08 16:20:24 -04:00
|
|
|
#include "wx/hashmap.h"
|
1999-07-07 18:04:58 -04:00
|
|
|
|
2005-02-19 11:53:49 -05:00
|
|
|
|
2006-01-18 11:45:41 -05:00
|
|
|
WX_DECLARE_STRING_HASH_MAP(int, wxZipFilenameHashMap);
|
2005-02-19 11:53:49 -05:00
|
|
|
|
|
|
|
|
2004-05-08 16:20:24 -04:00
|
|
|
//---------------------------------------------------------------------------
|
1999-07-07 18:04:58 -04:00
|
|
|
// wxZipFSHandler
|
2004-05-08 16:20:24 -04:00
|
|
|
//---------------------------------------------------------------------------
|
1999-07-07 18:04:58 -04:00
|
|
|
|
2003-07-01 21:59:24 -04:00
|
|
|
class WXDLLIMPEXP_BASE wxZipFSHandler : public wxFileSystemHandler
|
1999-07-07 18:04:58 -04:00
|
|
|
{
|
|
|
|
public:
|
1999-10-31 17:05:10 -05:00
|
|
|
wxZipFSHandler();
|
1999-07-07 18:04:58 -04:00
|
|
|
virtual bool CanOpen(const wxString& location);
|
|
|
|
virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);
|
1999-10-31 17:05:10 -05:00
|
|
|
virtual wxString FindFirst(const wxString& spec, int flags = 0);
|
|
|
|
virtual wxString FindNext();
|
2005-07-28 17:00:46 -04:00
|
|
|
void Cleanup();
|
1999-07-07 18:04:58 -04:00
|
|
|
~wxZipFSHandler();
|
2001-07-05 14:48:48 -04:00
|
|
|
|
1999-10-31 17:05:10 -05:00
|
|
|
private:
|
|
|
|
// these vars are used by FindFirst/Next:
|
2004-11-10 18:58:38 -05:00
|
|
|
class wxZipInputStream *m_Archive;
|
1999-10-31 17:05:10 -05:00
|
|
|
wxString m_Pattern, m_BaseDir, m_ZipFile;
|
|
|
|
bool m_AllowDirs, m_AllowFiles;
|
2005-02-19 11:53:49 -05:00
|
|
|
wxZipFilenameHashMap *m_DirsFound;
|
2001-07-05 14:48:48 -04:00
|
|
|
|
1999-10-31 17:05:10 -05:00
|
|
|
wxString DoFind();
|
2003-01-02 18:38:11 -05:00
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(wxZipFSHandler)
|
1999-07-07 18:04:58 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
1999-07-29 15:52:37 -04:00
|
|
|
#endif
|
2000-02-27 16:06:17 -05:00
|
|
|
// wxUSE_FILESYSTEM && wxUSE_FS_ZIP && wxUSE_STREAMS
|
1999-07-07 18:04:58 -04:00
|
|
|
|
2002-03-06 06:17:14 -05:00
|
|
|
#endif // _WX_FS_ZIP_H_
|
|
|
|
|