2 % automatically generated by HelpGen from
3 % fsfile.tex at 21/Mar/99 23:00:52
6 \section{\class{wxFSFile
}}\label{wxfsfile
}
8 This class represents a single file opened by
\helpref{wxFileSystem
}{wxfilesystem
}.
9 It provides more information than wxWindow's input stream
10 (stream, filename, mime type, anchor).
12 {\bf Note:
} Any pointer returned by a method of wxFSFile is valid
13 only as long as the wxFSFile object exists. For example a call to GetStream()
14 doesn't
{\it create
} the stream but only returns the pointer to it. In
15 other words after
10 calls to GetStream() you will have obtained ten identical
18 \wxheading{Derived from
}
20 \helpref{wxObject
}{wxobject
}
22 \wxheading{Include files
}
28 \helpref{wxFileSystemHandler
}{wxfilesystemhandler
},
29 \helpref{wxFileSystem
}{wxfilesystem
},
30 \helpref{Overview
}{fs
}
32 \latexignore{\rtfignore{\wxheading{Members
}}}
34 \membersection{wxFSFile::wxFSFile
}\label{wxfsfilewxfsfile
}
36 \func{}{wxFSFile
}{\param{wxInputStream
}{*stream
},
\param{const wxString\&
}{loc
},
\param{const wxString\&
}{mimetype
},
\param{const wxString\&
}{anchor
},
\param{wxDateTime
}{modif
}}
38 Constructor. You probably won't use it. See Notes for details.
40 \wxheading{Parameters
}
42 \docparam{stream
}{The input stream that will be used to access data
}
44 \docparam{location
}{The full location (aka filename) of the file
}
46 \docparam{mimetype
}{MIME type of this file. It may be left empty, in which
47 case the type will be determined from file's extension (
\arg{location
} must
48 not be empty in this case).
}
50 \docparam{anchor
}{Anchor. See
\helpref{GetAnchor()
}{wxfsfilegetanchor
} for details.
}
52 If you are not sure of the meaning of these params, see the description of the GetXXXX()
57 It is seldom used by the application programmer but you will need it if
58 you are writing your own virtual FS. For example you may need something
59 similar to wxMemoryInputStream, but because wxMemoryInputStream
60 doesn't free the memory when destroyed and thus passing a memory stream
61 pointer into wxFSFile constructor would lead to memory leaks, you
62 can write your own class derived from wxFSFile:
65 class wxMyFSFile : public wxFSFile
71 ~wxMyFSFile()
{free(m_Mem);
}
72 // of course dtor is virtual ;-)
76 \membersection{wxFSFile::DetachStream
}\label{wxfsfiledetachstream
}
78 \func{void
}{DetachStream
}{\void}
80 Detaches the stream from the wxFSFile object. That is, the
81 stream obtained with
{\tt GetStream()
} will continue its existance
82 after the wxFSFile object is deleted. You will have to delete
85 \membersection{wxFSFile::GetAnchor
}\label{wxfsfilegetanchor
}
87 \constfunc{const wxString\&
}{GetAnchor
}{\void}
89 Returns anchor (if present). The term of
{\bf anchor
} can be easily
90 explained using few examples:
93 index.htm#anchor /* 'anchor' is anchor */
94 index/wx001.htm /* NO anchor here! */
95 archive/main.zip#zip:index.htm#global /* 'global' */
96 archive/main.zip#zip:index.htm /* NO anchor here! */
99 Usually an anchor is presented only if the MIME type is 'text/html'.
100 But it may have some meaning with other files;
101 for example myanim.avi\
#200 may refer to position in animation
102 or reality.wrl\#MyView may refer to a predefined view in VRML.
104 \membersection{wxFSFile::GetLocation
}\label{wxfsfilegetlocation
}
106 \constfunc{const wxString\&
}{GetLocation
}{\void}
108 Returns full location of the file, including path and protocol.
112 http://www.wxwidgets.org
113 http://www.ms.mff.cuni.cz/~vsla8348/wxhtml/archive.zip#zip:info.txt
114 file:/home/vasek/index.htm
118 \membersection{wxFSFile::GetMimeType
}\label{wxfsfilegetmimetype
}
120 \constfunc{const wxString\&
}{GetMimeType
}{\void}
122 Returns the MIME type of the content of this file. It is either
123 extension-based (see wxMimeTypesManager) or extracted from
124 HTTP protocol Content-Type header.
126 \membersection{wxFSFile::GetModificationTime
}\label{wxfsfilegetmodificationtime
}
128 \constfunc{wxDateTime
}{GetModificationTime
}{\void}
130 Returns time when this file was modified.
132 \membersection{wxFSFile::GetStream
}\label{wxfsfilegetstream
}
134 \constfunc{wxInputStream*
}{GetStream
}{\void}
136 Returns pointer to the stream. You can use the returned
137 stream to directly access data. You may suppose
138 that the stream provide Seek and GetSize functionality
139 (even in the case of the HTTP protocol which doesn't provide
140 this by default. wxHtml uses local cache to work around
141 this and to speed up the connection).