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