35 #define _OSTREAM_TCC 1
37 #pragma GCC system_header
41 namespace std _GLIBCXX_VISIBILITY(default)
43 _GLIBCXX_BEGIN_NAMESPACE_VERSION
45 template<
typename _CharT,
typename _Traits>
48 : _M_ok(false), _M_os(__os)
51 if (__os.tie() && __os.good())
60 template<
typename _CharT,
typename _Traits>
61 template<
typename _ValueT>
73 if (__np.
put(*
this, *
this, this->fill(), __v).failed())
79 __throw_exception_again;
84 this->setstate(__err);
89 template<
typename _CharT,
typename _Traits>
98 return _M_insert(
static_cast<long>(
static_cast<unsigned short>(__n)));
100 return _M_insert(
static_cast<long>(__n));
103 template<
typename _CharT,
typename _Traits>
104 basic_ostream<_CharT, _Traits>&
112 return _M_insert(
static_cast<long>(
static_cast<unsigned int>(__n)));
114 return _M_insert(
static_cast<long>(__n));
117 template<
typename _CharT,
typename _Traits>
118 basic_ostream<_CharT, _Traits>&
123 sentry __cerb(*
this);
124 if (__cerb && __sbin)
128 if (!__copy_streambufs(__sbin, this->rdbuf()))
134 __throw_exception_again;
142 this->setstate(__err);
146 template<
typename _CharT,
typename _Traits>
147 basic_ostream<_CharT, _Traits>&
163 const int_type __put = this->rdbuf()->sputc(__c);
164 if (traits_type::eq_int_type(__put, traits_type::eof()))
170 __throw_exception_again;
175 this->setstate(__err);
180 template<
typename _CharT,
typename _Traits>
192 sentry __cerb(*
this);
198 if (this->rdbuf()->sputn(__s, __n) != __n)
204 __throw_exception_again;
214 template<
typename _CharT,
typename _Traits>
215 basic_ostream<_CharT, _Traits>&
232 if (this->rdbuf()->pubsync() == -1)
238 __throw_exception_again;
243 this->setstate(__err);
249 template<
typename _CharT,
typename _Traits>
250 typename basic_ostream<_CharT, _Traits>::pos_type
255 pos_type __ret = pos_type(-1);
261 template<
typename _CharT,
typename _Traits>
264 seekp(pos_type __pos)
271 const pos_type __p = this->rdbuf()->pubseekpos(__pos,
ios_base::out);
274 if (__p == pos_type(off_type(-1)))
280 template<
typename _CharT,
typename _Traits>
283 seekp(off_type __off, ios_base::seekdir __dir)
285 sentry __cerb(*
this);
290 const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
294 if (__p == pos_type(off_type(-1)))
300 template<
typename _CharT,
typename _Traits>
301 basic_ostream<_CharT, _Traits>&
302 operator<<(basic_ostream<_CharT, _Traits>& __out,
const char* __s)
310 const size_t __clen = char_traits<char>::length(__s);
316 __ptr_guard (_CharT *__ip): __p(__ip) { }
317 ~__ptr_guard() {
delete[] __p; }
318 _CharT* __get() {
return __p; }
319 } __pg (
new _CharT[__clen]);
321 _CharT *__ws = __pg.__get();
322 for (
size_t __i = 0; __i < __clen; ++__i)
323 __ws[__i] = __out.widen(__s[__i]);
324 __ostream_insert(__out, __ws, __clen);
329 __throw_exception_again;
339 #if _GLIBCXX_EXTERN_TEMPLATE
351 extern template ostream& ostream::_M_insert(
long);
352 extern template ostream& ostream::_M_insert(
unsigned long);
353 extern template ostream& ostream::_M_insert(
bool);
354 #ifdef _GLIBCXX_USE_LONG_LONG
355 extern template ostream& ostream::_M_insert(
long long);
356 extern template ostream& ostream::_M_insert(
unsigned long long);
358 extern template ostream& ostream::_M_insert(
double);
359 extern template ostream& ostream::_M_insert(
long double);
360 extern template ostream& ostream::_M_insert(
const void*);
362 #ifdef _GLIBCXX_USE_WCHAR_T
372 extern template wostream& wostream::_M_insert(
long);
373 extern template wostream& wostream::_M_insert(
unsigned long);
374 extern template wostream& wostream::_M_insert(
bool);
375 #ifdef _GLIBCXX_USE_LONG_LONG
376 extern template wostream& wostream::_M_insert(
long long);
377 extern template wostream& wostream::_M_insert(
unsigned long long);
379 extern template wostream& wostream::_M_insert(
double);
380 extern template wostream& wostream::_M_insert(
long double);
381 extern template wostream& wostream::_M_insert(
const void*);
385 _GLIBCXX_END_NAMESPACE_VERSION