2006-10-27 12:16:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-10-30 11:56:12 +00:00
|
|
|
// Name: wx/fs_arc.h
|
2006-10-27 22:10:19 +00:00
|
|
|
// Purpose: Archive file system
|
|
|
|
// Author: Vaclav Slavik, Mike Wetherell
|
|
|
|
// Copyright: (c) 1999 Vaclav Slavik, (c) 2006 Mike Wetherell
|
2006-10-27 12:16:30 +00:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-10-27 22:10:19 +00:00
|
|
|
#ifndef _WX_FS_ARC_H_
|
|
|
|
#define _WX_FS_ARC_H_
|
2006-10-27 12:16:30 +00:00
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2006-10-27 22:10:19 +00:00
|
|
|
#if wxUSE_FS_ARCHIVE
|
2006-10-27 12:16:30 +00:00
|
|
|
|
|
|
|
#include "wx/filesys.h"
|
|
|
|
#include "wx/hashmap.h"
|
|
|
|
|
2006-10-27 22:10:19 +00:00
|
|
|
WX_DECLARE_STRING_HASH_MAP(int, wxArchiveFilenameHashMap);
|
2006-10-27 12:16:30 +00:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
2006-10-27 22:10:19 +00:00
|
|
|
// wxArchiveFSHandler
|
2006-10-27 12:16:30 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2006-10-27 22:10:19 +00:00
|
|
|
class WXDLLIMPEXP_BASE wxArchiveFSHandler : public wxFileSystemHandler
|
2006-10-27 12:16:30 +00:00
|
|
|
{
|
2006-10-27 22:10:19 +00:00
|
|
|
public:
|
|
|
|
wxArchiveFSHandler();
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool CanOpen(const wxString& location) wxOVERRIDE;
|
|
|
|
virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location) wxOVERRIDE;
|
|
|
|
virtual wxString FindFirst(const wxString& spec, int flags = 0) wxOVERRIDE;
|
|
|
|
virtual wxString FindNext() wxOVERRIDE;
|
2006-10-27 22:10:19 +00:00
|
|
|
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-28 00:28:41 +00:00
|
|
|
struct wxArchiveFSEntry *m_FindEntry;
|
2006-10-27 22:10:19 +00:00
|
|
|
wxString m_Pattern, m_BaseDir, m_ZipFile;
|
|
|
|
bool m_AllowDirs, m_AllowFiles;
|
|
|
|
wxArchiveFilenameHashMap *m_DirsFound;
|
|
|
|
|
|
|
|
wxString DoFind();
|
|
|
|
|
2009-02-08 11:45:59 +00:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxArchiveFSHandler);
|
2006-10-27 22:10:19 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxArchiveFSHandler)
|
2006-10-27 12:16:30 +00:00
|
|
|
};
|
|
|
|
|
2006-10-27 22:10:19 +00:00
|
|
|
#endif // wxUSE_FS_ARCHIVE
|
2006-10-27 12:16:30 +00:00
|
|
|
|
2006-10-27 22:10:19 +00:00
|
|
|
#endif // _WX_FS_ARC_H_
|