X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8067ee1174ded3b3ab4127ed2e00e586b855a828..9a38aced4ecb7c9ca602e66b2defb8c2a1307d52:/interface/wx/filesys.h diff --git a/interface/wx/filesys.h b/interface/wx/filesys.h index a61f76362c..6d3146db61 100644 --- a/interface/wx/filesys.h +++ b/interface/wx/filesys.h @@ -36,6 +36,11 @@ class wxFileSystem : public wxObject 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(); @@ -54,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 @@ -100,14 +105,14 @@ public: If the file is found in any directory, returns @true and the full path of the file in @a str, otherwise returns @false and doesn't modify @a str. - @param str + @param pStr Receives the full path of the file, must not be @NULL @param path wxPATH_SEP-separated list of directories @param file the name of the file to look for */ - bool FindFileInPath(wxString str, const wxString& path, + bool FindFileInPath(wxString* pStr, const wxString& path, const wxString& file); /** @@ -172,7 +177,7 @@ public: @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 @@ -182,7 +187,7 @@ public: ten identical pointers. @library{wxbase} - @category{vfs} + @category{vfs,file} @see wxFileSystemHandler, wxFileSystem, @ref overview_fs */ @@ -238,7 +243,7 @@ public: You will have to delete the stream yourself. */ - void DetachStream(); + wxInputStream* DetachStream(); /** Returns anchor (if present). The term of @b anchor can be easily @@ -378,6 +383,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. @@ -401,18 +432,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. @@ -432,18 +451,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); };