]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/src/c++11/locale-inst.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / src / c++11 / locale-inst.cc
CommitLineData
b2dad0e3
BK
1// Locale support -*- C++ -*-
2
7adcbafe 3// Copyright (C) 1999-2022 Free Software Foundation, Inc.
b2dad0e3
BK
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
748086b7 8// Free Software Foundation; either version 3, or (at your option)
b2dad0e3
BK
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
748086b7
JJ
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/>.
b2dad0e3
BK
24
25//
26// ISO C++ 14882: 22.1 Locales
27//
28
34a2b755
JW
29#ifndef _GLIBCXX_USE_CXX11_ABI
30// Instantiations in this file use the old COW std::string ABI unless included
31// by another file which defines _GLIBCXX_USE_CXX11_ABI=1. Some instantiations
32// are guarded by a check for !_GLIBCXX_USE_CXX11_ABI so that they are only
33// instantiated once, because they are not tagged with abi_tag so should not
34// be instantiated twice.
35# define _GLIBCXX_USE_CXX11_ABI 0
36#endif
37
54c1bf78 38#include <locale>
b2dad0e3 39
c755e77d
BK
40// Instantiation configuration.
41#ifndef C
42# define C char
6defecc2 43# define C_is_char
c755e77d
BK
44#endif
45
7c1e7eed
JW
46#include "locale-inst-numeric.h"
47#include "locale-inst-monetary.h"
48
12ffa228
BK
49namespace std _GLIBCXX_VISIBILITY(default)
50{
51_GLIBCXX_BEGIN_NAMESPACE_VERSION
3cbc7af0 52
b2dad0e3 53 // moneypunct, money_get, and money_put
34a2b755 54#if ! _GLIBCXX_USE_CXX11_ABI
fe932e50
PC
55 template struct __moneypunct_cache<C, false>;
56 template struct __moneypunct_cache<C, true>;
34a2b755
JW
57#endif
58_GLIBCXX_BEGIN_NAMESPACE_CXX11
59 template class moneypunct<C, false>;
60 template class moneypunct<C, true>;
c755e77d
BK
61 template class moneypunct_byname<C, false>;
62 template class moneypunct_byname<C, true>;
34a2b755 63_GLIBCXX_END_NAMESPACE_CXX11
b2dad0e3
BK
64
65 // numpunct, numpunct_byname, num_get, and num_put
34a2b755 66#if ! _GLIBCXX_USE_CXX11_ABI
c755e77d 67 template struct __numpunct_cache<C>;
34a2b755
JW
68#endif
69_GLIBCXX_BEGIN_NAMESPACE_CXX11
70 template class numpunct<C>;
c755e77d 71 template class numpunct_byname<C>;
34a2b755 72_GLIBCXX_END_NAMESPACE_CXX11
6defecc2 73
b2dad0e3 74 // time_get and time_put
34a2b755 75#if ! _GLIBCXX_USE_CXX11_ABI
c755e77d
BK
76 template class __timepunct<C>;
77 template struct __timepunct_cache<C>;
78 template class time_put<C, ostreambuf_iterator<C> >;
79 template class time_put_byname<C, ostreambuf_iterator<C> >;
71a16cd8
JW
80#else
81 // Instantiate constructor taking __cxx11::string
82 template time_put_byname<C>::time_put_byname(const string&, size_t);
34a2b755
JW
83#endif
84_GLIBCXX_BEGIN_NAMESPACE_CXX11
c755e77d
BK
85 template class time_get<C, istreambuf_iterator<C> >;
86 template class time_get_byname<C, istreambuf_iterator<C> >;
34a2b755 87_GLIBCXX_END_NAMESPACE_CXX11
b2dad0e3
BK
88
89 // messages
34a2b755 90_GLIBCXX_BEGIN_NAMESPACE_CXX11
c755e77d
BK
91 template class messages<C>;
92 template class messages_byname<C>;
34a2b755 93_GLIBCXX_END_NAMESPACE_CXX11
f92ab29f 94
b2dad0e3 95 // ctype
71a16cd8
JW
96 ctype_byname<C>::ctype_byname(const string& __s, size_t __refs)
97 : ctype_byname(__s.c_str(), __refs) { }
98
34a2b755 99#if ! _GLIBCXX_USE_CXX11_ABI
c755e77d
BK
100 inline template class __ctype_abstract_base<C>;
101 template class ctype_byname<C>;
34a2b755 102#endif
f92ab29f 103
63511623 104 // codecvt
34a2b755 105#if ! _GLIBCXX_USE_CXX11_ABI
c755e77d
BK
106 inline template class __codecvt_abstract_base<C, char, mbstate_t>;
107 template class codecvt_byname<C, char, mbstate_t>;
71a16cd8
JW
108#else
109 // Instantiate constructor taking __cxx11::string
110 template codecvt_byname<C, char, mbstate_t>::codecvt_byname(const string&, size_t);
34a2b755 111#endif
63511623 112
b2dad0e3 113 // collate
34a2b755 114_GLIBCXX_BEGIN_NAMESPACE_CXX11
c755e77d
BK
115 template class collate<C>;
116 template class collate_byname<C>;
34a2b755 117_GLIBCXX_END_NAMESPACE_CXX11
f92ab29f 118
b2dad0e3 119 // use_facet
34a2b755 120#if ! _GLIBCXX_USE_CXX11_ABI
08376e28 121 template
f92ab29f 122 const ctype<C>&
08376e28
PC
123 use_facet<ctype<C> >(const locale&);
124
b2dad0e3 125 template
f92ab29f 126 const codecvt<C, char, mbstate_t>&
c755e77d 127 use_facet<codecvt<C, char, mbstate_t> >(const locale&);
34a2b755 128#endif
e08138aa 129
72ed2836 130 template
f92ab29f 131 const collate<C>&
c755e77d 132 use_facet<collate<C> >(const locale&);
e08138aa 133
41b4d44b 134 template
f92ab29f 135 const numpunct<C>&
c755e77d 136 use_facet<numpunct<C> >(const locale&);
41b4d44b 137
69971cd8 138 template
f92ab29f 139 const moneypunct<C, true>&
c755e77d 140 use_facet<moneypunct<C, true> >(const locale&);
e08138aa 141
69971cd8 142 template
f92ab29f 143 const moneypunct<C, false>&
c755e77d 144 use_facet<moneypunct<C, false> >(const locale&);
e08138aa 145
34a2b755 146#if ! _GLIBCXX_USE_CXX11_ABI
e08138aa 147 template
f92ab29f 148 const __timepunct<C>&
c755e77d 149 use_facet<__timepunct<C> >(const locale&);
e08138aa 150
f92ab29f
CG
151 template
152 const time_put<C>&
c755e77d 153 use_facet<time_put<C> >(const locale&);
34a2b755 154#endif
e08138aa 155
f92ab29f
CG
156 template
157 const time_get<C>&
c755e77d 158 use_facet<time_get<C> >(const locale&);
e08138aa 159
f92ab29f
CG
160 template
161 const messages<C>&
c755e77d 162 use_facet<messages<C> >(const locale&);
b2dad0e3
BK
163
164 // has_facet
34a2b755 165#if ! _GLIBCXX_USE_CXX11_ABI
f92ab29f 166 template
41b4d44b 167 bool
c755e77d 168 has_facet<ctype<C> >(const locale&);
41b4d44b 169
f92ab29f 170 template
bfa1e6b1 171 bool
c755e77d 172 has_facet<codecvt<C, char, mbstate_t> >(const locale&);
34a2b755 173#endif
41b4d44b 174
f92ab29f 175 template
bfa1e6b1 176 bool
c755e77d 177 has_facet<collate<C> >(const locale&);
41b4d44b 178
f92ab29f 179 template
bfa1e6b1 180 bool
c755e77d 181 has_facet<numpunct<C> >(const locale&);
41b4d44b 182
f92ab29f 183 template
41b4d44b 184 bool
c755e77d 185 has_facet<moneypunct<C> >(const locale&);
41b4d44b 186
34a2b755 187#if ! _GLIBCXX_USE_CXX11_ABI
f92ab29f 188 template
41b4d44b 189 bool
c755e77d 190 has_facet<__timepunct<C> >(const locale&);
41b4d44b 191
f92ab29f 192 template
b2dad0e3 193 bool
c755e77d 194 has_facet<time_put<C> >(const locale&);
34a2b755 195#endif
41b4d44b 196
f92ab29f 197 template
bfa1e6b1 198 bool
c755e77d 199 has_facet<time_get<C> >(const locale&);
41b4d44b 200
f92ab29f 201 template
bfa1e6b1 202 bool
c755e77d 203 has_facet<messages<C> >(const locale&);
41b4d44b 204
02a480f1 205
189486b8 206#if ! _GLIBCXX_USE_CXX11_ABI
c755e77d 207 // locale functions.
b2dad0e3 208 template
c755e77d 209 C*
f92ab29f 210 __add_grouping<C>(C*, C, char const*, size_t,
c755e77d 211 C const*, C const*);
b2dad0e3 212
c755e77d 213 template class __pad<C, char_traits<C> >;
b2dad0e3 214
ce3039af
JQ
215 template
216 int
3c21d6e0 217 __int_to_char(C*, unsigned long, const C*,
ce3039af 218 ios_base::fmtflags, bool);
ce3039af 219
3d7c150e 220#ifdef _GLIBCXX_USE_LONG_LONG
ce3039af
JQ
221 template
222 int
f92ab29f 223 __int_to_char(C*, unsigned long long, const C*,
ce3039af
JQ
224 ios_base::fmtflags, bool);
225#endif
189486b8 226#endif
3cbc7af0 227
12ffa228
BK
228_GLIBCXX_END_NAMESPACE_VERSION
229} // namespace
6defecc2
JJ
230
231// XXX GLIBCXX_ABI Deprecated
7c1e7eed
JW
232#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && ! _GLIBCXX_USE_CXX11_ABI
233#include "compatibility-ldbl-facets-aliases.h"
6defecc2 234#endif // _GLIBCXX_LONG_DOUBLE_COMPAT