Go to the documentation of this file.
31 #define _BASIC_IOS_H 1
33 #ifdef _GLIBCXX_SYSHDR
34 #pragma GCC system_header
43 namespace std _GLIBCXX_VISIBILITY(default)
45 _GLIBCXX_BEGIN_NAMESPACE_VERSION
47 template<
typename _Facet>
49 __check_facet(
const _Facet* __f)
68 template<
typename _CharT,
typename _Traits>
69 class basic_ios :
public ios_base
71 #if __cplusplus >= 202002L
72 static_assert(is_same_v<_CharT, typename _Traits::char_type>);
104 mutable bool _M_fill_init;
122 #if __cplusplus >= 201103L
124 explicit operator bool()
const
125 {
return !this->
fail(); }
127 operator void*()
const
134 {
return this->
fail(); }
147 {
return _M_streambuf_state; }
157 clear(iostate __state = goodbit);
173 _M_setstate(iostate __state)
177 _M_streambuf_state |= __state;
179 { __throw_exception_again; }
191 {
return this->
rdstate() == 0; }
202 {
return (this->
rdstate() & eofbit) != 0; }
214 {
return (this->
rdstate() & (badbit | failbit)) != 0; }
225 {
return (this->
rdstate() & badbit) != 0; }
237 {
return _M_exception; }
273 _M_exception = __except;
274 this->
clear(_M_streambuf_state);
285 :
ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
286 _M_ctype(0), _M_num_put(0), _M_num_get(0)
287 { this->
init(__sb); }
338 {
return _M_streambuf; }
389 if (__builtin_expect(!_M_fill_init,
false))
390 return this->
widen(
' ');
446 {
return __check_facet(_M_ctype).narrow(__c, __dfault); }
465 {
return __check_facet(_M_ctype).widen(__c); }
477 _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
489 #if __cplusplus >= 201103L
496 ios_base::_M_move(__rhs);
497 _M_cache_locale(_M_ios_locale);
498 this->
tie(__rhs.tie(
nullptr));
499 _M_fill = __rhs._M_fill;
500 _M_fill_init = __rhs._M_fill_init;
501 _M_streambuf =
nullptr;
506 { this->move(__rhs); }
511 ios_base::_M_swap(__rhs);
512 _M_cache_locale(_M_ios_locale);
513 __rhs._M_cache_locale(__rhs._M_ios_locale);
514 std::swap(_M_tie, __rhs._M_tie);
515 std::swap(_M_fill, __rhs._M_fill);
516 std::swap(_M_fill_init, __rhs._M_fill_init);
520 set_rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
521 { _M_streambuf = __sb; }
525 _M_cache_locale(
const locale& __loc);
528 _GLIBCXX_END_NAMESPACE_VERSION
char_type widen(char __c) const
Widens characters.
void init(basic_streambuf< _CharT, _Traits > *__sb)
All setup is performed here.
_Traits::int_type int_type
char narrow(char_type __c, char __dfault) const
Squeezes characters.
_Traits::off_type off_type
void exceptions(iostate __except)
Throwing exceptions on errors.
void setstate(iostate __state)
Sets additional flags in the error state.
char_type fill(char_type __ch)
Sets a new empty character.
Container class for localization functionality.
char_type fill() const
Retrieves the empty character.
ISO C++ entities toplevel namespace is std.
Primary class template num_put.
basic_ostream< _CharT, _Traits > * tie(basic_ostream< _CharT, _Traits > *__tiestr)
Ties this stream to an output stream.
bool eof() const
Fast error checking.
bool bad() const
Fast error checking.
The actual work of input and output (interface).
basic_ios & copyfmt(const basic_ios &__rhs)
Copies fields of __rhs into this.
Primary class template num_get.
basic_ostream< _CharT, _Traits > * tie() const
Fetches the current tied stream.
void clear(iostate __state=goodbit)
[Re]sets the error state.
basic_streambuf< _CharT, _Traits > * rdbuf() const
Accessing the underlying buffer.
virtual ~basic_ios()
Empty.
num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type
iostate exceptions() const
Throwing exceptions on errors.
The base of the I/O class hierarchy.
Template class basic_ostream.
Template class basic_ios, virtual base class for all stream classes.
bool good() const
Fast error checking.
_Traits::pos_type pos_type
iostate rdstate() const
Returns the error state of the stream buffer.
num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_type
basic_ios(basic_streambuf< _CharT, _Traits > *__sb)
Constructor performs initialization.
ctype< _CharT > __ctype_type
bool operator!() const
The quick-and-easy status check.
Primary class template ctype facet.
bool fail() const
Fast error checking.
locale imbue(const locale &__loc)
Moves to a new locale.