public:
/**
Constructor.
+
+ The initial current path of this object will be empty
+ (i.e. GetPath() == wxEmptyString) which means that e.g. OpenFile()
+ or FindFirst() functions will use current working directory as
+ current path (see also wxGetCwd).
*/
wxFileSystem();
handlers are deleted in wxFileSystem's destructor so that you
don't have to care about it.
*/
- static void AddHandler(wxFileSystemHandler handler);
+ static void AddHandler(wxFileSystemHandler* handler);
/**
Sets the current location. @a location parameter passed to OpenFile() is
@class wxFSFile
This class represents a single file opened by wxFileSystem.
- It provides more information than wxWindow's input stream
+ It provides more informations than wxWidgets' input streams
(stream, filename, mime type, anchor).
@note Any pointer returned by a method of wxFSFile is valid only as long as
ten identical pointers.
@library{wxbase}
- @category{vfs}
+ @category{vfs,file}
@see wxFileSystemHandler, wxFileSystem, @ref overview_fs
*/
*/
virtual wxString FindNext();
+ /**
+ Returns the MIME type based on @b extension of @a location.
+ (While wxFSFile::GetMimeType() returns real MIME type - either
+ extension-based or queried from HTTP.)
+
+ Example:
+ @code
+ GetMimeTypeFromExt("index.htm") == "text/html"
+ @endcode
+ */
+ static wxString GetMimeTypeFromExt(const wxString& location);
+
+ /**
+ Opens the file and returns wxFSFile pointer or @NULL if failed.
+ Must be overridden in derived handlers.
+
+ @param fs
+ Parent FS (the FS from that OpenFile was called).
+ See the ZIP handler for details of how to use it.
+ @param location
+ The absolute location of file.
+ */
+ virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location) = 0;
+
+protected:
+
/**
Returns the anchor if present in the location.
See wxFSFile::GetAnchor for details.
*/
static wxString GetLeftLocation(const wxString& location);
- /**
- Returns the MIME type based on @b extension of @a location.
- (While wxFSFile::GetMimeType() returns real MIME type - either
- extension-based or queried from HTTP.)
-
- Example:
- @code
- GetMimeTypeFromExt("index.htm") == "text/html"
- @endcode
- */
- static wxString GetMimeTypeFromExt(const wxString& location);
-
/**
Returns the protocol string extracted from @a location.
@endcode
*/
static wxString GetRightLocation(const wxString& location);
-
- /**
- Opens the file and returns wxFSFile pointer or @NULL if failed.
- Must be overridden in derived handlers.
-
- @param fs
- Parent FS (the FS from that OpenFile was called).
- See the ZIP handler for details of how to use it.
- @param location
- The absolute location of file.
- */
- virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location) = 0;
};