#ifndef _CPP_BITS_BASICIOS_H
#define _CPP_BITS_BASICIOS_H 1
#pragma GCC system_header
#include <bits/streambuf_iterator.h>
#include <bits/locale_facets.h>
namespace std
{
template<typename _CharT, typename _Traits>
class basic_ios : public ios_base
{
public:
typedef _CharT char_type;
typedef typename _Traits::int_type int_type;
typedef typename _Traits::pos_type pos_type;
typedef typename _Traits::off_type off_type;
typedef _Traits traits_type;
typedef ctype<_CharT> __ctype_type;
typedef ostreambuf_iterator<_CharT, _Traits> __ostreambuf_iter;
typedef num_put<_CharT, __ostreambuf_iter> __numput_type;
typedef istreambuf_iterator<_CharT, _Traits> __istreambuf_iter;
typedef num_get<_CharT, __istreambuf_iter> __numget_type;
protected:
basic_ostream<_CharT, _Traits>* _M_tie;
mutable char_type _M_fill;
mutable bool _M_fill_init;
basic_streambuf<_CharT, _Traits>* _M_streambuf;
const __ctype_type* _M_fctype;
const __numput_type* _M_fnumput;
const __numget_type* _M_fnumget;
public:
operator void*() const
{ return this->fail() ? 0 : const_cast<basic_ios*>(this); }
bool
operator!() const
{ return this->fail(); }
iostate
rdstate() const
{ return _M_streambuf_state; }
void
clear(iostate __state = goodbit);
void
setstate(iostate __state)
{ this->clear(this->rdstate() | __state); }
bool
good() const
{ return this->rdstate() == 0; }
bool
eof() const
{ return (this->rdstate() & eofbit) != 0; }
bool
fail() const
{ return (this->rdstate() & (badbit | failbit)) != 0; }
bool
bad() const
{ return (this->rdstate() & badbit) != 0; }
iostate
exceptions() const
{ return _M_exception; }
void
exceptions(iostate __except)
{
_M_exception = __except;
this->clear(_M_streambuf_state);
}
explicit
basic_ios(basic_streambuf<_CharT, _Traits>* __sb) : ios_base()
{ this->init(__sb); }
virtual
~basic_ios() { }
basic_ostream<_CharT, _Traits>*
tie() const
{ return _M_tie; }
basic_ostream<_CharT, _Traits>*
tie(basic_ostream<_CharT, _Traits>* __tiestr)
{
basic_ostream<_CharT, _Traits>* __old = _M_tie;
_M_tie = __tiestr;
return __old;
}
basic_streambuf<_CharT, _Traits>*
rdbuf() const
{ return _M_streambuf; }
basic_streambuf<_CharT, _Traits>*
rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
basic_ios&
copyfmt(const basic_ios& __rhs);
char_type
fill() const
{
if (!_M_fill_init)
{
_M_fill = this->widen(' ');
_M_fill_init = true;
}
return _M_fill;
}
char_type
fill(char_type __ch)
{
char_type __old = this->fill();
_M_fill = __ch;
return __old;
}
locale
imbue(const locale& __loc);
char
narrow(char_type __c, char __dfault) const;
char_type
widen(char __c) const;
protected:
basic_ios() : ios_base()
{ }
void
init(basic_streambuf<_CharT, _Traits>* __sb);
bool
_M_check_facet(const locale::facet* __f) const
{
if (!__f)
__throw_bad_cast();
return true;
}
void
_M_cache_facets(const locale& __loc);
};
}
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
#include <bits/basic_ios.tcc>
#endif
#endif