18#ifndef _STLP_NUM_PUT_C
19#define _STLP_NUM_PUT_C
21#ifndef _STLP_INTERNAL_NUM_PUT_H
25#ifndef _STLP_INTERNAL_LIMITS
40template <
class _CharT,
class _OutputIter>
46 _CharT __xplus, _CharT __xminus) {
47 if (__width <=
__last - __first)
48 return _STLP_STD::copy(__first,
__last, __oi);
53 if (__dir == ios_base::left) {
54 __oi = _STLP_STD::copy(__first,
__last, __oi);
57 else if (__dir == ios_base::internal && __first !=
__last &&
58 (*__first == __xplus || *__first == __xminus)) {
61 return _STLP_STD::copy(__first,
__last, __oi);
65 return _STLP_STD::copy(__first,
__last, __oi);
70#if !defined (_STLP_NO_WCHAR_T)
72template <
class _OutputIter>
76 wchar_t __decimal_point,
wchar_t __sep,
77 size_t __group_pos,
const string& __grouping) {
83 if (!__grouping.
empty()) {
85 __sep, __ct.widen(
'+'), __ct.widen(
'-'), 0);
94template <
class _OutputIter>
98 char __decimal_point,
char __sep,
99 size_t __group_pos,
const string& __grouping) {
100 if ((__group_pos < __str.
size()) && (__str[__group_pos] ==
'.')) {
101 __str[__group_pos] = __decimal_point;
104 if (!__grouping.
empty()) {
106 __grouping, __sep,
'+',
'-', 0);
113template <
class _CharT,
class _OutputIter,
class _Float>
116 _CharT
__fill, _Float __x) {
123 __np.decimal_point(), __np.thousands_sep(),
124 __group_pos, __np.grouping());
130#if !defined (_STLP_NO_WCHAR_T)
140template <
class _CharT>
146template <
class _CharT,
class _OutputIter>
151 _CharT __xplus, _CharT __xminus) {
153 return _STLP_STD::copy(__buf, __buf + __len, __oi);
163 if (__dir == ios_base::left) {
164 __oi = _STLP_STD::copy(__buf, __buf + __len, __oi);
167 else if (__dir == ios_base::internal && __len != 0 &&
168 (__buf[0] == __xplus || __buf[0] == __xminus)) {
171 return _STLP_STD::copy(__buf + 1, __buf + __len, __oi);
173 else if (__dir == ios_base::internal && __len >= 2 &&
174 (__flg & ios_base::showbase) &&
175 (__flg & ios_base::basefield) == ios_base::hex) {
179 return _STLP_STD::copy(__buf + 2, __buf + __len, __oi);
183 return _STLP_STD::copy(__buf, __buf + __len, __oi);
188#if !defined (_STLP_NO_WCHAR_T)
190template <
class _OutputIter>
198 wchar_t __xplus = __ct.widen(
'+');
199 wchar_t __xminus = __ct.widen(
'-');
202 __ct.widen(__buf, __iend, __wbuf);
204 wchar_t* __eend = __wbuf + __len;
207 const string& __grouping = __np.grouping();
209 if (!__grouping.empty()) {
211 if (__flags & ios_base::showbase)
212 switch (__flags & ios_base::basefield) {
213 case ios_base::hex: __basechars = 2;
break;
214 case ios_base::oct: __basechars = 1;
break;
215 default: __basechars = 0;
221 __xplus, __xminus, __basechars);
230template <
class _OutputIter>
238 const string& __grouping = __np.grouping();
240 if (!__grouping.empty()) {
242 if (__flags & ios_base::showbase)
243 switch (__flags & ios_base::basefield) {
244 case ios_base::hex: __basechars = 2;
break;
245 case ios_base::oct: __basechars = 1;
break;
246 default: __basechars = 0;
253 _STLP_STD::copy(__buf, __iend, (
char *) __grpbuf);
255 __iend = __grpbuf + __len;
257 '+',
'-', __basechars);
263#if defined (_STLP_LONG_LONG)
274template <
class _Integer>
277 const bool __negative = __x < 0 ;
281 for (; __utemp != 0; __utemp /= 10)
282 *--__ptr = (
char)((
int)(__utemp % 10) +
'0');
286 else if (__flags & ios_base::showpos)
291template <
class _Integer>
294 for (; __x != 0; __x /= 10)
295 *--__ptr = (
char)((
int)(__x % 10) +
'0');
297 if (__flags & ios_base::showpos)
302template <
class _Integer>
309 if ((__flags & ios_base::showpos) && ((__flags & (ios_base::oct | ios_base::hex)) == 0))
314 switch (__flags & ios_base::basefield) {
320 __temp &= 0xFFFFFFFF;
322 for (; __temp != 0; __temp >>=3)
323 *--__ptr = (
char)((((
unsigned)__temp)& 0x7) +
'0');
326 if (__flags & ios_base::showbase)
332 const char* __table_ptr = (__flags & ios_base::uppercase) ?
337 __temp &= 0xFFFFFFFF;
339 for (; __temp != 0; __temp >>=4)
340 *--__ptr = __table_ptr[((
unsigned)__temp & 0xF)];
342 if (__flags & ios_base::showbase) {
343 *--__ptr = __table_ptr[16];
351#if defined(__HP_aCC) && (__HP_aCC == 1)
352 bool _IsSigned = !((_Integer)-1 > 0);
370template <
class _CharT,
class _OutputIter,
class _Integer>
377 char __buf[
sizeof(_Integer) * 3 + 2];
378 const ptrdiff_t __buf_size =
sizeof(__buf) /
sizeof(
char);
384template <
class _CharT,
class _OutputIter>
393 return _STLP_STD::copy(__str.begin(), __str.end(), __s);
398 if (__dir == ios_base::left) {
399 __s = _STLP_STD::copy(__str.begin(), __str.end(), __s);
404 return _STLP_STD::copy(__str.begin(), __str.end(), __s);
414template <
class _CharT,
class _OutputIterator>
417#if !defined (_STLP_NO_BOOL)
418template <
class _CharT,
class _OutputIter>
422 if (!(__f.
flags() & ios_base::boolalpha))
430template <
class _CharT,
class _OutputIter>
436template <
class _CharT,
class _OutputIter>
439 unsigned long __val)
const
442template <
class _CharT,
class _OutputIter>
448#if !defined (_STLP_NO_LONG_DOUBLE)
449template <
class _CharT,
class _OutputIter>
452 long double __val)
const
456#if defined (_STLP_LONG_LONG)
457template <
class _CharT,
class _OutputIter>
463template <
class _CharT,
class _OutputIter>
473template <
class _CharT,
class _OutputIter>
476 const void*
__val)
const {
480 __f.
setf(ios_base::hex, ios_base::basefield);
481 __f.
setf(ios_base::showbase);
482 __f.
setf(ios_base::internal, ios_base::adjustfield);
483 __f.
width((
sizeof(
void*) * 2) + 2);
487 const char* __table_ptr = (__save_flags & ios_base::uppercase) ?
489 __s++ = __c_type.widen(
'0' );
490 __s++ = __c_type.widen( __table_ptr[16] );
491 __f.
width((
sizeof(
void*) * 2));
493 __f.
width((
sizeof(
void*) * 2) + 2);
495#if defined (_STLP_MSVC)
496# pragma warning (push)
497# pragma warning (disable : 4311)
503#ifdef _STLP_LONG_LONG
504 (
sizeof(
void*) ==
sizeof(
unsigned long) ) ?
513#if defined (_STLP_MSVC)
514# pragma warning (pop)
516 __f.
flags(__save_flags);
_STLP_INLINE_LOOP _InputIter __last
void __fill(_ForwardIter __first, _ForwardIter __last, const _Tp &__val, const input_iterator_tag &, _Distance *)
_STLP_INLINE_LOOP _InputIter const _Tp & __val
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _OutputIter __fill_n(_OutputIter __first, _Size __n, const _Tp &__val)
#define _STLP_BASIC_IOSTRING(_CharT)
_STLP_DECLSPEC const char *_STLP_CALL __hex_char_table_hi()
_OutputIter _STLP_CALL __do_put_float(_OutputIter __s, ios_base &__f, _CharT __fill, _Float __x)
_STLP_BEGIN_NAMESPACE _STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter _STLP_CALL __copy_float_and_fill(const _CharT *__first, const _CharT *__last, _OutputIter __oi, ios_base::fmtflags __flags, streamsize __width, _CharT __fill, _CharT __xplus, _CharT __xminus)
char *_STLP_CALL __write_decimal_backward(char *__ptr, _Integer __x, ios_base::fmtflags __flags, const __true_type &)
_OutputIter _STLP_CALL __copy_integer_and_fill(const _CharT *__buf, ptrdiff_t __len, _OutputIter __oi, ios_base::fmtflags __flg, streamsize __wid, _CharT __fill, _CharT __xplus, _CharT __xminus)
_STLP_DECLSPEC const char *_STLP_CALL __hex_char_table_lo()
void __get_money_digits_aux(__iostring &__buf, ios_base &, _STLP_LONGEST_FLOAT_TYPE __x)
_OutputIter _STLP_CALL __put_integer(char *__buf, char *__iend, _OutputIter __s, ios_base &__f, ios_base::fmtflags __flags, wchar_t __fill)
unsigned long __umax_int_t
char *_STLP_CALL __write_integer_backward(char *__buf, ios_base::fmtflags __flags, _Integer __x)
void _STLP_CALL __get_money_digits(_STLP_BASIC_IOSTRING(_CharT) &__buf, ios_base &__f, _STLP_LONGEST_FLOAT_TYPE __x)
_OutputIter _STLP_CALL __do_put_bool(_OutputIter __s, ios_base &__f, _CharT __fill, bool __x)
_OutputIter _STLP_CALL __put_float(__iostring &__str, _OutputIter __oi, ios_base &__f, wchar_t __fill, wchar_t __decimal_point, wchar_t __sep, size_t __group_pos, const string &__grouping)
_OutputIter _STLP_CALL __do_put_integer(_OutputIter __s, ios_base &__f, _CharT __fill, _Integer __x)
const _CharT * data() const
fmtflags setf(fmtflags __flag)
streamsize precision() const
virtual _OutputIter do_put(_OutputIter __s, ios_base &__f, _CharT __fill, bool __val) const
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
__kernel_ptrdiff_t ptrdiff_t
#define __REINTERPRET_CAST(__x, __y)
#define _STLP_STATIC_ASSERT(expr)
#define _STLP_MOVE_TO_STD_NAMESPACE
#define __STATIC_CAST(__x, __y)
#define _STLP_LONGEST_FLOAT_TYPE
#define _STLP_BEGIN_NAMESPACE
#define _STLP_END_NAMESPACE
#define _STLP_MOVE_TO_PRIV_NAMESPACE
static unsigned(__cdecl *hash_bstr)(bstr_t s)
ptrdiff_t _STLP_CALL __insert_grouping(char *first, char *last, const string &grouping, char separator, char Plus, char Minus, int basechars)
size_t _STLP_CALL __write_float(__iostring &buf, ios_base::fmtflags flags, int precision, double x)
void _STLP_CALL __get_floor_digits(__iostring &out, _STLP_LONGEST_FLOAT_TYPE __x)
void _STLP_CALL __convert_float_buffer(__iostring const &str, __iowstring &out, const ctype< wchar_t > &ct, wchar_t dot, bool __check_dot)