]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/fsfile.tex
Fixed crash-on-exit bug due to status bar being deleted twice (MDI apps);
[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
9704b250
VS
20\helpref{wxObject}{wxobject}
21
22\wxheading{Include files}
23
24<wx/filesys.h>
11b63f34
VS
25
26\wxheading{See Also}
27
28\helpref{wxFileSystemHandler}{wxfilesystemhandler},
29\helpref{wxFileSystem}{wxfilesystem},
30\helpref{Overview}{fs}
31
32\latexignore{\rtfignore{\wxheading{Members}}}
33
34\membersection{wxFSFile::wxFSFile}\label{wxfsfilewxfsfile}
35
36\func{}{wxFSFile}{\param{wxInputStream }{*stream}, \param{const wxString\& }{loc}, \param{const wxString\& }{mimetype}, \param{const wxString\& }{anchor}}
37
38Constructor. You probably won't use it. See Notes for details.
39
40\wxheading{Parameters}
41
42\docparam{stream}{The input stream that will be used to access data}
43
44\docparam{location}{The full location (aka filename) of the file}
45
46\docparam{mimetype}{MIME type of this file. Mime type is either extension-based or HTTP Content-Type}
47
48\docparam{anchor}{Anchor. See \helpref{GetAnchor()}{wxfsfilegetanchor} for details.}
49
50If you aren't sure what do these params mean see description of GetXXXX()
51functions.
52
53\wxheading{Notes}
54
55It is never used by end user but you'll need it if
56you're writing own virtual FS. For example you may need something
57similar to wxMemoryInputStream but because wxMemoryInputStream
58doesn't free the memory when destroyed and thus passing memory stream
59pointer into wxFSFile constructor would lead to memory leaks, you
60can write your own class derived from wxFSFile :
61
62\begin{verbatim}
63class wxMyFSFile : public wxFSFile
64{
65 private:
66 void *m_Mem;
67 public:
68 wxMyFSFile(.....)
69 ~wxMyFSFile() {free(m_Mem);}
70 // of course dtor is virtual ;-)
71};
72\end{verbatim}
73
559fe022 74\membersection{wxFSFile::GetAnchor}\label{wxfsfilegetanchor}
11b63f34 75
559fe022 76\constfunc{const wxString\&}{GetAnchor}{\void}
11b63f34 77
559fe022
VS
78Returns anchor (if present). The term of {\bf anchor} can be easily
79explained using few examples:
11b63f34 80
559fe022
VS
81\begin{verbatim}
82index.htm#anchor /* 'anchor' is anchor */
83index/wx001.htm /* NO anchor here! */
84archive/main.zip#zip:index.htm#global /* 'global' */
85archive/main.zip#zip:index.htm /* NO anchor here! */
86\end{verbatim}
11b63f34 87
559fe022
VS
88Usually anchor is presented only if mime type is 'text/html'.
89But it may have some meaning with other files
90(for example myanim.avi\#200 may refer to position in animation
91or reality.wrl\#MyView may refer to predefined view in VRML)
11b63f34
VS
92
93\membersection{wxFSFile::GetLocation}\label{wxfsfilegetlocation}
94
95\constfunc{const wxString\&}{GetLocation}{\void}
96
97Returns full location of the file, including path and protocol.
98Examples :
99
100\begin{verbatim}
101http://www.wxwindows.org
102http://www.ms.mff.cuni.cz/~vsla8348/wxhtml/archive.zip#zip:info.txt
103file:/home/vasek/index.htm
104relative-file.htm
105\end{verbatim}
106
559fe022 107\membersection{wxFSFile::GetMimeType}\label{wxfsfilegetmimetype}
11b63f34 108
559fe022 109\constfunc{const wxString\&}{GetMimeType}{\void}
11b63f34 110
559fe022
VS
111Returns MIME type of the content of this file. It is either
112extension-based (see wxMimeTypesManager) or extracted from
113HTTP protocol Content-Type header.
11b63f34 114
6ee654e6
VS
115\membersection{wxFSFile::GetModificationTime}\label{wxfsfilegetmodificationtime}
116
117\constfunc{wxDateTime}{GetModificationTime}{\void}
118
119Returns time when this file was modified.
120
559fe022 121\membersection{wxFSFile::GetStream}\label{wxfsfilegetstream}
11b63f34 122
559fe022
VS
123\constfunc{wxInputStream*}{GetStream}{\void}
124
125Returns pointer to the stream. You can use the returned
126stream to directly access data. You may suppose
127that the stream provide Seek and GetSize functionality
128(even in case of HTTP protocol which doesn't provide
129this by default. wxHtml is using local cache to workaround
130this and to speed up connection)
22d6efa8 131