18#ifndef _STLP_OSTREAM_C
19#define _STLP_OSTREAM_C
21#ifndef _STLP_INTERNAL_OSTREAM_H
25#if !defined (_STLP_INTERNAL_NUM_PUT_H)
36template <
class _CharT,
class _Traits>
42template <
class _CharT,
class _Traits>
47template <
class _CharT,
class _Traits>
50 sentry __sentry(*
this);
53 bool __any_inserted = __from->
gptr() != __from->
egptr()
54 ? this->_M_copy_buffered(__from, this->rdbuf())
55 : this->_M_copy_unbuffered(__from, this->rdbuf());
57 this->setstate(ios_base::failbit);
60 this->setstate(ios_base::badbit);
71template <
class _CharT,
class _Traits>
75 bool __any_inserted =
false;
77 while (__from->
egptr() != __from->
gptr()) {
82 __nwritten = __to->
sputn(__from->
gptr(), __avail);
86 this->_M_handle_exception(ios_base::badbit);
87 return __any_inserted;
90 if (__nwritten == __avail) {
92 if (this->_S_eof(__from->
sgetc()))
95 __any_inserted =
true;
98 this->_M_handle_exception(ios_base::failbit);
102 else if (__nwritten != 0)
105 return __any_inserted;
110 return __any_inserted || this->_M_copy_unbuffered(__from, __to);
117template <
class _CharT,
class _Traits>
143template <
class _CharT,
class _Traits>
148 bool __any_inserted =
false;
152 _SPutBackCGuard __cguard(__from);
158 this->_M_handle_exception(ios_base::failbit);
162 if (this->_S_eof(
__c))
169 if (this->_S_eof(__to->
sputc(_Traits::to_char_type(
__c))))
175 this->_M_handle_exception(ios_base::badbit);
180 __any_inserted =
true;
184 this->_M_handle_exception(ios_base::badbit);
186 return __any_inserted;
192template <
class _CharT,
class _Traits,
class _Number>
196 _Sentry __sentry(__os);
197 bool __failed =
true;
221template <
class _CharT,
class _Traits>
224 long __tmp = ((this->
flags() & _Basic_ios::basefield) != ios_base::dec) ?
229template <
class _CharT,
class _Traits>
235template <
class _CharT,
class _Traits>
238 long __tmp = ((this->
flags() & _Basic_ios::basefield) != ios_base::dec) ?
243template <
class _CharT,
class _Traits>
244#if defined (_WIN64) || !defined (_STLP_MSVC) || (_STLP_MSVC < 1300)
257template <
class _CharT,
class _Traits>
261template <
class _CharT,
class _Traits>
265#ifdef _STLP_LONG_LONG
266template <
class _CharT,
class _Traits>
270template <
class _CharT,
class _Traits>
275template <
class _CharT,
class _Traits>
279template <
class _CharT,
class _Traits>
283#ifndef _STLP_NO_LONG_DOUBLE
284template <
class _CharT,
class _Traits>
289template <
class _CharT,
class _Traits>
294template <
class _CharT,
class _Traits>
299template <
class _CharT,
class _Traits>
303 bool __failed =
true;
308 __failed = this->_S_eof(this->rdbuf()->sputc(
__c));
309 else if ((this->
flags() & ios_base::adjustfield) == ios_base::left) {
310 __failed = this->_S_eof(this->rdbuf()->sputc(
__c));
311 __failed = __failed ||
312 this->rdbuf()->_M_sputnc(this->
fill(), __npad) != __npad;
315 __failed = this->rdbuf()->_M_sputnc(this->
fill(), __npad) != __npad;
316 __failed = __failed || this->_S_eof(this->rdbuf()->sputc(
__c));
322 this->_M_handle_exception(ios_base::badbit);
326 this->setstate(ios_base::badbit);
330template <
class _CharT,
class _Traits>
334 bool __failed =
true;
340 __failed = this->rdbuf()->sputn(__s,
__n) !=
__n;
341 else if ((this->
flags() & ios_base::adjustfield) == ios_base::left) {
342 __failed = this->rdbuf()->sputn(__s,
__n) !=
__n;
343 __failed = __failed ||
344 this->rdbuf()->_M_sputnc(this->
fill(), __npad) != __npad;
347 __failed = this->rdbuf()->_M_sputnc(this->
fill(), __npad) != __npad;
348 __failed = __failed || this->rdbuf()->sputn(__s,
__n) !=
__n;
354 this->_M_handle_exception(ios_base::badbit);
358 this->setstate(ios_base::failbit);
362template <
class _CharT,
class _Traits>
366 bool __failed =
true;
372 __failed = !this->_M_put_widen_aux(__s,
__n);
373 else if ((this->
flags() & ios_base::adjustfield) == ios_base::left) {
374 __failed = !this->_M_put_widen_aux(__s,
__n);
375 __failed = __failed ||
376 this->rdbuf()->_M_sputnc(this->
fill(), __npad) != __npad;
379 __failed = this->rdbuf()->_M_sputnc(this->
fill(), __npad) != __npad;
380 __failed = __failed || !this->_M_put_widen_aux(__s,
__n);
386 this->_M_handle_exception(ios_base::badbit);
390 this->setstate(ios_base::failbit);
394template <
class _CharT,
class _Traits>
400 if (this->_S_eof(__buf->
sputc(this->widen(*__s++))))
406template <
class _CharT,
class _Traits>
410 bool __failed =
true;
414 __failed = this->_S_eof(this->rdbuf()->sputc(
__c));
417 this->_M_handle_exception(ios_base::badbit);
422 this->setstate(ios_base::badbit);
428template <
class _CharT,
class _Traits>
432 bool __failed =
true;
436 __failed = this->rdbuf()->sputn(__s,
__n) !=
__n;
439 this->_M_handle_exception(ios_base::badbit);
444 this->setstate(ios_base::badbit);
_STLP_MOVE_TO_STD_NAMESPACE void fill(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
_STLP_MOVE_TO_PRIV_NAMESPACE basic_ostream< _CharT, _Traits > &_STLP_CALL __put_num(basic_ostream< _CharT, _Traits > &__os, _Number __x)
static size_t _STLP_CALL length(const char_type *__s)
basic_streambuf< _CharT, _Traits > * rdbuf() const
void setstate(iostate __state)
void _M_handle_exception(ios_base::iostate __flag)
void _M_put_nowiden(const _CharT *__s)
_Self & operator<<(__ostream_fn __f)
void _M_put_widen(const char *__s)
void _M_put_char(_CharT __c)
_Traits::int_type int_type
basic_ostream(basic_streambuf< _CharT, _Traits > *__buf)
_Self & put(char_type __c)
bool _M_put_widen_aux(const char *__s, streamsize __n)
_Self & write(const char_type *__s, streamsize __n)
int_type sputbackc(char_type __c)
char_type * egptr() const
_Traits::int_type int_type
streamsize sputn(const char_type *__s, streamsize __n)
int_type sputc(char_type __c)
__kernel_ptrdiff_t ptrdiff_t
#define _STLP_STATIC_ASSERT(expr)
#define _STLP_MOVE_TO_STD_NAMESPACE
#define __STATIC_CAST(__x, __y)
#define _STLP_BEGIN_NAMESPACE
#define _STLP_END_NAMESPACE
#define _STLP_MOVE_TO_PRIV_NAMESPACE
GLint GLint GLsizei width
_StreamBuf::int_type int_type
basic_streambuf< _CharT, _Traits > _StreamBuf
_SPutBackC(_StreamBuf *pfrom)