2006-10-27 08:16:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-10-30 06:56:12 -05:00
|
|
|
// Name: wx/fs_arc.h
|
2006-10-27 18:10:19 -04:00
|
|
|
// Purpose: Archive file system
|
|
|
|
// Author: Vaclav Slavik, Mike Wetherell
|
|
|
|
// Copyright: (c) 1999 Vaclav Slavik, (c) 2006 Mike Wetherell
|
2006-10-27 08:16:30 -04:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-10-27 18:10:19 -04:00
|
|
|
#ifndef _WX_FS_ARC_H_
|
|
|
|
#define _WX_FS_ARC_H_
|
2006-10-27 08:16:30 -04:00
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2006-10-27 18:10:19 -04:00
|
|
|
#if wxUSE_FS_ARCHIVE
|
2006-10-27 08:16:30 -04:00
|
|
|
|
|
|
|
#include "wx/filesys.h"
|
|
|
|
#include "wx/hashmap.h"
|
|
|
|
|
2006-10-27 18:10:19 -04:00
|
|
|
WX_DECLARE_STRING_HASH_MAP(int, wxArchiveFilenameHashMap);
|
2006-10-27 08:16:30 -04:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
2006-10-27 18:10:19 -04:00
|
|
|
// wxArchiveFSHandler
|
2006-10-27 08:16:30 -04:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2006-10-27 18:10:19 -04:00
|
|
|
class WXDLLIMPEXP_BASE wxArchiveFSHandler : public wxFileSystemHandler
|
2006-10-27 08:16:30 -04:00
|
|
|
{
|
2006-10-27 18:10:19 -04:00
|
|
|
public:
|
|
|
|
wxArchiveFSHandler();
|
|
|
|
virtual bool CanOpen(const wxString& location);
|
|
|
|
virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);
|
|
|
|
virtual wxString FindFirst(const wxString& spec, int flags = 0);
|
|
|
|
virtual wxString FindNext();
|
|
|
|
void Cleanup();
|
|
|
|
virtual ~wxArchiveFSHandler();
|
|
|
|
|
|
|
|
private:
|
|
|
|
class wxArchiveFSCache *m_cache;
|
|
|
|
wxFileSystem m_fs;
|
|
|
|
|
|
|
|
// these vars are used by FindFirst/Next:
|
|
|
|
class wxArchiveFSCacheData *m_Archive;
|
2006-10-27 20:28:41 -04:00
|
|
|
struct wxArchiveFSEntry *m_FindEntry;
|
2006-10-27 18:10:19 -04:00
|
|
|
wxString m_Pattern, m_BaseDir, m_ZipFile;
|
|
|
|
bool m_AllowDirs, m_AllowFiles;
|
|
|
|
wxArchiveFilenameHashMap *m_DirsFound;
|
|
|
|
|
|
|
|
wxString DoFind();
|
|
|
|
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxArchiveFSHandler);
|
2006-10-27 18:10:19 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxArchiveFSHandler)
|
2006-10-27 08:16:30 -04:00
|
|
|
};
|
|
|
|
|
2006-10-27 18:10:19 -04:00
|
|
|
#endif // wxUSE_FS_ARCHIVE
|
2006-10-27 08:16:30 -04:00
|
|
|
|
2006-10-27 18:10:19 -04:00
|
|
|
#endif // _WX_FS_ARC_H_
|