This class provides an interface for opening files on different file systems. It can handle absolute and/or local filenames. It uses a system of handlers to provide access to user-defined virtual file systems.
wxFileSystemHandler, wxFSFile, Overview
This static function adds new handler into the list of handlers. The handlers provide access to virtual FS.
You can call:
This is because (a) AddHandler is a static method, and (b) the handlers are deleted in wxFileSystem's destructor so that you don't have to care about it.
Sets the current location. location parameter passed to OpenFile is relative to this path.
Caution! Unless is_dir is true the location parameter is not the directory name but the name of the file in this directory. All these commands change the path to "dir/subdir/":
ChangePathTo("dir/subdir/xh.htm"); ChangePathTo("dir/subdir", true); ChangePathTo("dir/subdir/", true);
f = fs -> OpenFile("hello.htm"); // opens file 'hello.htm' fs -> ChangePathTo("subdir/folder", true); f = fs -> OpenFile("hello.htm"); // opens file 'subdir/folder/hello.htm' !!
Returns actual path (set by ChangePathTo).
Converts filename into URL.
Works like wxFindFirstFile. Returns name of the first filename (within filesystem's current path) that matches wildcard. flags may be one of wxFILE (only files), wxDIR (only directories) or 0 (both).
Returns the next filename that matches parameters passed to FindFirst.
Opens the file and returns a pointer to a wxFSFile object or NULL if failed. It first tries to open the file in relative scope (based on value passed to ChangePathTo() method) and then as an absolute path. Note that the user is responsible for deleting the returned wxFSFile.
Converts URL into a well-formed filename. The URL must use the file protocol.