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