OSDN Git Service

2010-02-16 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / config / locale / ieee_1003.1-2001 / c_locale.cc
1 // Wrapper for underlying C-language localization -*- C++ -*-
2
3 // Copyright (C) 2001, 2002, 2009, 2010 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library.  This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
10
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
19
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23 // <http://www.gnu.org/licenses/>.
24
25 //
26 // ISO C++ 14882: 22.8  Standard locale categories.
27 //
28
29 // Written by Benjamin Kosnik <bkoz@redhat.com>
30
31 #include <locale>
32
33 namespace std 
34 {
35   void
36   locale::facet::_S_create_c_locale(__c_locale&, const char*, __c_locale*)
37   { }
38
39   void
40   locale::facet::_S_destroy_c_locale(__c_locale&)
41   { }
42
43   __c_locale
44   locale::facet::_S_clone_c_locale(__c_locale&) throw()
45   { return __c_locale(); }
46
47   template<> 
48     void
49     numpunct<char>::_M_initialize_numpunct(__c_locale)
50     {
51       // "C" locale
52       _M_decimal_point = '.';
53       _M_thousands_sep = ',';
54       _M_grouping = "";
55       _M_truename = "true";
56       _M_falsename = "false";
57     }
58       
59 #ifdef _GLIBCXX_USE_WCHAR_T
60   template<> 
61     void
62     numpunct<wchar_t>::_M_initialize_numpunct(__c_locale)
63     {
64       // "C" locale
65       _M_decimal_point = L'.';
66       _M_thousands_sep = L',';
67       _M_grouping = "";
68       _M_truename = L"true";
69       _M_falsename = L"false";
70     }
71 #endif
72
73   template<> 
74     void
75     moneypunct<char>::_M_initialize_moneypunct(__c_locale)
76     {
77       // "C" locale
78       _M_decimal_point = '.';
79       _M_thousands_sep = ',';
80       _M_grouping = "";
81       _M_curr_symbol = string_type();
82       _M_positive_sign = string_type();
83       _M_negative_sign = string_type();
84       _M_frac_digits = 0;
85       _M_pos_format = money_base::_S_default_pattern;
86       _M_neg_format = money_base::_S_default_pattern;
87     }
88
89 #ifdef _GLIBCXX_USE_WCHAR_T
90   template<> 
91     void
92     moneypunct<wchar_t>::_M_initialize_moneypunct(__c_locale)
93     {
94       // "C" locale
95       _M_decimal_point = L'.';
96       _M_thousands_sep = L',';
97       _M_grouping = "";
98       _M_curr_symbol = string_type();
99       _M_positive_sign = string_type();
100       _M_negative_sign = string_type();
101       _M_frac_digits = 0;
102       _M_pos_format = money_base::_S_default_pattern;
103       _M_neg_format = money_base::_S_default_pattern;
104     }
105 #endif
106 }  // namespace std
107