31 #define _BASIC_IOS_H 1
33 #pragma GCC system_header
40 namespace std _GLIBCXX_VISIBILITY(default)
42 _GLIBCXX_BEGIN_NAMESPACE_VERSION
44 template<
typename _Facet>
46 __check_facet(
const _Facet* __f)
65 template<
typename _CharT,
typename _Traits>
95 basic_ostream<_CharT, _Traits>* _M_tie;
96 mutable char_type _M_fill;
97 mutable bool _M_fill_init;
98 basic_streambuf<_CharT, _Traits>* _M_streambuf;
101 const __ctype_type* _M_ctype;
115 operator void*()
const
120 {
return this->
fail(); }
132 {
return _M_streambuf_state; }
162 _M_streambuf_state |= __state;
164 __throw_exception_again;
175 {
return this->
rdstate() == 0; }
217 {
return _M_exception; }
253 _M_exception = __except;
254 this->
clear(_M_streambuf_state);
265 :
ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
266 _M_ctype(0), _M_num_put(0), _M_num_get(0)
267 { this->
init(__sb); }
288 basic_ostream<_CharT, _Traits>*
300 basic_ostream<_CharT, _Traits>*
301 tie(basic_ostream<_CharT, _Traits>* __tiestr)
303 basic_ostream<_CharT, _Traits>* __old = _M_tie;
314 basic_streambuf<_CharT, _Traits>*
316 {
return _M_streambuf; }
340 basic_streambuf<_CharT, _Traits>*
341 rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
368 _M_fill = this->
widen(
' ');
386 char_type __old = this->
fill();
424 narrow(char_type __c,
char __dfault)
const
425 {
return __check_facet(_M_ctype).narrow(__c, __dfault); }
444 {
return __check_facet(_M_ctype).widen(__c); }
455 :
ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false),
456 _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
466 init(basic_streambuf<_CharT, _Traits>* __sb);
469 _M_cache_locale(
const locale& __loc);
472 _GLIBCXX_END_NAMESPACE_VERSION
475 #include <bits/basic_ios.tcc>
Primary class template ctype facet.This template class defines classification and conversion function...
char_type widen(char __c) const
Widens characters.
char_type fill() const
Retrieves the empty character.
bool bad() const
Fast error checking.
iostate exceptions() const
Throwing exceptions on errors.
static const iostate failbit
Indicates that an input operation failed to read the expected characters, or that an output operation...
iostate rdstate() const
Returns the error state of the stream buffer.
void clear(iostate __state=goodbit)
[Re]sets the error state.
static const iostate eofbit
Indicates that an input operation reached the end of an input sequence.
ISO C++ entities toplevel namespace is std.
ctype< _CharT > __ctype_type
bool good() const
Fast error checking.
_Ios_Iostate iostate
This is a bitmask type.
Primary class template num_put.This facet encapsulates the code to convert a number to a string...
The base of the I/O class hierarchy.This class defines everything that can be defined about I/O that ...
locale imbue(const locale &__loc)
Moves to a new locale.
num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_type
_Traits::pos_type pos_type
bool fail() const
Fast error checking.
basic_ostream< _CharT, _Traits > * tie() const
Fetches the current tied stream.
basic_ios & copyfmt(const basic_ios &__rhs)
Copies fields of __rhs into this.
void init(basic_streambuf< _CharT, _Traits > *__sb)
All setup is performed here.
bool operator!() const
The quick-and-easy status check.
static const iostate goodbit
Indicates all is well.
_Traits::int_type int_type
_Traits::off_type off_type
basic_streambuf< _CharT, _Traits > * rdbuf() const
Accessing the underlying buffer.
Primary class template num_get.This facet encapsulates the code to parse and return a number from a s...
basic_ostream< _CharT, _Traits > * tie(basic_ostream< _CharT, _Traits > *__tiestr)
Ties this stream to an output stream.
char narrow(char_type __c, char __dfault) const
Squeezes characters.
Container class for localization functionality.The locale class is first a class wrapper for C librar...
Template class basic_ios, virtual base class for all stream classes.
bool eof() const
Fast error checking.
num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type
char_type fill(char_type __ch)
Sets a new empty character.
void exceptions(iostate __except)
Throwing exceptions on errors.
void setstate(iostate __state)
Sets additional flags in the error state.
virtual ~basic_ios()
Empty.
basic_ios(basic_streambuf< _CharT, _Traits > *__sb)
Constructor performs initialization.
static const iostate badbit
Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error fro...