30 #ifndef _OSTREAM_INSERT_H
31 #define _OSTREAM_INSERT_H 1
33 #pragma GCC system_header
36 #include <cxxabi-forced.h>
38 _GLIBCXX_BEGIN_NAMESPACE(
std)
40 template<typename _CharT, typename _Traits>
42 __ostream_write(basic_ostream<_CharT, _Traits>& __out,
45 typedef basic_ostream<_CharT, _Traits> __ostream_type;
46 typedef typename __ostream_type::ios_base __ios_base;
48 const streamsize __put = __out.rdbuf()->sputn(__s, __n);
50 __out.setstate(__ios_base::badbit);
53 template<
typename _CharT,
typename _Traits>
55 __ostream_fill(basic_ostream<_CharT, _Traits>& __out,
streamsize __n)
57 typedef basic_ostream<_CharT, _Traits> __ostream_type;
58 typedef typename __ostream_type::ios_base __ios_base;
60 const _CharT __c = __out.fill();
61 for (; __n > 0; --__n)
63 const typename _Traits::int_type __put = __out.rdbuf()->sputc(__c);
64 if (_Traits::eq_int_type(__put, _Traits::eof()))
66 __out.setstate(__ios_base::badbit);
72 template<
typename _CharT,
typename _Traits>
73 basic_ostream<_CharT, _Traits>&
74 __ostream_insert(basic_ostream<_CharT, _Traits>& __out,
77 typedef basic_ostream<_CharT, _Traits> __ostream_type;
78 typedef typename __ostream_type::ios_base __ios_base;
80 typename __ostream_type::sentry __cerb(__out);
88 const bool __left = ((__out.flags()
89 & __ios_base::adjustfield)
92 __ostream_fill(__out, __w - __n);
94 __ostream_write(__out, __s, __n);
95 if (__left && __out.good())
96 __ostream_fill(__out, __w - __n);
99 __ostream_write(__out, __s, __n);
104 __out._M_setstate(__ios_base::badbit);
105 __throw_exception_again;
108 { __out._M_setstate(__ios_base::badbit); }
116 #if _GLIBCXX_EXTERN_TEMPLATE
117 extern template ostream& __ostream_insert(ostream&,
const char*,
streamsize);
119 #ifdef _GLIBCXX_USE_WCHAR_T
120 extern template wostream& __ostream_insert(wostream&,
const wchar_t*,
125 _GLIBCXX_END_NAMESPACE
ISO C++ entities toplevel namespace is std.
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
Thrown as part of forced unwinding.A magic placeholder class that can be caught by reference to recog...
ios_base & left(ios_base &__base)
Calls base.setf(ios_base::left, ios_base::adjustfield).