]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/filesys.tex
typo fixed
[wxWidgets.git] / docs / latex / wx / filesys.tex
CommitLineData
704a4b75
VS
1%
2% automatically generated by HelpGen from
3% filesystem.tex at 21/Mar/99 23:00:52
4%
5
704a4b75
VS
6\section{\class{wxFileSystem}}\label{wxfilesystem}
7
36edded9 8This class provides an interface for opening files on different
704a4b75 9file systems. It can handle absolute and/or local filenames.
36edded9 10It uses a system of \helpref{handlers}{wxfilesystemhandler} to
704a4b75
VS
11provide access to user-defined virtual file systems.
12
13\wxheading{Derived from}
14
9704b250
VS
15\helpref{wxObject}{wxobject}
16
17\wxheading{Include files}
18
19<wx/filesys.h>
704a4b75
VS
20
21\wxheading{See Also}
22
36edded9
JS
23\helpref{wxFileSystemHandler}{wxfilesystemhandler},
24\helpref{wxFSFile}{wxfsfile},
704a4b75
VS
25\helpref{Overview}{fs}
26
704a4b75
VS
27\latexignore{\rtfignore{\wxheading{Members}}}
28
704a4b75
VS
29\membersection{wxFileSystem::wxFileSystem}\label{wxfilesystemwxfilesystem}
30
31\func{}{wxFileSystem}{\void}
32
33Constructor.
34
559fe022
VS
35\membersection{wxFileSystem::AddHandler}\label{wxfilesystemaddhandler}
36
37\func{static void}{AddHandler}{\param{wxFileSystemHandler }{*handler}}
38
39This static function adds new handler into the list of handlers.
40The \helpref{handlers}{wxfilesystemhandler} provide access to virtual FS.
41
42\wxheading{Note}
43
44You can call:
45
46\begin{verbatim}
47wxFileSystem::AddHandler(new My_FS_Handler);
48\end{verbatim}
49
50This is because (a) AddHandler is a static method, and (b) the handlers
51are deleted in wxFileSystem's destructor so that you don't have to
52care about it.
53
704a4b75
VS
54\membersection{wxFileSystem::ChangePathTo}\label{wxfilesystemchangepathto}
55
56\func{void}{ChangePathTo}{\param{const wxString\& }{location}, \param{bool }{is\_dir = FALSE}}
57
58Sets the current location. {\it location} parameter passed to
59\helpref{OpenFile}{wxfilesystemopenfile} is relative to this path.
60
61{\bf Caution! } Unless {\it is\_dir} is TRUE the {\it location} parameter
62is not directory name but the name of the file in this directory!! All these
63commands change path to "dir/subdir/" :
64
65\begin{verbatim}
66ChangePathTo("dir/subdir/xh.htm");
67ChangePathTo("dir/subdir", TRUE);
68ChangePathTo("dir/subdir/", TRUE);
69\end{verbatim}
70
71\wxheading{Parameters}
72
73\docparam{location}{the new location. Its meaning depends on value of {\it is\_dir}}
74
75\docparam{is\_dir}{if TRUE {\it location} is new directory. If FALSE (default)
76{\it location} is {\bf file in} the new directory.}
77
78\wxheading{Example}
79
80\begin{verbatim}
81f = fs -> OpenFile("hello.htm"); // opens file 'hello.htm'
82fs -> ChangePathTo("subdir/folder", TRUE);
83f = fs -> OpenFile("hello.htm"); // opens file 'subdir/folder/hello.htm' !!
84\end{verbatim}
85
704a4b75
VS
86\membersection{wxFileSystem::GetPath}\label{wxfilesystemgetpath}
87
88\func{wxString}{GetPath}{\void}
89
90Returns actual path (set by \helpref{ChangePathTo}{wxfilesystemchangepathto}).
91
aaa66113
VS
92
93\membersection{wxFileSystem::FindFirst}\label{wxfilesystemfindfirst}
94
95\func{wxString}{FindFirst}{\param{const wxString\& }{wildcard}, \param{int }{flags = 0}}
96
97Works like \helpref{wxFindFirstFile}{wxfindfirstfile}. Returns name of the first
98filename (withing filesystem's current path) that matches {\it wildcard}. {\it flags} may be one of
99wxFILE (only files), wxDIR (only directories) or 0 (both).
100
101\membersection{wxFileSystem::FindNext}\label{wxfilesystemfindnext}
102
103\func{wxString}{FindNext}{\void}
104
105Returns next filename that matches parameters passed to \helpref{FindFirst}{wxfilesystemfindfirst}.
106
107
704a4b75
VS
108\membersection{wxFileSystem::OpenFile}\label{wxfilesystemopenfile}
109
110\func{wxFSFile*}{OpenFile}{\param{const wxString\& }{location}}
111
112Opens file and returns pointer to \helpref{wxFSFile}{wxfsfile} object
113or NULL if failed. It first tries to open the file in relative scope
114(based on value passed to ChangePathTo() method) and then as an
115absolute path.
116