Add generic wxFileSystem support to wxWebView using wxWebViewFSHandler.
Closes #14623. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
38
src/common/webviewfshandler.cpp
Normal file
38
src/common/webviewfshandler.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: webviewfshandler.cpp
|
||||
// Purpose: Custom webview handler for virtual file system
|
||||
// Author: Nick Matthews
|
||||
// Id: $Id$
|
||||
// Copyright: (c) 2012 Steven Lamerton
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if wxUSE_WEBVIEW
|
||||
|
||||
#if defined(__BORLANDC__)
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "wx/webviewfshandler.h"
|
||||
#include "wx/filesys.h"
|
||||
|
||||
wxWebViewFSHandler::wxWebViewFSHandler(const wxString& scheme) :
|
||||
wxWebViewHandler(scheme)
|
||||
{
|
||||
m_fileSystem = new wxFileSystem();
|
||||
}
|
||||
|
||||
wxWebViewFSHandler::~wxWebViewFSHandler()
|
||||
{
|
||||
wxDELETE(m_fileSystem);
|
||||
}
|
||||
|
||||
wxFSFile* wxWebViewFSHandler::GetFile(const wxString &uri)
|
||||
{
|
||||
return m_fileSystem->OpenFile(uri);
|
||||
}
|
||||
|
||||
#endif // wxUSE_WEBVIEW
|
||||
Reference in New Issue
Block a user