]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/fsfile.tex
0085ae2a6240150647fc99c2acde650fa64f1b8b
[wxWidgets.git] / docs / latex / wx / fsfile.tex
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
8 This class represents a single file opened by \helpref{wxFileSystem}{wxfilesystem}.
9 It provides more information than wxWindow's input stream
10 (stream, filename, mime type, anchor).
11
12 {\bf Note:} Any pointer returned by wxFSFile's member is valid
13 only as long as wxFSFile object exits. For example call to GetStream()
14 doesn't {\it create} the stream but only returns the pointer to it. In
15 other words after 10 calls to GetStream() you'll obtain ten identical
16 pointers.
17
18 \wxheading{Derived from}
19
20 wxObject
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
34 Constructor. 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
46 If you aren't sure what do these params mean see description of GetXXXX()
47 functions.
48
49 \wxheading{Notes}
50
51 It is never used by end user but you'll need it if
52 you're writing own virtual FS. For example you may need something
53 similar to wxMemoryInputStream but because wxMemoryInputStream
54 doesn't free the memory when destroyed and thus passing memory stream
55 pointer into wxFSFile constructor would lead to memory leaks, you
56 can write your own class derived from wxFSFile :
57
58 \begin{verbatim}
59 class 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::GetAnchor}\label{wxfsfilegetanchor}
71
72 \constfunc{const wxString\&}{GetAnchor}{\void}
73
74 Returns anchor (if present). The term of {\bf anchor} can be easily
75 explained using few examples:
76
77 \begin{verbatim}
78 index.htm#anchor /* 'anchor' is anchor */
79 index/wx001.htm /* NO anchor here! */
80 archive/main.zip#zip:index.htm#global /* 'global' */
81 archive/main.zip#zip:index.htm /* NO anchor here! */
82 \end{verbatim}
83
84 Usually anchor is presented only if mime type is 'text/html'.
85 But it may have some meaning with other files
86 (for example myanim.avi\#200 may refer to position in animation
87 or reality.wrl\#MyView may refer to predefined view in VRML)
88
89 \membersection{wxFSFile::GetLocation}\label{wxfsfilegetlocation}
90
91 \constfunc{const wxString\&}{GetLocation}{\void}
92
93 Returns full location of the file, including path and protocol.
94 Examples :
95
96 \begin{verbatim}
97 http://www.wxwindows.org
98 http://www.ms.mff.cuni.cz/~vsla8348/wxhtml/archive.zip#zip:info.txt
99 file:/home/vasek/index.htm
100 relative-file.htm
101 \end{verbatim}
102
103 \membersection{wxFSFile::GetMimeType}\label{wxfsfilegetmimetype}
104
105 \constfunc{const wxString\&}{GetMimeType}{\void}
106
107 Returns MIME type of the content of this file. It is either
108 extension-based (see wxMimeTypesManager) or extracted from
109 HTTP protocol Content-Type header.
110
111 \membersection{wxFSFile::GetStream}\label{wxfsfilegetstream}
112
113 \constfunc{wxInputStream*}{GetStream}{\void}
114
115 Returns pointer to the stream. You can use the returned
116 stream to directly access data. You may suppose
117 that the stream provide Seek and GetSize functionality
118 (even in case of HTTP protocol which doesn't provide
119 this by default. wxHtml is using local cache to workaround
120 this and to speed up connection)
121