Exemplo n.º 1
0
void _Locale_impl::insert_collate_facets(const char* nam)
{
  collate<char>*    col  = 0;
# ifndef __STL_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) {
    this->insert(_Stl_loc_classic_locale->_M_impl, collate<char>::id);
# ifndef __STL_NO_WCHAR_T
    this->insert(_Stl_loc_classic_locale->_M_impl, collate<wchar_t>::id);
# endif
  }
  else {
    __STL_TRY {
      col   = new collate_byname<char>(nam);
# ifndef __STL_NO_WCHAR_T
      wcol  = new collate_byname<wchar_t>(nam); 
# endif
    }
# ifndef __STL_NO_WCHAR_T
    __STL_UNWIND(delete col; delete wcol);
# else
    __STL_UNWIND(delete col);
# endif
    _Locale_impl_insert(this,col);
# ifndef __STL_NO_WCHAR_T
    _Locale_impl_insert(this,wcol);
# endif
  }
}
Exemplo n.º 2
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.º 3
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.º 4
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
  }
}
 const char* _Loc_collate_default(char* p)  { return _Locale_collate_default(p); }