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