X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/336aecf1c2f69fa10e3271ea94dac7c545bf6300..63a65070911908802c27b52173c3306e93dd63bf:/interface/wx/filesys.h diff --git a/interface/wx/filesys.h b/interface/wx/filesys.h index 22246cacbc..01e5fd12fe 100644 --- a/interface/wx/filesys.h +++ b/interface/wx/filesys.h @@ -3,7 +3,7 @@ // Purpose: interface of wxFileSystem, wxFileSystemHandler, wxFSFile // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -59,7 +59,7 @@ public: 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 @@ -160,6 +160,11 @@ public: Passing @e "wxFS_READ | wxFS_SEEKABLE" for @a flags will back a stream that is not natively seekable with memory or a file and return a stream that is always seekable. + + @note + The @a location argument is, despite this method's name @em not + a filename. It is a "location", aka wxFileSystem URL (see + @ref overview_fs). */ wxFSFile* OpenFile(const wxString& location, int flags = wxFS_READ); @@ -331,7 +336,7 @@ public: @beginWxPerlOnly In wxPerl, you need to derive your file system handler class - from Wx::PlFileSystemHandler. + from @c Wx::PlFileSystemHandler. @endWxPerlOnly @library{wxbase} @@ -383,6 +388,32 @@ public: */ 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. @@ -406,18 +437,6 @@ public: */ 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. @@ -437,17 +456,5 @@ public: @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; };