gcc/libstdc++-v3/testsuite/util/testsuite_character.h

541 lines
13 KiB
C
Raw Normal View History

re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
// -*- C++ -*-
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
// Testing character type and state type with char_traits and codecvt
// specializations for the C++ library testsuite.
//
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
//
// 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 2, 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.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
// USA.
//
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _GLIBCXX_TESTSUITE_CHARACTER_H
#define _GLIBCXX_TESTSUITE_CHARACTER_H
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
#include <climits>
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
#include <string> // for char_traits
#include <locale> // for codecvt
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
#include <ext/pod_char_traits.h>
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
namespace __gnu_test
{
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
struct pod_int
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
{
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
int value;
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
};
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
inline bool
operator==(const pod_int& lhs, const pod_int& rhs)
{ return lhs.value == rhs.value; }
inline bool
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
operator<(const pod_int& lhs, const pod_int& rhs)
{ return lhs.value < rhs.value; }
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
struct pod_state
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
{
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
unsigned long value;
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
};
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
inline bool
operator==(const pod_state& lhs, const pod_state& rhs)
{ return lhs.value == rhs.value; }
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
inline bool
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
operator<(const pod_state& lhs, const pod_state& rhs)
{ return lhs.value < rhs.value; }
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
// Alternate character types.
using __gnu_cxx::character;
typedef character<unsigned char, pod_int, pod_state> pod_char;
typedef character<unsigned char, unsigned int, pod_state> pod_uchar;
typedef character<unsigned short, unsigned int> pod_ushort;
typedef character<unsigned int, unsigned long> pod_uint;
}
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
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
namespace __gnu_cxx
{
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
// Specializations.
// pod_char
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
template<>
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
template<typename V2>
inline __gnu_test::pod_char::char_type
__gnu_test::pod_char::char_type::from(const V2& v)
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
{
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
char_type ret = { static_cast<value_type>(v.value) };
return ret;
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
}
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
template<>
template<typename V2>
inline V2
__gnu_test::pod_char::char_type::to(const char_type& c)
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
{
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
V2 ret = { c.value };
return ret;
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
}
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
template<>
template<typename V2>
inline __gnu_test::pod_uchar::char_type
__gnu_test::pod_uchar::char_type::from(const V2& v)
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
{
char_type ret;
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
ret.value = (v >> 5);
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
return ret;
}
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
template<>
template<typename V2>
inline V2
__gnu_test::pod_uchar::char_type::to(const char_type& c)
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
{ return static_cast<V2>(c.value << 5); }
}; // namespace __gnu_test
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
namespace std
{
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
// codecvt specialization
//
// The conversion performed by the specialization is not supposed to
// be useful, rather it has been designed to demonstrate the
// essential features of stateful conversions:
// * Number and value of bytes for each internal character depends on the
// state in addition to the character itself.
// * Unshift produces an unshift sequence and resets the state. On input
// the unshift sequence causes the state to be reset.
//
// The conversion for output is as follows:
// 1. Calculate the value tmp by xor-ing the state and the internal
// character
// 2. Split tmp into either two or three bytes depending on the value of
// state. Output those bytes.
// 3. tmp becomes the new value of state.
template<>
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
class codecvt<__gnu_test::pod_uchar, char, __gnu_test::pod_state>
: public __codecvt_abstract_base<__gnu_test::pod_uchar, char,
__gnu_test::pod_state>
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
{
public:
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
typedef codecvt_base::result result;
typedef __gnu_test::pod_uchar intern_type;
typedef char extern_type;
typedef __gnu_test::pod_state state_type;
typedef __codecvt_abstract_base<intern_type, extern_type, state_type>
base_type;
explicit codecvt(size_t refs = 0) : base_type(refs)
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
{ }
static locale::id id;
protected:
~codecvt()
{ }
virtual result
do_out(state_type& state, const intern_type* from,
const intern_type* from_end, const intern_type*& from_next,
extern_type* to, extern_type* to_limit,
extern_type*& to_next) const
{
while (from < from_end && to < to_limit)
{
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
unsigned char tmp = (state.value ^ from->value);
if (state.value & 0x8)
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
{
if (to >= to_limit - 2)
break;
*to++ = (tmp & 0x7);
*to++ = ((tmp >> 3) & 0x7);
*to++ = ((tmp >> 6) & 0x3);
}
else
{
if (to >= to_limit - 1)
break;
*to++ = (tmp & 0xf);
*to++ = ((tmp >> 4) & 0xf);
}
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
state.value = tmp;
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
++from;
}
from_next = from;
to_next = to;
return (from < from_end) ? partial : ok;
}
virtual result
do_in(state_type& state, const extern_type* from,
const extern_type* from_end, const extern_type*& from_next,
intern_type* to, intern_type* to_limit,
intern_type*& to_next) const
{
while (from < from_end && to < to_limit)
{
unsigned char c = *from;
if (c & 0xc0)
{
// Unshift sequence
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
state.value &= c;
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
++from;
continue;
}
unsigned char tmp;
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
if (state.value & 0x8)
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
{
if (from >= from_end - 2)
break;
tmp = (*from++ & 0x7);
tmp |= ((*from++ << 3) & 0x38);
tmp |= ((*from++ << 6) & 0xc0);
}
else
{
if (from >= from_end - 1)
break;
tmp = (*from++ & 0xf);
tmp |= ((*from++ << 4) & 0xf0);
}
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
to->value = (tmp ^ state.value);
state.value = tmp;
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
++to;
}
from_next = from;
to_next = to;
return (from < from_end) ? partial : ok;
}
virtual result
do_unshift(state_type& state, extern_type* to, extern_type* to_limit,
extern_type*& to_next) const
{
for (unsigned int i = 0; i < CHAR_BIT; ++i)
{
unsigned int mask = (1 << i);
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
if (state.value & mask)
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
{
if (to == to_limit)
{
to_next = to;
return partial;
}
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
state.value &= ~mask;
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
*to++ = static_cast<unsigned char>(~mask);
}
}
to_next = to;
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
return state.value == 0 ? ok : error;
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
}
virtual int
do_encoding() const throw()
{ return -1; }
virtual bool
do_always_noconv() const throw()
{ return false; }
virtual int
do_length(state_type& state, const extern_type* from,
const extern_type* end, size_t max) const
{
const extern_type* beg = from;
while (from < end && max)
{
unsigned char c = *from;
if (c & 0xc0)
{
// Unshift sequence
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
state.value &= c;
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
++from;
continue;
}
unsigned char tmp;
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
if (state.value & 0x8)
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
{
if (from >= end - 2)
break;
tmp = (*from++ & 0x7);
tmp |= ((*from++ << 3) & 0x38);
tmp |= ((*from++ << 6) & 0xc0);
}
else
{
if (from >= end - 1)
break;
tmp = (*from++ & 0xf);
tmp |= ((*from++ << 4) & 0xf0);
}
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
state.value = tmp;
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
--max;
}
return from - beg;
}
// Maximum 8 bytes unshift sequence followed by max 3 bytes for
// one character.
virtual int
do_max_length() const throw()
{ return 11; }
};
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
template<>
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
class ctype<__gnu_test::pod_uchar>
: public __ctype_abstract_base<__gnu_test::pod_uchar>
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
{
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
public:
typedef __gnu_test::pod_uchar char_type;
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
explicit ctype(size_t refs = 0)
: __ctype_abstract_base<__gnu_test::pod_uchar>(refs) { }
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
static locale::id id;
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
protected:
~ctype()
{ }
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
virtual bool
mt_allocator.h (__mt_alloc::__mt_alloc): Remove name of unused parameter. 2005-12-26 Chris Jefferson <chris@bubblescope.net> * include/ext/mt_allocator.h (__mt_alloc::__mt_alloc): Remove name of unused parameter. * include/bits/stream_iterator.h (istream_iterator::istream_iterator): Construct _M_value. * include/debug/functions.h (__check_valid_range): Add __attribute__((unused)). * include/tr1/hashtable (hashtable::end): Remove name of unused parameter. * include/tr1/tuple_iterate.h (tuple::tuple): Likewise. (tuple::operator=): Add __attribute__((unused)). * include/tr1/functional (Fnv_hash<4>::hash): Add static_cast. (Fnv_hash<8>::hash): Likewise. * testsuite/25_algorithms/iter_swap/20577.cc (swap): Remove name of unused parameter. * testsuite/25_algorithms/unique_copy/check_type.cc (S2::S2,X2::X2): Likewise. * testsuite/22_locale/ctype/narrow/char/19955.cc (do_narrow): Likewise. * testsuite/22_locale/ctype/is/char/9858.cc (Derived::do_is, Derived::do_scan_is, Derived::do_scan_not, Derived2::do_is, Derived2::do_scan_is, Derived2::do_scan_not): Likewise. * testsuite/22_locale/time_put/put/wchar_t/12439_1.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/wchar_t/12439_3.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/char/12439_1.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/char/12439_3.cc (TP::do_put): Likewise. * testsuite/testsuite_io.h (fail_num_get::do_get, fail_num_put::do_put): Likewise. * testsuite/25_algorithms/find/17441.cc (find): Likewise. * testsuite/23_containers/vector/cons/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/vector/bool/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/list/cons/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/set/modifiers/16728.cc (test_container): Likewise. * testsuite/27_io/basic_ios/cons/char/3.cc (char_traits::to_char_type, to_int_type): Likewise. * testsuite/27_io/basic_filebuf/imbue/12206.cc (codecvt::do_out, do_in, do_unshift, do_length): Likewise. * testsuite/21_strings/basic_string/capacity/1.cc (operator==(A<T>,A<T>), operator<(A<T>,A<T>), char_traits::to_char_type, char_traits::to_int_type): Likewise * testsuite/testsuite_character.h (ctype::do_is, ctype::do_scan_is, ctype::do_scan_not, do_toupper, do_tolower): Likewise. * testsuite/25_algorithms/replace_copy/check_type.cc (Z::operator=): Add missing return statement. * testsuite/25_algorithms/replace_copy_if/check_type.cc (Z::operator=): Likewise. * testsuite/testsuite_iterators.h (output_iterator_wrapper::operator=, random_access_iterator_wrapper::operator==): Likewise. * testsuite/20_util/functional/binders/1.cc (s::f_int_int_const, s::f_int_int, s::f_int_void_const, s::f_int_void): Likewise. * testsuite/27_io/types/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/write/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/write/char/1.cc (test01): Likewise. * testsuite/21_strings/c_strings/wchar_t/24559.cc (main): Likewise. * testsuite/27_io/basic_istream/ignore/wchar_t/2.cc (check): Add static cast. * testsuite/27_io/basic_istream/ignore/char/2.cc (check): Likewise. * testsuite/27_io/basic_istream/getline/wchar_t/5.cc (check): Likewise. * testsuite/27_io/basic_istream/getline/char/5.cc (check): Likewise. * testsuite/testsuite_allocator.h (check_new): Likewise. (check_deallocate_null): Add missing return value. * testsuite/ext/pool_allocator/allocate_chunk.cc (test01): Make variable unsigned. * testsuite/23_containers/vector/modifiers/erase/1.cc (N,N1,N2,N3,N4, N5,test01): Likewise. * testsuite/26_numerics/valarray/valarray_subset_assignment.cc (check_array): Likewise. (main): Removed unused variable. * testsuite/27_io/basic_streambuf/in_avail/wchar_t/1.cc (test05): Removed unused variable. * testsuite/27_io/basic_ostream/flush/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/flush/char/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/endl/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/endl/char/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/ends/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/ends/char/1.cc (test01): Likewise. * testsuite/tr1/2_general_utilities/memory/shared_ptr/ assign/shared_ptr.cc (test01): Correct return type. * testsuite/27_io/basic_filebuf/close/char/2.cc (test_02): Add default value to close_num. From-SVN: r109062
2005-12-26 11:53:42 +01:00
do_is(mask, char_type) const
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
{ return false; }
virtual const char_type*
do_is(const char_type* low, const char_type* high, mask* vec) const
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
{
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
fill_n(vec, high - low, mask());
return high;
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
}
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
virtual const char_type*
mt_allocator.h (__mt_alloc::__mt_alloc): Remove name of unused parameter. 2005-12-26 Chris Jefferson <chris@bubblescope.net> * include/ext/mt_allocator.h (__mt_alloc::__mt_alloc): Remove name of unused parameter. * include/bits/stream_iterator.h (istream_iterator::istream_iterator): Construct _M_value. * include/debug/functions.h (__check_valid_range): Add __attribute__((unused)). * include/tr1/hashtable (hashtable::end): Remove name of unused parameter. * include/tr1/tuple_iterate.h (tuple::tuple): Likewise. (tuple::operator=): Add __attribute__((unused)). * include/tr1/functional (Fnv_hash<4>::hash): Add static_cast. (Fnv_hash<8>::hash): Likewise. * testsuite/25_algorithms/iter_swap/20577.cc (swap): Remove name of unused parameter. * testsuite/25_algorithms/unique_copy/check_type.cc (S2::S2,X2::X2): Likewise. * testsuite/22_locale/ctype/narrow/char/19955.cc (do_narrow): Likewise. * testsuite/22_locale/ctype/is/char/9858.cc (Derived::do_is, Derived::do_scan_is, Derived::do_scan_not, Derived2::do_is, Derived2::do_scan_is, Derived2::do_scan_not): Likewise. * testsuite/22_locale/time_put/put/wchar_t/12439_1.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/wchar_t/12439_3.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/char/12439_1.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/char/12439_3.cc (TP::do_put): Likewise. * testsuite/testsuite_io.h (fail_num_get::do_get, fail_num_put::do_put): Likewise. * testsuite/25_algorithms/find/17441.cc (find): Likewise. * testsuite/23_containers/vector/cons/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/vector/bool/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/list/cons/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/set/modifiers/16728.cc (test_container): Likewise. * testsuite/27_io/basic_ios/cons/char/3.cc (char_traits::to_char_type, to_int_type): Likewise. * testsuite/27_io/basic_filebuf/imbue/12206.cc (codecvt::do_out, do_in, do_unshift, do_length): Likewise. * testsuite/21_strings/basic_string/capacity/1.cc (operator==(A<T>,A<T>), operator<(A<T>,A<T>), char_traits::to_char_type, char_traits::to_int_type): Likewise * testsuite/testsuite_character.h (ctype::do_is, ctype::do_scan_is, ctype::do_scan_not, do_toupper, do_tolower): Likewise. * testsuite/25_algorithms/replace_copy/check_type.cc (Z::operator=): Add missing return statement. * testsuite/25_algorithms/replace_copy_if/check_type.cc (Z::operator=): Likewise. * testsuite/testsuite_iterators.h (output_iterator_wrapper::operator=, random_access_iterator_wrapper::operator==): Likewise. * testsuite/20_util/functional/binders/1.cc (s::f_int_int_const, s::f_int_int, s::f_int_void_const, s::f_int_void): Likewise. * testsuite/27_io/types/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/write/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/write/char/1.cc (test01): Likewise. * testsuite/21_strings/c_strings/wchar_t/24559.cc (main): Likewise. * testsuite/27_io/basic_istream/ignore/wchar_t/2.cc (check): Add static cast. * testsuite/27_io/basic_istream/ignore/char/2.cc (check): Likewise. * testsuite/27_io/basic_istream/getline/wchar_t/5.cc (check): Likewise. * testsuite/27_io/basic_istream/getline/char/5.cc (check): Likewise. * testsuite/testsuite_allocator.h (check_new): Likewise. (check_deallocate_null): Add missing return value. * testsuite/ext/pool_allocator/allocate_chunk.cc (test01): Make variable unsigned. * testsuite/23_containers/vector/modifiers/erase/1.cc (N,N1,N2,N3,N4, N5,test01): Likewise. * testsuite/26_numerics/valarray/valarray_subset_assignment.cc (check_array): Likewise. (main): Removed unused variable. * testsuite/27_io/basic_streambuf/in_avail/wchar_t/1.cc (test05): Removed unused variable. * testsuite/27_io/basic_ostream/flush/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/flush/char/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/endl/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/endl/char/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/ends/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/ends/char/1.cc (test01): Likewise. * testsuite/tr1/2_general_utilities/memory/shared_ptr/ assign/shared_ptr.cc (test01): Correct return type. * testsuite/27_io/basic_filebuf/close/char/2.cc (test_02): Add default value to close_num. From-SVN: r109062
2005-12-26 11:53:42 +01:00
do_scan_is(mask, const char_type*, const char_type* high) const
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
{ return high; }
virtual const char_type*
mt_allocator.h (__mt_alloc::__mt_alloc): Remove name of unused parameter. 2005-12-26 Chris Jefferson <chris@bubblescope.net> * include/ext/mt_allocator.h (__mt_alloc::__mt_alloc): Remove name of unused parameter. * include/bits/stream_iterator.h (istream_iterator::istream_iterator): Construct _M_value. * include/debug/functions.h (__check_valid_range): Add __attribute__((unused)). * include/tr1/hashtable (hashtable::end): Remove name of unused parameter. * include/tr1/tuple_iterate.h (tuple::tuple): Likewise. (tuple::operator=): Add __attribute__((unused)). * include/tr1/functional (Fnv_hash<4>::hash): Add static_cast. (Fnv_hash<8>::hash): Likewise. * testsuite/25_algorithms/iter_swap/20577.cc (swap): Remove name of unused parameter. * testsuite/25_algorithms/unique_copy/check_type.cc (S2::S2,X2::X2): Likewise. * testsuite/22_locale/ctype/narrow/char/19955.cc (do_narrow): Likewise. * testsuite/22_locale/ctype/is/char/9858.cc (Derived::do_is, Derived::do_scan_is, Derived::do_scan_not, Derived2::do_is, Derived2::do_scan_is, Derived2::do_scan_not): Likewise. * testsuite/22_locale/time_put/put/wchar_t/12439_1.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/wchar_t/12439_3.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/char/12439_1.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/char/12439_3.cc (TP::do_put): Likewise. * testsuite/testsuite_io.h (fail_num_get::do_get, fail_num_put::do_put): Likewise. * testsuite/25_algorithms/find/17441.cc (find): Likewise. * testsuite/23_containers/vector/cons/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/vector/bool/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/list/cons/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/set/modifiers/16728.cc (test_container): Likewise. * testsuite/27_io/basic_ios/cons/char/3.cc (char_traits::to_char_type, to_int_type): Likewise. * testsuite/27_io/basic_filebuf/imbue/12206.cc (codecvt::do_out, do_in, do_unshift, do_length): Likewise. * testsuite/21_strings/basic_string/capacity/1.cc (operator==(A<T>,A<T>), operator<(A<T>,A<T>), char_traits::to_char_type, char_traits::to_int_type): Likewise * testsuite/testsuite_character.h (ctype::do_is, ctype::do_scan_is, ctype::do_scan_not, do_toupper, do_tolower): Likewise. * testsuite/25_algorithms/replace_copy/check_type.cc (Z::operator=): Add missing return statement. * testsuite/25_algorithms/replace_copy_if/check_type.cc (Z::operator=): Likewise. * testsuite/testsuite_iterators.h (output_iterator_wrapper::operator=, random_access_iterator_wrapper::operator==): Likewise. * testsuite/20_util/functional/binders/1.cc (s::f_int_int_const, s::f_int_int, s::f_int_void_const, s::f_int_void): Likewise. * testsuite/27_io/types/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/write/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/write/char/1.cc (test01): Likewise. * testsuite/21_strings/c_strings/wchar_t/24559.cc (main): Likewise. * testsuite/27_io/basic_istream/ignore/wchar_t/2.cc (check): Add static cast. * testsuite/27_io/basic_istream/ignore/char/2.cc (check): Likewise. * testsuite/27_io/basic_istream/getline/wchar_t/5.cc (check): Likewise. * testsuite/27_io/basic_istream/getline/char/5.cc (check): Likewise. * testsuite/testsuite_allocator.h (check_new): Likewise. (check_deallocate_null): Add missing return value. * testsuite/ext/pool_allocator/allocate_chunk.cc (test01): Make variable unsigned. * testsuite/23_containers/vector/modifiers/erase/1.cc (N,N1,N2,N3,N4, N5,test01): Likewise. * testsuite/26_numerics/valarray/valarray_subset_assignment.cc (check_array): Likewise. (main): Removed unused variable. * testsuite/27_io/basic_streambuf/in_avail/wchar_t/1.cc (test05): Removed unused variable. * testsuite/27_io/basic_ostream/flush/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/flush/char/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/endl/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/endl/char/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/ends/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/ends/char/1.cc (test01): Likewise. * testsuite/tr1/2_general_utilities/memory/shared_ptr/ assign/shared_ptr.cc (test01): Correct return type. * testsuite/27_io/basic_filebuf/close/char/2.cc (test_02): Add default value to close_num. From-SVN: r109062
2005-12-26 11:53:42 +01:00
do_scan_not(mask, const char_type* low, const char_type*) const
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
{ return low; }
virtual char_type
do_toupper(char_type c) const
{ return c; }
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
virtual const char_type*
mt_allocator.h (__mt_alloc::__mt_alloc): Remove name of unused parameter. 2005-12-26 Chris Jefferson <chris@bubblescope.net> * include/ext/mt_allocator.h (__mt_alloc::__mt_alloc): Remove name of unused parameter. * include/bits/stream_iterator.h (istream_iterator::istream_iterator): Construct _M_value. * include/debug/functions.h (__check_valid_range): Add __attribute__((unused)). * include/tr1/hashtable (hashtable::end): Remove name of unused parameter. * include/tr1/tuple_iterate.h (tuple::tuple): Likewise. (tuple::operator=): Add __attribute__((unused)). * include/tr1/functional (Fnv_hash<4>::hash): Add static_cast. (Fnv_hash<8>::hash): Likewise. * testsuite/25_algorithms/iter_swap/20577.cc (swap): Remove name of unused parameter. * testsuite/25_algorithms/unique_copy/check_type.cc (S2::S2,X2::X2): Likewise. * testsuite/22_locale/ctype/narrow/char/19955.cc (do_narrow): Likewise. * testsuite/22_locale/ctype/is/char/9858.cc (Derived::do_is, Derived::do_scan_is, Derived::do_scan_not, Derived2::do_is, Derived2::do_scan_is, Derived2::do_scan_not): Likewise. * testsuite/22_locale/time_put/put/wchar_t/12439_1.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/wchar_t/12439_3.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/char/12439_1.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/char/12439_3.cc (TP::do_put): Likewise. * testsuite/testsuite_io.h (fail_num_get::do_get, fail_num_put::do_put): Likewise. * testsuite/25_algorithms/find/17441.cc (find): Likewise. * testsuite/23_containers/vector/cons/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/vector/bool/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/list/cons/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/set/modifiers/16728.cc (test_container): Likewise. * testsuite/27_io/basic_ios/cons/char/3.cc (char_traits::to_char_type, to_int_type): Likewise. * testsuite/27_io/basic_filebuf/imbue/12206.cc (codecvt::do_out, do_in, do_unshift, do_length): Likewise. * testsuite/21_strings/basic_string/capacity/1.cc (operator==(A<T>,A<T>), operator<(A<T>,A<T>), char_traits::to_char_type, char_traits::to_int_type): Likewise * testsuite/testsuite_character.h (ctype::do_is, ctype::do_scan_is, ctype::do_scan_not, do_toupper, do_tolower): Likewise. * testsuite/25_algorithms/replace_copy/check_type.cc (Z::operator=): Add missing return statement. * testsuite/25_algorithms/replace_copy_if/check_type.cc (Z::operator=): Likewise. * testsuite/testsuite_iterators.h (output_iterator_wrapper::operator=, random_access_iterator_wrapper::operator==): Likewise. * testsuite/20_util/functional/binders/1.cc (s::f_int_int_const, s::f_int_int, s::f_int_void_const, s::f_int_void): Likewise. * testsuite/27_io/types/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/write/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/write/char/1.cc (test01): Likewise. * testsuite/21_strings/c_strings/wchar_t/24559.cc (main): Likewise. * testsuite/27_io/basic_istream/ignore/wchar_t/2.cc (check): Add static cast. * testsuite/27_io/basic_istream/ignore/char/2.cc (check): Likewise. * testsuite/27_io/basic_istream/getline/wchar_t/5.cc (check): Likewise. * testsuite/27_io/basic_istream/getline/char/5.cc (check): Likewise. * testsuite/testsuite_allocator.h (check_new): Likewise. (check_deallocate_null): Add missing return value. * testsuite/ext/pool_allocator/allocate_chunk.cc (test01): Make variable unsigned. * testsuite/23_containers/vector/modifiers/erase/1.cc (N,N1,N2,N3,N4, N5,test01): Likewise. * testsuite/26_numerics/valarray/valarray_subset_assignment.cc (check_array): Likewise. (main): Removed unused variable. * testsuite/27_io/basic_streambuf/in_avail/wchar_t/1.cc (test05): Removed unused variable. * testsuite/27_io/basic_ostream/flush/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/flush/char/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/endl/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/endl/char/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/ends/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/ends/char/1.cc (test01): Likewise. * testsuite/tr1/2_general_utilities/memory/shared_ptr/ assign/shared_ptr.cc (test01): Correct return type. * testsuite/27_io/basic_filebuf/close/char/2.cc (test_02): Add default value to close_num. From-SVN: r109062
2005-12-26 11:53:42 +01:00
do_toupper(char_type*, const char_type* high) const
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
{ return high; }
virtual char_type
do_tolower(char_type c) const
{ return c; }
virtual const char_type*
mt_allocator.h (__mt_alloc::__mt_alloc): Remove name of unused parameter. 2005-12-26 Chris Jefferson <chris@bubblescope.net> * include/ext/mt_allocator.h (__mt_alloc::__mt_alloc): Remove name of unused parameter. * include/bits/stream_iterator.h (istream_iterator::istream_iterator): Construct _M_value. * include/debug/functions.h (__check_valid_range): Add __attribute__((unused)). * include/tr1/hashtable (hashtable::end): Remove name of unused parameter. * include/tr1/tuple_iterate.h (tuple::tuple): Likewise. (tuple::operator=): Add __attribute__((unused)). * include/tr1/functional (Fnv_hash<4>::hash): Add static_cast. (Fnv_hash<8>::hash): Likewise. * testsuite/25_algorithms/iter_swap/20577.cc (swap): Remove name of unused parameter. * testsuite/25_algorithms/unique_copy/check_type.cc (S2::S2,X2::X2): Likewise. * testsuite/22_locale/ctype/narrow/char/19955.cc (do_narrow): Likewise. * testsuite/22_locale/ctype/is/char/9858.cc (Derived::do_is, Derived::do_scan_is, Derived::do_scan_not, Derived2::do_is, Derived2::do_scan_is, Derived2::do_scan_not): Likewise. * testsuite/22_locale/time_put/put/wchar_t/12439_1.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/wchar_t/12439_3.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/char/12439_1.cc (TP::do_put): Likewise. * testsuite/22_locale/time_put/put/char/12439_3.cc (TP::do_put): Likewise. * testsuite/testsuite_io.h (fail_num_get::do_get, fail_num_put::do_put): Likewise. * testsuite/25_algorithms/find/17441.cc (find): Likewise. * testsuite/23_containers/vector/cons/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/vector/bool/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/list/cons/clear_allocator.cc (clear_alloc::clear_alloc): Likewise. * testsuite/23_containers/set/modifiers/16728.cc (test_container): Likewise. * testsuite/27_io/basic_ios/cons/char/3.cc (char_traits::to_char_type, to_int_type): Likewise. * testsuite/27_io/basic_filebuf/imbue/12206.cc (codecvt::do_out, do_in, do_unshift, do_length): Likewise. * testsuite/21_strings/basic_string/capacity/1.cc (operator==(A<T>,A<T>), operator<(A<T>,A<T>), char_traits::to_char_type, char_traits::to_int_type): Likewise * testsuite/testsuite_character.h (ctype::do_is, ctype::do_scan_is, ctype::do_scan_not, do_toupper, do_tolower): Likewise. * testsuite/25_algorithms/replace_copy/check_type.cc (Z::operator=): Add missing return statement. * testsuite/25_algorithms/replace_copy_if/check_type.cc (Z::operator=): Likewise. * testsuite/testsuite_iterators.h (output_iterator_wrapper::operator=, random_access_iterator_wrapper::operator==): Likewise. * testsuite/20_util/functional/binders/1.cc (s::f_int_int_const, s::f_int_int, s::f_int_void_const, s::f_int_void): Likewise. * testsuite/27_io/types/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/write/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/write/char/1.cc (test01): Likewise. * testsuite/21_strings/c_strings/wchar_t/24559.cc (main): Likewise. * testsuite/27_io/basic_istream/ignore/wchar_t/2.cc (check): Add static cast. * testsuite/27_io/basic_istream/ignore/char/2.cc (check): Likewise. * testsuite/27_io/basic_istream/getline/wchar_t/5.cc (check): Likewise. * testsuite/27_io/basic_istream/getline/char/5.cc (check): Likewise. * testsuite/testsuite_allocator.h (check_new): Likewise. (check_deallocate_null): Add missing return value. * testsuite/ext/pool_allocator/allocate_chunk.cc (test01): Make variable unsigned. * testsuite/23_containers/vector/modifiers/erase/1.cc (N,N1,N2,N3,N4, N5,test01): Likewise. * testsuite/26_numerics/valarray/valarray_subset_assignment.cc (check_array): Likewise. (main): Removed unused variable. * testsuite/27_io/basic_streambuf/in_avail/wchar_t/1.cc (test05): Removed unused variable. * testsuite/27_io/basic_ostream/flush/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/flush/char/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/endl/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/endl/char/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/ends/wchar_t/1.cc (test01): Likewise. * testsuite/27_io/basic_ostream/ends/char/1.cc (test01): Likewise. * testsuite/tr1/2_general_utilities/memory/shared_ptr/ assign/shared_ptr.cc (test01): Correct return type. * testsuite/27_io/basic_filebuf/close/char/2.cc (test_02): Add default value to close_num. From-SVN: r109062
2005-12-26 11:53:42 +01:00
do_tolower(char_type*, const char_type* high) const
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
{ return high; }
virtual char_type
do_widen(char c) const
{ return __gnu_test::pod_uchar::from<char>(c); }
virtual const char*
do_widen(const char* low, const char* high, char_type* dest) const
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
{
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
transform(low, high, dest, &__gnu_test::pod_uchar::from<char>);
return high;
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
}
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
virtual char
do_narrow(char_type, char dfault) const
{ return dfault; }
virtual const char_type*
do_narrow(const char_type* low, const char_type* high,
char dfault, char* dest) const
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
{
pod_char_traits.h (__gnu_cxx::character): Add char_type. 2005-04-14 Benjamin Kosnik <bkoz@redhat.com> * include/ext/pod_char_traits.h (__gnu_cxx::character): Add char_type. (character::to): New. (character::from): New. (operator==): Add state parameter. (operator<): Same. (char_traits::copy): Use std::copy. (char_traits::assign): Use std::fill_n. (char_traits::to_char_type): Use character::from. (char_traits::to_int_type): Use character::to. * testsuite/testsuite_character.h (__gnu_test::character): Remove. (__gnu_test::conversion_state): Remove. (__gnu_test::pod_char): Remove. (pod_char): New typedef. (pod_uchar): New typedef. (pod_ushort): New typedef. * testsuite/testsuite_character.cc: Fixups. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Same. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/close/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/open/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc: Same. * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc: Same. * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc: Same. * testsuite/27_io/basic_ios/imbue/14072.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. From-SVN: r98165
2005-04-15 04:06:26 +02:00
fill_n(dest, high - low, dfault);
return high;
test.html: Update. 2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
2005-04-07 06:16:26 +02:00
}
};
// numpunct specializations
template<>
class numpunct<__gnu_test::pod_uint>
: public locale::facet
{
public:
typedef __gnu_test::pod_uint char_type;
typedef basic_string<char_type> string_type;
static locale::id id;
explicit
numpunct(size_t refs = 0)
: locale::facet(refs)
{ }
char_type
decimal_point() const
{ return this->do_decimal_point(); }
char_type
thousands_sep() const
{ return this->do_thousands_sep(); }
string
grouping() const
{ return this->do_grouping(); }
string_type
truename() const
{ return this->do_truename(); }
string_type
falsename() const
{ return this->do_falsename(); }
protected:
~numpunct()
{ }
virtual char_type
do_decimal_point() const
{ return char_type(); }
virtual char_type
do_thousands_sep() const
{ return char_type(); }
virtual string
do_grouping() const
{ return string(); }
virtual string_type
do_truename() const
{ return string_type(); }
virtual string_type
do_falsename() const
{ return string_type(); }
};
template<>
class moneypunct<__gnu_test::pod_uint>
: public locale::facet, public money_base
{
public:
typedef __gnu_test::pod_uint char_type;
typedef basic_string<char_type> string_type;
static locale::id id;
static const bool intl = false;
explicit
moneypunct(size_t refs = 0)
: locale::facet(refs)
{ }
char_type
decimal_point() const
{ return this->do_decimal_point(); }
char_type
thousands_sep() const
{ return this->do_thousands_sep(); }
string
grouping() const
{ return this->do_grouping(); }
string_type
curr_symbol() const
{ return this->do_curr_symbol(); }
string_type
positive_sign() const
{ return this->do_positive_sign(); }
string_type
negative_sign() const
{ return this->do_negative_sign(); }
int
frac_digits() const
{ return this->do_frac_digits(); }
pattern
pos_format() const
{ return this->do_pos_format(); }
pattern
neg_format() const
{ return this->do_neg_format(); }
protected:
~moneypunct()
{ }
virtual char_type
do_decimal_point() const
{ return char_type(); }
virtual char_type
do_thousands_sep() const
{ return char_type(); }
virtual string
do_grouping() const
{ return string(); }
virtual string_type
do_curr_symbol() const
{ return string_type(); }
string_type
do_positive_sign() const
{ return string_type(); }
string_type
do_negative_sign() const
{ return string_type(); }
int
do_frac_digits() const
{ return 0; }
pattern
do_pos_format() const
{ return pattern(); }
pattern
do_neg_format() const
{ return pattern(); }
};
re PR libstdc++/12790 (basic_filebuf doesn't handle stateful encodings) 2003-11-03 Petur Runolfsson <peturr02@ru.is> PR libstdc++/12790 * include/bits/fstream.tcc: Delete _M_last_overflowed. (basic_filebuf::basic_filebuf): Initialize _M_state_last. (basic_filebuf::open, basic_filebuf::close): Assign _M_state_beg to _M_state_cur and _M_state_last. (basic_filebuf::close): Call _M_terminate_output to handle unshift and flushing. (basic_filebuf::underflow): Assign _M_state_last, throw exception instead of calling abort when codecvt::max_length() is bad. (basic_filebuf::seekoff): Use _M_state_last when calling codecvt::length(), pass correct state to _M_seek. (basic_filebuf::seekpos): Pass __pos.state() to _M_seek. (basic_filebuf::_M_seek): Add __state_type parameter, set _M_state_cur correctly, store the resulting state in the return value and use _M_terminate_output to handle flushing and unshift. (basic_filebuf::_M_terminate_output): Flush contents of output buffer, if any, then call codecvt::unshift as needed and output the result. (basic_filebuf::sync): Move here, don't modify _M_writing or _M_reading. * include/std/std_fstream.h (basic_filebuf::_M_state_last): Declare it. (basic_filebuf::_M_last_overflowed): Delete. (basic_filebuf::_M_seek): Add __state_type parameter. (basic_filebuf::sync): Declare only. (basic_filebuf::_M_output_unshift): Delete. (basic_filebuf::_M_terminate_output): Declare it. * testsuite/testsuite_character.h: Define character class and state class plus char_traits and codecvt specializations for same for testing support for stateful encodings. * testsuite/27_io/basic_filebuf/close/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-1.cc, * testsuite/27_io/basic_filebuf/close/char/12790-2.cc, * testsuite/27_io/basic_filebuf/close/char/12790-3.cc, * testsuite/27_io/basic_filebuf/close/char/12790-4.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/open/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc, * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc, * testsuite/27_io/basic_filebuf/sync/char/1.cc, * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc: New tests. * testsuite/27_io/basic_filebuf/3.cc, * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc, * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc, * testsuite/27_io/basic_fstream/3.cc, * testsuite/27_io/basic_ifstream/3.cc, * testsuite/27_io/basic_ofstream/3.cc: Use streamoff as off_type and fpos<state_type> as pos_type. * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc, * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Check that sync does *not* set _M_writing to false. From-SVN: r73245
2003-11-04 06:27:41 +01:00
} // namespace std
#endif // _GLIBCXX_TESTSUITE_CHARACTER_H