1999-07-10 17:17:24 -04:00
|
|
|
%
|
|
|
|
% automatically generated by HelpGen from
|
|
|
|
% filesystem.tex at 21/Mar/99 23:00:52
|
|
|
|
%
|
|
|
|
|
|
|
|
\section{\class{wxFileSystem}}\label{wxfilesystem}
|
|
|
|
|
1999-11-01 15:36:43 -05:00
|
|
|
This class provides an interface for opening files on different
|
1999-07-10 17:17:24 -04:00
|
|
|
file systems. It can handle absolute and/or local filenames.
|
1999-11-01 15:36:43 -05:00
|
|
|
It uses a system of \helpref{handlers}{wxfilesystemhandler} to
|
1999-07-10 17:17:24 -04:00
|
|
|
provide access to user-defined virtual file systems.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
2000-02-27 16:06:58 -05:00
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/filesys.h>
|
1999-07-10 17:17:24 -04:00
|
|
|
|
|
|
|
\wxheading{See Also}
|
|
|
|
|
1999-11-01 15:36:43 -05:00
|
|
|
\helpref{wxFileSystemHandler}{wxfilesystemhandler},
|
|
|
|
\helpref{wxFSFile}{wxfsfile},
|
1999-07-10 17:17:24 -04:00
|
|
|
\helpref{Overview}{fs}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
\membersection{wxFileSystem::wxFileSystem}\label{wxfilesystemwxfilesystem}
|
|
|
|
|
|
|
|
\func{}{wxFileSystem}{\void}
|
|
|
|
|
|
|
|
Constructor.
|
|
|
|
|
1999-10-16 11:38:26 -04:00
|
|
|
\membersection{wxFileSystem::AddHandler}\label{wxfilesystemaddhandler}
|
|
|
|
|
|
|
|
\func{static void}{AddHandler}{\param{wxFileSystemHandler }{*handler}}
|
|
|
|
|
|
|
|
This static function adds new handler into the list of handlers.
|
|
|
|
The \helpref{handlers}{wxfilesystemhandler} provide access to virtual FS.
|
|
|
|
|
|
|
|
\wxheading{Note}
|
|
|
|
|
|
|
|
You can call:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
wxFileSystem::AddHandler(new My_FS_Handler);
|
|
|
|
\end{verbatim}
|
|
|
|
|
|
|
|
This is because (a) AddHandler is a static method, and (b) the handlers
|
|
|
|
are deleted in wxFileSystem's destructor so that you don't have to
|
|
|
|
care about it.
|
|
|
|
|
1999-07-10 17:17:24 -04:00
|
|
|
\membersection{wxFileSystem::ChangePathTo}\label{wxfilesystemchangepathto}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\func{void}{ChangePathTo}{\param{const wxString\& }{location}, \param{bool }{is\_dir = false}}
|
1999-07-10 17:17:24 -04:00
|
|
|
|
|
|
|
Sets the current location. {\it location} parameter passed to
|
|
|
|
\helpref{OpenFile}{wxfilesystemopenfile} is relative to this path.
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
{\bf Caution! } Unless {\it is\_dir} is true the {\it location} parameter
|
2002-12-17 17:22:19 -05:00
|
|
|
is not the directory name but the name of the file in this directory. All these
|
|
|
|
commands change the path to "dir/subdir/":
|
1999-07-10 17:17:24 -04:00
|
|
|
|
|
|
|
\begin{verbatim}
|
2002-12-17 17:22:19 -05:00
|
|
|
ChangePathTo("dir/subdir/xh.htm");
|
2003-01-17 19:16:34 -05:00
|
|
|
ChangePathTo("dir/subdir", true);
|
|
|
|
C hangePathTo("dir/subdir/", true);
|
1999-07-10 17:17:24 -04:00
|
|
|
\end{verbatim}
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
2002-12-17 17:22:19 -05:00
|
|
|
\docparam{location}{the new location. Its meaning depends on the value of {\it is\_dir}}
|
1999-07-10 17:17:24 -04:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\docparam{is\_dir}{if true {\it location} is new directory. If false (default)
|
1999-07-10 17:17:24 -04:00
|
|
|
{\it location} is {\bf file in} the new directory.}
|
|
|
|
|
|
|
|
\wxheading{Example}
|
|
|
|
|
|
|
|
\begin{verbatim}
|
2002-12-17 17:22:19 -05:00
|
|
|
f = fs -> OpenFile("hello.htm"); // opens file 'hello.htm'
|
2003-01-17 19:16:34 -05:00
|
|
|
fs -> ChangePathTo("subdir/folder", true);
|
2002-12-17 17:22:19 -05:00
|
|
|
f = fs -> OpenFile("hello.htm"); // opens file 'subdir/folder/hello.htm' !!
|
1999-07-10 17:17:24 -04:00
|
|
|
\end{verbatim}
|
|
|
|
|
|
|
|
\membersection{wxFileSystem::GetPath}\label{wxfilesystemgetpath}
|
|
|
|
|
|
|
|
\func{wxString}{GetPath}{\void}
|
|
|
|
|
|
|
|
Returns actual path (set by \helpref{ChangePathTo}{wxfilesystemchangepathto}).
|
|
|
|
|
2002-12-13 18:49:19 -05:00
|
|
|
\membersection{wxFileSystem::FileNameToURL}\label{wxfilesystemfilenametourl}
|
|
|
|
|
|
|
|
\func{static wxString}{FileNameToURL}{\param{wxFileName }{filename}}
|
|
|
|
|
|
|
|
Converts filename into URL.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxFileSystem::URLToFileName}{wxfilesystemurltofilename},
|
|
|
|
\helpref{wxFileName}{wxfilename}
|
1999-10-31 17:05:10 -05:00
|
|
|
|
|
|
|
\membersection{wxFileSystem::FindFirst}\label{wxfilesystemfindfirst}
|
|
|
|
|
|
|
|
\func{wxString}{FindFirst}{\param{const wxString\& }{wildcard}, \param{int }{flags = 0}}
|
|
|
|
|
|
|
|
Works like \helpref{wxFindFirstFile}{wxfindfirstfile}. Returns name of the first
|
2002-06-07 16:15:28 -04:00
|
|
|
filename (within filesystem's current path) that matches {\it wildcard}. {\it flags} may be one of
|
1999-10-31 17:05:10 -05:00
|
|
|
wxFILE (only files), wxDIR (only directories) or 0 (both).
|
|
|
|
|
|
|
|
\membersection{wxFileSystem::FindNext}\label{wxfilesystemfindnext}
|
|
|
|
|
|
|
|
\func{wxString}{FindNext}{\void}
|
|
|
|
|
2002-12-17 17:22:19 -05:00
|
|
|
Returns the next filename that matches parameters passed to \helpref{FindFirst}{wxfilesystemfindfirst}.
|
1999-10-31 17:05:10 -05:00
|
|
|
|
1999-07-10 17:17:24 -04:00
|
|
|
\membersection{wxFileSystem::OpenFile}\label{wxfilesystemopenfile}
|
|
|
|
|
|
|
|
\func{wxFSFile*}{OpenFile}{\param{const wxString\& }{location}}
|
|
|
|
|
2002-12-17 17:22:19 -05:00
|
|
|
Opens the file and returns a pointer to a \helpref{wxFSFile}{wxfsfile} object
|
1999-07-10 17:17:24 -04:00
|
|
|
or NULL if failed. It first tries to open the file in relative scope
|
|
|
|
(based on value passed to ChangePathTo() method) and then as an
|
|
|
|
absolute path.
|
|
|
|
|
2002-12-13 18:49:19 -05:00
|
|
|
\membersection{wxFileSystem::URLToFileName}\label{wxfilesystemurltofilename}
|
|
|
|
|
2003-06-22 18:20:40 -04:00
|
|
|
\func{static wxFileName}{URLToFileName}{\param{const wxString\& }{url}}
|
2002-12-13 18:49:19 -05:00
|
|
|
|
2002-12-17 17:22:19 -05:00
|
|
|
Converts URL into a well-formed filename. The URL must use the {\tt file}
|
2002-12-13 18:49:19 -05:00
|
|
|
protocol.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
2002-12-17 17:22:19 -05:00
|
|
|
\helpref{wxFileSystem::FileNameToURL}{wxfilesystemfilenametourl},
|
2002-12-13 18:49:19 -05:00
|
|
|
\helpref{wxFileName}{wxfilename}
|
2002-12-17 17:22:19 -05:00
|
|
|
|