]> git.saurik.com Git - wxWidgets.git/blame - include/wx/fs_mem.h
find available samples, demos and contribs at runtime
[wxWidgets.git] / include / wx / fs_mem.h
CommitLineData
dcb86da0
VS
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
4e8e18e2
VZ
9#ifndef _WX_FS_MEM_H_
10#define _WX_FS_MEM_H_
dcb86da0 11
af49c4b8 12#if defined(__GNUG__) && !defined(__APPLE__)
c3f4609e 13#pragma interface "fs_mem.h"
dcb86da0
VS
14#endif
15
16#include "wx/wxprec.h"
17
2b5f62a0 18#ifdef __BORLANDC__
dcb86da0
VS
19#pragma hdrstop
20#endif
21
24528b0c 22#if wxUSE_FILESYSTEM
dcb86da0 23
dcb86da0 24#include "wx/filesys.h"
04dbb646 25
e2478fde
VZ
26class WXDLLEXPORT wxBitmap;
27class WXDLLEXPORT wxImage;
dcb86da0
VS
28
29//--------------------------------------------------------------------------------
30// wxMemoryFSHandler
31//--------------------------------------------------------------------------------
32
e2478fde 33class WXDLLEXPORT wxMemoryFSHandlerBase : public wxFileSystemHandler
dcb86da0 34{
e2478fde
VZ
35public:
36 wxMemoryFSHandlerBase();
37 ~wxMemoryFSHandlerBase();
dcb86da0 38
e2478fde
VZ
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
f98d23fd 42#if wxUSE_IMAGE
e2478fde 43 static void AddFile(const wxString& filename, wxImage& image, long type);
f98d23fd 44#endif // wxUSE_IMAGE
e2478fde
VZ
45 static void AddFile(const wxString& filename, const wxString& textdata);
46 static void AddFile(const wxString& filename, const void *binarydata, size_t size);
04dbb646 47
e2478fde
VZ
48 // Remove file from memory FS and free occupied memory
49 static void RemoveFile(const wxString& filename);
04dbb646 50
e2478fde
VZ
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();
04dbb646 55
e2478fde
VZ
56private:
57 static wxHashTable *m_Hash;
04dbb646 58
e2478fde 59 static bool CheckHash(const wxString& filename);
dcb86da0
VS
60};
61
e2478fde
VZ
62class wxMemoryFSHandler : public wxMemoryFSHandlerBase
63{
64public:
65#if wxUSE_GUI
66 static void AddFile(const wxString& filename, const wxBitmap& bitmap, long type);
67#endif // wxUSE_GUI
68};
dcb86da0 69
e2478fde 70#endif // wxUSE_FILESYSTEM
dcb86da0 71
4e8e18e2
VZ
72#endif // _WX_FS_MEM_H_
73