Exemplo n.º 1
0
// Create a locale from a name.
                _STLP_EXP_DECLSPEC locale::locale(const char* name)
                    : _M_impl(0)
                {
                    if (!name)
                        _M_throw_runtime_error(0);
                    else if(strcmp(name,"")==0)
                        name = _Locale_ctype_default(NULL);

                    _Locale* impl = 0;

                    _STLP_TRY {
#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
impl = new _Locale(get_locale_id_S_max(), name);
# else
impl = new _Locale(locale::id::_S_max, name);
# endif


                        // Insert categories one at a time.
                        impl->insert_ctype_facets(name);
                        impl->insert_numeric_facets(name);
                        impl->insert_time_facets(name);
                        impl->insert_collate_facets(name);
                        impl->insert_monetary_facets(name);
                        impl->insert_messages_facets(name);
                        // reassign impl
                        _M_impl = impl;
                    }
                    _STLP_UNWIND(delete impl);
                }
Exemplo n.º 2
0
// Create a locale from a name.
locale::locale(const char* name)
  : _M_impl(0) {
  if (!name)
    _M_throw_runtime_error(0);

  if (is_C_locale_name(name)) {
    _M_impl = _get_Locale_impl( locale::classic()._M_impl );
    return;
  }

  _Locale_impl* impl = 0;
  _STLP_TRY {
    impl = new _Locale_impl(locale::id::_S_max, name);

    // Insert categories one at a time.
    impl->insert_ctype_facets(name);
    impl->insert_numeric_facets(name);
    impl->insert_time_facets(name);
    impl->insert_collate_facets(name);
    impl->insert_monetary_facets(name);
    impl->insert_messages_facets(name);
    // reassign impl
    _M_impl = _get_Locale_impl( impl );
  }
  _STLP_UNWIND(delete impl);
}
Exemplo n.º 3
0
void _Locale_impl::insert_messages_facets(const char* pname) {
  _Locale_impl* i2 = locale::classic()._M_impl;
  messages<char> *msg = 0;
#ifndef _STLP_NO_WCHAR_T
  messages<wchar_t> *wmsg = 0;
#endif

  char buf[_Locale_MAX_SIMPLE_NAME];
  if (pname == 0 || pname[0] == 0)
    pname = _Locale_messages_default(buf);

  if (pname == 0 || pname[0] == 0 || is_C_locale_name(pname)) {
    this->insert(i2, messages<char>::id);
#ifndef _STLP_NO_WCHAR_T
    this->insert(i2, messages<wchar_t>::id);
#endif
  }
  else {
    _STLP_TRY {
      msg  = new messages_byname<char>(pname);
#ifndef _STLP_NO_WCHAR_T
      wmsg = new messages_byname<wchar_t>(pname);
#endif
    }
#ifndef _STLP_NO_WCHAR_T
    _STLP_UNWIND(delete msg; delete wmsg);
#else
    _STLP_UNWIND(delete msg);
#endif
    _Locale_insert(this,msg);
#ifndef _STLP_NO_WCHAR_T
    _Locale_insert(this,wmsg);
#endif
  }
}
Exemplo n.º 4
0
Arquivo: _tree.c Projeto: Arkshine/NS
template <class _Key, class _Value, class _KeyOfValue, class _Compare, class _Alloc> _Rb_tree_node<_Value>* 
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc> ::_M_copy(_Rb_tree_node<_Value>* __x, _Rb_tree_node<_Value>* __p)
{
                        // structural copy.  __x and __p must be non-null.
  _Link_type __top = _M_clone_node(__x);
  __top->_M_parent = __p;
  
  _STLP_TRY {
    if (__x->_M_right)
      __top->_M_right = _M_copy(_S_right(__x), __top);
    __p = __top;
    __x = _S_left(__x);

    while (__x != 0) {
      _Link_type __y = _M_clone_node(__x);
      __p->_M_left = __y;
      __y->_M_parent = __p;
      if (__x->_M_right)
        __y->_M_right = _M_copy(_S_right(__x), __y);
      __p = __y;
      __x = _S_left(__x);
    }
  }
  _STLP_UNWIND(_M_erase(__top));

  return __top;
}
Exemplo n.º 5
0
// Change the string's capacity so that it is large enough to hold
//  at least __res_arg elements, plus the terminating _CharT().  Note that,
//  if __res_arg < capacity(), this member function may actually decrease
//  the string's capacity.
template <class _CharT, class _Traits, class _Alloc> void basic_string<_CharT,_Traits,_Alloc>::reserve(size_type __res_arg) {

  if (__res_arg >= capacity())
    {      
      if (__res_arg > max_size())
	this->_M_throw_length_error();

      size_type __n = __res_arg + 1;
      pointer __new_start = this->_M_end_of_storage.allocate(__n);
      pointer __new_finish = __new_start;
      
      _STLP_TRY {
	__new_finish = uninitialized_copy(this->_M_start, this->_M_finish, __new_start);
	_M_construct_null(__new_finish);
      }
      _STLP_UNWIND((_STLP_STD::_Destroy(__new_start, __new_finish), 
		    this->_M_end_of_storage.deallocate(__new_start, __n)));
      
      _STLP_STD::_Destroy(this->_M_start, this->_M_finish + 1);
      this->_M_deallocate_block();
      this->_M_start = __new_start;
      this->_M_finish = __new_finish;
      this->_M_end_of_storage._M_data = __new_start + __n;
    }
}
Exemplo n.º 6
0
void deque<_Tp, _Alloc >::_M_fill_insert(iterator __pos, size_type __n, const value_type& __x )
{
  if (__pos._M_cur == this->_M_start._M_cur) {
    iterator __new_start = _M_reserve_elements_at_front(__n);
    _STLP_TRY {
      uninitialized_fill(__new_start, this->_M_start, __x);
    }
    _STLP_UNWIND(this->_M_destroy_nodes(__new_start._M_node, this->_M_start._M_node))
    this->_M_start = __new_start;
  } else if (__pos._M_cur == this->_M_finish._M_cur) {
Exemplo n.º 7
0
void
_Deque_base<_Tp,_Alloc>::_M_create_nodes(_Tp** __nstart,
        _Tp** __nfinish)
{
    _Tp** __cur;
    _STLP_TRY {
        for (__cur = __nstart; __cur < __nfinish; ++__cur)
            *__cur = _M_map_size.allocate(this->buffer_size());
    }
    _STLP_UNWIND(_M_destroy_nodes(__nstart, __cur));
}
Exemplo n.º 8
0
void deque<_Tp, _Alloc >::_M_fill_insert(iterator __pos,
                                         size_type __n, const value_type& __x) {
#if !defined (_STLP_NO_MOVE_SEMANTIC)
  typedef typename __move_traits<_Tp>::implemented _Movable;
#endif
  if (__pos._M_cur == this->_M_start._M_cur) {
    iterator __new_start = _M_reserve_elements_at_front(__n);
    _STLP_TRY {
      uninitialized_fill(__new_start, this->_M_start, __x);
    }
    _STLP_UNWIND(this->_M_destroy_nodes(__new_start._M_node, this->_M_start._M_node))
    this->_M_start = __new_start;
  }
Exemplo n.º 9
0
// Create a locale from a name.
locale::locale(const char* name)
  : _M_impl(0) {
  if (!name)
    _M_throw_on_null_name();

  if (is_C_locale_name(name)) {
    _M_impl = _get_Locale_impl( locale::classic()._M_impl );
    return;
  }

  _Locale_impl* impl = 0;
  _STLP_TRY {
    impl = new _Locale_impl(locale::id::_S_max, name);

    // Insert categories one at a time.
    _Locale_name_hint *hint = 0;
    const char* ctype_name = name;
    char ctype_buf[_Locale_MAX_SIMPLE_NAME];
    const char* numeric_name = name;
    char numeric_buf[_Locale_MAX_SIMPLE_NAME];
    const char* time_name = name;
    char time_buf[_Locale_MAX_SIMPLE_NAME];
    const char* collate_name = name;
    char collate_buf[_Locale_MAX_SIMPLE_NAME];
    const char* monetary_name = name;
    char monetary_buf[_Locale_MAX_SIMPLE_NAME];
    const char* messages_name = name;
    char messages_buf[_Locale_MAX_SIMPLE_NAME];
    hint = impl->insert_ctype_facets(ctype_name, ctype_buf, hint);
    hint = impl->insert_numeric_facets(numeric_name, numeric_buf, hint);
    hint = impl->insert_time_facets(time_name, time_buf, hint);
    hint = impl->insert_collate_facets(collate_name, collate_buf, hint);
    hint = impl->insert_monetary_facets(monetary_name, monetary_buf, hint);
    impl->insert_messages_facets(messages_name, messages_buf, hint);

    // Try to use a normalize locale name in order to have the == operator
    // to behave correctly:
    if (strcmp(ctype_name, numeric_name) == 0 &&
        strcmp(ctype_name, time_name) == 0 &&
        strcmp(ctype_name, collate_name) == 0 &&
        strcmp(ctype_name, monetary_name) == 0 &&
        strcmp(ctype_name, messages_name) == 0) {
      impl->name = ctype_name;
    }
    // else we keep current name.

    // reassign impl
    _M_impl = _get_Locale_impl( impl );
  }
  _STLP_UNWIND(delete impl);
}
Exemplo n.º 10
0
template <class _CharT, class _Traits, class _Alloc> basic_string<_CharT,_Traits,_Alloc>& basic_string<_CharT,_Traits,_Alloc>::append(size_type __n, _CharT __c) {
  if (__n > max_size() || size() > max_size() - __n)
    this->_M_throw_length_error();
  if (size() + __n > capacity())
    reserve(size() + (max)(size(), __n));
  if (__n > 0) {
    uninitialized_fill_n(this->_M_finish + 1, __n - 1, __c);
    _STLP_TRY {
      _M_construct_null(this->_M_finish + __n);
    }
    _STLP_UNWIND(_Destroy(this->_M_finish + 1, this->_M_finish + __n));
    _Traits::assign(*end(), __c);
    this->_M_finish += __n;
  }
Exemplo n.º 11
0
                                                void _Locale::insert_collate_facets(const char* nam)
                                                {
                                                    _Locale_impl* i2 = locale::classic()._M_impl;

                                                    collate<char>*    col  = 0;
# ifndef _STLP_NO_WCHAR_T
collate<wchar_t>* wcol = 0;
# endif

                                                    char buf[_Locale_MAX_SIMPLE_NAME];
                                                    if (nam == 0 || nam[0] == 0)
                                                        nam = _Locale_collate_default(buf);

                                                    if (nam == 0 || nam[0] == 0 || strcmp(nam, "C") == 0) {
#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
this->insert(i2, collate<char>::GetFacetLocaleId());
#else
this->insert(i2, collate<char>::id);
#endif
# ifndef _STLP_NO_WCHAR_T
#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
this->insert(i2, collate<wchar_t>::GetFacetLocaleId());
#else
this->insert(i2, collate<wchar_t>::id);
#endif //__LIBSTD_CPP_SYMBIAN32_WSD__    
# endif//_STLP_NO_WCHAR_T
} 
else {
_STLP_TRY {
col   = new collate_byname<char>(nam);
# ifndef _STLP_NO_WCHAR_T
wcol  = new collate_byname<wchar_t>(nam);
# endif
}
# ifndef _STLP_NO_WCHAR_T
_STLP_UNWIND(delete col; delete wcol);
# else
_STLP_UNWIND(delete col);
# endif
_Locale_insert(this,col);
# ifndef _STLP_NO_WCHAR_T
_Locale_insert(this,wcol);
# endif
}
}
Exemplo n.º 12
0
                                                                void _Locale::insert_messages_facets(const char* pname)
                                                                {
                                                                    _Locale_impl* i2 = locale::classic()._M_impl;
                                                                    messages<char>*    msg  = 0;
# ifndef _STLP_NO_WCHAR_T
messages<wchar_t>* wmsg = 0;
# endif

                                                                    char buf[_Locale_MAX_SIMPLE_NAME];
                                                                    if (pname == 0 || pname[0] == 0)
                                                                        pname = _Locale_messages_default(buf);

                                                                    if (pname == 0 || pname[0] == 0 || strcmp(pname, "C") == 0) {
#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
this->insert(i2, messages<char>::GetFacetLocaleId());
#else
this->insert(i2, messages<char>::id);
#endif
# ifndef _STLP_NO_WCHAR_T
#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
this->insert(i2, messages<wchar_t>::GetFacetLocaleId());
#else
this->insert(i2, messages<wchar_t>::id);
#endif  //__LIBSTD_CPP_SYMBIAN32_WSD__   
# endif //!_STLP_NO_WCHAR_T
} 
else {
_STLP_TRY {
msg  = new messages_byname<char>(pname);
# ifndef _STLP_NO_WCHAR_T
wmsg = new messages_byname<wchar_t>(pname);
# endif
}
# ifndef _STLP_NO_WCHAR_T
_STLP_UNWIND(delete msg; delete wmsg);
# else
_STLP_UNWIND(delete msg);
# endif
_Locale_insert(this,msg);
# ifndef _STLP_NO_WCHAR_T
_Locale_insert(this,wmsg);
# endif
}
}
Exemplo n.º 13
0
void _Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t __num_elements) {
  size_t __num_nodes = __num_elements / this->buffer_size() + 1 ;

  _M_map_size._M_data = (max)((size_t) _S_initial_map_size, __num_nodes + 2);
  _M_map._M_data = _M_map.allocate(_M_map_size._M_data);

  _Tp** __nstart = _M_map._M_data + (_M_map_size._M_data - __num_nodes) / 2;
  _Tp** __nfinish = __nstart + __num_nodes;

  _STLP_TRY {
    _M_create_nodes(__nstart, __nfinish);
  }
  _STLP_UNWIND((_M_map.deallocate(_M_map._M_data, _M_map_size._M_data),
                _M_map._M_data = 0, _M_map_size._M_data = 0))
  _M_start._M_set_node(__nstart);
  this->_M_finish._M_set_node(__nfinish - 1);
  _M_start._M_cur = _M_start._M_first;
  this->_M_finish._M_cur = this->_M_finish._M_first + __num_elements % this->buffer_size();
}
Exemplo n.º 14
0
_Locale_name_hint* _Locale_impl::insert_collate_facets(const char* nam, _Locale_name_hint* hint) {
  _Locale_impl* i2 = locale::classic()._M_impl;

  collate<char> *col = 0;
#ifndef _STLP_NO_WCHAR_T
  collate<wchar_t> *wcol = 0;
#endif

  char buf[_Locale_MAX_SIMPLE_NAME];
  if (nam == 0 || nam[0] == 0)
    nam = _Locale_collate_default(buf);

  if (nam == 0 || nam[0] == 0 || is_C_locale_name(nam)) {
    this->insert(i2, collate<char>::id);
#ifndef _STLP_NO_WCHAR_T
    this->insert(i2, collate<wchar_t>::id);
#endif
  }
  else {
    _STLP_TRY {
      collate_byname<char> *colbn = _CHECK_PTR(new collate_byname<char>(nam, 0, hint));
      col   = colbn;
#if !defined (__DMC__)
      if (hint == 0) hint = _Locale_extract_hint(colbn);
#endif
#ifndef _STLP_NO_WCHAR_T
      wcol  = _CHECK_PTR(new collate_byname<wchar_t>(nam, 0, hint));
#endif
    }
#ifndef _STLP_NO_WCHAR_T
    _STLP_UNWIND(delete col; delete wcol);
#else
    _STLP_UNWIND(delete col);
#endif
    _Locale_insert(this,col);
#ifndef _STLP_NO_WCHAR_T
    _Locale_insert(this,wcol);
#endif
  }
  return hint;
}
Exemplo n.º 15
0
void _VECTOR_IMPL<_Tp, _Alloc>::_M_insert_overflow_aux(pointer __pos, const _Tp& __x, const __false_type& /*NOT TO USE!!*/,
                                                       size_type __fill_len, bool __atend ) {
  const size_type __old_size = size();
  const size_type __len = __old_size + (max)(__old_size, __fill_len);

  pointer __new_start = this->_M_end_of_storage.allocate(__len);
  pointer __new_finish = __new_start;
  _STLP_TRY {
    __new_finish = __uninitialized_move(this->_M_start, __pos, __new_start, _TrivialUCpy(), _Movable());
    // handle insertion
    if (__fill_len == 1) {
      _Copy_Construct(__new_finish, __x);
      ++__new_finish;
    } else
      __new_finish = __uninitialized_fill_n(__new_finish, __fill_len, __x, __false_type());
    if (!__atend)
      __new_finish = __uninitialized_move(__pos, this->_M_finish, __new_finish, _TrivialUCpy(), _Movable()); // copy remainder
  }
  _STLP_UNWIND((_STLP_STD::_Destroy_Range(__new_start,__new_finish),
               this->_M_end_of_storage.deallocate(__new_start,__len)))
  _M_clear_after_move();
  _M_set(__new_start, __new_finish, __new_start + __len);
}
Exemplo n.º 16
0
void _Locale_impl::insert_collate_facets(const char* nam) {
  _Locale_impl* i2 = locale::classic()._M_impl;

  collate<char> *col = 0;
#ifndef _STLP_NO_WCHAR_T
  collate<wchar_t> *wcol = 0;
#endif

  char buf[_Locale_MAX_SIMPLE_NAME];
  if (nam == 0 || nam[0] == 0)
    nam = _Locale_collate_default(buf);

  if (nam == 0 || nam[0] == 0 || is_C_locale_name(nam)) {
    this->insert(i2, collate<char>::id);
#ifndef _STLP_NO_WCHAR_T
    this->insert(i2, collate<wchar_t>::id);
#endif
  }
  else {
    _STLP_TRY {
      col   = new collate_byname<char>(nam);
#ifndef _STLP_NO_WCHAR_T
      wcol  = new collate_byname<wchar_t>(nam);
#endif
    }
#ifndef _STLP_NO_WCHAR_T
    _STLP_UNWIND(delete col; delete wcol);
#else
    _STLP_UNWIND(delete col);
#endif
    _Locale_insert(this,col);
#ifndef _STLP_NO_WCHAR_T
    _Locale_insert(this,wcol);
#endif
  }
}
Exemplo n.º 17
0
/*
 * Six functions, one for each category.  Each of them takes a
 * _Locale* and a name, constructs that appropriate category
 * facets by name, and inserts them into the locale.
 */
_Locale_name_hint* _Locale_impl::insert_ctype_facets(const char* pname, _Locale_name_hint* hint) {
  char buf[_Locale_MAX_SIMPLE_NAME];
  _Locale_impl* i2 = locale::classic()._M_impl;

  if (pname == 0 || pname[0] == 0)
    pname = _Locale_ctype_default(buf);

  if (pname == 0 || pname[0] == 0 || is_C_locale_name(pname)) {
    this->insert(i2, ctype<char>::id);
#ifndef _STLP_NO_MBSTATE_T
    this->insert(i2, codecvt<char, char, mbstate_t>::id);
#endif
#ifndef _STLP_NO_WCHAR_T
    this->insert(i2, ctype<wchar_t>::id);
#  ifndef _STLP_NO_MBSTATE_T
    this->insert(i2, codecvt<wchar_t, char, mbstate_t>::id);
#  endif
#endif
  } else {
    ctype<char>*    ct                      = 0;
#ifndef _STLP_NO_MBSTATE_T
    codecvt<char, char, mbstate_t>*    cvt  = 0;
#endif
#ifndef _STLP_NO_WCHAR_T
    ctype<wchar_t>* wct                     = 0;
    codecvt<wchar_t, char, mbstate_t>* wcvt = 0;
#endif
    _STLP_TRY {
      ctype_byname<char> *ctbn = _CHECK_PTR(new ctype_byname<char>(pname, 0, hint));
      ct   = ctbn;
#if !defined (__DMC__)
      if (hint == 0) hint = _Locale_extract_hint(ctbn);
#endif
#ifndef _STLP_NO_MBSTATE_T
      cvt  = _CHECK_PTR(new codecvt_byname<char, char, mbstate_t>(pname));
#endif
#ifndef _STLP_NO_WCHAR_T
      wct  = _CHECK_PTR(new ctype_byname<wchar_t>(pname, 0, hint));
      wcvt = _CHECK_PTR(new codecvt_byname<wchar_t, char, mbstate_t>(pname, 0, hint));
#endif
    }

#ifndef _STLP_NO_WCHAR_T
#  ifdef _STLP_NO_MBSTATE_T
    _STLP_UNWIND(delete ct; delete wct; delete wcvt);
#  else
    _STLP_UNWIND(delete ct; delete wct; delete cvt; delete wcvt);
#  endif
#else
#  ifdef _STLP_NO_MBSTATE_T
    _STLP_UNWIND(delete ct);
#  else
    _STLP_UNWIND(delete ct; delete cvt);
#  endif
#endif
    _Locale_insert(this, ct);
#ifndef _STLP_NO_MBSTATE_T
    _Locale_insert(this, cvt);
#endif
#ifndef _STLP_NO_WCHAR_T
    _Locale_insert(this, wct);
    _Locale_insert(this, wcvt);
#endif
  }
  return hint;
}
Exemplo n.º 18
0
/*
 * Six functions, one for each category.  Each of them takes a
 * _Locale* and a name, constructs that appropriate category
 * facets by name, and inserts them into the locale.
 */
void _Locale_impl::insert_ctype_facets(const char* pname) {
  char buf[_Locale_MAX_SIMPLE_NAME];
  _Locale_impl* i2 = locale::classic()._M_impl;

  if (pname == 0 || pname[0] == 0)
    pname = _Locale_ctype_default(buf);

  if (pname == 0 || pname[0] == 0 || is_C_locale_name(pname)) {
    this->insert(i2, ctype<char>::id);
#ifndef _STLP_NO_MBSTATE_T
    this->insert(i2, codecvt<char, char, mbstate_t>::id);
#endif
#ifndef _STLP_NO_WCHAR_T
    this->insert(i2, ctype<wchar_t>::id);
#  ifndef _STLP_NO_MBSTATE_T
    this->insert(i2, codecvt<wchar_t, char, mbstate_t>::id);
#  endif
#endif
  } else {
    ctype<char>*    ct                      = 0;
#ifndef _STLP_NO_MBSTATE_T
    codecvt<char, char, mbstate_t>*    cvt  = 0;
#endif
#ifndef _STLP_NO_WCHAR_T
    ctype<wchar_t>* wct                     = 0;
    codecvt<wchar_t, char, mbstate_t>* wcvt = 0;
#endif
    _STLP_TRY {
      ct   = new ctype_byname<char>(pname);
#ifndef _STLP_NO_MBSTATE_T
      cvt  = new codecvt_byname<char, char, mbstate_t>(pname);
#endif
#ifndef _STLP_NO_WCHAR_T
      wct  = new ctype_byname<wchar_t>(pname);
      wcvt = new codecvt_byname<wchar_t, char, mbstate_t>(pname);
#endif
    }

#ifndef _STLP_NO_WCHAR_T
#  ifdef _STLP_NO_MBSTATE_T
    _STLP_UNWIND(delete ct; delete wct; delete wcvt);
#  else
    _STLP_UNWIND(delete ct; delete wct; delete cvt; delete wcvt);
#  endif
#else
#  ifdef _STLP_NO_MBSTATE_T
    _STLP_UNWIND(delete ct);
#  else
    _STLP_UNWIND(delete ct; delete cvt);
#  endif
#endif
    _Locale_insert(this, ct);
#ifndef _STLP_NO_MBSTATE_T
    _Locale_insert(this, cvt);
#endif
#ifndef _STLP_NO_WCHAR_T
    _Locale_insert(this, wct);
    _Locale_insert(this, wcvt);
#endif
  }
}
Exemplo n.º 19
0
                        void _Locale::insert_ctype_facets(const char* pname)
                        {
                            char buf[_Locale_MAX_SIMPLE_NAME];
                            _Locale_impl* i2 = locale::classic()._M_impl;

                            if (pname == 0 || pname[0] == 0)
                                pname = _Locale_ctype_default(buf);

                            if (pname == 0 || pname[0] == 0 || strcmp(pname, "C") == 0) {
#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
this->insert(i2, ctype<char>::GetFacetLocaleId());
#else
this->insert(i2, ctype<char>::id);
#endif
# ifndef _STLP_NO_MBSTATE_T
#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
this->insert(i2, codecvt<char, char, mbstate_t>::GetFacetLocaleId());
#else
this->insert(i2, codecvt<char, char, mbstate_t>::id);
#endif //__LIBSTD_CPP_SYMBIAN32_WSD__
# endif //!_STLP_NO_MBSTATE_T
# ifndef _STLP_NO_WCHAR_T
#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
this->insert(i2, ctype<wchar_t>::GetFacetLocaleId());
#else
this->insert(i2, ctype<wchar_t>::id);
#endif //__LIBSTD_CPP_SYMBIAN32_WSD__   
# ifndef _STLP_NO_MBSTATE_T
#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
this->insert(i2, codecvt<wchar_t, char, mbstate_t>::GetFacetLocaleId());
#else
this->insert(i2, codecvt<wchar_t, char, mbstate_t>::id);
#endif //__LIBSTD_CPP_SYMBIAN32_WSD__   
# endif //!_STLP_NO_MBSTATE_T
# endif //!_STLP_NO_WCHAR_T
} 
else {
ctype<char>*    ct                      = 0;
# ifndef _STLP_NO_MBSTATE_T
codecvt<char, char, mbstate_t>*    cvt  = 0;
# endif
# ifndef _STLP_NO_WCHAR_T
ctype<wchar_t>* wct                     = 0;
codecvt<wchar_t, char, mbstate_t>* wcvt = 0;
# endif
_STLP_TRY {
ct   = new ctype_byname<char>(pname);
# ifndef _STLP_NO_MBSTATE_T
cvt  = new codecvt_byname<char, char, mbstate_t>(pname);
# endif
# ifndef _STLP_NO_WCHAR_T
wct  = new ctype_byname<wchar_t>(pname);
wcvt = new codecvt_byname<wchar_t, char, mbstate_t>(pname);
# endif
}

# ifndef _STLP_NO_WCHAR_T
#  ifdef _STLP_NO_MBSTATE_T
_STLP_UNWIND(delete ct; delete wct; delete wcvt);
#  else
_STLP_UNWIND(delete ct; delete wct; delete cvt; delete wcvt);
#  endif
# else
#  ifdef _STLP_NO_MBSTATE_T
_STLP_UNWIND(delete ct);
#  else
_STLP_UNWIND(delete ct; delete cvt);
#  endif
# endif
_Locale_insert(this, ct);
#  ifndef _STLP_NO_MBSTATE_T
_Locale_insert(this, cvt);
#  endif
#  ifndef _STLP_NO_WCHAR_T
_Locale_insert(this, wct);
_Locale_insert(this, wcvt);
#  endif
}
}