37 #define _OSTREAM_TCC 1
39 #pragma GCC system_header
43 namespace std _GLIBCXX_VISIBILITY(default)
45 _GLIBCXX_BEGIN_NAMESPACE_VERSION
47 template<
typename _CharT,
typename _Traits>
50 : _M_ok(false), _M_os(__os)
62 template<
typename _CharT,
typename _Traits>
63 template<
typename _ValueT>
75 if (__np.
put(*
this, *
this, this->fill(), __v).failed())
81 __throw_exception_again;
91 template<
typename _CharT,
typename _Traits>
92 basic_ostream<_CharT, _Traits>&
100 return _M_insert(static_cast<long>(static_cast<unsigned short>(__n)));
102 return _M_insert(static_cast<long>(__n));
105 template<
typename _CharT,
typename _Traits>
114 return _M_insert(static_cast<long>(static_cast<unsigned int>(__n)));
116 return _M_insert(static_cast<long>(__n));
119 template<
typename _CharT,
typename _Traits>
126 if (__cerb && __sbin)
130 if (!__copy_streambufs(__sbin, this->
rdbuf()))
136 __throw_exception_again;
148 template<
typename _CharT,
typename _Traits>
165 const int_type __put = this->
rdbuf()->sputc(__c);
166 if (traits_type::eq_int_type(__put, traits_type::eof()))
172 __throw_exception_again;
182 template<
typename _CharT,
typename _Traits>
202 __throw_exception_again;
210 template<
typename _CharT,
typename _Traits>
221 if (this->
rdbuf() && this->
rdbuf()->pubsync() == -1)
227 __throw_exception_again;
236 template<
typename _CharT,
typename _Traits>
237 typename basic_ostream<_CharT, _Traits>::pos_type
241 pos_type __ret = pos_type(-1);
250 __throw_exception_again;
257 template<
typename _CharT,
typename _Traits>
269 const pos_type __p = this->
rdbuf()->pubseekpos(__pos,
273 if (__p == pos_type(off_type(-1)))
280 __throw_exception_again;
289 template<
typename _CharT,
typename _Traits>
292 seekp(off_type __off, ios_base::seekdir __dir)
301 const pos_type __p = this->
rdbuf()->pubseekoff(__off, __dir,
305 if (__p == pos_type(off_type(-1)))
312 __throw_exception_again;
321 template<
typename _CharT,
typename _Traits>
323 operator<<(basic_ostream<_CharT, _Traits>& __out,
const char* __s)
337 __ptr_guard (_CharT *__ip): __p(__ip) { }
338 ~__ptr_guard() {
delete[] __p; }
339 _CharT* __get() {
return __p; }
340 } __pg (
new _CharT[__clen]);
342 _CharT *__ws = __pg.__get();
343 for (
size_t __i = 0; __i < __clen; ++__i)
344 __ws[__i] = __out.widen(__s[__i]);
345 __ostream_insert(__out, __ws, __clen);
350 __throw_exception_again;
360 #if _GLIBCXX_EXTERN_TEMPLATE
361 extern template class basic_ostream<char>;
372 extern template ostream& ostream::_M_insert(
long);
373 extern template ostream& ostream::_M_insert(
unsigned long);
374 extern template ostream& ostream::_M_insert(
bool);
375 #ifdef _GLIBCXX_USE_LONG_LONG
376 extern template ostream& ostream::_M_insert(
long long);
377 extern template ostream& ostream::_M_insert(
unsigned long long);
379 extern template ostream& ostream::_M_insert(
double);
380 extern template ostream& ostream::_M_insert(
long double);
381 extern template ostream& ostream::_M_insert(
const void*);
383 #ifdef _GLIBCXX_USE_WCHAR_T
384 extern template class basic_ostream<wchar_t>;
393 extern template wostream& wostream::_M_insert(
long);
394 extern template wostream& wostream::_M_insert(
unsigned long);
395 extern template wostream& wostream::_M_insert(
bool);
396 #ifdef _GLIBCXX_USE_LONG_LONG
397 extern template wostream& wostream::_M_insert(
long long);
398 extern template wostream& wostream::_M_insert(
unsigned long long);
400 extern template wostream& wostream::_M_insert(
double);
401 extern template wostream& wostream::_M_insert(
long double);
402 extern template wostream& wostream::_M_insert(
const void*);
406 _GLIBCXX_END_NAMESPACE_VERSION
bool fail() const
Fast error checking.
Basis for explicit traits specializations.
Controlling output.This is the base class for all output streams. It provides text formatting of all ...
basic_ostream< _CharT, _Traits > & endl(basic_ostream< _CharT, _Traits > &__os)
Write a newline and flush the stream.
static const fmtflags basefield
A mask of dec|oct|hex. Useful for the 2-arg form of setf.
Primary class template num_put.This facet encapsulates the code to convert a number to a string...
bool good() const
Fast error checking.
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
static const iostate goodbit
Indicates all is well.
__ostream_type & operator<<(__ostream_type &(*__pf)(__ostream_type &))
Interface for manipulators.
__ostream_type & put(char_type __c)
Simple insertion.
pos_type tellp()
Getting the current write position.
static const fmtflags oct
Converts integer input or generates integer output in octal base.
__ostream_type & write(const char_type *__s, streamsize __n)
Character string insertion.
basic_streambuf< _CharT, _Traits > * rdbuf() const
Accessing the underlying buffer.
sentry(basic_ostream< _CharT, _Traits > &__os)
The constructor performs preparatory work.
static const seekdir cur
Request a seek relative to the current position within the sequence.
static const iostate badbit
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error fro...
static const openmode out
Open for output. Default for ofstream and fstream.
fmtflags flags() const
Access to format flags.
basic_ostream< _CharT, _Traits > & ends(basic_ostream< _CharT, _Traits > &__os)
Write a null character into the output sequence.
The actual work of input and output (interface).This is a base class. Derived stream buffers each con...
void setstate(iostate __state)
Sets additional flags in the error state.
void _M_write(const char_type *__s, streamsize __n)
Simple insertion.
Thrown as part of forced unwinding.A magic placeholder class that can be caught by reference to recog...
static const iostate failbit
Indicates that an input operation failed to read the expected characters, or that an output operation...
__ostream_type & flush()
Synchronizing the stream buffer.
basic_ostream< _CharT, _Traits > * tie() const
Fetches the current tied stream.
basic_ostream< wchar_t > wostream
Base class for wchar_t output streams.
basic_ostream< char > ostream
Base class for char output streams.
__ostream_type & seekp(pos_type)
Changing the current write position.
static const fmtflags hex
Converts integer input or generates integer output in hexadecimal base.
iter_type put(iter_type __s, ios_base &__f, char_type __fill, bool __v) const
Numeric formatting.
Performs setup work for output streams.