⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filesysh.tex

📁 很牛的GUI源码wxWidgets-2.8.0.zip 可在多种平台下运行.
💻 TEX
字号:
%% automatically generated by HelpGen from% filesystemhandler.tex at 21/Mar/99 23:00:52%\section{\class{wxFileSystemHandler}}\label{wxfilesystemhandler}Classes derived from wxFileSystemHandler are usedto access virtual file systems. Its public interface consistsof two methods: \helpref{CanOpen}{wxfilesystemhandlercanopen} and \helpref{OpenFile}{wxfilesystemhandleropenfile}. It provides additional protected methods to simplify the processof opening the file: GetProtocol, GetLeftLocation, GetRightLocation,GetAnchor, GetMimeTypeFromExt.Please have a look at \helpref{overview}{fs} if you don't know how locationsare constructed.Also consult \helpref{list of available handlers}{fs}.\perlnote{In wxPerl, you need to derive your file system handler classfrom Wx::PlFileSystemHandler.}\wxheading{Notes}\begin{itemize}\itemsep=0pt\item The handlers are shared by all instances of wxFileSystem.\item wxHTML library provides handlers for local files and HTTP or FTP protocol\item The {\it location} parameter passed to OpenFile or CanOpen methodsis always an {\bf absolute} path. You don't need to check the FS's current path.\end{itemize}\wxheading{Derived from}\helpref{wxObject}{wxobject}\wxheading{Include files}<wx/filesys.h>\wxheading{See also}\helpref{wxFileSystem}{wxfilesystem}, \helpref{wxFSFile}{wxfsfile}, \helpref{Overview}{fs}\latexignore{\rtfignore{\wxheading{Members}}}\membersection{wxFileSystemHandler::wxFileSystemHandler}\label{wxfilesystemhandlerwxfilesystemhandler}\func{}{wxFileSystemHandler}{\void}Constructor.\membersection{wxFileSystemHandler::CanOpen}\label{wxfilesystemhandlercanopen}\func{virtual bool}{CanOpen}{\param{const wxString\& }{location}}Returns true if the handler is able to open this file. This function doesn'tcheck whether the file exists or not, it only checks if it knows the protocol.Example:\begin{verbatim}bool MyHand::CanOpen(const wxString& location) {    return (GetProtocol(location) == "http");}\end{verbatim}Must be overridden in derived handlers.\membersection{wxFileSystemHandler::GetAnchor}\label{wxfilesystemhandlergetanchor}\constfunc{wxString}{GetAnchor}{\param{const wxString\& }{location}}Returns the anchor if present in the location.See \helpref{wxFSFile}{wxfsfilegetanchor} for details.Example: GetAnchor("index.htm\#chapter2") == "chapter2"{\bf Note:} the anchor is NOT part of the left location.\membersection{wxFileSystemHandler::GetLeftLocation}\label{wxfilesystemhandlergetleftlocation}\constfunc{wxString}{GetLeftLocation}{\param{const wxString\& }{location}}Returns the left location string extracted from {\it location}. Example: GetLeftLocation("file:myzipfile.zip\#zip:index.htm") == "file:myzipfile.zip"\membersection{wxFileSystemHandler::GetMimeTypeFromExt}\label{wxfilesystemhandlergetmimetypefromext}\func{wxString}{GetMimeTypeFromExt}{\param{const wxString\& }{location}}Returns the MIME type based on {\bf extension} of {\it location}. (While wxFSFile::GetMimeTypereturns real MIME type - either extension-based or queried from HTTP.)Example : GetMimeTypeFromExt("index.htm") == "text/html"\membersection{wxFileSystemHandler::GetProtocol}\label{wxfilesystemhandlergetprotocol}\constfunc{wxString}{GetProtocol}{\param{const wxString\& }{location}}Returns the protocol string extracted from {\it location}. Example: GetProtocol("file:myzipfile.zip\#zip:index.htm") == "zip"\membersection{wxFileSystemHandler::GetRightLocation}\label{wxfilesystemhandlergetrightlocation}\constfunc{wxString}{GetRightLocation}{\param{const wxString\& }{location}}Returns the right location string extracted from {\it location}. Example : GetRightLocation("file:myzipfile.zip\#zip:index.htm") == "index.htm"\membersection{wxFileSystemHandler::FindFirst}\label{wxfilesystemhandlerfindfirst}\func{virtual wxString}{FindFirst}{\param{const wxString\& }{wildcard}, \param{int }{flags = 0}}Works like \helpref{wxFindFirstFile}{wxfindfirstfile}. Returns name of the firstfilename (within filesystem's current path) that matches {\it wildcard}. {\it flags} may be one ofwxFILE (only files), wxDIR (only directories) or 0 (both).This method is only called if \helpref{CanOpen}{wxfilesystemhandlercanopen} returns true.\membersection{wxFileSystemHandler::FindNext}\label{wxfilesystemhandlerfindnext}\func{virtual wxString}{FindNext}{\void}Returns next filename that matches parameters passed to \helpref{FindFirst}{wxfilesystemfindfirst}.This method is only called if \helpref{CanOpen}{wxfilesystemhandlercanopen} returns true and FindFirstreturned a non-empty string.\membersection{wxFileSystemHandler::OpenFile}\label{wxfilesystemhandleropenfile}\func{virtual wxFSFile*}{OpenFile}{\param{wxFileSystem\& }{fs}, \param{const wxString\& }{location}}Opens the file and returns wxFSFile pointer or NULL if failed.Must be overridden in derived handlers.\wxheading{Parameters}\docparam{fs}{Parent FS (the FS from that OpenFile was called). See ZIP handlerfor details of how to use it.}\docparam{location}{The {\bf absolute} location of file.}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -