home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / src / num_put.cpp < prev    next >
C/C++ Source or Header  |  2001-08-03  |  2KB  |  84 lines

  1. /*
  2.  * Copyright (c) 1999
  3.  * Silicon Graphics Computer Systems, Inc.
  4.  *
  5.  * Copyright (c) 1999 
  6.  * Boris Fomitchev
  7.  *
  8.  * This material is provided "as is", with absolutely no warranty expressed
  9.  * or implied. Any use is at your own risk.
  10.  *
  11.  * Permission to use or copy this software for any purpose is hereby granted 
  12.  * without fee, provided the above notices are retained on all copies.
  13.  * Permission to modify the code and to distribute modified code is granted,
  14.  * provided the above notices are retained, and a notice that the code was
  15.  * modified is included with the above copyright notice.
  16.  *
  17.  */ 
  18.  
  19. # include "stlport_prefix.h"
  20. # include "num_put.h"
  21.  
  22. _STLP_BEGIN_NAMESPACE
  23.  
  24. //----------------------------------------------------------------------
  25. // num_put
  26.  
  27. extern const char __hex_char_table_lo[];
  28. extern const char __hex_char_table_hi[];
  29.  
  30. const char __hex_char_table_lo[18] = "0123456789abcdefx"; 
  31. const char __hex_char_table_hi[18] = "0123456789ABCDEFX";
  32.  
  33. char* _STLP_CALL
  34. __write_integer(char* buf, ios_base::fmtflags flags, long x)
  35. {
  36.   char tmp[64];
  37.   char* bufend = tmp+64;
  38.   char* beg = __write_integer_backward(bufend, flags, x);
  39.   return copy(beg, bufend, buf);
  40. }
  41.  
  42. ///-------------------------------------
  43.  
  44. ptrdiff_t _STLP_CALL
  45. __insert_grouping(char * first, char * last, const string& grouping,
  46.           char separator, char Plus, char Minus, int basechars)
  47. {
  48.   return __insert_grouping_aux(first, last, grouping, 
  49.                    separator, Plus, Minus, basechars);
  50. }
  51.  
  52. # ifndef _STLP_NO_WCHAR_T
  53.  
  54. ptrdiff_t _STLP_CALL
  55. __insert_grouping(wchar_t* first, wchar_t* last, const string& grouping,
  56.                   wchar_t separator, wchar_t Plus, wchar_t Minus,
  57.           int basechars)
  58. {
  59.   return __insert_grouping_aux(first, last, grouping, separator, 
  60.                    Plus, Minus, basechars);
  61. }
  62.  
  63. # endif
  64.  
  65.  
  66. //----------------------------------------------------------------------
  67. // Force instantiation of num_put<>
  68. #if !defined(_STLP_NO_FORCE_INSTANTIATE)
  69. template class _STLP_CLASS_DECLSPEC ostreambuf_iterator<char, char_traits<char> >;
  70. // template class num_put<char, char*>;
  71. template class num_put<char, ostreambuf_iterator<char, char_traits<char> > >;
  72. # ifndef _STLP_NO_WCHAR_T
  73. template class ostreambuf_iterator<wchar_t, char_traits<wchar_t> >;
  74. template class num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
  75. // template class num_put<wchar_t, wchar_t*>;
  76. # endif /* INSTANTIATE_WIDE_STREAMS */
  77. #endif
  78.  
  79. _STLP_END_NAMESPACE
  80.  
  81. // Local Variables:
  82. // mode:C++
  83. // End:
  84.