]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/fsfile.tex
added missing \wxheading{Parameters}
[wxWidgets.git] / docs / latex / wx / fsfile.tex
... / ...
CommitLineData
1%
2% automatically generated by HelpGen from
3% fsfile.tex at 21/Mar/99 23:00:52
4%
5
6\section{\class{wxFSFile}}\label{wxfsfile}
7
8This class represents a single file opened by \helpref{wxFileSystem}{wxfilesystem}.
9It provides more information than wxWindow's input stream
10(stream, filename, mime type, anchor).
11
12{\bf Note:} Any pointer returned by a method of wxFSFile is valid
13only as long as the wxFSFile object exists. For example a 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 will have obtained ten identical
16pointers.
17
18\wxheading{Derived from}
19
20\helpref{wxObject}{wxobject}
21
22\wxheading{Include files}
23
24<wx/filesys.h>
25
26\wxheading{Library}
27
28\helpref{wxBase}{librarieslist}
29
30\wxheading{See Also}
31
32\helpref{wxFileSystemHandler}{wxfilesystemhandler},
33\helpref{wxFileSystem}{wxfilesystem},
34\helpref{Overview}{fs}
35
36\latexignore{\rtfignore{\wxheading{Members}}}
37
38\membersection{wxFSFile::wxFSFile}\label{wxfsfilewxfsfile}
39
40\func{}{wxFSFile}{\param{wxInputStream }{*stream}, \param{const wxString\& }{loc}, \param{const wxString\& }{mimetype}, \param{const wxString\& }{anchor}, \param{wxDateTime }{modif}}
41
42Constructor. You probably won't use it. See Notes for details.
43
44\wxheading{Parameters}
45
46\docparam{stream}{The input stream that will be used to access data}
47
48\docparam{location}{The full location (aka filename) of the file}
49
50\docparam{mimetype}{MIME type of this file. It may be left empty, in which
51case the type will be determined from file's extension (\arg{location} must
52not be empty in this case).}
53
54\docparam{anchor}{Anchor. See \helpref{GetAnchor()}{wxfsfilegetanchor} for details.}
55
56If you are not sure of the meaning of these params, see the description of the GetXXXX()
57functions.
58
59\wxheading{Notes}
60
61It is seldom used by the application programmer but you will need it if
62you are writing your own virtual FS. For example you may need something
63similar to wxMemoryInputStream, but because wxMemoryInputStream
64doesn't free the memory when destroyed and thus passing a memory stream
65pointer into wxFSFile constructor would lead to memory leaks, you
66can write your own class derived from wxFSFile:
67
68\begin{verbatim}
69class wxMyFSFile : public wxFSFile
70{
71 private:
72 void *m_Mem;
73 public:
74 wxMyFSFile(.....)
75 ~wxMyFSFile() {free(m_Mem);}
76 // of course dtor is virtual ;-)
77};
78\end{verbatim}
79
80\membersection{wxFSFile::DetachStream}\label{wxfsfiledetachstream}
81
82\func{void}{DetachStream}{\void}
83
84Detaches the stream from the wxFSFile object. That is, the
85stream obtained with {\tt GetStream()} will continue its existance
86after the wxFSFile object is deleted. You will have to delete
87the stream yourself.
88
89\membersection{wxFSFile::GetAnchor}\label{wxfsfilegetanchor}
90
91\constfunc{const wxString\&}{GetAnchor}{\void}
92
93Returns anchor (if present). The term of {\bf anchor} can be easily
94explained using few examples:
95
96\begin{verbatim}
97index.htm#anchor /* 'anchor' is anchor */
98index/wx001.htm /* NO anchor here! */
99archive/main.zip#zip:index.htm#global /* 'global' */
100archive/main.zip#zip:index.htm /* NO anchor here! */
101\end{verbatim}
102
103Usually an anchor is presented only if the MIME type is 'text/html'.
104But it may have some meaning with other files;
105for example myanim.avi\#200 may refer to position in animation
106or reality.wrl\#MyView may refer to a predefined view in VRML.
107
108\membersection{wxFSFile::GetLocation}\label{wxfsfilegetlocation}
109
110\constfunc{const wxString\&}{GetLocation}{\void}
111
112Returns full location of the file, including path and protocol.
113Examples :
114
115\begin{verbatim}
116http://www.wxwidgets.org
117http://www.ms.mff.cuni.cz/~vsla8348/wxhtml/archive.zip#zip:info.txt
118file:/home/vasek/index.htm
119relative-file.htm
120\end{verbatim}
121
122\membersection{wxFSFile::GetMimeType}\label{wxfsfilegetmimetype}
123
124\constfunc{const wxString\&}{GetMimeType}{\void}
125
126Returns the MIME type of the content of this file. It is either
127extension-based (see wxMimeTypesManager) or extracted from
128HTTP protocol Content-Type header.
129
130\membersection{wxFSFile::GetModificationTime}\label{wxfsfilegetmodificationtime}
131
132\constfunc{wxDateTime}{GetModificationTime}{\void}
133
134Returns time when this file was modified.
135
136\membersection{wxFSFile::GetStream}\label{wxfsfilegetstream}
137
138\constfunc{wxInputStream*}{GetStream}{\void}
139
140Returns pointer to the stream. You can use the returned
141stream to directly access data. You may suppose
142that the stream provide Seek and GetSize functionality
143(even in the case of the HTTP protocol which doesn't provide
144this by default. wxHtml uses local cache to work around
145this and to speed up the connection).
146