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
69 #if __cplusplus >= 202002L 70 static_assert(is_same_v<_CharT, typename _Traits::char_type>);
102 mutable bool _M_fill_init;
120 #if __cplusplus >= 201103L 121 explicit operator bool()
const 122 {
return !this->
fail(); }
124 operator void*()
const 130 {
return this->
fail(); }
142 {
return _M_streambuf_state; }
172 _M_streambuf_state |= __state;
174 __throw_exception_again;
185 {
return this->
rdstate() == 0; }
227 {
return _M_exception; }
263 _M_exception = __except;
264 this->
clear(_M_streambuf_state);
275 :
ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
276 _M_ctype(0), _M_num_put(0), _M_num_get(0)
277 { this->
init(__sb); }
326 {
return _M_streambuf; }
378 _M_fill = this->
widen(
' ');
435 {
return __check_facet(_M_ctype).narrow(__c, __dfault); }
454 {
return __check_facet(_M_ctype).widen(__c); }
466 _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
478 #if __cplusplus >= 201103L 485 ios_base::_M_move(__rhs);
486 _M_cache_locale(_M_ios_locale);
487 this->
tie(__rhs.tie(
nullptr));
488 _M_fill = __rhs._M_fill;
489 _M_fill_init = __rhs._M_fill_init;
490 _M_streambuf =
nullptr;
495 { this->move(__rhs); }
500 ios_base::_M_swap(__rhs);
501 _M_cache_locale(_M_ios_locale);
502 __rhs._M_cache_locale(__rhs._M_ios_locale);
503 std::swap(_M_tie, __rhs._M_tie);
504 std::swap(_M_fill, __rhs._M_fill);
505 std::swap(_M_fill_init, __rhs._M_fill_init);
509 set_rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
510 { _M_streambuf = __sb; }
514 _M_cache_locale(
const locale& __loc);
517 _GLIBCXX_END_NAMESPACE_VERSION
ISO C++ entities toplevel namespace is std.
char_type fill() const
Retrieves the empty character.
The ctype<char> specialization.This class defines classification and conversion functions for the cha...
static const iostate badbit
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error fro...
char_type widen(char __c) const
Widens characters.
bool fail() const
Fast error checking.
basic_ios & copyfmt(const basic_ios &__rhs)
Copies fields of __rhs into this.
ctype< _CharT > __ctype_type
locale imbue(const locale &__loc)
Moves to a new locale.
_Traits::pos_type pos_type
bool bad() const
Fast error checking.
static const iostate failbit
Indicates that an input operation failed to read the expected characters, or that an output operation...
Container class for localization functionality.The locale class is first a class wrapper for C librar...
void init(basic_streambuf< _CharT, _Traits > *__sb)
All setup is performed here.
bool operator!() const
The quick-and-easy status check.
Primary class template ctype facet.This template class defines classification and conversion function...
basic_ostream< _CharT, _Traits > * tie(basic_ostream< _CharT, _Traits > *__tiestr)
Ties this stream to an output stream.
_Traits::off_type off_type
char narrow(char_type __c, char __dfault) const
Squeezes characters.
The actual work of input and output (interface).
basic_streambuf< _CharT, _Traits > * rdbuf() const
Accessing the underlying buffer.
virtual ~basic_ios()
Empty.
num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_type
void setstate(iostate __state)
Sets additional flags in the error state.
Primary class template num_get.This facet encapsulates the code to parse and return a number from a s...
The base of the I/O class hierarchy.This class defines everything that can be defined about I/O that ...
char_type fill(char_type __ch)
Sets a new empty character.
iostate rdstate() const
Returns the error state of the stream buffer.
_Traits::int_type int_type
static const iostate eofbit
Indicates that an input operation reached the end of an input sequence.
basic_ostream< _CharT, _Traits > * tie() const
Fetches the current tied stream.
void clear(iostate __state=goodbit)
[Re]sets the error state.
Template class basic_ostream.
_Ios_Iostate iostate
This is a bitmask type.
Template class basic_ios, virtual base class for all stream classes.
bool eof() const
Fast error checking.
basic_ios(basic_streambuf< _CharT, _Traits > *__sb)
Constructor performs initialization.
bool good() const
Fast error checking.
Primary class template num_put.This facet encapsulates the code to convert a number to a string...
static const iostate goodbit
Indicates all is well.
num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type
iostate exceptions() const
Throwing exceptions on errors.
void exceptions(iostate __except)
Throwing exceptions on errors.