]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/fsfile.tex
added missing \wxheading{Parameters}
[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
2edb0bde
VZ
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()
11b63f34 14doesn't {\it create} the stream but only returns the pointer to it. In
fab86f26 15other words after 10 calls to GetStream() you will have obtained ten identical
11b63f34
VS
16pointers.
17
18\wxheading{Derived from}
19
9704b250
VS
20\helpref{wxObject}{wxobject}
21
22\wxheading{Include files}
23
24<wx/filesys.h>
11b63f34 25
a7af285d
VZ
26\wxheading{Library}
27
28\helpref{wxBase}{librarieslist}
29
11b63f34
VS
30\wxheading{See Also}
31
32\helpref{wxFileSystemHandler}{wxfilesystemhandler},
fa482912 33\helpref{wxFileSystem}{wxfilesystem},
11b63f34
VS
34\helpref{Overview}{fs}
35
36\latexignore{\rtfignore{\wxheading{Members}}}
37
38\membersection{wxFSFile::wxFSFile}\label{wxfsfilewxfsfile}
39
f6e9a818 40\func{}{wxFSFile}{\param{wxInputStream }{*stream}, \param{const wxString\& }{loc}, \param{const wxString\& }{mimetype}, \param{const wxString\& }{anchor}, \param{wxDateTime }{modif}}
11b63f34
VS
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
69cce151
VS
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).}
11b63f34
VS
53
54\docparam{anchor}{Anchor. See \helpref{GetAnchor()}{wxfsfilegetanchor} for details.}
55
fa482912 56If you are not sure of the meaning of these params, see the description of the GetXXXX()
11b63f34
VS
57functions.
58
59\wxheading{Notes}
60
f6bcfd97 61It is seldom used by the application programmer but you will need it if
fa482912
JS
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
11b63f34 65pointer into wxFSFile constructor would lead to memory leaks, you
fa482912 66can write your own class derived from wxFSFile:
11b63f34
VS
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
84d1cd43
RR
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
559fe022 89\membersection{wxFSFile::GetAnchor}\label{wxfsfilegetanchor}
11b63f34 90
559fe022 91\constfunc{const wxString\&}{GetAnchor}{\void}
11b63f34 92
559fe022
VS
93Returns anchor (if present). The term of {\bf anchor} can be easily
94explained using few examples:
11b63f34 95
559fe022
VS
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}
11b63f34 102
fa482912
JS
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.
11b63f34
VS
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}
fc2171bd 116http://www.wxwidgets.org
11b63f34
VS
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
559fe022 122\membersection{wxFSFile::GetMimeType}\label{wxfsfilegetmimetype}
11b63f34 123
559fe022 124\constfunc{const wxString\&}{GetMimeType}{\void}
11b63f34 125
fa482912 126Returns the MIME type of the content of this file. It is either
559fe022
VS
127extension-based (see wxMimeTypesManager) or extracted from
128HTTP protocol Content-Type header.
11b63f34 129
6ee654e6
VS
130\membersection{wxFSFile::GetModificationTime}\label{wxfsfilegetmodificationtime}
131
132\constfunc{wxDateTime}{GetModificationTime}{\void}
133
134Returns time when this file was modified.
135
559fe022 136\membersection{wxFSFile::GetStream}\label{wxfsfilegetstream}
11b63f34 137
559fe022
VS
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
fa482912
JS
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).
22d6efa8 146