1 // Locale support -*- C++ -*- 2 3 // Copyright (C) 1999-2014 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.1 Locales 27 // 28 29 #include <locale> 30 31 // Instantiation configuration. 32 #ifndef C 33 # define C char 34 # define C_is_char 35 #endif 36 37 namespace std _GLIBCXX_VISIBILITY(default) 38 { 39 _GLIBCXX_BEGIN_NAMESPACE_VERSION 40 41 // moneypunct, money_get, and money_put 42 template class moneypunct<C, false>; 43 template class moneypunct<C, true>; 44 template struct __moneypunct_cache<C, false>; 45 template struct __moneypunct_cache<C, true>; 46 template class moneypunct_byname<C, false>; 47 template class moneypunct_byname<C, true>; 48 _GLIBCXX_BEGIN_NAMESPACE_LDBL 49 template class money_get<C, istreambuf_iterator<C> >; 50 template class money_put<C, ostreambuf_iterator<C> >; 51 template 52 istreambuf_iterator<C> 53 money_get<C, istreambuf_iterator<C> >:: 54 _M_extract<true>(istreambuf_iterator<C>, istreambuf_iterator<C>, 55 ios_base&, ios_base::iostate&, string&) const; 56 57 template 58 istreambuf_iterator<C> 59 money_get<C, istreambuf_iterator<C> >:: 60 _M_extract<false>(istreambuf_iterator<C>, istreambuf_iterator<C>, 61 ios_base&, ios_base::iostate&, string&) const; 62 63 template 64 ostreambuf_iterator<C> 65 money_put<C, ostreambuf_iterator<C> >:: 66 _M_insert<true>(ostreambuf_iterator<C>, ios_base&, C, 67 const string_type&) const; 68 69 template 70 ostreambuf_iterator<C> 71 money_put<C, ostreambuf_iterator<C> >:: 72 _M_insert<false>(ostreambuf_iterator<C>, ios_base&, C, 73 const string_type&) const; 74 _GLIBCXX_END_NAMESPACE_LDBL 75 76 // numpunct, numpunct_byname, num_get, and num_put 77 template class numpunct<C>; 78 template struct __numpunct_cache<C>; 79 template class numpunct_byname<C>; 80 _GLIBCXX_BEGIN_NAMESPACE_LDBL 81 template class num_get<C, istreambuf_iterator<C> >; 82 template class num_put<C, ostreambuf_iterator<C> >; 83 template 84 istreambuf_iterator<C> 85 num_get<C, istreambuf_iterator<C> >:: 86 _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>, 87 ios_base&, ios_base::iostate&, 88 long&) const; 89 90 template 91 istreambuf_iterator<C> 92 num_get<C, istreambuf_iterator<C> >:: 93 _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>, 94 ios_base&, ios_base::iostate&, 95 unsigned short&) const; 96 97 template 98 istreambuf_iterator<C> 99 num_get<C, istreambuf_iterator<C> >:: 100 _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>, 101 ios_base&, ios_base::iostate&, 102 unsigned int&) const; 103 104 template 105 istreambuf_iterator<C> 106 num_get<C, istreambuf_iterator<C> >:: 107 _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>, 108 ios_base&, ios_base::iostate&, 109 unsigned long&) const; 110 111 #ifdef _GLIBCXX_USE_LONG_LONG 112 template 113 istreambuf_iterator<C> 114 num_get<C, istreambuf_iterator<C> >:: 115 _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>, 116 ios_base&, ios_base::iostate&, 117 long long&) const; 118 119 template 120 istreambuf_iterator<C> 121 num_get<C, istreambuf_iterator<C> >:: 122 _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>, 123 ios_base&, ios_base::iostate&, 124 unsigned long long&) const; 125 #endif 126 127 template 128 ostreambuf_iterator<C> 129 num_put<C, ostreambuf_iterator<C> >:: 130 _M_insert_int(ostreambuf_iterator<C>, ios_base&, C, 131 long) const; 132 133 template 134 ostreambuf_iterator<C> 135 num_put<C, ostreambuf_iterator<C> >:: 136 _M_insert_int(ostreambuf_iterator<C>, ios_base&, C, 137 unsigned long) const; 138 139 #ifdef _GLIBCXX_USE_LONG_LONG 140 template 141 ostreambuf_iterator<C> 142 num_put<C, ostreambuf_iterator<C> >:: 143 _M_insert_int(ostreambuf_iterator<C>, ios_base&, C, 144 long long) const; 145 146 template 147 ostreambuf_iterator<C> 148 num_put<C, ostreambuf_iterator<C> >:: 149 _M_insert_int(ostreambuf_iterator<C>, ios_base&, C, 150 unsigned long long) const; 151 #endif 152 153 template 154 ostreambuf_iterator<C> 155 num_put<C, ostreambuf_iterator<C> >:: 156 _M_insert_float(ostreambuf_iterator<C>, ios_base&, C, char, 157 double) const; 158 159 template 160 ostreambuf_iterator<C> 161 num_put<C, ostreambuf_iterator<C> >:: 162 _M_insert_float(ostreambuf_iterator<C>, ios_base&, C, char, 163 long double) const; 164 _GLIBCXX_END_NAMESPACE_LDBL 165 166 // time_get and time_put 167 template class __timepunct<C>; 168 template struct __timepunct_cache<C>; 169 template class time_put<C, ostreambuf_iterator<C> >; 170 template class time_put_byname<C, ostreambuf_iterator<C> >; 171 template class time_get<C, istreambuf_iterator<C> >; 172 template class time_get_byname<C, istreambuf_iterator<C> >; 173 174 // messages 175 template class messages<C>; 176 template class messages_byname<C>; 177 178 // ctype 179 inline template class __ctype_abstract_base<C>; 180 template class ctype_byname<C>; 181 182 // codecvt 183 inline template class __codecvt_abstract_base<C, char, mbstate_t>; 184 template class codecvt_byname<C, char, mbstate_t>; 185 186 // collate 187 template class collate<C>; 188 template class collate_byname<C>; 189 190 // use_facet 191 template 192 const ctype<C>& 193 use_facet<ctype<C> >(const locale&); 194 195 template 196 const codecvt<C, char, mbstate_t>& 197 use_facet<codecvt<C, char, mbstate_t> >(const locale&); 198 199 template 200 const collate<C>& 201 use_facet<collate<C> >(const locale&); 202 203 template 204 const numpunct<C>& 205 use_facet<numpunct<C> >(const locale&); 206 207 template 208 const num_put<C>& 209 use_facet<num_put<C> >(const locale&); 210 211 template 212 const num_get<C>& 213 use_facet<num_get<C> >(const locale&); 214 215 template 216 const moneypunct<C, true>& 217 use_facet<moneypunct<C, true> >(const locale&); 218 219 template 220 const moneypunct<C, false>& 221 use_facet<moneypunct<C, false> >(const locale&); 222 223 template 224 const money_put<C>& 225 use_facet<money_put<C> >(const locale&); 226 227 template 228 const money_get<C>& 229 use_facet<money_get<C> >(const locale&); 230 231 template 232 const __timepunct<C>& 233 use_facet<__timepunct<C> >(const locale&); 234 235 template 236 const time_put<C>& 237 use_facet<time_put<C> >(const locale&); 238 239 template 240 const time_get<C>& 241 use_facet<time_get<C> >(const locale&); 242 243 template 244 const messages<C>& 245 use_facet<messages<C> >(const locale&); 246 247 // has_facet 248 template 249 bool 250 has_facet<ctype<C> >(const locale&); 251 252 template 253 bool 254 has_facet<codecvt<C, char, mbstate_t> >(const locale&); 255 256 template 257 bool 258 has_facet<collate<C> >(const locale&); 259 260 template 261 bool 262 has_facet<numpunct<C> >(const locale&); 263 264 template 265 bool 266 has_facet<num_put<C> >(const locale&); 267 268 template 269 bool 270 has_facet<num_get<C> >(const locale&); 271 272 template 273 bool 274 has_facet<moneypunct<C> >(const locale&); 275 276 template 277 bool 278 has_facet<money_put<C> >(const locale&); 279 280 template 281 bool 282 has_facet<money_get<C> >(const locale&); 283 284 template 285 bool 286 has_facet<__timepunct<C> >(const locale&); 287 288 template 289 bool 290 has_facet<time_put<C> >(const locale&); 291 292 template 293 bool 294 has_facet<time_get<C> >(const locale&); 295 296 template 297 bool 298 has_facet<messages<C> >(const locale&); 299 300 301 // locale functions. 302 template 303 C* 304 __add_grouping<C>(C*, C, char const*, size_t, 305 C const*, C const*); 306 307 template class __pad<C, char_traits<C> >; 308 309 template 310 int 311 __int_to_char(C*, unsigned long, const C*, 312 ios_base::fmtflags, bool); 313 314 #ifdef _GLIBCXX_USE_LONG_LONG 315 template 316 int 317 __int_to_char(C*, unsigned long long, const C*, 318 ios_base::fmtflags, bool); 319 #endif 320 321 _GLIBCXX_END_NAMESPACE_VERSION 322 } // namespace 323 324 // XXX GLIBCXX_ABI Deprecated 325 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined C_is_char 326 327 #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \ 328 extern "C" void ldbl (void) __attribute__ ((alias (#dbl), weak)) 329 330 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIjEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_, 331 _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIjEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_); 332 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIlEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_, 333 _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIlEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_); 334 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intImEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_, 335 _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intImEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_); 336 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intItEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_, 337 _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intItEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_); 338 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIxEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_, 339 _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIxEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_); 340 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIyEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_, 341 _ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIyEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_); 342 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES4_S4_RSt8ios_basecT_, 343 _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIlEES3_S3_RSt8ios_basecT_); 344 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intImEES4_S4_RSt8ios_basecT_, 345 _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intImEES3_S3_RSt8ios_basecT_); 346 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIxEES4_S4_RSt8ios_basecT_, 347 _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIxEES3_S3_RSt8ios_basecT_); 348 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIyEES4_S4_RSt8ios_basecT_, 349 _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intIyEES3_S3_RSt8ios_basecT_); 350 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES4_S4_RSt8ios_baseccT_, 351 _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_); 352 _GLIBCXX_LDBL_COMPAT(_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_, 353 _ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIeEES3_S3_RSt8ios_baseccT_); 354 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb0EEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRSs, 355 _ZNKSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb0EEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRSs); 356 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb1EEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRSs, 357 _ZNKSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE10_M_extractILb1EEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRSs); 358 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb0EEES4_S4_RSt8ios_basecRKSs, 359 _ZNKSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb0EEES3_S3_RSt8ios_basecRKSs); 360 _GLIBCXX_LDBL_COMPAT(_ZNKSt17__gnu_cxx_ldbl1289money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb1EEES4_S4_RSt8ios_basecRKSs, 361 _ZNKSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertILb1EEES3_S3_RSt8ios_basecRKSs); 362 363 #endif // _GLIBCXX_LONG_DOUBLE_COMPAT 364