1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: in-memory file system
4 // Author: Vaclav Slavik
5 // Copyright: (c) 2000 Vaclav Slavik
6 // Licence: wxWindows Licence
7 /////////////////////////////////////////////////////////////////////////////
13 #pragma interface "fs_mem.h"
16 #include "wx/wxprec.h"
24 #include "wx/filesys.h"
28 #include "wx/bitmap.h"
31 //--------------------------------------------------------------------------------
33 //--------------------------------------------------------------------------------
35 class WXDLLEXPORT wxMemoryFSHandler
: public wxFileSystemHandler
41 // Add file to list of files stored in memory. Stored data (bitmap, text or raw data)
42 // will be copied into private memory stream and available under name "memory:" + filename
44 static void AddFile(const wxString
& filename
, wxImage
& image
, long type
);
45 static void AddFile(const wxString
& filename
, const wxBitmap
& bitmap
, long type
);
47 static void AddFile(const wxString
& filename
, const wxString
& textdata
);
48 static void AddFile(const wxString
& filename
, const void *binarydata
, size_t size
);
50 // Remove file from memory FS and free occupied memory
51 static void RemoveFile(const wxString
& filename
);
53 virtual bool CanOpen(const wxString
& location
);
54 virtual wxFSFile
* OpenFile(wxFileSystem
& fs
, const wxString
& location
);
55 virtual wxString
FindFirst(const wxString
& spec
, int flags
= 0);
56 virtual wxString
FindNext();
59 static wxHashTable
*m_Hash
;
61 static bool CheckHash(const wxString
& filename
);
68 #endif // _WX_FS_MEM_H_