// Iostreams base classes -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
basic_streambuf<_CharT, _Traits>* _M_streambuf;
// Cached use_facet<ctype>, which is based on the current locale info.
- const __ctype_type* _M_fctype;
- // From ostream.
- const __numput_type* _M_fnumput;
- // From istream.
- const __numget_type* _M_fnumget;
+ const __ctype_type* _M_ctype;
+ // For ostream.
+ const __numput_type* _M_num_put;
+ // For istream.
+ const __numget_type* _M_num_get;
public:
//@{
* The parameter is passed by derived streams.
*/
explicit
- basic_ios(basic_streambuf<_CharT, _Traits>* __sb) : ios_base()
+ basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
+ : ios_base(), _M_ctype(0), _M_num_put(0), _M_num_get(0)
{ this->init(__sb); }
/**
*
* Returns the result of
* @code
- * std::use_facet< ctype<char_type> >(getloc()).narrow(c,dfault)
+ * std::use_facet<ctype<char_type> >(getloc()).narrow(c,dfault)
* @endcode
*
* Additional l10n notes are at
*
* Returns the result of
* @code
- * std::use_facet< ctype<char_type> >(getloc()).widen(c)
+ * std::use_facet<ctype<char_type> >(getloc()).widen(c)
* @endcode
*
* Additional l10n notes are at
* The default constructor does nothing and is not normally
* accessible to users.
*/
- basic_ios() : ios_base()
+ basic_ios() : ios_base(), _M_ctype(0), _M_num_put(0), _M_num_get(0)
{ }
/**
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_locale(const locale& __loc);
+ // Internal state setter that won't throw, only set the state bits.
+ // Used to guarantee we don't throw when setting badbit.
void
- _M_cache_facets(const locale& __loc);
+ _M_setstate(iostate __state) { _M_streambuf_state |= __state; }
};
} // namespace std