OSDN Git Service

* config/d30v/d30v.h: Delete reference to ASM_FINAL_SPEC.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / src / locale-inst.cc
index e2f6d77..73b028d 100644 (file)
@@ -1,6 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 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
 #include <cstdlib>
 #include <clocale>
 #include <cstring>
-#include <cassert>
-#include <limits>
-#include <exception>
-#include <stdexcept>
 #include <locale>
-#include <istream>
-#include <ostream>
 
 namespace std
 {
-  typedef ostreambuf_iterator<char, char_traits<char> > obuf_iterator;
-  typedef istreambuf_iterator<char, char_traits<char> > ibuf_iterator;
-  typedef ostreambuf_iterator<wchar_t, char_traits<wchar_t> > wobuf_iterator;
-  typedef istreambuf_iterator<wchar_t, char_traits<wchar_t> > wibuf_iterator;
-
   // moneypunct, money_get, and money_put
   template class moneypunct<char, false>;
   template class moneypunct<char, true>;
   template class moneypunct_byname<char, false>;
   template class moneypunct_byname<char, true>;
-  template class money_get<char, ibuf_iterator>;
-  template class money_put<char, obuf_iterator>;
+  template class money_get<char, istreambuf_iterator<char> >;
+  template class money_put<char, ostreambuf_iterator<char> >;
+  template class __locale_cache<char>;
 
 #ifdef _GLIBCPP_USE_WCHAR_T
   template class moneypunct<wchar_t, false>;
   template class moneypunct<wchar_t, true>;
   template class moneypunct_byname<wchar_t, false>;
   template class moneypunct_byname<wchar_t, true>;
-  template class money_get<wchar_t, wibuf_iterator>;
-  template class money_put<wchar_t, wobuf_iterator>;
+  template class money_get<wchar_t, istreambuf_iterator<wchar_t> >;
+  template class money_put<wchar_t, ostreambuf_iterator<wchar_t> >;
+  template class __locale_cache<wchar_t>;
 #endif
 
   // numpunct, numpunct_byname, num_get, and num_put
   template class numpunct<char>;
   template class numpunct_byname<char>;
-  template class num_get<char, ibuf_iterator>;
-  template class num_put<char, obuf_iterator>; 
+  template class num_get<char, istreambuf_iterator<char> >;
+  template class num_put<char, ostreambuf_iterator<char> >; 
   template
-    obuf_iterator
-    num_put<char, obuf_iterator>::
-    _M_convert_int(obuf_iterator, ios_base&, char, char, char, long) const;
+    ostreambuf_iterator<char>
+    num_put<char, ostreambuf_iterator<char> >::
+    _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, 
+                  long) const;
 
   template
-    obuf_iterator
-    num_put<char, obuf_iterator>::
-    _M_convert_int(obuf_iterator, ios_base&, char, char, char, 
+    ostreambuf_iterator<char>
+    num_put<char, ostreambuf_iterator<char> >::
+    _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, 
                   unsigned long) const;
 
 #ifdef _GLIBCPP_USE_LONG_LONG
   template
-    obuf_iterator
-    num_put<char, obuf_iterator>::
-    _M_convert_int(obuf_iterator, ios_base&, char, char, char, 
+    ostreambuf_iterator<char>
+    num_put<char, ostreambuf_iterator<char> >::
+    _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, 
                   long long) const;
 
   template
-    obuf_iterator
-    num_put<char, obuf_iterator>::
-    _M_convert_int(obuf_iterator, ios_base&, char, char, char,
+    ostreambuf_iterator<char>
+    num_put<char, ostreambuf_iterator<char> >::
+    _M_convert_int(ostreambuf_iterator<char>, ios_base&, char, 
                   unsigned long long) const;
 #endif
 
   template
-    obuf_iterator
-    num_put<char, obuf_iterator>::
-    _M_convert_float(obuf_iterator, ios_base&, char, char, double) const;
+    ostreambuf_iterator<char>
+    num_put<char, ostreambuf_iterator<char> >::
+    _M_convert_float(ostreambuf_iterator<char>, ios_base&, char, char, 
+                    double) const;
 
   template
-    obuf_iterator
-    num_put<char, obuf_iterator>::
-    _M_convert_float(obuf_iterator, ios_base&, char, char, 
-                   long double) const;
-
+    ostreambuf_iterator<char>
+    num_put<char, ostreambuf_iterator<char> >::
+    _M_convert_float(ostreambuf_iterator<char>, ios_base&, char, char, 
+                    long double) const;
+  
 #ifdef _GLIBCPP_USE_WCHAR_T
   template class numpunct<wchar_t>;
   template class numpunct_byname<wchar_t>;
-  template class num_get<wchar_t, wibuf_iterator>;
-  template class num_put<wchar_t, wobuf_iterator>;
+  template class num_get<wchar_t, istreambuf_iterator<wchar_t> >;
+  template class num_put<wchar_t, ostreambuf_iterator<wchar_t> >;
 
   template
-    wobuf_iterator
-    num_put<wchar_t, wobuf_iterator>::
-    _M_convert_int(wobuf_iterator, ios_base&, wchar_t, char, char, long) const;
+    ostreambuf_iterator<wchar_t>
+    num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
+    _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, 
+                  long) const;
 
   template
-    wobuf_iterator
-    num_put<wchar_t, wobuf_iterator>::
-    _M_convert_int(wobuf_iterator, ios_base&, wchar_t, char, char,
+    ostreambuf_iterator<wchar_t>
+    num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
+    _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, 
                   unsigned long) const;
 
 #ifdef _GLIBCPP_USE_LONG_LONG
   template
-    wobuf_iterator
-    num_put<wchar_t, wobuf_iterator>::
-    _M_convert_int(wobuf_iterator, ios_base&, wchar_t, char, char,
+    ostreambuf_iterator<wchar_t>
+    num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
+    _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
                   long long) const;
 
   template
-    wobuf_iterator
-    num_put<wchar_t, wobuf_iterator>::
-    _M_convert_int(wobuf_iterator, ios_base&, wchar_t, char, char,
+    ostreambuf_iterator<wchar_t>
+    num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
+    _M_convert_int(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t,
                   unsigned long long) const;
 #endif
 
   template
-    wobuf_iterator
-    num_put<wchar_t, wobuf_iterator>::
-    _M_convert_float(wobuf_iterator, ios_base&, wchar_t, char, 
+    ostreambuf_iterator<wchar_t>
+    num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
+    _M_convert_float(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, 
                     double) const;
 
   template
-    wobuf_iterator
-    num_put<wchar_t, wobuf_iterator>::
-    _M_convert_float(wobuf_iterator, ios_base&, wchar_t, char, 
+    ostreambuf_iterator<wchar_t>
+    num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
+    _M_convert_float(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, char, 
                     long double) const;
 #endif
 
   // time_get and time_put
   template class __timepunct<char>;
-  template class time_put<char, obuf_iterator>;
-  template class time_put_byname<char, obuf_iterator>;
-  template class time_get<char, ibuf_iterator>;
-  template class time_get_byname<char, ibuf_iterator>;
+  template class time_put<char, ostreambuf_iterator<char> >;
+  template class time_put_byname<char, ostreambuf_iterator<char> >;
+  template class time_get<char, istreambuf_iterator<char> >;
+  template class time_get_byname<char, istreambuf_iterator<char> >;
 
 #ifdef _GLIBCPP_USE_WCHAR_T
   template class __timepunct<wchar_t>;
-  template class time_put<wchar_t, wobuf_iterator>;
-  template class time_put_byname<wchar_t, wobuf_iterator>;
-  template class time_get<wchar_t, wibuf_iterator>;
-  template class time_get_byname<wchar_t, wibuf_iterator>;
+  template class time_put<wchar_t, ostreambuf_iterator<wchar_t> >;
+  template class time_put_byname<wchar_t, ostreambuf_iterator<wchar_t> >;
+  template class time_get<wchar_t, istreambuf_iterator<wchar_t> >;
+  template class time_get_byname<wchar_t, istreambuf_iterator<wchar_t> >;
 #endif
 
   // messages
@@ -175,18 +169,18 @@ namespace std
 #endif
   
   // ctype
-  template class __ctype_abstract_base<char>;
+  inline template class __ctype_abstract_base<char>;
   template class ctype_byname<char>;
 #ifdef _GLIBCPP_USE_WCHAR_T
-  template class __ctype_abstract_base<wchar_t>;
+  inline template class __ctype_abstract_base<wchar_t>;
   template class ctype_byname<wchar_t>;
 #endif
   
   // codecvt
-  template class __codecvt_abstract_base<char, char, mbstate_t>;
-  template class __codecvt_abstract_base<wchar_t, char, mbstate_t>;
+  inline template class __codecvt_abstract_base<char, char, mbstate_t>;
   template class codecvt_byname<char, char, mbstate_t>;
 #ifdef _GLIBCPP_USE_WCHAR_T
+  inline template class __codecvt_abstract_base<wchar_t, char, mbstate_t>;
   template class codecvt_byname<wchar_t, char, mbstate_t>;
 #endif
 
@@ -199,18 +193,7 @@ namespace std
 #endif
     
   // use_facet
-  template
-    const numpunct<char>& 
-    use_facet<numpunct<char> >(const locale&);
-
-  template 
-    const num_put<char, obuf_iterator >& 
-    use_facet<num_put<char, obuf_iterator> >(const locale&);
-
-  template 
-    const num_get<char, ibuf_iterator >& 
-    use_facet<num_get<char, ibuf_iterator> >(const locale&);
-
+  // NB: use_facet<ctype> is specialized
   template
     const codecvt<char, char, mbstate_t>& 
     use_facet<codecvt<char, char, mbstate_t> >(const locale&);
@@ -220,6 +203,18 @@ namespace std
     use_facet<collate<char> >(const locale&);
 
   template
+    const numpunct<char>& 
+    use_facet<numpunct<char> >(const locale&);
+
+  template 
+    const num_put<char>& 
+    use_facet<num_put<char> >(const locale&);
+
+  template 
+    const num_get<char>& 
+    use_facet<num_get<char> >(const locale&);
+
+  template
     const moneypunct<char, true>& 
     use_facet<moneypunct<char, true> >(const locale&);
 
@@ -227,23 +222,31 @@ namespace std
     const moneypunct<char, false>& 
     use_facet<moneypunct<char, false> >(const locale&);
 
+  template 
+    const money_put<char>& 
+    use_facet<money_put<char> >(const locale&);
+
+  template 
+    const money_get<char>& 
+    use_facet<money_get<char> >(const locale&);
+
   template
     const __timepunct<char>& 
     use_facet<__timepunct<char> >(const locale&);
 
-#ifdef _GLIBCPP_USE_WCHAR_T
-  template
-    const numpunct<wchar_t>& 
-    use_facet<numpunct<wchar_t> >(const locale&);
+  template 
+    const time_put<char>& 
+    use_facet<time_put<char> >(const locale&);
 
   template 
-    const num_put<wchar_t, wobuf_iterator>& 
-    use_facet<num_put<wchar_t, wobuf_iterator> >(const locale&);
+    const time_get<char>& 
+    use_facet<time_get<char> >(const locale&);
 
   template 
-    const num_get<wchar_t, wibuf_iterator>& 
-    use_facet<num_get<wchar_t, wibuf_iterator> >(const locale&);
+    const messages<char>& 
+    use_facet<messages<char> >(const locale&);
 
+#ifdef _GLIBCPP_USE_WCHAR_T
   template
     const codecvt<wchar_t, char, mbstate_t>& 
     use_facet<codecvt<wchar_t, char, mbstate_t> >(locale const&);
@@ -253,78 +256,158 @@ namespace std
     use_facet<collate<wchar_t> >(const locale&);
 
   template
+    const numpunct<wchar_t>& 
+    use_facet<numpunct<wchar_t> >(const locale&);
+
+  template 
+    const num_put<wchar_t>& 
+    use_facet<num_put<wchar_t> >(const locale&);
+
+  template 
+    const num_get<wchar_t>& 
+    use_facet<num_get<wchar_t> >(const locale&);
+
+  template
     const moneypunct<wchar_t, true>& 
     use_facet<moneypunct<wchar_t, true> >(const locale&);
 
   template
     const moneypunct<wchar_t, false>& 
     use_facet<moneypunct<wchar_t, false> >(const locale&);
+  template 
+    const money_put<wchar_t>& 
+    use_facet<money_put<wchar_t> >(const locale&);
+
+  template 
+    const money_get<wchar_t>& 
+    use_facet<money_get<wchar_t> >(const locale&);
 
   template
     const __timepunct<wchar_t>& 
     use_facet<__timepunct<wchar_t> >(const locale&);
+
+  template 
+    const time_put<wchar_t>& 
+    use_facet<time_put<wchar_t> >(const locale&);
+
+  template 
+    const time_get<wchar_t>& 
+    use_facet<time_get<wchar_t> >(const locale&);
+
+  template 
+    const messages<wchar_t>& 
+    use_facet<messages<wchar_t> >(const locale&);
 #endif
 
   // has_facet
   template 
     bool
+    has_facet<ctype<char> >(const locale&);
+
+  template 
+    bool
+    has_facet<codecvt<char, char, mbstate_t> >(const locale&);
+
+  template 
+    bool
+    has_facet<collate<char> >(const locale&);
+
+  template 
+    bool
     has_facet<numpunct<char> >(const locale&);
+
   template 
     bool
     has_facet<num_put<char> >(const locale&);
+
   template 
     bool
     has_facet<num_get<char> >(const locale&);
+
   template 
     bool
-    has_facet<ctype<char> >(const locale&);
+    has_facet<moneypunct<char> >(const locale&);
+
+  template 
+    bool
+    has_facet<money_put<char> >(const locale&);
+
+  template 
+    bool
+    has_facet<money_get<char> >(const locale&);
+
+  template 
+    bool
+    has_facet<__timepunct<char> >(const locale&);
+
+  template 
+    bool
+    has_facet<time_put<char> >(const locale&);
+
+  template 
+    bool
+    has_facet<time_get<char> >(const locale&);
+
+  template 
+    bool
+    has_facet<messages<char> >(const locale&);
 
 #ifdef _GLIBCPP_USE_WCHAR_T
+ template 
+    bool
+    has_facet<ctype<wchar_t> >(const locale&);
+
+  template 
+    bool
+    has_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&);
+
+  template 
+    bool
+    has_facet<collate<wchar_t> >(const locale&);
+
   template 
     bool
     has_facet<numpunct<wchar_t> >(const locale&);
+
   template 
     bool
     has_facet<num_put<wchar_t> >(const locale&);
+
   template 
     bool
     has_facet<num_get<wchar_t> >(const locale&);
+
   template 
     bool
-    has_facet<ctype<wchar_t> >(const locale&);
-#endif
+    has_facet<moneypunct<wchar_t> >(const locale&);
 
-  //
-  // iterator
-  //
-  typedef vector<locale::facet*> vec_pfacet;
   template 
-    void 
-    vec_pfacet::
-    insert(vec_pfacet::iterator, vec_pfacet::size_type, 
-          const vec_pfacet::value_type&);
+    bool
+    has_facet<money_put<wchar_t> >(const locale&);
+
   template 
-    void 
-    vec_pfacet::
-    _M_fill_insert(vec_pfacet::iterator, vec_pfacet::size_type, 
-                  const vec_pfacet::value_type&);
+    bool
+    has_facet<money_get<wchar_t> >(const locale&);
 
+  template 
+    bool
+    has_facet<__timepunct<wchar_t> >(const locale&);
 
-  //
-  // locale
-  //
-  typedef istreambuf_iterator<char, char_traits<char> > istreambuf_iter;
-  typedef ostreambuf_iterator<char, char_traits<char> > ostreambuf_iter;
+  template 
+    bool
+    has_facet<time_put<wchar_t> >(const locale&);
 
-#ifdef _GLIBCPP_USE_WCHAR_T
-  typedef istreambuf_iterator<wchar_t, char_traits<wchar_t> > wistreambuf_iter;
-  typedef ostreambuf_iterator<wchar_t, char_traits<wchar_t> > wostreambuf_iter;
-#endif
+  template 
+    bool
+    has_facet<time_get<wchar_t> >(const locale&);
 
   template 
     bool
-    locale::operator()(const string&, const string&) const;
+    has_facet<messages<wchar_t> >(const locale&);
+#endif
 
+  // locale
   template
     char*
     __add_grouping<char>(char*, char, char const*, char const*, 
@@ -334,23 +417,9 @@ namespace std
     bool
     __verify_grouping<char>(const basic_string<char>&, basic_string<char>&);
 
-  template
-    void 
-    __pad<char>(ios_base&, char, char*, const char *, streamsize, 
-               streamsize, const bool);
-
-  template
-    void 
-    __pad<char, char_traits<char> >(ios_base&, char, char*, const char *, 
-                                   streamsize, streamsize, const bool);
+  template class __pad<char, char_traits<char> >;
 
 #ifdef _GLIBCPP_USE_WCHAR_T
-  template 
-    bool
-    locale::operator()(const wstring&, const wstring&) const;
-
-  typedef ostreambuf_iterator<wchar_t> wostreambuf_iter;
-
   template
     wchar_t*
     __add_grouping<wchar_t>(wchar_t*, wchar_t, char const*, char const*, 
@@ -360,31 +429,64 @@ namespace std
     __verify_grouping<wchar_t>(const basic_string<wchar_t>&, 
                               basic_string<wchar_t>&);
 
+  template class __pad<wchar_t, char_traits<wchar_t> >;
+#endif 
+
   template
-    void 
-    __pad<wchar_t>(ios_base&, wchar_t, wchar_t*, const wchar_t*
-                  streamsize, streamsize, const bool);
+    int
+    __convert_from_v(char*, const int, const char*, double
+                    const __c_locale&, int);
 
   template
-    void 
-    __pad<wchar_t, char_traits<wchar_t> >(ios_base&, wchar_t, wchar_t*, 
-                                         const wchar_t*, streamsize, 
-                                         streamsize, const bool);
-#endif // _GLIBCPP_USE_WCHAR_T
+    int
+    __convert_from_v(char*, const int, const char*, long double, 
+                    const __c_locale&, int);
 
-  template 
-    locale::facet** 
-    fill_n<locale::facet**, size_t, locale::facet*>
-    (locale::facet**, size_t, locale::facet* const&);
+  template
+    int
+    __convert_from_v(char*, const int, const char*, long, 
+                    const __c_locale&, int);
+
+  template
+    int
+    __convert_from_v(char*, const int, const char*, unsigned long, 
+                    const __c_locale&, int);
 
+#ifdef _GLIBCPP_USE_LONG_LONG
   template
-    __normal_iterator<locale::facet**, vector<locale::facet*> >
-    fill_n(__normal_iterator<locale::facet**, vector<locale::facet*> >,
-          size_t, locale::facet* const&);
+    int
+    __convert_from_v(char*, const int, const char*, long long, 
+                    const __c_locale&, int);
+
+  template
+    int
+    __convert_from_v(char*, const int, const char*, unsigned long long, 
+                    const __c_locale&, int);
+#endif
 
   template
-    void
-    fill(__normal_iterator<locale::facet**, vector<locale::facet*> >,
-         __normal_iterator<locale::facet**, vector<locale::facet*> >,
-         locale::facet* const&);
+    int
+    __int_to_char(char*, const int, unsigned long, const char*, 
+                 ios_base::fmtflags, bool);
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+  template
+    int
+    __int_to_char(wchar_t*, const int, unsigned long, const wchar_t*, 
+                 ios_base::fmtflags, bool);
+#endif
+
+#ifdef _GLIBCPP_USE_LONG_LONG
+  template
+    int
+    __int_to_char(char*, const int, unsigned long long, const char*, 
+                 ios_base::fmtflags, bool);
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+  template
+    int
+    __int_to_char(wchar_t*, const int, unsigned long long, const wchar_t*,
+                 ios_base::fmtflags, bool);
+#endif
+#endif
 } // namespace std