]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/pathlist.tex
wxMemoryDC constructor now optionally accepts a wxBitmap parameter,
[wxWidgets.git] / docs / latex / wx / pathlist.tex
... / ...
CommitLineData
1\section{\class{wxPathList}}\label{wxpathlist}
2
3The path list is a convenient way of storing a number of directories, and
4when presented with a filename without a directory, searching for an existing file
5in those directories. Storing the filename only in an application's files and
6using a locally-defined list of directories makes the application and its files more
7portable.
8
9Use the \helpref{wxFileName::SplitPath}{wxfilenamesplitpath} global function
10to 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}, \helpref{wxStandardPaths}{wxstandardpaths}, \helpref{wxFileName}{wxfilename}
23
24\latexignore{\rtfignore{\wxheading{Members}}}
25
26
27\membersection{wxPathList::wxPathList}\label{wxpathlistctor}
28
29\func{}{wxPathList}{\void}
30
31Empty constructor.
32
33\func{}{wxPathList}{\param{const wxArrayString\& }{arr}}
34
35Constructs 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
42Finds the value of the given environment variable, and adds all paths
43to the path list. Useful for finding files in the PATH variable, for
44example.
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
53The first form adds the given directory to the path list, if the path is not already in the list.
54The second form just calls the first form on all elements of the given array.
55
56The {\it path} is always considered a directory but no existence checks will be done on it
57(because if it doesn't exist, it could be created later and thus result a valid path when
58\helpref{FindValidPath}{wxpathlistfindvalidpath} is called).
59
60{\bf Note:} if the given path is relative, it won't be made absolute before adding it
61(this is why \helpref{FindValidPath}{wxpathlistfindvalidpath} may return relative paths).
62
63
64\membersection{wxPathList::EnsureFileAccessible}\label{wxpathlistensurefileaccessible}
65
66\func{void}{EnsureFileAccessible}{\param{const wxString\& }{filename}}
67
68Given a full filename (with path), ensures that files in the same path
69can be accessed using the pathlist. It does this by stripping the
70filename and adding the path to the list if not already there.
71
72
73\membersection{wxPathList::FindAbsoluteValidPath}\label{wxpathlistfindabsolutepath}
74
75\constfunc{wxString}{FindAbsoluteValidPath}{\param{const wxString\& }{file}}
76
77Searches for a full (i.e. absolute) path for an existing file by appending {\it file} to
78successive members of the path list. If the file wasn't found, an empty
79string is returned.
80
81
82\membersection{wxPathList::FindValidPath}\label{wxpathlistfindvalidpath}
83
84\constfunc{wxString}{FindValidPath}{\param{const wxString\& }{file}}
85
86Searches for a path for an existing file by appending {\it file} to
87successive members of the path list.
88If the file wasn't found, an empty string is returned.
89
90The returned path may be relative to the current working directory.
91
92The given string must be a file name, eventually with a path prefix (if the path
93prefix is absolute, only its name will be searched); i.e. it must not end with
94a directory separator (see \helpref{wxFileName::GetPathSeparator}{wxfilenamegetpathseparator})
95otherwise an assertion will fail.
96