OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / include / bits / basic_ios.h
index 29c1436..98b73ca 100644 (file)
@@ -1,6 +1,7 @@
 // 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
@@ -89,11 +90,11 @@ namespace std
       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:
       //@{
@@ -239,7 +240,8 @@ namespace std
        *  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); }
 
       /**
@@ -382,7 +384,7 @@ namespace std
        *
        *  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
@@ -400,7 +402,7 @@ namespace std
        *
        *  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
@@ -417,7 +419,7 @@ namespace std
        *  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)
       { }
 
       /**
@@ -429,16 +431,13 @@ namespace std
       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