Go to the documentation of this file.
31 #define _BASIC_IOS_H 1
33 #pragma GCC system_header
41 namespace std _GLIBCXX_VISIBILITY(default)
43 _GLIBCXX_BEGIN_NAMESPACE_VERSION
45 template<
typename _Facet>
47 __check_facet(
const _Facet* __f)
66 template<
typename _CharT,
typename _Traits>
67 class basic_ios :
public ios_base
77 typedef typename _Traits::int_type int_type;
78 typedef typename _Traits::pos_type pos_type;
79 typedef typename _Traits::off_type off_type;
80 typedef _Traits traits_type;
98 mutable bool _M_fill_init;
116 #if __cplusplus >= 201103L
117 explicit operator bool()
const
118 {
return !this->
fail(); }
120 operator void*()
const
121 {
return this->
fail() ? 0 : const_cast<basic_ios*>(
this); }
126 {
return this->
fail(); }
138 {
return _M_streambuf_state; }
168 _M_streambuf_state |= __state;
170 __throw_exception_again;
181 {
return this->
rdstate() == 0; }
223 {
return _M_exception; }
259 _M_exception = __except;
260 this->
clear(_M_streambuf_state);
271 :
ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
272 _M_ctype(0), _M_num_put(0), _M_num_get(0)
273 { this->
init(__sb); }
322 {
return _M_streambuf; }
374 _M_fill = this->
widen(
' ');
431 {
return __check_facet(_M_ctype).narrow(__c, __dfault); }
450 {
return __check_facet(_M_ctype).widen(__c); }
462 _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
474 #if __cplusplus >= 201103L
481 ios_base::_M_move(__rhs);
482 _M_cache_locale(_M_ios_locale);
483 this->
tie(__rhs.tie(
nullptr));
484 _M_fill = __rhs._M_fill;
485 _M_fill_init = __rhs._M_fill_init;
486 _M_streambuf =
nullptr;
491 { this->move(__rhs); }
496 ios_base::_M_swap(__rhs);
497 _M_cache_locale(_M_ios_locale);
498 __rhs._M_cache_locale(__rhs._M_ios_locale);
499 std::swap(_M_tie, __rhs._M_tie);
500 std::swap(_M_fill, __rhs._M_fill);
501 std::swap(_M_fill_init, __rhs._M_fill_init);
505 set_rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
506 { _M_streambuf = __sb; }
510 _M_cache_locale(
const locale& __loc);
513 _GLIBCXX_END_NAMESPACE_VERSION
basic_ostream< _CharT, _Traits > * tie() const
Fetches the current tied stream.
void setstate(iostate __state)
Sets additional flags in the error state.
bool eof() const
Fast error checking.
bool bad() const
Fast error checking.
Container class for localization functionality.
void exceptions(iostate __except)
Throwing exceptions on errors.
static const iostate eofbit
Indicates that an input operation reached the end of an input sequence.
bool good() const
Fast error checking.
bool fail() const
Fast error checking.
static const iostate badbit
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error fro...
basic_ios(basic_streambuf< _CharT, _Traits > *__sb)
Constructor performs initialization.
Template class basic_ios, virtual base class for all stream classes.
basic_streambuf< _CharT, _Traits > * rdbuf() const
Accessing the underlying buffer.
char_type fill() const
Retrieves the empty character.
ctype< _CharT > __ctype_type
The ctype<char> specialization.
void clear(iostate __state=goodbit)
[Re]sets the error state.
Primary class template num_get.
The base of the I/O class hierarchy.
basic_ios & copyfmt(const basic_ios &__rhs)
Copies fields of __rhs into this.
char narrow(char_type __c, char __dfault) const
Squeezes characters.
Template class basic_ostream.
iostate rdstate() const
Returns the error state of the stream buffer.
The actual work of input and output (interface).
static const iostate goodbit
Indicates all is well.
Primary class template ctype facet.
iostate exceptions() const
Throwing exceptions on errors.
basic_ostream< _CharT, _Traits > * tie(basic_ostream< _CharT, _Traits > *__tiestr)
Ties this stream to an output stream.
void init(basic_streambuf< _CharT, _Traits > *__sb)
All setup is performed here.
char_type widen(char __c) const
Widens characters.
ISO C++ entities toplevel namespace is std.
char_type fill(char_type __ch)
Sets a new empty character.
_Ios_Iostate iostate
This is a bitmask type.
Primary class template num_put.
locale imbue(const locale &__loc)
Moves to a new locale.
static const iostate failbit
Indicates that an input operation failed to read the expected characters, or that an output operation...
virtual ~basic_ios()
Empty.