📄 fsfile.tex
字号:
%% automatically generated by HelpGen from% fsfile.tex at 21/Mar/99 23:00:52%\section{\class{wxFSFile}}\label{wxfsfile}This class represents a single file opened by \helpref{wxFileSystem}{wxfilesystem}.It provides more information than wxWindow's input stream (stream, filename, mime type, anchor).{\bf Note:} Any pointer returned by a method of wxFSFile is validonly as long as the wxFSFile object exists. For example a call to GetStream()doesn't {\it create} the stream but only returns the pointer to it. Inother words after 10 calls to GetStream() you will obtain ten identicalpointers.\wxheading{Derived from}\helpref{wxObject}{wxobject}\wxheading{Include files}<wx/filesys.h>\wxheading{See Also}\helpref{wxFileSystemHandler}{wxfilesystemhandler}, \helpref{wxFileSystem}{wxfilesystem}, \helpref{Overview}{fs}\latexignore{\rtfignore{\wxheading{Members}}}\membersection{wxFSFile::wxFSFile}\label{wxfsfilewxfsfile}\func{}{wxFSFile}{\param{wxInputStream }{*stream}, \param{const wxString\& }{loc}, \param{const wxString\& }{mimetype}, \param{const wxString\& }{anchor}, \param{wxDateTime }{modif}}Constructor. You probably won't use it. See Notes for details.\wxheading{Parameters}\docparam{stream}{The input stream that will be used to access data}\docparam{location}{The full location (aka filename) of the file}\docparam{mimetype}{MIME type of this file. Mime type is either extension-based or HTTP Content-Type}\docparam{anchor}{Anchor. See \helpref{GetAnchor()}{wxfsfilegetanchor} for details.}If you are not sure of the meaning of these params, see the description of the GetXXXX()functions.\wxheading{Notes}It is seldom used by the application programmer but you will need it ifyou are writing your own virtual FS. For example you may need somethingsimilar to wxMemoryInputStream, but because wxMemoryInputStreamdoesn't free the memory when destroyed and thus passing a memory streampointer into wxFSFile constructor would lead to memory leaks, youcan write your own class derived from wxFSFile:\begin{verbatim}class wxMyFSFile : public wxFSFile{ private: void *m_Mem; public: wxMyFSFile(.....) ~wxMyFSFile() {free(m_Mem);} // of course dtor is virtual ;-)};\end{verbatim}\membersection{wxFSFile::DetachStream}\label{wxfsfiledetachstream}\func{void}{DetachStream}{\void}Detaches the stream from the wxFSFile object. That is, thestream obtained with {\tt GetStream()} will continue its existanceafter the wxFSFile object is deleted. You will have to deletethe stream yourself.\membersection{wxFSFile::GetAnchor}\label{wxfsfilegetanchor}\constfunc{const wxString\&}{GetAnchor}{\void}Returns anchor (if present). The term of {\bf anchor} can be easilyexplained using few examples:\begin{verbatim}index.htm#anchor /* 'anchor' is anchor */index/wx001.htm /* NO anchor here! */archive/main.zip#zip:index.htm#global /* 'global' */archive/main.zip#zip:index.htm /* NO anchor here! */\end{verbatim}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 animationor reality.wrl\#MyView may refer to a predefined view in VRML.\membersection{wxFSFile::GetLocation}\label{wxfsfilegetlocation}\constfunc{const wxString\&}{GetLocation}{\void}Returns full location of the file, including path and protocol. Examples : \begin{verbatim}http://www.wxwidgets.orghttp://www.ms.mff.cuni.cz/~vsla8348/wxhtml/archive.zip#zip:info.txtfile:/home/vasek/index.htmrelative-file.htm\end{verbatim}\membersection{wxFSFile::GetMimeType}\label{wxfsfilegetmimetype}\constfunc{const wxString\&}{GetMimeType}{\void}Returns the MIME type of the content of this file. It is eitherextension-based (see wxMimeTypesManager) or extracted fromHTTP protocol Content-Type header.\membersection{wxFSFile::GetModificationTime}\label{wxfsfilegetmodificationtime}\constfunc{wxDateTime}{GetModificationTime}{\void}Returns time when this file was modified.\membersection{wxFSFile::GetStream}\label{wxfsfilegetstream}\constfunc{wxInputStream*}{GetStream}{\void}Returns pointer to the stream. You can use the returnedstream to directly access data. You may supposethat the stream provide Seek and GetSize functionality(even in the case of the HTTP protocol which doesn't providethis by default. wxHtml uses local cache to work aroundthis and to speed up the connection).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -