ReactOS 0.4.15-dev-7942-gd23573b
basic_ios< _CharT, _Traits > Class Template Reference

#include <_ios.h>

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

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
 
- 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_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
 

Static Public Member Functions

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

 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 ()
 

Protected Attributes

const ctype< char_type > * _M_cached_ctype
 

Private Attributes

char_type _M_fill
 
basic_streambuf< _CharT, _Traits > * _M_streambuf
 
basic_ostream< _CharT, _Traits > * _M_tied_ostream
 

Friends

class ios_base
 

Additional Inherited Members

- Static Protected Member Functions inherited from ios_base
static void _STLP_CALL _S_initialize ()
 
static void _STLP_CALL _S_uninitialize ()
 
- Static Protected Attributes inherited from ios_base
static bool _S_is_synced = true
 

Detailed Description

template<class _CharT, class _Traits>
class basic_ios< _CharT, _Traits >

Definition at line 48 of file _ios.h.

Member Typedef Documentation

◆ char_type

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

Definition at line 51 of file _ios.h.

◆ int_type

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

Definition at line 52 of file _ios.h.

◆ off_type

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

Definition at line 54 of file _ios.h.

◆ pos_type

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

Definition at line 53 of file _ios.h.

◆ traits_type

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

Definition at line 55 of file _ios.h.

Constructor & Destructor Documentation

◆ basic_ios() [1/2]

template<class _CharT , class _Traits >
_STLP_BEGIN_NAMESPACE basic_ios< _CharT, _Traits >::basic_ios ( basic_streambuf< _CharT, _Traits > *  __streambuf)
explicit

Definition at line 40 of file _ios.c.

44}
#define _STLP_NULL_CHAR_INIT(_ChT)
Definition: char_traits.h:55
basic_streambuf< _CharT, _Traits > * _M_streambuf
Definition: _ios.h:137
char_type _M_fill
Definition: _ios.h:135
void init(basic_streambuf< _CharT, _Traits > *__streambuf)
Definition: _ios.c:97
basic_ostream< _CharT, _Traits > * _M_tied_ostream
Definition: _ios.h:138
const ctype< char_type > * _M_cached_ctype
Definition: _ios.h:117
friend class ios_base
Definition: _ios.h:49

◆ ~basic_ios()

template<class _CharT , class _Traits >
virtual basic_ios< _CharT, _Traits >::~basic_ios ( )
inlinevirtual

Definition at line 59 of file _ios.h.

59{}

◆ basic_ios() [2/2]

template<class _CharT , class _Traits >
basic_ios< _CharT, _Traits >::basic_ios
protected

Definition at line 90 of file _ios.c.

Member Function Documentation

◆ _M_ctype_facet()

template<class _CharT , class _Traits >
const ctype< char_type > * basic_ios< _CharT, _Traits >::_M_ctype_facet ( ) const
inline

Definition at line 121 of file _ios.h.

121{ return _M_cached_ctype; }

Referenced by operator>>().

◆ _M_handle_exception()

template<class _CharT , class _Traits >
void basic_ios< _CharT, _Traits >::_M_handle_exception ( ios_base::iostate  __flag)

Definition at line 114 of file _ios.c.

115{
116 this->_M_setstate_nothrow(__flag);
117 if (this->_M_get_exception_mask() & __flag)
119}
void _M_setstate_nothrow(iostate __state)
Definition: _ios_base.h:185
iostate _M_get_exception_mask() const
Definition: _ios_base.h:187
#define _STLP_RETHROW
Definition: features.h:822

Referenced by __copy_buffered(), __copy_unbuffered(), __get_num(), __put_num(), __read_buffered(), __read_unbuffered(), _M_ignore_buffered(), and _M_ignore_unbuffered().

◆ _S_eof()

template<class _CharT , class _Traits >
static bool _STLP_CALL basic_ios< _CharT, _Traits >::_S_eof ( int_type  __c)
inlinestatic

Definition at line 110 of file _ios.h.

110 {
111 const int_type __eof = _Traits::eof();
112 return _Traits::eq_int_type(__c, __eof);
113 }
_Traits::int_type int_type
Definition: _ios.h:52
#define __c
Definition: schilyio.h:209

Referenced by __copy_buffered(), __copy_unbuffered(), __read_buffered(), __read_unbuffered(), _M_ignore_buffered(), and _M_ignore_unbuffered().

◆ clear()

template<class _CharT , class _Traits >
void basic_ios< _CharT, _Traits >::clear ( iostate  __state = goodbit)
inline

Definition at line 91 of file _ios.h.

91 {
92 _M_clear_nothrow(this->rdbuf() ? __state : iostate(__state|ios_base::badbit));
94 }
basic_streambuf< _CharT, _Traits > * rdbuf() const
Definition: _ios.h:72
void _M_clear_nothrow(iostate __state)
Definition: _ios_base.h:186
void _M_check_exception_mask()
Definition: _ios_base.h:189
int iostate
Definition: _ios_base.h:58

Referenced by _tiffosSeekProc(), IStreamIteratorTest::copy_n_test(), basic_ios< _CharT, _Traits >::exceptions(), IOStreamTest::manipulators(), NumPutGetTest::num_get_float(), NumPutGetTest::num_get_integer(), and basic_ios< _CharT, _Traits >::setstate().

◆ copyfmt()

template<class _CharT , class _Traits >
basic_ios< _CharT, _Traits > & basic_ios< _CharT, _Traits >::copyfmt ( const basic_ios< _CharT, _Traits > &  __x)

Definition at line 57 of file _ios.c.

57 {
59 _M_copy_state(__x); // Inherited from ios_base.
61 _M_fill = __x._M_fill;
65 return *this;
66}
iostate exceptions() const
Definition: _ios.h:97
void _M_copy_state(const ios_base &__x)
Definition: ios.cpp:232
@ erase_event
Definition: _ios_base.h:154
@ copyfmt_event
Definition: _ios_base.h:154
void _M_invoke_callbacks(event)
Definition: ios.cpp:197
void _M_set_exception_mask(iostate __mask)
Definition: _ios_base.h:188

◆ exceptions() [1/2]

template<class _CharT , class _Traits >
iostate basic_ios< _CharT, _Traits >::exceptions ( ) const
inline

Definition at line 97 of file _ios.h.

97{ return this->_M_get_exception_mask(); }

Referenced by ios_base::_S_uninitialize().

◆ exceptions() [2/2]

template<class _CharT , class _Traits >
void basic_ios< _CharT, _Traits >::exceptions ( iostate  __mask)
inline

Definition at line 98 of file _ios.h.

98 {
99 this->_M_set_exception_mask(__mask);
100 this->clear(this->rdstate());
101 }
void clear(iostate __state=goodbit)
Definition: _ios.h:91
iostate rdstate() const
Definition: _ios_base.h:170

◆ fill() [1/2]

template<class _CharT , class _Traits >
char_type basic_ios< _CharT, _Traits >::fill ( ) const
inline

Definition at line 81 of file _ios.h.

81{ return _M_fill; }

Referenced by __put_num(), __stlp_string_fill(), _Rope_fill(), operator<<(), and operator>>().

◆ fill() [2/2]

template<class _CharT , class _Traits >
char_type basic_ios< _CharT, _Traits >::fill ( char_type  __fill)
inline

Definition at line 82 of file _ios.h.

82 {
83 char_type __tmp(_M_fill);
85 return __tmp;
86 }
void __fill(_ForwardIter __first, _ForwardIter __last, const _Tp &__val, const input_iterator_tag &, _Distance *)
Definition: _algobase.h:417
_CharT char_type
Definition: _ios.h:51

◆ imbue()

template<class _CharT , class _Traits >
locale basic_ios< _CharT, _Traits >::imbue ( const locale __loc)

Definition at line 69 of file _ios.c.

69 {
70 locale __tmp = ios_base::imbue(__loc);
71 _STLP_TRY {
72 if (_M_streambuf)
73 _M_streambuf->pubimbue(__loc);
74
75 // no throwing here
76 _M_cached_ctype = &use_facet<ctype<char_type> >(__loc);
77 }
79 __tmp = ios_base::imbue(__tmp);
80 _M_handle_exception(ios_base::failbit);
81 }
82 return __tmp;
83}
void _M_handle_exception(ios_base::iostate __flag)
Definition: _ios.c:114
locale imbue(const locale &)
Definition: ios.cpp:122
Definition: _locale.h:75
#define _STLP_TRY
Definition: features.h:817
#define _STLP_CATCH_ALL
Definition: features.h:818

Referenced by LocaleTest::_time_put_get(), CodecvtTest::imbue_while_reading(), and operator<<().

◆ init()

template<class _CharT , class _Traits >
void basic_ios< _CharT, _Traits >::init ( basic_streambuf< _CharT, _Traits > *  __streambuf)
protected

Definition at line 97 of file _ios.c.

98{
99 this->rdbuf(__sb);
100 this->imbue(locale());
101 this->tie(0);
102 this->_M_set_exception_mask(ios_base::goodbit);
103 this->_M_clear_nothrow(__sb != 0 ? ios_base::goodbit : ios_base::badbit);
104 ios_base::flags(ios_base::skipws | ios_base::dec);
107 this->fill(widen(' '));
108 // We don't need to worry about any of the three arrays: they are
109 // initialized correctly in ios_base's constructor.
110}
locale imbue(const locale &)
Definition: _ios.c:69
basic_ostream< _CharT, _Traits > * tie() const
Definition: _ios.h:62
char_type fill() const
Definition: _ios.h:81
_CharT widen(char) const
Definition: _ios.h:150
fmtflags flags() const
Definition: _ios_base.h:107
streamsize width() const
Definition: _ios_base.h:134
streamsize precision() const
Definition: _ios_base.h:127

Referenced by basic_ios< _CharT, _Traits >::basic_ios().

◆ narrow()

template<class _CharT , class _Traits >
char basic_ios< _CharT, _Traits >::narrow ( _CharT  __c,
char  __default 
) const
inline

Definition at line 145 of file _ios.h.

146{ return _M_ctype_facet()->narrow(__c, __default); }
const ctype< char_type > * _M_ctype_facet() const
Definition: _ios.h:121

Referenced by operator>>().

◆ rdbuf() [1/2]

◆ rdbuf() [2/2]

template<class _CharT , class _Traits >
basic_streambuf< _CharT, _Traits > * basic_ios< _CharT, _Traits >::rdbuf ( basic_streambuf< char_type, traits_type > *  __buf)

Definition at line 48 of file _ios.c.

48 {
50 _M_streambuf = __buf;
51 this->clear();
52 return __tmp;
53}

◆ setstate()

◆ tie() [1/2]

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > * basic_ios< _CharT, _Traits >::tie ( ) const
inline

Definition at line 62 of file _ios.h.

62 {
63 return _M_tied_ostream;
64 }

Referenced by __init_bostr(), _M_init_noskip(), _M_init_skip(), and ios_base::_S_initialize().

◆ tie() [2/2]

template<class _CharT , class _Traits >
basic_ostream< _CharT, _Traits > * basic_ios< _CharT, _Traits >::tie ( basic_ostream< char_type, traits_type > *  __new_tied_ostream)
inline

Definition at line 66 of file _ios.h.

66 {
68 _M_tied_ostream = __new_tied_ostream;
69 return __tmp;
70 }

◆ widen()

template<class _CharT , class _Traits >
_CharT basic_ios< _CharT, _Traits >::widen ( char  __c) const
inline

Friends And Related Function Documentation

◆ ios_base

template<class _CharT , class _Traits >
friend class ios_base
friend

Definition at line 49 of file _ios.h.

Member Data Documentation

◆ _M_cached_ctype

template<class _CharT , class _Traits >
const ctype<char_type>* basic_ios< _CharT, _Traits >::_M_cached_ctype
protected

Definition at line 117 of file _ios.h.

Referenced by basic_ios< _CharT, _Traits >::_M_ctype_facet().

◆ _M_fill

template<class _CharT , class _Traits >
char_type basic_ios< _CharT, _Traits >::_M_fill
private

Definition at line 135 of file _ios.h.

Referenced by basic_ios< _CharT, _Traits >::fill().

◆ _M_streambuf

template<class _CharT , class _Traits >
basic_streambuf<_CharT, _Traits>* basic_ios< _CharT, _Traits >::_M_streambuf
private

Definition at line 137 of file _ios.h.

Referenced by basic_ios< _CharT, _Traits >::rdbuf().

◆ _M_tied_ostream

template<class _CharT , class _Traits >
basic_ostream<_CharT, _Traits>* basic_ios< _CharT, _Traits >::_M_tied_ostream
private

Definition at line 138 of file _ios.h.

Referenced by basic_ios< _CharT, _Traits >::tie().


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