1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxStandardPaths documentation
4 %% Author: Vadim Zeitlin
8 %% Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxStandardPaths
}}\label{wxstandardpaths
}
14 wxStandardPaths returns the standard locations in the file system and should be
15 used by applications to find their data files in a portable way.
17 In the description of the methods below, the example return values are given
18 for the Unix, Windows and Mac OS X systems, however please note that these are
19 just the examples and the actual values may differ. For example, under Windows:
20 the system administrator may change the standard directories locations, i.e.
21 the Windows directory may be named
\texttt{W:$
\backslash$Win2003
} instead of
22 the default
\texttt{C:$
\backslash$Windows
}.
24 The strings
\texttt{\textit{appname
}} and
\texttt{\textit{username
}} should be
25 replaced with the value returned by
\helpref{wxApp::GetAppName
}{wxappgetappname
}
26 and the name of the currently logged in user, respectively. The string
27 \texttt{\textit{prefix
}} is only used under Unix and is
\texttt{/usr/local
} by
28 default but may be changed using
\helpref{SetInstallPrefix
}{wxstandardpathssetinstallprefix
}.
30 The directories returned by the methods of this class may or may not exist. If
31 they don't exist, it's up to the caller to create them, wxStandardPaths doesn't
34 Finally note that these functions only work with standardly packaged
35 applications. I.e. under Unix you should follow the standard installation
36 conventions and under Mac you should create your application bundle according
37 to the Apple guidelines. Again, this class doesn't help you to do it.
39 This class is MT-safe: its methods may be called concurrently from different
40 threads without additional locking.
42 \wxheading{Derived from
}
46 \wxheading{Include files
}
51 \latexignore{\rtfignore{\wxheading{Members
}}}
54 \membersection{wxStandardPaths::Get
}\label{wxstandardpathsget
}
56 \func{static wxStandardPathsBase\&
}{Get
}{\void}
58 Returns reference to the unique global standard paths object.
61 \membersection{wxStandardPaths::GetConfigDir
}\label{wxstandardpathsgetconfigdir
}
63 \func{wxString
}{GetConfigDir
}{\void}
65 Return the directory containing the system config files.
67 Example return values:
69 \item Unix:
\texttt{/etc
}
70 \item Windows:
\texttt{C:$
\backslash$Documents and Settings$
\backslash$All Users$
\backslash$Application Data
}
71 \item Mac:
\texttt{/Library/Preferences
}
76 \helpref{wxFileConfig
}{wxfileconfig
}
79 \membersection{wxStandardPaths::GetDataDir
}\label{wxstandardpathsgetdatadir
}
81 \func{wxString
}{GetDataDir
}{\void}
83 Return the location of the applications global, i.e. not user-specific,
86 Example return values:
88 \item Unix:
\texttt{\textit{prefix
}/share/
\textit{appname
}}
89 \item Windows: the directory where the executable file is located
90 \item Mac:
\texttt{\textit{appname
}.app/Contents/SharedSupport
} bundle subdirectory
95 \helpref{GetLocalDataDir
}{wxstandardpathsgetlocaldatadir
}
98 \membersection{wxStandardPaths::GetInstallPrefix
}\label{wxstandardpathsgetinstallprefix
}
100 \func{wxString
}{GetInstallPrefix
}{\void}
102 \textbf{Note:
} This function is only available under Unix.
104 Return the program installation prefix, e.g.
\texttt{/usr
},
\texttt{/opt
} or
105 \texttt{/home/zeitlin
}.
107 If the prefix had been previously by
108 \helpref{SetInstallPrefix
}{wxstandardpathssetinstallprefix
}, returns that
109 value, otherwise tries to determine it automatically (Linux only right
110 now) and finally returns the default
\texttt{/usr/local
} value if it failed.
113 \membersection{wxStandardPaths::GetLocalDataDir
}\label{wxstandardpathsgetlocaldatadir
}
115 \func{wxString
}{GetLocalDataDir
}{\void}
117 Return the location for application data files which are host-specific and
118 can't, or shouldn't, be shared with the other machines.
120 This is the same as
\helpref{GetDataDir()
}{wxstandardpathsgetdatadir
} except
121 under Unix where it returns
\texttt{/etc/
\textit{appname
}}.
124 \membersection{wxStandardPaths::GetPluginsDir
}\label{wxstandardpathsgetpluginsdir
}
126 \func{wxString
}{GetPluginsDir
}{\void}
128 Return the directory where the loadable modules (plugins) live.
130 Example return values:
132 \item Unix:
\texttt{\textit{prefix
}/lib/
\textit{appname
}}
133 \item Windows: the directory of the executable file
134 \item Mac:
\texttt{\textit{appname
}.app/Contents/PlugIns
} bundle subdirectory
139 \helpref{wxDynamicLibrary
}{wxdynamiclibrary
}
142 \membersection{wxStandardPaths::GetUserConfigDir
}\label{wxstandardpathsgetuserconfigdir
}
144 \func{wxString
}{GetUserConfigDir
}{\void}
146 Return the directory for the user config files:
148 \item Unix:
\tt{~
} (the home directory)
149 \item Windows:
\tt{C:$
\backslash$Documents and Settings$
\backslash$
\textit{username
}}
150 \item Mac:
\tt{~/Library/Preferences
}
153 Only use this method if you have a single configuration file to put in this
154 directory, otherwise
\helpref{GetUserDataDir()
}{wxstandardpathsgetuserdatadir
} is
158 \membersection{wxStandardPaths::GetUserDataDir
}\label{wxstandardpathsgetuserdatadir
}
160 \func{wxString
}{GetUserDataDir
}{\void}
162 Return the directory for the user-dependent application data files:
164 \item Unix:
\tt{~/.
\textit{appname
}}
165 \item Windows:
\tt{C:$
\backslash$Documents and Settings$
\backslash$
\textit{username
}$
\backslash$Application Data$
\backslash$
\textit{appname
}}
166 \item Mac:
\tt{~/Library/Application Support/
\textit{appname
}}
170 \membersection{wxStandardPaths::GetUserLocalDataDir
}\label{wxstandardpathsgetuserlocaldatadir
}
172 \func{wxString
}{GetUserLocalDataDir
}{\void}
174 Return the directory for user data files which shouldn't be shared with
177 This is the same as
\helpref{GetUserDataDir()
}{wxstandardpathsgetuserdatadir
} for
178 all platforms except Windows where it returns
179 \texttt{C:$
\backslash$Documents and Settings$
\backslash$
\textit{username
}$
\backslash$Local Settings$
\backslash$Application Data$
\backslash$
\textit{appname
}}
182 \membersection{wxStandardPaths::SetInstallPrefix
}\label{wxstandardpathssetinstallprefix
}
184 \func{void
}{SetInstallPrefix
}{\param{const wxString\&
}{prefix
}}
186 \textbf{Note:
} This function is only available under Unix.
188 Lets wxStandardPaths know about the real program installation prefix on a Unix
189 system. By default, the value returned by
190 \helpref{GetInstallPrefix
}{wxstandardpathsgetinstallprefix
} is used.
192 Although under Linux systems the program prefix may usually be determined
193 automatically, portable programs should call this function. Usually the prefix
194 is set during program configuration if using GNU autotools and so it is enough
195 to pass its value defined in
\texttt{config.h
} to this function.