]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/fsfile.tex
SetTitle method (internal use only) changed to virtual OnSetTitle, added GetOpenedPag...
[wxWidgets.git] / docs / latex / wx / fsfile.tex
CommitLineData
11b63f34
VS
1%
2% automatically generated by HelpGen from
3% fsfile.tex at 21/Mar/99 23:00:52
4%
5
11b63f34
VS
6\section{\class{wxFSFile}}\label{wxfsfile}
7
36edded9
JS
8This class represents a single file opened by \helpref{wxFileSystem}{wxfilesystem}.
9It provides more information than wxWindow's input stream
11b63f34
VS
10(stream, filename, mime type, anchor).
11
12{\bf Note:} Any pointer returned by wxFSFile's member is valid
13only as long as wxFSFile object exits. For example call to GetStream()
14doesn't {\it create} the stream but only returns the pointer to it. In
15other words after 10 calls to GetStream() you'll obtain ten identical
16pointers.
17
18\wxheading{Derived from}
19
20wxObject
21
22\wxheading{See Also}
23
24\helpref{wxFileSystemHandler}{wxfilesystemhandler},
25\helpref{wxFileSystem}{wxfilesystem},
26\helpref{Overview}{fs}
27
28\latexignore{\rtfignore{\wxheading{Members}}}
29
30\membersection{wxFSFile::wxFSFile}\label{wxfsfilewxfsfile}
31
32\func{}{wxFSFile}{\param{wxInputStream }{*stream}, \param{const wxString\& }{loc}, \param{const wxString\& }{mimetype}, \param{const wxString\& }{anchor}}
33
34Constructor. You probably won't use it. See Notes for details.
35
36\wxheading{Parameters}
37
38\docparam{stream}{The input stream that will be used to access data}
39
40\docparam{location}{The full location (aka filename) of the file}
41
42\docparam{mimetype}{MIME type of this file. Mime type is either extension-based or HTTP Content-Type}
43
44\docparam{anchor}{Anchor. See \helpref{GetAnchor()}{wxfsfilegetanchor} for details.}
45
46If you aren't sure what do these params mean see description of GetXXXX()
47functions.
48
49\wxheading{Notes}
50
51It is never used by end user but you'll need it if
52you're writing own virtual FS. For example you may need something
53similar to wxMemoryInputStream but because wxMemoryInputStream
54doesn't free the memory when destroyed and thus passing memory stream
55pointer into wxFSFile constructor would lead to memory leaks, you
56can write your own class derived from wxFSFile :
57
58\begin{verbatim}
59class wxMyFSFile : public wxFSFile
60{
61 private:
62 void *m_Mem;
63 public:
64 wxMyFSFile(.....)
65 ~wxMyFSFile() {free(m_Mem);}
66 // of course dtor is virtual ;-)
67};
68\end{verbatim}
69
559fe022 70\membersection{wxFSFile::GetAnchor}\label{wxfsfilegetanchor}
11b63f34 71
559fe022 72\constfunc{const wxString\&}{GetAnchor}{\void}
11b63f34 73
559fe022
VS
74Returns anchor (if present). The term of {\bf anchor} can be easily
75explained using few examples:
11b63f34 76
559fe022
VS
77\begin{verbatim}
78index.htm#anchor /* 'anchor' is anchor */
79index/wx001.htm /* NO anchor here! */
80archive/main.zip#zip:index.htm#global /* 'global' */
81archive/main.zip#zip:index.htm /* NO anchor here! */
82\end{verbatim}
11b63f34 83
559fe022
VS
84Usually anchor is presented only if mime type is 'text/html'.
85But it may have some meaning with other files
86(for example myanim.avi\#200 may refer to position in animation
87or reality.wrl\#MyView may refer to predefined view in VRML)
11b63f34
VS
88
89\membersection{wxFSFile::GetLocation}\label{wxfsfilegetlocation}
90
91\constfunc{const wxString\&}{GetLocation}{\void}
92
93Returns full location of the file, including path and protocol.
94Examples :
95
96\begin{verbatim}
97http://www.wxwindows.org
98http://www.ms.mff.cuni.cz/~vsla8348/wxhtml/archive.zip#zip:info.txt
99file:/home/vasek/index.htm
100relative-file.htm
101\end{verbatim}
102
559fe022 103\membersection{wxFSFile::GetMimeType}\label{wxfsfilegetmimetype}
11b63f34 104
559fe022 105\constfunc{const wxString\&}{GetMimeType}{\void}
11b63f34 106
559fe022
VS
107Returns MIME type of the content of this file. It is either
108extension-based (see wxMimeTypesManager) or extracted from
109HTTP protocol Content-Type header.
11b63f34 110
559fe022 111\membersection{wxFSFile::GetStream}\label{wxfsfilegetstream}
11b63f34 112
559fe022
VS
113\constfunc{wxInputStream*}{GetStream}{\void}
114
115Returns pointer to the stream. You can use the returned
116stream to directly access data. You may suppose
117that the stream provide Seek and GetSize functionality
118(even in case of HTTP protocol which doesn't provide
119this by default. wxHtml is using local cache to workaround
120this and to speed up connection)
22d6efa8 121