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