.\" This is a wxWidgets manpage page generated from the XML docs .TH wxMemoryFSHandler 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxMemoryFSHandler \- .SH DESCRIPTION This wxFileSystem handler can store arbitrary data in memory stream and make them accessible via URL. It is particularly suitable for storing bitmaps from resources or included XPM files so that they can be used with wxHTML. Filenames are prefixed with "memory:", e.g. "memory:myfile.html". Example: #ifndef __WXMSW__ #include "logo.xpm" #endif void MyFrame::OnAbout(wxCommandEvent&) { wxBusyCursor bcur; wxFileSystem::AddHandler(new wxMemoryFSHandler); wxMemoryFSHandler::AddFile("logo.pcx", wxBITMAP(logo), wxBITMAP_TYPE_PCX); wxMemoryFSHandler::AddFile("about.htm", "About: " ""); wxDialog dlg(this, -1, wxString(_("About"))); wxBoxSizer *topsizer; wxHtmlWindow *html; topsizer = new wxBoxSizer(wxVERTICAL); html = new wxHtmlWindow(&dlg, -1, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER); html->SetBorders(0); html->LoadPage("memory:about.htm"); html->SetSize(html->GetInternalRepresentation()->GetWidth(), html->GetInternalRepresentation()->GetHeight()); topsizer->Add(html, 1, wxALL, 10); topsizer->Add(new wxStaticLine(&dlg, -1), 0, wxEXPAND | wxLEFT | wxRIGHT, 10); topsizer->Add(new wxButton(&dlg, wxID_OK, "Ok"), 0, wxALL | wxALIGN_RIGHT, 15); dlg.SetAutoLayout(true); dlg.SetSizer(topsizer); topsizer->Fit(&dlg); dlg.Centre(); dlg.ShowModal(); wxMemoryFSHandler::RemoveFile("logo.pcx"); wxMemoryFSHandler::RemoveFile("about.htm"); } .SH "PARENTS" wxFileSystemHandler .SH "INCLUDE FILES" wx/fs_mem.h .SH MEMBERS .SS wxMemoryFSHandler () Constructor. .SS static void AddFile (const wxString& filenamewxImage& imagelong type) .SS static void AddFile (const wxString& filenameconst wxBitmap& bitmaplong type) .SS static void AddFile (const wxString& filenameconst wxString& textdata) .SS static void AddFile (const wxString& filenameconst void* binarydatasize_t size) Add file to list of files stored in memory. Stored data (bitmap, text or raw data) will be copied into private memory stream and available under name "memory:" + filename . The type argument is one of wxBITMAP_TYPE_XXX constants. Note that you must use a type value (aka image format) that wxWidgets can save (e.g. JPG, PNG, see wxImage documentation )! .SS static void RemoveFile (const wxString& filename) Remove file from memory FS and free occupied memory. .SH "SEE ALSO" wxFileSystemHandler .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.