]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/xlocale.tex
More doxygen topic overview cleanup.
[wxWidgets.git] / docs / latex / wx / xlocale.tex
CommitLineData
47a40785
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: xlocale.tex
3%% Purpose: wxXLocale documentation
4%% Author: Vadim Zeitlin
5%% Created: 2008-02-10
6%% RCS-ID: $Id: cmdlpars.tex 49199 2007-10-17 17:32:16Z VZ $
7%% Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
8%% License: wxWindows license
9%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10
11\section{\class{wxXLocale}}\label{wxxlocale}
12
13\subsection{Introduction}
14
15This class represents a locale object used by so-called xlocale API. Unlike
16\helpref{wxLocale}{wxlocale} it doesn't provide any non-trivial operations but
17simply provides a portable wrapper for POSIX \texttt{locale\_t} type. It exists
18solely to be provided as an argument to various \texttt{wxFoo\_l()} functions
19which are the extensions of the standard locale-dependent functions (hence the
20name xlocale). These functions do exactly the same thing as the corresponding
21standard \texttt{foo()} except that instead of using the global program locale
22they use the provided wxXLocale object. For example, if the user runs the
23program in French locale, the standard \texttt{printf()} function will output
24floating point numbers using decimal comma instead of decimal period. If the
25program needs to format a floating-point number in a standard format it can
26use \texttt{wxPrintf\_l(wxXLocale::GetCLocale(), "\%g", number)} to do it.
27Conversely, if a program wanted to output the number in French locale, even if
28the current locale is different, it could use wxXLocale(wxLANGUAGE\_FRENCH).
29
30\subsection{Availability}
31
32This class is fully implemented only under the platforms where xlocale POSIX
33API or equivalent is available. Currently the xlocale API is available under
34most of the recent Unix systems (including Linux, various BSD and Mac OS X) and
35Microsoft Visual C++ standard library provides a similar API starting from
36version 8 (Visual Studio 2005).
37
38If neither POSIX API nor Microsoft proprietary equivalent are available, this
39class is still available but works in degraded mode: the only supported locale
40is the C one and attempts to create wxXLocale object for any other locale will
41fail. You can use the preprocessor macro \texttt{wxHAS\_XLOCALE\_SUPPORT} to
42test if full xlocale API is available or only skeleton C locale support is
43present.
44
45Notice that wxXLocale is new in wxWidgets 2.9.0 and is not compiled in if
46\texttt{wxUSE\_XLOCALE} was set to $0$ during the library compilation.
47
48\subsection{Locale-dependent functions}
49
50Currently the following \texttt{\_l}-functions are available:
51\begin{itemize}
52 \item Character classification functions: \texttt{wxIsxxx\_l()}, e.g.
53 \texttt{wxIsalpha\_l()}, \texttt{wxIslower\_l()} and all the others.
54 \item Character transformation functions: \texttt{wxTolower\_l()} and
55 \texttt{wxToupper\_l()}
56\end{itemize}
57
58We hope to provide many more functions (covering numbers, time and formatted
59IO) in the near future.
60
61
62\wxheading{Derived from}
63
64No base class
65
66\wxheading{See also}
67
68\helpref{wxLocale}{wxlocale}
69
70\wxheading{Include files}
71
72<wx/intl.h>
73
74\wxheading{Library}
75
76\helpref{wxBase}{librarieslist}
77
78
79\latexignore{\rtfignore{\wxheading{Members}}}
80
81\membersection{wxXLocale::wxXLocale}\label{wxxlocalector}
82
83\func{}{wxLocale}{\void}
84
85Creates an uninitialized locale object, \helpref{IsOk}{wxxlocaleisok} method
86will return false.
87
88\func{}{wxLocale}{\param{wxLanguage}{ lang}}
89
90Creates the locale object corresponding to the specified language.
91
92\func{}{wxLocale}{\param{const char *}{loc}}
93
94Creates the locale object corresponding to the specified locale string. The
95locale string is system-dependent, use constructor taking wxLanguage for better
96portability.
97
98
99\membersection{wxXLocale::GetCLocale}\label{wxxlocalegetclocale}
100
101\func{static wxXLocale\& }{GetCLocale}{\void}
102
103Returns the global object representing the "C" locale. For an even shorter
104access to this object a global \texttt{wxCLocale} variable (implemented as a
105macro) is provided and can be used instead of calling this method.
106
107
108\membersection{wxXLocale::IsOk}\label{wxxlocaleisok}
109
110\constfunc{bool}{IsOk}{\void}
111
112Returns \true if this object is initialized, i.e. represents a valid locale or
113\false otherwise.
114