Source code of Windows XP (NT5)
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.

50 lines
1.5 KiB

  1. // xlocale -- class locale exotic char member functions
  2. #include <istream>
  3. #include <locale>
  4. #include <xdebug>
  5. _STD_BEGIN
  6. #pragma warning(disable: 4786)
  7. typedef char_traits<char> _Traits;
  8. typedef istreambuf_iterator<char, _Traits> _Initer;
  9. typedef ostreambuf_iterator<char, _Traits> _Outiter;
  10. // facets associated with C categories
  11. #define ADDFAC(Facet, cat, ptrimp, ptrloc) \
  12. if ((_CATMASK(Facet::_Getcat()) & cat) == 0) \
  13. ; \
  14. else if (ptrloc == 0) \
  15. ptrimp->_Addfac(_NEW_CRT Facet(lobj), Facet::id); \
  16. else \
  17. ptrimp->_Addfac((locale::facet *)&_USE(*ptrloc, Facet), Facet::id);
  18. // moved from locale to ease subsetting
  19. typedef collate<char> _T5;
  20. typedef messages<char> _T6;
  21. typedef money_get<char, _Initer> _T7;
  22. typedef money_put<char, _Outiter> _T9;
  23. typedef moneypunct<char, false> _T11;
  24. typedef moneypunct<char, true> _T12;
  25. typedef time_get<char, _Initer> _T13;
  26. typedef time_put<char, _Outiter> _T14;
  27. void __cdecl locale::_Locimp::_Makexloc(const _Locinfo& lobj,
  28. locale::category cat, _Locimp *ptrimp, const locale *ptrloc)
  29. { // setup exotic char part of a new locale
  30. ADDFAC(_T5, cat, ptrimp, ptrloc);
  31. ADDFAC(_T6, cat, ptrimp, ptrloc);
  32. ADDFAC(_T7, cat, ptrimp, ptrloc);
  33. ADDFAC(_T9, cat, ptrimp, ptrloc);
  34. ADDFAC(_T11, cat, ptrimp, ptrloc);
  35. ADDFAC(_T12, cat, ptrimp, ptrloc);
  36. ADDFAC(_T13, cat, ptrimp, ptrloc);
  37. ADDFAC(_T14, cat, ptrimp, ptrloc);
  38. }
  39. _STD_END
  40. /*
  41. * Copyright (c) 1992-2001 by P.J. Plauger. ALL RIGHTS RESERVED.
  42. * Consult your license regarding permissions and restrictions.
  43. V3.10:0009 */