]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxPathList}}\label{wxpathlist} |
2 | ||
3 | The path list is a convenient way of storing a number of directories, and | |
4 | when presented with a filename without a directory, searching for an existing file | |
5 | in those directories. Storing the filename only in an application's files and | |
6 | using a locally-defined list of directories makes the application and its files more | |
7 | portable. | |
8 | ||
9 | Use the {\it wxFileNameFromPath} global function to extract the filename | |
10 | from the path. | |
11 | ||
12 | \wxheading{Derived from} | |
13 | ||
14 | \helpref{wxList}{wxlist}\\ | |
15 | \helpref{wxObject}{wxobject} | |
16 | ||
954b8ae6 JS |
17 | \wxheading{Include files} |
18 | ||
19 | <wx/filefn.h> | |
20 | ||
a660d684 KB |
21 | \wxheading{See also} |
22 | ||
23 | \helpref{wxList}{wxlist} | |
24 | ||
25 | \latexignore{\rtfignore{\wxheading{Members}}} | |
26 | ||
4d01e350 | 27 | |
dcbd177f | 28 | \membersection{wxPathList::wxPathList}\label{wxpathlistctor} |
a660d684 KB |
29 | |
30 | \func{}{wxPathList}{\void} | |
31 | ||
32 | Constructor. | |
33 | ||
4d01e350 | 34 | |
dcbd177f | 35 | \membersection{wxPathList::AddEnvList}\label{wxpathlistaddenvlist} |
a660d684 KB |
36 | |
37 | \func{void}{AddEnvList}{\param{const wxString\& }{env\_variable}} | |
38 | ||
39 | Finds the value of the given environment variable, and adds all paths | |
40 | to the path list. Useful for finding files in the PATH variable, for | |
41 | example. | |
42 | ||
4d01e350 | 43 | |
dcbd177f | 44 | \membersection{wxPathList::Add}\label{wxpathlistadd} |
a660d684 KB |
45 | |
46 | \func{void}{Add}{\param{const wxString\& }{path}} | |
47 | ||
48 | Adds the given directory to the path list, but does not | |
4d01e350 VZ |
49 | check if the path was already on the list (use |
50 | \helpref{wxPathList::Member()}{wxpathlistmember} for this). | |
51 | ||
a660d684 | 52 | |
dcbd177f | 53 | \membersection{wxPathList::EnsureFileAccessible}\label{wxpathlistensurefileaccessible} |
a660d684 KB |
54 | |
55 | \func{void}{EnsureFileAccessible}{\param{const wxString\& }{filename}} | |
56 | ||
57 | Given a full filename (with path), ensures that files in the same path | |
58 | can be accessed using the pathlist. It does this by stripping the | |
59 | filename and adding the path to the list if not already there. | |
60 | ||
4d01e350 | 61 | |
dcbd177f | 62 | \membersection{wxPathList::FindAbsoluteValidPath}\label{wxpathlistfindabsolutepath} |
a660d684 KB |
63 | |
64 | \func{wxString}{FindAbsoluteValidPath}{\param{const wxString\& }{file}} | |
65 | ||
66 | Searches for a full path for an existing file by appending {\it file} to | |
4d01e350 VZ |
67 | successive members of the path list. If the file wasn't found, an empty |
68 | string is returned. | |
69 | ||
a660d684 | 70 | |
dcbd177f | 71 | \membersection{wxPathList::FindValidPath}\label{wxpathlistfindvalidpath} |
a660d684 KB |
72 | |
73 | \func{wxString}{FindValidPath}{\param{const wxString\& }{file}} | |
74 | ||
75 | Searches for a full path for an existing file by appending {\it file} to | |
4d01e350 VZ |
76 | successive members of the path list. If the file wasn't found, an empty string |
77 | is returned. This path may be relative to the current working directory. | |
78 | ||
a660d684 | 79 | |
4d01e350 | 80 | \membersection{wxPathList::Member}\label{wxpathlistmember} |
a660d684 KB |
81 | |
82 | \func{bool}{Member}{\param{const wxString\& }{file}} | |
83 | ||
cc81d32f | 84 | true if the path is in the path list (ignoring case). |
a660d684 | 85 |