ReactOS 0.4.16-dev-401-g45b008d
basic_ostream< _CharT, _Traits > Class Template Reference

#include <_ostream.h>

Inheritance diagram for basic_ostream< _CharT, _Traits >:
Collaboration diagram for basic_ostream< _CharT, _Traits >:

Classes

class  sentry
 

Public Types

typedef _CharT char_type
 
typedef _Traits::int_type int_type
 
typedef _Traits::pos_type pos_type
 
typedef _Traits::off_type off_type
 
typedef _Traits traits_type
 
typedef basic_ios< _CharT, _Traits > _Basic_ios
 
typedef basic_ios< _CharT, _Traits > &(_STLP_CALL__ios_fn) (basic_ios< _CharT, _Traits > &)
 
typedef ios_base &(_STLP_CALL__ios_base_fn) (ios_base &)
 
typedef _Self &(_STLP_CALL__ostream_fn) (_Self &)
 
- Public Types inherited from basic_ios< _CharT, _Traits >
typedef _CharT char_type
 
typedef _Traits::int_type int_type
 
typedef _Traits::pos_type pos_type
 
typedef _Traits::off_type off_type
 
typedef _Traits traits_type
 
- Public Types inherited from ios_base
enum  event { erase_event , imbue_event , copyfmt_event }
 
typedef int fmtflags
 
typedef int iostate
 
typedef int openmode
 
typedef int seekdir
 
typedef fmtflags fmt_flags
 
typedef void(* event_callback) (event, ios_base &, int __index)
 
typedef iostate io_state
 
typedef openmode open_mode
 
typedef seekdir seek_dir
 
typedef _STLP_STD::streamoff streamoff
 
typedef _STLP_STD::streampos streampos
 

Public Member Functions

 basic_ostream (basic_streambuf< _CharT, _Traits > *__buf)
 
 ~basic_ostream ()
 
_Selfoperator<< (__ostream_fn __f)
 
_Selfoperator<< (__ios_base_fn __f)
 
_Selfoperator<< (__ios_fn __ff)
 
void _M_put_char (_CharT __c)
 
void _M_put_nowiden (const _CharT *__s)
 
void _M_put_widen (const char *__s)
 
bool _M_put_widen_aux (const char *__s, streamsize __n)
 
_Selfput (char_type __c)
 
_Selfwrite (const char_type *__s, streamsize __n)
 
_Selfoperator<< (basic_streambuf< _CharT, _Traits > *__buf)
 
_Selfoperator<< (unsigned char __x)
 
_Selfoperator<< (short __x)
 
_Selfoperator<< (unsigned short __x)
 
_Selfoperator<< (int __x)
 
_Selfoperator<< (unsigned int __x)
 
_Selfoperator<< (long __x)
 
_Selfoperator<< (unsigned long __x)
 
_Selfoperator<< (float __x)
 
_Selfoperator<< (double __x)
 
_Selfoperator<< (long double __x)
 
_Selfoperator<< (const void *__x)
 
_Selfoperator<< (bool __x)
 
_Selfflush ()
 
pos_type tellp ()
 
_Selfseekp (pos_type __pos)
 
_Selfseekp (off_type __off, ios_base::seekdir __dir)
 
- Public Member Functions inherited from basic_ios< _CharT, _Traits >
 basic_ios (basic_streambuf< _CharT, _Traits > *__streambuf)
 
virtual ~basic_ios ()
 
basic_ostream< _CharT, _Traits > * tie () const
 
basic_ostream< _CharT, _Traits > * tie (basic_ostream< char_type, traits_type > *__new_tied_ostream)
 
basic_streambuf< _CharT, _Traits > * rdbuf () const
 
basic_streambuf< _CharT, _Traits > * rdbuf (basic_streambuf< char_type, traits_type > *)
 
basic_ios< _CharT, _Traits > & copyfmt (const basic_ios< _CharT, _Traits > &__x)
 
char_type fill () const
 
char_type fill (char_type __fill)
 
void clear (iostate __state=goodbit)
 
void setstate (iostate __state)
 
iostate exceptions () const
 
void exceptions (iostate __mask)
 
locale imbue (const locale &)
 
char narrow (_CharT, char) const
 
_CharT widen (char) const
 
const ctype< char_type > * _M_ctype_facet () const
 
void _M_handle_exception (ios_base::iostate __flag)
 
- Public Member Functions inherited from ios_base
 _STLP_STATIC_CONSTANT (int, left=0x0001)
 
 _STLP_STATIC_CONSTANT (int, right=0x0002)
 
 _STLP_STATIC_CONSTANT (int, internal=0x0004)
 
 _STLP_STATIC_CONSTANT (int, dec=0x0008)
 
 _STLP_STATIC_CONSTANT (int, hex=0x0010)
 
 _STLP_STATIC_CONSTANT (int, oct=0x0020)
 
 _STLP_STATIC_CONSTANT (int, fixed=0x0040)
 
 _STLP_STATIC_CONSTANT (int, scientific=0x0080)
 
 _STLP_STATIC_CONSTANT (int, boolalpha=0x0100)
 
 _STLP_STATIC_CONSTANT (int, showbase=0x0200)
 
 _STLP_STATIC_CONSTANT (int, showpoint=0x0400)
 
 _STLP_STATIC_CONSTANT (int, showpos=0x0800)
 
 _STLP_STATIC_CONSTANT (int, skipws=0x1000)
 
 _STLP_STATIC_CONSTANT (int, unitbuf=0x2000)
 
 _STLP_STATIC_CONSTANT (int, uppercase=0x4000)
 
 _STLP_STATIC_CONSTANT (int, adjustfield=left|right|internal)
 
 _STLP_STATIC_CONSTANT (int, basefield=dec|hex|oct)
 
 _STLP_STATIC_CONSTANT (int, floatfield=scientific|fixed)
 
 _STLP_STATIC_CONSTANT (int, goodbit=0x00)
 
 _STLP_STATIC_CONSTANT (int, badbit=0x01)
 
 _STLP_STATIC_CONSTANT (int, eofbit=0x02)
 
 _STLP_STATIC_CONSTANT (int, failbit=0x04)
 
 _STLP_STATIC_CONSTANT (int, __default_mode=0x0)
 
 _STLP_STATIC_CONSTANT (int, app=0x01)
 
 _STLP_STATIC_CONSTANT (int, ate=0x02)
 
 _STLP_STATIC_CONSTANT (int, binary=0x04)
 
 _STLP_STATIC_CONSTANT (int, in=0x08)
 
 _STLP_STATIC_CONSTANT (int, out=0x10)
 
 _STLP_STATIC_CONSTANT (int, trunc=0x20)
 
 _STLP_STATIC_CONSTANT (int, beg=0x01)
 
 _STLP_STATIC_CONSTANT (int, cur=0x02)
 
 _STLP_STATIC_CONSTANT (int, end=0x04)
 
fmtflags flags () const
 
fmtflags flags (fmtflags __flags)
 
fmtflags setf (fmtflags __flag)
 
fmtflags setf (fmtflags __flag, fmtflags __mask)
 
void unsetf (fmtflags __mask)
 
streamsize precision () const
 
streamsize precision (streamsize __newprecision)
 
streamsize width () const
 
streamsize width (streamsize __newwidth)
 
locale imbue (const locale &)
 
locale getloc () const
 
longiword (int __index)
 
void *& pword (int __index)
 
virtual ~ios_base ()
 
void register_callback (event_callback __fn, int __index)
 
 operator void * () const
 
bool operator! () const
 
iostate rdstate () const
 
bool good () const
 
bool eof () const
 
bool fail () const
 
bool bad () const
 

Private Types

typedef basic_ostream< _CharT, _Traits > _Self
 

Private Member Functions

bool _M_copy_buffered (basic_streambuf< _CharT, _Traits > *__from, basic_streambuf< _CharT, _Traits > *__to)
 
bool _M_copy_unbuffered (basic_streambuf< _CharT, _Traits > *__from, basic_streambuf< _CharT, _Traits > *__to)
 

Additional Inherited Members

- Static Public Member Functions inherited from basic_ios< _CharT, _Traits >
static bool _STLP_CALL _S_eof (int_type __c)
 
- Static Public Member Functions inherited from ios_base
static int _STLP_CALL xalloc ()
 
static bool _STLP_CALL sync_with_stdio (bool __sync=true)
 
- Protected Member Functions inherited from basic_ios< _CharT, _Traits >
 basic_ios ()
 
void init (basic_streambuf< _CharT, _Traits > *__streambuf)
 
- Protected Member Functions inherited from ios_base
void _M_copy_state (const ios_base &__x)
 
void _M_setstate_nothrow (iostate __state)
 
void _M_clear_nothrow (iostate __state)
 
iostate _M_get_exception_mask () const
 
void _M_set_exception_mask (iostate __mask)
 
void _M_check_exception_mask ()
 
void _M_invoke_callbacks (event)
 
void _STLP_FUNCTION_THROWS _M_throw_failure ()
 
 ios_base ()
 
- Static Protected Member Functions inherited from ios_base
static void _STLP_CALL _S_initialize ()
 
static void _STLP_CALL _S_uninitialize ()
 
- Protected Attributes inherited from basic_ios< _CharT, _Traits >
const ctype< char_type > * _M_cached_ctype
 
- Static Protected Attributes inherited from ios_base
static bool _S_is_synced = true
 

Detailed Description

template<class _CharT, class _Traits>
class basic_ostream< _CharT, _Traits >

Definition at line 53 of file _ostream.h.

Member Typedef Documentation

◆ __ios_base_fn

template<class _CharT , class _Traits >
typedef ios_base &(_STLP_CALL * basic_ostream< _CharT, _Traits >::__ios_base_fn) (ios_base &)

Definition at line 76 of file _ostream.h.

◆ __ios_fn

template<class _CharT , class _Traits >
typedef basic_ios< _CharT, _Traits > &(_STLP_CALL * basic_ostream< _CharT, _Traits >::__ios_fn) (basic_ios< _CharT, _Traits > &)

Definition at line 75 of file _ostream.h.

◆ __ostream_fn

template<class _CharT , class _Traits >
typedef _Self &(_STLP_CALL * basic_ostream< _CharT, _Traits >::__ostream_fn) (_Self &)

Definition at line 77 of file _ostream.h.

◆ _Basic_ios

template<class _CharT , class _Traits >
typedef basic_ios<_CharT, _Traits> basic_ostream< _CharT, _Traits >::_Basic_ios

Definition at line 68 of file _ostream.h.

◆ _Self

template<class _CharT , class _Traits >
typedef basic_ostream<_CharT, _Traits> basic_ostream< _CharT, _Traits >::_Self
private

Definition at line 54 of file _ostream.h.

◆ char_type

template<class _CharT , class _Traits >
typedef _CharT basic_ostream< _CharT, _Traits >::char_type

Definition at line 63 of file _ostream.h.

◆ int_type

template<class _CharT , class _Traits >
typedef _Traits::int_type basic_ostream< _CharT, _Traits >::int_type

Definition at line 64 of file _ostream.h.

◆ off_type

template<class _CharT , class _Traits >
typedef _Traits::off_type basic_ostream< _CharT, _Traits >::off_type

Definition at line 66 of file _ostream.h.

◆ pos_type

template<class _CharT , class _Traits >
typedef _Traits::pos_type basic_ostream< _CharT, _Traits >::pos_type

Definition at line 65 of file _ostream.h.

◆ traits_type

template<class _CharT , class _Traits >
typedef _Traits basic_ostream< _CharT, _Traits >::traits_type

Definition at line 67 of file _ostream.h.

Constructor & Destructor Documentation

◆ basic_ostream()

template<class _CharT , class _Traits >
_STLP_BEGIN_NAMESPACE basic_ostream< _CharT, _Traits >::basic_ostream ( basic_streambuf< _CharT, _Traits > *  __buf)
explicit

Definition at line 37 of file _ostream.c.

39 this->init(__buf);
40}
Definition: _ios.h:48
static int init
Definition: wintirpc.c:33

◆ ~basic_ostream()

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits >::~basic_ostream

Definition at line 43 of file _ostream.c.

44{}

Member Function Documentation

◆ _M_copy_buffered()

template<class _CharT , class _Traits >
bool basic_ostream< _CharT, _Traits >::_M_copy_buffered ( basic_streambuf< _CharT, _Traits > *  __from,
basic_streambuf< _CharT, _Traits > *  __to 
)
private

Definition at line 73 of file _ostream.c.

74 {
75 bool __any_inserted = false;
76
77 while (__from->egptr() != __from->gptr()) {
78 const ptrdiff_t __avail = __from->egptr() - __from->gptr();
79
80 streamsize __nwritten;
81 _STLP_TRY {
82 __nwritten = __to->sputn(__from->gptr(), __avail);
83 __from->gbump((int)__nwritten);
84 }
86 this->_M_handle_exception(ios_base::badbit);
87 return __any_inserted;
88 }
89
90 if (__nwritten == __avail) {
91 _STLP_TRY {
92 if (this->_S_eof(__from->sgetc()))
93 return true;
94 else
95 __any_inserted = true;
96 }
98 this->_M_handle_exception(ios_base::failbit);
99 return false;
100 }
101 }
102 else if (__nwritten != 0)
103 return true;
104 else
105 return __any_inserted;
106 }
107
108 // No characters are in the buffer, but we aren't at EOF. Switch to
109 // unbuffered mode.
110 return __any_inserted || this->_M_copy_unbuffered(__from, __to);
111}
ptrdiff_t streamsize
Definition: char_traits.h:81
static bool _STLP_CALL _S_eof(int_type __c)
Definition: _ios.h:110
void _M_handle_exception(ios_base::iostate __flag)
Definition: _ios.c:114
bool _M_copy_unbuffered(basic_streambuf< _CharT, _Traits > *__from, basic_streambuf< _CharT, _Traits > *__to)
Definition: _ostream.c:145
char_type * egptr() const
Definition: _streambuf.h:89
char_type * gptr() const
Definition: _streambuf.h:88
int_type sgetc()
Definition: _streambuf.h:233
void gbump(int __n)
Definition: _streambuf.h:91
streamsize sputn(const char_type *__s, streamsize __n)
Definition: _streambuf.h:204
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247
#define _STLP_TRY
Definition: features.h:817
#define _STLP_CATCH_ALL
Definition: features.h:818

◆ _M_copy_unbuffered()

template<class _CharT , class _Traits >
bool basic_ostream< _CharT, _Traits >::_M_copy_unbuffered ( basic_streambuf< _CharT, _Traits > *  __from,
basic_streambuf< _CharT, _Traits > *  __to 
)
private

Definition at line 145 of file _ostream.c.

146 {
147 typedef _SPutBackC<_CharT, _Traits> _SPutBackCGuard;
148 bool __any_inserted = false;
150
151 _STLP_TRY {
152 _SPutBackCGuard __cguard(__from);
153 for (;;) {
154 _STLP_TRY {
155 __c = __from->sbumpc();
156 }
158 this->_M_handle_exception(ios_base::failbit);
159 break;
160 }
161
162 if (this->_S_eof(__c))
163 break;
164
165 __cguard.guard(__c);
166#if defined (__DMC__)
167 _STLP_TRY {
168#endif
169 if (this->_S_eof(__to->sputc(_Traits::to_char_type(__c))))
170 break;
171
172#if defined (__DMC__)
173 }
175 this->_M_handle_exception(ios_base::badbit);
176 break;
177 }
178#endif
179 __cguard.release();
180 __any_inserted = true;
181 }
182 }
184 this->_M_handle_exception(ios_base::badbit);
185 }
186 return __any_inserted;
187}
_Traits::int_type int_type
Definition: _ostream.h:64
int_type sbumpc()
Definition: _streambuf.h:227
int_type sputc(char_type __c)
Definition: _streambuf.h:198
#define __c
Definition: schilyio.h:209

◆ _M_put_char()

template<class _CharT , class _Traits >
void basic_ostream< _CharT, _Traits >::_M_put_char ( _CharT  __c)

Definition at line 300 of file _ostream.c.

300 {
301 sentry __sentry(*this);
302 if (__sentry) {
303 bool __failed = true;
304 _STLP_TRY {
305 streamsize __npad = this->width() > 0 ? this->width() - 1 : 0;
306 // if (__npad <= 1)
307 if (__npad == 0)
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;
313 }
314 else {
315 __failed = this->rdbuf()->_M_sputnc(this->fill(), __npad) != __npad;
316 __failed = __failed || this->_S_eof(this->rdbuf()->sputc(__c));
317 }
318
319 this->width(0);
320 }
322 this->_M_handle_exception(ios_base::badbit);
323 }
324
325 if (__failed)
326 this->setstate(ios_base::badbit);
327 }
328}
basic_streambuf< _CharT, _Traits > * rdbuf() const
Definition: _ios.h:72
char_type fill() const
Definition: _ios.h:81
void setstate(iostate __state)
Definition: _ios.h:95
fmtflags flags() const
Definition: _ios_base.h:107
streamsize width() const
Definition: _ios_base.h:134

Referenced by operator<<(), and basic_ostream< _CharT, _Traits >::operator<<().

◆ _M_put_nowiden()

template<class _CharT , class _Traits >
void basic_ostream< _CharT, _Traits >::_M_put_nowiden ( const _CharT *  __s)

Definition at line 331 of file _ostream.c.

331 {
332 sentry __sentry(*this);
333 if (__sentry) {
334 bool __failed = true;
335 streamsize __n = _Traits::length(__s);
336 streamsize __npad = this->width() > __n ? this->width() - __n : 0;
337
338 _STLP_TRY {
339 if (__npad == 0)
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;
345 }
346 else {
347 __failed = this->rdbuf()->_M_sputnc(this->fill(), __npad) != __npad;
348 __failed = __failed || this->rdbuf()->sputn(__s, __n) != __n;
349 }
350
351 this->width(0);
352 }
354 this->_M_handle_exception(ios_base::badbit);
355 }
356
357 if (__failed)
358 this->setstate(ios_base::failbit);
359 }
360}
return __n
Definition: _algo.h:75

Referenced by operator<<().

◆ _M_put_widen()

template<class _CharT , class _Traits >
void basic_ostream< _CharT, _Traits >::_M_put_widen ( const char __s)

Definition at line 363 of file _ostream.c.

363 {
364 sentry __sentry(*this);
365 if (__sentry) {
366 bool __failed = true;
368 streamsize __npad = this->width() > __n ? this->width() - __n : 0;
369
370 _STLP_TRY {
371 if (__npad == 0)
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;
377 }
378 else {
379 __failed = this->rdbuf()->_M_sputnc(this->fill(), __npad) != __npad;
380 __failed = __failed || !this->_M_put_widen_aux(__s, __n);
381 }
382
383 this->width(0);
384 }
386 this->_M_handle_exception(ios_base::badbit);
387 }
388
389 if (__failed)
390 this->setstate(ios_base::failbit);
391 }
392}
static size_t _STLP_CALL length(const char_type *__s)
Definition: char_traits.h:153
bool _M_put_widen_aux(const char *__s, streamsize __n)
Definition: _ostream.c:395

Referenced by operator<<().

◆ _M_put_widen_aux()

template<class _CharT , class _Traits >
bool basic_ostream< _CharT, _Traits >::_M_put_widen_aux ( const char __s,
streamsize  __n 
)

Definition at line 395 of file _ostream.c.

396 {
398
399 for ( ; __n > 0 ; --__n)
400 if (this->_S_eof(__buf->sputc(this->widen(*__s++))))
401 return false;
402 return true;
403}

◆ flush()

template<class _CharT , class _Traits >
_Self & basic_ostream< _CharT, _Traits >::flush ( )
inline

Definition at line 134 of file _ostream.h.

134 {
135 if (this->rdbuf())
136 if (this->rdbuf()->pubsync() == -1)
137 this->setstate(ios_base::badbit);
138 return *this;
139 }

Referenced by endl(), flush(), and basic_ostream< _CharT, _Traits >::sentry::~sentry().

◆ operator<<() [1/16]

template<class _CharT , class _Traits >
_Self & basic_ostream< _CharT, _Traits >::operator<< ( __ios_base_fn  __f)
inline

Definition at line 79 of file _ostream.h.

79{ __f(*this); return *this; }

◆ operator<<() [2/16]

template<class _CharT , class _Traits >
_Self & basic_ostream< _CharT, _Traits >::operator<< ( __ios_fn  __ff)
inline

Definition at line 80 of file _ostream.h.

80{ __ff(*this); return *this; }

◆ operator<<() [3/16]

template<class _CharT , class _Traits >
_Self & basic_ostream< _CharT, _Traits >::operator<< ( __ostream_fn  __f)
inline

Definition at line 78 of file _ostream.h.

78{ return __f(*this); }

◆ operator<<() [4/16]

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > & basic_ostream< _CharT, _Traits >::operator<< ( basic_streambuf< _CharT, _Traits > *  __buf)

Definition at line 43 of file _ostream.c.

49 {
50 sentry __sentry(*this);
51 if (__sentry) {
52 if (__from) {
53 bool __any_inserted = __from->gptr() != __from->egptr()
54 ? this->_M_copy_buffered(__from, this->rdbuf())
55 : this->_M_copy_unbuffered(__from, this->rdbuf());
56 if (!__any_inserted)
57 this->setstate(ios_base::failbit);
58 }
59 else
60 this->setstate(ios_base::badbit);
61 }
62
63 return *this;
64}
bool _M_copy_buffered(basic_streambuf< _CharT, _Traits > *__from, basic_streambuf< _CharT, _Traits > *__to)
Definition: _ostream.c:73

◆ operator<<() [5/16]

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > & basic_ostream< _CharT, _Traits >::operator<< ( bool  __x)

Definition at line 215 of file _ostream.c.

296{ return _STLP_PRIV __put_num(*this, __x); }
#define _STLP_PRIV
Definition: _dm.h:70
_STLP_MOVE_TO_PRIV_NAMESPACE basic_ostream< _CharT, _Traits > &_STLP_CALL __put_num(basic_ostream< _CharT, _Traits > &__os, _Number __x)
Definition: _ostream.c:194

◆ operator<<() [6/16]

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > & basic_ostream< _CharT, _Traits >::operator<< ( const void __x)

Definition at line 215 of file _ostream.c.

291{ return _STLP_PRIV __put_num(*this, __x); }

◆ operator<<() [7/16]

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > & basic_ostream< _CharT, _Traits >::operator<< ( double  __x)

Definition at line 215 of file _ostream.c.

281{ return _STLP_PRIV __put_num(*this, __x); }

◆ operator<<() [8/16]

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > & basic_ostream< _CharT, _Traits >::operator<< ( float  __x)

Definition at line 215 of file _ostream.c.

277{ return _STLP_PRIV __put_num(*this, __STATIC_CAST(double,__x)); }
#define __STATIC_CAST(__x, __y)
Definition: features.h:585

◆ operator<<() [9/16]

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > & basic_ostream< _CharT, _Traits >::operator<< ( int  __x)

Definition at line 215 of file _ostream.c.

236 {
237 _STLP_STATIC_ASSERT( sizeof(int) <= sizeof(long) )
238 long __tmp = ((this->flags() & _Basic_ios::basefield) != ios_base::dec) ?
239 __STATIC_CAST(long, __STATIC_CAST(unsigned int, __x)): __x;
240 return _STLP_PRIV __put_num(*this, __tmp);
241}
#define _STLP_STATIC_ASSERT(expr)
Definition: features.h:313

◆ operator<<() [10/16]

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > & basic_ostream< _CharT, _Traits >::operator<< ( long  __x)

Definition at line 215 of file _ostream.c.

259{ return _STLP_PRIV __put_num(*this, __x); }

◆ operator<<() [11/16]

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > & basic_ostream< _CharT, _Traits >::operator<< ( long double  __x)

Definition at line 215 of file _ostream.c.

286{ return _STLP_PRIV __put_num(*this, __x); }

◆ operator<<() [12/16]

template<class _CharT , class _Traits >
_STLP_MOVE_TO_STD_NAMESPACE basic_ostream< _CharT, _Traits > & basic_ostream< _CharT, _Traits >::operator<< ( short  __x)

Definition at line 215 of file _ostream.c.

222 {
223 _STLP_STATIC_ASSERT( sizeof(short) <= sizeof(long) )
224 long __tmp = ((this->flags() & _Basic_ios::basefield) != ios_base::dec) ?
225 __STATIC_CAST(long, __STATIC_CAST(unsigned short, __x)): __x;
226 return _STLP_PRIV __put_num(*this, __tmp);
227}

◆ operator<<() [13/16]

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > & basic_ostream< _CharT, _Traits >::operator<< ( unsigned char  __x)
inline

Definition at line 104 of file _ostream.h.

104{ _M_put_char(__x); return *this; }
void _M_put_char(_CharT __c)
Definition: _ostream.c:300

◆ operator<<() [14/16]

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > & basic_ostream< _CharT, _Traits >::operator<< ( unsigned int  __x)

Definition at line 215 of file _ostream.c.

245 {
246 _STLP_STATIC_ASSERT( sizeof(unsigned int) <= sizeof(unsigned long) )
247#else
248/* We define this operator with size_t rather than unsigned int to avoid
249 * 64 bits warning.
250 */
252 _STLP_STATIC_ASSERT( sizeof(size_t) <= sizeof(unsigned long) )
253#endif
254 return _STLP_PRIV __put_num(*this, __STATIC_CAST(unsigned long,__x));
255}
_Self & operator<<(__ostream_fn __f)
Definition: _ostream.h:78

◆ operator<<() [15/16]

template<class _CharT , class _Traits >
_Self & basic_ostream< _CharT, _Traits >::operator<< ( unsigned long  __x)

◆ operator<<() [16/16]

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > & basic_ostream< _CharT, _Traits >::operator<< ( unsigned short  __x)

Definition at line 215 of file _ostream.c.

230 {
231 _STLP_STATIC_ASSERT( sizeof(unsigned short) <= sizeof(unsigned long) )
232 return _STLP_PRIV __put_num(*this, __STATIC_CAST(unsigned long,__x));
233}

◆ put()

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > & basic_ostream< _CharT, _Traits >::put ( char_type  __c)

Definition at line 408 of file _ostream.c.

408 {
409 sentry __sentry(*this);
410 bool __failed = true;
411
412 if (__sentry) {
413 _STLP_TRY {
414 __failed = this->_S_eof(this->rdbuf()->sputc(__c));
415 }
417 this->_M_handle_exception(ios_base::badbit);
418 }
419 }
420
421 if (__failed)
422 this->setstate(ios_base::badbit);
423
424 return *this;
425}

Referenced by _Rope_fill(), _tiffosSeekProc(), endl(), and ends().

◆ seekp() [1/2]

template<class _CharT , class _Traits >
_Self & basic_ostream< _CharT, _Traits >::seekp ( off_type  __off,
ios_base::seekdir  __dir 
)
inline

Definition at line 156 of file _ostream.h.

156 {
157 if (this->rdbuf() && !this->fail())
158 this->rdbuf()->pubseekoff(__off, __dir, ios_base::out);
159 return *this;
160 }
bool fail() const
Definition: _ios_base.h:174

◆ seekp() [2/2]

template<class _CharT , class _Traits >
_Self & basic_ostream< _CharT, _Traits >::seekp ( pos_type  __pos)
inline

Definition at line 147 of file _ostream.h.

147 {
148 if (this->rdbuf() && !this->fail()) {
149 if (this->rdbuf()->pubseekpos(__pos, ios_base::out) == pos_type(-1)) {
150 this->setstate(ios_base::failbit);
151 }
152 }
153 return *this;
154 }
_Traits::pos_type pos_type
Definition: _ostream.h:65

Referenced by _tiffosSeekProc(), _tiffosSizeProc(), and TIFFStreamOpen().

◆ tellp()

template<class _CharT , class _Traits >
pos_type basic_ostream< _CharT, _Traits >::tellp ( )
inline

Definition at line 141 of file _ostream.h.

141 {
142 return this->rdbuf() && !this->fail()
143 ? this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out)
144 : pos_type(-1);
145 }

Referenced by _tiffosSeekProc(), _tiffosSizeProc(), _tiffosWriteProc(), _tiffStreamOpen(), and TIFFStreamOpen().

◆ write()

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > & basic_ostream< _CharT, _Traits >::write ( const char_type __s,
streamsize  __n 
)

Definition at line 430 of file _ostream.c.

430 {
431 sentry __sentry(*this);
432 bool __failed = true;
433
434 if (__sentry) {
435 _STLP_TRY {
436 __failed = this->rdbuf()->sputn(__s, __n) != __n;
437 }
439 this->_M_handle_exception(ios_base::badbit);
440 }
441 }
442
443 if (__failed)
444 this->setstate(ios_base::badbit);
445
446 return *this;
447}

Referenced by _tiffosWriteProc(), and utf_converter::convert2utf16le().


The documentation for this class was generated from the following files: