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 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.
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
}.
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
}.
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
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.
43 This class is MT-safe: its methods may be called concurrently from different
44 threads without additional locking.
46 \wxheading{Derived from
}
50 \wxheading{Include files
}
55 \latexignore{\rtfignore{\wxheading{Members
}}}
58 \membersection{wxStandardPaths::GetConfigDir
}\label{wxstandardpathsgetconfigdir
}
60 \func{static wxString
}{GetConfigDir
}{\void}
62 Return the directory containing the system config files.
64 Example return values:
66 \item Unix:
\texttt{/etc
}
67 \item Windows:
\texttt{C:$
\backslash$Documents and Settings$
\backslash$All Users$
\backslash$Application Data
}
68 \item Mac:
\texttt{/Library/Preferences
}
73 \helpref{wxFileConfig
}{wxfileconfig
}
76 \membersection{wxStandardPaths::GetDataDir
}\label{wxstandardpathsgetdatadir
}
78 \func{static wxString
}{GetDataDir
}{\void}
80 Return the location of the applications global, i.e. not user-specific,
83 Example return values:
85 \item Unix:
\texttt{\textit{prefix
}/share/
\textit{appname
}}
86 \item Windows:
\texttt{C:$
\backslash$Program Files$
\backslash$
\textit{appname
}}
87 \item Mac:
\texttt{\textit{appname
}.app/Contents/SharedSupport
} bundle subdirectory
92 \helpref{GetLocalDataDir
}{wxstandardpathsgetlocaldatadir
}
95 \membersection{wxStandardPaths::GetInstallPrefix
}\label{wxstandardpathsgetinstallprefix
}
97 \func{static wxString
}{GetInstallPrefix
}{\void}
99 \textbf{Note:
} This function is only available under Unix.
101 Return the program installation prefix, e.g.
\texttt{/usr
},
\texttt{/opt
} or
102 \texttt{/home/zeitlin
}.
104 If the prefix had been previously by
105 \helpref{SetInstallPrefix
}{wxstandardpathssetinstallprefix
}, returns that
106 value, otherwise tries to determine it automatically (Linux only right
107 now) and finally returns the default
\texttt{/usr/local
} value if it failed.
110 \membersection{wxStandardPaths::GetLocalDataDir
}\label{wxstandardpathsgetlocaldatadir
}
112 \func{static wxString
}{GetLocalDataDir
}{\void}
114 Return the location for application data files which are host-specific and
115 can't, or shouldn't, be shared with the other machines.
117 This is the same as
\helpref{GetDataDir()
}{wxstandardpathsgetdatadir
} except
118 under Unix where it returns
\texttt{/etc/
\textit{appname
}}.
121 \membersection{wxStandardPaths::GetPluginsDir
}\label{wxstandardpathsgetpluginsdir
}
123 \func{static wxString
}{GetPluginsDir
}{\void}
125 Return the directory where the loadable modules (plugins) live.
127 Example return values:
129 \item Unix:
\texttt{\textit{prefix
}/lib/
\textit{appname
}}
130 \item Windows: the directory of the executable file
131 \item Mac:
\texttt{\textit{appname
}.app/Contents/PlugIns
} bundle subdirectory
136 \helpref{wxDynamicLibrary
}{wxdynamiclibrary
}
139 \membersection{wxStandardPaths::GetUserConfigDir
}\label{wxstandardpathsgetuserconfigdir
}
141 \func{static wxString
}{GetUserConfigDir
}{\void}
143 Return the directory for the user config files:
145 \item Unix:
\tt{~
} (the home directory)
146 \item Windows:
\tt{C:$
\backslash$Documents and Settings$
\backslash$
\textit{username
}}
147 \item Mac:
\tt{~/Library/Preferences
}
150 Only use this method if you have a single configuration file to put in this
151 directory, otherwise
\helpref{GetUserDataDir()
}{wxstandardpathsgetuserdatadir
} is
155 \membersection{wxStandardPaths::GetUserDataDir
}\label{wxstandardpathsgetuserdatadir
}
157 \func{static wxString
}{GetUserDataDir
}{\void}
159 Return the directory for the user-dependent application data files:
161 \item Unix:
\tt{~/.
\textit{appname
}}
162 \item Windows:
\tt{C:$
\backslash$Documents and Settings$
\backslash$
\textit{username
}$
\backslash$Application Data$
\backslash$
\textit{appname
}}
163 \item Mac:
\tt{~/Library/Application Support/
\textit{appname
}}
167 \membersection{wxStandardPaths::GetUserLocalDataDir
}\label{wxstandardpathsgetuserlocaldatadir
}
169 \func{static wxString
}{GetUserLocalDataDir
}{\void}
171 Return the directory for user data files which shouldn't be shared with
174 This is the same as
\helpref{GetUserDataDir()
}{wxstandardpathsgetuserdatadir
} for
175 all platforms except Windows where it returns
176 \texttt{C:$
\backslash$Documents and Settings$
\backslash$
\textit{username
}$
\backslash$Local Settings$
\backslash$Application Data$
\backslash$
\textit{appname
}}
179 \membersection{wxStandardPaths::SetInstallPrefix
}\label{wxstandardpathssetinstallprefix
}
181 \func{static void
}{SetInstallPrefix
}{\param{const wxString\&
}{prefix
}}
183 \textbf{Note:
} This function is only available under Unix.
185 Lets wxStandardPaths know about the real program installation prefix on a Unix
186 system. By default, the value returned by
187 \helpref{GetInstallPrefix
}{wxstandardpathsgetinstallprefix
} is used.
189 Although under Linux systems the program prefix may usually be determined
190 automatically, portable programs should call this function. Usually the prefix
191 is set during program configuration if using GNU autotools and so it is enough
192 to pass its value defined in
\texttt{config.h
} to this function.