]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/fsfile.tex
SetFonts methods have const param now
[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 single file opened by \helpref{wxFileSystem}{wxfilesystem}.
9 It provides more information than wx'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::GetStream}\label{wxfsfilegetstream}
71
72 \constfunc{wxInputStream*}{GetStream}{\void}
73
74 Returns pointer to the stream. You can use the returned
75 stream to directly access data. You may suppose
76 that the stream provide Seek and GetSize functionality
77 (even in case of HTTP protocol which doesn't provide
78 this by default. wxHtml is using local cache to workaround
79 this and to speed up connection)
80
81 \membersection{wxFSFile::GetMimeType}\label{wxfsfilegetmimetype}
82
83 \constfunc{const wxString\&}{GetMimeType}{\void}
84
85 Returns MIME type of the content of this file. It is either
86 extension-based (see wxMimeTypesManager) or extracted from
87 HTTP protocol Content-Type header.
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::GetAnchor}\label{wxfsfilegetanchor}
104
105 \constfunc{const wxString\&}{GetAnchor}{\void}
106
107 Returns anchor (if present). The term of {\bf anchor} can be easily
108 explained using few examples:
109
110 \begin{verbatim}
111 index.htm#anchor /* 'anchor' is anchor */
112 index/wx001.htm /* NO anchor here! */
113 archive/main.zip#zip:index.htm#global /* 'global' */
114 archive/main.zip#zip:index.htm /* NO anchor here! */
115 \end{verbatim}
116
117 Usually anchor is presented only if mime type is 'text/html'.
118 But it may have some meaning with other files
119 (for example myanim.avi\#200 may refer to position in animation
120 or reality.wrl\#MyView may refer to predefined view in VRML)
121