Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.9 KiB

  1. // xlocale -- class locale exotic char member functions
  2. #include <istream>
  3. #include <locale>
  4. _STD_BEGIN
  5. typedef char_traits<char> _Traits;
  6. typedef istreambuf_iterator<char, _Traits> _Initer;
  7. typedef ostreambuf_iterator<char, _Traits> _Outiter;
  8. // facets associated with C categories
  9. #define ADDFAC(T, cat, pi, pl) \
  10. if ((_CATMASK(T::_Getcat()) & cat) == 0) \
  11. ; \
  12. else if (pl == 0) \
  13. pi->_Addfac(new T(_Lobj), T::id); \
  14. else \
  15. pi->_Addfac((locale::facet *)&_USE(*pl, T), T::id);
  16. typedef collate<char> _T5;
  17. typedef messages<char> _T6;
  18. typedef money_get<char, _Initer> _T7;
  19. typedef money_put<char, _Outiter> _T9;
  20. typedef moneypunct<char, false> _T11;
  21. typedef moneypunct<char, true> _T12;
  22. typedef time_get<char, _Initer> _T13;
  23. typedef time_put<char, _Outiter> _T14;
  24. template<> locale::id collate<char>::id;
  25. template<> locale::id messages<char>::id;
  26. template<> locale::id money_get<char, _Initer>::id;
  27. template<> locale::id money_put<char, _Outiter>::id;
  28. template<> locale::id moneypunct<char, false>::id;
  29. template<> locale::id moneypunct<char, true>::id;
  30. template<> locale::id time_get<char, _Initer>::id;
  31. template<> locale::id time_put<char, _Outiter>::id;
  32. void __cdecl locale::_Locimp::_Makexloc(const _Locinfo& _Lobj,
  33. locale::category _C, _Locimp *_Pi, const locale *_Pl)
  34. { // setup exotic char part of a new locale
  35. _Lockit _Lk;
  36. ADDFAC(_T5, _C, _Pi, _Pl);
  37. ADDFAC(_T6, _C, _Pi, _Pl);
  38. ADDFAC(_T7, _C, _Pi, _Pl);
  39. ADDFAC(_T9, _C, _Pi, _Pl);
  40. ADDFAC(_T11, _C, _Pi, _Pl);
  41. ADDFAC(_T12, _C, _Pi, _Pl);
  42. ADDFAC(_T13, _C, _Pi, _Pl);
  43. ADDFAC(_T14, _C, _Pi, _Pl);
  44. }
  45. _STD_END
  46. /*
  47. * Copyright (c) 1995 by P.J. Plauger. ALL RIGHTS RESERVED.
  48. * Consult your license regarding permissions and restrictions.
  49. */