const char* _Loc_monetary_default(char* p) { return _Locale_monetary_default(p); }
示例#2
0
void _Locale_impl::insert_monetary_facets(const char* pname)
{
  moneypunct<char,    false>* punct   = 0;
  moneypunct<char,    true>*  ipunct  = 0;
  money_get<char, istreambuf_iterator<char, char_traits<char> > >*            get     = 0;
  money_put<char, ostreambuf_iterator<char, char_traits<char> > >*            put     = 0;

# ifndef __STL_NO_WCHAR_T
  moneypunct<wchar_t, false>* wpunct  = 0;
  moneypunct<wchar_t, true>*  wipunct = 0;
  money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >*         wget    = 0;
  money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >*         wput    = 0;
# endif

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

  if (pname == 0 || pname[0] == 0 || strcmp(pname, "C") == 0) {
    this->insert(_Stl_loc_classic_locale->_M_impl, moneypunct<char, false>::id);
    this->insert(_Stl_loc_classic_locale->_M_impl, moneypunct<char, true>::id);
    this->insert(_Stl_loc_classic_locale->_M_impl, money_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
    this->insert(_Stl_loc_classic_locale->_M_impl, money_put<char, ostreambuf_iterator<char, char_traits<char> > >::id);
# ifndef __STL_NO_WCHAR_T
    this->insert(_Stl_loc_classic_locale->_M_impl, moneypunct<wchar_t, false>::id);
    this->insert(_Stl_loc_classic_locale->_M_impl, moneypunct<wchar_t, true>::id);
    this->insert(_Stl_loc_classic_locale->_M_impl, money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
    this->insert(_Stl_loc_classic_locale->_M_impl, money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
# endif
  }
  else {    
    __STL_TRY {
      punct   = new moneypunct_byname<char, false>(pname);
      ipunct  = new moneypunct_byname<char, true>(pname);
      get     = new money_get<char, istreambuf_iterator<char, char_traits<char> > >;
      put     = new money_put<char, ostreambuf_iterator<char, char_traits<char> > >;
# ifndef __STL_NO_WCHAR_T
      wpunct  = new moneypunct_byname<wchar_t, false>(pname);
      wipunct = new moneypunct_byname<wchar_t, true>(pname);
      wget    = new money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
      wput    = new money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
# endif
    }
# ifndef __STL_NO_WCHAR_T
    __STL_UNWIND(delete punct; delete ipunct; delete wpunct; delete wipunct;
    delete get; delete wget; delete put; delete wput);
# else
    __STL_UNWIND(delete punct; delete ipunct; delete get; delete put);
# endif
    _Locale_impl_insert(this,punct);
    _Locale_impl_insert(this,ipunct);
    _Locale_impl_insert(this,get);
    _Locale_impl_insert(this,put);
# ifndef __STL_NO_WCHAR_T
    _Locale_impl_insert(this,wget);
    _Locale_impl_insert(this,wpunct);
    _Locale_impl_insert(this,wipunct);
    _Locale_impl_insert(this,wput);
# endif
  }
}
示例#3
0
_Locale_name_hint* _Locale_impl::insert_monetary_facets(const char* pname, _Locale_name_hint* hint) {
  _Locale_impl* i2 = locale::classic()._M_impl;

  moneypunct<char, false> *punct = 0;
  moneypunct<char, true> *ipunct = 0;
  money_get<char, istreambuf_iterator<char, char_traits<char> > > *get = 0;
  money_put<char, ostreambuf_iterator<char, char_traits<char> > > *put = 0;

#ifndef _STLP_NO_WCHAR_T
  moneypunct<wchar_t, false>* wpunct = 0;
  moneypunct<wchar_t, true>* wipunct = 0;
  money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > > *wget = 0;
  money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > > *wput = 0;
#endif

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

  if (pname == 0 || pname[0] == 0 || is_C_locale_name(pname)) {
    this->insert(i2, moneypunct<char, false>::id);
    this->insert(i2, moneypunct<char, true>::id);
    this->insert(i2, money_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
    this->insert(i2, money_put<char, ostreambuf_iterator<char, char_traits<char> > >::id);
#ifndef _STLP_NO_WCHAR_T
    this->insert(i2, moneypunct<wchar_t, false>::id);
    this->insert(i2, moneypunct<wchar_t, true>::id);
    this->insert(i2, money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
    this->insert(i2, money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
#endif
  }
  else {
    _STLP_TRY {
      moneypunct_byname<char, false>* punctbn = new moneypunct_byname<char, false>(pname, 0, hint);
      punct   = punctbn;
#if !defined (__DMC__)
      if (hint == 0) hint = _Locale_extract_hint(punctbn);
#endif
      ipunct  = _CHECK_PTR(new moneypunct_byname<char, true>(pname, 0, hint));
      get     = _CHECK_PTR(new money_get<char, istreambuf_iterator<char, char_traits<char> > >);
      put     = _CHECK_PTR(new money_put<char, ostreambuf_iterator<char, char_traits<char> > >);
#ifndef _STLP_NO_WCHAR_T
      wpunct  = _CHECK_PTR(new moneypunct_byname<wchar_t, false>(pname, 0, hint));
      wipunct = _CHECK_PTR(new moneypunct_byname<wchar_t, true>(pname, 0, hint));
      wget    = _CHECK_PTR(new money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >);
      wput    = _CHECK_PTR(new money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >);
#endif
    }
#ifndef _STLP_NO_WCHAR_T
    _STLP_UNWIND(delete punct; delete ipunct; delete wpunct; delete wipunct; delete get; delete wget; delete put; delete wput);
#else
    _STLP_UNWIND(delete punct; delete ipunct; delete get; delete put);
#endif
    _Locale_insert(this,punct);
    _Locale_insert(this,ipunct);
    _Locale_insert(this,get);
    _Locale_insert(this,put);
#ifndef _STLP_NO_WCHAR_T
    _Locale_insert(this,wget);
    _Locale_insert(this,wpunct);
    _Locale_insert(this,wipunct);
    _Locale_insert(this,wput);
#endif
  }
  return hint;
}
                                                        void _Locale::insert_monetary_facets(const char* pname)
                                                        {
                                                            _Locale_impl* i2 = locale::classic()._M_impl;

                                                            moneypunct<char,    false>* punct   = 0;
                                                            moneypunct<char,    true>*  ipunct  = 0;
                                                            money_get<char, istreambuf_iterator<char, char_traits<char> > >*            get     = 0;
                                                            money_put<char, ostreambuf_iterator<char, char_traits<char> > >*            put     = 0;

# ifndef _STLP_NO_WCHAR_T
moneypunct<wchar_t, false>* wpunct  = 0;
moneypunct<wchar_t, true>*  wipunct = 0;
money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >*         wget    = 0;
money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >*         wput    = 0;
# endif

                                                            char buf[_Locale_MAX_SIMPLE_NAME];
                                                            if (pname == 0 || pname[0] == 0)
                                                                pname = _Locale_monetary_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, moneypunct<char, false>::GetFacetLocaleId());
this->insert(i2, moneypunct<char, true>::GetFacetLocaleId());
this->insert(i2, money_get<char, istreambuf_iterator<char, char_traits<char> > >::GetFacetLocaleId());
this->insert(i2, money_put<char, ostreambuf_iterator<char, char_traits<char> > >::GetFacetLocaleId());
#else
this->insert(i2, moneypunct<char, false>::id);
this->insert(i2, moneypunct<char, true>::id);
this->insert(i2, money_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
this->insert(i2, money_put<char, ostreambuf_iterator<char, char_traits<char> > >::id);
#endif
# ifndef _STLP_NO_WCHAR_T
#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
this->insert( i2, moneypunct<wchar_t, false>::GetFacetLocaleId());
this->insert( i2, moneypunct<wchar_t, true>::GetFacetLocaleId());
this->insert(i2, money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::GetFacetLocaleId());
this->insert(i2, money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::GetFacetLocaleId());
#else
this->insert(i2, moneypunct<wchar_t, false>::id);
this->insert(i2, moneypunct<wchar_t, true>::id);
this->insert(i2, money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
this->insert(i2, money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
#endif //__LIBSTD_CPP_SYMBIAN32_WSD__     
# endif
} 
else {
_STLP_TRY {
punct   = new moneypunct_byname<char, false>(pname);
ipunct  = new moneypunct_byname<char, true>(pname);
get     = new money_get<char, istreambuf_iterator<char, char_traits<char> > >;
put     = new money_put<char, ostreambuf_iterator<char, char_traits<char> > >;
# ifndef _STLP_NO_WCHAR_T
wpunct  = new moneypunct_byname<wchar_t, false>(pname);
wipunct = new moneypunct_byname<wchar_t, true>(pname);
wget    = new money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
wput    = new money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
# endif
}
# ifndef _STLP_NO_WCHAR_T
_STLP_UNWIND(delete punct; delete ipunct; delete wpunct; delete wipunct;
delete get; delete wget; delete put; delete wput);
# else
_STLP_UNWIND(delete punct; delete ipunct; delete get; delete put);
# endif
_Locale_insert(this,punct);
_Locale_insert(this,ipunct);
_Locale_insert(this,get);
_Locale_insert(this,put);
# ifndef _STLP_NO_WCHAR_T
_Locale_insert(this,wget);
_Locale_insert(this,wpunct);
_Locale_insert(this,wipunct);
_Locale_insert(this,wput);
# endif
}
}