8daf3c3664
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
85 lines
2.6 KiB
TeX
85 lines
2.6 KiB
TeX
\section{\class{wxPathList}}\label{wxpathlist}
|
|
|
|
The path list is a convenient way of storing a number of directories, and
|
|
when presented with a filename without a directory, searching for an existing file
|
|
in those directories. Storing the filename only in an application's files and
|
|
using a locally-defined list of directories makes the application and its files more
|
|
portable.
|
|
|
|
Use the \helpref{wxFileName::SplitPath}{wxfilenamesplitpath} global function
|
|
to extract the filename from the path.
|
|
|
|
\wxheading{Derived from}
|
|
|
|
\helpref{wxArrayString}{wxarraystring}
|
|
|
|
\wxheading{Include files}
|
|
|
|
<wx/filefn.h>
|
|
|
|
\wxheading{See also}
|
|
|
|
\helpref{wxArrayString}{wxarraystring}
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
\membersection{wxPathList::wxPathList}\label{wxpathlistctor}
|
|
|
|
\func{}{wxPathList}{\void}
|
|
|
|
Empty constructor.
|
|
|
|
\func{}{wxPathList}{\param{const wxArrayString\& }{arr}}
|
|
|
|
Constructs the object calling the \helpref{Add}{wxpathlistadd} function.
|
|
|
|
|
|
\membersection{wxPathList::AddEnvList}\label{wxpathlistaddenvlist}
|
|
|
|
\func{void}{AddEnvList}{\param{const wxString\& }{env\_variable}}
|
|
|
|
Finds the value of the given environment variable, and adds all paths
|
|
to the path list. Useful for finding files in the PATH variable, for
|
|
example.
|
|
|
|
|
|
\membersection{wxPathList::Add}\label{wxpathlistadd}
|
|
|
|
\func{void}{Add}{\param{const wxString\& }{path}}
|
|
|
|
\func{void}{Add}{\param{const wxArrayString\& }{arr}}
|
|
|
|
The first form adds the given directory (the filename if present is removed)
|
|
to the path list, if the path is not already in the list.
|
|
|
|
The second form just calls the first form on all elements of the given array.
|
|
|
|
|
|
\membersection{wxPathList::EnsureFileAccessible}\label{wxpathlistensurefileaccessible}
|
|
|
|
\func{void}{EnsureFileAccessible}{\param{const wxString\& }{filename}}
|
|
|
|
Given a full filename (with path), ensures that files in the same path
|
|
can be accessed using the pathlist. It does this by stripping the
|
|
filename and adding the path to the list if not already there.
|
|
|
|
|
|
\membersection{wxPathList::FindAbsoluteValidPath}\label{wxpathlistfindabsolutepath}
|
|
|
|
\constfunc{wxString}{FindAbsoluteValidPath}{\param{const wxString\& }{file}}
|
|
|
|
Searches for a full path for an existing file by appending {\it file} to
|
|
successive members of the path list. If the file wasn't found, an empty
|
|
string is returned.
|
|
|
|
|
|
\membersection{wxPathList::FindValidPath}\label{wxpathlistfindvalidpath}
|
|
|
|
\constfunc{wxString}{FindValidPath}{\param{const wxString\& }{file}}
|
|
|
|
Searches for a full path for an existing file by appending {\it file} to
|
|
successive members of the path list. If the file wasn't found, an empty string
|
|
is returned. This path may be relative to the current working directory.
|
|
|