33 #define _BASIC_IOS_H 1
35 #pragma GCC system_header
42 _GLIBCXX_BEGIN_NAMESPACE(
std)
44 template<typename _Facet>
46 __check_facet(const _Facet* __f)
61 template<
typename _CharT,
typename _Traits>
91 basic_ostream<_CharT, _Traits>* _M_tie;
92 mutable char_type _M_fill;
93 mutable bool _M_fill_init;
94 basic_streambuf<_CharT, _Traits>* _M_streambuf;
97 const __ctype_type* _M_ctype;
111 operator void*()
const
112 {
return this->fail() ? 0 :
const_cast<basic_ios*
>(
this); }
116 {
return this->fail(); }
128 {
return _M_streambuf_state; }
138 clear(iostate __state = goodbit);
148 { this->clear(this->rdstate() | __state); }
154 _M_setstate(iostate __state)
158 _M_streambuf_state |= __state;
159 if (this->exceptions() & __state)
160 __throw_exception_again;
171 {
return this->rdstate() == 0; }
181 {
return (this->rdstate() & eofbit) != 0; }
192 {
return (this->rdstate() & (badbit | failbit)) != 0; }
202 {
return (this->rdstate() & badbit) != 0; }
213 {
return _M_exception; }
249 _M_exception = __except;
250 this->clear(_M_streambuf_state);
261 :
ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
262 _M_ctype(0), _M_num_put(0), _M_num_get(0)
263 { this->init(__sb); }
284 basic_ostream<_CharT, _Traits>*
296 basic_ostream<_CharT, _Traits>*
297 tie(basic_ostream<_CharT, _Traits>* __tiestr)
299 basic_ostream<_CharT, _Traits>* __old = _M_tie;
310 basic_streambuf<_CharT, _Traits>*
312 {
return _M_streambuf; }
336 basic_streambuf<_CharT, _Traits>*
337 rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
364 _M_fill = this->widen(
' ');
382 char_type __old = this->fill();
400 imbue(
const locale& __loc);
420 narrow(char_type __c,
char __dfault)
const
421 {
return __check_facet(_M_ctype).narrow(__c, __dfault); }
440 {
return __check_facet(_M_ctype).widen(__c); }
451 :
ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false),
452 _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
462 init(basic_streambuf<_CharT, _Traits>* __sb);
465 _M_cache_locale(
const locale& __loc);
468 _GLIBCXX_END_NAMESPACE
470 #ifndef _GLIBCXX_EXPORT_TEMPLATE
471 #include <bits/basic_ios.tcc>
bool eof() const
Fast error checking.
num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type
virtual ~basic_ios()
Empty.
bool bad() const
Fast error checking.
ISO C++ entities toplevel namespace is std.
char_type widen(char __c) const
Widens characters.
num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_type
void setstate(iostate __state)
Sets additional flags in the error state.
bool operator!() const
The quick-and-easy status check.
Virtual base class for all stream classes.Most of the member functions called dispatched on stream ob...
_Traits::pos_type pos_type
Facet for converting numbers to strings.
bool good() const
Fast error checking.
_Traits::off_type off_type
Container class for localization functionality.
void exceptions(iostate __except)
Throwing exceptions on errors.
basic_ostream< _CharT, _Traits > * tie() const
Fetches the current tied stream.
basic_ios(basic_streambuf< _CharT, _Traits > *__sb)
Constructor performs initialization.
bool fail() const
Fast error checking.
char_type fill() const
Retrieves the "empty" character.
ctype< _CharT > __ctype_type
Facet for parsing number strings.
char narrow(char_type __c, char __dfault) const
Squeezes characters.
iostate exceptions() const
Throwing exceptions on errors.
basic_streambuf< _CharT, _Traits > * rdbuf() const
Accessing the underlying buffer.
The base of the I/O class hierarchy.This class defines everything that can be defined about I/O that ...
_Traits::int_type int_type
char_type fill(char_type __ch)
Sets a new "empty" character.
iostate rdstate() const
Returns the error state of the stream buffer.
basic_ostream< _CharT, _Traits > * tie(basic_ostream< _CharT, _Traits > *__tiestr)
Ties this stream to an output stream.