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.

48 lines
1.5 KiB

  1. // iomanip -- instantiations of iomanip
  2. #include <locale>
  3. #include <iomanip>
  4. _STD_BEGIN
  5. // function resetiosflags
  6. static void rsfun(ios_base& iostr, ios_base::fmtflags mask)
  7. {iostr.setf(ios_base::_Fmtzero, mask); }
  8. // function setiosflags
  9. static void sifun(ios_base& iostr, ios_base::fmtflags mask)
  10. {iostr.setf(ios_base::_Fmtmask, mask); }
  11. // function setbase
  12. static void sbfun(ios_base& iostr, int n)
  13. {iostr.setf(n == 8 ? ios_base::oct : n == 10 ? ios_base::dec
  14. : n == 16 ? ios_base::hex : ios_base::_Fmtzero,
  15. ios_base::basefield); }
  16. // function setprecision
  17. static void spfun(ios_base& iostr, streamsize n)
  18. {iostr.precision(n); }
  19. // function setw
  20. static void swfun(ios_base& iostr, streamsize n)
  21. {iostr.width(n); }
  22. _CRTIMP2 _Smanip<ios_base::fmtflags>
  23. __cdecl resetiosflags(ios_base::fmtflags mask)
  24. {return (_Smanip<ios_base::fmtflags>(&rsfun, mask)); }
  25. _CRTIMP2 _Smanip<ios_base::fmtflags>
  26. __cdecl setiosflags(ios_base::fmtflags mask)
  27. {return (_Smanip<ios_base::fmtflags>(&sifun, mask)); }
  28. _CRTIMP2 _Smanip<int> __cdecl setbase(int n)
  29. {return (_Smanip<int>(&sbfun, n)); }
  30. _CRTIMP2 _Smanip<streamsize> __cdecl setprecision(streamsize n)
  31. {return (_Smanip<streamsize>(&spfun, n)); }
  32. _CRTIMP2 _Smanip<streamsize> __cdecl setw(streamsize n)
  33. {return (_Smanip<streamsize>(&swfun, n)); }
  34. _STD_END
  35. /*
  36. * Copyright (c) 1994 by P.J. Plauger. ALL RIGHTS RESERVED.
  37. * Consult your license regarding permissions and restrictions.
  38. */