32{
return ((
name[0] ==
'C') && (
name[1] == 0)); }
37#if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND) || \
38 defined (_STLP_SIGNAL_RUNTIME_COMPATIBILITY) || defined (_STLP_CHECK_RUNTIME_COMPATIBILITY)
39# define locale _STLP_NO_MEM_T_NAME(loc)
44#if !defined (_STLP_MEMBER_TEMPLATES) || defined (_STLP_INLINE_MEMBER_TEMPLATES)
47 const string& __y)
const
50# if !defined (_STLP_NO_WCHAR_T)
52 const wstring& __y)
const
61 string what =
"Unable to find facet";
63 what +=
name.empty() ?
"system" :
name.c_str();
73 what =
"No platform localization support for ";
75 what +=
" facet category, unable to create facet for ";
76 what +=
name[0] == 0 ?
"system" :
name;
80 what =
"No platform localization support, unable to create ";
81 what +=
name[0] == 0 ?
"system" :
name;
86 what =
"Unable to create facet ";
88 what +=
" from name '";
103 if (
id._M_index == 0) {
104#if defined (_STLP_ATOMIC_INCREMENT) && !defined (_STLP_WIN95_LIKE)
110 size_t new_index = locale::id::_S_max++;
111 id._M_index = new_index;
153 const char* ctype_name =
name;
155 const char* numeric_name =
name;
157 const char* time_name =
name;
159 const char* collate_name =
name;
161 const char* monetary_name =
name;
163 const char* messages_name =
name;
174 if (
strcmp(ctype_name, numeric_name) == 0 &&
175 strcmp(ctype_name, time_name) == 0 &&
176 strcmp(ctype_name, collate_name) == 0 &&
177 strcmp(ctype_name, monetary_name) == 0 &&
178 strcmp(ctype_name, messages_name) == 0) {
179 impl->
name = ctype_name;
191 const char* ctype_name,
const char* time_name,
const char* numeric_name,
192 const char* collate_name,
const char* monetary_name,
const char* messages_name,
213 else if ((
c & locale::all) == locale::all)
222 const char* ctype_name,
const char* time_name,
const char* numeric_name,
223 const char* collate_name,
const char* monetary_name,
const char* messages_name,
225 if ((
c & locale::all) == 0 || (
strcmp(
name, ctype_name) == 0 &&
232 else if ((
c & locale::all) == locale::all &&
strcmp(ctype_name, time_name) == 0 &&
233 strcmp(ctype_name, numeric_name) == 0 &&
234 strcmp(ctype_name, collate_name) == 0 &&
235 strcmp(ctype_name, monetary_name) == 0 &&
236 strcmp(ctype_name, messages_name) == 0)
237 L->
name = ctype_name;
249 _M_throw_on_null_name();
260 const char* ctype_name =
name;
262 const char* numeric_name =
name;
264 const char* time_name =
name;
266 const char* collate_name =
name;
268 const char* monetary_name =
name;
270 const char* messages_name =
name;
272 if (
c & locale::ctype)
274 if (
c & locale::numeric)
276 if (
c & locale::time)
278 if (
c & locale::collate)
280 if (
c & locale::monetary)
282 if (
c & locale::messages)
286 ctype_name, time_name, numeric_name,
287 collate_name, monetary_name, messages_name,
c);
308 impl->
insert( i2, _STLP_STD::collate<char>::id);
309# ifndef _STLP_NO_WCHAR_T
310 impl->
insert( i2, _STLP_STD::collate<wchar_t>::id);
314 impl->
insert( i2, _STLP_STD::ctype<char>::id);
315 impl->
insert( i2, _STLP_STD::codecvt<char, char, mbstate_t>::id);
316# ifndef _STLP_NO_WCHAR_T
317 impl->
insert( i2, _STLP_STD::ctype<wchar_t>::id);
318 impl->
insert( i2, _STLP_STD::codecvt<wchar_t, char, mbstate_t>::id);
322 impl->
insert( i2, _STLP_STD::moneypunct<char, true>::id);
323 impl->
insert( i2, _STLP_STD::moneypunct<char, false>::id);
326# ifndef _STLP_NO_WCHAR_T
327 impl->
insert( i2, _STLP_STD::moneypunct<wchar_t, true>::id);
328 impl->
insert( i2, _STLP_STD::moneypunct<wchar_t, false>::id);
334 impl->
insert( i2, _STLP_STD::numpunct<char>::id);
337# ifndef _STLP_NO_WCHAR_T
338 impl->
insert( i2, _STLP_STD::numpunct<wchar_t>::id);
346# ifndef _STLP_NO_WCHAR_T
352 impl->
insert( i2, _STLP_STD::messages<char>::id);
353# ifndef _STLP_NO_WCHAR_T
354 impl->
insert( i2, _STLP_STD::messages<wchar_t>::id);
369 if (this->_M_impl !=
L._M_impl) {
399 return !(*
this ==
L);
408#if !defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND)
420#if !defined(_STLP_NO_LOCALE_SUPPORT)
426#if !defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND)
433#if !defined (_STLP_STATIC_CONST_INIT_BUG) && !defined (_STLP_NO_STATIC_CONST_DEFINITION)
bool __locale_do_operator_call(const locale &__loc, const basic_string< _CharT, _Traits, _Alloc > &__x, const basic_string< _CharT, _Traits, _Alloc > &__y)
_STLP_DECLSPEC _Locale_impl *_STLP_CALL _get_Locale_impl(_Locale_impl *locimpl)
#define _STLP_THROW_BAD_ALLOC
#define _STLP_ATOMIC_INCREMENT(__x)
#define _STLP_MUTEX_INITIALIZER
int strcmp(const char *String1, const char *String2)
_Locale_name_hint * insert_numeric_facets(const char *&name, char *buf, _Locale_name_hint *hint)
static void _STLP_FUNCTION_THROWS _STLP_CALL _M_throw_bad_cast()
locale::facet * insert(locale::facet *, const locale::id &n)
_Locale_name_hint * insert_ctype_facets(const char *&name, char *buf, _Locale_name_hint *hint)
vector< locale::facet * > facets_vec
basic_string< char, char_traits< char >, allocator< char > > name
_Locale_name_hint * insert_messages_facets(const char *&name, char *buf, _Locale_name_hint *hint)
_Locale_name_hint * insert_collate_facets(const char *&name, char *buf, _Locale_name_hint *hint)
_Locale_name_hint * insert_monetary_facets(const char *&name, char *buf, _Locale_name_hint *hint)
_Locale_name_hint * insert_time_facets(const char *&name, char *buf, _Locale_name_hint *hint)
const _CharT * c_str() const
static void _STLP_FUNCTION_THROWS _STLP_CALL _M_throw_on_null_name()
bool operator!=(const locale &) const
static locale _STLP_CALL global(const locale &)
facet * _M_use_facet(const id &) const
static void _STLP_FUNCTION_THROWS _STLP_CALL _M_throw_on_creation_failure(int __err_code, const char *name, const char *facet)
void _M_insert(facet *__f, id &__id)
bool operator()(const string &__x, const string &__y) const
facet * _M_get_facet(const id &) const
bool operator==(const locale &) const
const locale & operator=(const locale &) _STLP_NOTHROW
static void _STLP_FUNCTION_THROWS _STLP_CALL _M_throw_on_combine_error(const string &name)
static const locale &_STLP_CALL classic()
friend class _Locale_impl
#define _STLP_UNWIND(action)
#define _STLP_STATIC_MUTEX
#define __STATIC_CAST(__x, __y)
#define _STLP_BEGIN_NAMESPACE
#define _STLP_END_NAMESPACE
GLenum GLuint GLenum GLsizei const GLchar * buf
#define _STLP_LOC_UNSUPPORTED_FACET_CATEGORY
#define _Locale_MAX_SIMPLE_NAME
char const * _Locale_extract_numeric_name(const char *cname, char *__buf, struct _Locale_name_hint *__hint, int *__err_code)
char const * _Locale_extract_monetary_name(const char *cname, char *__buf, struct _Locale_name_hint *__hint, int *__err_code)
char const * _Locale_extract_time_name(const char *cname, char *__buf, struct _Locale_name_hint *__hint, int *__err_code)
#define _STLP_LOC_NO_MEMORY
char const * _Locale_extract_collate_name(const char *cname, char *__buf, struct _Locale_name_hint *__hint, int *__err_code)
#define _STLP_LOC_UNKNOWN_NAME
char const * _Locale_extract_ctype_name(const char *cname, char *__buf, struct _Locale_name_hint *__hint, int *__err_code)
char const * _Locale_extract_messages_name(const char *cname, char *__buf, struct _Locale_name_hint *__hint, int *__err_code)
#define _STLP_LOC_NO_PLATFORM_SUPPORT
void _STLP_CALL _release_Locale_impl(_Locale_impl *&loc)
static bool is_C_locale_name(const char *name)
locale * _Stl_get_global_locale()
static const locale::id & _Stl_loc_get_index(locale::id &id)
static void _Stl_loc_combine_names(_Locale_impl *L, const char *name1, const char *name2, locale::category c)
static void _Stl_loc_combine_names_aux(_Locale_impl *L, const char *name, const char *ctype_name, const char *time_name, const char *numeric_name, const char *collate_name, const char *monetary_name, const char *messages_name, locale::category c)
locale * _Stl_get_classic_locale()
static _STLP_BEGIN_NAMESPACE const string _Nameless("*")