Go to the documentation of this file.
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);
200 __throw_exception_again;
208 template<
typename _CharT,
typename _Traits>
209 basic_ostream<_CharT, _Traits>&
219 if (this->rdbuf() && this->rdbuf()->pubsync() == -1)
225 __throw_exception_again;
230 this->setstate(__err);
234 template<
typename _CharT,
typename _Traits>
235 typename basic_ostream<_CharT, _Traits>::pos_type
239 pos_type __ret = pos_type(-1);
248 __throw_exception_again;
255 template<
typename _CharT,
typename _Traits>
258 seekp(pos_type __pos)
267 const pos_type __p = this->rdbuf()->pubseekpos(__pos,
271 if (__p == pos_type(off_type(-1)))
278 __throw_exception_again;
283 this->setstate(__err);
287 template<
typename _CharT,
typename _Traits>
290 seekp(off_type __off, ios_base::seekdir __dir)
299 const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
303 if (__p == pos_type(off_type(-1)))
310 __throw_exception_again;
315 this->setstate(__err);
319 template<
typename _CharT,
typename _Traits>
335 __ptr_guard (_CharT *__ip): __p(__ip) { }
336 ~__ptr_guard() {
delete[] __p; }
337 _CharT* __get() {
return __p; }
338 } __pg (
new _CharT[__clen]);
340 _CharT *__ws = __pg.__get();
341 for (
size_t __i = 0; __i < __clen; ++__i)
342 __ws[__i] = __out.widen(__s[__i]);
343 __ostream_insert(__out, __ws, __clen);
348 __throw_exception_again;
358 #if _GLIBCXX_EXTERN_TEMPLATE
359 extern template class basic_ostream<char>;
370 extern template ostream& ostream::_M_insert(
long);
371 extern template ostream& ostream::_M_insert(
unsigned long);
372 extern template ostream& ostream::_M_insert(
bool);
373 #ifdef _GLIBCXX_USE_LONG_LONG
374 extern template ostream& ostream::_M_insert(
long long);
375 extern template ostream& ostream::_M_insert(
unsigned long long);
377 extern template ostream& ostream::_M_insert(
double);
378 extern template ostream& ostream::_M_insert(
long double);
379 extern template ostream& ostream::_M_insert(
const void*);
381 #ifdef _GLIBCXX_USE_WCHAR_T
391 extern template wostream& wostream::_M_insert(
long);
392 extern template wostream& wostream::_M_insert(
unsigned long);
393 extern template wostream& wostream::_M_insert(
bool);
394 #ifdef _GLIBCXX_USE_LONG_LONG
395 extern template wostream& wostream::_M_insert(
long long);
396 extern template wostream& wostream::_M_insert(
unsigned long long);
398 extern template wostream& wostream::_M_insert(
double);
399 extern template wostream& wostream::_M_insert(
long double);
400 extern template wostream& wostream::_M_insert(
const void*);
404 _GLIBCXX_END_NAMESPACE_VERSION
_Ios_Iostate iostate
This is a bitmask type.
iter_type put(iter_type __s, ios_base &__io, char_type __fill, bool __v) const
Numeric formatting.
basic_ostream< _CharT, _Traits > & endl(basic_ostream< _CharT, _Traits > &__os)
Write a newline and flush the stream.
void _M_write(const char_type *__s, streamsize __n)
Core write functionality, without sentry.
__ostream_type & write(const char_type *__s, streamsize __n)
Character string insertion.
_Ios_Fmtflags fmtflags
This is a bitmask type.
static const seekdir cur
Request a seek relative to the current position within the sequence.
Performs setup work for output streams.
static const iostate badbit
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error fro...
basic_ostream< char > ostream
Base class for char output streams.
static const fmtflags basefield
A mask of dec|oct|hex. Useful for the 2-arg form of setf.
static const fmtflags oct
Converts integer input or generates integer output in octal base.
__ostream_type & seekp(pos_type)
Changing the current write position.
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
sentry(basic_ostream< _CharT, _Traits > &__os)
The constructor performs preparatory work.
ISO C++ entities toplevel namespace is std.
Thrown as part of forced unwinding.
static const openmode out
Open for output. Default for ofstream and fstream.
static const iostate goodbit
Indicates all is well.
__ostream_type & operator<<(__ostream_type &(*__pf)(__ostream_type &))
Interface for manipulators.
basic_ostream< _CharT, _Traits > & ends(basic_ostream< _CharT, _Traits > &__os)
Write a null character into the output sequence.
Primary class template num_put.
Basis for explicit traits specializations.
__ostream_type & flush()
Synchronizing the stream buffer.
Template class basic_ostream.
static const iostate failbit
Indicates that an input operation failed to read the expected characters, or that an output operation...
static const fmtflags hex
Converts integer input or generates integer output in hexadecimal base.
pos_type tellp()
Getting the current write position.
__ostream_type & put(char_type __c)
Simple insertion.