ctype_byname<wchar_t>::ctype_byname(const char* name, size_t refs) : ctype<wchar_t>(refs), _M_ctype(__acquire_ctype(name)) { if (!_M_ctype) locale::_M_throw_runtime_error(); }
_STLP_BEGIN_NAMESPACE //---------------------------------------------------------------------- // ctype_byname<char> ctype_byname<char>::ctype_byname(const char* name, size_t refs, _Locale_name_hint* hint) : ctype<char>( 0, false, refs) { if (!name) locale::_M_throw_runtime_error(name); _M_ctype = _STLP_PRIV __acquire_ctype(name, hint); if (!_M_ctype) locale::_M_throw_runtime_error(name); ctype<char>::_M_ctype_table = _M_byname_table; // We have to do this, instead of just pointer twiddling, because // ctype_base::mask isn't the same type as _Locale_mask_t. const _Locale_mask_t* p = _Locale_ctype_table(_M_ctype); if (!p) locale::_M_throw_runtime_error(); for (size_t i = 0; i < table_size; ++i) { _Locale_mask_t __m = p[i]; if (__m & (upper | lower)) __m |= alpha; _M_byname_table[i] = ctype_base::mask(__m); } }
//---------------------------------------------------------------------- // codecvt_byname<wchar_t> codecvt_byname<wchar_t, char, mbstate_t> ::codecvt_byname(const char* name, size_t refs, _Locale_name_hint* hint) : codecvt<wchar_t, char, mbstate_t>(refs), _M_ctype(_STLP_PRIV __acquire_ctype(name, hint)) { if (!_M_ctype) locale::_M_throw_runtime_error(); }
_STLP_MOVE_TO_STD_NAMESPACE ctype_byname<wchar_t>::ctype_byname(const char* name, size_t refs, _Locale_name_hint* hint) : ctype<wchar_t>(refs), _M_ctype(_STLP_PRIV __acquire_ctype(name, hint)) { if (!_M_ctype) locale::_M_throw_runtime_error(); }
_STLP_MOVE_TO_STD_NAMESPACE ctype_byname<wchar_t>::ctype_byname(const char* name, size_t refs) : ctype<wchar_t>(refs) { if (!name) locale::_M_throw_on_null_name(); int __err_code; char buf[_Locale_MAX_SIMPLE_NAME]; _M_ctype = _STLP_PRIV __acquire_ctype(name, buf, 0, &__err_code); if (!_M_ctype) locale::_M_throw_on_creation_failure(__err_code, name, "ctype"); }
_STLP_BEGIN_NAMESPACE //---------------------------------------------------------------------- // ctype_byname<char> ctype_byname<char>::ctype_byname(const char* name, size_t refs) : ctype<char>( 0, false, refs) { if (!name) locale::_M_throw_on_null_name(); int __err_code; char buf[_Locale_MAX_SIMPLE_NAME]; _M_ctype = _STLP_PRIV __acquire_ctype(name, buf, 0, &__err_code); if (!_M_ctype) locale::_M_throw_on_creation_failure(__err_code, name, "ctype"); _M_init(); }
ctype_byname<char>::ctype_byname(const char* name, size_t refs) : ctype<char>(_M_byname_table+1, false, refs), _M_ctype(__acquire_ctype(name)) { if (!_M_ctype) locale::_M_throw_runtime_error(); // We have to do this, instead of just pointer twiddling, because // ctype_base::mask isn't the same type as _Locale_mask_t. const _Locale_mask_t* p = _Locale_ctype_table(_M_ctype); if (!p) locale::_M_throw_runtime_error(); for (size_t i = 0; i < table_size + 1; ++i) { _Locale_mask_t __m = p[i]; if (__m & (upper | lower)) __m |= alpha; _M_byname_table[i] = ctype_base::mask(__m); } }