File: stdpaths.tex

package info (click to toggle)
wxwidgets2.8 2.8.10.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 239,052 kB
  • ctags: 289,550
  • sloc: cpp: 1,838,857; xml: 396,717; python: 282,506; ansic: 126,171; makefile: 51,406; sh: 14,581; asm: 299; sql: 258; lex: 194; perl: 139; yacc: 128; pascal: 95; php: 39; lisp: 38; tcl: 24; haskell: 20; java: 18; cs: 18; erlang: 17; ruby: 16; ada: 9; ml: 9; csh: 9
file content (282 lines) | stat: -rw-r--r-- 10,317 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Name:        stdpaths.tex
%% Purpose:     wxStandardPaths documentation
%% Author:      Vadim Zeitlin
%% Modified by:
%% Created:     2004-10-17
%% RCS-ID:      $Id: stdpaths.tex 54786 2008-07-26 09:13:27Z SC $
%% Copyright:   (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
%% License:     wxWindows license
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{\class{wxStandardPaths}}\label{wxstandardpaths}

wxStandardPaths returns the standard locations in the file system and should be
used by applications to find their data files in a portable way.

In the description of the methods below, the example return values are given
for the Unix, Windows and Mac OS X systems, however please note that these are
just the examples and the actual values may differ. For example, under Windows:
the system administrator may change the standard directories locations, i.e.
the Windows directory may be named \texttt{W:$\backslash$Win2003} instead of
the default \texttt{C:$\backslash$Windows}.

The strings \texttt{\textit{appname}} and \texttt{\textit{username}} should be
replaced with the value returned by \helpref{wxApp::GetAppName}{wxappgetappname}
and the name of the currently logged in user, respectively. The string
\texttt{\textit{prefix}} is only used under Unix and is \texttt{/usr/local} by
default but may be changed using \helpref{SetInstallPrefix}{wxstandardpathssetinstallprefix}.

The directories returned by the methods of this class may or may not exist. If
they don't exist, it's up to the caller to create them, wxStandardPaths doesn't
do it.

Finally note that these functions only work with standardly packaged
applications. I.e. under Unix you should follow the standard installation
conventions and under Mac you should create your application bundle according
to the Apple guidelines. Again, this class doesn't help you to do it.

This class is MT-safe: its methods may be called concurrently from different
threads without additional locking.

Note that you don't allocate an instance of class wxStandardPaths, but retrieve the 
global standard paths object using \texttt{wxStandardPaths::Get} on which you call the 
desired methods.

\wxheading{Derived from}

No base class

\wxheading{Include files}

<wx/stdpaths.h>


\latexignore{\rtfignore{\wxheading{Members}}}


\membersection{wxStandardPaths::Get}\label{wxstandardpathsget}

\func{static wxStandardPathsBase\&}{Get}{\void}

Returns reference to the unique global standard paths object.


\membersection{wxStandardPaths::GetConfigDir}\label{wxstandardpathsgetconfigdir}

\constfunc{wxString}{GetConfigDir}{\void}

Return the directory containing the system config files.

Example return values:
\begin{itemize}
    \item Unix: \texttt{/etc}
    \item Windows: \texttt{C:$\backslash$Documents and Settings$\backslash$All Users$\backslash$Application Data}
    \item Mac: \texttt{/Library/Preferences}
\end{itemize}

\wxheading{See also}

\helpref{wxFileConfig}{wxfileconfig}


\membersection{wxStandardPaths::GetDataDir}\label{wxstandardpathsgetdatadir}

\constfunc{wxString}{GetDataDir}{\void}

Return the location of the applications global, i.e. not user-specific,
data files.

Example return values:
\begin{itemize}
    \item Unix: \texttt{\textit{prefix}/share/\textit{appname}}
    \item Windows: the directory where the executable file is located
    \item Mac: \texttt{\textit{appname}.app/Contents/SharedSupport} bundle subdirectory
\end{itemize}

\wxheading{See also}

\helpref{GetLocalDataDir}{wxstandardpathsgetlocaldatadir}


\membersection{wxStandardPaths::GetDocumentsDir}\label{wxstandardpathsgetdocumentsdir}

\constfunc{wxString}{GetDocumentsDir}{\void}

Return the directory containing the current user's documents.

Example return values:
\begin{itemize}
    \item Unix: \tt{~} (the home directory)
    \item Windows: \texttt{C:$\backslash$Documents and Settings$\backslash$\textit{username}$\backslash$Documents}
    \item Mac: \texttt{~/Documents}
\end{itemize}

\newsince{2.7.0}


\membersection{wxStandardPaths::GetExecutablePath}\label{wxstandardpathsgetexecutablepath}

\constfunc{wxString}{GetExecutablePath}{\void}

Return the directory and the filename for the current executable.

Example return values:
\begin{itemize}
    \item Unix: \texttt{/usr/local/bin/exename}
    \item Windows: \texttt{C:$\backslash$Programs$\backslash$AppFolder$\backslash$exename.exe}
    \item Mac: \texttt{/Programs/exename}
\end{itemize}



\membersection{wxStandardPaths::GetInstallPrefix}\label{wxstandardpathsgetinstallprefix}

\constfunc{wxString}{GetInstallPrefix}{\void}

\textbf{Note: } This function is only available under Unix.

Return the program installation prefix, e.g. \texttt{/usr}, \texttt{/opt} or
\texttt{/home/zeitlin}.

If the prefix had been previously by
\helpref{SetInstallPrefix}{wxstandardpathssetinstallprefix}, returns that
value, otherwise tries to determine it automatically (Linux only right
now) and finally returns the default \texttt{/usr/local} value if it failed.


\membersection{wxStandardPaths::GetLocalDataDir}\label{wxstandardpathsgetlocaldatadir}

\constfunc{wxString}{GetLocalDataDir}{\void}

Return the location for application data files which are host-specific and
can't, or shouldn't, be shared with the other machines.

This is the same as \helpref{GetDataDir()}{wxstandardpathsgetdatadir} except
under Unix where it returns \texttt{/etc/\textit{appname}}.


\membersection{wxStandardPaths::GetLocalizedResourcesDir}\label{wxstandardpathsgetlocalizedresourcesdir}

\constfunc{wxString}{GetLocalizedResourcesDir}{\param{const wxChar*}{ lang}, \param{ResourceCat}{ category = ResourceCat\_None}}

Return the localized resources directory containing the resource files of the
specified category for the given language.

In general this is just the same as \arg{lang} subdirectory of
\helpref{GetResourcesDir()}{wxstandardpathsgetresourcesdir} (or
\texttt{\arg{lang}.lproj} under Mac OS X) but is something quite
different for message catalog category under Unix where it returns the standard
\texttt{\textit{prefix}/share/locale/\arg{lang}/LC\_MESSAGES} directory.

\newsince{2.7.0}


\membersection{wxStandardPaths::GetPluginsDir}\label{wxstandardpathsgetpluginsdir}

\constfunc{wxString}{GetPluginsDir}{\void}

Return the directory where the loadable modules (plugins) live.

Example return values:
\begin{itemize}
    \item Unix: \texttt{\textit{prefix}/lib/\textit{appname}}
    \item Windows: the directory of the executable file
    \item Mac: \texttt{\textit{appname}.app/Contents/PlugIns} bundle subdirectory
\end{itemize}

\wxheading{See also}

\helpref{wxDynamicLibrary}{wxdynamiclibrary}


\membersection{wxStandardPaths::GetResourcesDir}\label{wxstandardpathsgetresourcesdir}

\constfunc{wxString}{GetResourcesDir}{\void}

Return the directory where the application resource files are located. The
resources are the auxiliary data files needed for the application to run and
include, for example, image and sound files it might use.

This function is the same as \helpref{GetDataDir}{wxstandardpathsgetdatadir} for
all platforms except Mac OS X.

Example return values:
\begin{itemize}
    \item Unix: \texttt{\textit{prefix}/share/\textit{appname}}
    \item Windows: the directory where the executable file is located
    \item Mac: \texttt{\textit{appname}.app/Contents/Resources} bundle subdirectory
\end{itemize}

\newsince{2.7.0}


\wxheading{See also}

\helpref{GetLocalizedResourcesDir}{wxstandardpathsgetlocalizedresourcesdir}

\membersection{wxStandardPaths::GetTempDir}\label{wxstandardpathsgettempdir}

\constfunc{wxString}{GetTempDir}{\void}

Return the directory for storing temporary files. To create unique temporary files,
it is best to use \helpref{wxFileName::CreateTempFileName}{wxfilenamecreatetempfilename} for correct behaviour when
multiple processes are attempting to create temporary files.

\newsince{2.7.2}

\membersection{wxStandardPaths::GetUserConfigDir}\label{wxstandardpathsgetuserconfigdir}

\constfunc{wxString}{GetUserConfigDir}{\void}

Return the directory for the user config files:
\begin{itemize}
    \item Unix: \tt{~} (the home directory)
    \item Windows: \tt{C:$\backslash$Documents and Settings$\backslash$\textit{username}$\backslash$Application Data}
    \item Mac: \tt{~/Library/Preferences}
\end{itemize}

Only use this method if you have a single configuration file to put in this
directory, otherwise \helpref{GetUserDataDir()}{wxstandardpathsgetuserdatadir} is
more appropriate.


\membersection{wxStandardPaths::GetUserDataDir}\label{wxstandardpathsgetuserdatadir}

\constfunc{wxString}{GetUserDataDir}{\void}

Return the directory for the user-dependent application data files:
\begin{itemize}
    \item Unix: \tt{~/.\textit{appname}}
    \item Windows: \tt{C:$\backslash$Documents and Settings$\backslash$\textit{username}$\backslash$Application Data$\backslash$\textit{appname}}
    \item Mac: \tt{~/Library/Application Support/\textit{appname}}
\end{itemize}


\membersection{wxStandardPaths::GetUserLocalDataDir}\label{wxstandardpathsgetuserlocaldatadir}

\constfunc{wxString}{GetUserLocalDataDir}{\void}

Return the directory for user data files which shouldn't be shared with
the other machines.

This is the same as \helpref{GetUserDataDir()}{wxstandardpathsgetuserdatadir} for
all platforms except Windows where it returns
\texttt{C:$\backslash$Documents and Settings$\backslash$\textit{username}$\backslash$Local Settings$\backslash$Application Data$\backslash$\textit{appname}}


\membersection{wxStandardPaths::SetInstallPrefix}\label{wxstandardpathssetinstallprefix}

\func{void}{SetInstallPrefix}{\param{const wxString\& }{prefix}}

\textbf{Note:} This function is only available under Unix.

Lets wxStandardPaths know about the real program installation prefix on a Unix
system. By default, the value returned by
\helpref{GetInstallPrefix}{wxstandardpathsgetinstallprefix} is used.

Although under Linux systems the program prefix may usually be determined
automatically, portable programs should call this function. Usually the prefix
is set during program configuration if using GNU autotools and so it is enough
to pass its value defined in \texttt{config.h} to this function.