]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/fsfile.tex
wxLog::FlushActive added
[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
8This class represents single file opened by \helpref{wxFileSystem}{wxfilesystem}.
9It provides more information than wx's input stream
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
70\membersection{wxFSFile::GetStream}\label{wxfsfilegetstream}
71
72\constfunc{wxInputStream*}{GetStream}{\void}
73
74Returns pointer to the stream. You can use the returned
75stream to directly access data. You may suppose
76that the stream provide Seek and GetSize functionality
77(even in case of HTTP protocol which doesn't provide
78this by default. wxHtml is using local cache to workaround
79this and to speed up connection)
80
81\membersection{wxFSFile::GetMimeType}\label{wxfsfilegetmimetype}
82
83\constfunc{const wxString\&}{GetMimeType}{\void}
84
85Returns MIME type of the content of this file. It is either
86extension-based (see wxMimeTypesManager) or extracted from
87HTTP protocol Content-Type header.
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
11b63f34
VS
103\membersection{wxFSFile::GetAnchor}\label{wxfsfilegetanchor}
104
105\constfunc{const wxString\&}{GetAnchor}{\void}
106
107Returns anchor (if present). The term of {\bf anchor} can be easily
108explained using few examples:
109
110\begin{verbatim}
111index.htm#anchor /* 'anchor' is anchor */
112index/wx001.htm /* NO anchor here! */
113archive/main.zip#zip:index.htm#global /* 'global' */
114archive/main.zip#zip:index.htm /* NO anchor here! */
115\end{verbatim}
116
117Usually anchor is presented only if mime type is 'text/html'.
118But it may have some meaning with other files
119(for example myanim.avi\#200 may refer to position in animation
120or reality.wrl\#MyView may refer to predefined view in VRML)
22d6efa8 121