コード例 #1
0
ファイル: locale_impl.cpp プロジェクト: RenEvo/dead6
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
  }
}
コード例 #2
0
ファイル: locale_impl.cpp プロジェクト: jcemelanda/wormux
_Locale_name_hint* _Locale_impl::insert_time_facets(const char* pname, _Locale_name_hint* hint) {
  _Locale_impl* i2 = locale::classic()._M_impl;
  time_get<char, istreambuf_iterator<char, char_traits<char> > > *get = 0;
  time_put<char, ostreambuf_iterator<char, char_traits<char> > > *put = 0;
#ifndef _STLP_NO_WCHAR_T
  time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > > *wget = 0;
  time_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_time_default(buf);

  if (pname == 0 || pname[0] == 0 || is_C_locale_name(pname)) {

    this->insert(i2,
                 time_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
    this->insert(i2,
                 time_put<char, ostreambuf_iterator<char, char_traits<char> > >::id);
#ifndef _STLP_NO_WCHAR_T
    this->insert(i2,
                 time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
    this->insert(i2,
                 time_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
#endif
  } else {
    _STLP_TRY {
      time_get_byname<char, istreambuf_iterator<char, char_traits<char> > > *getbn =
        _CHECK_PTR(new time_get_byname<char, istreambuf_iterator<char, char_traits<char> > >(pname, 0, hint));
      get  = getbn;
#if !defined (__DMC__)
      if (hint == 0) hint = _Locale_time_extract_hint(getbn);
#endif
      put  = _CHECK_PTR(new time_put_byname<char, ostreambuf_iterator<char, char_traits<char> > >(pname, 0, hint));
#ifndef _STLP_NO_WCHAR_T
      wget = _CHECK_PTR(new time_get_byname<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >(pname, 0, hint));
      wput = _CHECK_PTR(new time_put_byname<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >(pname, 0, hint));
#endif
    }
#ifndef _STLP_NO_WCHAR_T
    _STLP_UNWIND(delete get; delete wget; delete put; delete wput);
#else
    _STLP_UNWIND(delete get; delete put);
#endif
    _Locale_insert(this,get);
    _Locale_insert(this,put);
#ifndef _STLP_NO_WCHAR_T
    _Locale_insert(this,wget);
    _Locale_insert(this,wput);
#endif
  }
  return hint;
}
コード例 #3
0
ファイル: locale_impl.cpp プロジェクト: RenEvo/dead6
void _Locale_impl::insert_time_facets(const char* pname) {
  _Locale_impl* i2 = locale::classic()._M_impl;
  time_get<char, istreambuf_iterator<char, char_traits<char> > > *get = 0;
  time_put<char, ostreambuf_iterator<char, char_traits<char> > > *put = 0;
#ifndef _STLP_NO_WCHAR_T
  time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > > *wget = 0;
  time_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_time_default(buf);

  if (pname == 0 || pname[0] == 0 || is_C_locale_name(pname)) {

    this->insert(i2,
                 time_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
    this->insert(i2,
                 time_put<char, ostreambuf_iterator<char, char_traits<char> > >::id);
#ifndef _STLP_NO_WCHAR_T
    this->insert(i2,
                 time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
    this->insert(i2,
                 time_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
#endif
  } else {
    _STLP_TRY {
      get  = new time_get_byname<char, istreambuf_iterator<char, char_traits<char> > >(pname);
      put  = new time_put_byname<char, ostreambuf_iterator<char, char_traits<char> > >(pname);
#ifndef _STLP_NO_WCHAR_T
      wget = new time_get_byname<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >(pname);
      wput = new time_put_byname<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >(pname);
#endif
    }
#ifndef _STLP_NO_WCHAR_T
    _STLP_UNWIND(delete get; delete wget; delete put; delete wput);
#else
    _STLP_UNWIND(delete get; delete put);
#endif
    _Locale_insert(this,get);
    _Locale_insert(this,put);
#ifndef _STLP_NO_WCHAR_T
    _Locale_insert(this,wget);
    _Locale_insert(this,wput);
#endif
  }
}
コード例 #4
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
}
}
コード例 #5
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
}
}
コード例 #6
0
ファイル: locale_impl.cpp プロジェクト: jcemelanda/wormux
_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;
}
コード例 #7
0
ファイル: locale_impl.cpp プロジェクト: RenEvo/dead6
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
  }
}
コード例 #8
0
ファイル: locale_impl.cpp プロジェクト: jcemelanda/wormux
_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;
}
コード例 #9
0
ファイル: locale_impl.cpp プロジェクト: jcemelanda/wormux
/*
 * 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;
}
コード例 #10
0
                                                        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
}
}
コード例 #11
0
                                        void _Locale::insert_time_facets(const char* pname)
                                        {
                                            _Locale_impl* i2 = locale::classic()._M_impl;
                                            time_get<char, istreambuf_iterator<char, char_traits<char> > >*    get  = 0;
                                            time_put<char, ostreambuf_iterator<char, char_traits<char> > >*    put  = 0;
# ifndef _STLP_NO_WCHAR_T
time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >* wget = 0;
time_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_time_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,
time_get<char, istreambuf_iterator<char, char_traits<char> > >::GetFacetLocaleId());
this->insert(i2,
time_put<char, ostreambuf_iterator<char, char_traits<char> > >::GetFacetLocaleId());
#else
this->insert(i2,
time_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
this->insert(i2,
time_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,
time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::GetFacetLocaleId());
this->insert(i2,
time_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::GetFacetLocaleId());
#else
this->insert(i2,
time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
this->insert(i2,
time_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
#endif
# endif //!_STLP_NO_WCHAR_T
} 
else {
_STLP_TRY {
get  = new time_get_byname<char, istreambuf_iterator<char, char_traits<char> > >(pname);
put  = new time_put_byname<char, ostreambuf_iterator<char, char_traits<char> > >(pname);
# ifndef _STLP_NO_WCHAR_T
wget = new time_get_byname<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >(pname);
wput = new time_put_byname<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >(pname);
# endif
}
# ifndef _STLP_NO_WCHAR_T
_STLP_UNWIND(delete get; delete wget; delete put; delete wput);
# else
_STLP_UNWIND(delete get; delete put);
# endif
_Locale_insert(this,get);
_Locale_insert(this,put);
# ifndef _STLP_NO_WCHAR_T
_Locale_insert(this,wget);
_Locale_insert(this,wput);
# endif
}
}
コード例 #12
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
}
}
コード例 #13
0
ファイル: locale_impl.cpp プロジェクト: RenEvo/dead6
void _Locale_impl::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 || 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 {
      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
  }
}
コード例 #14
0
ファイル: locale_impl.cpp プロジェクト: RenEvo/dead6
/*
 * 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
  }
}