]> git.saurik.com Git - wxWidgets.git/blob - include/wx/fs_mem.h
fixed compilation of multilib dll
[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 #if wxUSE_GUI
27 class WXDLLIMPEXP_CORE wxBitmap;
28 class WXDLLIMPEXP_CORE wxImage;
29 #endif // wxUSE_GUI
30
31 // ----------------------------------------------------------------------------
32 // wxMemoryFSHandlerBase
33 // ----------------------------------------------------------------------------
34
35 class WXDLLIMPEXP_BASE wxMemoryFSHandlerBase : public wxFileSystemHandler
36 {
37 public:
38 wxMemoryFSHandlerBase();
39 ~wxMemoryFSHandlerBase();
40
41 // Add file to list of files stored in memory. Stored data (bitmap, text or
42 // raw data) will be copied into private memory stream and available under
43 // name "memory:" + filename
44 static void AddFile(const wxString& filename, const wxString& textdata);
45 static void AddFile(const wxString& filename, const void *binarydata, size_t size);
46
47 // Remove file from memory FS and free occupied memory
48 static void RemoveFile(const wxString& filename);
49
50 virtual bool CanOpen(const wxString& location);
51 virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);
52 virtual wxString FindFirst(const wxString& spec, int flags = 0);
53 virtual wxString FindNext();
54
55 protected:
56 static bool CheckHash(const wxString& filename);
57 static wxHashTable *m_Hash;
58 };
59
60 // ----------------------------------------------------------------------------
61 // wxMemoryFSHandler
62 // ----------------------------------------------------------------------------
63
64 #if wxUSE_GUI
65
66 // add GUI-only operations to the base class
67 class WXDLLIMPEXP_CORE wxMemoryFSHandler : public wxMemoryFSHandlerBase
68 {
69 public:
70 // bring the base class versions into the scope, otherwise they would be
71 // inaccessible in wxMemoryFSHandler
72 #if !defined(__GNUG__) || (__GNUG__ > 2)
73 using wxMemoryFSHandlerBase::AddFile;
74 #endif
75
76 #if wxUSE_IMAGE
77 static void AddFile(const wxString& filename, wxImage& image, long type);
78 #endif // wxUSE_IMAGE
79
80 static void AddFile(const wxString& filename, const wxBitmap& bitmap, long type);
81 };
82
83 #else // !wxUSE_GUI
84
85 // just the same thing as the base class in wxBase
86 class WXDLLIMPEXP_BASE wxMemoryFSHandler : public wxMemoryFSHandlerBase
87 {
88 };
89
90 #endif // wxUSE_GUI/!wxUSE_GUI
91
92 #endif // wxUSE_FILESYSTEM
93
94 #endif // _WX_FS_MEM_H_
95