30#ifndef _OSTREAM_INSERT_H
31#define _OSTREAM_INSERT_H 1
33#pragma GCC system_header
39namespace std _GLIBCXX_VISIBILITY(default)
41_GLIBCXX_BEGIN_NAMESPACE_VERSION
45 template<
typename _CharT,
typename _Traits>
47 __ostream_write(basic_ostream<_CharT, _Traits>& __out,
50 typedef basic_ostream<_CharT, _Traits> __ostream_type;
51 typedef typename __ostream_type::ios_base __ios_base;
53 const streamsize __put = __out.rdbuf()->sputn(__s, __n);
55 __out.setstate(__ios_base::badbit);
58 template<
typename _CharT,
typename _Traits>
60 __ostream_fill(basic_ostream<_CharT, _Traits>& __out,
streamsize __n)
62 typedef basic_ostream<_CharT, _Traits> __ostream_type;
63 typedef typename __ostream_type::ios_base __ios_base;
65 const _CharT __c = __out.fill();
66 for (; __n > 0; --__n)
68 const typename _Traits::int_type __put = __out.rdbuf()->sputc(__c);
69 if (_Traits::eq_int_type(__put, _Traits::eof()))
71 __out.setstate(__ios_base::badbit);
77 template<
typename _CharT,
typename _Traits>
78 basic_ostream<_CharT, _Traits>&
79 __ostream_insert(basic_ostream<_CharT, _Traits>& __out,
82 typedef basic_ostream<_CharT, _Traits> __ostream_type;
83 typedef typename __ostream_type::ios_base __ios_base;
85 typename __ostream_type::sentry __cerb(__out);
93 const bool __left = ((__out.flags()
94 & __ios_base::adjustfield)
97 __ostream_fill(__out, __w - __n);
99 __ostream_write(__out, __s, __n);
100 if (__left && __out.good())
101 __ostream_fill(__out, __w - __n);
104 __ostream_write(__out, __s, __n);
109 __out._M_setstate(__ios_base::badbit);
110 __throw_exception_again;
113 { __out._M_setstate(__ios_base::badbit); }
120#if _GLIBCXX_EXTERN_TEMPLATE
123#ifdef _GLIBCXX_USE_WCHAR_T
131_GLIBCXX_END_NAMESPACE_VERSION
basic_ostream< char > ostream
Base class for char output streams.
basic_ostream< wchar_t > wostream
Base class for wchar_t output streams.
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.