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