/home/ntakagi/work/STLport-5.1.5/stlport/stl/_num_put.hGo to the documentation of this file.00001 /* 00002 * Copyright (c) 1999 00003 * Silicon Graphics Computer Systems, Inc. 00004 * 00005 * Copyright (c) 1999 00006 * Boris Fomitchev 00007 * 00008 * This material is provided "as is", with absolutely no warranty expressed 00009 * or implied. Any use is at your own risk. 00010 * 00011 * Permission to use or copy this software for any purpose is hereby granted 00012 * without fee, provided the above notices are retained on all copies. 00013 * Permission to modify the code and to distribute modified code is granted, 00014 * provided the above notices are retained, and a notice that the code was 00015 * modified is included with the above copyright notice. 00016 * 00017 */ 00018 // WARNING: This is an internal header file, included by other C++ 00019 // standard library headers. You should not attempt to use this header 00020 // file directly. 00021 00022 00023 #ifndef _STLP_INTERNAL_NUM_PUT_H 00024 #define _STLP_INTERNAL_NUM_PUT_H 00025 00026 #ifndef _STLP_INTERNAL_NUMPUNCT_H 00027 # include <stl/_numpunct.h> 00028 #endif 00029 00030 #ifndef _STLP_INTERNAL_CTYPE_H 00031 # include <stl/_ctype.h> 00032 #endif 00033 00034 #ifndef _STLP_INTERNAL_OSTREAMBUF_ITERATOR_H 00035 # include <stl/_ostreambuf_iterator.h> 00036 #endif 00037 00038 #ifndef _STLP_INTERNAL_IOSTREAM_STRING_H 00039 # include <stl/_iostream_string.h> 00040 #endif 00041 00042 _STLP_BEGIN_NAMESPACE 00043 00044 //---------------------------------------------------------------------- 00045 // num_put facet 00046 00047 #if defined (_STLP_LIMITED_DEFAULT_TEMPLATES) 00048 template <class _CharT, class _OutputIter> 00049 #else 00050 template <class _CharT, class _OutputIter = ostreambuf_iterator<_CharT, char_traits<_CharT> > > 00051 #endif 00052 class num_put: public locale::facet { 00053 friend class _Locale_impl; 00054 public: 00055 typedef _CharT char_type; 00056 typedef _OutputIter iter_type; 00057 00058 explicit num_put(size_t __refs = 0) : locale::facet(__refs) {} 00059 00060 #if !defined (_STLP_NO_BOOL) 00061 iter_type put(iter_type __s, ios_base& __f, char_type __fill, 00062 bool __val) const { 00063 return do_put(__s, __f, __fill, __val); 00064 } 00065 #endif 00066 iter_type put(iter_type __s, ios_base& __f, char_type __fill, 00067 long __val) const { 00068 return do_put(__s, __f, __fill, __val); 00069 } 00070 00071 iter_type put(iter_type __s, ios_base& __f, char_type __fill, 00072 unsigned long __val) const { 00073 return do_put(__s, __f, __fill, __val); 00074 } 00075 00076 #if defined (_STLP_LONG_LONG) 00077 iter_type put(iter_type __s, ios_base& __f, char_type __fill, 00078 _STLP_LONG_LONG __val) const { 00079 return do_put(__s, __f, __fill, __val); 00080 } 00081 00082 iter_type put(iter_type __s, ios_base& __f, char_type __fill, 00083 unsigned _STLP_LONG_LONG __val) const { 00084 return do_put(__s, __f, __fill, __val); 00085 } 00086 #endif 00087 00088 iter_type put(iter_type __s, ios_base& __f, char_type __fill, 00089 double __val) const { 00090 return do_put(__s, __f, __fill, (double)__val); 00091 } 00092 00093 #if !defined (_STLP_NO_LONG_DOUBLE) 00094 iter_type put(iter_type __s, ios_base& __f, char_type __fill, 00095 long double __val) const { 00096 return do_put(__s, __f, __fill, __val); 00097 } 00098 #endif 00099 00100 iter_type put(iter_type __s, ios_base& __f, char_type __fill, 00101 const void * __val) const { 00102 return do_put(__s, __f, __fill, __val); 00103 } 00104 00105 static _STLP_STATIC_MEMBER_DECLSPEC locale::id id; 00106 00107 protected: 00108 ~num_put() {} 00109 #if !defined (_STLP_NO_BOOL) 00110 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, bool __val) const; 00111 #endif 00112 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long __val) const; 00113 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, unsigned long __val) const; 00114 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, double __val) const; 00115 #if !defined (_STLP_NO_LONG_DOUBLE) 00116 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long double __val) const; 00117 #endif 00118 00119 #if defined (_STLP_LONG_LONG) 00120 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, _STLP_LONG_LONG __val) const; 00121 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, 00122 unsigned _STLP_LONG_LONG __val) const ; 00123 #endif 00124 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, const void* __val) const; 00125 }; 00126 00127 #if defined (_STLP_USE_TEMPLATE_EXPORT) 00128 _STLP_EXPORT_TEMPLATE_CLASS num_put<char, ostreambuf_iterator<char, char_traits<char> > >; 00129 // _STLP_EXPORT_TEMPLATE_CLASS num_put<char, char*>; 00130 # if !defined (_STLP_NO_WCHAR_T) 00131 _STLP_EXPORT_TEMPLATE_CLASS num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >; 00132 // _STLP_EXPORT_TEMPLATE_CLASS num_put<wchar_t, wchar_t*>; 00133 # endif 00134 #endif 00135 00136 #if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) 00137 00138 _STLP_MOVE_TO_PRIV_NAMESPACE 00139 00140 template <class _Integer> 00141 char* _STLP_CALL 00142 __write_integer_backward(char* __buf, ios_base::fmtflags __flags, _Integer __x); 00143 00144 /* 00145 * Returns the position on the right of the digits that has to be considered 00146 * for the application of the grouping policy. 00147 */ 00148 extern size_t _STLP_CALL __write_float(__iostring&, ios_base::fmtflags, int, double); 00149 # if !defined (_STLP_NO_LONG_DOUBLE) 00150 extern size_t _STLP_CALL __write_float(__iostring&, ios_base::fmtflags, int, long double); 00151 # endif 00152 00153 /* 00154 * Gets the digits of the integer part. 00155 */ 00156 void _STLP_CALL __get_floor_digits(__iostring&, _STLP_LONGEST_FLOAT_TYPE); 00157 00158 template <class _CharT> 00159 void _STLP_CALL __get_money_digits(_STLP_BASIC_IOSTRING(_CharT)&, ios_base&, _STLP_LONGEST_FLOAT_TYPE); 00160 00161 # if !defined (_STLP_NO_WCHAR_T) 00162 extern void _STLP_CALL __convert_float_buffer(__iostring const&, __iowstring&, const ctype<wchar_t>&, wchar_t, bool = true); 00163 # endif 00164 extern void _STLP_CALL __adjust_float_buffer(__iostring&, char); 00165 00166 extern char* _STLP_CALL 00167 __write_integer(char* buf, ios_base::fmtflags flags, long x); 00168 00169 extern ptrdiff_t _STLP_CALL __insert_grouping(char* first, char* last, const string&, char, char, char, int); 00170 extern void _STLP_CALL __insert_grouping(__iostring&, size_t, const string&, char, char, char, int); 00171 # if !defined (_STLP_NO_WCHAR_T) 00172 extern ptrdiff_t _STLP_CALL __insert_grouping(wchar_t*, wchar_t*, const string&, wchar_t, wchar_t, wchar_t, int); 00173 extern void _STLP_CALL __insert_grouping(__iowstring&, size_t, const string&, wchar_t, wchar_t, wchar_t, int); 00174 # endif 00175 00176 _STLP_MOVE_TO_STD_NAMESPACE 00177 00178 #endif /* _STLP_EXPOSE_STREAM_IMPLEMENTATION */ 00179 00180 _STLP_END_NAMESPACE 00181 00182 #if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION) 00183 # include <stl/_num_put.c> 00184 #endif 00185 00186 #endif /* _STLP_INTERNAL_NUMERIC_FACETS_H */ 00187 00188 // Local Variables: 00189 // mode:C++ 00190 // End:
Generated on Mon Mar 10 15:32:31 2008 by ![]() |