Add wxFSInputStream providing stream interface to wxFileSystem.

This class allows using virtual wxFSFiles with any wx functions taking
streams. E.g. it makes it possible to load images and animations from
wxFileSystem.

Closes #14185.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-04-16 13:53:49 +00:00
parent f5ef4d69b7
commit b7775a521f
4 changed files with 76 additions and 0 deletions

View File

@@ -293,7 +293,20 @@ protected:
static wxString ms_root;
};
// Stream reading data from wxFSFile: this allows to use virtual files with any
// wx functions accepting streams.
class WXDLLIMPEXP_BASE wxFSInputStream : public wxWrapperInputStream
{
public:
// Notice that wxFS_READ is implied in flags.
wxFSInputStream(const wxString& filename, int flags = 0);
virtual ~wxFSInputStream();
private:
wxFSFile* m_file;
wxDECLARE_NO_COPY_CLASS(wxFSInputStream);
};
#endif
// wxUSE_FILESYSTEM