1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: in-memory file system
4 // Author: Vaclav Slavik
5 // Copyright: (c) 2000 Vaclav Slavik
6 // Licence: wxWindows Licence
7 /////////////////////////////////////////////////////////////////////////////
11 #pragma interface "fs_mem.h"
14 #include "wx/wxprec.h"
26 #include "wx/filesys.h"
29 #include "wx/bitmap.h"
32 //--------------------------------------------------------------------------------
34 //--------------------------------------------------------------------------------
36 class WXDLLEXPORT wxMemoryFSHandler
: public wxFileSystemHandler
42 // Add file to list of files stored in memory. Stored data (bitmap, text or raw data)
43 // will be copied into private memory stream and available under name "memory:" + filename
45 static void AddFile(const wxString
& filename
, wxImage
& image
, long type
);
46 static void AddFile(const wxString
& filename
, const wxBitmap
& bitmap
, long type
);
48 static void AddFile(const wxString
& filename
, const wxString
& textdata
);
49 static void AddFile(const wxString
& filename
, const void *binarydata
, size_t size
);
51 // Remove file from memory FS and free occupied memory
52 static void RemoveFile(const wxString
& filename
);
54 virtual bool CanOpen(const wxString
& location
);
55 virtual wxFSFile
* OpenFile(wxFileSystem
& fs
, const wxString
& location
);
56 virtual wxString
FindFirst(const wxString
& spec
, int flags
= 0);
57 virtual wxString
FindNext();
60 static wxHashTable
*m_Hash
;
62 static bool CheckHash(const wxString
& filename
);