X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4cc4bfafe5a31cb96f35b3ec9b19fa2b0b3a4eef..14bdedbc67c490c8b168455bc726f092a950faea:/interface/filesys.h diff --git a/interface/filesys.h b/interface/filesys.h index d56f823cd3..41deffada4 100644 --- a/interface/filesys.h +++ b/interface/filesys.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: filesys.h -// Purpose: documentation for wxFileSystem class +// Purpose: interface of wxFileSystem // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows license @@ -12,14 +12,13 @@ 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 + It uses a system of handlers() to provide access to user-defined virtual file systems. @library{wxbase} @category{vfs} - @seealso - wxFileSystemHandler, wxFSFile, Overview + @see wxFileSystemHandler, wxFSFile, Overview() */ class wxFileSystem : public wxObject { @@ -31,7 +30,7 @@ public: /** This static function adds new handler into the list of - handlers which provide access to virtual FS. + handlers() which provide access to virtual FS. Note that if two handlers for the same protocol are added, the last one added takes precedence. */ @@ -43,7 +42,7 @@ public: @b Caution! Unless @a is_dir is @true the @a 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/": - + @param location the new location. Its meaning depends on the value of is_dir @param is_dir @@ -54,7 +53,7 @@ public: /** Converts filename into URL. - + @see URLToFileName(), wxFileName */ static wxString FileNameToURL(wxFileName filename); @@ -65,7 +64,7 @@ public: @e path. If the file is found in any directory, returns @true and the full path of the file in @e str, otherwise returns @false and doesn't modify @e str. - + @param str Receives the full path of the file, must not be @NULL @param path @@ -77,7 +76,7 @@ public: const wxString& file); /** - Works like wxFindFirstFile. Returns name of the first + Works like wxFindFirstFile(). Returns name of the first filename (within filesystem's current path) that matches @e wildcard. @a flags may be one of wxFILE (only files), wxDIR (only directories) or 0 (both). @@ -108,7 +107,7 @@ public: absolute path. Note that the user is responsible for deleting the returned wxFSFile. @a flags can be one or more of the following bit values ored together: - + A stream opened with just the default @e wxFS_READ flag may or may not be seekable depending on the underlying source. Passing @e wxFS_READ | wxFS_SEEKABLE for @a flags will @@ -126,6 +125,7 @@ public: }; + /** @class wxFSFile @wxheader{filesys.h} @@ -134,7 +134,7 @@ public: It provides more information than wxWindow's input stream (stream, filename, mime type, anchor). - @b Note: Any pointer returned by a method of wxFSFile is valid + @note Any pointer returned by a method of wxFSFile is valid only as long as the wxFSFile object exists. For example a call to GetStream() doesn't @e create the stream but only returns the pointer to it. In other words after 10 calls to GetStream() you will have obtained ten identical @@ -143,15 +143,14 @@ public: @library{wxbase} @category{vfs} - @seealso - wxFileSystemHandler, wxFileSystem, Overview + @see wxFileSystemHandler, wxFileSystem, Overview() */ class wxFSFile : public wxObject { public: /** Constructor. You probably won't use it. See Notes for details. - + @param stream The input stream that will be used to access data @param location @@ -178,31 +177,31 @@ public: /** Returns anchor (if present). The term of @b anchor can be easily explained using few examples: - + Usually an anchor is presented only if the MIME type is 'text/html'. But it may have some meaning with other files; for example myanim.avi#200 may refer to position in animation or reality.wrl#MyView may refer to a predefined view in VRML. */ - const wxString GetAnchor(); + const wxString GetAnchor() const; /** Returns full location of the file, including path and protocol. Examples : */ - const wxString GetLocation(); + const wxString GetLocation() const; /** Returns the MIME type of the content of this file. It is either extension-based (see wxMimeTypesManager) or extracted from HTTP protocol Content-Type header. */ - const wxString GetMimeType(); + const wxString GetMimeType() const; /** Returns time when this file was modified. */ - wxDateTime GetModificationTime(); + wxDateTime GetModificationTime() const; /** Returns pointer to the stream. You can use the returned @@ -212,10 +211,11 @@ public: this by default. wxHtml uses local cache to work around this and to speed up the connection). */ - wxInputStream* GetStream(); + wxInputStream* GetStream() const; }; + /** @class wxFileSystemHandler @wxheader{filesys.h} @@ -228,7 +228,7 @@ public: of opening the file: GetProtocol, GetLeftLocation, GetRightLocation, GetAnchor, GetMimeTypeFromExt. - Please have a look at overview if you don't know how locations + Please have a look at overview() if you don't know how locations are constructed. Also consult @ref overview_fs "list of available handlers". @@ -239,8 +239,7 @@ public: @library{wxbase} @category{vfs} - @seealso - wxFileSystem, wxFSFile, Overview + @see wxFileSystem, wxFSFile, Overview() */ class wxFileSystemHandler : public wxObject { @@ -254,13 +253,13 @@ public: Returns @true if the handler is able to open this file. This function doesn't check whether the file exists or not, it only checks if it knows the protocol. Example: - + Must be overridden in derived handlers. */ virtual bool CanOpen(const wxString& location); /** - Works like wxFindFirstFile. Returns name of the first + Works like wxFindFirstFile(). Returns name of the first filename (within filesystem's current path) that matches @e wildcard. @a flags may be one of wxFILE (only files), wxDIR (only directories) or 0 (both). @@ -280,16 +279,16 @@ public: Returns the anchor if present in the location. See @ref wxFSFile::getanchor wxFSFile for details. Example: GetAnchor("index.htm#chapter2") == "chapter2" - @b Note: the anchor is NOT part of the left location. + @note the anchor is NOT part of the left location. */ - wxString GetAnchor(const wxString& location); + wxString GetAnchor(const wxString& location) const; /** Returns the left location string extracted from @e location. Example: GetLeftLocation("file:myzipfile.zip#zip:index.htm") == "file:myzipfile.zip" */ - wxString GetLeftLocation(const wxString& location); + wxString GetLeftLocation(const wxString& location) const; /** Returns the MIME type based on @b extension of @e location. (While @@ -303,18 +302,18 @@ public: Returns the protocol string extracted from @e location. Example: GetProtocol("file:myzipfile.zip#zip:index.htm") == "zip" */ - wxString GetProtocol(const wxString& location); + wxString GetProtocol(const wxString& location) const; /** Returns the right location string extracted from @e location. Example : GetRightLocation("file:myzipfile.zip#zip:index.htm") == "index.htm" */ - wxString GetRightLocation(const wxString& location); + wxString GetRightLocation(const wxString& location) const; /** 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 ZIP handler for details of how to use it. @@ -324,3 +323,4 @@ public: virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location); }; +