2 % automatically generated by HelpGen from
3 % filesystem.tex at 21/Mar/99 23:00:52
6 \section{\class{wxFileSystem
}}\label{wxfilesystem
}
8 This class provides an interface for opening files on different
9 file systems. It can handle absolute and/or local filenames.
10 It uses a system of
\helpref{handlers
}{wxfilesystemhandler
} to
11 provide access to user-defined virtual file systems.
13 \wxheading{Derived from
}
15 \helpref{wxObject
}{wxobject
}
17 \wxheading{Include files
}
23 \helpref{wxFileSystemHandler
}{wxfilesystemhandler
},
24 \helpref{wxFSFile
}{wxfsfile
},
25 \helpref{Overview
}{fs
}
27 \latexignore{\rtfignore{\wxheading{Members
}}}
30 \membersection{wxFileSystem::wxFileSystem
}\label{wxfilesystemwxfilesystem
}
32 \func{}{wxFileSystem
}{\void}
37 \membersection{wxFileSystem::AddHandler
}\label{wxfilesystemaddhandler
}
39 \func{static void
}{AddHandler
}{\param{wxFileSystemHandler
}{*handler
}}
41 This static function adds new handler into the list of handlers.
42 The
\helpref{handlers
}{wxfilesystemhandler
} provide access to virtual FS.
49 wxFileSystem::AddHandler(new My_FS_Handler);
52 This is because (a) AddHandler is a static method, and (b) the handlers
53 are deleted in wxFileSystem's destructor so that you don't have to
57 \membersection{wxFileSystem::ChangePathTo
}\label{wxfilesystemchangepathto
}
59 \func{void
}{ChangePathTo
}{\param{const wxString\&
}{location
},
\param{bool
}{is
\_dir = false
}}
61 Sets the current location.
{\it location
} parameter passed to
62 \helpref{OpenFile
}{wxfilesystemopenfile
} is relative to this path.
64 {\bf Caution!
} Unless
{\it is
\_dir} is true the
{\it location
} parameter
65 is not the directory name but the name of the file in this directory. All these
66 commands change the path to "dir/subdir/":
69 ChangePathTo("dir/subdir/xh.htm");
70 ChangePathTo("dir/subdir", true);
71 ChangePathTo("dir/subdir/", true);
74 \wxheading{Parameters
}
76 \docparam{location
}{the new location. Its meaning depends on the value of
{\it is
\_dir}}
78 \docparam{is
\_dir}{if true
{\it location
} is new directory. If false (default)
79 {\it location
} is
{\bf file in
} the new directory.
}
84 f = fs -> OpenFile("hello.htm"); // opens file 'hello.htm'
85 fs -> ChangePathTo("subdir/folder", true);
86 f = fs -> OpenFile("hello.htm"); // opens file 'subdir/folder/hello.htm' !!
90 \membersection{wxFileSystem::GetPath
}\label{wxfilesystemgetpath
}
92 \func{wxString
}{GetPath
}{\void}
94 Returns actual path (set by
\helpref{ChangePathTo
}{wxfilesystemchangepathto
}).
97 \membersection{wxFileSystem::FileNameToURL
}\label{wxfilesystemfilenametourl
}
99 \func{static wxString
}{FileNameToURL
}{\param{wxFileName
}{filename
}}
101 Converts filename into URL.
105 \helpref{wxFileSystem::URLToFileName
}{wxfilesystemurltofilename
},
106 \helpref{wxFileName
}{wxfilename
}
109 \membersection{wxFileSystem::FindFileInPath
}\label{wxfilesystemfindfileinpath
}
111 \func{bool
}{FindFileInPath
}{\param{wxString
}{*str
},
\param{const wxChar
}{*path
},
\param{const wxChar
}{*file
}}
113 Looks for the file with the given name
\arg{file
} in a colon or semi-colon
114 (depending on the current platform) separated list of directories in
115 \arg{path
}. If the file is found in any directory, returns
\true and the full
116 path of the file in
\arg{str
}, otherwise returns
\false and doesn't modify
119 \wxheading{Parameters
}
121 \docparam{str
}{Receives the full path of the file, must not be
\NULL}
123 \docparam{path
}{\texttt{wxPATH
\_SEP}-separated list of directories
}
125 \docparam{file
}{the name of the file to look for
}
128 \membersection{wxFileSystem::FindFirst
}\label{wxfilesystemfindfirst
}
130 \func{wxString
}{FindFirst
}{\param{const wxString\&
}{wildcard
},
\param{int
}{flags =
0}}
132 Works like
\helpref{wxFindFirstFile
}{wxfindfirstfile
}. Returns name of the first
133 filename (within filesystem's current path) that matches
{\it wildcard
}.
{\it flags
} may be one of
134 wxFILE (only files), wxDIR (only directories) or
0 (both).
137 \membersection{wxFileSystem::FindNext
}\label{wxfilesystemfindnext
}
139 \func{wxString
}{FindNext
}{\void}
141 Returns the next filename that matches parameters passed to
\helpref{FindFirst
}{wxfilesystemfindfirst
}.
144 \membersection{wxFileSystem::OpenFile
}\label{wxfilesystemopenfile
}
146 \func{wxFSFile*
}{OpenFile
}{\param{const wxString\&
}{location
}}
148 Opens the file and returns a pointer to a
\helpref{wxFSFile
}{wxfsfile
} object
149 or NULL if failed. It first tries to open the file in relative scope
150 (based on value passed to ChangePathTo() method) and then as an
151 absolute path. Note that the user is responsible for deleting the returned
155 \membersection{wxFileSystem::URLToFileName
}\label{wxfilesystemurltofilename
}
157 \func{static wxFileName
}{URLToFileName
}{\param{const wxString\&
}{url
}}
159 Converts URL into a well-formed filename. The URL must use the
{\tt file
}
164 \helpref{wxFileSystem::FileNameToURL
}{wxfilesystemfilenametourl
},
165 \helpref{wxFileName
}{wxfilename
}