forked from wxWidgets/wxWidgets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add wxFileSystemHandler for "data" scheme
This notably allows embedding images directly in HTML. Closes wxWidgets#24138.
- Loading branch information
1 parent
68eaff5
commit ca40535
Showing
14 changed files
with
306 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
///////////////////////////////////////////////////////////////////////////// | ||
// Name: wx/fs_data.h | ||
// Purpose: DATA scheme file system. | ||
// Author: Vyacheslav Lisovski | ||
// Copyright: (c) 2023 Vyacheslav Lisovski | ||
// Licence: wxWindows licence | ||
///////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifndef _WX_FS_DATA_H_ | ||
#define _WX_FS_DATA_H_ | ||
|
||
#include "wx/defs.h" | ||
|
||
#if wxUSE_FILESYSTEM | ||
|
||
#include "wx/filesys.h" | ||
|
||
// ---------------------------------------------------------------------------- | ||
// wxDataSchemeFSHandler | ||
// ---------------------------------------------------------------------------- | ||
|
||
class WXDLLIMPEXP_BASE wxDataSchemeFSHandler : public wxFileSystemHandler | ||
{ | ||
public: | ||
virtual bool CanOpen(const wxString& location) override; | ||
virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location) override; | ||
}; | ||
|
||
#endif // wxUSE_FILESYSTEM | ||
|
||
#endif // _WX_FS_DATA_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
///////////////////////////////////////////////////////////////////////////// | ||
// Name: wx/fs_data.h | ||
// Purpose: DATA scheme file system | ||
// Author: Vyacheslav Lisovski | ||
// Copyright: (c) 2023 Vyacheslav Lisovski | ||
// Licence: wxWindows licence | ||
///////////////////////////////////////////////////////////////////////////// | ||
|
||
/** | ||
@class wxDataSchemeFSHandler | ||
File system handler for "data" URI scheme (RFC 2397). | ||
URI syntax: @c "data:[<mediatype>][;base64],<data>". | ||
The handler makes the data, included (encoded) into URI, available for | ||
components that use the wxFileSystem infrastructure. | ||
To make available for usage it should be registered somewhere within an | ||
initialization procedure: | ||
@code | ||
wxFileSystem::AddHandler(new wxDataSchemeFSHandler); | ||
@endcode | ||
@since 3.3.0 | ||
*/ | ||
|
||
class wxDataSchemeFSHandler : public wxFileSystemHandler | ||
{ | ||
public: | ||
wxDataSchemeFSHandler(); | ||
}; |
Oops, something went wrong.