]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/stdpaths.tex
- added and documented Get/SetInstallPath() under Unix
[wxWidgets.git] / docs / latex / wx / stdpaths.tex
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %% Name: stdpaths.tex
3 %% Purpose: wxStandardPaths documentation
4 %% Author: Vadim Zeitlin
5 %% Modified by:
6 %% Created: 2004-10-17
7 %% RCS-ID: $Id$
8 %% Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
9 %% License: wxWidgets license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12 \section{\class{wxStandardPaths}}\label{wxstandardpaths}
13
14 wxStandardPaths returns the standard locations in the file system and should be
15 used by the programs to find their data files in a portable way.
16
17 Please note that this is not a real class because object of this type are never
18 created but more a namespace containing the class methods which are all static,
19 so to use wxStandardPaths simply call its methods directly.
20
21 In the description of the methods below, the example return values are given
22 for the Unix, Windows and Mac OS X systems, however please note that these are
23 just the examples and the actual values may differ. For example, under Windows:
24 the system administrator may change the standard directories locations, i.e.
25 the Windows directory may be named \texttt{W:$\backslash$Win2003} instead of
26 the default \texttt{C:$\backslash$Windows}.
27
28 The strings \texttt{\textit{appname}} and \texttt{\textit{username}} should be
29 replaced with the value returned by \helpref{wxApp::GetAppName}{wxappgetappname}
30 and the name of the currently logged in user, respectively. The string
31 \texttt{\textit{prefix}} is only used under Unix and is \texttt{/usr/local} by
32 default but may be changed using \helpref{SetInstallPrefix}{wxstandardpathssetinstallprefix}.
33
34 The directories returned by the methods of this class may or may not exist. If
35 they don't exist, it's up to the caller to create them, wxStandardPaths doesn't
36 do it.
37
38 Finally note that these functions only work with standardly packaged
39 applications. I.e. under Unix you should follow the standard installation
40 conventions and under Mac you should create your application bundle according
41 to the Apple guidelines. Again, this class doesn't help you to do it.
42
43 \wxheading{Derived from}
44
45 No base class
46
47 \wxheading{Include files}
48
49 <wx/fileloc.h>
50
51
52 \latexignore{\rtfignore{\wxheading{Members}}}
53
54
55 \membersection{wxStandardPaths::GetConfigDir}\label{wxstandardpathsgetconfigdir}
56
57 \func{static wxString}{GetConfigDir}{\void}
58
59 Return the directory containing the system config files.
60
61 Example return values:
62 \begin{itemize}
63 \item Unix: \texttt{/etc}
64 \item Windows: \texttt{C:$\backslash$Windows}
65 \item Mac: \texttt{/Library/Preferences}
66 \end{itemize}
67
68 \wxheading{See also}
69
70 \helpref{wxFileConfig}{wxfileconfig}
71
72
73 \membersection{wxStandardPaths::GetDataDir}\label{wxstandardpathsgetdatadir}
74
75 \func{static wxString}{GetDataDir}{\void}
76
77 Return the location of the applications global, i.e. not user-specific,
78 data files.
79
80 Example return values:
81 \begin{itemize}
82 \item Unix: \texttt{\textit{prefix}/share/\textit{appname}}
83 \item Windows: \texttt{C:$\backslash$Program Files$\backslash$\textit{appname}}
84 \item Mac: \texttt{\textit{appname}.app/Contents/SharedSupport} bundle subdirectory
85 \end{itemize}
86
87 \wxheading{See also}
88
89 \helpref{GetLocalDataDir}{wxstandardpathsgetlocaldatadir}
90
91
92 \membersection{wxStandardPaths::GetInstallPrefix}\label{wxstandardpathsgetinstallprefix}
93
94 \func{static wxString}{GetInstallPrefix}{\void}
95
96 \textbf{Note: } This function is only available under Unix.
97
98 Return the program installation prefix, e.g. \texttt{/usr}, \texttt{/opt} or
99 \texttt{/home/zeitlin}.
100
101 If the prefix had been previously by
102 \helpref{SetInstallPrefix}{wxstandardpathssetinstallprefix}, returns that
103 value, otherwise tries to determine it automatically (Linux only right
104 now) and finally returns the default \texttt{/usr/local} value if it failed.
105
106
107 \membersection{wxStandardPaths::GetLocalDataDir}\label{wxstandardpathsgetlocaldatadir}
108
109 \func{static wxString}{GetLocalDataDir}{\void}
110
111 Return the location for application data files which are host-specific and
112 can't, or shouldn't, be shared with the other machines.
113
114 This is the same as \helpref{GetDataDir()}{wxstandardpathsgetdatadir} except
115 under Unix where it returns \texttt{/etc/\textit{appname}}.
116
117
118 \membersection{wxStandardPaths::GetPluginsDir}\label{wxstandardpathsgetpluginsdir}
119
120 \func{static wxString}{GetPluginsDir}{\void}
121
122 Return the directory where the loadable modules (plugins) live.
123
124 Example return values:
125 \begin{itemize}
126 \item Unix: \texttt{\textit{prefix}/lib/\textit{appname}}
127 \item Windows: the directory of the executable file
128 \item Mac: \texttt{\textit{appname}.app/Contents/PlugIns} bundle subdirectory
129 \end{itemize}
130
131 \wxheading{See also}
132
133 \helpref{wxDynamicLibrary}{wxdynamiclibrary}
134
135
136 \membersection{wxStandardPaths::GetUserConfigDir}\label{wxstandardpathsgetuserconfigdir}
137
138 \func{static wxString}{GetUserConfigDir}{\void}
139
140 Return the directory for the user config files:
141 \begin{itemize}
142 \item Unix: \texttt{\verb|~|} (the home directory)
143 \item Windows: \texttt{C:$\backslash$Documents and Settings$\backslash$\textit{username}}
144 \item Mac: \texttt{\verb|~|/Library/Preferences}
145 \end{itemize}
146
147 Only use this method if you have a single configuration file to put in this
148 directory, otherwise \helpref{GetUserDataDir()}{wxstandardpathsgetuserdatadir} is
149 more appropriate.
150
151
152 \membersection{wxStandardPaths::GetUserDataDir}\label{wxstandardpathsgetuserdatadir}
153
154 \func{static wxString}{GetUserDataDir}{\void}
155
156 Return the directory for the user-dependent application data files:
157 \begin{itemize}
158 \item Unix: \texttt{\verb|~|/.\textit{appname}}
159 \item Windows: \texttt{C:$\backslash$Documents and Settings$\backslash$\textit{username}$\backslash$Application Data$\backslash$\textit{appname}}
160 \item Mac: \texttt{\verb|~|/Library/Application Support/\textit{appname}}
161 \end{itemize}
162
163
164 \membersection{wxStandardPaths::GetUserLocalDataDir}\label{wxstandardpathsgetuserlocaldatadir}
165
166 \func{static wxString}{GetUserLocalDataDir}{\void}
167
168 Return the directory for user data files which shouldn't be shared with
169 the other machines.
170
171 This is the same as \helpref{GetUserDataDir()}{wxstandardpathsgetuserdatadir} for
172 all platforms except Windows where it returns
173 \texttt{C:$\backslash$Documents and Settings$\backslash$\textit{username}$\backslash$Local Settings$\backslash$Application Data$\backslash$\textit{appname}}
174
175
176 \membersection{wxStandardPaths::SetInstallPrefix}\label{wxstandardpathssetinstallprefix}
177
178 \func{static void}{SetInstallPrefix}{\param{const wxString\& }{prefix}}
179
180 \textbf{Note: } This function is only available under Unix.
181
182 Lets wxStandardPaths know about the real program installation prefix on a Unix
183 system. By default, the value returned by
184 \helpref{GetInstallPrefix}{wxstandardpathsgetinstallprefix} is used.
185
186 Although under Linux systems the program prefix may usually be determined
187 automatically, portable programs should call this function. Usually the prefix
188 is set during program configuration if using GNU autotools and so it is enough
189 to pass its value defined in \texttt{config.h} to this function.
190
191