a quick hack to fix wxBase compilation
[wxWidgets.git] / include / wx / fs_mem.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: fs_mem.h
3 // Purpose: in-memory file system
4 // Author: Vaclav Slavik
5 // Copyright: (c) 2000 Vaclav Slavik
6 // Licence: wxWindows Licence
7 /////////////////////////////////////////////////////////////////////////////
8
9 #ifndef _WX_FS_MEM_H_
10 #define _WX_FS_MEM_H_
11
12 #if defined(__GNUG__) && !defined(__APPLE__)
13 #pragma interface "fs_mem.h"
14 #endif
15
16 #include "wx/wxprec.h"
17
18 #ifdef __BORLANDC__
19 #pragma hdrstop
20 #endif
21
22 #if wxUSE_FILESYSTEM
23
24 #include "wx/filesys.h"
25
26 class WXDLLEXPORT wxBitmap;
27 class WXDLLEXPORT wxImage;
28
29 //--------------------------------------------------------------------------------
30 // wxMemoryFSHandler
31 //--------------------------------------------------------------------------------
32
33 class WXDLLEXPORT wxMemoryFSHandlerBase : public wxFileSystemHandler
34 {
35 public:
36 wxMemoryFSHandlerBase();
37 ~wxMemoryFSHandlerBase();
38
39 // Add file to list of files stored in memory. Stored data (bitmap, text or
40 // raw data) will be copied into private memory stream and available under
41 // name "memory:" + filename
42 #if wxUSE_IMAGE
43 static void AddFile(const wxString& filename, wxImage& image, long type);
44 #endif // wxUSE_IMAGE
45 static void AddFile(const wxString& filename, const wxString& textdata);
46 static void AddFile(const wxString& filename, const void *binarydata, size_t size);
47
48 // Remove file from memory FS and free occupied memory
49 static void RemoveFile(const wxString& filename);
50
51 virtual bool CanOpen(const wxString& location);
52 virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);
53 virtual wxString FindFirst(const wxString& spec, int flags = 0);
54 virtual wxString FindNext();
55
56 private:
57 static wxHashTable *m_Hash;
58
59 static bool CheckHash(const wxString& filename);
60 };
61
62 class wxMemoryFSHandler : public wxMemoryFSHandlerBase
63 {
64 public:
65 #if wxUSE_GUI
66 static void AddFile(const wxString& filename, const wxBitmap& bitmap, long type);
67 #endif // wxUSE_GUI
68 };
69
70 #endif // wxUSE_FILESYSTEM
71
72 #endif // _WX_FS_MEM_H_
73