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