gcc/libstdc++-v3/include/bits/locale_facets.h

2611 lines
88 KiB
C
Raw Normal View History

// Locale support -*- C++ -*-
PR libstdc++/28080 (partial) 2007-02-26 Paolo Carlini <pcarlini@suse.de> PR libstdc++/28080 (partial) * include/std/bitset: Do not include <istream> and <ostream>, <ios> is enough. * include/std/iomanip: Do not include the whole <istream>, <ios> is enough; do not include <functional>; reformat. * include/std/functional: Do not include <cstddef>. * include/std/list: Do not include <bits/stl_uninitialized.h>. * include/std/numeric: Do not include the whole <iterator> and <bits/stl_function.h>. * include/std/valarray: Do not include <numeric>. * include/bits/stl_numeric.h: Include <bits/concept_check.h>. * src/iostream-inst.cc: Include <istream>. * include/ext/functional: Include <cstddef>. * testsuite/util/testsuite_hooks.h: Do not include <locale>, <ctime> is enough; qualify tm. * testsuite/util/testsuite_hooks.cc: Qualify tm. 2007-02-26 Paolo Carlini <pcarlini@suse.de> * include/bits/locale_facets.h (class ctype_byname<char>, class ctype_byname<wchar_t>): Declare. * src/ctype.cc (ctype_byname<wchar_t>::ctype_byname(const char*, size_t), ctype_byname<wchar_t>::~ctype_byname): Define. * config/locale/generic/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * config/locale/gnu/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * config/locale/darwin/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * testsuite/22_locale/headers/locale/synopsis.cc: Remove xfail. From-SVN: r122329
2007-02-26 10:36:39 +01:00
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007, 2008, 2009, 2010, 2011
Audit for LANG independence. 2002-01-22 Benjamin Kosnik <bkoz@redhat.com> Audit for LANG independence. * include/bits/localefwd.h: Tweaks. * include/bits/locale_facets.tcc (money_get::do_get(long double)): Use __convert_to_v. (time_get::do_get_year): Same. (__convert_from_v): Add. (num_put::_M_convert_float): Use. (num_put::_M_convert_int): Same. (money_put::do_put): Same. * src/locale-inst.cc: Add instantiations for __convert_from_v. * config/locale/time_members_gnu.cc: Cleanup setlocale usage. * config/locale/time_members_generic.cc: * config/locale/messages_members_gnu.cc: Same. * config/locale/messages_members_gnu.h: Same. * testsuite/22_locale/codecvt_members_wchar_t_char.cc (test02): New. * testsuite/22_locale/codecvt_members_char_char.cc (test02): New. * testsuite/22_locale/collate_members_wchar_t.cc (test02): New. * testsuite/22_locale/collate_members_char.cc (test02): New. * testsuite/22_locale/ctype_members_wchar_t.cc (test03): New. * testsuite/22_locale/ctype_members_char.cc (test03): New. * testsuite/22_locale/messages_members_char.cc (test02): New. * testsuite/22_locale/moneypunct_members_wchar_t.cc (test02): New. * testsuite/22_locale/moneypunct_members_char.cc (test02): New. * testsuite/22_locale/money_get_members_wchar_t.cc (test04): New. * testsuite/22_locale/money_get_members_char.cc (test04): New. * testsuite/22_locale/money_put_members_wchar_t.cc (test04): New. * testsuite/22_locale/money_put_members_char.cc (test04): New. * testsuite/22_locale/numpunct_members_wchar_t.cc (test02): New. * testsuite/22_locale/numpunct_members_char.cc (test02): New. * testsuite/22_locale/time_put_members_wchar_t.cc (test03): New. * testsuite/22_locale/time_put_members_char.cc (test03): New. * testsuite/22_locale/time_get_members_wchar_t.cc (test07): New. * testsuite/22_locale/time_get_members_char.cc (test07): New. * testsuite/22_locale/num_get_members_wchar_t.cc (test03): New. * testsuite/22_locale/num_get_members_char.cc (test03): New. * testsuite/22_locale/num_put_members_wchar_t.cc (test03): New. * testsuite/22_locale/num_put_members_char.cc (test03): New. * testsuite/22_locale/time_get_members_char.cc: Fixups for global locale issues. * testsuite/22_locale/time_get_members_char.cc: Same. 2002-01-22 Benjamin Kosnik <bkoz@redhat.com> libstdc++/5280 * include/bits/localefwd.h: Tweak comments. * include/bits/locale_facets.h (__convert_to_v): Add. * include/bits/locale_facets.tcc (num_get::do_get(double)): Use it. (num_get::do_get(float)): Same. (num_get::do_get(long double)): Same. (num_get::do_get(bool)): Same. (num_get::do_get(long)): Same. (num_get::do_get(long long)): Same. (num_get::do_get(unsigned int)): Same. (num_get::do_get(unsigned short)): Same. (num_get::do_get(unsigned long)): Same. (num_get::do_get(unsigned long long)): Same. * config/locale/c_locale_gnu.cc (__convert_to_v): Specialize. * config/locale/c_locale_generic.cc: Same. From-SVN: r49108
2002-01-23 00:09:04 +01:00
// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file bits/locale_facets.h
c_io_stdio.h: Correct grammar in comments. 2001-11-02 Phil Edwards <pme@gcc.gnu.org> * config/io/c_io_stdio.h: Correct grammar in comments. * docs/doxygen/Intro.3: Expand "top-level" man page. * docs/doxygen/doxygroups.cc: New module definitions (comments). * docs/doxygen/mainpage.doxy: Tweaks. * docs/doxygen/run_doxygen: Update Doxygen version, massage man pages. Add @file hooks so that headers are considered to be documented. * include/bits/basic_ios.h, include/bits/basic_file.h, include/bits/basic_string.h, include/bits/boost_concept_check.h, include/bits/char_traits.h, include/bits/codecvt.h, include/bits/concept_check.h, include/bits/cpp_type_traits.h, include/bits/fpos.h, include/bits/gslice.h, include/bits/gslice_array.h, include/bits/indirect_array.h, include/bits/ios_base.h, include/bits/locale_facets.h, include/bits/localefwd.h, include/bits/mask_array.h, include/bits/pthread_allocimpl.h, include/bits/slice.h, include/bits/slice_array.h, include/bits/std_algorithm.h, include/bits/std_bitset.h, include/bits/std_complex.h, include/bits/std_deque.h, include/bits/std_fstream.h, include/bits/std_functional.h, include/bits/std_iomanip.h, include/bits/std_ios.h, include/bits/std_iosfwd.h, include/bits/std_iostream.h, include/bits/std_istream.h, include/bits/std_iterator.h, include/bits/std_limits.h, include/bits/std_list.h, include/bits/std_locale.h, include/bits/std_map.h, include/bits/std_memory.h, include/bits/std_numeric.h, include/bits/std_ostream.h, include/bits/std_queue.h, include/bits/std_set.h, include/bits/std_sstream.h, include/bits/std_stack.h, include/bits/std_streambuf.h, include/bits/std_string.h, include/bits/std_utility.h, include/bits/std_valarray.h, include/bits/std_vector.h, include/bits/stl_algo.h, include/bits/stl_alloc.h, include/bits/stl_bvector.h, include/bits/stl_construct.h, include/bits/stl_deque.h, include/bits/stl_heap.h, include/bits/stl_iterator.h, include/bits/stl_iterator_base_funcs.h, include/bits/stl_iterator_base_types.h, include/bits/stl_list.h, include/bits/stl_map.h, include/bits/stl_multimap.h, include/bits/stl_multiset.h, include/bits/stl_numeric.h, include/bits/stl_pair.h, include/bits/stl_pthread_alloc.h, include/bits/stl_queue.h, include/bits/stl_raw_storage_iter.h, include/bits/stl_relops.h, include/bits/stl_set.h, include/bits/stl_stack.h, include/bits/stl_tempbuf.h, include/bits/stl_threads.h, include/bits/stl_tree.h, include/bits/stl_uninitialized.h, include/bits/stl_vector.h, include/bits/stream_iterator.h, include/bits/streambuf_iterator.h, include/bits/stringfwd.h, include/bits/type_traits.h, include/bits/valarray_array.h, include/bits/valarray_meta.h: Add hooks, tweak comments only. * include/bits/stl_algobase.h (swap, min, iter_swap): Also document these functions. * include/bits/stl_function.h: Tweak link comments. From-SVN: r46717
2001-11-02 18:38:11 +01:00
* This is an internal header file, included by other library headers.
* Do not attempt to use it directly. @headername{locale}
c_io_stdio.h: Correct grammar in comments. 2001-11-02 Phil Edwards <pme@gcc.gnu.org> * config/io/c_io_stdio.h: Correct grammar in comments. * docs/doxygen/Intro.3: Expand "top-level" man page. * docs/doxygen/doxygroups.cc: New module definitions (comments). * docs/doxygen/mainpage.doxy: Tweaks. * docs/doxygen/run_doxygen: Update Doxygen version, massage man pages. Add @file hooks so that headers are considered to be documented. * include/bits/basic_ios.h, include/bits/basic_file.h, include/bits/basic_string.h, include/bits/boost_concept_check.h, include/bits/char_traits.h, include/bits/codecvt.h, include/bits/concept_check.h, include/bits/cpp_type_traits.h, include/bits/fpos.h, include/bits/gslice.h, include/bits/gslice_array.h, include/bits/indirect_array.h, include/bits/ios_base.h, include/bits/locale_facets.h, include/bits/localefwd.h, include/bits/mask_array.h, include/bits/pthread_allocimpl.h, include/bits/slice.h, include/bits/slice_array.h, include/bits/std_algorithm.h, include/bits/std_bitset.h, include/bits/std_complex.h, include/bits/std_deque.h, include/bits/std_fstream.h, include/bits/std_functional.h, include/bits/std_iomanip.h, include/bits/std_ios.h, include/bits/std_iosfwd.h, include/bits/std_iostream.h, include/bits/std_istream.h, include/bits/std_iterator.h, include/bits/std_limits.h, include/bits/std_list.h, include/bits/std_locale.h, include/bits/std_map.h, include/bits/std_memory.h, include/bits/std_numeric.h, include/bits/std_ostream.h, include/bits/std_queue.h, include/bits/std_set.h, include/bits/std_sstream.h, include/bits/std_stack.h, include/bits/std_streambuf.h, include/bits/std_string.h, include/bits/std_utility.h, include/bits/std_valarray.h, include/bits/std_vector.h, include/bits/stl_algo.h, include/bits/stl_alloc.h, include/bits/stl_bvector.h, include/bits/stl_construct.h, include/bits/stl_deque.h, include/bits/stl_heap.h, include/bits/stl_iterator.h, include/bits/stl_iterator_base_funcs.h, include/bits/stl_iterator_base_types.h, include/bits/stl_list.h, include/bits/stl_map.h, include/bits/stl_multimap.h, include/bits/stl_multiset.h, include/bits/stl_numeric.h, include/bits/stl_pair.h, include/bits/stl_pthread_alloc.h, include/bits/stl_queue.h, include/bits/stl_raw_storage_iter.h, include/bits/stl_relops.h, include/bits/stl_set.h, include/bits/stl_stack.h, include/bits/stl_tempbuf.h, include/bits/stl_threads.h, include/bits/stl_tree.h, include/bits/stl_uninitialized.h, include/bits/stl_vector.h, include/bits/stream_iterator.h, include/bits/streambuf_iterator.h, include/bits/stringfwd.h, include/bits/type_traits.h, include/bits/valarray_array.h, include/bits/valarray_meta.h: Add hooks, tweak comments only. * include/bits/stl_algobase.h (swap, min, iter_swap): Also document these functions. * include/bits/stl_function.h: Tweak link comments. From-SVN: r46717
2001-11-02 18:38:11 +01:00
*/
localefwd.h: Consistent @file placement... 2006-12-05 Benjamin Kosnik <bkoz@redhat.com> * include/bits/localefwd.h: Consistent @file placement, use include/ as part of the path for files that have shadows instead of no name. * include/bits/valarray_after.h: Same. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/locale_classes.h: Same. * include/bits/locale_facets.h: Same. * include/bits/indirect_array.h: Same. * include/bits/basic_string.h: Same. * include/bits/ios_base.h: Same. * include/bits/postypes.h: Same. * include/bits/codecvt.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/boost_concept_check.h: Same. * include/bits/char_traits.h: Same. * include/bits/stringfwd.h: Same. * include/bits/c++config: Same. * include/bits/valarray_array.h: Same. * include/bits/valarray_before.h: Same. * include/bits/cpp_type_traits.h: Same. * include/c/std_cerrno.h: Same. * include/precompiled/extc++.h: Same. * include/precompiled/stdtr1c++.h: Same. * include/precompiled/stdc++.h: Same. * include/tr1/cinttypes: Same. * include/tr1/fenv.h: Same. * include/tr1/mu_iterate.h: Same. * include/tr1/cstdio: Same. * include/tr1/limits.h: Same. * include/tr1/ctgmath: Same. * include/tr1/cstdarg: Same. * include/tr1/tuple: Same. * include/tr1/float.h: Same. * include/tr1/stdint.h: Same. * include/tr1/tuple_iterate.h: Same. * include/tr1/type_traits_fwd.h: Same. * include/tr1/hashtable_policy.h: Same. * include/tr1/cfenv: Same. * include/tr1/wctype.h: Same. * include/tr1/ref_fwd.h: Same. * include/tr1/bind_repeat.h: Same. * include/tr1/utility: Same. * include/tr1/climits: Same. * include/tr1/type_traits: Same. * include/tr1/stdlib.h: Same. * include/tr1/cwchar: Same. * include/tr1/stdio.h: Same. * include/tr1/ref_wrap_iterate.h: Same. * include/tr1/cstdint: Same. * include/tr1/memory: Same. * include/tr1/cstdbool: Same. * include/tr1/cwctype: Same. * include/tr1/bind_iterate.h: Same. * include/tr1/math.h: Same. * include/tr1/random: Same. * include/tr1/tuple_defs.h: Same. * include/tr1/cstdlib: Same. * include/tr1/unordered_map: Same. * include/tr1/boost_shared_ptr.h: Same. * include/tr1/cctype: Same. * include/tr1/random.tcc: Same. * include/tr1/wchar.h: Same. * include/tr1/hashtable: Same. * include/tr1/cmath: Same. * include/tr1/stdbool.h: Same. * include/tr1/ctime: Same. * include/tr1/functional: Same. * include/tr1/unordered_set: Same. * include/tr1/inttypes.h: Same. * include/tr1/functional_iterate.h: Same. * include/tr1/repeat.h: Same. * include/tr1/complex: Same. * include/tr1/cfloat: Same. * include/tr1/ctype.h: Same. * include/tr1/stdarg.h: Same. * include/tr1/tgmath.h: Same. * include/tr1/array: Same. * include/tr1/common.h: Same. * include/std/std_valarray.h: Same. * include/std/std_iostream.h: Same. * include/std/std_queue.h: Same. * include/std/std_algorithm.h: Same. * include/std/std_streambuf.h: Same. * include/std/std_iterator.h: Same. * include/std/std_ios.h: Same. * include/std/std_bitset.h: Same. * include/std/std_iosfwd.h: Same. * include/std/std_set.h: Same. * include/std/std_iomanip.h: Same. * include/std/std_fstream.h: Same. * include/std/std_functional.h: Same. * include/std/std_numeric.h: Same. * include/std/std_vector.h: Same. * include/std/std_deque.h: Same. * include/std/std_stdexcept.h: Same. * include/std/std_utility.h: Same. * include/std/std_stack.h: Same. * include/std/std_string.h: Same. * include/std/std_complex.h: Same. * include/std/std_memory.h: Same. * include/std/std_ostream.h: Same. * include/std/std_list.h: Same. * include/std/std_map.h: Same. * include/std/std_sstream.h: Same. * include/c_std/std_csignal.h: Same. * include/c_std/std_cstdlib.h: Same. * include/c_std/std_cstdio.h: Same. * include/c_std/std_cstdarg.h: Same. * include/c_std/std_cctype.h: Same. * include/c_std/std_cerrno.h: Same. * include/c_std/std_cmath.h: Same. * include/c_std/std_ctime.h: Same. * include/c_std/std_clocale.h: Same. * include/c_std/std_climits.h: Same. * include/c_std/std_cassert.h: Same. * include/c_std/cmath.tcc * include/c_std/std_csetjmp.h: Same. * include/c_std/std_cwchar.h: Same. * include/c_std/std_cfloat.h: Same. * include/c_std/std_cstring.h: Same. * include/c_std/std_cstddef.h: Same. * include/c_std/std_cwctype.h: Same. * config/locale/gnu/c_locale.h: Namespace scope in all files. * config/locale/gnu/messages_members.h: Same. * config/locale/gnu/c++locale_internal.h: Same. * config/locale/gnu/time_members.h: Same. * config/locale/ieee_1003.1-2001/c_locale.h: Same. * config/locale/ieee_1003.1-2001/messages_members.h: Same. * config/locale/generic/c_locale.h: Same. * config/locale/generic/messages_members.h: Same. * config/locale/generic/time_members.h: Same. * config/allocator/mt_allocator_base.h: Same. * config/allocator/malloc_allocator_base.h: Same. * config/allocator/new_allocator_base.h: Same. * config/allocator/pool_allocator_base.h: Same. * config/allocator/bitmap_allocator_base.h: Same. * config/os/windiss/ctype_noninline.h: Same. * config/os/windiss/os_defines.h: Same. * config/os/windiss/ctype_inline.h: Same. * config/os/newlib/ctype_noninline.h: Same. * config/os/newlib/os_defines.h: Same. * config/os/newlib/ctype_inline.h: Same. * config/os/aix/ctype_noninline.h: Same. * config/os/aix/os_defines.h: Same. * config/os/aix/ctype_inline.h: Same. * config/os/vxworks/ctype_noninline.h: Same. * config/os/vxworks/os_defines.h: Same. * config/os/vxworks/ctype_inline.h: Same. * config/os/hpux/ctype_noninline.h: Same. * config/os/hpux/os_defines.h: Same. * config/os/hpux/ctype_inline.h: Same. * config/os/mingw32/ctype_noninline.h: Same. * config/os/mingw32/os_defines.h: Same. * config/os/mingw32/ctype_inline.h: Same. * config/os/gnu-linux/ctype_noninline.h: Same. * config/os/gnu-linux/os_defines.h: Same. * config/os/gnu-linux/ctype_inline.h: Same. * config/os/tpf/ctype_noninline.h: Same. * config/os/tpf/os_defines.h: Same. * config/os/tpf/ctype_inline.h: Same. * config/os/uclibc/ctype_noninline.h: Same. * config/os/uclibc/os_defines.h: Same. * config/os/uclibc/ctype_inline.h: Same. * config/os/djgpp/ctype_noninline.h: Same. * config/os/djgpp/os_defines.h: Same. * config/os/djgpp/ctype_inline.h: Same. * config/os/qnx/qnx6.1/ctype_noninline.h: Same. * config/os/qnx/qnx6.1/ctype_inline.h: Same. * config/os/bsd/netbsd/ctype_noninline.h: Same. * config/os/bsd/netbsd/ctype_inline.h: Same. * config/os/bsd/darwin/ctype_noninline.h: Same. * config/os/bsd/darwin/ctype_inline.h: Same. * config/os/bsd/freebsd/ctype_noninline.h: Same. * config/os/bsd/freebsd/ctype_inline.h: Same. * config/os/irix/irix5.2/ctype_noninline.h: Same. * config/os/irix/irix5.2/ctype_inline.h: Same. * config/os/irix/irix6.5/ctype_noninline.h: Same. * config/os/irix/irix6.5/ctype_inline.h: Same. * config/os/solaris/solaris2.5/ctype_noninline.h: Same. * config/os/solaris/solaris2.5/ctype_inline.h: Same. * config/os/solaris/solaris2.6/ctype_noninline.h: Same. * config/os/solaris/solaris2.6/ctype_inline.h: Same. * config/os/solaris/solaris2.7/ctype_noninline.h: Same. * config/os/solaris/solaris2.7/ctype_inline.h: Same. * config/os/generic/ctype_noninline.h: Same. * config/os/generic/os_defines.h: Same. * config/os/generic/ctype_inline.h: Same. * config/cpu/arm/cxxabi_tweaks.h: Same. * config/cpu/powerpc/cpu_defines.h: Same. * config/cpu/generic/cxxabi_tweaks.h: Same. * config/cpu/generic/cpu_defines.h: Same. * config/cpu/generic/atomic_word.h: Same. * config/io/c_io_stdio.h: Same. * config/abi/compatibility.h: Same. * docs/doxygen/user.cfg.in: Adjust file list. From-SVN: r119561
2006-12-06 00:24:07 +01:00
//
// ISO C++ 14882: 22.1 Locales
//
#ifndef _LOCALE_FACETS_H
#define _LOCALE_FACETS_H 1
#pragma GCC system_header
re PR libstdc++/4164 (33 Memory Leak when using iostream) 2002-04-15 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/4164 Valgrind fixes. * config/io/basic_file_stdio.cc (__basic_file::~__basic_file): Call close. (__basic_file::close): Call fflush. Correct return if fclose ok. (__basic_file::is_open): Make const. Change __c_file_type to __c_file. * config/io/basic_file_stdio.h: Change __c_file_type to __c_file. (__basic_file::is_open): Make const. * config/io/c_io_stdio.h: Change __c_file_type to __c_file. * include/std/std_fstream.h (filebuf::_M_allocate_file): Remove. (filebuf::_M_unbuf): Add. (filebuf::_M_file): Change to non-pointer. (filebuf::_M_allocate_pback_buffer): Remove. * include/bits/fstream.tcc (filebuf::_M_allocate_file): Remove. (filebuf::_M_allocate_internal_buffer): Use _M_unbuf. Change initialization list for _M_file change. (filebuf::_M_allocate_pback_buffer): Remove. Change _M_file usage to reflect non-pointer data member. * config/locale/generic/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/generic/collate_members.cc: Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/generic/monetary_members.cc: Changeup data types. Add dtors. * config/locale/generic/numeric_members.cc: Add dtors. * config/locale/generic/time_members.cc: Add dtors. * config/locale/gnu/c_locale.cc: Add parameter. * config/locale/gnu/collate_members.cc:Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/gnu/ctype_members.cc: Better error checking. * config/os/gnu-linux/bits/ctype_noninline.h: Better error checking. * config/locale/gnu/messages_members.cc: Tweak comment. * config/locale/gnu/monetary_members.cc: Change data types. Add dtors. * config/locale/gnu/numeric_members.cc: Add dtors, better error checking. * config/locale/gnu/time_members.cc: Same. * config/locale/ieee_1003.1-2001/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/ieee_1003.1-2001/c_locale.h: Correct typedef. * config/locale/ieee_1003.1-2001/codecvt_specializations.h: Remove bogus ctor. * include/bits/locale_facets.h (moneypunct): Use string literals. Don't define dtor. (numpunct): Same. (__timepunct): Same. (locale::_Impl::_M_facets): Change from vector to array. (locale::_Impl::_M_names): Change from array of strings to array of string literals. (locale::facet::_S_create_c_locale): Add parameter. (locale::locale::_S_num_facets): Move to... (locale::_Impl::_M_facets_size): Here. * include/bits/locale_facets.tcc: Fixups for _M_facets, _M_name changes. * include/bits/localefwd.h: (locale::id::_M_id): Add member function. (locale::_Impl::_Impl(facet**, size_t, bool)): Add. (locale::_Impl::_Impl(string, size_t)): Change to (locale::_Impl::_Impl(const char*, size_t)): This. * include/bits/streambuf.tcc (streambuf::_S_pback_size): Define. * include/std/std_streambuf.h (streambuf::_M_pback_size): Change to (streambuf::_S_pback_size): This. * src/globals.cc: Add pre-allocations for "C" facets. * src/locale-inst.cc: Remove vector instantiations. * src/locale.cc: Remove vector include. Fixups for _M_names, _M_facets changes. * src/localename.cc: Same. * include/bits/stl_vector.h: Fix odd formatting. * include/bits/basic_string.tcc: Tweak comment. * libsupc++/new: Make sure parameters are uglified. * libsupc++/typeinfo: Same. * testsuite/22_locale/num_get_members_char.cc: Fixup. * testsuite/22_locale/num_get_members_wchar_t.cc: Same. * testsuite/27_io/filebuf_members.cc: Same. From-SVN: r52345
2002-04-16 02:45:36 +02:00
#include <cwctype> // For wctype_t
#include <cctype>
throw_allocator.h: Consistent @file markup. 2006-11-29 Benjamin Kosnik <bkoz@redhat.com> * include/ext/throw_allocator.h: Consistent @file markup. * include/ext/type_traits.h: Same. * include/debug/hash_map: Same. * include/debug/hash_multimap.h: Same. * include/debug/set.h: Same. * include/debug/hash_set.h: Same. * include/debug/formatter.h: Same. * include/debug/bitset: Same. * include/debug/set: Same. * include/debug/multiset.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/hash_set: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/safe_iterator.tcc: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/hash_map.h: Same. * include/debug/string: Same. * include/debug/macros.h: Same. * include/debug/list: Same. * include/debug/debug.h: Same. * include/debug/map: Same. * include/debug/safe_iterator.h: Same. * include/debug/multimap.h: Same. * config/cpu/generic/atomicity_mutex/atomicity.h: Same. * config/cpu/generic/atomicity_builtins/atomicity.h: Same. * config/cpu/generic/atomic_word.h: Same. * include/tr1/memory: Same. * include/tr1/random: Same. * include/std/std_queue.h: Same. * include/std/std_iterator.h: Same. * include/std/std_bitset.h: Same. * include/std/std_set.h: Same. * include/std/std_vector.h: Same. * include/std/std_deque.h: Same. * include/std/std_utility.h: Same. * include/std/std_stack.h: Same. * include/std/std_string.h: Same. * include/std/std_list.h: Same. * include/std/std_map.h: Same. * libsupc++/typeinfo: Same. * libsupc++/exception: Same. * libsupc++/exception_defines.h: Same. * libsupc++/new: Same. * include/ext/bitmap_allocator.h: Change namespace __balloc to __detail. * src/bitmap_allocator.cc: Same. * include/bits/cpp_type_traits.h: Change __true_type and __false_type from global to namespace std scope. * include/ext/slist: Same. * include/ext/vstring.h: Same. * include/ext/vstring.tcc: Same. * include/ext/rc_string_base.h: Same. * include/ext/sso_string_base.h: Same. * include/bits/codecvt.h: Adjust markup so that correct namespace scope information is in all files. * include/bits/locale_facets.h: Same. Include ctype_base directly. * config/os/windiss/ctype_base.h: Add in namespace markup. * config/os/newlib/ctype_base.h: Same. * config/os/aix/ctype_base.h: Same. * config/os/vxworks/ctype_base.h: Same. * config/os/hpux/ctype_base.h: Same. * config/os/mingw32/ctype_base.h: Same. * config/os/gnu-linux/ctype_base.h: Same. * config/os/tpf/ctype_base.h: Same. * config/os/uclibc/ctype_base.h: Same. * config/os/djgpp/ctype_base.h: Same. * config/os/qnx/qnx6.1/ctype_base.h: Same. * config/os/bsd/netbsd/ctype_base.h: Same. * config/os/bsd/darwin/ctype_base.h: Same. * config/os/bsd/freebsd/ctype_base.h: Same. * config/os/irix/irix5.2/ctype_base.h: Same. * config/os/irix/irix6.5/ctype_base.h: Same. * config/os/solaris/solaris2.5/ctype_base.h: Same. * config/os/solaris/solaris2.6/ctype_base.h: Same. * config/os/solaris/solaris2.7/ctype_base.h: Same. * config/os/generic/ctype_base.h: Same. * include/tr1/mu_iterate.h: Same. * include/tr1/tuple: Same. * include/tr1/tuple_iterate.h: Same. * include/tr1/tuple_defs.h: Same. * include/tr1/random.tcc: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Line number changes. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * docs/doxygen/user.cfg.in: Update to doxygen 1.5.1. * docs/html/17_intro/license.html: Updated info for generated docs. * docs/doxygen/guide.html: Adjust. * docs/doxygen/run_doxygen: Adjust. * docs/doxygen/mainpage.html: Same. * docs/doxygen/doxygroups.cc: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/tables.html: Same. From-SVN: r119334
2006-11-29 21:59:22 +01:00
#include <bits/ctype_base.h>
#include <iosfwd>
#include <bits/ios_base.h> // For ios_base, ios_base::iostate
#include <streambuf>
#include <bits/cpp_type_traits.h>
#include <ext/type_traits.h>
#include <ext/numeric_traits.h>
#include <bits/streambuf_iterator.h>
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
c++config: Add in revised namespace associations. 2005-12-18 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Add in revised namespace associations. _GLIBCXX_BEGIN_NAMESPACE: New macro. _GLIBCXX_END_NAMESPACE: Same. _GLIBCXX_BEGIN_NESTED_NAMESPACE: Same. _GLIBCXX_END_NESTED_NAMESPACE: Same. * acinclude.m4 (GLIBCXX_ENABLE_SYMVERS]): Add gnu-versioned-namespace. * configure: Regenerated. * config.h.in: Same. * config/abi/pre/gnu-versioned-namespace.ver: New. * config/abi/pre/gnu.ver (GLIBCXX_3.4.7): Add exports for nested debug mode items. * include/Makefile.am (${host_builddir}/c++config.h): Fill in values for __GLIBCXX__ and _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION. * include/Makefile.in: Regnerate. * src/compatibility.cc: Alias new, nested definitions to exported symbols from non-nested __gnu_debug. * src/Makefile.am: Add in ENABLE_SYMVERS_GNU_NAMESPACE. * src/Makefile.in: Regenerate. * docs/html/debug_mode.html: Revise for nested design. * docs/html/debug.html: Use debug qualifications instead of __gnu_debug. * docs/html/configopts.html: Revise documentation for --enable-symvers. * include/debug/formatter: Simplify namespace qualifications for current, nested-only reality. Add top-level namespace alias, namespace debug, for debug-mode containers. * include/debug/safe_iterator.h: Same. * include/debug/set.h: Same. * include/debug/hash_multimap.h: Same. * include/debug/hash_set.h: Same. * include/debug/bitset * include/debug/safe_sequence.h: Same. * include/debug/multiset.h: Same. * include/debug/safe_base.h: Same. * include/debug/functions.h: Same. * include/debug/safe_iterator.tcc * include/debug/hash_multiset.h: Same. * include/debug/vector * include/debug/map.h: Same. * include/debug/deque * include/debug/hash_map.h: Same. * include/debug/string * include/debug/macros.h: Same. * include/debug/list * include/debug/debug.h: Same. * include/debug/multimap.h: Same. * src/debug.cc: Same. * testsuite/23_containers/vector/invalidation/1.cc: Cleanups. * testsuite/23_containers/vector/invalidation/2.cc: Same. * testsuite/23_containers/vector/invalidation/3.cc: Same. * testsuite/23_containers/vector/invalidation/4.cc: Same. * testsuite/23_containers/deque/invalidation/1.cc: Same. * testsuite/23_containers/deque/invalidation/2.cc: Same. * testsuite/23_containers/deque/invalidation/3.cc: Same. * testsuite/23_containers/deque/invalidation/4.cc: Same. * testsuite/23_containers/multiset/invalidation/1.cc: Same. * testsuite/23_containers/multiset/invalidation/2.cc: Same. * testsuite/23_containers/multimap/invalidation/1.cc: Same. * testsuite/23_containers/multimap/invalidation/2.cc: Same. * testsuite/23_containers/bitset/invalidation/1.cc: Same. * testsuite/23_containers/bitset/cons/16020.cc: Same. * testsuite/23_containers/bitset/operations/13838.cc: Same. * testsuite/23_containers/list/invalidation/1.cc: Same. * testsuite/23_containers/list/invalidation/2.cc: Same. * testsuite/23_containers/list/invalidation/3.cc: Same. * testsuite/23_containers/list/invalidation/4.cc: Same. * testsuite/23_containers/set/invalidation/1.cc: Same. * testsuite/23_containers/set/invalidation/2.cc: Same. * testsuite/23_containers/map/invalidation/1.cc: Same. * testsuite/23_containers/map/invalidation/2.cc: Same. * testsuite/23_containers/map/insert/16813.cc: Same. * include/bits/basic_ios.h: Use _GLIBCXX_BEGIN_NAMESPACE(std) and friends. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_algobase.h: Same. * include/bits/localefwd.h: Same. * include/bits/valarray_array.tcc: Same. * include/bits/valarray_after.h: Same. * include/bits/gslice_array.h: Same. * include/bits/stl_queue.h: Same. * include/bits/gslice.h: Same. * include/bits/locale_facets.tcc: Same. * include/bits/locale_classes.h: Same. * include/bits/stl_set.h: Same. * include/bits/locale_facets.h: Same. * include/bits/stl_stack.h: Same. * include/bits/stl_iterator_base_types.h: Same. * include/bits/stl_heap.h: Same. * include/bits/indirect_array.h: Same. * include/bits/atomicity.h: Same. * include/bits/stream_iterator.h: Same. * include/bits/concurrence.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_pair.h: Same. * include/bits/basic_ios.tcc: Same. * include/bits/stl_raw_storage_iter.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_numeric.h: Same. * include/bits/ios_base.h: Same. * include/bits/stl_deque.h: Same. * include/bits/istream.tcc: Same. * include/bits/postypes.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/mask_array.h: Same. * include/bits/stl_uninitialized.h: Same. * include/bits/ostream.tcc: Same. * include/bits/slice_array.h: Same. * include/bits/boost_concept_check.h: Same. * include/bits/sstream.tcc: Same. * include/bits/stl_iterator_base_funcs.h: Same. * include/bits/char_traits.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stringfwd.h: Same. * include/bits/c++config * include/bits/stl_iterator.h: Same. * include/bits/valarray_array.h: Same. * include/bits/stl_tempbuf.h: Same. * include/bits/vector.tcc: Same. * include/bits/deque.tcc: Same. * include/bits/stl_bvector.h: Same. * include/bits/basic_string.tcc: Same. * include/bits/list.tcc: Same. * include/bits/streambuf_iterator.h: Same. * include/bits/valarray_before.h: Same. * include/bits/stl_construct.h: Same. * include/bits/stl_function.h: Same. * include/bits/cpp_type_traits.h: Same. * include/bits/streambuf.tcc: Same. * include/bits/allocator.h: Same. * include/bits/stl_tree.h: Same. * include/bits/fstream.tcc: Same. * include/bits/stl_relops.h: Same. * include/bits/functexcept.h: Same. * include/std/std_valarray.h: Same. * include/std/std_iostream.h: Same. * include/std/std_streambuf.h: Same. * include/std/std_bitset.h: Same. * include/std/std_iosfwd.h: Same. * include/std/std_iomanip.h: Same. * include/std/std_fstream.h: Same. * include/std/std_limits.h: Same. * include/std/std_stdexcept.h: Same. * include/std/std_istream.h: Same. * include/std/std_complex.h: Same. * include/std/std_memory.h: Same. * include/std/std_ostream.h: Same. * include/std/std_sstream.h: Same. * include/c_std/std_csignal.h: Same. * include/c_std/std_cstdlib.h: Same. * include/c_std/std_cstdio.h: Same. * include/c_std/std_cstdarg.h: Same. * include/c_std/std_cctype.h: Same. * include/c_std/std_cmath.h: Same. * include/c_std/std_ctime.h: Same. * include/c_std/std_clocale.h: Same. * include/c_std/std_csetjmp.h: Same. * include/c_std/std_cwchar.h: Same. * include/c_std/std_cstring.h: Same. * include/c_std/std_cstddef.h: Same. * include/c_std/std_cwctype.h: Same. * include/backward/iterator.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/strstream * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * src/allocator-inst.cc: Same. * src/complex_io.cc: Same. * src/localename.cc: Same. * src/limits.cc: Same. * src/ios_failure.cc: Same. * src/locale-misc-inst.cc: Same. * src/streambuf-inst.cc: Same. * src/misc-inst.cc: Same. * src/concept-inst.cc: Same. * src/ios_locale.cc: Same. * src/pool_allocator.cc: Same. * src/fstream-inst.cc: Same. * src/istream-inst.cc: Same. * src/string-inst.cc: Same. * src/locale_init.cc: Same. * src/ctype.cc: Same. * src/strstream.cc: Same. * src/ostream-inst.cc: Same. * src/functexcept.cc: Same. * src/streambuf.cc: Same. * src/sstream-inst.cc: Same. * src/ios.cc: Same. * src/valarray-inst.cc: Same. * src/locale.cc: Same. * src/tree.cc: Same. * src/stdexcept.cc: Same. * src/istream.cc: Same. * src/compatibility.cc: Same. * src/locale-inst.cc: Same. * src/globals_io.cc: Same. * src/list.cc: Same. * src/ios_init.cc: Same. * src/locale_facets.cc: Same. * src/codecvt.cc: Same. * include/tr1/unordered_map: Use _GLIBCXX_BEGIN_NAMESPACE(tr1). * include/tr1/boost_shared_ptr.h: Same. * include/tr1/tuple * include/tr1/hashtable * include/tr1/type_traits_fwd.h: Same. * include/tr1/unordered_set * include/tr1/functional * include/tr1/ref_fwd.h: Same. * include/tr1/utility * include/tr1/type_traits * include/tr1/array * include/ext/hashtable.h: Use _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx). * include/ext/typelist.h: Same. * include/ext/hash_map: Same. * include/ext/rc_string_base.h: Same. * include/ext/pool_allocator.h: Same. * include/ext/iterator: Same. * include/ext/rb_tree: Same. * include/ext/numeric: Same. * include/ext/vstring.tcc: Same. * include/ext/sso_string_base.h: Same. * include/ext/stdio_filebuf.h: Same. * include/ext/algorithm: Same. * include/ext/codecvt_specializations.h: Same. * include/ext/new_allocator.h: Same. * include/ext/array_allocator.h: Same. * include/ext/vstring_util.h: Same. * include/ext/vstring_fwd.h: Same. * include/ext/mt_allocator.h: Same. * include/ext/debug_allocator.h: Same. * include/ext/slist: Same. * include/ext/stdio_sync_filebuf.h: Same. * include/ext/hash_fun.h: Same. * include/ext/malloc_allocator.h: Same. * include/ext/functional: Same. * include/ext/bitmap_allocator.h: Same. * include/ext/pod_char_traits.h: Same. * include/ext/vstring.h: Same. * include/ext/ropeimpl.h: Same. * include/ext/hash_set: Same. * include/ext/memory: Same. * include/ext/rope: Same. * include/bits/boost_concept_check.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/char_traits.h: Same. * include/bits/cpp_type_traits.h: Same. * include/bits/concurrence.h: Same. * include/bits/atomicity.h: Same. * config/locale/gnu/numeric_members.cc: Same. * config/locale/gnu/collate_members.cc: Same. * config/locale/gnu/ctype_members.cc: Same. * config/locale/gnu/c_locale.cc: Same. * config/locale/gnu/codecvt_members.cc: Same. * config/locale/gnu/messages_members.cc: Same. * config/locale/gnu/c_locale.h: Same. * config/locale/gnu/monetary_members.cc: Same. * config/locale/gnu/time_members.cc: Same. * config/locale/ieee_1003.1-2001/c_locale.h: Same. * config/locale/generic/numeric_members.cc: Same. * config/locale/generic/collate_members.cc: Same. * config/locale/generic/ctype_members.cc: Same. * config/locale/generic/c_locale.cc: Same. * config/locale/generic/codecvt_members.cc: Same. * config/locale/generic/messages_members.cc: Same. * config/locale/generic/c_locale.h: Same. * config/locale/generic/monetary_members.cc: Same. * config/locale/generic/time_members.cc: Same. * config/os/aix/atomicity.h: Same. * config/os/irix/atomicity.h: Same. * config/cpu/powerpc/atomicity.h: Same. * config/cpu/cris/atomicity.h: Same. * config/cpu/ia64/atomicity.h: Same. * config/cpu/alpha/atomicity.h: Same. * config/cpu/m68k/atomicity.h: Same. * config/cpu/hppa/atomicity.h: Same. * config/cpu/mips/atomicity.h: Same. * config/cpu/sparc/atomicity.h: Same. * config/cpu/i386/atomicity.h: Same. * config/cpu/i486/atomicity.h: Same. * config/cpu/sh/atomicity.h: Same. * config/cpu/generic/atomicity.h: Same. * config/cpu/s390/atomicity.h: Same. * config/io/c_io_stdio.h: Same. * config/io/basic_file_stdio.cc: Same. * config/io/basic_file_stdio.h: Same. * src/misc-inst.cc: Same. * src/concept-inst.cc: Same. * src/ext-inst.cc: Same. * src/string-inst.cc: Same. * src/pool_allocator.cc: Same. * src/bitmap_allocator.cc: Same. * src/mt_allocator.cc: Same. * libsupc++/exception: Same. * libsupc++/vterminate.cc: Same. * testsuite/ext/hash_map/1.cc: Explicitly qualify __gnu_cxx::hash_map. * testsuite/ext/hash_map/14648.cc: Same. * libsupc++/eh_alloc.cc: Correct comment line spacing. From-SVN: r108775
2005-12-19 01:56:05 +01:00
re PR libstdc++/4164 (33 Memory Leak when using iostream) 2002-04-15 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/4164 Valgrind fixes. * config/io/basic_file_stdio.cc (__basic_file::~__basic_file): Call close. (__basic_file::close): Call fflush. Correct return if fclose ok. (__basic_file::is_open): Make const. Change __c_file_type to __c_file. * config/io/basic_file_stdio.h: Change __c_file_type to __c_file. (__basic_file::is_open): Make const. * config/io/c_io_stdio.h: Change __c_file_type to __c_file. * include/std/std_fstream.h (filebuf::_M_allocate_file): Remove. (filebuf::_M_unbuf): Add. (filebuf::_M_file): Change to non-pointer. (filebuf::_M_allocate_pback_buffer): Remove. * include/bits/fstream.tcc (filebuf::_M_allocate_file): Remove. (filebuf::_M_allocate_internal_buffer): Use _M_unbuf. Change initialization list for _M_file change. (filebuf::_M_allocate_pback_buffer): Remove. Change _M_file usage to reflect non-pointer data member. * config/locale/generic/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/generic/collate_members.cc: Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/generic/monetary_members.cc: Changeup data types. Add dtors. * config/locale/generic/numeric_members.cc: Add dtors. * config/locale/generic/time_members.cc: Add dtors. * config/locale/gnu/c_locale.cc: Add parameter. * config/locale/gnu/collate_members.cc:Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/gnu/ctype_members.cc: Better error checking. * config/os/gnu-linux/bits/ctype_noninline.h: Better error checking. * config/locale/gnu/messages_members.cc: Tweak comment. * config/locale/gnu/monetary_members.cc: Change data types. Add dtors. * config/locale/gnu/numeric_members.cc: Add dtors, better error checking. * config/locale/gnu/time_members.cc: Same. * config/locale/ieee_1003.1-2001/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/ieee_1003.1-2001/c_locale.h: Correct typedef. * config/locale/ieee_1003.1-2001/codecvt_specializations.h: Remove bogus ctor. * include/bits/locale_facets.h (moneypunct): Use string literals. Don't define dtor. (numpunct): Same. (__timepunct): Same. (locale::_Impl::_M_facets): Change from vector to array. (locale::_Impl::_M_names): Change from array of strings to array of string literals. (locale::facet::_S_create_c_locale): Add parameter. (locale::locale::_S_num_facets): Move to... (locale::_Impl::_M_facets_size): Here. * include/bits/locale_facets.tcc: Fixups for _M_facets, _M_name changes. * include/bits/localefwd.h: (locale::id::_M_id): Add member function. (locale::_Impl::_Impl(facet**, size_t, bool)): Add. (locale::_Impl::_Impl(string, size_t)): Change to (locale::_Impl::_Impl(const char*, size_t)): This. * include/bits/streambuf.tcc (streambuf::_S_pback_size): Define. * include/std/std_streambuf.h (streambuf::_M_pback_size): Change to (streambuf::_S_pback_size): This. * src/globals.cc: Add pre-allocations for "C" facets. * src/locale-inst.cc: Remove vector instantiations. * src/locale.cc: Remove vector include. Fixups for _M_names, _M_facets changes. * src/localename.cc: Same. * include/bits/stl_vector.h: Fix odd formatting. * include/bits/basic_string.tcc: Tweak comment. * libsupc++/new: Make sure parameters are uglified. * libsupc++/typeinfo: Same. * testsuite/22_locale/num_get_members_char.cc: Fixup. * testsuite/22_locale/num_get_members_wchar_t.cc: Same. * testsuite/27_io/filebuf_members.cc: Same. From-SVN: r52345
2002-04-16 02:45:36 +02:00
// NB: Don't instantiate required wchar_t facets if no wchar_t support.
#ifdef _GLIBCXX_USE_WCHAR_T
# define _GLIBCXX_NUM_FACETS 28
re PR libstdc++/4164 (33 Memory Leak when using iostream) 2002-04-15 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/4164 Valgrind fixes. * config/io/basic_file_stdio.cc (__basic_file::~__basic_file): Call close. (__basic_file::close): Call fflush. Correct return if fclose ok. (__basic_file::is_open): Make const. Change __c_file_type to __c_file. * config/io/basic_file_stdio.h: Change __c_file_type to __c_file. (__basic_file::is_open): Make const. * config/io/c_io_stdio.h: Change __c_file_type to __c_file. * include/std/std_fstream.h (filebuf::_M_allocate_file): Remove. (filebuf::_M_unbuf): Add. (filebuf::_M_file): Change to non-pointer. (filebuf::_M_allocate_pback_buffer): Remove. * include/bits/fstream.tcc (filebuf::_M_allocate_file): Remove. (filebuf::_M_allocate_internal_buffer): Use _M_unbuf. Change initialization list for _M_file change. (filebuf::_M_allocate_pback_buffer): Remove. Change _M_file usage to reflect non-pointer data member. * config/locale/generic/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/generic/collate_members.cc: Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/generic/monetary_members.cc: Changeup data types. Add dtors. * config/locale/generic/numeric_members.cc: Add dtors. * config/locale/generic/time_members.cc: Add dtors. * config/locale/gnu/c_locale.cc: Add parameter. * config/locale/gnu/collate_members.cc:Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/gnu/ctype_members.cc: Better error checking. * config/os/gnu-linux/bits/ctype_noninline.h: Better error checking. * config/locale/gnu/messages_members.cc: Tweak comment. * config/locale/gnu/monetary_members.cc: Change data types. Add dtors. * config/locale/gnu/numeric_members.cc: Add dtors, better error checking. * config/locale/gnu/time_members.cc: Same. * config/locale/ieee_1003.1-2001/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/ieee_1003.1-2001/c_locale.h: Correct typedef. * config/locale/ieee_1003.1-2001/codecvt_specializations.h: Remove bogus ctor. * include/bits/locale_facets.h (moneypunct): Use string literals. Don't define dtor. (numpunct): Same. (__timepunct): Same. (locale::_Impl::_M_facets): Change from vector to array. (locale::_Impl::_M_names): Change from array of strings to array of string literals. (locale::facet::_S_create_c_locale): Add parameter. (locale::locale::_S_num_facets): Move to... (locale::_Impl::_M_facets_size): Here. * include/bits/locale_facets.tcc: Fixups for _M_facets, _M_name changes. * include/bits/localefwd.h: (locale::id::_M_id): Add member function. (locale::_Impl::_Impl(facet**, size_t, bool)): Add. (locale::_Impl::_Impl(string, size_t)): Change to (locale::_Impl::_Impl(const char*, size_t)): This. * include/bits/streambuf.tcc (streambuf::_S_pback_size): Define. * include/std/std_streambuf.h (streambuf::_M_pback_size): Change to (streambuf::_S_pback_size): This. * src/globals.cc: Add pre-allocations for "C" facets. * src/locale-inst.cc: Remove vector instantiations. * src/locale.cc: Remove vector include. Fixups for _M_names, _M_facets changes. * src/localename.cc: Same. * include/bits/stl_vector.h: Fix odd formatting. * include/bits/basic_string.tcc: Tweak comment. * libsupc++/new: Make sure parameters are uglified. * libsupc++/typeinfo: Same. * testsuite/22_locale/num_get_members_char.cc: Fixup. * testsuite/22_locale/num_get_members_wchar_t.cc: Same. * testsuite/27_io/filebuf_members.cc: Same. From-SVN: r52345
2002-04-16 02:45:36 +02:00
#else
# define _GLIBCXX_NUM_FACETS 14
re PR libstdc++/4164 (33 Memory Leak when using iostream) 2002-04-15 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/4164 Valgrind fixes. * config/io/basic_file_stdio.cc (__basic_file::~__basic_file): Call close. (__basic_file::close): Call fflush. Correct return if fclose ok. (__basic_file::is_open): Make const. Change __c_file_type to __c_file. * config/io/basic_file_stdio.h: Change __c_file_type to __c_file. (__basic_file::is_open): Make const. * config/io/c_io_stdio.h: Change __c_file_type to __c_file. * include/std/std_fstream.h (filebuf::_M_allocate_file): Remove. (filebuf::_M_unbuf): Add. (filebuf::_M_file): Change to non-pointer. (filebuf::_M_allocate_pback_buffer): Remove. * include/bits/fstream.tcc (filebuf::_M_allocate_file): Remove. (filebuf::_M_allocate_internal_buffer): Use _M_unbuf. Change initialization list for _M_file change. (filebuf::_M_allocate_pback_buffer): Remove. Change _M_file usage to reflect non-pointer data member. * config/locale/generic/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/generic/collate_members.cc: Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/generic/monetary_members.cc: Changeup data types. Add dtors. * config/locale/generic/numeric_members.cc: Add dtors. * config/locale/generic/time_members.cc: Add dtors. * config/locale/gnu/c_locale.cc: Add parameter. * config/locale/gnu/collate_members.cc:Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/gnu/ctype_members.cc: Better error checking. * config/os/gnu-linux/bits/ctype_noninline.h: Better error checking. * config/locale/gnu/messages_members.cc: Tweak comment. * config/locale/gnu/monetary_members.cc: Change data types. Add dtors. * config/locale/gnu/numeric_members.cc: Add dtors, better error checking. * config/locale/gnu/time_members.cc: Same. * config/locale/ieee_1003.1-2001/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/ieee_1003.1-2001/c_locale.h: Correct typedef. * config/locale/ieee_1003.1-2001/codecvt_specializations.h: Remove bogus ctor. * include/bits/locale_facets.h (moneypunct): Use string literals. Don't define dtor. (numpunct): Same. (__timepunct): Same. (locale::_Impl::_M_facets): Change from vector to array. (locale::_Impl::_M_names): Change from array of strings to array of string literals. (locale::facet::_S_create_c_locale): Add parameter. (locale::locale::_S_num_facets): Move to... (locale::_Impl::_M_facets_size): Here. * include/bits/locale_facets.tcc: Fixups for _M_facets, _M_name changes. * include/bits/localefwd.h: (locale::id::_M_id): Add member function. (locale::_Impl::_Impl(facet**, size_t, bool)): Add. (locale::_Impl::_Impl(string, size_t)): Change to (locale::_Impl::_Impl(const char*, size_t)): This. * include/bits/streambuf.tcc (streambuf::_S_pback_size): Define. * include/std/std_streambuf.h (streambuf::_M_pback_size): Change to (streambuf::_S_pback_size): This. * src/globals.cc: Add pre-allocations for "C" facets. * src/locale-inst.cc: Remove vector instantiations. * src/locale.cc: Remove vector include. Fixups for _M_names, _M_facets changes. * src/localename.cc: Same. * include/bits/stl_vector.h: Fix odd formatting. * include/bits/basic_string.tcc: Tweak comment. * libsupc++/new: Make sure parameters are uglified. * libsupc++/typeinfo: Same. * testsuite/22_locale/num_get_members_char.cc: Fixup. * testsuite/22_locale/num_get_members_wchar_t.cc: Same. * testsuite/27_io/filebuf_members.cc: Same. From-SVN: r52345
2002-04-16 02:45:36 +02:00
#endif
// Convert string to numeric value of type _Tp and store results.
// NB: This is specialized for all required types, there is no
// generic definition.
template<typename _Tp>
void
__convert_to_v(const char*, _Tp&, ios_base::iostate&,
const __c_locale&) throw();
// Explicit specializations for required types.
template<>
void
__convert_to_v(const char*, float&, ios_base::iostate&,
const __c_locale&) throw();
template<>
void
__convert_to_v(const char*, double&, ios_base::iostate&,
const __c_locale&) throw();
template<>
void
__convert_to_v(const char*, long double&, ios_base::iostate&,
const __c_locale&) throw();
// NB: __pad is a struct, rather than a function, so it can be
// partially-specialized.
char_traits.h: Remove generic definitions. 2002-07-30 Benjamin Kosnik <bkoz@redhat.com> Gabriel Dos Reis <gdr@nerim.net> * include/bits/char_traits.h: Remove generic definitions. * include/bits/streambuf_iterator.h (istreambuf_iterator): Use eof, not -2. * include/bits/istream.tcc (istream::readsome): Don't check against eof, instead use constants. (istream::sync): Same. (istream::sentry::sentry): Use eq_int_type. (istream::get): Same. * include/bits/ostream.tcc: Change __pad to __pad<_CharT, _Traits>::_S_pad. * include/bits/locale_facets.h: Add __pad_traits generic and ostreambuf_iterator specialization. * include/bits/locale_facets.tcc: Change __pad into struct __pad with a _CharT and _Traits template parameter and _S_pad static member function. * src/locale-inst.cc: Update __pad instantiations. * include/std/std_fstream.h: Declare _M_underflow_common specializations. * src/fstream.cc: New. Add _M_underflow_common specializations. * include/bits/fstream.tcc (filebuf::close): Use traits_type. (filebuf::_M_underflow_common(bool)): Remove generic version, as sys_ungetc and custom int_types don't get along. * include/std/std_streambuf.h: Add _M_pos. * src/Makefile.am (sources): Add fstream.cc. * src/Makefile.in: Regenerate. * testsuite/21_strings/capacity.cc: Add char_traits specializations. * testsuite/22_locale/codecvt_members_unicode_char.cc: Same. * testsuite/22_locale/codecvt_members_unicode_wchar_t.cc: Same. * testsuite/22_locale/ctor_copy_dtor.cc: Same. * testsuite/27_io/filebuf_virtuals.cc (test07): Move to... * testsuite/27_io/filebuf.cc: ...here. * testsuite/testsuite_hooks.h: Add gnu_char, gnu_int, char_traits specialization for both. * testsuite/27_io/streambuf.cc: Add instantiation test, testsuite_hooks include. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/filebuf.cc: Same. * testsuite/27_io/stringbuf.cc: Same. Co-Authored-By: Gabriel Dos Reis <gdr@nerim.net> From-SVN: r55893
2002-07-31 04:47:36 +02:00
template<typename _CharT, typename _Traits>
struct __pad
{
static void
_S_pad(ios_base& __io, _CharT __fill, _CharT* __news,
const _CharT* __olds, streamsize __newlen, streamsize __oldlen);
};
// Used by both numeric and monetary facets.
// Inserts "group separator" characters into an array of characters.
// It's recursive, one iteration per group. It moves the characters
// in the buffer this way: "xxxx12345" -> "12,345xxx". Call this
// only with __gsize != 0.
template<typename _CharT>
_CharT*
__add_grouping(_CharT* __s, _CharT __sep,
const char* __gbeg, size_t __gsize,
const _CharT* __first, const _CharT* __last);
char_traits.h: Remove generic definitions. 2002-07-30 Benjamin Kosnik <bkoz@redhat.com> Gabriel Dos Reis <gdr@nerim.net> * include/bits/char_traits.h: Remove generic definitions. * include/bits/streambuf_iterator.h (istreambuf_iterator): Use eof, not -2. * include/bits/istream.tcc (istream::readsome): Don't check against eof, instead use constants. (istream::sync): Same. (istream::sentry::sentry): Use eq_int_type. (istream::get): Same. * include/bits/ostream.tcc: Change __pad to __pad<_CharT, _Traits>::_S_pad. * include/bits/locale_facets.h: Add __pad_traits generic and ostreambuf_iterator specialization. * include/bits/locale_facets.tcc: Change __pad into struct __pad with a _CharT and _Traits template parameter and _S_pad static member function. * src/locale-inst.cc: Update __pad instantiations. * include/std/std_fstream.h: Declare _M_underflow_common specializations. * src/fstream.cc: New. Add _M_underflow_common specializations. * include/bits/fstream.tcc (filebuf::close): Use traits_type. (filebuf::_M_underflow_common(bool)): Remove generic version, as sys_ungetc and custom int_types don't get along. * include/std/std_streambuf.h: Add _M_pos. * src/Makefile.am (sources): Add fstream.cc. * src/Makefile.in: Regenerate. * testsuite/21_strings/capacity.cc: Add char_traits specializations. * testsuite/22_locale/codecvt_members_unicode_char.cc: Same. * testsuite/22_locale/codecvt_members_unicode_wchar_t.cc: Same. * testsuite/22_locale/ctor_copy_dtor.cc: Same. * testsuite/27_io/filebuf_virtuals.cc (test07): Move to... * testsuite/27_io/filebuf.cc: ...here. * testsuite/testsuite_hooks.h: Add gnu_char, gnu_int, char_traits specialization for both. * testsuite/27_io/streambuf.cc: Add instantiation test, testsuite_hooks include. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/filebuf.cc: Same. * testsuite/27_io/stringbuf.cc: Same. Co-Authored-By: Gabriel Dos Reis <gdr@nerim.net> From-SVN: r55893
2002-07-31 04:47:36 +02:00
// This template permits specializing facet output code for
// ostreambuf_iterator. For ostreambuf_iterator, sputn is
// significantly more efficient than incrementing iterators.
template<typename _CharT>
inline
ostreambuf_iterator<_CharT>
__write(ostreambuf_iterator<_CharT> __s, const _CharT* __ws, int __len)
{
__s._M_put(__ws, __len);
return __s;
}
// This is the unspecialized form of the template.
template<typename _CharT, typename _OutIter>
inline
_OutIter
__write(_OutIter __s, const _CharT* __ws, int __len)
{
for (int __j = 0; __j < __len; __j++, ++__s)
*__s = __ws[__j];
return __s;
}
// 22.2.1.1 Template class ctype
Implement std::messages. 2001-08-07 Benjamin Kosnik <bkoz@redhat.com> Implement std::messages. Make config a fully-nested directory. * config/locale: New directory. * config/c_locale_generic.cc: Move into locale subdirectory. * config/c_locale_generic.h: Same. * config/c_locale_gnu.cc: Same. * config/c_locale_gnu.h: Same. * config/c_locale_ieee_1003.1-200x.cc: Same. * config/c_locale_ieee_1003.1-200x_.h: Same. * config/codecvt_specializations_generic.h: Same. * config/codecvt_specializations_ieee_1003.1-200x.h: Same. * config/messages_members_gnu.h: Same. * config/messaages_members_gnu.cc: Same. * config/messages_members_generic.h: Same. * config/messaages_members_generic.cc: Same. * config/messages_members_ieee_1003.1-200x.h: Same. * config/messaages_members_ieee_1003.1-200x.cc: Same. * config/io: New directory. * config/basic_file_libio.h: Move into io subdirectory. * config/basic_file_libio.cc: Same. * config/c_io_libio.h: Same. * config/c_io_libio_codecvt.c: Same. * config/basic_file_stdio.h: Same. * config/basic_file_stdio.cc: Same. * config/c_io_stdio.h: Same. * po: New directory. * po/POTFILES.in: New file. * po/Makefile.am: New file. * po/Makefile.in: New file. * po/libstdc++.pot: Generic translation file. * po/fr.po: Preliminary French translation. * po/de.po: Preliminary German translation. * intl: New directory. * intl/Makefile.am: New file. * intl/Makefile.in: New file. * intl/string_literals.cc: New file. * acinclude.m4 (GLIBCPP_CONFIGURE): Bump VERSION to 3.1.0. Add requisite setup for gettext. Re-arrange. * aclocal.m4: Regenerate. * configure.in: Don't call GLIBCPP_CHECK_COMPILER_VERSION. Output Makefile bits for po and intl. * configure: Regenerate. * Makefile.am (SUBDIRS): Add intl, po. Add rule for dist. * Makefile.in: Regenerate. * acconfig.h: Add ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY. * config.h.in: Regenerate. * acinclude.m4 (AC_REPLACE_STRINGFUNCS): Remove. * include/Makefile.am (install-data-local): Don't install Makefile. * include/Makefile.in: Regenerate. * include/bits/locale_facet.h (locale::facet::_S_clone_c_locale): Add member. * config/locale/c_locale_gnu.cc (_S_clone_c_locale): Add definition. * config/locale/c_locale_generic.cc: Same. * config/locale/c_locale_ieee_1003.1-200x.cc: Same. * include/bits/codecvt.h: Excise non-standard, non-required bits. This includes __enc_traits, and partial specializations of codecvt for __enc_traits. * src/codecvt.cc (__enc_traits::_S_max_size): Guard * config/codecvt_partials_ieee_1003.1-200x.h: New file. * config/codecvt_partials_generic.h: New file. * include/Makefile.am (allstamps): Add stamp-codecvt_model. (stamp-codecvt_model): Add. * include/Makefile.in: Regenerate. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add in codecvt configury. * aclocal.m4: Regenerate. * configure: Regenerate. * testsuite/22_locale/codecvt_unicode_wchar_t.cc: Use macro guard. * testsuite/22_locale/codecvt_unicode_char.cc: Same. * testsuite/22_locale/ctor_copy_dtor.cc: And here. * include/bits/localefwd.h (class locale::facet): Add __enc_traits as a friend for _S_*_c_locale functions. * include/bits/codecvt.h (__enc_traits::__enc_traits): Add locale argument to default constructor so that CODESET information can be deduced. * include/bits/locale_facets.h (messages_byname): Re-implement. Remove specializations. * src/locale.cc (messages_byname<char>): Remove specialization. (messages_byname<wchar_t>): Same. * config/locale/c_locale_ieee_1003.1-200x.cc: New file. * config/locale/c_locale_ieee_1003.1-200x.h: New file. * config/locale/messages_members_ieee_1003.1-200x.cc: New file. * config/locale/messages_members_ieee_1003.1-200x.h: New file. * config/locale/messages_members_gnu.cc: New file. * config/locale/messages_members_gnu.h: New file. * config/locale/messages_members_generic.cc: New file. * config/locale/messages_members_generic.h: New file. * docs/html/configopts.html: Add documentation for new locale model, ieee_1003.1. Adjust other flags for current defaults. * docs/html/22_locale/locale.html: Update. * docs/html/22_locale/howto.html: Add link to messages.html. Organize. * docs/html/22_locale/messages.html: New. * src/Makefile.am (sources): Add messages_virtuals.cc. * src/Makefile.in: Regenerate. * include/Makefile.am (allstamps): Add stamp-messages_model. (stamp-messages_model): Add. * include/Makefile.in: Regenerate. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add in messages configury. * aclocal.m4: Regenerate. * configure: Regenerate. * testsuite_flags.in (--cxxflags): Add LOCALEDIR. * testsuite/lib/libstdc++-v3-dg.exp: Remove broken LD_LIBRARY_PATH bits for Irix. * acinclude (GLIBCPP_ENABLE_CLOCALE): Set glibcpp_localedir to the build directories message catalog base directory, and export. Eventually this should probably be made to deal with build and install directories. For now, punt on this as the library itself doesn't use message catalogs (yet). * testsuite/22_locale/messages.cc: New file. * testsuite/22_locale/messages_char_members.cc: New file. * testsuite/22_locale/messages_byname.cc: New file. From-SVN: r44702
2001-08-08 04:49:01 +02:00
// Include host and configuration specific ctype enums for ctype_base.
/**
* @brief Common base for ctype facet
*
* This template class provides implementations of the public functions
* that forward to the protected virtual functions.
*
auto_ptr.h: Fix comment typos. 2008-01-31 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * include/backward/auto_ptr.h: Fix comment typos. * include/bits/algorithmfwd.h: Likewise. * include/bits/basic_ios.h: Likewise. * include/bits/c++config: Likewise. * include/bits/char_traits.h: Likewise. * include/bits/codecvt.h: Likewise. * include/bits/gslice.h: Likewise. * include/bits/ios_base.h: Likewise. * include/bits/locale_facets.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/postypes.h: Likewise. * include/bits/sstream.tcc: Likewise. * include/bits/stl_algo.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_iterator.h: Likewise. * include/bits/stl_iterator_base_types.h Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_map.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_set.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/valarray_array.h: Likewise. * include/debug/safe_base.h: Likewise. * include/ext/bitmap_allocator.h: Likewise. * include/ext/codecvt_specializations.h Likewise. * include/ext/mt_allocator.h: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/rope: Likewise. * include/parallel/checkers.h: Likewise. * include/parallel/find.h: Likewise. * include/parallel/multiseq_selection.h: Likewise. * include/parallel/partition.h: Likewise. * include/parallel/settings.h: Likewise. * include/std/bitset: Likewise. * include/std/complex: Likewise. * include/std/fstream: Likewise. * include/std/istream: Likewise. * include/std/limits: Likewise. * include/std/ostream: Likewise. * include/std/stdexcept: Likewise. * include/std/streambuf: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/cmath: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1_impl/random: Likewise. * include/tr1_impl/regex: Likewise. From-SVN: r131982
2008-01-31 19:44:55 +01:00
* This template also provides abstract stubs for the protected virtual
* functions.
*/
template<typename _CharT>
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
class __ctype_abstract_base : public locale::facet, public ctype_base
{
public:
// Types:
/// Typedef for the template parameter
typedef _CharT char_type;
/**
* @brief Test char_type classification.
*
* This function finds a mask M for @a c and compares it to mask @a m.
* It does so by returning the value of ctype<char_type>::do_is().
*
* @param c The char_type to compare the mask of.
* @param m The mask to compare against.
* @return (M & m) != 0.
*/
bool
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
is(mask __m, char_type __c) const
{ return this->do_is(__m, __c); }
/**
* @brief Return a mask array.
*
* This function finds the mask for each char_type in the range [lo,hi)
* and successively writes it to vec. vec must have as many elements
* as the char array. It does so by returning the value of
* ctype<char_type>::do_is().
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @param vec Pointer to an array of mask storage.
* @return @a hi.
*/
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
const char_type*
is(const char_type *__lo, const char_type *__hi, mask *__vec) const
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
{ return this->do_is(__lo, __hi, __vec); }
/**
* @brief Find char_type matching a mask
*
* This function searches for and returns the first char_type c in
* [lo,hi) for which is(m,c) is true. It does so by returning
* ctype<char_type>::do_scan_is().
*
* @param m The mask to compare against.
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @return Pointer to matching char_type if found, else @a hi.
*/
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
const char_type*
scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
{ return this->do_scan_is(__m, __lo, __hi); }
/**
* @brief Find char_type not matching a mask
*
* This function searches for and returns the first char_type c in
* [lo,hi) for which is(m,c) is false. It does so by returning
* ctype<char_type>::do_scan_not().
*
* @param m The mask to compare against.
* @param lo Pointer to first char in range.
* @param hi Pointer to end of range.
* @return Pointer to non-matching char if found, else @a hi.
*/
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
const char_type*
scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
{ return this->do_scan_not(__m, __lo, __hi); }
/**
* @brief Convert to uppercase.
*
* This function converts the argument to uppercase if possible.
* If not possible (for example, '2'), returns the argument. It does
* so by returning ctype<char_type>::do_toupper().
*
* @param c The char_type to convert.
* @return The uppercase char_type if convertible, else @a c.
*/
char_type
toupper(char_type __c) const
{ return this->do_toupper(__c); }
/**
* @brief Convert array to uppercase.
*
* This function converts each char_type in the range [lo,hi) to
* uppercase if possible. Other elements remain untouched. It does so
* by returning ctype<char_type>:: do_toupper(lo, hi).
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @return @a hi.
*/
const char_type*
toupper(char_type *__lo, const char_type* __hi) const
{ return this->do_toupper(__lo, __hi); }
/**
* @brief Convert to lowercase.
*
* This function converts the argument to lowercase if possible. If
* not possible (for example, '2'), returns the argument. It does so
* by returning ctype<char_type>::do_tolower(c).
*
* @param c The char_type to convert.
* @return The lowercase char_type if convertible, else @a c.
*/
char_type
tolower(char_type __c) const
{ return this->do_tolower(__c); }
/**
* @brief Convert array to lowercase.
*
* This function converts each char_type in the range [lo,hi) to
* lowercase if possible. Other elements remain untouched. It does so
* by returning ctype<char_type>:: do_tolower(lo, hi).
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @return @a hi.
*/
const char_type*
tolower(char_type* __lo, const char_type* __hi) const
{ return this->do_tolower(__lo, __hi); }
/**
* @brief Widen char to char_type
*
* This function converts the char argument to char_type using the
* simplest reasonable transformation. It does so by returning
* ctype<char_type>::do_widen(c).
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param c The char to convert.
* @return The converted char_type.
*/
char_type
widen(char __c) const
{ return this->do_widen(__c); }
/**
* @brief Widen array to char_type
*
* This function converts each char in the input to char_type using the
* simplest reasonable transformation. It does so by returning
* ctype<char_type>::do_widen(c).
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @param to Pointer to the destination array.
* @return @a hi.
*/
const char*
widen(const char* __lo, const char* __hi, char_type* __to) const
{ return this->do_widen(__lo, __hi, __to); }
/**
* @brief Narrow char_type to char
*
* This function converts the char_type to char using the simplest
* reasonable transformation. If the conversion fails, dfault is
* returned instead. It does so by returning
* ctype<char_type>::do_narrow(c).
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param c The char_type to convert.
* @param dfault Char to return if conversion fails.
* @return The converted char.
*/
char
narrow(char_type __c, char __dfault) const
{ return this->do_narrow(__c, __dfault); }
/**
* @brief Narrow array to char array
*
* This function converts each char_type in the input to char using the
* simplest reasonable transformation and writes the results to the
* destination array. For any char_type in the input that cannot be
* converted, @a dfault is used instead. It does so by returning
* ctype<char_type>::do_narrow(lo, hi, dfault, to).
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @param dfault Char to use if conversion fails.
* @param to Pointer to the destination array.
* @return @a hi.
*/
const char_type*
narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char *__to) const
{ return this->do_narrow(__lo, __hi, __dfault, __to); }
protected:
explicit
__ctype_abstract_base(size_t __refs = 0): facet(__refs) { }
virtual
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
~__ctype_abstract_base() { }
/**
* @brief Test char_type classification.
*
* This function finds a mask M for @a c and compares it to mask @a m.
*
* do_is() is a hook for a derived facet to change the behavior of
* classifying. do_is() must always return the same result for the
* same input.
*
* @param c The char_type to find the mask of.
* @param m The mask to compare against.
* @return (M & m) != 0.
*/
virtual bool
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
do_is(mask __m, char_type __c) const = 0;
/**
* @brief Return a mask array.
*
* This function finds the mask for each char_type in the range [lo,hi)
* and successively writes it to vec. vec must have as many elements
* as the input.
*
* do_is() is a hook for a derived facet to change the behavior of
* classifying. do_is() must always return the same result for the
* same input.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @param vec Pointer to an array of mask storage.
* @return @a hi.
*/
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
virtual const char_type*
do_is(const char_type* __lo, const char_type* __hi,
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
mask* __vec) const = 0;
/**
* @brief Find char_type matching mask
*
* This function searches for and returns the first char_type c in
* [lo,hi) for which is(m,c) is true.
*
* do_scan_is() is a hook for a derived facet to change the behavior of
* match searching. do_is() must always return the same result for the
* same input.
*
* @param m The mask to compare against.
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @return Pointer to a matching char_type if found, else @a hi.
*/
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
virtual const char_type*
do_scan_is(mask __m, const char_type* __lo,
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
const char_type* __hi) const = 0;
/**
* @brief Find char_type not matching mask
*
* This function searches for and returns a pointer to the first
* char_type c of [lo,hi) for which is(m,c) is false.
*
* do_scan_is() is a hook for a derived facet to change the behavior of
* match searching. do_is() must always return the same result for the
* same input.
*
* @param m The mask to compare against.
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @return Pointer to a non-matching char_type if found, else @a hi.
*/
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
virtual const char_type*
do_scan_not(mask __m, const char_type* __lo,
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
const char_type* __hi) const = 0;
/**
* @brief Convert to uppercase.
*
* This virtual function converts the char_type argument to uppercase
* if possible. If not possible (for example, '2'), returns the
* argument.
*
* do_toupper() is a hook for a derived facet to change the behavior of
* uppercasing. do_toupper() must always return the same result for
* the same input.
*
* @param c The char_type to convert.
* @return The uppercase char_type if convertible, else @a c.
*/
virtual char_type
do_toupper(char_type) const = 0;
/**
* @brief Convert array to uppercase.
*
* This virtual function converts each char_type in the range [lo,hi)
* to uppercase if possible. Other elements remain untouched.
*
* do_toupper() is a hook for a derived facet to change the behavior of
* uppercasing. do_toupper() must always return the same result for
* the same input.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @return @a hi.
*/
virtual const char_type*
do_toupper(char_type* __lo, const char_type* __hi) const = 0;
/**
* @brief Convert to lowercase.
*
* This virtual function converts the argument to lowercase if
* possible. If not possible (for example, '2'), returns the argument.
*
* do_tolower() is a hook for a derived facet to change the behavior of
* lowercasing. do_tolower() must always return the same result for
* the same input.
*
* @param c The char_type to convert.
* @return The lowercase char_type if convertible, else @a c.
*/
virtual char_type
do_tolower(char_type) const = 0;
/**
* @brief Convert array to lowercase.
*
* This virtual function converts each char_type in the range [lo,hi)
* to lowercase if possible. Other elements remain untouched.
*
* do_tolower() is a hook for a derived facet to change the behavior of
* lowercasing. do_tolower() must always return the same result for
* the same input.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @return @a hi.
*/
virtual const char_type*
do_tolower(char_type* __lo, const char_type* __hi) const = 0;
/**
* @brief Widen char
*
* This virtual function converts the char to char_type using the
* simplest reasonable transformation.
*
* do_widen() is a hook for a derived facet to change the behavior of
* widening. do_widen() must always return the same result for the
* same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param c The char to convert.
* @return The converted char_type
*/
virtual char_type
do_widen(char) const = 0;
/**
* @brief Widen char array
*
* This function converts each char in the input to char_type using the
* simplest reasonable transformation.
*
* do_widen() is a hook for a derived facet to change the behavior of
* widening. do_widen() must always return the same result for the
* same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param lo Pointer to start range.
* @param hi Pointer to end of range.
* @param to Pointer to the destination array.
* @return @a hi.
*/
virtual const char*
do_widen(const char* __lo, const char* __hi,
char_type* __dest) const = 0;
/**
* @brief Narrow char_type to char
*
* This virtual function converts the argument to char using the
* simplest reasonable transformation. If the conversion fails, dfault
* is returned instead.
*
* do_narrow() is a hook for a derived facet to change the behavior of
* narrowing. do_narrow() must always return the same result for the
* same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param c The char_type to convert.
* @param dfault Char to return if conversion fails.
* @return The converted char.
*/
virtual char
do_narrow(char_type, char __dfault) const = 0;
/**
* @brief Narrow char_type array to char
*
* This virtual function converts each char_type in the range [lo,hi) to
* char using the simplest reasonable transformation and writes the
* results to the destination array. For any element in the input that
* cannot be converted, @a dfault is used instead.
*
* do_narrow() is a hook for a derived facet to change the behavior of
* narrowing. do_narrow() must always return the same result for the
* same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @param dfault Char to use if conversion fails.
* @param to Pointer to the destination array.
* @return @a hi.
*/
virtual const char_type*
do_narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char* __dest) const = 0;
};
/**
* @brief Primary class template ctype facet.
* @ingroup locales
*
* This template class defines classification and conversion functions for
* character sets. It wraps cctype functionality. Ctype gets used by
* streams for many I/O operations.
*
* This template provides the protected virtual functions the developer
* will have to replace in a derived class or specialization to make a
* working facet. The public functions that access them are defined in
* __ctype_abstract_base, to allow for implementation flexibility. See
* ctype<wchar_t> for an example. The functions are documented in
* __ctype_abstract_base.
*
* Note: implementations are provided for all the protected virtual
* functions, but will likely not be useful.
*/
template<typename _CharT>
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
class ctype : public __ctype_abstract_base<_CharT>
{
public:
// Types:
typedef _CharT char_type;
typedef typename __ctype_abstract_base<_CharT>::mask mask;
/// The facet id for ctype<char_type>
static locale::id id;
re PR libstdc++/4164 (33 Memory Leak when using iostream) 2002-04-15 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/4164 Valgrind fixes. * config/io/basic_file_stdio.cc (__basic_file::~__basic_file): Call close. (__basic_file::close): Call fflush. Correct return if fclose ok. (__basic_file::is_open): Make const. Change __c_file_type to __c_file. * config/io/basic_file_stdio.h: Change __c_file_type to __c_file. (__basic_file::is_open): Make const. * config/io/c_io_stdio.h: Change __c_file_type to __c_file. * include/std/std_fstream.h (filebuf::_M_allocate_file): Remove. (filebuf::_M_unbuf): Add. (filebuf::_M_file): Change to non-pointer. (filebuf::_M_allocate_pback_buffer): Remove. * include/bits/fstream.tcc (filebuf::_M_allocate_file): Remove. (filebuf::_M_allocate_internal_buffer): Use _M_unbuf. Change initialization list for _M_file change. (filebuf::_M_allocate_pback_buffer): Remove. Change _M_file usage to reflect non-pointer data member. * config/locale/generic/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/generic/collate_members.cc: Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/generic/monetary_members.cc: Changeup data types. Add dtors. * config/locale/generic/numeric_members.cc: Add dtors. * config/locale/generic/time_members.cc: Add dtors. * config/locale/gnu/c_locale.cc: Add parameter. * config/locale/gnu/collate_members.cc:Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/gnu/ctype_members.cc: Better error checking. * config/os/gnu-linux/bits/ctype_noninline.h: Better error checking. * config/locale/gnu/messages_members.cc: Tweak comment. * config/locale/gnu/monetary_members.cc: Change data types. Add dtors. * config/locale/gnu/numeric_members.cc: Add dtors, better error checking. * config/locale/gnu/time_members.cc: Same. * config/locale/ieee_1003.1-2001/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/ieee_1003.1-2001/c_locale.h: Correct typedef. * config/locale/ieee_1003.1-2001/codecvt_specializations.h: Remove bogus ctor. * include/bits/locale_facets.h (moneypunct): Use string literals. Don't define dtor. (numpunct): Same. (__timepunct): Same. (locale::_Impl::_M_facets): Change from vector to array. (locale::_Impl::_M_names): Change from array of strings to array of string literals. (locale::facet::_S_create_c_locale): Add parameter. (locale::locale::_S_num_facets): Move to... (locale::_Impl::_M_facets_size): Here. * include/bits/locale_facets.tcc: Fixups for _M_facets, _M_name changes. * include/bits/localefwd.h: (locale::id::_M_id): Add member function. (locale::_Impl::_Impl(facet**, size_t, bool)): Add. (locale::_Impl::_Impl(string, size_t)): Change to (locale::_Impl::_Impl(const char*, size_t)): This. * include/bits/streambuf.tcc (streambuf::_S_pback_size): Define. * include/std/std_streambuf.h (streambuf::_M_pback_size): Change to (streambuf::_S_pback_size): This. * src/globals.cc: Add pre-allocations for "C" facets. * src/locale-inst.cc: Remove vector instantiations. * src/locale.cc: Remove vector include. Fixups for _M_names, _M_facets changes. * src/localename.cc: Same. * include/bits/stl_vector.h: Fix odd formatting. * include/bits/basic_string.tcc: Tweak comment. * libsupc++/new: Make sure parameters are uglified. * libsupc++/typeinfo: Same. * testsuite/22_locale/num_get_members_char.cc: Fixup. * testsuite/22_locale/num_get_members_wchar_t.cc: Same. * testsuite/27_io/filebuf_members.cc: Same. From-SVN: r52345
2002-04-16 02:45:36 +02:00
explicit
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) { }
protected:
virtual
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
~ctype();
virtual bool
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
do_is(mask __m, char_type __c) const;
virtual const char_type*
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
virtual const char_type*
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
virtual const char_type*
do_scan_not(mask __m, const char_type* __lo,
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
const char_type* __hi) const;
virtual char_type
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
do_toupper(char_type __c) const;
virtual const char_type*
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
do_toupper(char_type* __lo, const char_type* __hi) const;
virtual char_type
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
do_tolower(char_type __c) const;
virtual const char_type*
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
do_tolower(char_type* __lo, const char_type* __hi) const;
virtual char_type
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
do_widen(char __c) const;
virtual const char*
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
virtual char
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
do_narrow(char_type, char __dfault) const;
virtual const char_type*
do_narrow(const char_type* __lo, const char_type* __hi,
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
char __dfault, char* __dest) const;
};
template<typename _CharT>
locale::id ctype<_CharT>::id;
/**
* @brief The ctype<char> specialization.
* @ingroup locales
*
* This class defines classification and conversion functions for
* the char type. It gets used by char streams for many I/O
* operations. The char specialization provides a number of
* optimizations as well.
*/
template<>
class ctype<char> : public locale::facet, public ctype_base
{
public:
// Types:
/// Typedef for the template parameter char.
typedef char char_type;
Clean up initialization and simplfy caching of underlying "C" locale objects. 2001-12-14 Benjamin Kosnik <bkoz@redhat.com> Clean up initialization and simplfy caching of underlying "C" locale objects. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Unconditionally create __clocale object for all named locales, including "C" and "POSIX". * config/locale/c_locale_generic.cc (locale::facet::_S_create_c_locale): Always set __cloc to zero. * config/locale/c_locale_gnu.cc: Always delete. * include/bits/localefwd.h (locale::facet::_S_c_locale): New. * src/locale.cc (locale::classic()): Initialize locale::facet::_S_c_locale. (locale::facet::_S_c_locale): Define. * include/bits/locale_facets.h: Add ctype_byname<wchar_t> ctor specialization. * src/locale.cc: Add definition here. * config/os/gnu-linux/bits/ctype_inline.h: Tweak. * config/os/gnu-linux/bits/ctype_noninline.h: Adjust initializations. * include/bits/locale_facets.h (ctype<char>::_M_c_locale_ctype): Add. Adjust ctors, dtors. (ctype<char>::_M_toupper): Remove const&. (ctype<char>::_M_tolower): Remove const&. (ctype<char>::_M_ctable): Remove const&. * include/bits/locale_facets.h (collate): Clean up initialization of _M_c_locale_collate in ctors and dtors. * config/locale/collate_members_gnu.cc: Always use extended functions. * include/bits/locale_facets.h (messages): Clean up inits in ctor/dtor. (messages_byname): Same. * config/locale/messages_members_generic.h (messages::~messages): Remove. * config/locale/messages_members_gnu.h: Same. * include/bits/localefwd.h: Clean. Move dtor definitions to * src/locale.cc: Here. * testsuite/22_locale/facet.cc: Fix spelling. Named locale support for ctype<wchar_t>. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add variable ctype_members_* bits. * aclocal.m4: Regenerate. * configure: Regenerate. * src/Makefile.am (sources): Add ctype.cc. * src/Makefile.in: Regenerate. * config/locale/ctype_members_generic.cc: New file. * config/locale/ctype_members_gnu.cc: New file. * src/locale.cc: Remove ctype<wchart_t> definitions. From-SVN: r48034
2001-12-15 08:05:04 +01:00
protected:
// Data Members:
Clean up initialization and simplfy caching of underlying "C" locale objects. 2001-12-14 Benjamin Kosnik <bkoz@redhat.com> Clean up initialization and simplfy caching of underlying "C" locale objects. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Unconditionally create __clocale object for all named locales, including "C" and "POSIX". * config/locale/c_locale_generic.cc (locale::facet::_S_create_c_locale): Always set __cloc to zero. * config/locale/c_locale_gnu.cc: Always delete. * include/bits/localefwd.h (locale::facet::_S_c_locale): New. * src/locale.cc (locale::classic()): Initialize locale::facet::_S_c_locale. (locale::facet::_S_c_locale): Define. * include/bits/locale_facets.h: Add ctype_byname<wchar_t> ctor specialization. * src/locale.cc: Add definition here. * config/os/gnu-linux/bits/ctype_inline.h: Tweak. * config/os/gnu-linux/bits/ctype_noninline.h: Adjust initializations. * include/bits/locale_facets.h (ctype<char>::_M_c_locale_ctype): Add. Adjust ctors, dtors. (ctype<char>::_M_toupper): Remove const&. (ctype<char>::_M_tolower): Remove const&. (ctype<char>::_M_ctable): Remove const&. * include/bits/locale_facets.h (collate): Clean up initialization of _M_c_locale_collate in ctors and dtors. * config/locale/collate_members_gnu.cc: Always use extended functions. * include/bits/locale_facets.h (messages): Clean up inits in ctor/dtor. (messages_byname): Same. * config/locale/messages_members_generic.h (messages::~messages): Remove. * config/locale/messages_members_gnu.h: Same. * include/bits/localefwd.h: Clean. Move dtor definitions to * src/locale.cc: Here. * testsuite/22_locale/facet.cc: Fix spelling. Named locale support for ctype<wchar_t>. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add variable ctype_members_* bits. * aclocal.m4: Regenerate. * configure: Regenerate. * src/Makefile.am (sources): Add ctype.cc. * src/Makefile.in: Regenerate. * config/locale/ctype_members_generic.cc: New file. * config/locale/ctype_members_gnu.cc: New file. * src/locale.cc: Remove ctype<wchart_t> definitions. From-SVN: r48034
2001-12-15 08:05:04 +01:00
__c_locale _M_c_locale_ctype;
bool _M_del;
__to_type _M_toupper;
__to_type _M_tolower;
const mask* _M_table;
mutable char _M_widen_ok;
mutable char _M_widen[1 + static_cast<unsigned char>(-1)];
mutable char _M_narrow[1 + static_cast<unsigned char>(-1)];
mutable char _M_narrow_ok; // 0 uninitialized, 1 init,
// 2 memcpy can't be used
public:
/// The facet id for ctype<char>
static locale::id id;
/// The size of the mask table. It is SCHAR_MAX + 1.
static const size_t table_size = 1 + static_cast<unsigned char>(-1);
/**
* @brief Constructor performs initialization.
*
* This is the constructor provided by the standard.
*
* @param table If non-zero, table is used as the per-char mask.
* Else classic_table() is used.
* @param del If true, passes ownership of table to this facet.
* @param refs Passed to the base facet class.
*/
explicit
ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
/**
* @brief Constructor performs static initialization.
*
* This constructor is used to construct the initial C locale facet.
*
* @param cloc Handle to C locale data.
* @param table If non-zero, table is used as the per-char mask.
* @param del If true, passes ownership of table to this facet.
* @param refs Passed to the base facet class.
*/
explicit
ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false,
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
size_t __refs = 0);
/**
* @brief Test char classification.
*
* This function compares the mask table[c] to @a m.
*
* @param c The char to compare the mask of.
* @param m The mask to compare against.
* @return True if m & table[c] is true, false otherwise.
*/
inline bool
is(mask __m, char __c) const;
/**
* @brief Return a mask array.
*
* This function finds the mask for each char in the range [lo, hi) and
* successively writes it to vec. vec must have as many elements as
* the char array.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @param vec Pointer to an array of mask storage.
* @return @a hi.
*/
inline const char*
is(const char* __lo, const char* __hi, mask* __vec) const;
/**
* @brief Find char matching a mask
*
* This function searches for and returns the first char in [lo,hi) for
* which is(m,char) is true.
*
* @param m The mask to compare against.
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @return Pointer to a matching char if found, else @a hi.
*/
inline const char*
scan_is(mask __m, const char* __lo, const char* __hi) const;
/**
* @brief Find char not matching a mask
*
* This function searches for and returns a pointer to the first char
* in [lo,hi) for which is(m,char) is false.
*
* @param m The mask to compare against.
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @return Pointer to a non-matching char if found, else @a hi.
*/
inline const char*
scan_not(mask __m, const char* __lo, const char* __hi) const;
/**
* @brief Convert to uppercase.
*
* This function converts the char argument to uppercase if possible.
* If not possible (for example, '2'), returns the argument.
*
* toupper() acts as if it returns ctype<char>::do_toupper(c).
* do_toupper() must always return the same result for the same input.
*
* @param c The char to convert.
* @return The uppercase char if convertible, else @a c.
*/
char_type
toupper(char_type __c) const
{ return this->do_toupper(__c); }
/**
* @brief Convert array to uppercase.
*
* This function converts each char in the range [lo,hi) to uppercase
* if possible. Other chars remain untouched.
*
* toupper() acts as if it returns ctype<char>:: do_toupper(lo, hi).
* do_toupper() must always return the same result for the same input.
*
* @param lo Pointer to first char in range.
* @param hi Pointer to end of range.
* @return @a hi.
*/
const char_type*
toupper(char_type *__lo, const char_type* __hi) const
{ return this->do_toupper(__lo, __hi); }
/**
* @brief Convert to lowercase.
*
* This function converts the char argument to lowercase if possible.
* If not possible (for example, '2'), returns the argument.
*
* tolower() acts as if it returns ctype<char>::do_tolower(c).
* do_tolower() must always return the same result for the same input.
*
* @param c The char to convert.
* @return The lowercase char if convertible, else @a c.
*/
char_type
tolower(char_type __c) const
{ return this->do_tolower(__c); }
/**
* @brief Convert array to lowercase.
*
* This function converts each char in the range [lo,hi) to lowercase
* if possible. Other chars remain untouched.
*
* tolower() acts as if it returns ctype<char>:: do_tolower(lo, hi).
* do_tolower() must always return the same result for the same input.
*
* @param lo Pointer to first char in range.
* @param hi Pointer to end of range.
* @return @a hi.
*/
const char_type*
tolower(char_type* __lo, const char_type* __hi) const
{ return this->do_tolower(__lo, __hi); }
/**
* @brief Widen char
*
* This function converts the char to char_type using the simplest
* reasonable transformation. For an underived ctype<char> facet, the
* argument will be returned unchanged.
*
* This function works as if it returns ctype<char>::do_widen(c).
* do_widen() must always return the same result for the same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param c The char to convert.
* @return The converted character.
*/
char_type
widen(char __c) const
{
if (_M_widen_ok)
return _M_widen[static_cast<unsigned char>(__c)];
this->_M_widen_init();
return this->do_widen(__c);
}
/**
* @brief Widen char array
*
* This function converts each char in the input to char using the
* simplest reasonable transformation. For an underived ctype<char>
* facet, the argument will be copied unchanged.
*
* This function works as if it returns ctype<char>::do_widen(c).
* do_widen() must always return the same result for the same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param lo Pointer to first char in range.
* @param hi Pointer to end of range.
* @param to Pointer to the destination array.
* @return @a hi.
*/
const char*
widen(const char* __lo, const char* __hi, char_type* __to) const
{
if (_M_widen_ok == 1)
{
pod_char_traits.h (char_traits<>::move): Use __builtin_memmove. 2007-05-11 Paolo Carlini <pcarlini@suse.de> * include/ext/pod_char_traits.h (char_traits<>::move): Use __builtin_memmove. * include/bits/locale_classes.h (locale::_Impl::_M_check_same_name, collate_byname(const char*, size_t)): Use __builtin_strcmp. * include/bits/locale_facets.h: Use __builtin_mem* and __builtin_str* everywhere. * include/bits/codecvt.h (codecvt_byname(const char*, size_t)): Use __builtin_strcmp. * include/bits/char_traits.h: Use __builtin_mem* everywhere. * include/bits/fstream.tcc (basic_filebuf<>::underflow, imbue): Use __builtin_memcpy and __builtin_memmove. * include/bits/locale_facets_nonio.h (moneypunct_byname(const char*, size_t __refs)): Use __builtin_strcmp. * include/std/bitset (bitset<>::_M_do_reset): Use __builtin_memset. * config/locale/gnu/c_locale.h: Use __builtin_strlen, __builtin_strcmp, and __builtin_memcpy. * config/locale/gnu/messages_members.h: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/c_locale.h: Likewise. * config/locale/generic/messages_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. * config/os/gnu-linux/ctype_noninline.h: Likewise, avoid strdup. * config/os/tpf/ctype_noninline.h: Likewise. * config/locale/generic/codecvt_members.cc: Include <cstring>. * config/locale/generic/ctype_members.cc: Likewise. * config/locale/generic/collate_members.cc: Likewise. * config/locale/gnu/c++locale_internal.h: Likewise. * config/locale/darwin/ctype_members.cc: Likewise. * src/ctype.cc: Likewise. * testsuite/19_diagnostics/logic_error/what-1.cc: Likewise. * testsuite/19_diagnostics/logic_error/what-2.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-1.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-2.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-3.cc: Likewise. * config/locale/gnu/messages_members.cc: Avoid strdup. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.cc: Likewise. * config/locale/gnu/time_members.cc: Likewise. * config/locale/generic/c_locale.cc: Likewise. From-SVN: r124623
2007-05-11 20:58:08 +02:00
__builtin_memcpy(__to, __lo, __hi - __lo);
return __hi;
}
if (!_M_widen_ok)
_M_widen_init();
return this->do_widen(__lo, __hi, __to);
}
/**
* @brief Narrow char
*
* This function converts the char to char using the simplest
* reasonable transformation. If the conversion fails, dfault is
* returned instead. For an underived ctype<char> facet, @a c
* will be returned unchanged.
*
* This function works as if it returns ctype<char>::do_narrow(c).
* do_narrow() must always return the same result for the same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param c The char to convert.
* @param dfault Char to return if conversion fails.
* @return The converted character.
*/
char
narrow(char_type __c, char __dfault) const
{
if (_M_narrow[static_cast<unsigned char>(__c)])
return _M_narrow[static_cast<unsigned char>(__c)];
const char __t = do_narrow(__c, __dfault);
if (__t != __dfault)
_M_narrow[static_cast<unsigned char>(__c)] = __t;
return __t;
}
/**
* @brief Narrow char array
*
* This function converts each char in the input to char using the
* simplest reasonable transformation and writes the results to the
* destination array. For any char in the input that cannot be
* converted, @a dfault is used instead. For an underived ctype<char>
* facet, the argument will be copied unchanged.
*
* This function works as if it returns ctype<char>::do_narrow(lo, hi,
* dfault, to). do_narrow() must always return the same result for the
* same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @param dfault Char to use if conversion fails.
* @param to Pointer to the destination array.
* @return @a hi.
*/
const char_type*
narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char *__to) const
{
if (__builtin_expect(_M_narrow_ok == 1, true))
{
pod_char_traits.h (char_traits<>::move): Use __builtin_memmove. 2007-05-11 Paolo Carlini <pcarlini@suse.de> * include/ext/pod_char_traits.h (char_traits<>::move): Use __builtin_memmove. * include/bits/locale_classes.h (locale::_Impl::_M_check_same_name, collate_byname(const char*, size_t)): Use __builtin_strcmp. * include/bits/locale_facets.h: Use __builtin_mem* and __builtin_str* everywhere. * include/bits/codecvt.h (codecvt_byname(const char*, size_t)): Use __builtin_strcmp. * include/bits/char_traits.h: Use __builtin_mem* everywhere. * include/bits/fstream.tcc (basic_filebuf<>::underflow, imbue): Use __builtin_memcpy and __builtin_memmove. * include/bits/locale_facets_nonio.h (moneypunct_byname(const char*, size_t __refs)): Use __builtin_strcmp. * include/std/bitset (bitset<>::_M_do_reset): Use __builtin_memset. * config/locale/gnu/c_locale.h: Use __builtin_strlen, __builtin_strcmp, and __builtin_memcpy. * config/locale/gnu/messages_members.h: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/c_locale.h: Likewise. * config/locale/generic/messages_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. * config/os/gnu-linux/ctype_noninline.h: Likewise, avoid strdup. * config/os/tpf/ctype_noninline.h: Likewise. * config/locale/generic/codecvt_members.cc: Include <cstring>. * config/locale/generic/ctype_members.cc: Likewise. * config/locale/generic/collate_members.cc: Likewise. * config/locale/gnu/c++locale_internal.h: Likewise. * config/locale/darwin/ctype_members.cc: Likewise. * src/ctype.cc: Likewise. * testsuite/19_diagnostics/logic_error/what-1.cc: Likewise. * testsuite/19_diagnostics/logic_error/what-2.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-1.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-2.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-3.cc: Likewise. * config/locale/gnu/messages_members.cc: Avoid strdup. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.cc: Likewise. * config/locale/gnu/time_members.cc: Likewise. * config/locale/generic/c_locale.cc: Likewise. From-SVN: r124623
2007-05-11 20:58:08 +02:00
__builtin_memcpy(__to, __lo, __hi - __lo);
return __hi;
}
if (!_M_narrow_ok)
_M_narrow_init();
return this->do_narrow(__lo, __hi, __dfault, __to);
}
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 695. ctype<char>::classic_table() not accessible.
/// Returns a pointer to the mask table provided to the constructor, or
/// the default from classic_table() if none was provided.
const mask*
table() const throw()
{ return _M_table; }
/// Returns a pointer to the C locale mask table.
static const mask*
classic_table() throw();
protected:
/**
* @brief Destructor.
*
* This function deletes table() if @a del was true in the
* constructor.
*/
virtual
Clean up initialization and simplfy caching of underlying "C" locale objects. 2001-12-14 Benjamin Kosnik <bkoz@redhat.com> Clean up initialization and simplfy caching of underlying "C" locale objects. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Unconditionally create __clocale object for all named locales, including "C" and "POSIX". * config/locale/c_locale_generic.cc (locale::facet::_S_create_c_locale): Always set __cloc to zero. * config/locale/c_locale_gnu.cc: Always delete. * include/bits/localefwd.h (locale::facet::_S_c_locale): New. * src/locale.cc (locale::classic()): Initialize locale::facet::_S_c_locale. (locale::facet::_S_c_locale): Define. * include/bits/locale_facets.h: Add ctype_byname<wchar_t> ctor specialization. * src/locale.cc: Add definition here. * config/os/gnu-linux/bits/ctype_inline.h: Tweak. * config/os/gnu-linux/bits/ctype_noninline.h: Adjust initializations. * include/bits/locale_facets.h (ctype<char>::_M_c_locale_ctype): Add. Adjust ctors, dtors. (ctype<char>::_M_toupper): Remove const&. (ctype<char>::_M_tolower): Remove const&. (ctype<char>::_M_ctable): Remove const&. * include/bits/locale_facets.h (collate): Clean up initialization of _M_c_locale_collate in ctors and dtors. * config/locale/collate_members_gnu.cc: Always use extended functions. * include/bits/locale_facets.h (messages): Clean up inits in ctor/dtor. (messages_byname): Same. * config/locale/messages_members_generic.h (messages::~messages): Remove. * config/locale/messages_members_gnu.h: Same. * include/bits/localefwd.h: Clean. Move dtor definitions to * src/locale.cc: Here. * testsuite/22_locale/facet.cc: Fix spelling. Named locale support for ctype<wchar_t>. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add variable ctype_members_* bits. * aclocal.m4: Regenerate. * configure: Regenerate. * src/Makefile.am (sources): Add ctype.cc. * src/Makefile.in: Regenerate. * config/locale/ctype_members_generic.cc: New file. * config/locale/ctype_members_gnu.cc: New file. * src/locale.cc: Remove ctype<wchart_t> definitions. From-SVN: r48034
2001-12-15 08:05:04 +01:00
~ctype();
/**
* @brief Convert to uppercase.
*
* This virtual function converts the char argument to uppercase if
* possible. If not possible (for example, '2'), returns the argument.
*
* do_toupper() is a hook for a derived facet to change the behavior of
* uppercasing. do_toupper() must always return the same result for
* the same input.
*
* @param c The char to convert.
* @return The uppercase char if convertible, else @a c.
*/
virtual char_type
do_toupper(char_type) const;
/**
* @brief Convert array to uppercase.
*
* This virtual function converts each char in the range [lo,hi) to
* uppercase if possible. Other chars remain untouched.
*
* do_toupper() is a hook for a derived facet to change the behavior of
* uppercasing. do_toupper() must always return the same result for
* the same input.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @return @a hi.
*/
virtual const char_type*
do_toupper(char_type* __lo, const char_type* __hi) const;
/**
* @brief Convert to lowercase.
*
* This virtual function converts the char argument to lowercase if
* possible. If not possible (for example, '2'), returns the argument.
*
* do_tolower() is a hook for a derived facet to change the behavior of
* lowercasing. do_tolower() must always return the same result for
* the same input.
*
* @param c The char to convert.
* @return The lowercase char if convertible, else @a c.
*/
virtual char_type
do_tolower(char_type) const;
/**
* @brief Convert array to lowercase.
*
* This virtual function converts each char in the range [lo,hi) to
* lowercase if possible. Other chars remain untouched.
*
* do_tolower() is a hook for a derived facet to change the behavior of
* lowercasing. do_tolower() must always return the same result for
* the same input.
*
* @param lo Pointer to first char in range.
* @param hi Pointer to end of range.
* @return @a hi.
*/
virtual const char_type*
do_tolower(char_type* __lo, const char_type* __hi) const;
/**
* @brief Widen char
*
* This virtual function converts the char to char using the simplest
* reasonable transformation. For an underived ctype<char> facet, the
* argument will be returned unchanged.
*
* do_widen() is a hook for a derived facet to change the behavior of
* widening. do_widen() must always return the same result for the
* same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param c The char to convert.
* @return The converted character.
*/
virtual char_type
do_widen(char __c) const
{ return __c; }
/**
* @brief Widen char array
*
* This function converts each char in the range [lo,hi) to char using
* the simplest reasonable transformation. For an underived
* ctype<char> facet, the argument will be copied unchanged.
*
* do_widen() is a hook for a derived facet to change the behavior of
* widening. do_widen() must always return the same result for the
* same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @param to Pointer to the destination array.
* @return @a hi.
*/
virtual const char*
do_widen(const char* __lo, const char* __hi, char_type* __dest) const
{
pod_char_traits.h (char_traits<>::move): Use __builtin_memmove. 2007-05-11 Paolo Carlini <pcarlini@suse.de> * include/ext/pod_char_traits.h (char_traits<>::move): Use __builtin_memmove. * include/bits/locale_classes.h (locale::_Impl::_M_check_same_name, collate_byname(const char*, size_t)): Use __builtin_strcmp. * include/bits/locale_facets.h: Use __builtin_mem* and __builtin_str* everywhere. * include/bits/codecvt.h (codecvt_byname(const char*, size_t)): Use __builtin_strcmp. * include/bits/char_traits.h: Use __builtin_mem* everywhere. * include/bits/fstream.tcc (basic_filebuf<>::underflow, imbue): Use __builtin_memcpy and __builtin_memmove. * include/bits/locale_facets_nonio.h (moneypunct_byname(const char*, size_t __refs)): Use __builtin_strcmp. * include/std/bitset (bitset<>::_M_do_reset): Use __builtin_memset. * config/locale/gnu/c_locale.h: Use __builtin_strlen, __builtin_strcmp, and __builtin_memcpy. * config/locale/gnu/messages_members.h: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/c_locale.h: Likewise. * config/locale/generic/messages_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. * config/os/gnu-linux/ctype_noninline.h: Likewise, avoid strdup. * config/os/tpf/ctype_noninline.h: Likewise. * config/locale/generic/codecvt_members.cc: Include <cstring>. * config/locale/generic/ctype_members.cc: Likewise. * config/locale/generic/collate_members.cc: Likewise. * config/locale/gnu/c++locale_internal.h: Likewise. * config/locale/darwin/ctype_members.cc: Likewise. * src/ctype.cc: Likewise. * testsuite/19_diagnostics/logic_error/what-1.cc: Likewise. * testsuite/19_diagnostics/logic_error/what-2.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-1.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-2.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-3.cc: Likewise. * config/locale/gnu/messages_members.cc: Avoid strdup. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.cc: Likewise. * config/locale/gnu/time_members.cc: Likewise. * config/locale/generic/c_locale.cc: Likewise. From-SVN: r124623
2007-05-11 20:58:08 +02:00
__builtin_memcpy(__dest, __lo, __hi - __lo);
return __hi;
}
/**
* @brief Narrow char
*
* This virtual function converts the char to char using the simplest
* reasonable transformation. If the conversion fails, dfault is
* returned instead. For an underived ctype<char> facet, @a c will be
* returned unchanged.
*
* do_narrow() is a hook for a derived facet to change the behavior of
* narrowing. do_narrow() must always return the same result for the
* same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param c The char to convert.
* @param dfault Char to return if conversion fails.
* @return The converted char.
*/
virtual char
do_narrow(char_type __c, char) const
{ return __c; }
/**
* @brief Narrow char array to char array
*
* This virtual function converts each char in the range [lo,hi) to
* char using the simplest reasonable transformation and writes the
* results to the destination array. For any char in the input that
* cannot be converted, @a dfault is used instead. For an underived
* ctype<char> facet, the argument will be copied unchanged.
*
* do_narrow() is a hook for a derived facet to change the behavior of
* narrowing. do_narrow() must always return the same result for the
* same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @param dfault Char to use if conversion fails.
* @param to Pointer to the destination array.
* @return @a hi.
*/
virtual const char_type*
do_narrow(const char_type* __lo, const char_type* __hi,
char, char* __dest) const
{
pod_char_traits.h (char_traits<>::move): Use __builtin_memmove. 2007-05-11 Paolo Carlini <pcarlini@suse.de> * include/ext/pod_char_traits.h (char_traits<>::move): Use __builtin_memmove. * include/bits/locale_classes.h (locale::_Impl::_M_check_same_name, collate_byname(const char*, size_t)): Use __builtin_strcmp. * include/bits/locale_facets.h: Use __builtin_mem* and __builtin_str* everywhere. * include/bits/codecvt.h (codecvt_byname(const char*, size_t)): Use __builtin_strcmp. * include/bits/char_traits.h: Use __builtin_mem* everywhere. * include/bits/fstream.tcc (basic_filebuf<>::underflow, imbue): Use __builtin_memcpy and __builtin_memmove. * include/bits/locale_facets_nonio.h (moneypunct_byname(const char*, size_t __refs)): Use __builtin_strcmp. * include/std/bitset (bitset<>::_M_do_reset): Use __builtin_memset. * config/locale/gnu/c_locale.h: Use __builtin_strlen, __builtin_strcmp, and __builtin_memcpy. * config/locale/gnu/messages_members.h: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/c_locale.h: Likewise. * config/locale/generic/messages_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. * config/os/gnu-linux/ctype_noninline.h: Likewise, avoid strdup. * config/os/tpf/ctype_noninline.h: Likewise. * config/locale/generic/codecvt_members.cc: Include <cstring>. * config/locale/generic/ctype_members.cc: Likewise. * config/locale/generic/collate_members.cc: Likewise. * config/locale/gnu/c++locale_internal.h: Likewise. * config/locale/darwin/ctype_members.cc: Likewise. * src/ctype.cc: Likewise. * testsuite/19_diagnostics/logic_error/what-1.cc: Likewise. * testsuite/19_diagnostics/logic_error/what-2.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-1.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-2.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-3.cc: Likewise. * config/locale/gnu/messages_members.cc: Avoid strdup. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.cc: Likewise. * config/locale/gnu/time_members.cc: Likewise. * config/locale/generic/c_locale.cc: Likewise. From-SVN: r124623
2007-05-11 20:58:08 +02:00
__builtin_memcpy(__dest, __lo, __hi - __lo);
return __hi;
}
private:
void _M_narrow_init() const;
void _M_widen_init() const;
};
#ifdef _GLIBCXX_USE_WCHAR_T
/**
* @brief The ctype<wchar_t> specialization.
* @ingroup locales
*
* This class defines classification and conversion functions for the
* wchar_t type. It gets used by wchar_t streams for many I/O operations.
* The wchar_t specialization provides a number of optimizations as well.
*
* ctype<wchar_t> inherits its public methods from
* __ctype_abstract_base<wchar_t>.
*/
template<>
locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. 2000-12-06 Benjamin Kosnik <bkoz@kredhat.com> * include/bits/locale_facets.h (ctype): Remove _Ctype_nois and _Ctype and replace with common __ctype_abstract_base. (ctype<wchar_t>::_M_convert_to_wmask): Move to locale.cc. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>::ctype): And here. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * src/locale-inst.cc: Clean instantiations. * src/locale.cc (ctype<char>): Add definitions here. (ctype<wchar_t>::_M_wmask): Move definitions here. * config/os/generic/bits/ctype_inline.h (ctype<char>::is): Implement in a generic way, with only "C" functionality and no knowlege of the target os. * config/os/generic/bits/os_defines.h: Change comments to C++ style. * testsuite/22_locale/ctype_char_members.cc (test01): Add tests. * include/bits/codecvt.h (ctype_byname): Remove specializations, as not required. * include/bits/localefwd.h (codecvt_byname): And here. * src/codecvt.cc: Remove codecvt_byname specializations. * include/c/bits/std_cstdio.h: Include c++config.h. From-SVN: r38100
2000-12-07 07:44:49 +01:00
class ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
{
public:
// Types:
/// Typedef for the template parameter wchar_t.
typedef wchar_t char_type;
typedef wctype_t __wmask_type;
Clean up initialization and simplfy caching of underlying "C" locale objects. 2001-12-14 Benjamin Kosnik <bkoz@redhat.com> Clean up initialization and simplfy caching of underlying "C" locale objects. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Unconditionally create __clocale object for all named locales, including "C" and "POSIX". * config/locale/c_locale_generic.cc (locale::facet::_S_create_c_locale): Always set __cloc to zero. * config/locale/c_locale_gnu.cc: Always delete. * include/bits/localefwd.h (locale::facet::_S_c_locale): New. * src/locale.cc (locale::classic()): Initialize locale::facet::_S_c_locale. (locale::facet::_S_c_locale): Define. * include/bits/locale_facets.h: Add ctype_byname<wchar_t> ctor specialization. * src/locale.cc: Add definition here. * config/os/gnu-linux/bits/ctype_inline.h: Tweak. * config/os/gnu-linux/bits/ctype_noninline.h: Adjust initializations. * include/bits/locale_facets.h (ctype<char>::_M_c_locale_ctype): Add. Adjust ctors, dtors. (ctype<char>::_M_toupper): Remove const&. (ctype<char>::_M_tolower): Remove const&. (ctype<char>::_M_ctable): Remove const&. * include/bits/locale_facets.h (collate): Clean up initialization of _M_c_locale_collate in ctors and dtors. * config/locale/collate_members_gnu.cc: Always use extended functions. * include/bits/locale_facets.h (messages): Clean up inits in ctor/dtor. (messages_byname): Same. * config/locale/messages_members_generic.h (messages::~messages): Remove. * config/locale/messages_members_gnu.h: Same. * include/bits/localefwd.h: Clean. Move dtor definitions to * src/locale.cc: Here. * testsuite/22_locale/facet.cc: Fix spelling. Named locale support for ctype<wchar_t>. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add variable ctype_members_* bits. * aclocal.m4: Regenerate. * configure: Regenerate. * src/Makefile.am (sources): Add ctype.cc. * src/Makefile.in: Regenerate. * config/locale/ctype_members_generic.cc: New file. * config/locale/ctype_members_gnu.cc: New file. * src/locale.cc: Remove ctype<wchart_t> definitions. From-SVN: r48034
2001-12-15 08:05:04 +01:00
protected:
__c_locale _M_c_locale_ctype;
// Pre-computed narrowed and widened chars.
bool _M_narrow_ok;
char _M_narrow[128];
wint_t _M_widen[1 + static_cast<unsigned char>(-1)];
// Pre-computed elements for do_is.
mask _M_bit[16];
__wmask_type _M_wmask[16];
Clean up initialization and simplfy caching of underlying "C" locale objects. 2001-12-14 Benjamin Kosnik <bkoz@redhat.com> Clean up initialization and simplfy caching of underlying "C" locale objects. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Unconditionally create __clocale object for all named locales, including "C" and "POSIX". * config/locale/c_locale_generic.cc (locale::facet::_S_create_c_locale): Always set __cloc to zero. * config/locale/c_locale_gnu.cc: Always delete. * include/bits/localefwd.h (locale::facet::_S_c_locale): New. * src/locale.cc (locale::classic()): Initialize locale::facet::_S_c_locale. (locale::facet::_S_c_locale): Define. * include/bits/locale_facets.h: Add ctype_byname<wchar_t> ctor specialization. * src/locale.cc: Add definition here. * config/os/gnu-linux/bits/ctype_inline.h: Tweak. * config/os/gnu-linux/bits/ctype_noninline.h: Adjust initializations. * include/bits/locale_facets.h (ctype<char>::_M_c_locale_ctype): Add. Adjust ctors, dtors. (ctype<char>::_M_toupper): Remove const&. (ctype<char>::_M_tolower): Remove const&. (ctype<char>::_M_ctable): Remove const&. * include/bits/locale_facets.h (collate): Clean up initialization of _M_c_locale_collate in ctors and dtors. * config/locale/collate_members_gnu.cc: Always use extended functions. * include/bits/locale_facets.h (messages): Clean up inits in ctor/dtor. (messages_byname): Same. * config/locale/messages_members_generic.h (messages::~messages): Remove. * config/locale/messages_members_gnu.h: Same. * include/bits/localefwd.h: Clean. Move dtor definitions to * src/locale.cc: Here. * testsuite/22_locale/facet.cc: Fix spelling. Named locale support for ctype<wchar_t>. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add variable ctype_members_* bits. * aclocal.m4: Regenerate. * configure: Regenerate. * src/Makefile.am (sources): Add ctype.cc. * src/Makefile.in: Regenerate. * config/locale/ctype_members_generic.cc: New file. * config/locale/ctype_members_gnu.cc: New file. * src/locale.cc: Remove ctype<wchart_t> definitions. From-SVN: r48034
2001-12-15 08:05:04 +01:00
public:
// Data Members:
/// The facet id for ctype<wchar_t>
static locale::id id;
/**
* @brief Constructor performs initialization.
*
* This is the constructor provided by the standard.
*
* @param refs Passed to the base facet class.
*/
explicit
ctype(size_t __refs = 0);
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
/**
* @brief Constructor performs static initialization.
*
* This constructor is used to construct the initial C locale facet.
*
* @param cloc Handle to C locale data.
* @param refs Passed to the base facet class.
*/
explicit
Named locale support for ctype<char>. 2001-12-12 Benjamin Kosnik <bkoz@redhat.com> Named locale support for ctype<char>. * config/locale/c_locale_gnu.h (_GLIBCPP_C_LOCALE_GNU): New. * config/os/gnu-linux/bits/ctype_noninline.h (ctype<char>): Add definitions for alternate constructor. * config/os/solaris/solaris2.7/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.6/bits/ctype_noninline.h (ctype): Same. * config/os/solaris/solaris2.5/bits/ctype_noninline.h (ctype): Same. * config/os/newlib/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix6.5/bits/ctype_noninline.h (ctype): Same. * config/os/irix/irix5.2/bits/ctype_noninline.h (ctype): Same. * config/os/hpux/bits/ctype_noninline.h (ctype): Same. * config/os/generic/bits/ctype_noninline.h (ctype): Same. * config/os/djgpp/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/netbsd/bits/ctype_noninline.h (ctype): Same. * config/os/bsd/freebsd/bits/ctype_noninline.h (ctype): Same. * config/os/aix/bits/ctype_noninline.h (ctype): Same. * include/bits/locale_facets.h (ctype<_CharT>): Remove dummy definitions for all virtual functions. These are now explicitly undefined for non-required factets, ie any non-char, non-wchar_t instantiations. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Named locales use alternate constructor for ctype facet. * include/bits/locale_facets.h (ctype<char>::ctype(__c_locale, const mask*, bool, size_t): Add. (ctype<wchar_t>::ctype(__c_locale, size_t): Add. * src/locale.cc (ctype<wchar_t>::ctype(__c_locale, size_t)): Add definition. * testsuite/22_locale/ctype_members_char.cc (test02): Add, mark XFAIL for non-gnu locale models. From-SVN: r47953
2001-12-13 00:16:35 +01:00
ctype(__c_locale __cloc, size_t __refs = 0);
protected:
__wmask_type
_M_convert_to_wmask(const mask __m) const throw();
/// Destructor
virtual
~ctype();
/**
* @brief Test wchar_t classification.
*
* This function finds a mask M for @a c and compares it to mask @a m.
*
* do_is() is a hook for a derived facet to change the behavior of
* classifying. do_is() must always return the same result for the
* same input.
*
* @param c The wchar_t to find the mask of.
* @param m The mask to compare against.
* @return (M & m) != 0.
*/
virtual bool
do_is(mask __m, char_type __c) const;
/**
* @brief Return a mask array.
*
* This function finds the mask for each wchar_t in the range [lo,hi)
* and successively writes it to vec. vec must have as many elements
* as the input.
*
* do_is() is a hook for a derived facet to change the behavior of
* classifying. do_is() must always return the same result for the
* same input.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @param vec Pointer to an array of mask storage.
* @return @a hi.
*/
virtual const char_type*
do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
/**
* @brief Find wchar_t matching mask
*
* This function searches for and returns the first wchar_t c in
* [lo,hi) for which is(m,c) is true.
*
* do_scan_is() is a hook for a derived facet to change the behavior of
* match searching. do_is() must always return the same result for the
* same input.
*
* @param m The mask to compare against.
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @return Pointer to a matching wchar_t if found, else @a hi.
*/
virtual const char_type*
do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
/**
* @brief Find wchar_t not matching mask
*
* This function searches for and returns a pointer to the first
* wchar_t c of [lo,hi) for which is(m,c) is false.
*
* do_scan_is() is a hook for a derived facet to change the behavior of
* match searching. do_is() must always return the same result for the
* same input.
*
* @param m The mask to compare against.
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @return Pointer to a non-matching wchar_t if found, else @a hi.
*/
virtual const char_type*
do_scan_not(mask __m, const char_type* __lo,
const char_type* __hi) const;
/**
* @brief Convert to uppercase.
*
* This virtual function converts the wchar_t argument to uppercase if
* possible. If not possible (for example, '2'), returns the argument.
*
* do_toupper() is a hook for a derived facet to change the behavior of
* uppercasing. do_toupper() must always return the same result for
* the same input.
*
* @param c The wchar_t to convert.
* @return The uppercase wchar_t if convertible, else @a c.
*/
virtual char_type
do_toupper(char_type) const;
/**
* @brief Convert array to uppercase.
*
* This virtual function converts each wchar_t in the range [lo,hi) to
* uppercase if possible. Other elements remain untouched.
*
* do_toupper() is a hook for a derived facet to change the behavior of
* uppercasing. do_toupper() must always return the same result for
* the same input.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @return @a hi.
*/
virtual const char_type*
do_toupper(char_type* __lo, const char_type* __hi) const;
/**
* @brief Convert to lowercase.
*
* This virtual function converts the argument to lowercase if
* possible. If not possible (for example, '2'), returns the argument.
*
* do_tolower() is a hook for a derived facet to change the behavior of
* lowercasing. do_tolower() must always return the same result for
* the same input.
*
* @param c The wchar_t to convert.
* @return The lowercase wchar_t if convertible, else @a c.
*/
virtual char_type
do_tolower(char_type) const;
/**
* @brief Convert array to lowercase.
*
* This virtual function converts each wchar_t in the range [lo,hi) to
* lowercase if possible. Other elements remain untouched.
*
* do_tolower() is a hook for a derived facet to change the behavior of
* lowercasing. do_tolower() must always return the same result for
* the same input.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @return @a hi.
*/
virtual const char_type*
do_tolower(char_type* __lo, const char_type* __hi) const;
/**
* @brief Widen char to wchar_t
*
* This virtual function converts the char to wchar_t using the
* simplest reasonable transformation. For an underived ctype<wchar_t>
* facet, the argument will be cast to wchar_t.
*
* do_widen() is a hook for a derived facet to change the behavior of
* widening. do_widen() must always return the same result for the
* same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param c The char to convert.
* @return The converted wchar_t.
*/
virtual char_type
do_widen(char) const;
/**
* @brief Widen char array to wchar_t array
*
* This function converts each char in the input to wchar_t using the
* simplest reasonable transformation. For an underived ctype<wchar_t>
* facet, the argument will be copied, casting each element to wchar_t.
*
* do_widen() is a hook for a derived facet to change the behavior of
* widening. do_widen() must always return the same result for the
* same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param lo Pointer to start range.
* @param hi Pointer to end of range.
* @param to Pointer to the destination array.
* @return @a hi.
*/
virtual const char*
do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
/**
* @brief Narrow wchar_t to char
*
* This virtual function converts the argument to char using
* the simplest reasonable transformation. If the conversion
* fails, dfault is returned instead. For an underived
* ctype<wchar_t> facet, @a c will be cast to char and
* returned.
*
* do_narrow() is a hook for a derived facet to change the
* behavior of narrowing. do_narrow() must always return the
* same result for the same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param c The wchar_t to convert.
* @param dfault Char to return if conversion fails.
* @return The converted char.
*/
virtual char
do_narrow(char_type, char __dfault) const;
/**
* @brief Narrow wchar_t array to char array
*
* This virtual function converts each wchar_t in the range [lo,hi) to
* char using the simplest reasonable transformation and writes the
* results to the destination array. For any wchar_t in the input that
* cannot be converted, @a dfault is used instead. For an underived
* ctype<wchar_t> facet, the argument will be copied, casting each
* element to char.
*
* do_narrow() is a hook for a derived facet to change the behavior of
* narrowing. do_narrow() must always return the same result for the
* same input.
*
* Note: this is not what you want for codepage conversions. See
* codecvt for that.
*
* @param lo Pointer to start of range.
* @param hi Pointer to end of range.
* @param dfault Char to use if conversion fails.
* @param to Pointer to the destination array.
* @return @a hi.
*/
virtual const char_type*
do_narrow(const char_type* __lo, const char_type* __hi,
Clean up initialization and simplfy caching of underlying "C" locale objects. 2001-12-14 Benjamin Kosnik <bkoz@redhat.com> Clean up initialization and simplfy caching of underlying "C" locale objects. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Unconditionally create __clocale object for all named locales, including "C" and "POSIX". * config/locale/c_locale_generic.cc (locale::facet::_S_create_c_locale): Always set __cloc to zero. * config/locale/c_locale_gnu.cc: Always delete. * include/bits/localefwd.h (locale::facet::_S_c_locale): New. * src/locale.cc (locale::classic()): Initialize locale::facet::_S_c_locale. (locale::facet::_S_c_locale): Define. * include/bits/locale_facets.h: Add ctype_byname<wchar_t> ctor specialization. * src/locale.cc: Add definition here. * config/os/gnu-linux/bits/ctype_inline.h: Tweak. * config/os/gnu-linux/bits/ctype_noninline.h: Adjust initializations. * include/bits/locale_facets.h (ctype<char>::_M_c_locale_ctype): Add. Adjust ctors, dtors. (ctype<char>::_M_toupper): Remove const&. (ctype<char>::_M_tolower): Remove const&. (ctype<char>::_M_ctable): Remove const&. * include/bits/locale_facets.h (collate): Clean up initialization of _M_c_locale_collate in ctors and dtors. * config/locale/collate_members_gnu.cc: Always use extended functions. * include/bits/locale_facets.h (messages): Clean up inits in ctor/dtor. (messages_byname): Same. * config/locale/messages_members_generic.h (messages::~messages): Remove. * config/locale/messages_members_gnu.h: Same. * include/bits/localefwd.h: Clean. Move dtor definitions to * src/locale.cc: Here. * testsuite/22_locale/facet.cc: Fix spelling. Named locale support for ctype<wchar_t>. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add variable ctype_members_* bits. * aclocal.m4: Regenerate. * configure: Regenerate. * src/Makefile.am (sources): Add ctype.cc. * src/Makefile.in: Regenerate. * config/locale/ctype_members_generic.cc: New file. * config/locale/ctype_members_gnu.cc: New file. * src/locale.cc: Remove ctype<wchart_t> definitions. From-SVN: r48034
2001-12-15 08:05:04 +01:00
char __dfault, char* __dest) const;
// For use at construction time only.
void
_M_initialize_ctype() throw();
};
#endif //_GLIBCXX_USE_WCHAR_T
run_doxygen: Remove html_output_dir. 2008-03-25 Benjamin Kosnik <bkoz@redhat.com> * scripts/run_doxygen: Remove html_output_dir. Downgrade to Doxygen 1.5.1. * doc/doxygen/style.css: Delete. * doc/doxygen/user.cfg.in: Regenerate with Doxygen 1.5.1. (INPUT): Update. (PREDEFINED): Update. (HTML_OUTPUT): Remove html_output_dir, use html. (HTML_STYLESHEET): Remove style.css. * doc/doxygen/tables.html: Remove style.css use. * doc/doxygen/mainpage.html: Nested lists for Namespaces and Classes. * doc/doxygen/doxygroups.cc: Namespace edits. * doc/doxygen/Intro.3: Correct typo. * doc/xml/api.xml: Add gcc-4.3 links. * doc/html/api.html: Regenerate. * include/debug/debug.h: Document namepaces here. * include/parallel/base.h: Same. * include/ext/typelist.h: Same. * include/ext/pb_ds/tag_and_trait.hpp: Same. * include/tr1_impl/random: Adjust line break. * include/tr1_impl/unordered_map: Correct and or add markup. * include/tr1_impl/boost_shared_ptr.h: Correct and or add markup. * include/tr1_impl/functional_hash.h: Same. * include/tr1_impl/cmath: Same. * include/tr1_impl/functional: Same. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/complex: Same. * include/tr1_impl/type_traits: Same. * include/tr1_impl/regex: Same. * include/tr1_impl/array: Same. * include/std/tuple: Same. * include/std/date_time: Same. * include/std/system_error: Same. * include/std/type_traits: Same. * include/ext/enc_filebuf.h: Same. * include/ext/throw_allocator.h: Same. * include/ext/pool_allocator.h: Same. * include/ext/bitmap_allocator.h: Same. * include/ext/concurrence.h: Same. * include/ext/codecvt_specializations.h: Same. * include/ext/stdio_sync_filebuf.h: Same. * include/ext/array_allocator.h: Same. * include/ext/mt_allocator.h: Same. * include/bits/locale_classes.h: Same. * include/bits/locale_facets.h: Same. * include/bits/codecvt.h: Same. * include/bits/char_traits.h: Same. * include/bits/allocator.h: Same. * include/bits/locale_facets_nonio.h: Same. * include/tr1/poly_laguerre.tcc: Same. * include/tr1/riemann_zeta.tcc: Same. * include/tr1/beta_function.tcc: Same. * include/tr1/tuple: Same. * include/tr1/exp_integral.tcc: Same. * include/tr1/gamma.tcc: Same. * include/tr1/hypergeometric.tcc: Same. * include/tr1/modified_bessel_func.tcc: Same. * include/tr1/legendre_function.tcc: Same. * include/tr1/type_traits: Same. * include/tr1/special_function_util.h: Same. * include/tr1/bessel_function.tcc: Same. * include/tr1/cmath: Same. * include/tr1/poly_hermite.tcc: Same. * include/tr1/ell_integral.tcc: Same. * config/abi/compatibility.h: Adjust file name. * testsuite/19_diagnostics/error_category/cons/copy_neg.cc: Adjust line numbers. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. From-SVN: r133544
2008-03-26 07:27:35 +01:00
/// class ctype_byname [22.2.1.2].
template<typename _CharT>
class ctype_byname : public ctype<_CharT>
{
public:
PR libstdc++/28080 (partial) 2007-02-26 Paolo Carlini <pcarlini@suse.de> PR libstdc++/28080 (partial) * include/std/bitset: Do not include <istream> and <ostream>, <ios> is enough. * include/std/iomanip: Do not include the whole <istream>, <ios> is enough; do not include <functional>; reformat. * include/std/functional: Do not include <cstddef>. * include/std/list: Do not include <bits/stl_uninitialized.h>. * include/std/numeric: Do not include the whole <iterator> and <bits/stl_function.h>. * include/std/valarray: Do not include <numeric>. * include/bits/stl_numeric.h: Include <bits/concept_check.h>. * src/iostream-inst.cc: Include <istream>. * include/ext/functional: Include <cstddef>. * testsuite/util/testsuite_hooks.h: Do not include <locale>, <ctime> is enough; qualify tm. * testsuite/util/testsuite_hooks.cc: Qualify tm. 2007-02-26 Paolo Carlini <pcarlini@suse.de> * include/bits/locale_facets.h (class ctype_byname<char>, class ctype_byname<wchar_t>): Declare. * src/ctype.cc (ctype_byname<wchar_t>::ctype_byname(const char*, size_t), ctype_byname<wchar_t>::~ctype_byname): Define. * config/locale/generic/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * config/locale/gnu/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * config/locale/darwin/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * testsuite/22_locale/headers/locale/synopsis.cc: Remove xfail. From-SVN: r122329
2007-02-26 10:36:39 +01:00
typedef typename ctype<_CharT>::mask mask;
explicit
Clean up initialization and simplfy caching of underlying "C" locale objects. 2001-12-14 Benjamin Kosnik <bkoz@redhat.com> Clean up initialization and simplfy caching of underlying "C" locale objects. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Unconditionally create __clocale object for all named locales, including "C" and "POSIX". * config/locale/c_locale_generic.cc (locale::facet::_S_create_c_locale): Always set __cloc to zero. * config/locale/c_locale_gnu.cc: Always delete. * include/bits/localefwd.h (locale::facet::_S_c_locale): New. * src/locale.cc (locale::classic()): Initialize locale::facet::_S_c_locale. (locale::facet::_S_c_locale): Define. * include/bits/locale_facets.h: Add ctype_byname<wchar_t> ctor specialization. * src/locale.cc: Add definition here. * config/os/gnu-linux/bits/ctype_inline.h: Tweak. * config/os/gnu-linux/bits/ctype_noninline.h: Adjust initializations. * include/bits/locale_facets.h (ctype<char>::_M_c_locale_ctype): Add. Adjust ctors, dtors. (ctype<char>::_M_toupper): Remove const&. (ctype<char>::_M_tolower): Remove const&. (ctype<char>::_M_ctable): Remove const&. * include/bits/locale_facets.h (collate): Clean up initialization of _M_c_locale_collate in ctors and dtors. * config/locale/collate_members_gnu.cc: Always use extended functions. * include/bits/locale_facets.h (messages): Clean up inits in ctor/dtor. (messages_byname): Same. * config/locale/messages_members_generic.h (messages::~messages): Remove. * config/locale/messages_members_gnu.h: Same. * include/bits/localefwd.h: Clean. Move dtor definitions to * src/locale.cc: Here. * testsuite/22_locale/facet.cc: Fix spelling. Named locale support for ctype<wchar_t>. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add variable ctype_members_* bits. * aclocal.m4: Regenerate. * configure: Regenerate. * src/Makefile.am (sources): Add ctype.cc. * src/Makefile.in: Regenerate. * config/locale/ctype_members_generic.cc: New file. * config/locale/ctype_members_gnu.cc: New file. * src/locale.cc: Remove ctype<wchart_t> definitions. From-SVN: r48034
2001-12-15 08:05:04 +01:00
ctype_byname(const char* __s, size_t __refs = 0);
protected:
virtual
Clean up initialization and simplfy caching of underlying "C" locale objects. 2001-12-14 Benjamin Kosnik <bkoz@redhat.com> Clean up initialization and simplfy caching of underlying "C" locale objects. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Unconditionally create __clocale object for all named locales, including "C" and "POSIX". * config/locale/c_locale_generic.cc (locale::facet::_S_create_c_locale): Always set __cloc to zero. * config/locale/c_locale_gnu.cc: Always delete. * include/bits/localefwd.h (locale::facet::_S_c_locale): New. * src/locale.cc (locale::classic()): Initialize locale::facet::_S_c_locale. (locale::facet::_S_c_locale): Define. * include/bits/locale_facets.h: Add ctype_byname<wchar_t> ctor specialization. * src/locale.cc: Add definition here. * config/os/gnu-linux/bits/ctype_inline.h: Tweak. * config/os/gnu-linux/bits/ctype_noninline.h: Adjust initializations. * include/bits/locale_facets.h (ctype<char>::_M_c_locale_ctype): Add. Adjust ctors, dtors. (ctype<char>::_M_toupper): Remove const&. (ctype<char>::_M_tolower): Remove const&. (ctype<char>::_M_ctable): Remove const&. * include/bits/locale_facets.h (collate): Clean up initialization of _M_c_locale_collate in ctors and dtors. * config/locale/collate_members_gnu.cc: Always use extended functions. * include/bits/locale_facets.h (messages): Clean up inits in ctor/dtor. (messages_byname): Same. * config/locale/messages_members_generic.h (messages::~messages): Remove. * config/locale/messages_members_gnu.h: Same. * include/bits/localefwd.h: Clean. Move dtor definitions to * src/locale.cc: Here. * testsuite/22_locale/facet.cc: Fix spelling. Named locale support for ctype<wchar_t>. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add variable ctype_members_* bits. * aclocal.m4: Regenerate. * configure: Regenerate. * src/Makefile.am (sources): Add ctype.cc. * src/Makefile.in: Regenerate. * config/locale/ctype_members_generic.cc: New file. * config/locale/ctype_members_gnu.cc: New file. * src/locale.cc: Remove ctype<wchart_t> definitions. From-SVN: r48034
2001-12-15 08:05:04 +01:00
~ctype_byname() { };
};
/// 22.2.1.4 Class ctype_byname specializations.
template<>
PR libstdc++/28080 (partial) 2007-02-26 Paolo Carlini <pcarlini@suse.de> PR libstdc++/28080 (partial) * include/std/bitset: Do not include <istream> and <ostream>, <ios> is enough. * include/std/iomanip: Do not include the whole <istream>, <ios> is enough; do not include <functional>; reformat. * include/std/functional: Do not include <cstddef>. * include/std/list: Do not include <bits/stl_uninitialized.h>. * include/std/numeric: Do not include the whole <iterator> and <bits/stl_function.h>. * include/std/valarray: Do not include <numeric>. * include/bits/stl_numeric.h: Include <bits/concept_check.h>. * src/iostream-inst.cc: Include <istream>. * include/ext/functional: Include <cstddef>. * testsuite/util/testsuite_hooks.h: Do not include <locale>, <ctime> is enough; qualify tm. * testsuite/util/testsuite_hooks.cc: Qualify tm. 2007-02-26 Paolo Carlini <pcarlini@suse.de> * include/bits/locale_facets.h (class ctype_byname<char>, class ctype_byname<wchar_t>): Declare. * src/ctype.cc (ctype_byname<wchar_t>::ctype_byname(const char*, size_t), ctype_byname<wchar_t>::~ctype_byname): Define. * config/locale/generic/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * config/locale/gnu/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * config/locale/darwin/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * testsuite/22_locale/headers/locale/synopsis.cc: Remove xfail. From-SVN: r122329
2007-02-26 10:36:39 +01:00
class ctype_byname<char> : public ctype<char>
{
public:
explicit
ctype_byname(const char* __s, size_t __refs = 0);
PR libstdc++/28080 (partial) 2007-02-26 Paolo Carlini <pcarlini@suse.de> PR libstdc++/28080 (partial) * include/std/bitset: Do not include <istream> and <ostream>, <ios> is enough. * include/std/iomanip: Do not include the whole <istream>, <ios> is enough; do not include <functional>; reformat. * include/std/functional: Do not include <cstddef>. * include/std/list: Do not include <bits/stl_uninitialized.h>. * include/std/numeric: Do not include the whole <iterator> and <bits/stl_function.h>. * include/std/valarray: Do not include <numeric>. * include/bits/stl_numeric.h: Include <bits/concept_check.h>. * src/iostream-inst.cc: Include <istream>. * include/ext/functional: Include <cstddef>. * testsuite/util/testsuite_hooks.h: Do not include <locale>, <ctime> is enough; qualify tm. * testsuite/util/testsuite_hooks.cc: Qualify tm. 2007-02-26 Paolo Carlini <pcarlini@suse.de> * include/bits/locale_facets.h (class ctype_byname<char>, class ctype_byname<wchar_t>): Declare. * src/ctype.cc (ctype_byname<wchar_t>::ctype_byname(const char*, size_t), ctype_byname<wchar_t>::~ctype_byname): Define. * config/locale/generic/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * config/locale/gnu/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * config/locale/darwin/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * testsuite/22_locale/headers/locale/synopsis.cc: Remove xfail. From-SVN: r122329
2007-02-26 10:36:39 +01:00
protected:
virtual
~ctype_byname();
};
#ifdef _GLIBCXX_USE_WCHAR_T
Clean up initialization and simplfy caching of underlying "C" locale objects. 2001-12-14 Benjamin Kosnik <bkoz@redhat.com> Clean up initialization and simplfy caching of underlying "C" locale objects. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Unconditionally create __clocale object for all named locales, including "C" and "POSIX". * config/locale/c_locale_generic.cc (locale::facet::_S_create_c_locale): Always set __cloc to zero. * config/locale/c_locale_gnu.cc: Always delete. * include/bits/localefwd.h (locale::facet::_S_c_locale): New. * src/locale.cc (locale::classic()): Initialize locale::facet::_S_c_locale. (locale::facet::_S_c_locale): Define. * include/bits/locale_facets.h: Add ctype_byname<wchar_t> ctor specialization. * src/locale.cc: Add definition here. * config/os/gnu-linux/bits/ctype_inline.h: Tweak. * config/os/gnu-linux/bits/ctype_noninline.h: Adjust initializations. * include/bits/locale_facets.h (ctype<char>::_M_c_locale_ctype): Add. Adjust ctors, dtors. (ctype<char>::_M_toupper): Remove const&. (ctype<char>::_M_tolower): Remove const&. (ctype<char>::_M_ctable): Remove const&. * include/bits/locale_facets.h (collate): Clean up initialization of _M_c_locale_collate in ctors and dtors. * config/locale/collate_members_gnu.cc: Always use extended functions. * include/bits/locale_facets.h (messages): Clean up inits in ctor/dtor. (messages_byname): Same. * config/locale/messages_members_generic.h (messages::~messages): Remove. * config/locale/messages_members_gnu.h: Same. * include/bits/localefwd.h: Clean. Move dtor definitions to * src/locale.cc: Here. * testsuite/22_locale/facet.cc: Fix spelling. Named locale support for ctype<wchar_t>. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add variable ctype_members_* bits. * aclocal.m4: Regenerate. * configure: Regenerate. * src/Makefile.am (sources): Add ctype.cc. * src/Makefile.in: Regenerate. * config/locale/ctype_members_generic.cc: New file. * config/locale/ctype_members_gnu.cc: New file. * src/locale.cc: Remove ctype<wchart_t> definitions. From-SVN: r48034
2001-12-15 08:05:04 +01:00
template<>
PR libstdc++/28080 (partial) 2007-02-26 Paolo Carlini <pcarlini@suse.de> PR libstdc++/28080 (partial) * include/std/bitset: Do not include <istream> and <ostream>, <ios> is enough. * include/std/iomanip: Do not include the whole <istream>, <ios> is enough; do not include <functional>; reformat. * include/std/functional: Do not include <cstddef>. * include/std/list: Do not include <bits/stl_uninitialized.h>. * include/std/numeric: Do not include the whole <iterator> and <bits/stl_function.h>. * include/std/valarray: Do not include <numeric>. * include/bits/stl_numeric.h: Include <bits/concept_check.h>. * src/iostream-inst.cc: Include <istream>. * include/ext/functional: Include <cstddef>. * testsuite/util/testsuite_hooks.h: Do not include <locale>, <ctime> is enough; qualify tm. * testsuite/util/testsuite_hooks.cc: Qualify tm. 2007-02-26 Paolo Carlini <pcarlini@suse.de> * include/bits/locale_facets.h (class ctype_byname<char>, class ctype_byname<wchar_t>): Declare. * src/ctype.cc (ctype_byname<wchar_t>::ctype_byname(const char*, size_t), ctype_byname<wchar_t>::~ctype_byname): Define. * config/locale/generic/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * config/locale/gnu/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * config/locale/darwin/ctype_members.cc (ctype_byname<char>:: ctype_byname(const char*, size_t), ctype_byname<char>::~ctype_byname): Likewise. * testsuite/22_locale/headers/locale/synopsis.cc: Remove xfail. From-SVN: r122329
2007-02-26 10:36:39 +01:00
class ctype_byname<wchar_t> : public ctype<wchar_t>
{
public:
explicit
ctype_byname(const char* __s, size_t __refs = 0);
protected:
virtual
~ctype_byname();
};
#endif
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
throw_allocator.h: Consistent @file markup. 2006-11-29 Benjamin Kosnik <bkoz@redhat.com> * include/ext/throw_allocator.h: Consistent @file markup. * include/ext/type_traits.h: Same. * include/debug/hash_map: Same. * include/debug/hash_multimap.h: Same. * include/debug/set.h: Same. * include/debug/hash_set.h: Same. * include/debug/formatter.h: Same. * include/debug/bitset: Same. * include/debug/set: Same. * include/debug/multiset.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/hash_set: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/safe_iterator.tcc: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/hash_map.h: Same. * include/debug/string: Same. * include/debug/macros.h: Same. * include/debug/list: Same. * include/debug/debug.h: Same. * include/debug/map: Same. * include/debug/safe_iterator.h: Same. * include/debug/multimap.h: Same. * config/cpu/generic/atomicity_mutex/atomicity.h: Same. * config/cpu/generic/atomicity_builtins/atomicity.h: Same. * config/cpu/generic/atomic_word.h: Same. * include/tr1/memory: Same. * include/tr1/random: Same. * include/std/std_queue.h: Same. * include/std/std_iterator.h: Same. * include/std/std_bitset.h: Same. * include/std/std_set.h: Same. * include/std/std_vector.h: Same. * include/std/std_deque.h: Same. * include/std/std_utility.h: Same. * include/std/std_stack.h: Same. * include/std/std_string.h: Same. * include/std/std_list.h: Same. * include/std/std_map.h: Same. * libsupc++/typeinfo: Same. * libsupc++/exception: Same. * libsupc++/exception_defines.h: Same. * libsupc++/new: Same. * include/ext/bitmap_allocator.h: Change namespace __balloc to __detail. * src/bitmap_allocator.cc: Same. * include/bits/cpp_type_traits.h: Change __true_type and __false_type from global to namespace std scope. * include/ext/slist: Same. * include/ext/vstring.h: Same. * include/ext/vstring.tcc: Same. * include/ext/rc_string_base.h: Same. * include/ext/sso_string_base.h: Same. * include/bits/codecvt.h: Adjust markup so that correct namespace scope information is in all files. * include/bits/locale_facets.h: Same. Include ctype_base directly. * config/os/windiss/ctype_base.h: Add in namespace markup. * config/os/newlib/ctype_base.h: Same. * config/os/aix/ctype_base.h: Same. * config/os/vxworks/ctype_base.h: Same. * config/os/hpux/ctype_base.h: Same. * config/os/mingw32/ctype_base.h: Same. * config/os/gnu-linux/ctype_base.h: Same. * config/os/tpf/ctype_base.h: Same. * config/os/uclibc/ctype_base.h: Same. * config/os/djgpp/ctype_base.h: Same. * config/os/qnx/qnx6.1/ctype_base.h: Same. * config/os/bsd/netbsd/ctype_base.h: Same. * config/os/bsd/darwin/ctype_base.h: Same. * config/os/bsd/freebsd/ctype_base.h: Same. * config/os/irix/irix5.2/ctype_base.h: Same. * config/os/irix/irix6.5/ctype_base.h: Same. * config/os/solaris/solaris2.5/ctype_base.h: Same. * config/os/solaris/solaris2.6/ctype_base.h: Same. * config/os/solaris/solaris2.7/ctype_base.h: Same. * config/os/generic/ctype_base.h: Same. * include/tr1/mu_iterate.h: Same. * include/tr1/tuple: Same. * include/tr1/tuple_iterate.h: Same. * include/tr1/tuple_defs.h: Same. * include/tr1/random.tcc: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Line number changes. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * docs/doxygen/user.cfg.in: Update to doxygen 1.5.1. * docs/html/17_intro/license.html: Updated info for generated docs. * docs/doxygen/guide.html: Adjust. * docs/doxygen/run_doxygen: Adjust. * docs/doxygen/mainpage.html: Same. * docs/doxygen/doxygroups.cc: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/tables.html: Same. From-SVN: r119334
2006-11-29 21:59:22 +01:00
localefwd.h: Consistent @file placement... 2006-12-05 Benjamin Kosnik <bkoz@redhat.com> * include/bits/localefwd.h: Consistent @file placement, use include/ as part of the path for files that have shadows instead of no name. * include/bits/valarray_after.h: Same. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/locale_classes.h: Same. * include/bits/locale_facets.h: Same. * include/bits/indirect_array.h: Same. * include/bits/basic_string.h: Same. * include/bits/ios_base.h: Same. * include/bits/postypes.h: Same. * include/bits/codecvt.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/boost_concept_check.h: Same. * include/bits/char_traits.h: Same. * include/bits/stringfwd.h: Same. * include/bits/c++config: Same. * include/bits/valarray_array.h: Same. * include/bits/valarray_before.h: Same. * include/bits/cpp_type_traits.h: Same. * include/c/std_cerrno.h: Same. * include/precompiled/extc++.h: Same. * include/precompiled/stdtr1c++.h: Same. * include/precompiled/stdc++.h: Same. * include/tr1/cinttypes: Same. * include/tr1/fenv.h: Same. * include/tr1/mu_iterate.h: Same. * include/tr1/cstdio: Same. * include/tr1/limits.h: Same. * include/tr1/ctgmath: Same. * include/tr1/cstdarg: Same. * include/tr1/tuple: Same. * include/tr1/float.h: Same. * include/tr1/stdint.h: Same. * include/tr1/tuple_iterate.h: Same. * include/tr1/type_traits_fwd.h: Same. * include/tr1/hashtable_policy.h: Same. * include/tr1/cfenv: Same. * include/tr1/wctype.h: Same. * include/tr1/ref_fwd.h: Same. * include/tr1/bind_repeat.h: Same. * include/tr1/utility: Same. * include/tr1/climits: Same. * include/tr1/type_traits: Same. * include/tr1/stdlib.h: Same. * include/tr1/cwchar: Same. * include/tr1/stdio.h: Same. * include/tr1/ref_wrap_iterate.h: Same. * include/tr1/cstdint: Same. * include/tr1/memory: Same. * include/tr1/cstdbool: Same. * include/tr1/cwctype: Same. * include/tr1/bind_iterate.h: Same. * include/tr1/math.h: Same. * include/tr1/random: Same. * include/tr1/tuple_defs.h: Same. * include/tr1/cstdlib: Same. * include/tr1/unordered_map: Same. * include/tr1/boost_shared_ptr.h: Same. * include/tr1/cctype: Same. * include/tr1/random.tcc: Same. * include/tr1/wchar.h: Same. * include/tr1/hashtable: Same. * include/tr1/cmath: Same. * include/tr1/stdbool.h: Same. * include/tr1/ctime: Same. * include/tr1/functional: Same. * include/tr1/unordered_set: Same. * include/tr1/inttypes.h: Same. * include/tr1/functional_iterate.h: Same. * include/tr1/repeat.h: Same. * include/tr1/complex: Same. * include/tr1/cfloat: Same. * include/tr1/ctype.h: Same. * include/tr1/stdarg.h: Same. * include/tr1/tgmath.h: Same. * include/tr1/array: Same. * include/tr1/common.h: Same. * include/std/std_valarray.h: Same. * include/std/std_iostream.h: Same. * include/std/std_queue.h: Same. * include/std/std_algorithm.h: Same. * include/std/std_streambuf.h: Same. * include/std/std_iterator.h: Same. * include/std/std_ios.h: Same. * include/std/std_bitset.h: Same. * include/std/std_iosfwd.h: Same. * include/std/std_set.h: Same. * include/std/std_iomanip.h: Same. * include/std/std_fstream.h: Same. * include/std/std_functional.h: Same. * include/std/std_numeric.h: Same. * include/std/std_vector.h: Same. * include/std/std_deque.h: Same. * include/std/std_stdexcept.h: Same. * include/std/std_utility.h: Same. * include/std/std_stack.h: Same. * include/std/std_string.h: Same. * include/std/std_complex.h: Same. * include/std/std_memory.h: Same. * include/std/std_ostream.h: Same. * include/std/std_list.h: Same. * include/std/std_map.h: Same. * include/std/std_sstream.h: Same. * include/c_std/std_csignal.h: Same. * include/c_std/std_cstdlib.h: Same. * include/c_std/std_cstdio.h: Same. * include/c_std/std_cstdarg.h: Same. * include/c_std/std_cctype.h: Same. * include/c_std/std_cerrno.h: Same. * include/c_std/std_cmath.h: Same. * include/c_std/std_ctime.h: Same. * include/c_std/std_clocale.h: Same. * include/c_std/std_climits.h: Same. * include/c_std/std_cassert.h: Same. * include/c_std/cmath.tcc * include/c_std/std_csetjmp.h: Same. * include/c_std/std_cwchar.h: Same. * include/c_std/std_cfloat.h: Same. * include/c_std/std_cstring.h: Same. * include/c_std/std_cstddef.h: Same. * include/c_std/std_cwctype.h: Same. * config/locale/gnu/c_locale.h: Namespace scope in all files. * config/locale/gnu/messages_members.h: Same. * config/locale/gnu/c++locale_internal.h: Same. * config/locale/gnu/time_members.h: Same. * config/locale/ieee_1003.1-2001/c_locale.h: Same. * config/locale/ieee_1003.1-2001/messages_members.h: Same. * config/locale/generic/c_locale.h: Same. * config/locale/generic/messages_members.h: Same. * config/locale/generic/time_members.h: Same. * config/allocator/mt_allocator_base.h: Same. * config/allocator/malloc_allocator_base.h: Same. * config/allocator/new_allocator_base.h: Same. * config/allocator/pool_allocator_base.h: Same. * config/allocator/bitmap_allocator_base.h: Same. * config/os/windiss/ctype_noninline.h: Same. * config/os/windiss/os_defines.h: Same. * config/os/windiss/ctype_inline.h: Same. * config/os/newlib/ctype_noninline.h: Same. * config/os/newlib/os_defines.h: Same. * config/os/newlib/ctype_inline.h: Same. * config/os/aix/ctype_noninline.h: Same. * config/os/aix/os_defines.h: Same. * config/os/aix/ctype_inline.h: Same. * config/os/vxworks/ctype_noninline.h: Same. * config/os/vxworks/os_defines.h: Same. * config/os/vxworks/ctype_inline.h: Same. * config/os/hpux/ctype_noninline.h: Same. * config/os/hpux/os_defines.h: Same. * config/os/hpux/ctype_inline.h: Same. * config/os/mingw32/ctype_noninline.h: Same. * config/os/mingw32/os_defines.h: Same. * config/os/mingw32/ctype_inline.h: Same. * config/os/gnu-linux/ctype_noninline.h: Same. * config/os/gnu-linux/os_defines.h: Same. * config/os/gnu-linux/ctype_inline.h: Same. * config/os/tpf/ctype_noninline.h: Same. * config/os/tpf/os_defines.h: Same. * config/os/tpf/ctype_inline.h: Same. * config/os/uclibc/ctype_noninline.h: Same. * config/os/uclibc/os_defines.h: Same. * config/os/uclibc/ctype_inline.h: Same. * config/os/djgpp/ctype_noninline.h: Same. * config/os/djgpp/os_defines.h: Same. * config/os/djgpp/ctype_inline.h: Same. * config/os/qnx/qnx6.1/ctype_noninline.h: Same. * config/os/qnx/qnx6.1/ctype_inline.h: Same. * config/os/bsd/netbsd/ctype_noninline.h: Same. * config/os/bsd/netbsd/ctype_inline.h: Same. * config/os/bsd/darwin/ctype_noninline.h: Same. * config/os/bsd/darwin/ctype_inline.h: Same. * config/os/bsd/freebsd/ctype_noninline.h: Same. * config/os/bsd/freebsd/ctype_inline.h: Same. * config/os/irix/irix5.2/ctype_noninline.h: Same. * config/os/irix/irix5.2/ctype_inline.h: Same. * config/os/irix/irix6.5/ctype_noninline.h: Same. * config/os/irix/irix6.5/ctype_inline.h: Same. * config/os/solaris/solaris2.5/ctype_noninline.h: Same. * config/os/solaris/solaris2.5/ctype_inline.h: Same. * config/os/solaris/solaris2.6/ctype_noninline.h: Same. * config/os/solaris/solaris2.6/ctype_inline.h: Same. * config/os/solaris/solaris2.7/ctype_noninline.h: Same. * config/os/solaris/solaris2.7/ctype_inline.h: Same. * config/os/generic/ctype_noninline.h: Same. * config/os/generic/os_defines.h: Same. * config/os/generic/ctype_inline.h: Same. * config/cpu/arm/cxxabi_tweaks.h: Same. * config/cpu/powerpc/cpu_defines.h: Same. * config/cpu/generic/cxxabi_tweaks.h: Same. * config/cpu/generic/cpu_defines.h: Same. * config/cpu/generic/atomic_word.h: Same. * config/io/c_io_stdio.h: Same. * config/abi/compatibility.h: Same. * docs/doxygen/user.cfg.in: Adjust file list. From-SVN: r119561
2006-12-06 00:24:07 +01:00
// Include host and configuration specific ctype inlines.
#include <bits/ctype_inline.h>
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
Clean up initialization and simplfy caching of underlying "C" locale objects. 2001-12-14 Benjamin Kosnik <bkoz@redhat.com> Clean up initialization and simplfy caching of underlying "C" locale objects. * src/localename.cc (locale::_Impl::_Impl(string, size_t): Unconditionally create __clocale object for all named locales, including "C" and "POSIX". * config/locale/c_locale_generic.cc (locale::facet::_S_create_c_locale): Always set __cloc to zero. * config/locale/c_locale_gnu.cc: Always delete. * include/bits/localefwd.h (locale::facet::_S_c_locale): New. * src/locale.cc (locale::classic()): Initialize locale::facet::_S_c_locale. (locale::facet::_S_c_locale): Define. * include/bits/locale_facets.h: Add ctype_byname<wchar_t> ctor specialization. * src/locale.cc: Add definition here. * config/os/gnu-linux/bits/ctype_inline.h: Tweak. * config/os/gnu-linux/bits/ctype_noninline.h: Adjust initializations. * include/bits/locale_facets.h (ctype<char>::_M_c_locale_ctype): Add. Adjust ctors, dtors. (ctype<char>::_M_toupper): Remove const&. (ctype<char>::_M_tolower): Remove const&. (ctype<char>::_M_ctable): Remove const&. * include/bits/locale_facets.h (collate): Clean up initialization of _M_c_locale_collate in ctors and dtors. * config/locale/collate_members_gnu.cc: Always use extended functions. * include/bits/locale_facets.h (messages): Clean up inits in ctor/dtor. (messages_byname): Same. * config/locale/messages_members_generic.h (messages::~messages): Remove. * config/locale/messages_members_gnu.h: Same. * include/bits/localefwd.h: Clean. Move dtor definitions to * src/locale.cc: Here. * testsuite/22_locale/facet.cc: Fix spelling. Named locale support for ctype<wchar_t>. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add variable ctype_members_* bits. * aclocal.m4: Regenerate. * configure: Regenerate. * src/Makefile.am (sources): Add ctype.cc. * src/Makefile.in: Regenerate. * config/locale/ctype_members_generic.cc: New file. * config/locale/ctype_members_gnu.cc: New file. * src/locale.cc: Remove ctype<wchart_t> definitions. From-SVN: r48034
2001-12-15 08:05:04 +01:00
// 22.2.2 The numeric category.
class __num_base
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{
public:
// NB: Code depends on the order of _S_atoms_out elements.
// Below are the indices into _S_atoms_out.
enum
{
_S_ominus,
_S_oplus,
_S_ox,
_S_oX,
_S_odigits,
_S_odigits_end = _S_odigits + 16,
_S_oudigits = _S_odigits_end,
_S_oudigits_end = _S_oudigits + 16,
_S_oe = _S_odigits + 14, // For scientific notation, 'e'
_S_oE = _S_oudigits + 14, // For scientific notation, 'E'
_S_oend = _S_oudigits_end
};
// A list of valid numeric literals for output. This array
// contains chars that will be passed through the current locale's
// ctype<_CharT>.widen() and then used to render numbers.
// For the standard "C" locale, this is
// "-+xX0123456789abcdef0123456789ABCDEF".
static const char* _S_atoms_out;
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
// String literal of acceptable (narrow) input, for num_get.
// "-+xX0123456789abcdefABCDEF"
static const char* _S_atoms_in;
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
enum
{
_S_iminus,
_S_iplus,
_S_ix,
_S_iX,
_S_izero,
_S_ie = _S_izero + 14,
_S_iE = _S_izero + 20,
_S_iend = 26
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
};
Audit for LANG independence. 2002-01-22 Benjamin Kosnik <bkoz@redhat.com> Audit for LANG independence. * include/bits/localefwd.h: Tweaks. * include/bits/locale_facets.tcc (money_get::do_get(long double)): Use __convert_to_v. (time_get::do_get_year): Same. (__convert_from_v): Add. (num_put::_M_convert_float): Use. (num_put::_M_convert_int): Same. (money_put::do_put): Same. * src/locale-inst.cc: Add instantiations for __convert_from_v. * config/locale/time_members_gnu.cc: Cleanup setlocale usage. * config/locale/time_members_generic.cc: * config/locale/messages_members_gnu.cc: Same. * config/locale/messages_members_gnu.h: Same. * testsuite/22_locale/codecvt_members_wchar_t_char.cc (test02): New. * testsuite/22_locale/codecvt_members_char_char.cc (test02): New. * testsuite/22_locale/collate_members_wchar_t.cc (test02): New. * testsuite/22_locale/collate_members_char.cc (test02): New. * testsuite/22_locale/ctype_members_wchar_t.cc (test03): New. * testsuite/22_locale/ctype_members_char.cc (test03): New. * testsuite/22_locale/messages_members_char.cc (test02): New. * testsuite/22_locale/moneypunct_members_wchar_t.cc (test02): New. * testsuite/22_locale/moneypunct_members_char.cc (test02): New. * testsuite/22_locale/money_get_members_wchar_t.cc (test04): New. * testsuite/22_locale/money_get_members_char.cc (test04): New. * testsuite/22_locale/money_put_members_wchar_t.cc (test04): New. * testsuite/22_locale/money_put_members_char.cc (test04): New. * testsuite/22_locale/numpunct_members_wchar_t.cc (test02): New. * testsuite/22_locale/numpunct_members_char.cc (test02): New. * testsuite/22_locale/time_put_members_wchar_t.cc (test03): New. * testsuite/22_locale/time_put_members_char.cc (test03): New. * testsuite/22_locale/time_get_members_wchar_t.cc (test07): New. * testsuite/22_locale/time_get_members_char.cc (test07): New. * testsuite/22_locale/num_get_members_wchar_t.cc (test03): New. * testsuite/22_locale/num_get_members_char.cc (test03): New. * testsuite/22_locale/num_put_members_wchar_t.cc (test03): New. * testsuite/22_locale/num_put_members_char.cc (test03): New. * testsuite/22_locale/time_get_members_char.cc: Fixups for global locale issues. * testsuite/22_locale/time_get_members_char.cc: Same. 2002-01-22 Benjamin Kosnik <bkoz@redhat.com> libstdc++/5280 * include/bits/localefwd.h: Tweak comments. * include/bits/locale_facets.h (__convert_to_v): Add. * include/bits/locale_facets.tcc (num_get::do_get(double)): Use it. (num_get::do_get(float)): Same. (num_get::do_get(long double)): Same. (num_get::do_get(bool)): Same. (num_get::do_get(long)): Same. (num_get::do_get(long long)): Same. (num_get::do_get(unsigned int)): Same. (num_get::do_get(unsigned short)): Same. (num_get::do_get(unsigned long)): Same. (num_get::do_get(unsigned long long)): Same. * config/locale/c_locale_gnu.cc (__convert_to_v): Specialize. * config/locale/c_locale_generic.cc: Same. From-SVN: r49108
2002-01-23 00:09:04 +01:00
// num_put
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
// Construct and return valid scanf format for floating point types.
static void
_S_format_float(const ios_base& __io, char* __fptr, char __mod) throw();
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
};
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
template<typename _CharT>
struct __numpunct_cache : public locale::facet
{
const char* _M_grouping;
size_t _M_grouping_size;
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
bool _M_use_grouping;
const _CharT* _M_truename;
size_t _M_truename_size;
const _CharT* _M_falsename;
size_t _M_falsename_size;
_CharT _M_decimal_point;
_CharT _M_thousands_sep;
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
// A list of valid numeric literals for output: in the standard
// "C" locale, this is "-+xX0123456789abcdef0123456789ABCDEF".
// This array contains the chars after having been passed
// through the current locale's ctype<_CharT>.widen().
_CharT _M_atoms_out[__num_base::_S_oend];
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
// A list of valid numeric literals for input: in the standard
// "C" locale, this is "-+xX0123456789abcdefABCDEF"
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
// This array contains the chars after having been passed
// through the current locale's ctype<_CharT>.widen().
_CharT _M_atoms_in[__num_base::_S_iend];
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
bool _M_allocated;
c++config (std::size_t, [...]): Provide typedefs. 2010-06-03 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/c++config (std::size_t, std::ptrdiff_t, std::nullptr_t): Provide typedefs. * include/c_std/cstddef: Don't provide std::size_t and std::ptrdiff_t here. * include/c_global/cstddef: Likewise. * src/condition_variable.cc: Don't include <cstddef>, don't use NULL, use std::size_t and std::ptrdiff_t. * src/mt_allocator.cc: Likewise. * src/localename.cc: Likewise. * src/chrono.cc: Likewise. * src/thread.cc: Likewise. * include/debug/formatter.h: Likewise. * include/debug/functions.h: Likewise. * include/std/valarray: Likewise. * include/std/thread: Likewise. * include/std/type_traits: Likewise. * include/std/atomic: Likewise. * include/std/iterator: Likewise. * include/std/bitset: Likewise. * include/std/fstream: Likewise. * include/std/mutex: Likewise. * include/c_std/cstdlib: Likewise. * include/c_std/cstdio: Likewise. * include/c_std/ctime: Likewise. * include/c_std/cwchar: Likewise. * include/c_std/cstring: Likewise. * include/parallel/multiway_merge.h: Likewise. * include/parallel/multiseq_selection.h: Likewise. * include/parallel/base.h: Likewise. * include/parallel/basic_iterator.h: Likewise. * include/parallel/multiway_mergesort.h * include/parallel/partition.h: Likewise. * include/ext/string_conversions.h: Likewise. * include/ext/pb_ds/assoc_container.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_prime_size_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ sample_resize_policy.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ sample_resize_trigger.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/d: Likewise.etail/cc_hash_table_map_/ insert_no_store_hash_fn_imps.hpp * include/ext/pb_ds/detail/cc_hash_table_map_/ cmp_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ insert_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ entry_list_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ cc_ht_map_.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_no_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/child_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ insert_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ const_child_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/internal_node.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/point_iterators.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ r_erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ rotate_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ point_iterators.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ gp_ht_map_.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Likewise. * include/ext/pb_ds/detail/tree_policy/ sample_tree_node_update.hpp: Likewise. * include/ext/pb_ds/detail/basic_tree_policy/ null_node_metadata.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/trie_policy/ sample_trie_node_update.hpp: Likewise. * include/ext/pb_ds/detail/trie_policy/ sample_trie_e_access_traits.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_policy/ counter_lu_metadata.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ null_metadata.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/ sample_ranged_probe_fn.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/ sample_ranged_hash_fn.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp: Likewise. * include/ext/pb_ds/list_update_policy.hpp: Likewise. * include/ext/pb_ds/exception.hpp: Likewise. * include/ext/pb_ds/tree_policy.hpp: Likewise. * include/ext/pb_ds/tag_and_trait.hpp: Likewise. * include/ext/pb_ds/hash_policy.hpp: Likewise. * include/ext/pb_ds/trie_policy.hpp: Likewise. * include/ext/pb_ds/priority_queue.hpp: Likewise. * include/ext/throw_allocator.h: Likewis: Likewise.e. * include/ext/bitmap_allocator.h * include/ext/rc_string_base.h: Likewise. * include/ext/new_allocator.h: Likewise. * include/ext/codecvt_specializations.h: Likewise. * include/ext/functional: Likewise.: Likewise. * include/ext/array_allocator.h: Likewise. * include/ext/mt_allocator.h: Likewise. * include/ext/sso_string_base.h: Likewise. * include/profile/impl/profiler_trace.h: Likewise. * include/profile/impl/profiler_node.h: Likewise. * include/bits/stl_algobase.h: Likewise. * include/bits/functional_hash.h: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_facets.h: Likewise. * include/bits/stl_iterator_base_types.h: Likewise. * include/bits/move.h: Likewise. * include/bits/boost_concept_check.h: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/fstream.tcc: Likewise. * include/bits/locale_facets_nonio.h: Likewise. * include/c_global/cstdlib: Likewise. * include/c_global/cstdio: Likewise. * include/c_global/ctime: Likewise. * include/c_global/cwchar: Likewise. * include/c_global/cstring * include/tr1/type_traits: Likewise. * include/backward/hash_fun.h: Likewise. * libsupc++/new: Likewise. * libsupc++/initializer_list: Likewise. * testsuite/27_io/basic_ofstream/pthread2.cc: Likewise. * testsuite/27_io/basic_iostream/cons/2020.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetn/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetn/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/overflow/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/overflow/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetc/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetc/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/char/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputc/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/objects/wchar_t/5268.cc: Likewise. * testsuite/27_io/objects/char/9661-1.cc: Likewise. * testsuite/27_io/objects/char/5268.cc: Likewise. * testsuite/27_io/objects/char/10.cc: Likewise. * testsuite/27_io/basic_ios/copyfmt/char/1.cc: Likewise. * testsuite/27_io/basic_ios/copyfmt/char/2.cc: Likewise. * testsuite/27_io/basic_ios/exceptions/char/1.cc: Likewise. * testsuite/27_io/basic_ios/locales/char/1.cc: Likewise. * testsuite/27_io/basic_ios/clear/char/1.cc: Likewise. * testsuite/27_io/basic_ostringstream/pthread3.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputc/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputn/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputn/char/1057.cc: Likewise. * testsuite/27_io/basic_istream/get/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/get/char/1.cc: Likewise. * testsuite/27_io/basic_istream/ignore/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/ignore/char/1.cc: Likewise. * testsuite/27_io/basic_istream/peek/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/peek/char/1.cc: Likewise. * testsuite/27_io/basic_istream/getline/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/getline/char/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/wchar_t/ exceptions_null.cc * testsuite/27_io/basic_istream/extractors_other/wchar_t/ 1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/char/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/char/1.cc: Likewise. * testsuite/27_io/basic_istream/cons/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/ wchar_t/01.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/ char/01.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/2.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/2.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/9826.cc: Likewise. * testsuite/27_io/basic_istream/read/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/read/char/1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/ 1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/char/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/char/1.cc: Likewise. * testsuite/27_io/basic_ostream/cons/2020.cc: Likewise. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_character/ wchar_t/8.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_character/ char/8.cc: Likewise. * testsuite/27_io/basic_filebuf/setbuf/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/2.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/9507.cc: Likewise. * testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-1.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-2.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-3.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-4.cc: Likewise. * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/2.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/12790-3.cc: Likewise. * testsuite/27_io/basic_filebuf/sputn/char/1057.cc: Likewise. * testsuite/24_iterators/ostreambuf_iterator/2.cc: Likewise. * testsuite/18_support/bad_exception/23591_thread-1.c * testsuite/18_support/new_delete_placement.cc: Likewise. * testsuite/18_support/pthread_guard.cc: Likewise. * testsuite/21_strings/basic_string/operations/wchar_t/1.cc: Likewise. * testsuite/21_strings/basic_string/operations/char/1.cc: Likewise. * testsuite/21_strings/basic_string/pthread4.cc: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/5.cc: Likewise. * testsuite/21_strings/basic_string/cons/char/5.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/thread/cons/assign_neg.cc: Likewise. * testsuite/30_threads/thread/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/ assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/ copy_neg.cc: Likewise. * testsuite/ext/mt_allocator/22309_thread.cc: Likewise. * testsuite/ext/slist/23781.cc: Likewise. * testsuite/ext/rope/pthread7-rope.cc: Likewise. * testsuite/ext/stdio_filebuf/char/10063-2.cc: Likewise. * testsuite/22_locale/ctype/is/wchar_t/1.cc: Likewise. * testsuite/22_locale/ctype/is/char/1.cc: Likewise. * testsuite/22_locale/time_put/put/char/12439_1.cc: Likewise. * testsuite/22_locale/time_put/put/char/12439_3.cc: Likewise. * testsuite/22_locale/locale/cons/2.cc: Likewise. * testsuite/22_locale/locale/cons/12658_thread-1.cc: Likewise. * testsuite/22_locale/locale/cons/29217.cc: Likewise. * testsuite/22_locale/locale/global_locale_objects/14071.cc: Likewise. * testsuite/22_locale/locale/global_locale_objects/2.cc: Likewise. * testsuite/tr1/6_containers/unordered_multimap/ requirements/iterator_null_neg.cc: Likewise. * testsuite/tr1/6_containers/unordered_multiset/ requirements/iterator_null_neg.cc: Likewise. * testsuite/29_atomics/atomic_address/cons/single_value.cc: Likewise. * testsuite/29_atomics/atomic_address/cons/aggregate.cc: Likewise. * testsuite/23_containers/multimap/23781.cc: Likewise. * testsuite/23_containers/set/23781.cc: Likewise. * testsuite/23_containers/multiset/23781.cc: Likewise. * testsuite/23_containers/list/pthread1.cc: Likewise. * testsuite/23_containers/list/23781.cc: Likewise. * testsuite/23_containers/map/pthread6.cc: Likewise. * testsuite/23_containers/map/23781.cc: Likewise. * testsuite/util/regression/rand/priority_queue/ rand_regression_test.hpp: Likewise. * testsuite/util/regression/rand/priority_queue/ container_rand_regression_test.tcc: Likewise. * testsuite/util/regression/rand/assoc/ rand_regression_test.hpp: Likewise. * testsuite/util/regression/rand/assoc/ container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_hooks.cc: Likewise. * testsuite/util/testsuite_io.h: Likewise. * testsuite/util/testsuite_iterators.h: Likewise. * testsuite/util/replacement_memory_operators.h: Likewise. * testsuite/util/testsuite_allocator.h: Likewise. * testsuite/util/testsuite_performance.h: Likewise. From-SVN: r160231
2010-06-03 21:15:56 +02:00
__numpunct_cache(size_t __refs = 0)
: facet(__refs), _M_grouping(0), _M_grouping_size(0),
_M_use_grouping(false),
_M_truename(0), _M_truename_size(0), _M_falsename(0),
_M_falsename_size(0), _M_decimal_point(_CharT()),
_M_thousands_sep(_CharT()), _M_allocated(false)
{ }
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
~__numpunct_cache();
void
_M_cache(const locale& __loc);
re PR libstdc++/12854 (libstdc++ vs. -Weffc++) 2004-05-22 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/12854 Fixups for -Weffc++. * include/bits/basic_string.h (basic_string::operator=): Return pointer to this instead of result of assign. Although redundant, this doesn't impact resultant codegen. * include/bits/locale_facets.h (__numpunct_cache): Declare assignment opxserator and copy constructor private. (__timepunct_cache): Same. (__moneypunct_cache): Same. (collate): Use member initialization list for _M_c_locale_collate. * config/locale/gnu/messages_members.h: Same. * config/locale/gnu/time_members.h (__timepunct): Same. * src/codecvt.cc: Use member initialization list to initialize _M_c_locale_codecvt. * src/ctype.cc: Same, with _M_c_locale_ctype and _M_narrow_ok. * config/os/gnu-linux/ctype_noninline.h: Same. * src/locale.cc (_Impl): Same. * src/locale_init.cc: Same. * src/localename.cc: Same. * include/bits/basic_ios.h (basic_ios): Complete member initialization list. * include/bits/istream.tcc (basic_istream::sentry): Same. * include/bits/ostream.tcc (basic_ostream::sentry): Same. * include/bits/fstream.tcc (basic_filebuf): Add _M_lock and _M_pback to member initialization list. * include/std/std_streambuf.h: Same. * include/std/std_sstream.h: Same, for _M_mode. * src/ios.cc (ios_base): Same. * include/ext/rope: Make derived classes match exception specifications. Add copy constructors and assignment operators. * include/debug/safe_base.h (_Safe_sequence_base): Declare copy constructor and assignment operator protected. (_Safe_iterator_base): Same. * include/debug/formatter.h (_Error_formatter): Define copy constructor and assignment operator. * include/backward/strstream: Declare assignment operator and copy constructor private. From-SVN: r82153
2004-05-23 01:46:34 +02:00
private:
__numpunct_cache&
operator=(const __numpunct_cache&);
explicit
__numpunct_cache(const __numpunct_cache&);
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
};
template<typename _CharT>
__numpunct_cache<_CharT>::~__numpunct_cache()
{
if (_M_allocated)
{
delete [] _M_grouping;
delete [] _M_truename;
delete [] _M_falsename;
}
}
Audit for LANG independence. 2002-01-22 Benjamin Kosnik <bkoz@redhat.com> Audit for LANG independence. * include/bits/localefwd.h: Tweaks. * include/bits/locale_facets.tcc (money_get::do_get(long double)): Use __convert_to_v. (time_get::do_get_year): Same. (__convert_from_v): Add. (num_put::_M_convert_float): Use. (num_put::_M_convert_int): Same. (money_put::do_put): Same. * src/locale-inst.cc: Add instantiations for __convert_from_v. * config/locale/time_members_gnu.cc: Cleanup setlocale usage. * config/locale/time_members_generic.cc: * config/locale/messages_members_gnu.cc: Same. * config/locale/messages_members_gnu.h: Same. * testsuite/22_locale/codecvt_members_wchar_t_char.cc (test02): New. * testsuite/22_locale/codecvt_members_char_char.cc (test02): New. * testsuite/22_locale/collate_members_wchar_t.cc (test02): New. * testsuite/22_locale/collate_members_char.cc (test02): New. * testsuite/22_locale/ctype_members_wchar_t.cc (test03): New. * testsuite/22_locale/ctype_members_char.cc (test03): New. * testsuite/22_locale/messages_members_char.cc (test02): New. * testsuite/22_locale/moneypunct_members_wchar_t.cc (test02): New. * testsuite/22_locale/moneypunct_members_char.cc (test02): New. * testsuite/22_locale/money_get_members_wchar_t.cc (test04): New. * testsuite/22_locale/money_get_members_char.cc (test04): New. * testsuite/22_locale/money_put_members_wchar_t.cc (test04): New. * testsuite/22_locale/money_put_members_char.cc (test04): New. * testsuite/22_locale/numpunct_members_wchar_t.cc (test02): New. * testsuite/22_locale/numpunct_members_char.cc (test02): New. * testsuite/22_locale/time_put_members_wchar_t.cc (test03): New. * testsuite/22_locale/time_put_members_char.cc (test03): New. * testsuite/22_locale/time_get_members_wchar_t.cc (test07): New. * testsuite/22_locale/time_get_members_char.cc (test07): New. * testsuite/22_locale/num_get_members_wchar_t.cc (test03): New. * testsuite/22_locale/num_get_members_char.cc (test03): New. * testsuite/22_locale/num_put_members_wchar_t.cc (test03): New. * testsuite/22_locale/num_put_members_char.cc (test03): New. * testsuite/22_locale/time_get_members_char.cc: Fixups for global locale issues. * testsuite/22_locale/time_get_members_char.cc: Same. 2002-01-22 Benjamin Kosnik <bkoz@redhat.com> libstdc++/5280 * include/bits/localefwd.h: Tweak comments. * include/bits/locale_facets.h (__convert_to_v): Add. * include/bits/locale_facets.tcc (num_get::do_get(double)): Use it. (num_get::do_get(float)): Same. (num_get::do_get(long double)): Same. (num_get::do_get(bool)): Same. (num_get::do_get(long)): Same. (num_get::do_get(long long)): Same. (num_get::do_get(unsigned int)): Same. (num_get::do_get(unsigned short)): Same. (num_get::do_get(unsigned long)): Same. (num_get::do_get(unsigned long long)): Same. * config/locale/c_locale_gnu.cc (__convert_to_v): Specialize. * config/locale/c_locale_generic.cc: Same. From-SVN: r49108
2002-01-23 00:09:04 +01:00
/**
* @brief Primary class template numpunct.
* @ingroup locales
*
* This facet stores several pieces of information related to printing and
* scanning numbers, such as the decimal point character. It takes a
* template parameter specifying the char type. The numpunct facet is
* used by streams for many I/O operations involving numbers.
*
* The numpunct template uses protected virtual functions to provide the
* actual results. The public accessors forward the call to the virtual
* functions. These virtual functions are hooks for developers to
* implement the behavior they require from a numpunct facet.
*/
template<typename _CharT>
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
class numpunct : public locale::facet
{
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
public:
// Types:
//@{
/// Public typedefs
typedef _CharT char_type;
typedef basic_string<_CharT> string_type;
//@}
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
typedef __numpunct_cache<_CharT> __cache_type;
protected:
__cache_type* _M_data;
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
public:
/// Numpunct facet id.
static locale::id id;
/**
* @brief Numpunct constructor.
*
* @param refs Refcount to pass to the base class.
*/
explicit
c++config (std::size_t, [...]): Provide typedefs. 2010-06-03 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/c++config (std::size_t, std::ptrdiff_t, std::nullptr_t): Provide typedefs. * include/c_std/cstddef: Don't provide std::size_t and std::ptrdiff_t here. * include/c_global/cstddef: Likewise. * src/condition_variable.cc: Don't include <cstddef>, don't use NULL, use std::size_t and std::ptrdiff_t. * src/mt_allocator.cc: Likewise. * src/localename.cc: Likewise. * src/chrono.cc: Likewise. * src/thread.cc: Likewise. * include/debug/formatter.h: Likewise. * include/debug/functions.h: Likewise. * include/std/valarray: Likewise. * include/std/thread: Likewise. * include/std/type_traits: Likewise. * include/std/atomic: Likewise. * include/std/iterator: Likewise. * include/std/bitset: Likewise. * include/std/fstream: Likewise. * include/std/mutex: Likewise. * include/c_std/cstdlib: Likewise. * include/c_std/cstdio: Likewise. * include/c_std/ctime: Likewise. * include/c_std/cwchar: Likewise. * include/c_std/cstring: Likewise. * include/parallel/multiway_merge.h: Likewise. * include/parallel/multiseq_selection.h: Likewise. * include/parallel/base.h: Likewise. * include/parallel/basic_iterator.h: Likewise. * include/parallel/multiway_mergesort.h * include/parallel/partition.h: Likewise. * include/ext/string_conversions.h: Likewise. * include/ext/pb_ds/assoc_container.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_prime_size_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ sample_resize_policy.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ sample_resize_trigger.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/d: Likewise.etail/cc_hash_table_map_/ insert_no_store_hash_fn_imps.hpp * include/ext/pb_ds/detail/cc_hash_table_map_/ cmp_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ insert_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ entry_list_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ cc_ht_map_.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_no_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/child_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ insert_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ const_child_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/internal_node.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/point_iterators.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ r_erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ rotate_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ point_iterators.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ gp_ht_map_.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Likewise. * include/ext/pb_ds/detail/tree_policy/ sample_tree_node_update.hpp: Likewise. * include/ext/pb_ds/detail/basic_tree_policy/ null_node_metadata.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/trie_policy/ sample_trie_node_update.hpp: Likewise. * include/ext/pb_ds/detail/trie_policy/ sample_trie_e_access_traits.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_policy/ counter_lu_metadata.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ null_metadata.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/ sample_ranged_probe_fn.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/ sample_ranged_hash_fn.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp: Likewise. * include/ext/pb_ds/list_update_policy.hpp: Likewise. * include/ext/pb_ds/exception.hpp: Likewise. * include/ext/pb_ds/tree_policy.hpp: Likewise. * include/ext/pb_ds/tag_and_trait.hpp: Likewise. * include/ext/pb_ds/hash_policy.hpp: Likewise. * include/ext/pb_ds/trie_policy.hpp: Likewise. * include/ext/pb_ds/priority_queue.hpp: Likewise. * include/ext/throw_allocator.h: Likewis: Likewise.e. * include/ext/bitmap_allocator.h * include/ext/rc_string_base.h: Likewise. * include/ext/new_allocator.h: Likewise. * include/ext/codecvt_specializations.h: Likewise. * include/ext/functional: Likewise.: Likewise. * include/ext/array_allocator.h: Likewise. * include/ext/mt_allocator.h: Likewise. * include/ext/sso_string_base.h: Likewise. * include/profile/impl/profiler_trace.h: Likewise. * include/profile/impl/profiler_node.h: Likewise. * include/bits/stl_algobase.h: Likewise. * include/bits/functional_hash.h: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_facets.h: Likewise. * include/bits/stl_iterator_base_types.h: Likewise. * include/bits/move.h: Likewise. * include/bits/boost_concept_check.h: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/fstream.tcc: Likewise. * include/bits/locale_facets_nonio.h: Likewise. * include/c_global/cstdlib: Likewise. * include/c_global/cstdio: Likewise. * include/c_global/ctime: Likewise. * include/c_global/cwchar: Likewise. * include/c_global/cstring * include/tr1/type_traits: Likewise. * include/backward/hash_fun.h: Likewise. * libsupc++/new: Likewise. * libsupc++/initializer_list: Likewise. * testsuite/27_io/basic_ofstream/pthread2.cc: Likewise. * testsuite/27_io/basic_iostream/cons/2020.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetn/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetn/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/overflow/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/overflow/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetc/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetc/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/char/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputc/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/objects/wchar_t/5268.cc: Likewise. * testsuite/27_io/objects/char/9661-1.cc: Likewise. * testsuite/27_io/objects/char/5268.cc: Likewise. * testsuite/27_io/objects/char/10.cc: Likewise. * testsuite/27_io/basic_ios/copyfmt/char/1.cc: Likewise. * testsuite/27_io/basic_ios/copyfmt/char/2.cc: Likewise. * testsuite/27_io/basic_ios/exceptions/char/1.cc: Likewise. * testsuite/27_io/basic_ios/locales/char/1.cc: Likewise. * testsuite/27_io/basic_ios/clear/char/1.cc: Likewise. * testsuite/27_io/basic_ostringstream/pthread3.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputc/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputn/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputn/char/1057.cc: Likewise. * testsuite/27_io/basic_istream/get/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/get/char/1.cc: Likewise. * testsuite/27_io/basic_istream/ignore/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/ignore/char/1.cc: Likewise. * testsuite/27_io/basic_istream/peek/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/peek/char/1.cc: Likewise. * testsuite/27_io/basic_istream/getline/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/getline/char/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/wchar_t/ exceptions_null.cc * testsuite/27_io/basic_istream/extractors_other/wchar_t/ 1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/char/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/char/1.cc: Likewise. * testsuite/27_io/basic_istream/cons/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/ wchar_t/01.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/ char/01.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/2.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/2.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/9826.cc: Likewise. * testsuite/27_io/basic_istream/read/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/read/char/1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/ 1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/char/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/char/1.cc: Likewise. * testsuite/27_io/basic_ostream/cons/2020.cc: Likewise. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_character/ wchar_t/8.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_character/ char/8.cc: Likewise. * testsuite/27_io/basic_filebuf/setbuf/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/2.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/9507.cc: Likewise. * testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-1.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-2.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-3.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-4.cc: Likewise. * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/2.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/12790-3.cc: Likewise. * testsuite/27_io/basic_filebuf/sputn/char/1057.cc: Likewise. * testsuite/24_iterators/ostreambuf_iterator/2.cc: Likewise. * testsuite/18_support/bad_exception/23591_thread-1.c * testsuite/18_support/new_delete_placement.cc: Likewise. * testsuite/18_support/pthread_guard.cc: Likewise. * testsuite/21_strings/basic_string/operations/wchar_t/1.cc: Likewise. * testsuite/21_strings/basic_string/operations/char/1.cc: Likewise. * testsuite/21_strings/basic_string/pthread4.cc: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/5.cc: Likewise. * testsuite/21_strings/basic_string/cons/char/5.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/thread/cons/assign_neg.cc: Likewise. * testsuite/30_threads/thread/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/ assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/ copy_neg.cc: Likewise. * testsuite/ext/mt_allocator/22309_thread.cc: Likewise. * testsuite/ext/slist/23781.cc: Likewise. * testsuite/ext/rope/pthread7-rope.cc: Likewise. * testsuite/ext/stdio_filebuf/char/10063-2.cc: Likewise. * testsuite/22_locale/ctype/is/wchar_t/1.cc: Likewise. * testsuite/22_locale/ctype/is/char/1.cc: Likewise. * testsuite/22_locale/time_put/put/char/12439_1.cc: Likewise. * testsuite/22_locale/time_put/put/char/12439_3.cc: Likewise. * testsuite/22_locale/locale/cons/2.cc: Likewise. * testsuite/22_locale/locale/cons/12658_thread-1.cc: Likewise. * testsuite/22_locale/locale/cons/29217.cc: Likewise. * testsuite/22_locale/locale/global_locale_objects/14071.cc: Likewise. * testsuite/22_locale/locale/global_locale_objects/2.cc: Likewise. * testsuite/tr1/6_containers/unordered_multimap/ requirements/iterator_null_neg.cc: Likewise. * testsuite/tr1/6_containers/unordered_multiset/ requirements/iterator_null_neg.cc: Likewise. * testsuite/29_atomics/atomic_address/cons/single_value.cc: Likewise. * testsuite/29_atomics/atomic_address/cons/aggregate.cc: Likewise. * testsuite/23_containers/multimap/23781.cc: Likewise. * testsuite/23_containers/set/23781.cc: Likewise. * testsuite/23_containers/multiset/23781.cc: Likewise. * testsuite/23_containers/list/pthread1.cc: Likewise. * testsuite/23_containers/list/23781.cc: Likewise. * testsuite/23_containers/map/pthread6.cc: Likewise. * testsuite/23_containers/map/23781.cc: Likewise. * testsuite/util/regression/rand/priority_queue/ rand_regression_test.hpp: Likewise. * testsuite/util/regression/rand/priority_queue/ container_rand_regression_test.tcc: Likewise. * testsuite/util/regression/rand/assoc/ rand_regression_test.hpp: Likewise. * testsuite/util/regression/rand/assoc/ container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_hooks.cc: Likewise. * testsuite/util/testsuite_io.h: Likewise. * testsuite/util/testsuite_iterators.h: Likewise. * testsuite/util/replacement_memory_operators.h: Likewise. * testsuite/util/testsuite_allocator.h: Likewise. * testsuite/util/testsuite_performance.h: Likewise. From-SVN: r160231
2010-06-03 21:15:56 +02:00
numpunct(size_t __refs = 0)
: facet(__refs), _M_data(0)
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
{ _M_initialize_numpunct(); }
/**
* @brief Internal constructor. Not for general use.
*
* This is a constructor for use by the library itself to set up the
* predefined locale facets.
*
* @param cache __numpunct_cache object.
* @param refs Refcount to pass to the base class.
*/
explicit
numpunct(__cache_type* __cache, size_t __refs = 0)
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
: facet(__refs), _M_data(__cache)
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ _M_initialize_numpunct(); }
/**
* @brief Internal constructor. Not for general use.
*
* This is a constructor for use by the library itself to set up new
* locales.
*
re PR libstdc++/42460 (man page errors for generated libstdc++ man pages) 2010-02-04 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/42460 * doc/doxygen/user.cfg.in: Update file list. * include/debug/safe_sequence.h: Doxygen markup fixes for '' and "". * include/debug/safe_base.h: Same. * include/debug/macros.h: Same. * include/tr1_impl/regex: Same. * include/std/iostream: Same. * include/std/streambuf: Same. * include/std/bitset: Same. * include/std/iosfwd: Same. * include/std/limits: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/parallel/multiway_merge.h: Same. * include/parallel/for_each.h: Same. * include/parallel/workstealing.h: Same. * include/parallel/omp_loop_static.h: Same. * include/parallel/omp_loop.h: Same. * include/c_std/csignal: Same. * include/c_std/cstdlib: Same. * include/c_std/cstdio: Same. * include/c_std/cstdarg: Same. * include/c_std/cctype: Same. * include/c_std/cerrno: Same. * include/c_std/cmath: Same. * include/c_std/ciso646: Same. * include/c_std/ctime: Same. * include/c_std/clocale: Same. * include/c_std/climits: Same. * include/c_std/cassert: Same. * include/c_std/csetjmp: Same. * include/c_std/cwchar: Same. * include/c_std/cfloat: Same. * include/c_std/cstring: Same. * include/c_std/cstddef: Same. * include/c_std/cwctype: Same. * include/profile/iterator_tracker.h: Same. * include/profile/impl/profiler_trace.h: Same. * include/ext/vstring.h: Same. * include/ext/algorithm: Same. * include/ext/pb_ds/detail/pat_trie_/pat_trie_.h.pp: Same. * include/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.h.pp: Same. * include/ext/pb_ds/detail/type_utils.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp: Same * include/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp: Same. * include/ext/rc_string_base.h: Same. * include/ext/stdio_sync_filebuf.h: Same. * include/ext/functional: Same. * include/ext/mt_allocator.h: Same. * include/bits/basic_ios.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_algobase.h: Same. * include/bits/stl_queue.h: Same. * include/bits/locale_classes.h: Same. * include/bits/stl_set.h: Same. * include/bits/locale_facets.h: Same. * include/bits/stl_stack.h: Same. * include/bits/stl_iterator_base_types.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/ios_base.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_iterator_base_funcs.h: Same. * include/bits/char_traits.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_tempbuf.h: Same. * include/bits/random.tcc: Same. * include/bits/stl_function.h: Same. * include/bits/cpp_type_traits.h: Same. * include/bits/random.h: Same. * include/bits/allocator.h: Same. * include/bits/locale_facets_nonio.h: Same. * include/c_global/csignal: Same. * include/c_global/cstdlib: Same. * include/c_global/cstdio: Same. * include/c_global/cstdarg: Same. * include/c_global/cctype: Same. * include/c_global/cerrno: Same. * include/c_global/cmath: Same. * include/c_global/ciso646: Same. * include/c_global/ctime: Same. * include/c_global/clocale: Same. * include/c_global/climits: Same. * include/c_global/cassert: Same. * include/c_global/csetjmp: Same. * include/c_global/cwchar: Same. * include/c_global/cfloat: Same. * include/c_global/cstring: Same. * include/c_global/cstddef: Same. * include/c_global/cwctype: Same. * include/tr1/hypergeometric.tcc: Same. * include/tr1/random.tcc: Same. * include/tr1/functional: Same. * include/tr1/random.h: Same. * include/backward/auto_ptr.h: Same. * include/backward/binders.h: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust line numbers. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc: Same. From-SVN: r156502
2010-02-04 19:20:34 +01:00
* @param cloc The C locale.
* @param refs Refcount to pass to the base class.
*/
explicit
numpunct(__c_locale __cloc, size_t __refs = 0)
c++config (std::size_t, [...]): Provide typedefs. 2010-06-03 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/c++config (std::size_t, std::ptrdiff_t, std::nullptr_t): Provide typedefs. * include/c_std/cstddef: Don't provide std::size_t and std::ptrdiff_t here. * include/c_global/cstddef: Likewise. * src/condition_variable.cc: Don't include <cstddef>, don't use NULL, use std::size_t and std::ptrdiff_t. * src/mt_allocator.cc: Likewise. * src/localename.cc: Likewise. * src/chrono.cc: Likewise. * src/thread.cc: Likewise. * include/debug/formatter.h: Likewise. * include/debug/functions.h: Likewise. * include/std/valarray: Likewise. * include/std/thread: Likewise. * include/std/type_traits: Likewise. * include/std/atomic: Likewise. * include/std/iterator: Likewise. * include/std/bitset: Likewise. * include/std/fstream: Likewise. * include/std/mutex: Likewise. * include/c_std/cstdlib: Likewise. * include/c_std/cstdio: Likewise. * include/c_std/ctime: Likewise. * include/c_std/cwchar: Likewise. * include/c_std/cstring: Likewise. * include/parallel/multiway_merge.h: Likewise. * include/parallel/multiseq_selection.h: Likewise. * include/parallel/base.h: Likewise. * include/parallel/basic_iterator.h: Likewise. * include/parallel/multiway_mergesort.h * include/parallel/partition.h: Likewise. * include/ext/string_conversions.h: Likewise. * include/ext/pb_ds/assoc_container.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_prime_size_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ sample_resize_policy.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ sample_resize_trigger.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/d: Likewise.etail/cc_hash_table_map_/ insert_no_store_hash_fn_imps.hpp * include/ext/pb_ds/detail/cc_hash_table_map_/ cmp_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ insert_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ entry_list_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ cc_ht_map_.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_no_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/child_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ insert_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ const_child_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/internal_node.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/point_iterators.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ r_erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ rotate_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ point_iterators.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ gp_ht_map_.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Likewise. * include/ext/pb_ds/detail/tree_policy/ sample_tree_node_update.hpp: Likewise. * include/ext/pb_ds/detail/basic_tree_policy/ null_node_metadata.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/trie_policy/ sample_trie_node_update.hpp: Likewise. * include/ext/pb_ds/detail/trie_policy/ sample_trie_e_access_traits.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_policy/ counter_lu_metadata.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ null_metadata.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/ sample_ranged_probe_fn.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/ sample_ranged_hash_fn.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp: Likewise. * include/ext/pb_ds/list_update_policy.hpp: Likewise. * include/ext/pb_ds/exception.hpp: Likewise. * include/ext/pb_ds/tree_policy.hpp: Likewise. * include/ext/pb_ds/tag_and_trait.hpp: Likewise. * include/ext/pb_ds/hash_policy.hpp: Likewise. * include/ext/pb_ds/trie_policy.hpp: Likewise. * include/ext/pb_ds/priority_queue.hpp: Likewise. * include/ext/throw_allocator.h: Likewis: Likewise.e. * include/ext/bitmap_allocator.h * include/ext/rc_string_base.h: Likewise. * include/ext/new_allocator.h: Likewise. * include/ext/codecvt_specializations.h: Likewise. * include/ext/functional: Likewise.: Likewise. * include/ext/array_allocator.h: Likewise. * include/ext/mt_allocator.h: Likewise. * include/ext/sso_string_base.h: Likewise. * include/profile/impl/profiler_trace.h: Likewise. * include/profile/impl/profiler_node.h: Likewise. * include/bits/stl_algobase.h: Likewise. * include/bits/functional_hash.h: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_facets.h: Likewise. * include/bits/stl_iterator_base_types.h: Likewise. * include/bits/move.h: Likewise. * include/bits/boost_concept_check.h: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/fstream.tcc: Likewise. * include/bits/locale_facets_nonio.h: Likewise. * include/c_global/cstdlib: Likewise. * include/c_global/cstdio: Likewise. * include/c_global/ctime: Likewise. * include/c_global/cwchar: Likewise. * include/c_global/cstring * include/tr1/type_traits: Likewise. * include/backward/hash_fun.h: Likewise. * libsupc++/new: Likewise. * libsupc++/initializer_list: Likewise. * testsuite/27_io/basic_ofstream/pthread2.cc: Likewise. * testsuite/27_io/basic_iostream/cons/2020.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetn/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetn/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/overflow/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/overflow/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetc/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetc/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/char/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputc/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/objects/wchar_t/5268.cc: Likewise. * testsuite/27_io/objects/char/9661-1.cc: Likewise. * testsuite/27_io/objects/char/5268.cc: Likewise. * testsuite/27_io/objects/char/10.cc: Likewise. * testsuite/27_io/basic_ios/copyfmt/char/1.cc: Likewise. * testsuite/27_io/basic_ios/copyfmt/char/2.cc: Likewise. * testsuite/27_io/basic_ios/exceptions/char/1.cc: Likewise. * testsuite/27_io/basic_ios/locales/char/1.cc: Likewise. * testsuite/27_io/basic_ios/clear/char/1.cc: Likewise. * testsuite/27_io/basic_ostringstream/pthread3.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputc/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputn/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputn/char/1057.cc: Likewise. * testsuite/27_io/basic_istream/get/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/get/char/1.cc: Likewise. * testsuite/27_io/basic_istream/ignore/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/ignore/char/1.cc: Likewise. * testsuite/27_io/basic_istream/peek/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/peek/char/1.cc: Likewise. * testsuite/27_io/basic_istream/getline/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/getline/char/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/wchar_t/ exceptions_null.cc * testsuite/27_io/basic_istream/extractors_other/wchar_t/ 1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/char/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/char/1.cc: Likewise. * testsuite/27_io/basic_istream/cons/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/ wchar_t/01.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/ char/01.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/2.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/2.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/9826.cc: Likewise. * testsuite/27_io/basic_istream/read/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/read/char/1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/ 1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/char/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/char/1.cc: Likewise. * testsuite/27_io/basic_ostream/cons/2020.cc: Likewise. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_character/ wchar_t/8.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_character/ char/8.cc: Likewise. * testsuite/27_io/basic_filebuf/setbuf/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/2.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/9507.cc: Likewise. * testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-1.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-2.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-3.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-4.cc: Likewise. * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/2.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/12790-3.cc: Likewise. * testsuite/27_io/basic_filebuf/sputn/char/1057.cc: Likewise. * testsuite/24_iterators/ostreambuf_iterator/2.cc: Likewise. * testsuite/18_support/bad_exception/23591_thread-1.c * testsuite/18_support/new_delete_placement.cc: Likewise. * testsuite/18_support/pthread_guard.cc: Likewise. * testsuite/21_strings/basic_string/operations/wchar_t/1.cc: Likewise. * testsuite/21_strings/basic_string/operations/char/1.cc: Likewise. * testsuite/21_strings/basic_string/pthread4.cc: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/5.cc: Likewise. * testsuite/21_strings/basic_string/cons/char/5.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/thread/cons/assign_neg.cc: Likewise. * testsuite/30_threads/thread/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/ assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/ copy_neg.cc: Likewise. * testsuite/ext/mt_allocator/22309_thread.cc: Likewise. * testsuite/ext/slist/23781.cc: Likewise. * testsuite/ext/rope/pthread7-rope.cc: Likewise. * testsuite/ext/stdio_filebuf/char/10063-2.cc: Likewise. * testsuite/22_locale/ctype/is/wchar_t/1.cc: Likewise. * testsuite/22_locale/ctype/is/char/1.cc: Likewise. * testsuite/22_locale/time_put/put/char/12439_1.cc: Likewise. * testsuite/22_locale/time_put/put/char/12439_3.cc: Likewise. * testsuite/22_locale/locale/cons/2.cc: Likewise. * testsuite/22_locale/locale/cons/12658_thread-1.cc: Likewise. * testsuite/22_locale/locale/cons/29217.cc: Likewise. * testsuite/22_locale/locale/global_locale_objects/14071.cc: Likewise. * testsuite/22_locale/locale/global_locale_objects/2.cc: Likewise. * testsuite/tr1/6_containers/unordered_multimap/ requirements/iterator_null_neg.cc: Likewise. * testsuite/tr1/6_containers/unordered_multiset/ requirements/iterator_null_neg.cc: Likewise. * testsuite/29_atomics/atomic_address/cons/single_value.cc: Likewise. * testsuite/29_atomics/atomic_address/cons/aggregate.cc: Likewise. * testsuite/23_containers/multimap/23781.cc: Likewise. * testsuite/23_containers/set/23781.cc: Likewise. * testsuite/23_containers/multiset/23781.cc: Likewise. * testsuite/23_containers/list/pthread1.cc: Likewise. * testsuite/23_containers/list/23781.cc: Likewise. * testsuite/23_containers/map/pthread6.cc: Likewise. * testsuite/23_containers/map/23781.cc: Likewise. * testsuite/util/regression/rand/priority_queue/ rand_regression_test.hpp: Likewise. * testsuite/util/regression/rand/priority_queue/ container_rand_regression_test.tcc: Likewise. * testsuite/util/regression/rand/assoc/ rand_regression_test.hpp: Likewise. * testsuite/util/regression/rand/assoc/ container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_hooks.cc: Likewise. * testsuite/util/testsuite_io.h: Likewise. * testsuite/util/testsuite_iterators.h: Likewise. * testsuite/util/replacement_memory_operators.h: Likewise. * testsuite/util/testsuite_allocator.h: Likewise. * testsuite/util/testsuite_performance.h: Likewise. From-SVN: r160231
2010-06-03 21:15:56 +02:00
: facet(__refs), _M_data(0)
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ _M_initialize_numpunct(__cloc); }
/**
* @brief Return decimal point character.
*
* This function returns a char_type to use as a decimal point. It
* does so by returning returning
* numpunct<char_type>::do_decimal_point().
*
* @return @a char_type representing a decimal point.
*/
char_type
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
decimal_point() const
{ return this->do_decimal_point(); }
/**
* @brief Return thousands separator character.
*
* This function returns a char_type to use as a thousands
* separator. It does so by returning returning
* numpunct<char_type>::do_thousands_sep().
*
* @return char_type representing a thousands separator.
*/
char_type
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
thousands_sep() const
{ return this->do_thousands_sep(); }
/**
* @brief Return grouping specification.
*
* This function returns a string representing groupings for the
* integer part of a number. Groupings indicate where thousands
* separators should be inserted in the integer part of a number.
*
* Each char in the return string is interpret as an integer
* rather than a character. These numbers represent the number
* of digits in a group. The first char in the string
* represents the number of digits in the least significant
* group. If a char is negative, it indicates an unlimited
* number of digits for the group. If more chars from the
* string are required to group a number, the last char is used
* repeatedly.
*
* For example, if the grouping() returns "\003\002" and is
* applied to the number 123456789, this corresponds to
* 12,34,56,789. Note that if the string was "32", this would
* put more than 50 digits into the least significant group if
* the character set is ASCII.
*
* The string is returned by calling
* numpunct<char_type>::do_grouping().
*
* @return string representing grouping specification.
*/
string
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
grouping() const
{ return this->do_grouping(); }
/**
* @brief Return string representation of bool true.
*
* This function returns a string_type containing the text
* representation for true bool variables. It does so by calling
* numpunct<char_type>::do_truename().
*
* @return string_type representing printed form of true.
*/
string_type
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
truename() const
{ return this->do_truename(); }
/**
* @brief Return string representation of bool false.
*
* This function returns a string_type containing the text
* representation for false bool variables. It does so by calling
* numpunct<char_type>::do_falsename().
*
* @return string_type representing printed form of false.
*/
string_type
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
falsename() const
{ return this->do_falsename(); }
protected:
/// Destructor.
virtual
re PR libstdc++/4164 (33 Memory Leak when using iostream) 2002-04-15 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/4164 Valgrind fixes. * config/io/basic_file_stdio.cc (__basic_file::~__basic_file): Call close. (__basic_file::close): Call fflush. Correct return if fclose ok. (__basic_file::is_open): Make const. Change __c_file_type to __c_file. * config/io/basic_file_stdio.h: Change __c_file_type to __c_file. (__basic_file::is_open): Make const. * config/io/c_io_stdio.h: Change __c_file_type to __c_file. * include/std/std_fstream.h (filebuf::_M_allocate_file): Remove. (filebuf::_M_unbuf): Add. (filebuf::_M_file): Change to non-pointer. (filebuf::_M_allocate_pback_buffer): Remove. * include/bits/fstream.tcc (filebuf::_M_allocate_file): Remove. (filebuf::_M_allocate_internal_buffer): Use _M_unbuf. Change initialization list for _M_file change. (filebuf::_M_allocate_pback_buffer): Remove. Change _M_file usage to reflect non-pointer data member. * config/locale/generic/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/generic/collate_members.cc: Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/generic/monetary_members.cc: Changeup data types. Add dtors. * config/locale/generic/numeric_members.cc: Add dtors. * config/locale/generic/time_members.cc: Add dtors. * config/locale/gnu/c_locale.cc: Add parameter. * config/locale/gnu/collate_members.cc:Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/gnu/ctype_members.cc: Better error checking. * config/os/gnu-linux/bits/ctype_noninline.h: Better error checking. * config/locale/gnu/messages_members.cc: Tweak comment. * config/locale/gnu/monetary_members.cc: Change data types. Add dtors. * config/locale/gnu/numeric_members.cc: Add dtors, better error checking. * config/locale/gnu/time_members.cc: Same. * config/locale/ieee_1003.1-2001/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/ieee_1003.1-2001/c_locale.h: Correct typedef. * config/locale/ieee_1003.1-2001/codecvt_specializations.h: Remove bogus ctor. * include/bits/locale_facets.h (moneypunct): Use string literals. Don't define dtor. (numpunct): Same. (__timepunct): Same. (locale::_Impl::_M_facets): Change from vector to array. (locale::_Impl::_M_names): Change from array of strings to array of string literals. (locale::facet::_S_create_c_locale): Add parameter. (locale::locale::_S_num_facets): Move to... (locale::_Impl::_M_facets_size): Here. * include/bits/locale_facets.tcc: Fixups for _M_facets, _M_name changes. * include/bits/localefwd.h: (locale::id::_M_id): Add member function. (locale::_Impl::_Impl(facet**, size_t, bool)): Add. (locale::_Impl::_Impl(string, size_t)): Change to (locale::_Impl::_Impl(const char*, size_t)): This. * include/bits/streambuf.tcc (streambuf::_S_pback_size): Define. * include/std/std_streambuf.h (streambuf::_M_pback_size): Change to (streambuf::_S_pback_size): This. * src/globals.cc: Add pre-allocations for "C" facets. * src/locale-inst.cc: Remove vector instantiations. * src/locale.cc: Remove vector include. Fixups for _M_names, _M_facets changes. * src/localename.cc: Same. * include/bits/stl_vector.h: Fix odd formatting. * include/bits/basic_string.tcc: Tweak comment. * libsupc++/new: Make sure parameters are uglified. * libsupc++/typeinfo: Same. * testsuite/22_locale/num_get_members_char.cc: Fixup. * testsuite/22_locale/num_get_members_wchar_t.cc: Same. * testsuite/27_io/filebuf_members.cc: Same. From-SVN: r52345
2002-04-16 02:45:36 +02:00
~numpunct();
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
/**
* @brief Return decimal point character.
*
* Returns a char_type to use as a decimal point. This function is a
* hook for derived classes to change the value returned.
*
* @return @a char_type representing a decimal point.
*/
virtual char_type
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
do_decimal_point() const
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
{ return _M_data->_M_decimal_point; }
/**
* @brief Return thousands separator character.
*
* Returns a char_type to use as a thousands separator. This function
* is a hook for derived classes to change the value returned.
*
* @return @a char_type representing a thousands separator.
*/
virtual char_type
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
do_thousands_sep() const
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
{ return _M_data->_M_thousands_sep; }
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
/**
* @brief Return grouping specification.
*
* Returns a string representing groupings for the integer part of a
* number. This function is a hook for derived classes to change the
* value returned. @see grouping() for details.
*
* @return String representing grouping specification.
*/
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
virtual string
do_grouping() const
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
{ return _M_data->_M_grouping; }
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
/**
* @brief Return string representation of bool true.
*
* Returns a string_type containing the text representation for true
* bool variables. This function is a hook for derived classes to
* change the value returned.
*
* @return string_type representing printed form of true.
*/
virtual string_type
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
do_truename() const
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
{ return _M_data->_M_truename; }
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
/**
* @brief Return string representation of bool false.
*
* Returns a string_type containing the text representation for false
* bool variables. This function is a hook for derived classes to
* change the value returned.
*
* @return string_type representing printed form of false.
*/
virtual string_type
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
do_falsename() const
ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> * include/bits/ios_base.h (ios_base::_M_getloc): Return reference to the imbued locale. * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use _M_getloc. (num_put::_M_convert_float): Use. 2003-06-26 Benjamin Kosnik <bkoz@redhat.com> Jerry Quinn <jlquinn@optonline.net> * config/linker-map.gnu: Add __numpunct_cache. * config/locale/gnu/numeric_members.cc (numpunct::_M_initialize_numpunct): Account for _M_data, fill in all elements for "C" locale. (numpunct::~numpunct): Delete _M_data. * config/locale/generic/numeric_members.cc: Same. * include/bits/basic_ios.tcc (basic_ios::init): Remove __locale_cache bits. (basic_ios::_M_cache_locale): Same. * include/bits/ios_base.h: Same. Tweaks. * include/bits/locale_classes.h: Tweaks. Reorder classes. (__use_cache): Make friends with _Impl, locale. (_Impl::_M_caches): Add. (_Impl::_M_install_cache): Add. * include/bits/locale_facets.h (__numpunct_cache): New. (numpunct): Encapsulate data members in __numpunct_cache member, _M_data. Adjust virtuals. (numpunct::numpunct): New ctor for the same. (__locale_cache_base): Remove. (__locale_cache): Remove. * include/bits/locale_facets.tcc (__use_cache): New function, specializations. (num_put::_M_convert_int, _M_convert_float, do_put): Use it. * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w. * src/ios.cc (ios_base::ios_base): Remove __locale_cache. * src/locale-inst.cc: Same. Add __numpunct_cache. * src/locale.cc: Tweak inlines. (__use_cache): Define specializations. * src/localename.cc: Use global bits. (_Impl::~Impl): Deal with __numpunct_cache destruction. (_Impl::_Impl): Same. Pre-cache standard numpunct facets. (_Impl::_M_init_facet): Take into account __numpunct_cache. * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. Co-Authored-By: Jerry Quinn <jlquinn@optonline.net> From-SVN: r68558
2003-06-27 09:25:38 +02:00
{ return _M_data->_M_falsename; }
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
// For use at construction time only.
void
c++config (std::size_t, [...]): Provide typedefs. 2010-06-03 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/c++config (std::size_t, std::ptrdiff_t, std::nullptr_t): Provide typedefs. * include/c_std/cstddef: Don't provide std::size_t and std::ptrdiff_t here. * include/c_global/cstddef: Likewise. * src/condition_variable.cc: Don't include <cstddef>, don't use NULL, use std::size_t and std::ptrdiff_t. * src/mt_allocator.cc: Likewise. * src/localename.cc: Likewise. * src/chrono.cc: Likewise. * src/thread.cc: Likewise. * include/debug/formatter.h: Likewise. * include/debug/functions.h: Likewise. * include/std/valarray: Likewise. * include/std/thread: Likewise. * include/std/type_traits: Likewise. * include/std/atomic: Likewise. * include/std/iterator: Likewise. * include/std/bitset: Likewise. * include/std/fstream: Likewise. * include/std/mutex: Likewise. * include/c_std/cstdlib: Likewise. * include/c_std/cstdio: Likewise. * include/c_std/ctime: Likewise. * include/c_std/cwchar: Likewise. * include/c_std/cstring: Likewise. * include/parallel/multiway_merge.h: Likewise. * include/parallel/multiseq_selection.h: Likewise. * include/parallel/base.h: Likewise. * include/parallel/basic_iterator.h: Likewise. * include/parallel/multiway_mergesort.h * include/parallel/partition.h: Likewise. * include/ext/string_conversions.h: Likewise. * include/ext/pb_ds/assoc_container.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_prime_size_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ sample_resize_policy.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ sample_resize_trigger.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/d: Likewise.etail/cc_hash_table_map_/ insert_no_store_hash_fn_imps.hpp * include/ext/pb_ds/detail/cc_hash_table_map_/ cmp_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ insert_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ entry_list_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ cc_ht_map_.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_no_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/child_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ insert_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ const_child_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/internal_node.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/point_iterators.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ r_erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ rotate_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ point_iterators.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ gp_ht_map_.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Likewise. * include/ext/pb_ds/detail/tree_policy/ sample_tree_node_update.hpp: Likewise. * include/ext/pb_ds/detail/basic_tree_policy/ null_node_metadata.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/trie_policy/ sample_trie_node_update.hpp: Likewise. * include/ext/pb_ds/detail/trie_policy/ sample_trie_e_access_traits.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_policy/ counter_lu_metadata.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ null_metadata.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/ sample_ranged_probe_fn.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/ sample_ranged_hash_fn.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp: Likewise. * include/ext/pb_ds/list_update_policy.hpp: Likewise. * include/ext/pb_ds/exception.hpp: Likewise. * include/ext/pb_ds/tree_policy.hpp: Likewise. * include/ext/pb_ds/tag_and_trait.hpp: Likewise. * include/ext/pb_ds/hash_policy.hpp: Likewise. * include/ext/pb_ds/trie_policy.hpp: Likewise. * include/ext/pb_ds/priority_queue.hpp: Likewise. * include/ext/throw_allocator.h: Likewis: Likewise.e. * include/ext/bitmap_allocator.h * include/ext/rc_string_base.h: Likewise. * include/ext/new_allocator.h: Likewise. * include/ext/codecvt_specializations.h: Likewise. * include/ext/functional: Likewise.: Likewise. * include/ext/array_allocator.h: Likewise. * include/ext/mt_allocator.h: Likewise. * include/ext/sso_string_base.h: Likewise. * include/profile/impl/profiler_trace.h: Likewise. * include/profile/impl/profiler_node.h: Likewise. * include/bits/stl_algobase.h: Likewise. * include/bits/functional_hash.h: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_facets.h: Likewise. * include/bits/stl_iterator_base_types.h: Likewise. * include/bits/move.h: Likewise. * include/bits/boost_concept_check.h: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/fstream.tcc: Likewise. * include/bits/locale_facets_nonio.h: Likewise. * include/c_global/cstdlib: Likewise. * include/c_global/cstdio: Likewise. * include/c_global/ctime: Likewise. * include/c_global/cwchar: Likewise. * include/c_global/cstring * include/tr1/type_traits: Likewise. * include/backward/hash_fun.h: Likewise. * libsupc++/new: Likewise. * libsupc++/initializer_list: Likewise. * testsuite/27_io/basic_ofstream/pthread2.cc: Likewise. * testsuite/27_io/basic_iostream/cons/2020.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetn/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetn/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/overflow/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/overflow/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetc/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetc/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/char/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputc/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/objects/wchar_t/5268.cc: Likewise. * testsuite/27_io/objects/char/9661-1.cc: Likewise. * testsuite/27_io/objects/char/5268.cc: Likewise. * testsuite/27_io/objects/char/10.cc: Likewise. * testsuite/27_io/basic_ios/copyfmt/char/1.cc: Likewise. * testsuite/27_io/basic_ios/copyfmt/char/2.cc: Likewise. * testsuite/27_io/basic_ios/exceptions/char/1.cc: Likewise. * testsuite/27_io/basic_ios/locales/char/1.cc: Likewise. * testsuite/27_io/basic_ios/clear/char/1.cc: Likewise. * testsuite/27_io/basic_ostringstream/pthread3.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputc/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputn/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputn/char/1057.cc: Likewise. * testsuite/27_io/basic_istream/get/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/get/char/1.cc: Likewise. * testsuite/27_io/basic_istream/ignore/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/ignore/char/1.cc: Likewise. * testsuite/27_io/basic_istream/peek/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/peek/char/1.cc: Likewise. * testsuite/27_io/basic_istream/getline/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/getline/char/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/wchar_t/ exceptions_null.cc * testsuite/27_io/basic_istream/extractors_other/wchar_t/ 1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/char/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/char/1.cc: Likewise. * testsuite/27_io/basic_istream/cons/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/ wchar_t/01.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/ char/01.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/2.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/2.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/9826.cc: Likewise. * testsuite/27_io/basic_istream/read/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/read/char/1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/ 1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/char/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/char/1.cc: Likewise. * testsuite/27_io/basic_ostream/cons/2020.cc: Likewise. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_character/ wchar_t/8.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_character/ char/8.cc: Likewise. * testsuite/27_io/basic_filebuf/setbuf/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/2.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/9507.cc: Likewise. * testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-1.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-2.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-3.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-4.cc: Likewise. * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/2.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/12790-3.cc: Likewise. * testsuite/27_io/basic_filebuf/sputn/char/1057.cc: Likewise. * testsuite/24_iterators/ostreambuf_iterator/2.cc: Likewise. * testsuite/18_support/bad_exception/23591_thread-1.c * testsuite/18_support/new_delete_placement.cc: Likewise. * testsuite/18_support/pthread_guard.cc: Likewise. * testsuite/21_strings/basic_string/operations/wchar_t/1.cc: Likewise. * testsuite/21_strings/basic_string/operations/char/1.cc: Likewise. * testsuite/21_strings/basic_string/pthread4.cc: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/5.cc: Likewise. * testsuite/21_strings/basic_string/cons/char/5.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/thread/cons/assign_neg.cc: Likewise. * testsuite/30_threads/thread/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/ assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/ copy_neg.cc: Likewise. * testsuite/ext/mt_allocator/22309_thread.cc: Likewise. * testsuite/ext/slist/23781.cc: Likewise. * testsuite/ext/rope/pthread7-rope.cc: Likewise. * testsuite/ext/stdio_filebuf/char/10063-2.cc: Likewise. * testsuite/22_locale/ctype/is/wchar_t/1.cc: Likewise. * testsuite/22_locale/ctype/is/char/1.cc: Likewise. * testsuite/22_locale/time_put/put/char/12439_1.cc: Likewise. * testsuite/22_locale/time_put/put/char/12439_3.cc: Likewise. * testsuite/22_locale/locale/cons/2.cc: Likewise. * testsuite/22_locale/locale/cons/12658_thread-1.cc: Likewise. * testsuite/22_locale/locale/cons/29217.cc: Likewise. * testsuite/22_locale/locale/global_locale_objects/14071.cc: Likewise. * testsuite/22_locale/locale/global_locale_objects/2.cc: Likewise. * testsuite/tr1/6_containers/unordered_multimap/ requirements/iterator_null_neg.cc: Likewise. * testsuite/tr1/6_containers/unordered_multiset/ requirements/iterator_null_neg.cc: Likewise. * testsuite/29_atomics/atomic_address/cons/single_value.cc: Likewise. * testsuite/29_atomics/atomic_address/cons/aggregate.cc: Likewise. * testsuite/23_containers/multimap/23781.cc: Likewise. * testsuite/23_containers/set/23781.cc: Likewise. * testsuite/23_containers/multiset/23781.cc: Likewise. * testsuite/23_containers/list/pthread1.cc: Likewise. * testsuite/23_containers/list/23781.cc: Likewise. * testsuite/23_containers/map/pthread6.cc: Likewise. * testsuite/23_containers/map/23781.cc: Likewise. * testsuite/util/regression/rand/priority_queue/ rand_regression_test.hpp: Likewise. * testsuite/util/regression/rand/priority_queue/ container_rand_regression_test.tcc: Likewise. * testsuite/util/regression/rand/assoc/ rand_regression_test.hpp: Likewise. * testsuite/util/regression/rand/assoc/ container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_hooks.cc: Likewise. * testsuite/util/testsuite_io.h: Likewise. * testsuite/util/testsuite_iterators.h: Likewise. * testsuite/util/replacement_memory_operators.h: Likewise. * testsuite/util/testsuite_allocator.h: Likewise. * testsuite/util/testsuite_performance.h: Likewise. From-SVN: r160231
2010-06-03 21:15:56 +02:00
_M_initialize_numpunct(__c_locale __cloc = 0);
};
template<typename _CharT>
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
locale::id numpunct<_CharT>::id;
template<>
re PR libstdc++/4164 (33 Memory Leak when using iostream) 2002-04-15 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/4164 Valgrind fixes. * config/io/basic_file_stdio.cc (__basic_file::~__basic_file): Call close. (__basic_file::close): Call fflush. Correct return if fclose ok. (__basic_file::is_open): Make const. Change __c_file_type to __c_file. * config/io/basic_file_stdio.h: Change __c_file_type to __c_file. (__basic_file::is_open): Make const. * config/io/c_io_stdio.h: Change __c_file_type to __c_file. * include/std/std_fstream.h (filebuf::_M_allocate_file): Remove. (filebuf::_M_unbuf): Add. (filebuf::_M_file): Change to non-pointer. (filebuf::_M_allocate_pback_buffer): Remove. * include/bits/fstream.tcc (filebuf::_M_allocate_file): Remove. (filebuf::_M_allocate_internal_buffer): Use _M_unbuf. Change initialization list for _M_file change. (filebuf::_M_allocate_pback_buffer): Remove. Change _M_file usage to reflect non-pointer data member. * config/locale/generic/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/generic/collate_members.cc: Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/generic/monetary_members.cc: Changeup data types. Add dtors. * config/locale/generic/numeric_members.cc: Add dtors. * config/locale/generic/time_members.cc: Add dtors. * config/locale/gnu/c_locale.cc: Add parameter. * config/locale/gnu/collate_members.cc:Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/gnu/ctype_members.cc: Better error checking. * config/os/gnu-linux/bits/ctype_noninline.h: Better error checking. * config/locale/gnu/messages_members.cc: Tweak comment. * config/locale/gnu/monetary_members.cc: Change data types. Add dtors. * config/locale/gnu/numeric_members.cc: Add dtors, better error checking. * config/locale/gnu/time_members.cc: Same. * config/locale/ieee_1003.1-2001/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/ieee_1003.1-2001/c_locale.h: Correct typedef. * config/locale/ieee_1003.1-2001/codecvt_specializations.h: Remove bogus ctor. * include/bits/locale_facets.h (moneypunct): Use string literals. Don't define dtor. (numpunct): Same. (__timepunct): Same. (locale::_Impl::_M_facets): Change from vector to array. (locale::_Impl::_M_names): Change from array of strings to array of string literals. (locale::facet::_S_create_c_locale): Add parameter. (locale::locale::_S_num_facets): Move to... (locale::_Impl::_M_facets_size): Here. * include/bits/locale_facets.tcc: Fixups for _M_facets, _M_name changes. * include/bits/localefwd.h: (locale::id::_M_id): Add member function. (locale::_Impl::_Impl(facet**, size_t, bool)): Add. (locale::_Impl::_Impl(string, size_t)): Change to (locale::_Impl::_Impl(const char*, size_t)): This. * include/bits/streambuf.tcc (streambuf::_S_pback_size): Define. * include/std/std_streambuf.h (streambuf::_M_pback_size): Change to (streambuf::_S_pback_size): This. * src/globals.cc: Add pre-allocations for "C" facets. * src/locale-inst.cc: Remove vector instantiations. * src/locale.cc: Remove vector include. Fixups for _M_names, _M_facets changes. * src/localename.cc: Same. * include/bits/stl_vector.h: Fix odd formatting. * include/bits/basic_string.tcc: Tweak comment. * libsupc++/new: Make sure parameters are uglified. * libsupc++/typeinfo: Same. * testsuite/22_locale/num_get_members_char.cc: Fixup. * testsuite/22_locale/num_get_members_wchar_t.cc: Same. * testsuite/27_io/filebuf_members.cc: Same. From-SVN: r52345
2002-04-16 02:45:36 +02:00
numpunct<char>::~numpunct();
template<>
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
void
numpunct<char>::_M_initialize_numpunct(__c_locale __cloc);
#ifdef _GLIBCXX_USE_WCHAR_T
template<>
re PR libstdc++/4164 (33 Memory Leak when using iostream) 2002-04-15 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/4164 Valgrind fixes. * config/io/basic_file_stdio.cc (__basic_file::~__basic_file): Call close. (__basic_file::close): Call fflush. Correct return if fclose ok. (__basic_file::is_open): Make const. Change __c_file_type to __c_file. * config/io/basic_file_stdio.h: Change __c_file_type to __c_file. (__basic_file::is_open): Make const. * config/io/c_io_stdio.h: Change __c_file_type to __c_file. * include/std/std_fstream.h (filebuf::_M_allocate_file): Remove. (filebuf::_M_unbuf): Add. (filebuf::_M_file): Change to non-pointer. (filebuf::_M_allocate_pback_buffer): Remove. * include/bits/fstream.tcc (filebuf::_M_allocate_file): Remove. (filebuf::_M_allocate_internal_buffer): Use _M_unbuf. Change initialization list for _M_file change. (filebuf::_M_allocate_pback_buffer): Remove. Change _M_file usage to reflect non-pointer data member. * config/locale/generic/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/generic/collate_members.cc: Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/generic/monetary_members.cc: Changeup data types. Add dtors. * config/locale/generic/numeric_members.cc: Add dtors. * config/locale/generic/time_members.cc: Add dtors. * config/locale/gnu/c_locale.cc: Add parameter. * config/locale/gnu/collate_members.cc:Change _M_compare_helper to _M_compare. Change _M_transform_helper to _M_transform. * config/locale/gnu/ctype_members.cc: Better error checking. * config/os/gnu-linux/bits/ctype_noninline.h: Better error checking. * config/locale/gnu/messages_members.cc: Tweak comment. * config/locale/gnu/monetary_members.cc: Change data types. Add dtors. * config/locale/gnu/numeric_members.cc: Add dtors, better error checking. * config/locale/gnu/time_members.cc: Same. * config/locale/ieee_1003.1-2001/c_locale.cc (locale::facet::_S_create_c_locale): Add parameter. * config/locale/ieee_1003.1-2001/c_locale.h: Correct typedef. * config/locale/ieee_1003.1-2001/codecvt_specializations.h: Remove bogus ctor. * include/bits/locale_facets.h (moneypunct): Use string literals. Don't define dtor. (numpunct): Same. (__timepunct): Same. (locale::_Impl::_M_facets): Change from vector to array. (locale::_Impl::_M_names): Change from array of strings to array of string literals. (locale::facet::_S_create_c_locale): Add parameter. (locale::locale::_S_num_facets): Move to... (locale::_Impl::_M_facets_size): Here. * include/bits/locale_facets.tcc: Fixups for _M_facets, _M_name changes. * include/bits/localefwd.h: (locale::id::_M_id): Add member function. (locale::_Impl::_Impl(facet**, size_t, bool)): Add. (locale::_Impl::_Impl(string, size_t)): Change to (locale::_Impl::_Impl(const char*, size_t)): This. * include/bits/streambuf.tcc (streambuf::_S_pback_size): Define. * include/std/std_streambuf.h (streambuf::_M_pback_size): Change to (streambuf::_S_pback_size): This. * src/globals.cc: Add pre-allocations for "C" facets. * src/locale-inst.cc: Remove vector instantiations. * src/locale.cc: Remove vector include. Fixups for _M_names, _M_facets changes. * src/localename.cc: Same. * include/bits/stl_vector.h: Fix odd formatting. * include/bits/basic_string.tcc: Tweak comment. * libsupc++/new: Make sure parameters are uglified. * libsupc++/typeinfo: Same. * testsuite/22_locale/num_get_members_char.cc: Fixup. * testsuite/22_locale/num_get_members_wchar_t.cc: Same. * testsuite/27_io/filebuf_members.cc: Same. From-SVN: r52345
2002-04-16 02:45:36 +02:00
numpunct<wchar_t>::~numpunct();
template<>
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
void
numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc);
#endif
run_doxygen: Remove html_output_dir. 2008-03-25 Benjamin Kosnik <bkoz@redhat.com> * scripts/run_doxygen: Remove html_output_dir. Downgrade to Doxygen 1.5.1. * doc/doxygen/style.css: Delete. * doc/doxygen/user.cfg.in: Regenerate with Doxygen 1.5.1. (INPUT): Update. (PREDEFINED): Update. (HTML_OUTPUT): Remove html_output_dir, use html. (HTML_STYLESHEET): Remove style.css. * doc/doxygen/tables.html: Remove style.css use. * doc/doxygen/mainpage.html: Nested lists for Namespaces and Classes. * doc/doxygen/doxygroups.cc: Namespace edits. * doc/doxygen/Intro.3: Correct typo. * doc/xml/api.xml: Add gcc-4.3 links. * doc/html/api.html: Regenerate. * include/debug/debug.h: Document namepaces here. * include/parallel/base.h: Same. * include/ext/typelist.h: Same. * include/ext/pb_ds/tag_and_trait.hpp: Same. * include/tr1_impl/random: Adjust line break. * include/tr1_impl/unordered_map: Correct and or add markup. * include/tr1_impl/boost_shared_ptr.h: Correct and or add markup. * include/tr1_impl/functional_hash.h: Same. * include/tr1_impl/cmath: Same. * include/tr1_impl/functional: Same. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/complex: Same. * include/tr1_impl/type_traits: Same. * include/tr1_impl/regex: Same. * include/tr1_impl/array: Same. * include/std/tuple: Same. * include/std/date_time: Same. * include/std/system_error: Same. * include/std/type_traits: Same. * include/ext/enc_filebuf.h: Same. * include/ext/throw_allocator.h: Same. * include/ext/pool_allocator.h: Same. * include/ext/bitmap_allocator.h: Same. * include/ext/concurrence.h: Same. * include/ext/codecvt_specializations.h: Same. * include/ext/stdio_sync_filebuf.h: Same. * include/ext/array_allocator.h: Same. * include/ext/mt_allocator.h: Same. * include/bits/locale_classes.h: Same. * include/bits/locale_facets.h: Same. * include/bits/codecvt.h: Same. * include/bits/char_traits.h: Same. * include/bits/allocator.h: Same. * include/bits/locale_facets_nonio.h: Same. * include/tr1/poly_laguerre.tcc: Same. * include/tr1/riemann_zeta.tcc: Same. * include/tr1/beta_function.tcc: Same. * include/tr1/tuple: Same. * include/tr1/exp_integral.tcc: Same. * include/tr1/gamma.tcc: Same. * include/tr1/hypergeometric.tcc: Same. * include/tr1/modified_bessel_func.tcc: Same. * include/tr1/legendre_function.tcc: Same. * include/tr1/type_traits: Same. * include/tr1/special_function_util.h: Same. * include/tr1/bessel_function.tcc: Same. * include/tr1/cmath: Same. * include/tr1/poly_hermite.tcc: Same. * include/tr1/ell_integral.tcc: Same. * config/abi/compatibility.h: Adjust file name. * testsuite/19_diagnostics/error_category/cons/copy_neg.cc: Adjust line numbers. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. From-SVN: r133544
2008-03-26 07:27:35 +01:00
/// class numpunct_byname [22.2.3.2].
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
template<typename _CharT>
class numpunct_byname : public numpunct<_CharT>
{
public:
typedef _CharT char_type;
typedef basic_string<_CharT> string_type;
explicit
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
numpunct_byname(const char* __s, size_t __refs = 0)
: numpunct<_CharT>(__refs)
{
pod_char_traits.h (char_traits<>::move): Use __builtin_memmove. 2007-05-11 Paolo Carlini <pcarlini@suse.de> * include/ext/pod_char_traits.h (char_traits<>::move): Use __builtin_memmove. * include/bits/locale_classes.h (locale::_Impl::_M_check_same_name, collate_byname(const char*, size_t)): Use __builtin_strcmp. * include/bits/locale_facets.h: Use __builtin_mem* and __builtin_str* everywhere. * include/bits/codecvt.h (codecvt_byname(const char*, size_t)): Use __builtin_strcmp. * include/bits/char_traits.h: Use __builtin_mem* everywhere. * include/bits/fstream.tcc (basic_filebuf<>::underflow, imbue): Use __builtin_memcpy and __builtin_memmove. * include/bits/locale_facets_nonio.h (moneypunct_byname(const char*, size_t __refs)): Use __builtin_strcmp. * include/std/bitset (bitset<>::_M_do_reset): Use __builtin_memset. * config/locale/gnu/c_locale.h: Use __builtin_strlen, __builtin_strcmp, and __builtin_memcpy. * config/locale/gnu/messages_members.h: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/c_locale.h: Likewise. * config/locale/generic/messages_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. * config/os/gnu-linux/ctype_noninline.h: Likewise, avoid strdup. * config/os/tpf/ctype_noninline.h: Likewise. * config/locale/generic/codecvt_members.cc: Include <cstring>. * config/locale/generic/ctype_members.cc: Likewise. * config/locale/generic/collate_members.cc: Likewise. * config/locale/gnu/c++locale_internal.h: Likewise. * config/locale/darwin/ctype_members.cc: Likewise. * src/ctype.cc: Likewise. * testsuite/19_diagnostics/logic_error/what-1.cc: Likewise. * testsuite/19_diagnostics/logic_error/what-2.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-1.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-2.cc: Likewise. * testsuite/19_diagnostics/runtime_error/what-3.cc: Likewise. * config/locale/gnu/messages_members.cc: Avoid strdup. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.cc: Likewise. * config/locale/gnu/time_members.cc: Likewise. * config/locale/generic/c_locale.cc: Likewise. From-SVN: r124623
2007-05-11 20:58:08 +02:00
if (__builtin_strcmp(__s, "C") != 0
&& __builtin_strcmp(__s, "POSIX") != 0)
{
__c_locale __tmp;
this->_S_create_c_locale(__tmp, __s);
this->_M_initialize_numpunct(__tmp);
this->_S_destroy_c_locale(__tmp);
}
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
}
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
protected:
virtual
~numpunct_byname() { }
};
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
_GLIBCXX_BEGIN_NAMESPACE_LDBL
/**
* @brief Primary class template num_get.
* @ingroup locales
*
* This facet encapsulates the code to parse and return a number
* from a string. It is used by the istream numeric extraction
* operators.
*
* The num_get template uses protected virtual functions to provide the
* actual results. The public accessors forward the call to the virtual
* functions. These virtual functions are hooks for developers to
* implement the behavior they require from the num_get facet.
*/
template<typename _CharT, typename _InIter>
class num_get : public locale::facet
{
public:
// Types:
//@{
/// Public typedefs
typedef _CharT char_type;
typedef _InIter iter_type;
//@}
/// Numpunct facet id.
static locale::id id;
/**
* @brief Constructor performs initialization.
*
* This is the constructor provided by the standard.
*
* @param refs Passed to the base facet class.
*/
explicit
num_get(size_t __refs = 0) : facet(__refs) { }
/**
* @brief Numeric parsing.
*
* Parses the input stream into the bool @a v. It does so by calling
* num_get::do_get().
*
* If ios_base::boolalpha is set, attempts to read
* ctype<CharT>::truename() or ctype<CharT>::falsename(). Sets
* @a v to true or false if successful. Sets err to
* ios_base::failbit if reading the string fails. Sets err to
* ios_base::eofbit if the stream is emptied.
*
* If ios_base::boolalpha is not set, proceeds as with reading a long,
* except if the value is 1, sets @a v to true, if the value is 0, sets
* @a v to false, and otherwise set err to ios_base::failbit.
*
* @param in Start of input stream.
* @param end End of input stream.
* @param io Source of locale and flags.
* @param err Error flags to set.
* @param v Value to format and insert.
* @return Iterator after reading.
*/
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, bool& __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_get(__in, __end, __io, __err, __v); }
//@{
/**
* @brief Numeric parsing.
*
* Parses the input stream into the integral variable @a v. It does so
* by calling num_get::do_get().
*
* Parsing is affected by the flag settings in @a io.
*
* The basic parse is affected by the value of io.flags() &
* ios_base::basefield. If equal to ios_base::oct, parses like the
* scanf %o specifier. Else if equal to ios_base::hex, parses like %X
* specifier. Else if basefield equal to 0, parses like the %i
* specifier. Otherwise, parses like %d for signed and %u for unsigned
* types. The matching type length modifier is also used.
*
auto_ptr.h: Fix comment typos. 2008-01-31 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * include/backward/auto_ptr.h: Fix comment typos. * include/bits/algorithmfwd.h: Likewise. * include/bits/basic_ios.h: Likewise. * include/bits/c++config: Likewise. * include/bits/char_traits.h: Likewise. * include/bits/codecvt.h: Likewise. * include/bits/gslice.h: Likewise. * include/bits/ios_base.h: Likewise. * include/bits/locale_facets.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/postypes.h: Likewise. * include/bits/sstream.tcc: Likewise. * include/bits/stl_algo.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_iterator.h: Likewise. * include/bits/stl_iterator_base_types.h Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_map.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_set.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/valarray_array.h: Likewise. * include/debug/safe_base.h: Likewise. * include/ext/bitmap_allocator.h: Likewise. * include/ext/codecvt_specializations.h Likewise. * include/ext/mt_allocator.h: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/rope: Likewise. * include/parallel/checkers.h: Likewise. * include/parallel/find.h: Likewise. * include/parallel/multiseq_selection.h: Likewise. * include/parallel/partition.h: Likewise. * include/parallel/settings.h: Likewise. * include/std/bitset: Likewise. * include/std/complex: Likewise. * include/std/fstream: Likewise. * include/std/istream: Likewise. * include/std/limits: Likewise. * include/std/ostream: Likewise. * include/std/stdexcept: Likewise. * include/std/streambuf: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/cmath: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1_impl/random: Likewise. * include/tr1_impl/regex: Likewise. From-SVN: r131982
2008-01-31 19:44:55 +01:00
* Digit grouping is interpreted according to numpunct::grouping() and
* numpunct::thousands_sep(). If the pattern of digit groups isn't
* consistent, sets err to ios_base::failbit.
*
* If parsing the string yields a valid value for @a v, @a v is set.
* Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
* Sets err to ios_base::eofbit if the stream is emptied.
*
* @param in Start of input stream.
* @param end End of input stream.
* @param io Source of locale and flags.
* @param err Error flags to set.
* @param v Value to format and insert.
* @return Iterator after reading.
*/
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, long& __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_get(__in, __end, __io, __err, __v); }
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned short& __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_get(__in, __end, __io, __err, __v); }
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned int& __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_get(__in, __end, __io, __err, __v); }
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned long& __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_get(__in, __end, __io, __err, __v); }
#ifdef _GLIBCXX_USE_LONG_LONG
iter_type
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, long long& __v) const
{ return this->do_get(__in, __end, __io, __err, __v); }
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned long long& __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_get(__in, __end, __io, __err, __v); }
#endif
//@}
//@{
/**
* @brief Numeric parsing.
*
* Parses the input stream into the integral variable @a v. It does so
* by calling num_get::do_get().
*
* The input characters are parsed like the scanf %g specifier. The
* matching type length modifier is also used.
*
* The decimal point character used is numpunct::decimal_point().
auto_ptr.h: Fix comment typos. 2008-01-31 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * include/backward/auto_ptr.h: Fix comment typos. * include/bits/algorithmfwd.h: Likewise. * include/bits/basic_ios.h: Likewise. * include/bits/c++config: Likewise. * include/bits/char_traits.h: Likewise. * include/bits/codecvt.h: Likewise. * include/bits/gslice.h: Likewise. * include/bits/ios_base.h: Likewise. * include/bits/locale_facets.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/postypes.h: Likewise. * include/bits/sstream.tcc: Likewise. * include/bits/stl_algo.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_iterator.h: Likewise. * include/bits/stl_iterator_base_types.h Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_map.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_set.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/valarray_array.h: Likewise. * include/debug/safe_base.h: Likewise. * include/ext/bitmap_allocator.h: Likewise. * include/ext/codecvt_specializations.h Likewise. * include/ext/mt_allocator.h: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/rope: Likewise. * include/parallel/checkers.h: Likewise. * include/parallel/find.h: Likewise. * include/parallel/multiseq_selection.h: Likewise. * include/parallel/partition.h: Likewise. * include/parallel/settings.h: Likewise. * include/std/bitset: Likewise. * include/std/complex: Likewise. * include/std/fstream: Likewise. * include/std/istream: Likewise. * include/std/limits: Likewise. * include/std/ostream: Likewise. * include/std/stdexcept: Likewise. * include/std/streambuf: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/cmath: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1_impl/random: Likewise. * include/tr1_impl/regex: Likewise. From-SVN: r131982
2008-01-31 19:44:55 +01:00
* Digit grouping is interpreted according to numpunct::grouping() and
* numpunct::thousands_sep(). If the pattern of digit groups isn't
* consistent, sets err to ios_base::failbit.
*
* If parsing the string yields a valid value for @a v, @a v is set.
* Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
* Sets err to ios_base::eofbit if the stream is emptied.
*
* @param in Start of input stream.
* @param end End of input stream.
* @param io Source of locale and flags.
* @param err Error flags to set.
* @param v Value to format and insert.
* @return Iterator after reading.
*/
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, float& __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_get(__in, __end, __io, __err, __v); }
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, double& __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_get(__in, __end, __io, __err, __v); }
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, long double& __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_get(__in, __end, __io, __err, __v); }
//@}
/**
* @brief Numeric parsing.
*
* Parses the input stream into the pointer variable @a v. It does so
* by calling num_get::do_get().
*
* The input characters are parsed like the scanf %p specifier.
*
auto_ptr.h: Fix comment typos. 2008-01-31 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * include/backward/auto_ptr.h: Fix comment typos. * include/bits/algorithmfwd.h: Likewise. * include/bits/basic_ios.h: Likewise. * include/bits/c++config: Likewise. * include/bits/char_traits.h: Likewise. * include/bits/codecvt.h: Likewise. * include/bits/gslice.h: Likewise. * include/bits/ios_base.h: Likewise. * include/bits/locale_facets.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/postypes.h: Likewise. * include/bits/sstream.tcc: Likewise. * include/bits/stl_algo.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_iterator.h: Likewise. * include/bits/stl_iterator_base_types.h Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_map.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_set.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/valarray_array.h: Likewise. * include/debug/safe_base.h: Likewise. * include/ext/bitmap_allocator.h: Likewise. * include/ext/codecvt_specializations.h Likewise. * include/ext/mt_allocator.h: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/rope: Likewise. * include/parallel/checkers.h: Likewise. * include/parallel/find.h: Likewise. * include/parallel/multiseq_selection.h: Likewise. * include/parallel/partition.h: Likewise. * include/parallel/settings.h: Likewise. * include/std/bitset: Likewise. * include/std/complex: Likewise. * include/std/fstream: Likewise. * include/std/istream: Likewise. * include/std/limits: Likewise. * include/std/ostream: Likewise. * include/std/stdexcept: Likewise. * include/std/streambuf: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/cmath: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1_impl/random: Likewise. * include/tr1_impl/regex: Likewise. From-SVN: r131982
2008-01-31 19:44:55 +01:00
* Digit grouping is interpreted according to numpunct::grouping() and
* numpunct::thousands_sep(). If the pattern of digit groups isn't
* consistent, sets err to ios_base::failbit.
*
* Note that the digit grouping effect for pointers is a bit ambiguous
* in the standard and shouldn't be relied on. See DR 344.
*
* If parsing the string yields a valid value for @a v, @a v is set.
* Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
* Sets err to ios_base::eofbit if the stream is emptied.
*
* @param in Start of input stream.
* @param end End of input stream.
* @param io Source of locale and flags.
* @param err Error flags to set.
* @param v Value to format and insert.
* @return Iterator after reading.
*/
iter_type
get(iter_type __in, iter_type __end, ios_base& __io,
ios_base::iostate& __err, void*& __v) const
{ return this->do_get(__in, __end, __io, __err, __v); }
protected:
/// Destructor.
virtual ~num_get() { }
iter_type
_M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&,
string&) const;
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
template<typename _ValueT>
iter_type
_M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
_ValueT&) const;
template<typename _CharT2>
type_traits.h: New. 2006-09-18 Benjamin Kosnik <bkoz@redhat.com> Peter Doerfler <gcc@pdoerfler.com> Paolo Carlini <pcarlini@suse.de> * include/ext/type_traits.h: New. (__conditional_type): New. (__numeric_traits): New. (__add_unsigned): New. (__remove_unsigned): New. (__enable_if): New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * include/ext/pb_ds/detail/type_utils.hpp: Use ext include, remove duplicates. * include/tr1/hashtable_policy.h (IF): Use __conditional_type. (_Max_digits10): Same. (identity): Use _Identity. (extract1st): Use _Select1st. * include/tr1/random (_Select): Use __conditional_type. (_To_Unsigned_Type): Use __add_unsigned. Linebreak fixups. * include/bits/locale_facets.tcc (__to_unsigned_type): Remove, use __add_unsigned. * include/tr1/random.tcc: Fixups as above. * include/tr1/unordered_map: Same. * include/tr1/hashtable: Same. * include/tr1/unordered_set: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Same. * include/ext/pb_ds/detail/standard_policies.hpp: Same. * include/ext/pb_ds/detail/typelist/typelist_filter.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same. * include/ext/pb_ds/detail/type_utils.hpp: Same. * include/ext/pb_ds/trie_policy.hpp: Same. * docs/html/ext/pb_ds/string_trie_e_access_traits.html: Same. * include/bits/cpp_type_traits.h (__enable_if): Move to ext, make boolean argument first. * include/bits/locale_facets.h: Fixups for __enable_if argument and namespace switch. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/streambuf_iterator.h: Same. * include/debug/safe_iterator.h: Same. * include/tr1/hashtable_policy.h: Same. * include/tr1/cmath: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * include/std/std_streambuf.h: Same. * include/c_std/std_cmath.h: Same. * testsuite/util/testsuite_tr1.h: Same. * testsuite/util/performance/assoc/multimap_common_type.hpp: Same. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> Co-Authored-By: Peter Doerfler <gcc@pdoerfler.com> From-SVN: r117024
2006-09-18 15:30:56 +02:00
typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, int>::__type
_M_find(const _CharT2*, size_t __len, _CharT2 __c) const
{
int __ret = -1;
if (__len <= 10)
{
if (__c >= _CharT2('0') && __c < _CharT2(_CharT2('0') + __len))
__ret = __c - _CharT2('0');
}
else
{
if (__c >= _CharT2('0') && __c <= _CharT2('9'))
__ret = __c - _CharT2('0');
else if (__c >= _CharT2('a') && __c <= _CharT2('f'))
__ret = 10 + (__c - _CharT2('a'));
else if (__c >= _CharT2('A') && __c <= _CharT2('F'))
__ret = 10 + (__c - _CharT2('A'));
}
return __ret;
}
template<typename _CharT2>
type_traits.h: New. 2006-09-18 Benjamin Kosnik <bkoz@redhat.com> Peter Doerfler <gcc@pdoerfler.com> Paolo Carlini <pcarlini@suse.de> * include/ext/type_traits.h: New. (__conditional_type): New. (__numeric_traits): New. (__add_unsigned): New. (__remove_unsigned): New. (__enable_if): New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * include/ext/pb_ds/detail/type_utils.hpp: Use ext include, remove duplicates. * include/tr1/hashtable_policy.h (IF): Use __conditional_type. (_Max_digits10): Same. (identity): Use _Identity. (extract1st): Use _Select1st. * include/tr1/random (_Select): Use __conditional_type. (_To_Unsigned_Type): Use __add_unsigned. Linebreak fixups. * include/bits/locale_facets.tcc (__to_unsigned_type): Remove, use __add_unsigned. * include/tr1/random.tcc: Fixups as above. * include/tr1/unordered_map: Same. * include/tr1/hashtable: Same. * include/tr1/unordered_set: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Same. * include/ext/pb_ds/detail/standard_policies.hpp: Same. * include/ext/pb_ds/detail/typelist/typelist_filter.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same. * include/ext/pb_ds/detail/type_utils.hpp: Same. * include/ext/pb_ds/trie_policy.hpp: Same. * docs/html/ext/pb_ds/string_trie_e_access_traits.html: Same. * include/bits/cpp_type_traits.h (__enable_if): Move to ext, make boolean argument first. * include/bits/locale_facets.h: Fixups for __enable_if argument and namespace switch. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/streambuf_iterator.h: Same. * include/debug/safe_iterator.h: Same. * include/tr1/hashtable_policy.h: Same. * include/tr1/cmath: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * include/std/std_streambuf.h: Same. * include/c_std/std_cmath.h: Same. * testsuite/util/testsuite_tr1.h: Same. * testsuite/util/performance/assoc/multimap_common_type.hpp: Same. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> Co-Authored-By: Peter Doerfler <gcc@pdoerfler.com> From-SVN: r117024
2006-09-18 15:30:56 +02:00
typename __gnu_cxx::__enable_if<!__is_char<_CharT2>::__value,
int>::__type
_M_find(const _CharT2* __zero, size_t __len, _CharT2 __c) const
{
int __ret = -1;
const char_type* __q = char_traits<_CharT2>::find(__zero, __len, __c);
if (__q)
{
__ret = __q - __zero;
if (__ret > 15)
__ret -= 6;
}
return __ret;
}
//@{
/**
* @brief Numeric parsing.
*
* Parses the input stream into the variable @a v. This function is a
* hook for derived classes to change the value returned. @see get()
* for more details.
*
* @param in Start of input stream.
* @param end End of input stream.
* @param io Source of locale and flags.
* @param err Error flags to set.
* @param v Value to format and insert.
* @return Iterator after reading.
*/
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
virtual iter_type
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, long& __v) const
{ return _M_extract_int(__beg, __end, __io, __err, __v); }
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
virtual iter_type
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned short& __v) const
{ return _M_extract_int(__beg, __end, __io, __err, __v); }
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
virtual iter_type
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned int& __v) const
{ return _M_extract_int(__beg, __end, __io, __err, __v); }
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
virtual iter_type
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned long& __v) const
{ return _M_extract_int(__beg, __end, __io, __err, __v); }
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
#ifdef _GLIBCXX_USE_LONG_LONG
virtual iter_type
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, long long& __v) const
{ return _M_extract_int(__beg, __end, __io, __err, __v); }
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
virtual iter_type
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned long long& __v) const
{ return _M_extract_int(__beg, __end, __io, __err, __v); }
#endif
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
float&) const;
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
double&) const;
configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check. 2006-02-07 Jakub Jelinek <jakub@redhat.com> Benjamin Kosnik <bkoz@redhat.com> * configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check. If true, set also port_specific_symbol_files and create as_symver_specs. (GLIBCXX_LDBL_COMPAT): New GLIBCXX_CONDITIONAL. * configure: Rebuilt. * config.h.in: Rebuilt. * config/os/gnu-linux/ldbl-extra.ver: New file. * config/abi/pre/gnu.ver: Make sure no __float128 symbols are exported. * include/bits/c++config (_GLIBCXX_LONG_DOUBLE_COMPAT, _GLIBCXX_LDBL_NAMESPACE, _GLIBCXX_BEGIN_LDBL_NAMESPACE, _GLIBCXX_END_LDBL_NAMESPACE): Define. * include/bits/localefwd.h: Use them to conditionally scope facets. * include/bits/locale_facets.h: Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_get): Add __do_get method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_put): Add __do_put method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_get): Add __do_get method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_put): Add __do_put method. * include/bits/locale_facets.tcc: Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. (std::money_get::__do_get, std::money_put::__do_put, std::num_get::__do_get, std::num_put::__do_put): New specializations. * include/Makefile.am: Conditionally define _GLIBCXX_LONG_DOUBLE_COMPAT in c++config. * include/Makefile.in: Regenerate. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT] (_GLIBCXX_LOC_ID, _GLIBCXX_SYNC_ID): Define, use them. * src/compatibility-ldbl.cc: New file. * src/complex_io.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Add compatibility symbols. * src/limits.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale-misc-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/istream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/ostream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/wlocale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/compatibility.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * config/locale/generic/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * config/locale/gnu/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/Makefile.am (libstdc++-symbol.ver): Append instead of insert in the middle if port specific symbol file requests it. (ldbl_compat_sources): New variable. (sources): Use it. (compatibility-ldbl.lo, compatibility-ldbl.o): New rules. * src/Makefile.in: Rebuilt. * testsuite/testsuite_abi.cc: Recognize GLIBCXX_LDBL_3.4, GLIBCXX_LDBL_3.4.7, CXXABI_LDBL_1.3. Co-Authored-By: Benjamin Kosnik <bkoz@redhat.com> From-SVN: r110725
2006-02-07 23:23:58 +01:00
// XXX GLIBCXX_ABI Deprecated
#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
virtual iter_type
__do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
double&) const;
#else
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
long double&) const;
configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check. 2006-02-07 Jakub Jelinek <jakub@redhat.com> Benjamin Kosnik <bkoz@redhat.com> * configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check. If true, set also port_specific_symbol_files and create as_symver_specs. (GLIBCXX_LDBL_COMPAT): New GLIBCXX_CONDITIONAL. * configure: Rebuilt. * config.h.in: Rebuilt. * config/os/gnu-linux/ldbl-extra.ver: New file. * config/abi/pre/gnu.ver: Make sure no __float128 symbols are exported. * include/bits/c++config (_GLIBCXX_LONG_DOUBLE_COMPAT, _GLIBCXX_LDBL_NAMESPACE, _GLIBCXX_BEGIN_LDBL_NAMESPACE, _GLIBCXX_END_LDBL_NAMESPACE): Define. * include/bits/localefwd.h: Use them to conditionally scope facets. * include/bits/locale_facets.h: Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_get): Add __do_get method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_put): Add __do_put method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_get): Add __do_get method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_put): Add __do_put method. * include/bits/locale_facets.tcc: Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. (std::money_get::__do_get, std::money_put::__do_put, std::num_get::__do_get, std::num_put::__do_put): New specializations. * include/Makefile.am: Conditionally define _GLIBCXX_LONG_DOUBLE_COMPAT in c++config. * include/Makefile.in: Regenerate. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT] (_GLIBCXX_LOC_ID, _GLIBCXX_SYNC_ID): Define, use them. * src/compatibility-ldbl.cc: New file. * src/complex_io.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Add compatibility symbols. * src/limits.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale-misc-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/istream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/ostream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/wlocale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/compatibility.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * config/locale/generic/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * config/locale/gnu/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/Makefile.am (libstdc++-symbol.ver): Append instead of insert in the middle if port specific symbol file requests it. (ldbl_compat_sources): New variable. (sources): Use it. (compatibility-ldbl.lo, compatibility-ldbl.o): New rules. * src/Makefile.in: Rebuilt. * testsuite/testsuite_abi.cc: Recognize GLIBCXX_LDBL_3.4, GLIBCXX_LDBL_3.4.7, CXXABI_LDBL_1.3. Co-Authored-By: Benjamin Kosnik <bkoz@redhat.com> From-SVN: r110725
2006-02-07 23:23:58 +01:00
#endif
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
void*&) const;
configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check. 2006-02-07 Jakub Jelinek <jakub@redhat.com> Benjamin Kosnik <bkoz@redhat.com> * configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check. If true, set also port_specific_symbol_files and create as_symver_specs. (GLIBCXX_LDBL_COMPAT): New GLIBCXX_CONDITIONAL. * configure: Rebuilt. * config.h.in: Rebuilt. * config/os/gnu-linux/ldbl-extra.ver: New file. * config/abi/pre/gnu.ver: Make sure no __float128 symbols are exported. * include/bits/c++config (_GLIBCXX_LONG_DOUBLE_COMPAT, _GLIBCXX_LDBL_NAMESPACE, _GLIBCXX_BEGIN_LDBL_NAMESPACE, _GLIBCXX_END_LDBL_NAMESPACE): Define. * include/bits/localefwd.h: Use them to conditionally scope facets. * include/bits/locale_facets.h: Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_get): Add __do_get method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_put): Add __do_put method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_get): Add __do_get method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_put): Add __do_put method. * include/bits/locale_facets.tcc: Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. (std::money_get::__do_get, std::money_put::__do_put, std::num_get::__do_get, std::num_put::__do_put): New specializations. * include/Makefile.am: Conditionally define _GLIBCXX_LONG_DOUBLE_COMPAT in c++config. * include/Makefile.in: Regenerate. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT] (_GLIBCXX_LOC_ID, _GLIBCXX_SYNC_ID): Define, use them. * src/compatibility-ldbl.cc: New file. * src/complex_io.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Add compatibility symbols. * src/limits.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale-misc-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/istream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/ostream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/wlocale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/compatibility.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * config/locale/generic/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * config/locale/gnu/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/Makefile.am (libstdc++-symbol.ver): Append instead of insert in the middle if port specific symbol file requests it. (ldbl_compat_sources): New variable. (sources): Use it. (compatibility-ldbl.lo, compatibility-ldbl.o): New rules. * src/Makefile.in: Rebuilt. * testsuite/testsuite_abi.cc: Recognize GLIBCXX_LDBL_3.4, GLIBCXX_LDBL_3.4.7, CXXABI_LDBL_1.3. Co-Authored-By: Benjamin Kosnik <bkoz@redhat.com> From-SVN: r110725
2006-02-07 23:23:58 +01:00
// XXX GLIBCXX_ABI Deprecated
#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
long double&) const;
#endif
//@}
};
template<typename _CharT, typename _InIter>
locale::id num_get<_CharT, _InIter>::id;
char_traits.h: Remove generic definitions. 2002-07-30 Benjamin Kosnik <bkoz@redhat.com> Gabriel Dos Reis <gdr@nerim.net> * include/bits/char_traits.h: Remove generic definitions. * include/bits/streambuf_iterator.h (istreambuf_iterator): Use eof, not -2. * include/bits/istream.tcc (istream::readsome): Don't check against eof, instead use constants. (istream::sync): Same. (istream::sentry::sentry): Use eq_int_type. (istream::get): Same. * include/bits/ostream.tcc: Change __pad to __pad<_CharT, _Traits>::_S_pad. * include/bits/locale_facets.h: Add __pad_traits generic and ostreambuf_iterator specialization. * include/bits/locale_facets.tcc: Change __pad into struct __pad with a _CharT and _Traits template parameter and _S_pad static member function. * src/locale-inst.cc: Update __pad instantiations. * include/std/std_fstream.h: Declare _M_underflow_common specializations. * src/fstream.cc: New. Add _M_underflow_common specializations. * include/bits/fstream.tcc (filebuf::close): Use traits_type. (filebuf::_M_underflow_common(bool)): Remove generic version, as sys_ungetc and custom int_types don't get along. * include/std/std_streambuf.h: Add _M_pos. * src/Makefile.am (sources): Add fstream.cc. * src/Makefile.in: Regenerate. * testsuite/21_strings/capacity.cc: Add char_traits specializations. * testsuite/22_locale/codecvt_members_unicode_char.cc: Same. * testsuite/22_locale/codecvt_members_unicode_wchar_t.cc: Same. * testsuite/22_locale/ctor_copy_dtor.cc: Same. * testsuite/27_io/filebuf_virtuals.cc (test07): Move to... * testsuite/27_io/filebuf.cc: ...here. * testsuite/testsuite_hooks.h: Add gnu_char, gnu_int, char_traits specialization for both. * testsuite/27_io/streambuf.cc: Add instantiation test, testsuite_hooks include. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/filebuf.cc: Same. * testsuite/27_io/stringbuf.cc: Same. Co-Authored-By: Gabriel Dos Reis <gdr@nerim.net> From-SVN: r55893
2002-07-31 04:47:36 +02:00
/**
* @brief Primary class template num_put.
* @ingroup locales
*
* This facet encapsulates the code to convert a number to a string. It is
* used by the ostream numeric insertion operators.
*
* The num_put template uses protected virtual functions to provide the
* actual results. The public accessors forward the call to the virtual
* functions. These virtual functions are hooks for developers to
* implement the behavior they require from the num_put facet.
*/
template<typename _CharT, typename _OutIter>
class num_put : public locale::facet
{
public:
// Types:
//@{
/// Public typedefs
typedef _CharT char_type;
typedef _OutIter iter_type;
//@}
/// Numpunct facet id.
static locale::id id;
/**
* @brief Constructor performs initialization.
*
* This is the constructor provided by the standard.
*
* @param refs Passed to the base facet class.
*/
explicit
num_put(size_t __refs = 0) : facet(__refs) { }
/**
* @brief Numeric formatting.
*
* Formats the boolean @a v and inserts it into a stream. It does so
* by calling num_put::do_put().
*
* If ios_base::boolalpha is set, writes ctype<CharT>::truename() or
* ctype<CharT>::falsename(). Otherwise formats @a v as an int.
*
* @param s Stream to write to.
* @param io Source of locale and flags.
* @param fill Char_type to use for filling.
* @param v Value to format and insert.
* @return Iterator after writing.
*/
iter_type
put(iter_type __s, ios_base& __f, char_type __fill, bool __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_put(__s, __f, __fill, __v); }
//@{
/**
* @brief Numeric formatting.
*
* Formats the integral value @a v and inserts it into a
* stream. It does so by calling num_put::do_put().
*
* Formatting is affected by the flag settings in @a io.
*
* The basic format is affected by the value of io.flags() &
* ios_base::basefield. If equal to ios_base::oct, formats like the
* printf %o specifier. Else if equal to ios_base::hex, formats like
* %x or %X with ios_base::uppercase unset or set respectively.
* Otherwise, formats like %d, %ld, %lld for signed and %u, %lu, %llu
* for unsigned values. Note that if both oct and hex are set, neither
* will take effect.
*
* If ios_base::showpos is set, '+' is output before positive values.
* If ios_base::showbase is set, '0' precedes octal values (except 0)
* and '0[xX]' precedes hex values.
*
* Thousands separators are inserted according to numpunct::grouping()
* and numpunct::thousands_sep(). The decimal point character used is
* numpunct::decimal_point().
*
* If io.width() is non-zero, enough @a fill characters are inserted to
* make the result at least that wide. If
* (io.flags() & ios_base::adjustfield) == ios_base::left, result is
* padded at the end. If ios_base::internal, then padding occurs
* immediately after either a '+' or '-' or after '0x' or '0X'.
* Otherwise, padding occurs at the beginning.
*
* @param s Stream to write to.
* @param io Source of locale and flags.
* @param fill Char_type to use for filling.
* @param v Value to format and insert.
* @return Iterator after writing.
*/
iter_type
put(iter_type __s, ios_base& __f, char_type __fill, long __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_put(__s, __f, __fill, __v); }
iter_type
put(iter_type __s, ios_base& __f, char_type __fill,
unsigned long __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_put(__s, __f, __fill, __v); }
#ifdef _GLIBCXX_USE_LONG_LONG
iter_type
put(iter_type __s, ios_base& __f, char_type __fill, long long __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_put(__s, __f, __fill, __v); }
iter_type
put(iter_type __s, ios_base& __f, char_type __fill,
unsigned long long __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_put(__s, __f, __fill, __v); }
#endif
//@}
//@{
/**
* @brief Numeric formatting.
*
* Formats the floating point value @a v and inserts it into a stream.
* It does so by calling num_put::do_put().
*
* Formatting is affected by the flag settings in @a io.
*
* The basic format is affected by the value of io.flags() &
* ios_base::floatfield. If equal to ios_base::fixed, formats like the
* printf %f specifier. Else if equal to ios_base::scientific, formats
* like %e or %E with ios_base::uppercase unset or set respectively.
* Otherwise, formats like %g or %G depending on uppercase. Note that
* if both fixed and scientific are set, the effect will also be like
* %g or %G.
*
* The output precision is given by io.precision(). This precision is
* capped at numeric_limits::digits10 + 2 (different for double and
* long double). The default precision is 6.
*
* If ios_base::showpos is set, '+' is output before positive values.
* If ios_base::showpoint is set, a decimal point will always be
* output.
*
* Thousands separators are inserted according to numpunct::grouping()
* and numpunct::thousands_sep(). The decimal point character used is
* numpunct::decimal_point().
*
* If io.width() is non-zero, enough @a fill characters are inserted to
* make the result at least that wide. If
* (io.flags() & ios_base::adjustfield) == ios_base::left, result is
* padded at the end. If ios_base::internal, then padding occurs
* immediately after either a '+' or '-' or after '0x' or '0X'.
* Otherwise, padding occurs at the beginning.
*
* @param s Stream to write to.
* @param io Source of locale and flags.
* @param fill Char_type to use for filling.
* @param v Value to format and insert.
* @return Iterator after writing.
*/
iter_type
put(iter_type __s, ios_base& __f, char_type __fill, double __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_put(__s, __f, __fill, __v); }
iter_type
put(iter_type __s, ios_base& __f, char_type __fill,
long double __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_put(__s, __f, __fill, __v); }
//@}
/**
* @brief Numeric formatting.
*
* Formats the pointer value @a v and inserts it into a stream. It
* does so by calling num_put::do_put().
*
* This function formats @a v as an unsigned long with ios_base::hex
* and ios_base::showbase set.
*
* @param s Stream to write to.
* @param io Source of locale and flags.
* @param fill Char_type to use for filling.
* @param v Value to format and insert.
* @return Iterator after writing.
*/
iter_type
put(iter_type __s, ios_base& __f, char_type __fill,
const void* __v) const
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
{ return this->do_put(__s, __f, __fill, __v); }
protected:
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
template<typename _ValueT>
iter_type
_M_insert_float(iter_type, ios_base& __io, char_type __fill,
char __mod, _ValueT __v) const;
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
void
_M_group_float(const char* __grouping, size_t __grouping_size,
char_type __sep, const char_type* __p, char_type* __new,
char_type* __cs, int& __len) const;
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
template<typename _ValueT>
iter_type
_M_insert_int(iter_type, ios_base& __io, char_type __fill,
_ValueT __v) const;
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
void
_M_group_int(const char* __grouping, size_t __grouping_size,
char_type __sep, ios_base& __io, char_type* __new,
char_type* __cs, int& __len) const;
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
void
_M_pad(char_type __fill, streamsize __w, ios_base& __io,
char_type* __new, const char_type* __cs, int& __len) const;
Numeric facets cleanup. 2001-11-27 Benjamin Kosnik <bkoz@redhat.com> Numeric facets cleanup. * include/bits/locale_facets.h (__num_base::_S_atoms): Add, remove + and - signs. (__num_base::_M_zero): Add (__num_base::_M_e): Add. (__num_base::_M_E): Add. * include/bits/locale_facets.tcc (num_get::_M_extract): Remove. (num_get::_M_extract_float): New. (num_get::_M_extract_int): New. * src/locale.cc (num_get::_M_extract): Remove. * include/bits/locale_facets.tcc (num_put::_M_insert_float): Simplify, use _M_insert. (num_put::do_put(bool)): Simplify, remove __pad. (__pad): Remove. (__pad_output): Change to __pad. * include/bits/ostream.tcc: And here. * src/locale-inst: Remove instantiations. * include/bits/locale_facets.h: Move helper functions in to class num_put. (num_put::_M_insert_float): Same, for __output_integer. (num_put::_M_insert_int): Same, for __output_float. (num_put::_M_insert): New. (__num_base): Add. (__num_base::_S_format_float): Move __build_float_format into class __num_base. (__num_base::_S_format_int): Move __build_int_format into class __num_base. * include/bits/locale_facets.tcc (__group_digits): Change to (__add_grouping): This. * src/locale-inst.cc: And here. Tweak instantiations. * src/misc-inst.cc: Remove instantiations. * include/bits/ostream.tcc (__pad_char): Rename, adjust inserters for new calling conventions, move to... * include/bits/locale_facets.tcc (__pad_output): Here. Adjust signature to make it useful for both ostream and num_put. (__pad_numeric): Remove. * src/misc-inst.cc: Remove instantiations. * src/locale-inst.cc: Same. * include/bits/locale_facets.h (_Numeric_get): Remove. (_Numeric_put): Remove. (num_get::get(short)): Remove. (num_get::get(int)): Remove. (num_get::do_get(short)): Remove. (num_get::do_get(int)): Remove. * include/bits/istream.tcc (istream::operator>>(short)): Fix as per DR 118. (istream::operator>>(int)): Same. * include/bits/locale_facets.h (_Format_cache): Remove. * include/bits/locale_facets.tcc: Same. * src/locale.cc: Same. * src/locale-inst.cc: Same. * include/bits/ostream.tcc: Same. * src/ios.cc (ios_base::imbue): Remove here as well. * testsuite/22_locale/num_get.cc: New file. * testsuite/22_locale/num_get_members_char.cc: New file. * testsuite/22_locale/num_get_members_wchar_t.cc: New. * testsuite/22_locale/numpunct_members_wchar_t.cc: New file. * testsuite/22_locale/num_put.cc: New file. * testsuite/22_locale/num_put_members_char.cc: New file. * testsuite/22_locale/num_put_members_wchar_t.cc: New file. * testsuite/27_io/ostream_inserter_arith.cc: Fix. * testsuite/27_io/istream_extractor_arith.cc: Fix. From-SVN: r47397
2001-11-28 05:07:11 +01:00
/// Destructor.
virtual
~num_put() { };
//@{
/**
* @brief Numeric formatting.
*
* These functions do the work of formatting numeric values and
* inserting them into a stream. This function is a hook for derived
* classes to change the value returned.
*
* @param s Stream to write to.
* @param io Source of locale and flags.
* @param fill Char_type to use for filling.
* @param v Value to format and insert.
* @return Iterator after writing.
*/
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, bool __v) const;
virtual iter_type
do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
{ return _M_insert_int(__s, __io, __fill, __v); }
virtual iter_type
do_put(iter_type __s, ios_base& __io, char_type __fill,
unsigned long __v) const
{ return _M_insert_int(__s, __io, __fill, __v); }
#ifdef _GLIBCXX_USE_LONG_LONG
virtual iter_type
do_put(iter_type __s, ios_base& __io, char_type __fill,
long long __v) const
{ return _M_insert_int(__s, __io, __fill, __v); }
virtual iter_type
do_put(iter_type __s, ios_base& __io, char_type __fill,
unsigned long long __v) const
{ return _M_insert_int(__s, __io, __fill, __v); }
#endif
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, double __v) const;
configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check. 2006-02-07 Jakub Jelinek <jakub@redhat.com> Benjamin Kosnik <bkoz@redhat.com> * configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check. If true, set also port_specific_symbol_files and create as_symver_specs. (GLIBCXX_LDBL_COMPAT): New GLIBCXX_CONDITIONAL. * configure: Rebuilt. * config.h.in: Rebuilt. * config/os/gnu-linux/ldbl-extra.ver: New file. * config/abi/pre/gnu.ver: Make sure no __float128 symbols are exported. * include/bits/c++config (_GLIBCXX_LONG_DOUBLE_COMPAT, _GLIBCXX_LDBL_NAMESPACE, _GLIBCXX_BEGIN_LDBL_NAMESPACE, _GLIBCXX_END_LDBL_NAMESPACE): Define. * include/bits/localefwd.h: Use them to conditionally scope facets. * include/bits/locale_facets.h: Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_get): Add __do_get method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_put): Add __do_put method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_get): Add __do_get method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_put): Add __do_put method. * include/bits/locale_facets.tcc: Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. (std::money_get::__do_get, std::money_put::__do_put, std::num_get::__do_get, std::num_put::__do_put): New specializations. * include/Makefile.am: Conditionally define _GLIBCXX_LONG_DOUBLE_COMPAT in c++config. * include/Makefile.in: Regenerate. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT] (_GLIBCXX_LOC_ID, _GLIBCXX_SYNC_ID): Define, use them. * src/compatibility-ldbl.cc: New file. * src/complex_io.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Add compatibility symbols. * src/limits.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale-misc-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/istream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/ostream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/wlocale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/compatibility.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * config/locale/generic/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * config/locale/gnu/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/Makefile.am (libstdc++-symbol.ver): Append instead of insert in the middle if port specific symbol file requests it. (ldbl_compat_sources): New variable. (sources): Use it. (compatibility-ldbl.lo, compatibility-ldbl.o): New rules. * src/Makefile.in: Rebuilt. * testsuite/testsuite_abi.cc: Recognize GLIBCXX_LDBL_3.4, GLIBCXX_LDBL_3.4.7, CXXABI_LDBL_1.3. Co-Authored-By: Benjamin Kosnik <bkoz@redhat.com> From-SVN: r110725
2006-02-07 23:23:58 +01:00
// XXX GLIBCXX_ABI Deprecated
#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
virtual iter_type
__do_put(iter_type, ios_base&, char_type __fill, double __v) const;
#else
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, long double __v) const;
configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check. 2006-02-07 Jakub Jelinek <jakub@redhat.com> Benjamin Kosnik <bkoz@redhat.com> * configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check. If true, set also port_specific_symbol_files and create as_symver_specs. (GLIBCXX_LDBL_COMPAT): New GLIBCXX_CONDITIONAL. * configure: Rebuilt. * config.h.in: Rebuilt. * config/os/gnu-linux/ldbl-extra.ver: New file. * config/abi/pre/gnu.ver: Make sure no __float128 symbols are exported. * include/bits/c++config (_GLIBCXX_LONG_DOUBLE_COMPAT, _GLIBCXX_LDBL_NAMESPACE, _GLIBCXX_BEGIN_LDBL_NAMESPACE, _GLIBCXX_END_LDBL_NAMESPACE): Define. * include/bits/localefwd.h: Use them to conditionally scope facets. * include/bits/locale_facets.h: Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_get): Add __do_get method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_put): Add __do_put method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_get): Add __do_get method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_put): Add __do_put method. * include/bits/locale_facets.tcc: Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. (std::money_get::__do_get, std::money_put::__do_put, std::num_get::__do_get, std::num_put::__do_put): New specializations. * include/Makefile.am: Conditionally define _GLIBCXX_LONG_DOUBLE_COMPAT in c++config. * include/Makefile.in: Regenerate. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT] (_GLIBCXX_LOC_ID, _GLIBCXX_SYNC_ID): Define, use them. * src/compatibility-ldbl.cc: New file. * src/complex_io.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Add compatibility symbols. * src/limits.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale-misc-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/istream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/ostream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/wlocale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/compatibility.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * config/locale/generic/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * config/locale/gnu/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/Makefile.am (libstdc++-symbol.ver): Append instead of insert in the middle if port specific symbol file requests it. (ldbl_compat_sources): New variable. (sources): Use it. (compatibility-ldbl.lo, compatibility-ldbl.o): New rules. * src/Makefile.in: Rebuilt. * testsuite/testsuite_abi.cc: Recognize GLIBCXX_LDBL_3.4, GLIBCXX_LDBL_3.4.7, CXXABI_LDBL_1.3. Co-Authored-By: Benjamin Kosnik <bkoz@redhat.com> From-SVN: r110725
2006-02-07 23:23:58 +01:00
#endif
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, const void* __v) const;
configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check. 2006-02-07 Jakub Jelinek <jakub@redhat.com> Benjamin Kosnik <bkoz@redhat.com> * configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check. If true, set also port_specific_symbol_files and create as_symver_specs. (GLIBCXX_LDBL_COMPAT): New GLIBCXX_CONDITIONAL. * configure: Rebuilt. * config.h.in: Rebuilt. * config/os/gnu-linux/ldbl-extra.ver: New file. * config/abi/pre/gnu.ver: Make sure no __float128 symbols are exported. * include/bits/c++config (_GLIBCXX_LONG_DOUBLE_COMPAT, _GLIBCXX_LDBL_NAMESPACE, _GLIBCXX_BEGIN_LDBL_NAMESPACE, _GLIBCXX_END_LDBL_NAMESPACE): Define. * include/bits/localefwd.h: Use them to conditionally scope facets. * include/bits/locale_facets.h: Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_get): Add __do_get method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_put): Add __do_put method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_get): Add __do_get method. [_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_put): Add __do_put method. * include/bits/locale_facets.tcc: Surround std::{money,num}_{get,put} with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE. (std::money_get::__do_get, std::money_put::__do_put, std::num_get::__do_get, std::num_put::__do_put): New specializations. * include/Makefile.am: Conditionally define _GLIBCXX_LONG_DOUBLE_COMPAT in c++config. * include/Makefile.in: Regenerate. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT] (_GLIBCXX_LOC_ID, _GLIBCXX_SYNC_ID): Define, use them. * src/compatibility-ldbl.cc: New file. * src/complex_io.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Add compatibility symbols. * src/limits.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale-misc-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/istream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/ostream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/wlocale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/compatibility.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * config/locale/generic/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * config/locale/gnu/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise. * src/Makefile.am (libstdc++-symbol.ver): Append instead of insert in the middle if port specific symbol file requests it. (ldbl_compat_sources): New variable. (sources): Use it. (compatibility-ldbl.lo, compatibility-ldbl.o): New rules. * src/Makefile.in: Rebuilt. * testsuite/testsuite_abi.cc: Recognize GLIBCXX_LDBL_3.4, GLIBCXX_LDBL_3.4.7, CXXABI_LDBL_1.3. Co-Authored-By: Benjamin Kosnik <bkoz@redhat.com> From-SVN: r110725
2006-02-07 23:23:58 +01:00
// XXX GLIBCXX_ABI Deprecated
#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, long double __v) const;
#endif
//@}
};
template <typename _CharT, typename _OutIter>
locale::id num_put<_CharT, _OutIter>::id;
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
_GLIBCXX_END_NAMESPACE_LDBL
Implement std::messages. 2001-08-07 Benjamin Kosnik <bkoz@redhat.com> Implement std::messages. Make config a fully-nested directory. * config/locale: New directory. * config/c_locale_generic.cc: Move into locale subdirectory. * config/c_locale_generic.h: Same. * config/c_locale_gnu.cc: Same. * config/c_locale_gnu.h: Same. * config/c_locale_ieee_1003.1-200x.cc: Same. * config/c_locale_ieee_1003.1-200x_.h: Same. * config/codecvt_specializations_generic.h: Same. * config/codecvt_specializations_ieee_1003.1-200x.h: Same. * config/messages_members_gnu.h: Same. * config/messaages_members_gnu.cc: Same. * config/messages_members_generic.h: Same. * config/messaages_members_generic.cc: Same. * config/messages_members_ieee_1003.1-200x.h: Same. * config/messaages_members_ieee_1003.1-200x.cc: Same. * config/io: New directory. * config/basic_file_libio.h: Move into io subdirectory. * config/basic_file_libio.cc: Same. * config/c_io_libio.h: Same. * config/c_io_libio_codecvt.c: Same. * config/basic_file_stdio.h: Same. * config/basic_file_stdio.cc: Same. * config/c_io_stdio.h: Same. * po: New directory. * po/POTFILES.in: New file. * po/Makefile.am: New file. * po/Makefile.in: New file. * po/libstdc++.pot: Generic translation file. * po/fr.po: Preliminary French translation. * po/de.po: Preliminary German translation. * intl: New directory. * intl/Makefile.am: New file. * intl/Makefile.in: New file. * intl/string_literals.cc: New file. * acinclude.m4 (GLIBCPP_CONFIGURE): Bump VERSION to 3.1.0. Add requisite setup for gettext. Re-arrange. * aclocal.m4: Regenerate. * configure.in: Don't call GLIBCPP_CHECK_COMPILER_VERSION. Output Makefile bits for po and intl. * configure: Regenerate. * Makefile.am (SUBDIRS): Add intl, po. Add rule for dist. * Makefile.in: Regenerate. * acconfig.h: Add ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY. * config.h.in: Regenerate. * acinclude.m4 (AC_REPLACE_STRINGFUNCS): Remove. * include/Makefile.am (install-data-local): Don't install Makefile. * include/Makefile.in: Regenerate. * include/bits/locale_facet.h (locale::facet::_S_clone_c_locale): Add member. * config/locale/c_locale_gnu.cc (_S_clone_c_locale): Add definition. * config/locale/c_locale_generic.cc: Same. * config/locale/c_locale_ieee_1003.1-200x.cc: Same. * include/bits/codecvt.h: Excise non-standard, non-required bits. This includes __enc_traits, and partial specializations of codecvt for __enc_traits. * src/codecvt.cc (__enc_traits::_S_max_size): Guard * config/codecvt_partials_ieee_1003.1-200x.h: New file. * config/codecvt_partials_generic.h: New file. * include/Makefile.am (allstamps): Add stamp-codecvt_model. (stamp-codecvt_model): Add. * include/Makefile.in: Regenerate. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add in codecvt configury. * aclocal.m4: Regenerate. * configure: Regenerate. * testsuite/22_locale/codecvt_unicode_wchar_t.cc: Use macro guard. * testsuite/22_locale/codecvt_unicode_char.cc: Same. * testsuite/22_locale/ctor_copy_dtor.cc: And here. * include/bits/localefwd.h (class locale::facet): Add __enc_traits as a friend for _S_*_c_locale functions. * include/bits/codecvt.h (__enc_traits::__enc_traits): Add locale argument to default constructor so that CODESET information can be deduced. * include/bits/locale_facets.h (messages_byname): Re-implement. Remove specializations. * src/locale.cc (messages_byname<char>): Remove specialization. (messages_byname<wchar_t>): Same. * config/locale/c_locale_ieee_1003.1-200x.cc: New file. * config/locale/c_locale_ieee_1003.1-200x.h: New file. * config/locale/messages_members_ieee_1003.1-200x.cc: New file. * config/locale/messages_members_ieee_1003.1-200x.h: New file. * config/locale/messages_members_gnu.cc: New file. * config/locale/messages_members_gnu.h: New file. * config/locale/messages_members_generic.cc: New file. * config/locale/messages_members_generic.h: New file. * docs/html/configopts.html: Add documentation for new locale model, ieee_1003.1. Adjust other flags for current defaults. * docs/html/22_locale/locale.html: Update. * docs/html/22_locale/howto.html: Add link to messages.html. Organize. * docs/html/22_locale/messages.html: New. * src/Makefile.am (sources): Add messages_virtuals.cc. * src/Makefile.in: Regenerate. * include/Makefile.am (allstamps): Add stamp-messages_model. (stamp-messages_model): Add. * include/Makefile.in: Regenerate. * acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add in messages configury. * aclocal.m4: Regenerate. * configure: Regenerate. * testsuite_flags.in (--cxxflags): Add LOCALEDIR. * testsuite/lib/libstdc++-v3-dg.exp: Remove broken LD_LIBRARY_PATH bits for Irix. * acinclude (GLIBCPP_ENABLE_CLOCALE): Set glibcpp_localedir to the build directories message catalog base directory, and export. Eventually this should probably be made to deal with build and install directories. For now, punt on this as the library itself doesn't use message catalogs (yet). * testsuite/22_locale/messages.cc: New file. * testsuite/22_locale/messages_char_members.cc: New file. * testsuite/22_locale/messages_byname.cc: New file. From-SVN: r44702
2001-08-08 04:49:01 +02:00
// Subclause convenience interfaces, inlines.
// NB: These are inline because, when used in a loop, some compilers
// can hoist the body out of the loop; then it's just as fast as the
// C is*() function.
/// Convenience interface to ctype.is(ctype_base::space, __c).
template<typename _CharT>
inline bool
isspace(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c); }
/// Convenience interface to ctype.is(ctype_base::print, __c).
template<typename _CharT>
inline bool
isprint(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c); }
/// Convenience interface to ctype.is(ctype_base::cntrl, __c).
template<typename _CharT>
inline bool
iscntrl(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c); }
/// Convenience interface to ctype.is(ctype_base::upper, __c).
template<typename _CharT>
inline bool
isupper(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c); }
/// Convenience interface to ctype.is(ctype_base::lower, __c).
template<typename _CharT>
inline bool
islower(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c); }
/// Convenience interface to ctype.is(ctype_base::alpha, __c).
template<typename _CharT>
inline bool
isalpha(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c); }
/// Convenience interface to ctype.is(ctype_base::digit, __c).
template<typename _CharT>
inline bool
isdigit(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c); }
/// Convenience interface to ctype.is(ctype_base::punct, __c).
template<typename _CharT>
inline bool
ispunct(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c); }
/// Convenience interface to ctype.is(ctype_base::xdigit, __c).
template<typename _CharT>
inline bool
isxdigit(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c); }
/// Convenience interface to ctype.is(ctype_base::alnum, __c).
template<typename _CharT>
inline bool
isalnum(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c); }
/// Convenience interface to ctype.is(ctype_base::graph, __c).
template<typename _CharT>
inline bool
isgraph(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c); }
/// Convenience interface to ctype.toupper(__c).
template<typename _CharT>
inline _CharT
toupper(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).toupper(__c); }
/// Convenience interface to ctype.tolower(__c).
template<typename _CharT>
inline _CharT
tolower(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).tolower(__c); }
c++config: Add in revised namespace associations. 2005-12-18 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Add in revised namespace associations. _GLIBCXX_BEGIN_NAMESPACE: New macro. _GLIBCXX_END_NAMESPACE: Same. _GLIBCXX_BEGIN_NESTED_NAMESPACE: Same. _GLIBCXX_END_NESTED_NAMESPACE: Same. * acinclude.m4 (GLIBCXX_ENABLE_SYMVERS]): Add gnu-versioned-namespace. * configure: Regenerated. * config.h.in: Same. * config/abi/pre/gnu-versioned-namespace.ver: New. * config/abi/pre/gnu.ver (GLIBCXX_3.4.7): Add exports for nested debug mode items. * include/Makefile.am (${host_builddir}/c++config.h): Fill in values for __GLIBCXX__ and _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION. * include/Makefile.in: Regnerate. * src/compatibility.cc: Alias new, nested definitions to exported symbols from non-nested __gnu_debug. * src/Makefile.am: Add in ENABLE_SYMVERS_GNU_NAMESPACE. * src/Makefile.in: Regenerate. * docs/html/debug_mode.html: Revise for nested design. * docs/html/debug.html: Use debug qualifications instead of __gnu_debug. * docs/html/configopts.html: Revise documentation for --enable-symvers. * include/debug/formatter: Simplify namespace qualifications for current, nested-only reality. Add top-level namespace alias, namespace debug, for debug-mode containers. * include/debug/safe_iterator.h: Same. * include/debug/set.h: Same. * include/debug/hash_multimap.h: Same. * include/debug/hash_set.h: Same. * include/debug/bitset * include/debug/safe_sequence.h: Same. * include/debug/multiset.h: Same. * include/debug/safe_base.h: Same. * include/debug/functions.h: Same. * include/debug/safe_iterator.tcc * include/debug/hash_multiset.h: Same. * include/debug/vector * include/debug/map.h: Same. * include/debug/deque * include/debug/hash_map.h: Same. * include/debug/string * include/debug/macros.h: Same. * include/debug/list * include/debug/debug.h: Same. * include/debug/multimap.h: Same. * src/debug.cc: Same. * testsuite/23_containers/vector/invalidation/1.cc: Cleanups. * testsuite/23_containers/vector/invalidation/2.cc: Same. * testsuite/23_containers/vector/invalidation/3.cc: Same. * testsuite/23_containers/vector/invalidation/4.cc: Same. * testsuite/23_containers/deque/invalidation/1.cc: Same. * testsuite/23_containers/deque/invalidation/2.cc: Same. * testsuite/23_containers/deque/invalidation/3.cc: Same. * testsuite/23_containers/deque/invalidation/4.cc: Same. * testsuite/23_containers/multiset/invalidation/1.cc: Same. * testsuite/23_containers/multiset/invalidation/2.cc: Same. * testsuite/23_containers/multimap/invalidation/1.cc: Same. * testsuite/23_containers/multimap/invalidation/2.cc: Same. * testsuite/23_containers/bitset/invalidation/1.cc: Same. * testsuite/23_containers/bitset/cons/16020.cc: Same. * testsuite/23_containers/bitset/operations/13838.cc: Same. * testsuite/23_containers/list/invalidation/1.cc: Same. * testsuite/23_containers/list/invalidation/2.cc: Same. * testsuite/23_containers/list/invalidation/3.cc: Same. * testsuite/23_containers/list/invalidation/4.cc: Same. * testsuite/23_containers/set/invalidation/1.cc: Same. * testsuite/23_containers/set/invalidation/2.cc: Same. * testsuite/23_containers/map/invalidation/1.cc: Same. * testsuite/23_containers/map/invalidation/2.cc: Same. * testsuite/23_containers/map/insert/16813.cc: Same. * include/bits/basic_ios.h: Use _GLIBCXX_BEGIN_NAMESPACE(std) and friends. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_algobase.h: Same. * include/bits/localefwd.h: Same. * include/bits/valarray_array.tcc: Same. * include/bits/valarray_after.h: Same. * include/bits/gslice_array.h: Same. * include/bits/stl_queue.h: Same. * include/bits/gslice.h: Same. * include/bits/locale_facets.tcc: Same. * include/bits/locale_classes.h: Same. * include/bits/stl_set.h: Same. * include/bits/locale_facets.h: Same. * include/bits/stl_stack.h: Same. * include/bits/stl_iterator_base_types.h: Same. * include/bits/stl_heap.h: Same. * include/bits/indirect_array.h: Same. * include/bits/atomicity.h: Same. * include/bits/stream_iterator.h: Same. * include/bits/concurrence.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_pair.h: Same. * include/bits/basic_ios.tcc: Same. * include/bits/stl_raw_storage_iter.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_numeric.h: Same. * include/bits/ios_base.h: Same. * include/bits/stl_deque.h: Same. * include/bits/istream.tcc: Same. * include/bits/postypes.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/mask_array.h: Same. * include/bits/stl_uninitialized.h: Same. * include/bits/ostream.tcc: Same. * include/bits/slice_array.h: Same. * include/bits/boost_concept_check.h: Same. * include/bits/sstream.tcc: Same. * include/bits/stl_iterator_base_funcs.h: Same. * include/bits/char_traits.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stringfwd.h: Same. * include/bits/c++config * include/bits/stl_iterator.h: Same. * include/bits/valarray_array.h: Same. * include/bits/stl_tempbuf.h: Same. * include/bits/vector.tcc: Same. * include/bits/deque.tcc: Same. * include/bits/stl_bvector.h: Same. * include/bits/basic_string.tcc: Same. * include/bits/list.tcc: Same. * include/bits/streambuf_iterator.h: Same. * include/bits/valarray_before.h: Same. * include/bits/stl_construct.h: Same. * include/bits/stl_function.h: Same. * include/bits/cpp_type_traits.h: Same. * include/bits/streambuf.tcc: Same. * include/bits/allocator.h: Same. * include/bits/stl_tree.h: Same. * include/bits/fstream.tcc: Same. * include/bits/stl_relops.h: Same. * include/bits/functexcept.h: Same. * include/std/std_valarray.h: Same. * include/std/std_iostream.h: Same. * include/std/std_streambuf.h: Same. * include/std/std_bitset.h: Same. * include/std/std_iosfwd.h: Same. * include/std/std_iomanip.h: Same. * include/std/std_fstream.h: Same. * include/std/std_limits.h: Same. * include/std/std_stdexcept.h: Same. * include/std/std_istream.h: Same. * include/std/std_complex.h: Same. * include/std/std_memory.h: Same. * include/std/std_ostream.h: Same. * include/std/std_sstream.h: Same. * include/c_std/std_csignal.h: Same. * include/c_std/std_cstdlib.h: Same. * include/c_std/std_cstdio.h: Same. * include/c_std/std_cstdarg.h: Same. * include/c_std/std_cctype.h: Same. * include/c_std/std_cmath.h: Same. * include/c_std/std_ctime.h: Same. * include/c_std/std_clocale.h: Same. * include/c_std/std_csetjmp.h: Same. * include/c_std/std_cwchar.h: Same. * include/c_std/std_cstring.h: Same. * include/c_std/std_cstddef.h: Same. * include/c_std/std_cwctype.h: Same. * include/backward/iterator.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/strstream * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * src/allocator-inst.cc: Same. * src/complex_io.cc: Same. * src/localename.cc: Same. * src/limits.cc: Same. * src/ios_failure.cc: Same. * src/locale-misc-inst.cc: Same. * src/streambuf-inst.cc: Same. * src/misc-inst.cc: Same. * src/concept-inst.cc: Same. * src/ios_locale.cc: Same. * src/pool_allocator.cc: Same. * src/fstream-inst.cc: Same. * src/istream-inst.cc: Same. * src/string-inst.cc: Same. * src/locale_init.cc: Same. * src/ctype.cc: Same. * src/strstream.cc: Same. * src/ostream-inst.cc: Same. * src/functexcept.cc: Same. * src/streambuf.cc: Same. * src/sstream-inst.cc: Same. * src/ios.cc: Same. * src/valarray-inst.cc: Same. * src/locale.cc: Same. * src/tree.cc: Same. * src/stdexcept.cc: Same. * src/istream.cc: Same. * src/compatibility.cc: Same. * src/locale-inst.cc: Same. * src/globals_io.cc: Same. * src/list.cc: Same. * src/ios_init.cc: Same. * src/locale_facets.cc: Same. * src/codecvt.cc: Same. * include/tr1/unordered_map: Use _GLIBCXX_BEGIN_NAMESPACE(tr1). * include/tr1/boost_shared_ptr.h: Same. * include/tr1/tuple * include/tr1/hashtable * include/tr1/type_traits_fwd.h: Same. * include/tr1/unordered_set * include/tr1/functional * include/tr1/ref_fwd.h: Same. * include/tr1/utility * include/tr1/type_traits * include/tr1/array * include/ext/hashtable.h: Use _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx). * include/ext/typelist.h: Same. * include/ext/hash_map: Same. * include/ext/rc_string_base.h: Same. * include/ext/pool_allocator.h: Same. * include/ext/iterator: Same. * include/ext/rb_tree: Same. * include/ext/numeric: Same. * include/ext/vstring.tcc: Same. * include/ext/sso_string_base.h: Same. * include/ext/stdio_filebuf.h: Same. * include/ext/algorithm: Same. * include/ext/codecvt_specializations.h: Same. * include/ext/new_allocator.h: Same. * include/ext/array_allocator.h: Same. * include/ext/vstring_util.h: Same. * include/ext/vstring_fwd.h: Same. * include/ext/mt_allocator.h: Same. * include/ext/debug_allocator.h: Same. * include/ext/slist: Same. * include/ext/stdio_sync_filebuf.h: Same. * include/ext/hash_fun.h: Same. * include/ext/malloc_allocator.h: Same. * include/ext/functional: Same. * include/ext/bitmap_allocator.h: Same. * include/ext/pod_char_traits.h: Same. * include/ext/vstring.h: Same. * include/ext/ropeimpl.h: Same. * include/ext/hash_set: Same. * include/ext/memory: Same. * include/ext/rope: Same. * include/bits/boost_concept_check.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/char_traits.h: Same. * include/bits/cpp_type_traits.h: Same. * include/bits/concurrence.h: Same. * include/bits/atomicity.h: Same. * config/locale/gnu/numeric_members.cc: Same. * config/locale/gnu/collate_members.cc: Same. * config/locale/gnu/ctype_members.cc: Same. * config/locale/gnu/c_locale.cc: Same. * config/locale/gnu/codecvt_members.cc: Same. * config/locale/gnu/messages_members.cc: Same. * config/locale/gnu/c_locale.h: Same. * config/locale/gnu/monetary_members.cc: Same. * config/locale/gnu/time_members.cc: Same. * config/locale/ieee_1003.1-2001/c_locale.h: Same. * config/locale/generic/numeric_members.cc: Same. * config/locale/generic/collate_members.cc: Same. * config/locale/generic/ctype_members.cc: Same. * config/locale/generic/c_locale.cc: Same. * config/locale/generic/codecvt_members.cc: Same. * config/locale/generic/messages_members.cc: Same. * config/locale/generic/c_locale.h: Same. * config/locale/generic/monetary_members.cc: Same. * config/locale/generic/time_members.cc: Same. * config/os/aix/atomicity.h: Same. * config/os/irix/atomicity.h: Same. * config/cpu/powerpc/atomicity.h: Same. * config/cpu/cris/atomicity.h: Same. * config/cpu/ia64/atomicity.h: Same. * config/cpu/alpha/atomicity.h: Same. * config/cpu/m68k/atomicity.h: Same. * config/cpu/hppa/atomicity.h: Same. * config/cpu/mips/atomicity.h: Same. * config/cpu/sparc/atomicity.h: Same. * config/cpu/i386/atomicity.h: Same. * config/cpu/i486/atomicity.h: Same. * config/cpu/sh/atomicity.h: Same. * config/cpu/generic/atomicity.h: Same. * config/cpu/s390/atomicity.h: Same. * config/io/c_io_stdio.h: Same. * config/io/basic_file_stdio.cc: Same. * config/io/basic_file_stdio.h: Same. * src/misc-inst.cc: Same. * src/concept-inst.cc: Same. * src/ext-inst.cc: Same. * src/string-inst.cc: Same. * src/pool_allocator.cc: Same. * src/bitmap_allocator.cc: Same. * src/mt_allocator.cc: Same. * libsupc++/exception: Same. * libsupc++/vterminate.cc: Same. * testsuite/ext/hash_map/1.cc: Explicitly qualify __gnu_cxx::hash_map. * testsuite/ext/hash_map/14648.cc: Same. * libsupc++/eh_alloc.cc: Correct comment line spacing. From-SVN: r108775
2005-12-19 01:56:05 +01:00
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
# include <bits/locale_facets.tcc>
#endif