]>
Commit | Line | Data |
---|---|---|
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 | 8 | This class provides an interface for opening files on different |
704a4b75 | 9 | file systems. It can handle absolute and/or local filenames. |
36edded9 | 10 | It uses a system of \helpref{handlers}{wxfilesystemhandler} to |
704a4b75 VS |
11 | provide 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 | ||
33 | Constructor. | |
34 | ||
559fe022 VS |
35 | \membersection{wxFileSystem::AddHandler}\label{wxfilesystemaddhandler} |
36 | ||
37 | \func{static void}{AddHandler}{\param{wxFileSystemHandler }{*handler}} | |
38 | ||
39 | This static function adds new handler into the list of handlers. | |
40 | The \helpref{handlers}{wxfilesystemhandler} provide access to virtual FS. | |
41 | ||
42 | \wxheading{Note} | |
43 | ||
44 | You can call: | |
45 | ||
46 | \begin{verbatim} | |
47 | wxFileSystem::AddHandler(new My_FS_Handler); | |
48 | \end{verbatim} | |
49 | ||
50 | This is because (a) AddHandler is a static method, and (b) the handlers | |
51 | are deleted in wxFileSystem's destructor so that you don't have to | |
52 | care about it. | |
53 | ||
704a4b75 VS |
54 | \membersection{wxFileSystem::ChangePathTo}\label{wxfilesystemchangepathto} |
55 | ||
cc81d32f | 56 | \func{void}{ChangePathTo}{\param{const wxString\& }{location}, \param{bool }{is\_dir = false}} |
704a4b75 VS |
57 | |
58 | Sets the current location. {\it location} parameter passed to | |
59 | \helpref{OpenFile}{wxfilesystemopenfile} is relative to this path. | |
60 | ||
cc81d32f | 61 | {\bf Caution! } Unless {\it is\_dir} is true the {\it location} parameter |
ba7fe276 JS |
62 | is not the directory name but the name of the file in this directory. All these |
63 | commands change the path to "dir/subdir/": | |
704a4b75 VS |
64 | |
65 | \begin{verbatim} | |
ba7fe276 | 66 | ChangePathTo("dir/subdir/xh.htm"); |
cc81d32f VS |
67 | ChangePathTo("dir/subdir", true); |
68 | C hangePathTo("dir/subdir/", true); | |
704a4b75 VS |
69 | \end{verbatim} |
70 | ||
71 | \wxheading{Parameters} | |
72 | ||
ba7fe276 | 73 | \docparam{location}{the new location. Its meaning depends on the value of {\it is\_dir}} |
704a4b75 | 74 | |
cc81d32f | 75 | \docparam{is\_dir}{if true {\it location} is new directory. If false (default) |
704a4b75 VS |
76 | {\it location} is {\bf file in} the new directory.} |
77 | ||
78 | \wxheading{Example} | |
79 | ||
80 | \begin{verbatim} | |
ba7fe276 | 81 | f = fs -> OpenFile("hello.htm"); // opens file 'hello.htm' |
cc81d32f | 82 | fs -> ChangePathTo("subdir/folder", true); |
ba7fe276 | 83 | f = fs -> OpenFile("hello.htm"); // opens file 'subdir/folder/hello.htm' !! |
704a4b75 VS |
84 | \end{verbatim} |
85 | ||
704a4b75 VS |
86 | \membersection{wxFileSystem::GetPath}\label{wxfilesystemgetpath} |
87 | ||
88 | \func{wxString}{GetPath}{\void} | |
89 | ||
90 | Returns actual path (set by \helpref{ChangePathTo}{wxfilesystemchangepathto}). | |
91 | ||
4d144d07 VS |
92 | \membersection{wxFileSystem::FileNameToURL}\label{wxfilesystemfilenametourl} |
93 | ||
94 | \func{static wxString}{FileNameToURL}{\param{wxFileName }{filename}} | |
95 | ||
96 | Converts filename into URL. | |
97 | ||
98 | \wxheading{See also} | |
99 | ||
100 | \helpref{wxFileSystem::URLToFileName}{wxfilesystemurltofilename}, | |
101 | \helpref{wxFileName}{wxfilename} | |
aaa66113 VS |
102 | |
103 | \membersection{wxFileSystem::FindFirst}\label{wxfilesystemfindfirst} | |
104 | ||
105 | \func{wxString}{FindFirst}{\param{const wxString\& }{wildcard}, \param{int }{flags = 0}} | |
106 | ||
107 | Works like \helpref{wxFindFirstFile}{wxfindfirstfile}. Returns name of the first | |
2edb0bde | 108 | filename (within filesystem's current path) that matches {\it wildcard}. {\it flags} may be one of |
aaa66113 VS |
109 | wxFILE (only files), wxDIR (only directories) or 0 (both). |
110 | ||
111 | \membersection{wxFileSystem::FindNext}\label{wxfilesystemfindnext} | |
112 | ||
113 | \func{wxString}{FindNext}{\void} | |
114 | ||
ba7fe276 | 115 | Returns the next filename that matches parameters passed to \helpref{FindFirst}{wxfilesystemfindfirst}. |
aaa66113 | 116 | |
704a4b75 VS |
117 | \membersection{wxFileSystem::OpenFile}\label{wxfilesystemopenfile} |
118 | ||
119 | \func{wxFSFile*}{OpenFile}{\param{const wxString\& }{location}} | |
120 | ||
ba7fe276 | 121 | Opens the file and returns a pointer to a \helpref{wxFSFile}{wxfsfile} object |
704a4b75 VS |
122 | or NULL if failed. It first tries to open the file in relative scope |
123 | (based on value passed to ChangePathTo() method) and then as an | |
6ed8156e RN |
124 | absolute path. Note that the user is responsible for deleting the returned |
125 | wxFSFile. | |
704a4b75 | 126 | |
4d144d07 VS |
127 | \membersection{wxFileSystem::URLToFileName}\label{wxfilesystemurltofilename} |
128 | ||
bf43ff9a | 129 | \func{static wxFileName}{URLToFileName}{\param{const wxString\& }{url}} |
4d144d07 | 130 | |
ba7fe276 | 131 | Converts URL into a well-formed filename. The URL must use the {\tt file} |
4d144d07 VS |
132 | protocol. |
133 | ||
134 | \wxheading{See also} | |
135 | ||
ba7fe276 | 136 | \helpref{wxFileSystem::FileNameToURL}{wxfilesystemfilenametourl}, |
4d144d07 | 137 | \helpref{wxFileName}{wxfilename} |
ba7fe276 | 138 |