]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/pathlist.tex
wxPlatformInfo (patch 1532064)
[wxWidgets.git] / docs / latex / wx / pathlist.tex
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 \helpref{wxFileName::SplitPath}{wxfilenamesplitpath} global function
10 to extract the filename from the path.
11
12 \wxheading{Derived from}
13
14 \helpref{wxArrayString}{wxarraystring}
15
16 \wxheading{Include files}
17
18 <wx/filefn.h>
19
20 \wxheading{See also}
21
22 \helpref{wxArrayString}{wxarraystring}
23
24 \latexignore{\rtfignore{\wxheading{Members}}}
25
26
27 \membersection{wxPathList::wxPathList}\label{wxpathlistctor}
28
29 \func{}{wxPathList}{\void}
30
31 Empty constructor.
32
33 \func{}{wxPathList}{\param{const wxArrayString\& }{arr}}
34
35 Constructs the object calling the \helpref{Add}{wxpathlistadd} function.
36
37
38 \membersection{wxPathList::AddEnvList}\label{wxpathlistaddenvlist}
39
40 \func{void}{AddEnvList}{\param{const wxString\& }{env\_variable}}
41
42 Finds the value of the given environment variable, and adds all paths
43 to the path list. Useful for finding files in the PATH variable, for
44 example.
45
46
47 \membersection{wxPathList::Add}\label{wxpathlistadd}
48
49 \func{void}{Add}{\param{const wxString\& }{path}}
50
51 \func{void}{Add}{\param{const wxArrayString\& }{arr}}
52
53 The first form adds the given directory (the filename if present is removed)
54 to the path list, if the path is not already in the list.
55
56 The second form just calls the first form on all elements of the given array.
57
58
59 \membersection{wxPathList::EnsureFileAccessible}\label{wxpathlistensurefileaccessible}
60
61 \func{void}{EnsureFileAccessible}{\param{const wxString\& }{filename}}
62
63 Given a full filename (with path), ensures that files in the same path
64 can be accessed using the pathlist. It does this by stripping the
65 filename and adding the path to the list if not already there.
66
67
68 \membersection{wxPathList::FindAbsoluteValidPath}\label{wxpathlistfindabsolutepath}
69
70 \constfunc{wxString}{FindAbsoluteValidPath}{\param{const wxString\& }{file}}
71
72 Searches for a full path for an existing file by appending {\it file} to
73 successive members of the path list. If the file wasn't found, an empty
74 string is returned.
75
76
77 \membersection{wxPathList::FindValidPath}\label{wxpathlistfindvalidpath}
78
79 \constfunc{wxString}{FindValidPath}{\param{const wxString\& }{file}}
80
81 Searches for a full path for an existing file by appending {\it file} to
82 successive members of the path list. If the file wasn't found, an empty string
83 is returned. This path may be relative to the current working directory.
84