33 #ifndef _GLIBCXX_OSTREAM
34 #define _GLIBCXX_OSTREAM 1
36 #pragma GCC system_header
41 namespace std _GLIBCXX_VISIBILITY(default)
43 _GLIBCXX_BEGIN_NAMESPACE_VERSION
57 template<
typename _CharT,
typename _Traits>
58 class basic_ostream :
virtual public basic_ios<_CharT, _Traits>
62 typedef _CharT char_type;
63 typedef typename _Traits::int_type int_type;
64 typedef typename _Traits::pos_type pos_type;
65 typedef typename _Traits::off_type off_type;
66 typedef _Traits traits_type;
69 typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
70 typedef basic_ios<_CharT, _Traits> __ios_type;
71 typedef basic_ostream<_CharT, _Traits> __ostream_type;
72 typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
74 typedef ctype<_CharT> __ctype_type;
167 {
return _M_insert(__n); }
171 {
return _M_insert(__n); }
175 {
return _M_insert(__n); }
185 return _M_insert(static_cast<unsigned long>(__n));
196 return _M_insert(static_cast<unsigned long>(__n));
199 #ifdef _GLIBCXX_USE_LONG_LONG
202 {
return _M_insert(__n); }
206 {
return _M_insert(__n); }
221 {
return _M_insert(__f); }
228 return _M_insert(static_cast<double>(__f));
233 {
return _M_insert(__f); }
246 {
return _M_insert(__p); }
381 seekp(off_type, ios_base::seekdir);
387 template<
typename _ValueT>
389 _M_insert(_ValueT __v);
399 template <
typename _CharT,
typename _Traits>
434 if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
446 #if __cplusplus >= 201103L
449 operator bool()
const
469 template<
typename _CharT,
typename _Traits>
471 operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
472 {
return __ostream_insert(__out, &__c, 1); }
474 template<
typename _CharT,
typename _Traits>
475 inline basic_ostream<_CharT, _Traits>&
476 operator<<(basic_ostream<_CharT, _Traits>& __out,
char __c)
477 {
return (__out << __out.widen(__c)); }
480 template <
class _Traits>
481 inline basic_ostream<char, _Traits>&
482 operator<<(basic_ostream<char, _Traits>& __out,
char __c)
483 {
return __ostream_insert(__out, &__c, 1); }
486 template<
class _Traits>
487 inline basic_ostream<char, _Traits>&
488 operator<<(basic_ostream<char, _Traits>& __out,
signed char __c)
489 {
return (__out << static_cast<char>(__c)); }
491 template<
class _Traits>
492 inline basic_ostream<char, _Traits>&
493 operator<<(basic_ostream<char, _Traits>& __out,
unsigned char __c)
494 {
return (__out << static_cast<char>(__c)); }
511 template<
typename _CharT,
typename _Traits>
512 inline basic_ostream<_CharT, _Traits>&
513 operator<<(basic_ostream<_CharT, _Traits>& __out,
const _CharT* __s)
518 __ostream_insert(__out, __s,
519 static_cast<streamsize>(_Traits::length(__s)));
523 template<
typename _CharT,
typename _Traits>
524 basic_ostream<_CharT, _Traits> &
525 operator<<(basic_ostream<_CharT, _Traits>& __out,
const char* __s);
528 template<
class _Traits>
529 inline basic_ostream<char, _Traits>&
530 operator<<(basic_ostream<char, _Traits>& __out,
const char* __s)
535 __ostream_insert(__out, __s,
536 static_cast<streamsize>(_Traits::length(__s)));
541 template<
class _Traits>
542 inline basic_ostream<char, _Traits>&
543 operator<<(basic_ostream<char, _Traits>& __out,
const signed char* __s)
544 {
return (__out << reinterpret_cast<const char*>(__s)); }
546 template<
class _Traits>
547 inline basic_ostream<char, _Traits> &
548 operator<<(basic_ostream<char, _Traits>& __out,
const unsigned char* __s)
549 {
return (__out << reinterpret_cast<const char*>(__s)); }
562 template<
typename _CharT,
typename _Traits>
563 inline basic_ostream<_CharT, _Traits>&
565 {
return flush(__os.put(__os.widen(
'\n'))); }
574 template<
typename _CharT,
typename _Traits>
575 inline basic_ostream<_CharT, _Traits>&
577 {
return __os.put(_CharT()); }
584 template<
typename _CharT,
typename _Traits>
585 inline basic_ostream<_CharT, _Traits>&
587 {
return __os.flush(); }
589 #if __cplusplus >= 201103L
600 template<
typename _CharT,
typename _Traits,
typename _Tp>
601 inline basic_ostream<_CharT, _Traits>&
602 operator<<(basic_ostream<_CharT, _Traits>&& __os,
const _Tp& __x)
603 {
return (__os << __x); }
606 _GLIBCXX_END_NAMESPACE_VERSION
virtual ~basic_ostream()
Base destructor.
Performs setup work for output streams.
static const fmtflags unitbuf
Flushes output after each output operation.
The base of the I/O class hierarchy.This class defines everything that can be defined about I/O that ...
__ostream_type & flush()
Synchronizing the stream buffer.
bool uncaught_exception() noexcept __attribute__((__pure__))
static const iostate badbit
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error fro...
basic_ostream< _CharT, _Traits > & endl(basic_ostream< _CharT, _Traits > &__os)
Write a newline and flush the stream.
void init(basic_streambuf< _CharT, _Traits > *__sb)
All setup is performed here.
basic_streambuf< _CharT, _Traits > * rdbuf() const
Accessing the underlying buffer.
__ostream_type & write(const char_type *__s, streamsize __n)
Character string insertion.
__ostream_type & put(char_type __c)
Simple insertion.
__ostream_type & seekp(pos_type)
Changing the current write position.
pos_type tellp()
Getting the current write position.
void setstate(iostate __state)
Sets additional flags in the error state.
~sentry()
Possibly flushes the stream.
basic_ostream< _CharT, _Traits > & ends(basic_ostream< _CharT, _Traits > &__os)
Write a null character into the output sequence.
void _M_write(const char_type *__s, streamsize __n)
Core write functionality, without sentry.
basic_ostream(__streambuf_type *__sb)
Base constructor.
__ostream_type & operator<<(__ostream_type &(*__pf)(__ostream_type &))
Interface for manipulators.
basic_ostream< _CharT, _Traits > & flush(basic_ostream< _CharT, _Traits > &__os)
Flushes the output stream.
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.