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();
|
2014-03-29 20:02:23 -04: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 18:10:19 -04: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-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);
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_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_
|