ReactOS  0.4.14-dev-114-gc8cbd56
locale.cpp File Reference
#include "stlport_prefix.h"
#include <locale>
#include <stdexcept>
#include "c_locale.h"
#include "locale_impl.h"
Include dependency graph for locale.cpp:

Go to the source code of this file.

Functions

static _STLP_BEGIN_NAMESPACE const string _Nameless ("*")
 
static bool is_C_locale_name (const char *name)
 
locale_Stl_get_classic_locale ()
 
locale_Stl_get_global_locale ()
 
static const locale::id_Stl_loc_get_index (locale::id &id)
 
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)
 
static void _Stl_loc_combine_names (_Locale_impl *L, const char *name1, const char *name2, locale::category c)
 
static void _Stl_loc_combine_names (_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)
 

Function Documentation

◆ _Nameless()

static _STLP_BEGIN_NAMESPACE const string _Nameless ( "*"  )
static

◆ _Stl_get_classic_locale()

locale* _Stl_get_classic_locale ( )

Definition at line 598 of file locale_impl.cpp.

598  {
599  static _Locale_impl::Init init;
600  return _Stl_classic_locale;
601 }
static int init
Definition: wintirpc.c:33
static locale * _Stl_classic_locale

Referenced by locale::classic().

◆ _Stl_get_global_locale()

locale* _Stl_get_global_locale ( )

Definition at line 603 of file locale_impl.cpp.

603  {
604  static _Locale_impl::Init init;
605  return _Stl_global_locale;
606 }
static int init
Definition: wintirpc.c:33
static locale * _Stl_global_locale

Referenced by locale::global().

◆ _Stl_loc_combine_names() [1/2]

static void _Stl_loc_combine_names ( _Locale_impl L,
const char name1,
const char name2,
locale::category  c 
)
static

Definition at line 208 of file locale.cpp.

210  {
211  if ((c & locale::all) == 0 || strcmp(name1, name2) == 0)
212  L->name = name1;
213  else if ((c & locale::all) == locale::all)
214  L->name = name2;
215  else {
217  }
218 }
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)
Definition: locale.cpp:189
static WCHAR name1[]
Definition: record.c:34
const GLubyte * c
Definition: glext.h:8905
static const WCHAR L[]
Definition: oid.c:1250
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static WCHAR name2[]
Definition: record.c:35

Referenced by locale::locale().

◆ _Stl_loc_combine_names() [2/2]

static void _Stl_loc_combine_names ( _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 
)
static

Definition at line 220 of file locale.cpp.

224  {
225  if ((c & locale::all) == 0 || (strcmp(name, ctype_name) == 0 &&
226  strcmp(name, time_name) == 0 &&
227  strcmp(name, numeric_name) == 0 &&
228  strcmp(name, collate_name) == 0 &&
229  strcmp(name, monetary_name) == 0 &&
230  strcmp(name, messages_name) == 0))
231  L->name = name;
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;
238  else {
239  _Stl_loc_combine_names_aux(L, name, ctype_name, time_name, numeric_name, collate_name, monetary_name, messages_name, c);
240  }
241 }
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)
Definition: locale.cpp:189
const GLubyte * c
Definition: glext.h:8905
static const WCHAR L[]
Definition: oid.c:1250
Definition: name.c:36
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
GLuint const GLchar * name
Definition: glext.h:6031

◆ _Stl_loc_combine_names_aux()

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 
)
static

Definition at line 189 of file locale.cpp.

193  {
194  // This function is only called when names has been validated so using _Locale_extract_*_name
195  // can't fail.
196  int __err_code;
198  L->name = string("LC_CTYPE=") + _Locale_extract_ctype_name((c & locale::ctype) ? ctype_name : name, buf, 0, &__err_code) + ";";
199  L->name += string("LC_TIME=") + _Locale_extract_time_name((c & locale::time) ? time_name : name, buf, 0, &__err_code) + ";";
200  L->name += string("LC_NUMERIC=") + _Locale_extract_numeric_name((c & locale::numeric) ? numeric_name : name, buf, 0, &__err_code) + ";";
201  L->name += string("LC_COLLATE=") + _Locale_extract_collate_name((c & locale::collate) ? collate_name : name, buf, 0, &__err_code) + ";";
202  L->name += string("LC_MONETARY=") + _Locale_extract_monetary_name((c & locale::monetary) ? monetary_name : name, buf, 0, &__err_code) + ";";
203  L->name += string("LC_MESSAGES=") + _Locale_extract_messages_name((c & locale::messages) ? messages_name : name, buf, 0, &__err_code);
204 }
char const * _Locale_extract_monetary_name(const char *cname, char *__buf, struct _Locale_name_hint *__hint, int *__err_code)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
__u16 time
Definition: mkdosfs.c:366
char const * _Locale_extract_time_name(const char *cname, char *__buf, struct _Locale_name_hint *__hint, int *__err_code)
char const * _Locale_extract_collate_name(const char *cname, char *__buf, struct _Locale_name_hint *__hint, int *__err_code)
char const * _Locale_extract_ctype_name(const char *cname, char *__buf, struct _Locale_name_hint *__hint, int *__err_code)
const GLubyte * c
Definition: glext.h:8905
static const WCHAR L[]
Definition: oid.c:1250
char const * _Locale_extract_numeric_name(const char *cname, char *__buf, struct _Locale_name_hint *__hint, int *__err_code)
#define _Locale_MAX_SIMPLE_NAME
Definition: c_locale.h:54
char string[160]
Definition: util.h:11
Definition: name.c:36
char const * _Locale_extract_messages_name(const char *cname, char *__buf, struct _Locale_name_hint *__hint, int *__err_code)

Referenced by _Stl_loc_combine_names().

◆ _Stl_loc_get_index()

static const locale::id& _Stl_loc_get_index ( locale::id id)
static

Definition at line 102 of file locale.cpp.

102  {
103  if (id._M_index == 0) {
104 #if defined (_STLP_ATOMIC_INCREMENT) && !defined (_STLP_WIN95_LIKE)
106  id._M_index = _STLP_ATOMIC_INCREMENT(&_S_index);
107 #else
108  static _STLP_STATIC_MUTEX _Index_lock _STLP_MUTEX_INITIALIZER;
109  _STLP_auto_lock sentry(_Index_lock);
110  size_t new_index = locale::id::_S_max++;
111  id._M_index = new_index;
112 #endif
113  }
114  return id;
115 }
#define _STLP_STATIC_MUTEX
Definition: features.h:267
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
#define _STLP_VOLATILE
Definition: features.h:277
#define _STLP_MUTEX_INITIALIZER
Definition: _threads.h:241
GLenum GLuint id
Definition: glext.h:5579
size_t __stl_atomic_t
Definition: _threads.h:232
static size_t _S_max
Definition: _locale.h:104
#define _STLP_ATOMIC_INCREMENT(__x)
Definition: _sparc_atomic.h:57

Referenced by locale::_M_insert().

◆ is_C_locale_name()

static bool is_C_locale_name ( const char name)
inlinestatic

Definition at line 31 of file locale.cpp.

32 { return ((name[0] == 'C') && (name[1] == 0)); }
Definition: name.c:36

Referenced by locale::locale().