ReactOS  0.4.14-dev-608-gd495a4f
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.

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

◆ ~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.

91  : ios_base(),
93 {}
basic_streambuf< _CharT, _Traits > * _M_streambuf
Definition: _ios.h:137
char_type _M_fill
Definition: _ios.h:135
ios_base()
Definition: ios.cpp:285
basic_ostream< _CharT, _Traits > * _M_tied_ostream
Definition: _ios.h:138
#define _STLP_NULL_CHAR_INIT(_ChT)
Definition: char_traits.h:55

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; }
const ctype< char_type > * _M_cached_ctype
Definition: _ios.h:117

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 }
#define _STLP_RETHROW
Definition: features.h:822
iostate _M_get_exception_mask() const
Definition: _ios_base.h:187
void _M_setstate_nothrow(iostate __state)
Definition: _ios_base.h:185

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  }
#define __c
Definition: schilyio.h:209
_Traits::int_type int_type
Definition: _ios.h:52
_Check_return_ _CRTIMP int __cdecl __cdecl eof(_In_ int _FileHandle)

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  }
void _M_clear_nothrow(iostate __state)
Definition: _ios_base.h:186
basic_streambuf< _CharT, _Traits > * rdbuf() const
Definition: _ios.h:72
void _M_check_exception_mask()
Definition: _ios_base.h:189
int iostate
Definition: _ios_base.h:58

Referenced by IStreamIteratorTest::copy_n_test(), basic_ios< char, char_traits< char > >::exceptions(), IOStreamTest::manipulators(), NumPutGetTest::num_get_float(), NumPutGetTest::num_get_integer(), and basic_ios< char, char_traits< char > >::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;
64  this->_M_set_exception_mask(__x.exceptions());
65  return *this;
66 }
void _M_invoke_callbacks(event)
Definition: ios.cpp:197
const ctype< char_type > * _M_cached_ctype
Definition: _ios.h:117
char_type _M_fill
Definition: _ios.h:135
void _M_copy_state(const ios_base &__x)
Definition: ios.cpp:232
iostate exceptions() const
Definition: _ios.h:97
basic_ostream< _CharT, _Traits > * _M_tied_ostream
Definition: _ios.h:138
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(); }
iostate _M_get_exception_mask() const
Definition: _ios_base.h:187

Referenced by ios_base::_S_uninitialize(), and basic_ios< char, char_traits< char > >::copyfmt().

◆ 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  }
iostate rdstate() const
Definition: _ios_base.h:170
void clear(iostate __state=goodbit)
Definition: _ios.h:91
void _M_set_exception_mask(iostate __mask)
Definition: _ios_base.h:188

◆ 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; }
char_type _M_fill
Definition: _ios.h:135

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);
84  _M_fill = __fill;
85  return __tmp;
86  }
char_type _M_fill
Definition: _ios.h:135
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 }
locale imbue(const locale &)
Definition: ios.cpp:122
basic_streambuf< _CharT, _Traits > * _M_streambuf
Definition: _ios.h:137
void _M_handle_exception(ios_base::iostate __flag)
Definition: _ios.c:114
Definition: _locale.h:75
const ctype< char_type > * _M_cached_ctype
Definition: _ios.h:117
#define _STLP_CATCH_ALL
Definition: features.h:818
#define _STLP_TRY
Definition: features.h:817

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);
105  ios_base::width(0);
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 }
void _M_clear_nothrow(iostate __state)
Definition: _ios_base.h:186
streamsize precision() const
Definition: _ios_base.h:127
basic_streambuf< _CharT, _Traits > * rdbuf() const
Definition: _ios.h:72
char_type fill() const
Definition: _ios.h:81
ios_base &_STLP_CALL skipws(ios_base &__s)
Definition: _ios_base.h:291
ios_base &_STLP_CALL dec(ios_base &__s)
Definition: _ios_base.h:321
locale imbue(const locale &)
Definition: _ios.c:69
_CharT widen(char) const
Definition: _ios.h:150
fmtflags flags() const
Definition: _ios_base.h:107
static const wchar_t void * locale
Definition: printf.c:79
streamsize width() const
Definition: _ios_base.h:134
basic_ostream< _CharT, _Traits > * tie() const
Definition: _ios.h:62
void _M_set_exception_mask(iostate __mask)
Definition: _ios_base.h:188

Referenced by basic_fstream< char, char_traits< char > >::basic_fstream(), basic_ifstream< _CharT, _Traits >::basic_ifstream(), basic_ios< char, char_traits< char > >::basic_ios(), basic_istream< char, char_traits< char > >::basic_istream(), basic_ofstream< _CharT, _Traits >::basic_ofstream(), and basic_ostream< char, char_traits< char > >::basic_ostream().

◆ 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); }
#define __c
Definition: schilyio.h:209
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 }
basic_streambuf< _CharT, _Traits > * _M_streambuf
Definition: _ios.h:137
void clear(iostate __state=goodbit)
Definition: _ios.h:91

◆ 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  }
basic_ostream< _CharT, _Traits > * _M_tied_ostream
Definition: _ios.h:138

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  }
basic_ostream< _CharT, _Traits > * _M_tied_ostream
Definition: _ios.h:138

◆ widen()

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

Definition at line 150 of file _ios.h.

151 { return _M_ctype_facet()->widen(__c); }
#define __c
Definition: schilyio.h:209
const ctype< char_type > * _M_ctype_facet() const
Definition: _ios.h:121

Referenced by endl(), basic_istream< char, char_traits< char > >::get(), getline(), basic_istream< char, char_traits< char > >::getline(), and operator<<().

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

◆ _M_fill

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

◆ _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< char, char_traits< char > >::rdbuf().

◆ _M_tied_ostream

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

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