2004-10-17 17:43:08 -04:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2004-10-18 18:35:51 -04:00
%% Name: stdpaths.tex
%% Purpose: wxStandardPaths documentation
2004-10-17 17:43:08 -04:00
%% Author: Vadim Zeitlin
%% Modified by:
%% Created: 2004-10-17
%% RCS-ID: $Id$
%% Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
2005-02-22 10:09:56 -05:00
%% License: wxWindows license
2004-10-17 17:43:08 -04:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2004-10-18 19:27:37 -04:00
\section { \class { wxStandardPaths} } \label { wxstandardpaths}
2004-10-17 17:43:08 -04:00
2004-10-18 18:35:51 -04:00
wxStandardPaths returns the standard locations in the file system and should be
2005-02-11 15:08:51 -05:00
used by applications to find their data files in a portable way.
2004-10-17 17:43:08 -04:00
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
2004-10-18 19:27:37 -04:00
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} .
2004-10-17 17:43:08 -04:00
The strings \texttt { \textit { appname} } and \texttt { \textit { username} } should be
replaced with the value returned by \helpref { wxApp::GetAppName} { wxappgetappname}
2004-10-18 19:27:37 -04:00
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} .
2004-10-17 17:43:08 -04:00
The directories returned by the methods of this class may or may not exist. If
2004-10-18 18:35:51 -04:00
they don't exist, it's up to the caller to create them, wxStandardPaths doesn't
2004-10-17 17:43:08 -04:00
do it.
2004-10-18 19:27:37 -04:00
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.
2004-10-17 17:43:08 -04:00
2004-10-19 14:47:31 -04:00
This class is MT-safe: its methods may be called concurrently from different
threads without additional locking.
2004-10-17 17:43:08 -04:00
\wxheading { Derived from}
No base class
\wxheading { Include files}
2005-03-08 10:18:36 -05:00
<wx/stdpaths.h>
2004-10-17 17:43:08 -04:00
\latexignore { \rtfignore { \wxheading { Members} } }
2005-05-31 11:25:35 -04:00
\membersection { wxStandardPaths::Get} \label { wxstandardpathsget}
2005-09-01 10:46:18 -04:00
\func { static wxStandardPathsBase\& } { Get} { \void }
2005-05-31 11:25:35 -04:00
Returns reference to the unique global standard paths object.
2004-10-18 19:27:37 -04:00
\membersection { wxStandardPaths::GetConfigDir} \label { wxstandardpathsgetconfigdir}
2004-10-17 17:43:08 -04:00
2005-05-31 11:25:35 -04:00
\func { wxString} { GetConfigDir} { \void }
2004-10-17 17:43:08 -04:00
Return the directory containing the system config files.
Example return values:
\begin { itemize}
\item Unix: \texttt { /etc}
2004-10-19 14:47:31 -04:00
\item Windows: \texttt { C:$ \backslash $ Documents and Settings$ \backslash $ All Users$ \backslash $ Application Data}
2004-10-17 17:43:08 -04:00
\item Mac: \texttt { /Library/Preferences}
\end { itemize}
\wxheading { See also}
\helpref { wxFileConfig} { wxfileconfig}
2004-10-18 19:27:37 -04:00
\membersection { wxStandardPaths::GetDataDir} \label { wxstandardpathsgetdatadir}
2004-10-17 17:43:08 -04:00
2005-05-31 11:25:35 -04:00
\func { wxString} { GetDataDir} { \void }
2004-10-17 17:43:08 -04:00
Return the location of the applications global, i.e. not user-specific,
data files.
Example return values:
\begin { itemize}
2004-10-18 19:27:37 -04:00
\item Unix: \texttt { \textit { prefix} /share/\textit { appname} }
2005-03-14 11:05:52 -05:00
\item Windows: the directory where the executable file is located
2004-10-18 19:27:37 -04:00
\item Mac: \texttt { \textit { appname} .app/Contents/SharedSupport} bundle subdirectory
2004-10-17 17:43:08 -04:00
\end { itemize}
\wxheading { See also}
2004-10-18 19:27:37 -04:00
\helpref { GetLocalDataDir} { wxstandardpathsgetlocaldatadir}
\membersection { wxStandardPaths::GetInstallPrefix} \label { wxstandardpathsgetinstallprefix}
2005-05-31 11:25:35 -04:00
\func { wxString} { GetInstallPrefix} { \void }
2004-10-18 19:27:37 -04:00
\textbf { Note: } This function is only available under Unix.
Return the program installation prefix, e.g. \texttt { /usr} , \texttt { /opt} or
\texttt { /home/zeitlin} .
2004-10-17 17:43:08 -04:00
2004-10-18 19:27:37 -04:00
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.
2004-10-17 17:43:08 -04:00
2004-10-18 19:27:37 -04:00
\membersection { wxStandardPaths::GetLocalDataDir} \label { wxstandardpathsgetlocaldatadir}
2004-10-17 17:43:08 -04:00
2005-05-31 11:25:35 -04:00
\func { wxString} { GetLocalDataDir} { \void }
2004-10-17 17:43:08 -04:00
Return the location for application data files which are host-specific and
can't, or shouldn't, be shared with the other machines.
2004-10-18 19:27:37 -04:00
This is the same as \helpref { GetDataDir()} { wxstandardpathsgetdatadir} except
2004-10-17 17:43:08 -04:00
under Unix where it returns \texttt { /etc/\textit { appname} } .
2004-10-18 19:27:37 -04:00
\membersection { wxStandardPaths::GetPluginsDir} \label { wxstandardpathsgetpluginsdir}
2004-10-17 17:43:08 -04:00
2005-05-31 11:25:35 -04:00
\func { wxString} { GetPluginsDir} { \void }
2004-10-17 17:43:08 -04:00
Return the directory where the loadable modules (plugins) live.
Example return values:
\begin { itemize}
2004-10-18 19:27:37 -04:00
\item Unix: \texttt { \textit { prefix} /lib/\textit { appname} }
2004-10-17 17:43:08 -04:00
\item Windows: the directory of the executable file
2004-10-18 19:27:37 -04:00
\item Mac: \texttt { \textit { appname} .app/Contents/PlugIns} bundle subdirectory
2004-10-17 17:43:08 -04:00
\end { itemize}
\wxheading { See also}
\helpref { wxDynamicLibrary} { wxdynamiclibrary}
2004-10-18 19:27:37 -04:00
\membersection { wxStandardPaths::GetUserConfigDir} \label { wxstandardpathsgetuserconfigdir}
2004-10-17 17:43:08 -04:00
2005-05-31 11:25:35 -04:00
\func { wxString} { GetUserConfigDir} { \void }
2004-10-17 17:43:08 -04:00
Return the directory for the user config files:
\begin { itemize}
2004-11-18 09:14:43 -05:00
\item Unix: \tt { ~} (the home directory)
2005-01-24 11:37:28 -05:00
\item Windows: \tt { C:$ \backslash $ Documents and Settings$ \backslash $ \textit { username} }
2004-11-18 09:14:43 -05:00
\item Mac: \tt { ~/Library/Preferences}
2004-10-17 17:43:08 -04:00
\end { itemize}
Only use this method if you have a single configuration file to put in this
2004-10-18 19:27:37 -04:00
directory, otherwise \helpref { GetUserDataDir()} { wxstandardpathsgetuserdatadir} is
2004-10-17 17:43:08 -04:00
more appropriate.
2004-10-18 19:27:37 -04:00
\membersection { wxStandardPaths::GetUserDataDir} \label { wxstandardpathsgetuserdatadir}
2004-10-17 17:43:08 -04:00
2005-05-31 11:25:35 -04:00
\func { wxString} { GetUserDataDir} { \void }
2004-10-17 17:43:08 -04:00
Return the directory for the user-dependent application data files:
\begin { itemize}
2004-11-18 09:14:43 -05:00
\item Unix: \tt { ~/.\textit { appname} }
2005-01-24 11:37:28 -05:00
\item Windows: \tt { C:$ \backslash $ Documents and Settings$ \backslash $ \textit { username} $ \backslash $ Application Data$ \backslash $ \textit { appname} }
2004-11-18 09:14:43 -05:00
\item Mac: \tt { ~/Library/Application Support/\textit { appname} }
2004-10-17 17:43:08 -04:00
\end { itemize}
2004-10-18 19:27:37 -04:00
\membersection { wxStandardPaths::GetUserLocalDataDir} \label { wxstandardpathsgetuserlocaldatadir}
2004-10-17 17:43:08 -04:00
2005-05-31 11:25:35 -04:00
\func { wxString} { GetUserLocalDataDir} { \void }
2004-10-17 17:43:08 -04:00
Return the directory for user data files which shouldn't be shared with
the other machines.
2004-10-18 19:27:37 -04:00
This is the same as \helpref { GetUserDataDir()} { wxstandardpathsgetuserdatadir} for
2004-10-17 17:43:08 -04:00
all platforms except Windows where it returns
2004-10-18 18:35:51 -04:00
\texttt { C:$ \backslash $ Documents and Settings$ \backslash $ \textit { username} $ \backslash $ Local Settings$ \backslash $ Application Data$ \backslash $ \textit { appname} }
2004-10-17 17:43:08 -04:00
2004-10-18 19:27:37 -04:00
\membersection { wxStandardPaths::SetInstallPrefix} \label { wxstandardpathssetinstallprefix}
2005-05-31 11:25:35 -04:00
\func { void} { SetInstallPrefix} { \param { const wxString\& } { prefix} }
2004-10-18 19:27:37 -04:00
2005-02-11 15:08:51 -05:00
\textbf { Note:} This function is only available under Unix.
2004-10-18 19:27:37 -04:00
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.