2000-10-05 13:27:02 +02:00
|
|
|
// Iostreams base classes -*- C++ -*-
|
|
|
|
|
2016-01-04 15:30:50 +01:00
|
|
|
// Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
2000-10-05 13:27:02 +02: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
|
2009-04-09 17:00:19 +02:00
|
|
|
// Free Software Foundation; either version 3, or (at your option)
|
2000-10-05 13:27:02 +02:00
|
|
|
// 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.
|
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
// Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
// permissions described in the GCC Runtime Library Exception, version
|
|
|
|
// 3.1, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License and
|
|
|
|
// a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
// <http://www.gnu.org/licenses/>.
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-12-19 10:21:16 +01:00
|
|
|
/** @file bits/basic_ios.h
|
c_io_stdio.h: Correct grammar in comments.
2001-11-02 Phil Edwards <pme@gcc.gnu.org>
* config/io/c_io_stdio.h: Correct grammar in comments.
* docs/doxygen/Intro.3: Expand "top-level" man page.
* docs/doxygen/doxygroups.cc: New module definitions (comments).
* docs/doxygen/mainpage.doxy: Tweaks.
* docs/doxygen/run_doxygen: Update Doxygen version, massage man pages.
Add @file hooks so that headers are considered to be documented.
* include/bits/basic_ios.h, include/bits/basic_file.h,
include/bits/basic_string.h, include/bits/boost_concept_check.h,
include/bits/char_traits.h, include/bits/codecvt.h,
include/bits/concept_check.h, include/bits/cpp_type_traits.h,
include/bits/fpos.h, include/bits/gslice.h, include/bits/gslice_array.h,
include/bits/indirect_array.h, include/bits/ios_base.h,
include/bits/locale_facets.h, include/bits/localefwd.h,
include/bits/mask_array.h, include/bits/pthread_allocimpl.h,
include/bits/slice.h, include/bits/slice_array.h,
include/bits/std_algorithm.h, include/bits/std_bitset.h,
include/bits/std_complex.h, include/bits/std_deque.h,
include/bits/std_fstream.h, include/bits/std_functional.h,
include/bits/std_iomanip.h, include/bits/std_ios.h,
include/bits/std_iosfwd.h, include/bits/std_iostream.h,
include/bits/std_istream.h, include/bits/std_iterator.h,
include/bits/std_limits.h, include/bits/std_list.h,
include/bits/std_locale.h, include/bits/std_map.h,
include/bits/std_memory.h, include/bits/std_numeric.h,
include/bits/std_ostream.h, include/bits/std_queue.h,
include/bits/std_set.h, include/bits/std_sstream.h,
include/bits/std_stack.h, include/bits/std_streambuf.h,
include/bits/std_string.h, include/bits/std_utility.h,
include/bits/std_valarray.h, include/bits/std_vector.h,
include/bits/stl_algo.h, include/bits/stl_alloc.h,
include/bits/stl_bvector.h, include/bits/stl_construct.h,
include/bits/stl_deque.h, include/bits/stl_heap.h,
include/bits/stl_iterator.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_iterator_base_types.h, include/bits/stl_list.h,
include/bits/stl_map.h, include/bits/stl_multimap.h,
include/bits/stl_multiset.h, include/bits/stl_numeric.h,
include/bits/stl_pair.h, include/bits/stl_pthread_alloc.h,
include/bits/stl_queue.h, include/bits/stl_raw_storage_iter.h,
include/bits/stl_relops.h, include/bits/stl_set.h,
include/bits/stl_stack.h, include/bits/stl_tempbuf.h,
include/bits/stl_threads.h, include/bits/stl_tree.h,
include/bits/stl_uninitialized.h, include/bits/stl_vector.h,
include/bits/stream_iterator.h, include/bits/streambuf_iterator.h,
include/bits/stringfwd.h, include/bits/type_traits.h,
include/bits/valarray_array.h, include/bits/valarray_meta.h:
Add hooks, tweak comments only.
* include/bits/stl_algobase.h (swap, min, iter_swap): Also
document these functions.
* include/bits/stl_function.h: Tweak link comments.
From-SVN: r46717
2001-11-02 18:38:11 +01:00
|
|
|
* This is an internal header file, included by other library headers.
|
2010-12-19 10:21:16 +01:00
|
|
|
* Do not attempt to use it directly. @headername{ios}
|
c_io_stdio.h: Correct grammar in comments.
2001-11-02 Phil Edwards <pme@gcc.gnu.org>
* config/io/c_io_stdio.h: Correct grammar in comments.
* docs/doxygen/Intro.3: Expand "top-level" man page.
* docs/doxygen/doxygroups.cc: New module definitions (comments).
* docs/doxygen/mainpage.doxy: Tweaks.
* docs/doxygen/run_doxygen: Update Doxygen version, massage man pages.
Add @file hooks so that headers are considered to be documented.
* include/bits/basic_ios.h, include/bits/basic_file.h,
include/bits/basic_string.h, include/bits/boost_concept_check.h,
include/bits/char_traits.h, include/bits/codecvt.h,
include/bits/concept_check.h, include/bits/cpp_type_traits.h,
include/bits/fpos.h, include/bits/gslice.h, include/bits/gslice_array.h,
include/bits/indirect_array.h, include/bits/ios_base.h,
include/bits/locale_facets.h, include/bits/localefwd.h,
include/bits/mask_array.h, include/bits/pthread_allocimpl.h,
include/bits/slice.h, include/bits/slice_array.h,
include/bits/std_algorithm.h, include/bits/std_bitset.h,
include/bits/std_complex.h, include/bits/std_deque.h,
include/bits/std_fstream.h, include/bits/std_functional.h,
include/bits/std_iomanip.h, include/bits/std_ios.h,
include/bits/std_iosfwd.h, include/bits/std_iostream.h,
include/bits/std_istream.h, include/bits/std_iterator.h,
include/bits/std_limits.h, include/bits/std_list.h,
include/bits/std_locale.h, include/bits/std_map.h,
include/bits/std_memory.h, include/bits/std_numeric.h,
include/bits/std_ostream.h, include/bits/std_queue.h,
include/bits/std_set.h, include/bits/std_sstream.h,
include/bits/std_stack.h, include/bits/std_streambuf.h,
include/bits/std_string.h, include/bits/std_utility.h,
include/bits/std_valarray.h, include/bits/std_vector.h,
include/bits/stl_algo.h, include/bits/stl_alloc.h,
include/bits/stl_bvector.h, include/bits/stl_construct.h,
include/bits/stl_deque.h, include/bits/stl_heap.h,
include/bits/stl_iterator.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_iterator_base_types.h, include/bits/stl_list.h,
include/bits/stl_map.h, include/bits/stl_multimap.h,
include/bits/stl_multiset.h, include/bits/stl_numeric.h,
include/bits/stl_pair.h, include/bits/stl_pthread_alloc.h,
include/bits/stl_queue.h, include/bits/stl_raw_storage_iter.h,
include/bits/stl_relops.h, include/bits/stl_set.h,
include/bits/stl_stack.h, include/bits/stl_tempbuf.h,
include/bits/stl_threads.h, include/bits/stl_tree.h,
include/bits/stl_uninitialized.h, include/bits/stl_vector.h,
include/bits/stream_iterator.h, include/bits/streambuf_iterator.h,
include/bits/stringfwd.h, include/bits/type_traits.h,
include/bits/valarray_array.h, include/bits/valarray_meta.h:
Add hooks, tweak comments only.
* include/bits/stl_algobase.h (swap, min, iter_swap): Also
document these functions.
* include/bits/stl_function.h: Tweak link comments.
From-SVN: r46717
2001-11-02 18:38:11 +01:00
|
|
|
*/
|
|
|
|
|
2003-07-05 06:05:45 +02:00
|
|
|
#ifndef _BASIC_IOS_H
|
|
|
|
#define _BASIC_IOS_H 1
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2001-02-19 19:52:25 +01:00
|
|
|
#pragma GCC system_header
|
|
|
|
|
2003-01-22 17:51:52 +01:00
|
|
|
#include <bits/localefwd.h>
|
|
|
|
#include <bits/locale_classes.h>
|
2001-02-17 18:51:45 +01:00
|
|
|
#include <bits/locale_facets.h>
|
2007-04-29 18:06:09 +02:00
|
|
|
#include <bits/streambuf_iterator.h>
|
Make streams movable and swappable.
PR libstdc++/54316
PR libstdc++/53626
* config/abi/pre/gnu.ver: Add new exports.
* config/io/basic_file_stdio.h (__basic_file): Support moving and
swapping.
* include/bits/basic_ios.h (basic_ios::move, basic_ios::swap):
Likewise.
* include/bits/ios_base.h (ios_base::_M_move, ios_base::_M_swap):
Likewise.
* include/bits/fstream.tcc (basic_filebuf): Likewise.
* include/bits/move.h (__exchange): Define for C++11 mode.
* include/ext/stdio_filebuf.h (stdio_filebuf): Support moving and
swapping.
* include/ext/stdio_sync_filebuf.h (stdio_sync_filebuf): Likewise.
* include/std/fstream (basic_filebuf, basic_ifstream, basic_ofstream,
basic_fstream): Likewise.
* include/std/ios: Remove whitespace.
* include/std/istream (basic_istream, basic_iostream): Support moving
and swapping.
* include/std/ostream (basic_ostream): Likewise.
* include/std/sstream (basic_stringbuf, basic_istringstream,
basic_ostringstream, basic_stringstream): Likewise.
* include/std/streambuf (basic_streambuf): Do not default copy
constructor and assignment on first declaration.
* include/std/utility (exchange): Forward to __exchange.
* testsuite/27_io/basic_filebuf/cons/char/copy_neg.cc: New.
* src/c++11/Makefile.am: Add stream-related files.
* src/c++11/Makefile.in: Regenerate.
* src/c++11/ext11-inst.cc (stdio_filebuf, stdio_sync_filebuf):
New file for explicit instantiation definitions.
* src/c++11/ios.cc: Move from src/c++98 to here.
(ios_base::_M_move, ios_base::_M_swap): Define.
* src/c++11/ios-inst.cc: Move from src/c++98 to here.
* src/c++11/iostream-inst.cc: Likewise.
* src/c++11/istream-inst.cc: Likewise.
* src/c++11/ostream-inst.cc: Likewise.
* src/c++11/sstream-inst.cc: Likewise.
* src/c++11/streambuf-inst.cc: Likewise.
* src/c++98/Makefile.am: Remove stream-related files.
* src/c++98/Makefile.in: Regenerate.
* src/c++98/ext-inst.cc (stdio_filebuf): Remove explicit
instantiations.
* src/c++98/misc-inst.cc (stdio_sync_filebuf): Likewise.
* src/c++98/ios-inst.cc: Move to src/c++11/.
* src/c++98/ios.cc: Move to src/c++11/.
* src/c++98/iostream-inst.cc: Likewise.
* src/c++98/istream-inst.cc: Likewise.
* src/c++98/ostream-inst.cc: Likewise.
* src/c++98/sstream-inst.cc: Likewise.
* src/c++98/streambuf-inst.cc: Likewise.
* testsuite/27_io/basic_filebuf/cons/char/copy_neg.cc: New.
* testsuite/27_io/basic_fstream/cons/move.cc: New.
* testsuite/27_io/basic_fstream/assign/1.cc: New.
* testsuite/27_io/basic_ifstream/cons/move.cc: New.
* testsuite/27_io/basic_ifstream/assign/1.cc: New.
* testsuite/27_io/basic_istringstream/assign/1.cc: New.
* testsuite/27_io/basic_istringstream/cons/move.cc: New.
* testsuite/27_io/basic_ofstream/cons/move.cc: New.
* testsuite/27_io/basic_ofstream/assign/1.cc: New.
* testsuite/27_io/basic_ostringstream/assign/1.cc: New.
* testsuite/27_io/basic_ostringstream/cons/move.cc: New.
* testsuite/27_io/basic_stringstream/assign/1.cc: New.
* testsuite/27_io/basic_stringstream/cons/move.cc: New.
From-SVN: r215463
2014-09-22 15:34:09 +02:00
|
|
|
#include <bits/move.h>
|
2000-10-05 13:27:02 +02:00
|
|
|
|
PR libstdc++/36104 part four
2011-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/36104 part four
* include/bits/c++config (_GLIBCXX_STD): Remove.
(_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C.
(_GLIBCXX_P): Now _GLIBCXX_STD_A.
(_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL,
_GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove.
(_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL,
_GLIBCXX_INLINE_PROFILE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE(X)): Remove.
(_GLIBCXX_END_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove.
(_GLIBCXX_END_NESTED_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add.
(_GLIBCXX_END_NAMESPACE_ALGO): Add.
(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_END_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add.
(_GLIBCXX_END_NAMESPACE_VERSION): Add.
(_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL.
(_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL.
(_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY.
* include/*: Use new macros for namespace scope.
* config/*: Same.
* src/*: Same.
* src/Makefile.am (sources): Remove debug_list.cc, add
compatibility-debug_list-2.cc.
(parallel_sources): Remove parallel_list.cc, add
compatibility-parallel_list-2.cc.
(compatibility-parallel_list-2.[o,lo]): New rule.
* src/Makefile.in: Regenerate.
* src/debug_list.cc: Remove.
* src/parallel_list.cc: Remove.
* src/compatibility-list-2.cc: New.
* src/compatibility-debug_list-2.cc: New.
* src/compatibility-parallel_list-2.cc: New.
* doc/doxygen/user.cfg.in: Adjust macros.
* testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros.
* testsuite/20_util/declval/requirements/1_neg.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
* testsuite/20_util/forward/c_neg.cc: Same.
* testsuite/20_util/forward/f_neg.cc: Same.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/forward_list/capacity/1.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Same.
* testsuite/23_containers/list/capacity/29134.cc: Same.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Same.
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same.
* testsuite/25_algorithms/sort/35588.cc: Same.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
* testsuite/ext/profile/mutex_extensions_neg.cc: Same.
* testsuite/ext/profile/profiler_algos.cc: Same.
* testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same.
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same.
From-SVN: r169421
2011-01-30 23:39:36 +01:00
|
|
|
namespace std _GLIBCXX_VISIBILITY(default)
|
|
|
|
{
|
|
|
|
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
2005-12-19 01:56:05 +01:00
|
|
|
|
2007-04-29 18:06:09 +02:00
|
|
|
template<typename _Facet>
|
|
|
|
inline const _Facet&
|
|
|
|
__check_facet(const _Facet* __f)
|
|
|
|
{
|
|
|
|
if (!__f)
|
|
|
|
__throw_bad_cast();
|
|
|
|
return *__f;
|
|
|
|
}
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
2012-05-03 00:25:28 +02:00
|
|
|
* @brief Template class basic_ios, virtual base class for all
|
|
|
|
* stream classes.
|
2009-02-21 01:45:21 +01:00
|
|
|
* @ingroup io
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
*
|
2012-05-03 00:25:28 +02:00
|
|
|
* @tparam _CharT Type of character stream.
|
|
|
|
* @tparam _Traits Traits for character type, defaults to
|
|
|
|
* char_traits<_CharT>.
|
|
|
|
*
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* Most of the member functions called dispatched on stream objects
|
|
|
|
* (e.g., @c std::cout.foo(bar);) are consolidated in this class.
|
|
|
|
*/
|
2000-10-05 13:27:02 +02:00
|
|
|
template<typename _CharT, typename _Traits>
|
|
|
|
class basic_ios : public ios_base
|
|
|
|
{
|
|
|
|
public:
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
* These are standard types. They permit a standardized way of
|
2013-02-20 23:41:51 +01:00
|
|
|
* referring to names of (or names dependent on) the template
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* parameters, which are specific to the implementation.
|
|
|
|
*/
|
|
|
|
typedef _CharT char_type;
|
|
|
|
typedef typename _Traits::int_type int_type;
|
|
|
|
typedef typename _Traits::pos_type pos_type;
|
|
|
|
typedef typename _Traits::off_type off_type;
|
|
|
|
typedef _Traits traits_type;
|
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
* These are non-standard types.
|
|
|
|
*/
|
|
|
|
typedef ctype<_CharT> __ctype_type;
|
2004-02-08 05:46:42 +01:00
|
|
|
typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
|
2003-08-12 05:46:18 +02:00
|
|
|
__num_put_type;
|
2004-02-08 05:46:42 +01:00
|
|
|
typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
|
|
|
|
__num_get_type;
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
//@}
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2000-10-05 13:27:02 +02:00
|
|
|
// Data members:
|
2002-01-25 07:36:32 +01:00
|
|
|
protected:
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
basic_ostream<_CharT, _Traits>* _M_tie;
|
|
|
|
mutable char_type _M_fill;
|
|
|
|
mutable bool _M_fill_init;
|
|
|
|
basic_streambuf<_CharT, _Traits>* _M_streambuf;
|
2000-10-05 13:27:02 +02:00
|
|
|
|
|
|
|
// Cached use_facet<ctype>, which is based on the current locale info.
|
2004-02-08 05:46:42 +01:00
|
|
|
const __ctype_type* _M_ctype;
|
2003-02-18 06:45:07 +01:00
|
|
|
// For ostream.
|
2003-08-12 05:46:18 +02:00
|
|
|
const __num_put_type* _M_num_put;
|
2003-02-18 06:45:07 +01:00
|
|
|
// For istream.
|
2003-08-12 05:46:18 +02:00
|
|
|
const __num_get_type* _M_num_get;
|
2000-10-05 13:27:02 +02:00
|
|
|
|
|
|
|
public:
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
* @brief The quick-and-easy status check.
|
|
|
|
*
|
|
|
|
* This allows you to write constructs such as
|
2010-02-04 19:20:34 +01:00
|
|
|
* <code>if (!a_stream) ...</code> and <code>while (a_stream) ...</code>
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
*/
|
2014-09-25 00:13:35 +02:00
|
|
|
#if __cplusplus >= 201103L
|
|
|
|
explicit operator bool() const
|
|
|
|
{ return !this->fail(); }
|
|
|
|
#else
|
2004-02-08 05:46:42 +01:00
|
|
|
operator void*() const
|
2000-10-05 13:27:02 +02:00
|
|
|
{ return this->fail() ? 0 : const_cast<basic_ios*>(this); }
|
2014-09-25 00:13:35 +02:00
|
|
|
#endif
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
bool
|
|
|
|
operator!() const
|
2000-10-05 13:27:02 +02:00
|
|
|
{ return this->fail(); }
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Returns the error state of the stream buffer.
|
|
|
|
* @return A bit pattern (well, isn't everything?)
|
|
|
|
*
|
|
|
|
* See std::ios_base::iostate for the possible bit values. Most
|
|
|
|
* users will call one of the interpreting wrappers, e.g., good().
|
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
iostate
|
|
|
|
rdstate() const
|
2000-10-05 13:27:02 +02:00
|
|
|
{ return _M_streambuf_state; }
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief [Re]sets the error state.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __state The new state flag(s) to set.
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
*
|
|
|
|
* See std::ios_base::iostate for the possible bit values. Most
|
|
|
|
* users will not need to pass an argument.
|
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
void
|
Tune for size.
2002-02-15 Benjamin Kosnik <bkoz@redhat.com>
Tune for size.
* src/string-inst.cc (string::_Rep::_S_terminal): Remove redundant
explicit instantiation.
(string::_Rep::_S_max_size): Same.
* include/bits/basic_string.tcc: Add extern explicit
instantiations for string, wstring.
* include/bits/basic_ios.tcc: Add extern explicit instantiations
for ios, wios.
* include/bits/streambuf.tcc: Same, for streambuf, wstreambuf.
* include/bits/istream.tcc: Same, for istream, wistream.
* include/bits/ostream.tcc: Same for ostream, wostream, iostream,
wiostream.
* include/bits/sstream.tcc: Same, for stringbuf, wstringbuf,
istringstream, wistringstream, ostringstream, wostringstream,
stringstream, wstringstream.
* include/bits/fstream.tcc: Same, for filebuf, wfilebuf, ifstream,
wifstream, ofstream, wofstream, fstream, wfstream.
* src/misc-inst.cc: Correct comments.
Add iomanip instantiations for wide streams.
* include/std/std_iomanip.h: Same.
* include/bits/locale_facets.tcc: Same.
* include/std/std_streambuf.h: Correct
_GLIBCPP_FULLY_COMPLIANT_HEADERS guard.
* include/std/std_sstream.h: Same.
* include/std/std_ostream.h: Same.
* include/std/std_istream.h: Same.
* include/std/std_fstream.h: Same.
* include/std/std_streambuf.h: Add definitions for private copy
ctor and assignment operator.
* include/std/std_istream.h: Remove declared but undefined copy
ctor and assignment operator. This is taken care of in ios_base,
so adding it in the derived class as well is superfluous.
* include/std/std_ostream.h: Same.
* include/bits/basic_ios.h (basic_ios::clear): Don't inline.
* include/bits/basic_ios.tcc (basic_ios::clear): Move definition here.
From-SVN: r49798
2002-02-16 01:19:13 +01:00
|
|
|
clear(iostate __state = goodbit);
|
2000-10-05 13:27:02 +02:00
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Sets additional flags in the error state.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __state The additional state flag(s) to set.
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
*
|
|
|
|
* See std::ios_base::iostate for the possible bit values.
|
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
void
|
|
|
|
setstate(iostate __state)
|
2003-12-02 03:48:51 +01:00
|
|
|
{ this->clear(this->rdstate() | __state); }
|
re PR libstdc++/9371 (Bad exception handling in i/ostream::operator>>/<<(streambuf*))
2003-11-26 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/9371
PR libstdc++/9546
PR libstdc++/10093
PR libstdc++/10095
* include/bits/basic_ios.h (basic_ios::setstate): Elide if goodbit.
(basic_ios::_M_setstate): Consolidate common error handling code.
* include/bits/basic_ios.tcc: Tweak.
* include/bits/fstream.tcc: Tweak.
* include/bits/istream.tcc: Use _M_setstate for common exception
handling. Move setstate calls after catch.
(basic_istream::tellg): Check for exceptions thrown by streambuf
virtual functions.
(basic_istream::seekg): Same.
* include/bits/ostream.tcc: Same, but for ostream.
(basic_ostream::flush): Check for exceptions thrown by streambuf
virtual functions.
(basic_istream::tellp): Same.
(basic_istream::seekp): Same.
* include/bits/locale_facets.tcc: Tweak.
* include/bits/streambuf.tcc: Tweak.
(__copy_streambufs): Propagate exceptions.
* testsuite/testsuite_io.h (fail_streambuf): New.
(fail_num_get): New.
(fail_num_put): New.
(facet_error): New.
(underflow_error): New.
(overflow_error): New.
(positioning_error): New.
* testsuite/27_io/basic_istream/exceptions/char/9561.cc: Tweak.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/
exceptions_badbit_throw.cc, exceptions_failbit.cc,
exceptions_failbit_throw.cc: New.
* testsuite/27_io/basic_istream/extractors_other/char/
error_failbit.cc, exceptions_badbit_throw.cc,
exceptions_failbit_throw.cc, exceptions_null.cc: New.
* testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_istream/tellg/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_ostream/flush/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_ostream/inserters_arithmetic/char/
exceptions_badbit_throw.cc, exceptions_failbit_throw.cc: New.
* testsuite/27_io/basic_ostream/inserters_other/char/
error_failbit.cc, exceptions_badbit_throw.cc,
exceptions_failbit_throw.cc, exceptions_null.cc: New.
* testsuite/27_io/basic_ostream/seekp/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc:
New.
From-SVN: r73979
2003-11-27 09:14:25 +01:00
|
|
|
|
|
|
|
// Flip the internal state on for the proper state bits, then re
|
|
|
|
// throws the propagated exception if bit also set in
|
|
|
|
// exceptions().
|
|
|
|
void
|
2004-02-08 05:46:42 +01:00
|
|
|
_M_setstate(iostate __state)
|
|
|
|
{
|
re PR libstdc++/9371 (Bad exception handling in i/ostream::operator>>/<<(streambuf*))
2003-11-26 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/9371
PR libstdc++/9546
PR libstdc++/10093
PR libstdc++/10095
* include/bits/basic_ios.h (basic_ios::setstate): Elide if goodbit.
(basic_ios::_M_setstate): Consolidate common error handling code.
* include/bits/basic_ios.tcc: Tweak.
* include/bits/fstream.tcc: Tweak.
* include/bits/istream.tcc: Use _M_setstate for common exception
handling. Move setstate calls after catch.
(basic_istream::tellg): Check for exceptions thrown by streambuf
virtual functions.
(basic_istream::seekg): Same.
* include/bits/ostream.tcc: Same, but for ostream.
(basic_ostream::flush): Check for exceptions thrown by streambuf
virtual functions.
(basic_istream::tellp): Same.
(basic_istream::seekp): Same.
* include/bits/locale_facets.tcc: Tweak.
* include/bits/streambuf.tcc: Tweak.
(__copy_streambufs): Propagate exceptions.
* testsuite/testsuite_io.h (fail_streambuf): New.
(fail_num_get): New.
(fail_num_put): New.
(facet_error): New.
(underflow_error): New.
(overflow_error): New.
(positioning_error): New.
* testsuite/27_io/basic_istream/exceptions/char/9561.cc: Tweak.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/
exceptions_badbit_throw.cc, exceptions_failbit.cc,
exceptions_failbit_throw.cc: New.
* testsuite/27_io/basic_istream/extractors_other/char/
error_failbit.cc, exceptions_badbit_throw.cc,
exceptions_failbit_throw.cc, exceptions_null.cc: New.
* testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_istream/tellg/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_ostream/flush/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_ostream/inserters_arithmetic/char/
exceptions_badbit_throw.cc, exceptions_failbit_throw.cc: New.
* testsuite/27_io/basic_ostream/inserters_other/char/
error_failbit.cc, exceptions_badbit_throw.cc,
exceptions_failbit_throw.cc, exceptions_null.cc: New.
* testsuite/27_io/basic_ostream/seekp/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc:
New.
From-SVN: r73979
2003-11-27 09:14:25 +01:00
|
|
|
// 27.6.1.2.1 Common requirements.
|
|
|
|
// Turn this on without causing an ios::failure to be thrown.
|
2004-02-08 05:46:42 +01:00
|
|
|
_M_streambuf_state |= __state;
|
re PR libstdc++/9371 (Bad exception handling in i/ostream::operator>>/<<(streambuf*))
2003-11-26 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/9371
PR libstdc++/9546
PR libstdc++/10093
PR libstdc++/10095
* include/bits/basic_ios.h (basic_ios::setstate): Elide if goodbit.
(basic_ios::_M_setstate): Consolidate common error handling code.
* include/bits/basic_ios.tcc: Tweak.
* include/bits/fstream.tcc: Tweak.
* include/bits/istream.tcc: Use _M_setstate for common exception
handling. Move setstate calls after catch.
(basic_istream::tellg): Check for exceptions thrown by streambuf
virtual functions.
(basic_istream::seekg): Same.
* include/bits/ostream.tcc: Same, but for ostream.
(basic_ostream::flush): Check for exceptions thrown by streambuf
virtual functions.
(basic_istream::tellp): Same.
(basic_istream::seekp): Same.
* include/bits/locale_facets.tcc: Tweak.
* include/bits/streambuf.tcc: Tweak.
(__copy_streambufs): Propagate exceptions.
* testsuite/testsuite_io.h (fail_streambuf): New.
(fail_num_get): New.
(fail_num_put): New.
(facet_error): New.
(underflow_error): New.
(overflow_error): New.
(positioning_error): New.
* testsuite/27_io/basic_istream/exceptions/char/9561.cc: Tweak.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/
exceptions_badbit_throw.cc, exceptions_failbit.cc,
exceptions_failbit_throw.cc: New.
* testsuite/27_io/basic_istream/extractors_other/char/
error_failbit.cc, exceptions_badbit_throw.cc,
exceptions_failbit_throw.cc, exceptions_null.cc: New.
* testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_istream/tellg/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_ostream/flush/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_ostream/inserters_arithmetic/char/
exceptions_badbit_throw.cc, exceptions_failbit_throw.cc: New.
* testsuite/27_io/basic_ostream/inserters_other/char/
error_failbit.cc, exceptions_badbit_throw.cc,
exceptions_failbit_throw.cc, exceptions_null.cc: New.
* testsuite/27_io/basic_ostream/seekp/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc:
New.
From-SVN: r73979
2003-11-27 09:14:25 +01:00
|
|
|
if (this->exceptions() & __state)
|
|
|
|
__throw_exception_again;
|
|
|
|
}
|
2000-10-05 13:27:02 +02:00
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Fast error checking.
|
|
|
|
* @return True if no error flags are set.
|
|
|
|
*
|
|
|
|
* A wrapper around rdstate.
|
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
bool
|
|
|
|
good() const
|
2000-10-05 13:27:02 +02:00
|
|
|
{ return this->rdstate() == 0; }
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Fast error checking.
|
|
|
|
* @return True if the eofbit is set.
|
|
|
|
*
|
|
|
|
* Note that other iostate flags may also be set.
|
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
bool
|
|
|
|
eof() const
|
2000-10-05 13:27:02 +02:00
|
|
|
{ return (this->rdstate() & eofbit) != 0; }
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Fast error checking.
|
|
|
|
* @return True if either the badbit or the failbit is set.
|
|
|
|
*
|
|
|
|
* Checking the badbit in fail() is historical practice.
|
|
|
|
* Note that other iostate flags may also be set.
|
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
bool
|
|
|
|
fail() const
|
2000-10-05 13:27:02 +02:00
|
|
|
{ return (this->rdstate() & (badbit | failbit)) != 0; }
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Fast error checking.
|
|
|
|
* @return True if the badbit is set.
|
|
|
|
*
|
|
|
|
* Note that other iostate flags may also be set.
|
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
bool
|
|
|
|
bad() const
|
2000-10-05 13:27:02 +02:00
|
|
|
{ return (this->rdstate() & badbit) != 0; }
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Throwing exceptions on errors.
|
|
|
|
* @return The current exceptions mask.
|
|
|
|
*
|
|
|
|
* This changes nothing in the stream. See the one-argument version
|
|
|
|
* of exceptions(iostate) for the meaning of the return value.
|
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
iostate
|
|
|
|
exceptions() const
|
2000-10-05 13:27:02 +02:00
|
|
|
{ return _M_exception; }
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Throwing exceptions on errors.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __except The new exceptions mask.
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
*
|
|
|
|
* By default, error flags are set silently. You can set an
|
|
|
|
* exceptions mask for each stream; if a bit in the mask becomes set
|
|
|
|
* in the error flags, then an exception of type
|
|
|
|
* std::ios_base::failure is thrown.
|
|
|
|
*
|
2008-01-31 19:44:55 +01:00
|
|
|
* If the error flag is already set when the exceptions mask is
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* added, the exception is immediately thrown. Try running the
|
|
|
|
* following under GCC 3.1 or later:
|
|
|
|
* @code
|
|
|
|
* #include <iostream>
|
|
|
|
* #include <fstream>
|
|
|
|
* #include <exception>
|
2004-02-08 05:46:42 +01:00
|
|
|
*
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* int main()
|
|
|
|
* {
|
|
|
|
* std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
|
2004-02-08 05:46:42 +01:00
|
|
|
*
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* std::ifstream f ("/etc/motd");
|
2004-02-08 05:46:42 +01:00
|
|
|
*
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* std::cerr << "Setting badbit\n";
|
|
|
|
* f.setstate (std::ios_base::badbit);
|
2004-02-08 05:46:42 +01:00
|
|
|
*
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* std::cerr << "Setting exception mask\n";
|
|
|
|
* f.exceptions (std::ios_base::badbit);
|
|
|
|
* }
|
|
|
|
* @endcode
|
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
void
|
|
|
|
exceptions(iostate __except)
|
|
|
|
{
|
|
|
|
_M_exception = __except;
|
|
|
|
this->clear(_M_streambuf_state);
|
2000-10-05 13:27:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Constructor/destructor:
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Constructor performs initialization.
|
|
|
|
*
|
|
|
|
* The parameter is passed by derived streams.
|
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
explicit
|
|
|
|
basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
|
2004-05-23 01:46:34 +02:00
|
|
|
: ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
|
2007-04-29 18:06:09 +02:00
|
|
|
_M_ctype(0), _M_num_put(0), _M_num_get(0)
|
2000-10-05 13:27:02 +02:00
|
|
|
{ this->init(__sb); }
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Empty.
|
|
|
|
*
|
|
|
|
* The destructor does nothing. More specifically, it does not
|
|
|
|
* destroy the streambuf held by rdbuf().
|
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
virtual
|
2000-10-05 13:27:02 +02:00
|
|
|
~basic_ios() { }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2000-10-05 13:27:02 +02:00
|
|
|
// Members:
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Fetches the current @e tied stream.
|
|
|
|
* @return A pointer to the tied stream, or NULL if the stream is
|
|
|
|
* not tied.
|
|
|
|
*
|
|
|
|
* A stream may be @e tied (or synchronized) to a second output
|
|
|
|
* stream. When this stream performs any I/O, the tied stream is
|
|
|
|
* first flushed. For example, @c std::cin is tied to @c std::cout.
|
|
|
|
*/
|
Tune for size.
2002-02-15 Benjamin Kosnik <bkoz@redhat.com>
Tune for size.
* src/string-inst.cc (string::_Rep::_S_terminal): Remove redundant
explicit instantiation.
(string::_Rep::_S_max_size): Same.
* include/bits/basic_string.tcc: Add extern explicit
instantiations for string, wstring.
* include/bits/basic_ios.tcc: Add extern explicit instantiations
for ios, wios.
* include/bits/streambuf.tcc: Same, for streambuf, wstreambuf.
* include/bits/istream.tcc: Same, for istream, wistream.
* include/bits/ostream.tcc: Same for ostream, wostream, iostream,
wiostream.
* include/bits/sstream.tcc: Same, for stringbuf, wstringbuf,
istringstream, wistringstream, ostringstream, wostringstream,
stringstream, wstringstream.
* include/bits/fstream.tcc: Same, for filebuf, wfilebuf, ifstream,
wifstream, ofstream, wofstream, fstream, wfstream.
* src/misc-inst.cc: Correct comments.
Add iomanip instantiations for wide streams.
* include/std/std_iomanip.h: Same.
* include/bits/locale_facets.tcc: Same.
* include/std/std_streambuf.h: Correct
_GLIBCPP_FULLY_COMPLIANT_HEADERS guard.
* include/std/std_sstream.h: Same.
* include/std/std_ostream.h: Same.
* include/std/std_istream.h: Same.
* include/std/std_fstream.h: Same.
* include/std/std_streambuf.h: Add definitions for private copy
ctor and assignment operator.
* include/std/std_istream.h: Remove declared but undefined copy
ctor and assignment operator. This is taken care of in ios_base,
so adding it in the derived class as well is superfluous.
* include/std/std_ostream.h: Same.
* include/bits/basic_ios.h (basic_ios::clear): Don't inline.
* include/bits/basic_ios.tcc (basic_ios::clear): Move definition here.
From-SVN: r49798
2002-02-16 01:19:13 +01:00
|
|
|
basic_ostream<_CharT, _Traits>*
|
2004-02-08 05:46:42 +01:00
|
|
|
tie() const
|
2000-10-05 13:27:02 +02:00
|
|
|
{ return _M_tie; }
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Ties this stream to an output stream.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __tiestr The output stream.
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* @return The previously tied output stream, or NULL if the stream
|
|
|
|
* was not tied.
|
|
|
|
*
|
|
|
|
* This sets up a new tie; see tie() for more.
|
|
|
|
*/
|
Tune for size.
2002-02-15 Benjamin Kosnik <bkoz@redhat.com>
Tune for size.
* src/string-inst.cc (string::_Rep::_S_terminal): Remove redundant
explicit instantiation.
(string::_Rep::_S_max_size): Same.
* include/bits/basic_string.tcc: Add extern explicit
instantiations for string, wstring.
* include/bits/basic_ios.tcc: Add extern explicit instantiations
for ios, wios.
* include/bits/streambuf.tcc: Same, for streambuf, wstreambuf.
* include/bits/istream.tcc: Same, for istream, wistream.
* include/bits/ostream.tcc: Same for ostream, wostream, iostream,
wiostream.
* include/bits/sstream.tcc: Same, for stringbuf, wstringbuf,
istringstream, wistringstream, ostringstream, wostringstream,
stringstream, wstringstream.
* include/bits/fstream.tcc: Same, for filebuf, wfilebuf, ifstream,
wifstream, ofstream, wofstream, fstream, wfstream.
* src/misc-inst.cc: Correct comments.
Add iomanip instantiations for wide streams.
* include/std/std_iomanip.h: Same.
* include/bits/locale_facets.tcc: Same.
* include/std/std_streambuf.h: Correct
_GLIBCPP_FULLY_COMPLIANT_HEADERS guard.
* include/std/std_sstream.h: Same.
* include/std/std_ostream.h: Same.
* include/std/std_istream.h: Same.
* include/std/std_fstream.h: Same.
* include/std/std_streambuf.h: Add definitions for private copy
ctor and assignment operator.
* include/std/std_istream.h: Remove declared but undefined copy
ctor and assignment operator. This is taken care of in ios_base,
so adding it in the derived class as well is superfluous.
* include/std/std_ostream.h: Same.
* include/bits/basic_ios.h (basic_ios::clear): Don't inline.
* include/bits/basic_ios.tcc (basic_ios::clear): Move definition here.
From-SVN: r49798
2002-02-16 01:19:13 +01:00
|
|
|
basic_ostream<_CharT, _Traits>*
|
2000-10-05 13:27:02 +02:00
|
|
|
tie(basic_ostream<_CharT, _Traits>* __tiestr)
|
|
|
|
{
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
basic_ostream<_CharT, _Traits>* __old = _M_tie;
|
|
|
|
_M_tie = __tiestr;
|
|
|
|
return __old;
|
2000-10-05 13:27:02 +02:00
|
|
|
}
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Accessing the underlying buffer.
|
|
|
|
* @return The current stream buffer.
|
|
|
|
*
|
|
|
|
* This does not change the state of the stream.
|
|
|
|
*/
|
Tune for size.
2002-02-15 Benjamin Kosnik <bkoz@redhat.com>
Tune for size.
* src/string-inst.cc (string::_Rep::_S_terminal): Remove redundant
explicit instantiation.
(string::_Rep::_S_max_size): Same.
* include/bits/basic_string.tcc: Add extern explicit
instantiations for string, wstring.
* include/bits/basic_ios.tcc: Add extern explicit instantiations
for ios, wios.
* include/bits/streambuf.tcc: Same, for streambuf, wstreambuf.
* include/bits/istream.tcc: Same, for istream, wistream.
* include/bits/ostream.tcc: Same for ostream, wostream, iostream,
wiostream.
* include/bits/sstream.tcc: Same, for stringbuf, wstringbuf,
istringstream, wistringstream, ostringstream, wostringstream,
stringstream, wstringstream.
* include/bits/fstream.tcc: Same, for filebuf, wfilebuf, ifstream,
wifstream, ofstream, wofstream, fstream, wfstream.
* src/misc-inst.cc: Correct comments.
Add iomanip instantiations for wide streams.
* include/std/std_iomanip.h: Same.
* include/bits/locale_facets.tcc: Same.
* include/std/std_streambuf.h: Correct
_GLIBCPP_FULLY_COMPLIANT_HEADERS guard.
* include/std/std_sstream.h: Same.
* include/std/std_ostream.h: Same.
* include/std/std_istream.h: Same.
* include/std/std_fstream.h: Same.
* include/std/std_streambuf.h: Add definitions for private copy
ctor and assignment operator.
* include/std/std_istream.h: Remove declared but undefined copy
ctor and assignment operator. This is taken care of in ios_base,
so adding it in the derived class as well is superfluous.
* include/std/std_ostream.h: Same.
* include/bits/basic_ios.h (basic_ios::clear): Don't inline.
* include/bits/basic_ios.tcc (basic_ios::clear): Move definition here.
From-SVN: r49798
2002-02-16 01:19:13 +01:00
|
|
|
basic_streambuf<_CharT, _Traits>*
|
2004-02-08 05:46:42 +01:00
|
|
|
rdbuf() const
|
2000-10-05 13:27:02 +02:00
|
|
|
{ return _M_streambuf; }
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Changing the underlying buffer.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __sb The new stream buffer.
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* @return The previous stream buffer.
|
|
|
|
*
|
|
|
|
* Associates a new buffer with the current stream, and clears the
|
|
|
|
* error state.
|
|
|
|
*
|
|
|
|
* Due to historical accidents which the LWG refuses to correct, the
|
|
|
|
* I/O library suffers from a design error: this function is hidden
|
|
|
|
* in derived classes by overrides of the zero-argument @c rdbuf(),
|
|
|
|
* which is non-virtual for hysterical raisins. As a result, you
|
|
|
|
* must use explicit qualifications to access this function via any
|
2003-01-12 03:56:50 +01:00
|
|
|
* derived class. For example:
|
|
|
|
*
|
|
|
|
* @code
|
|
|
|
* std::fstream foo; // or some other derived type
|
|
|
|
* std::streambuf* p = .....;
|
|
|
|
*
|
|
|
|
* foo.ios::rdbuf(p); // ios == basic_ios<char>
|
|
|
|
* @endcode
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
basic_streambuf<_CharT, _Traits>*
|
2000-10-05 13:27:02 +02:00
|
|
|
rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
2003-07-11 16:25:09 +02:00
|
|
|
* @brief Copies fields of __rhs into this.
|
|
|
|
* @param __rhs The source values for the copies.
|
|
|
|
* @return Reference to this object.
|
|
|
|
*
|
|
|
|
* All fields of __rhs are copied into this object except that rdbuf()
|
|
|
|
* and rdstate() remain unchanged. All values in the pword and iword
|
|
|
|
* arrays are copied. Before copying, each callback is invoked with
|
|
|
|
* erase_event. After copying, each (new) callback is invoked with
|
|
|
|
* copyfmt_event. The final step is to copy exceptions().
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
*/
|
2000-10-05 13:27:02 +02:00
|
|
|
basic_ios&
|
|
|
|
copyfmt(const basic_ios& __rhs);
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
2010-02-04 19:20:34 +01:00
|
|
|
* @brief Retrieves the @a empty character.
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* @return The current fill character.
|
|
|
|
*
|
|
|
|
* It defaults to a space (' ') in the current locale.
|
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
char_type
|
|
|
|
fill() const
|
2002-02-27 02:01:31 +01:00
|
|
|
{
|
|
|
|
if (!_M_fill_init)
|
|
|
|
{
|
|
|
|
_M_fill = this->widen(' ');
|
|
|
|
_M_fill_init = true;
|
|
|
|
}
|
2004-02-08 05:46:42 +01:00
|
|
|
return _M_fill;
|
2002-02-27 02:01:31 +01:00
|
|
|
}
|
2000-10-05 13:27:02 +02:00
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
2010-02-04 19:20:34 +01:00
|
|
|
* @brief Sets a new @a empty character.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __ch The new character.
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* @return The previous fill character.
|
|
|
|
*
|
|
|
|
* The fill character is used to fill out space when P+ characters
|
|
|
|
* have been requested (e.g., via setw), Q characters are actually
|
|
|
|
* used, and Q<P. It defaults to a space (' ') in the current locale.
|
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
char_type
|
2000-10-05 13:27:02 +02:00
|
|
|
fill(char_type __ch)
|
|
|
|
{
|
2002-01-25 07:36:32 +01:00
|
|
|
char_type __old = this->fill();
|
2000-10-05 13:27:02 +02:00
|
|
|
_M_fill = __ch;
|
|
|
|
return __old;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Locales:
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Moves to a new locale.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __loc The new locale.
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* @return The previous locale.
|
|
|
|
*
|
|
|
|
* Calls @c ios_base::imbue(loc), and if a stream buffer is associated
|
|
|
|
* with this stream, calls that buffer's @c pubimbue(loc).
|
|
|
|
*
|
|
|
|
* Additional l10n notes are at
|
2008-12-02 05:55:54 +01:00
|
|
|
* http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
locale
|
2000-10-05 13:27:02 +02:00
|
|
|
imbue(const locale& __loc);
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Squeezes characters.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __c The character to narrow.
|
|
|
|
* @param __dfault The character to narrow.
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* @return The narrowed character.
|
|
|
|
*
|
|
|
|
* Maps a character of @c char_type to a character of @c char,
|
|
|
|
* if possible.
|
|
|
|
*
|
|
|
|
* Returns the result of
|
|
|
|
* @code
|
2003-05-07 07:01:59 +02:00
|
|
|
* std::use_facet<ctype<char_type> >(getloc()).narrow(c,dfault)
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* @endcode
|
|
|
|
*
|
|
|
|
* Additional l10n notes are at
|
2008-12-02 05:55:54 +01:00
|
|
|
* http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
char
|
2007-04-29 18:06:09 +02:00
|
|
|
narrow(char_type __c, char __dfault) const
|
|
|
|
{ return __check_facet(_M_ctype).narrow(__c, __dfault); }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Widens characters.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __c The character to widen.
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* @return The widened character.
|
|
|
|
*
|
|
|
|
* Maps a character of @c char to a character of @c char_type.
|
|
|
|
*
|
|
|
|
* Returns the result of
|
|
|
|
* @code
|
2003-05-07 07:01:59 +02:00
|
|
|
* std::use_facet<ctype<char_type> >(getloc()).widen(c)
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
* @endcode
|
|
|
|
*
|
|
|
|
* Additional l10n notes are at
|
2008-12-02 05:55:54 +01:00
|
|
|
* http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
char_type
|
2007-04-29 18:06:09 +02:00
|
|
|
widen(char __c) const
|
|
|
|
{ return __check_facet(_M_ctype).widen(__c); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2000-10-05 13:27:02 +02:00
|
|
|
protected:
|
|
|
|
// 27.4.5.1 basic_ios constructors
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief Empty.
|
|
|
|
*
|
|
|
|
* The default constructor does nothing and is not normally
|
|
|
|
* accessible to users.
|
|
|
|
*/
|
2004-05-23 01:46:34 +02:00
|
|
|
basic_ios()
|
|
|
|
: ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false),
|
2007-04-29 18:06:09 +02:00
|
|
|
_M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
|
2000-10-05 13:27:02 +02:00
|
|
|
{ }
|
|
|
|
|
TODO: Note change in clause 27 docs.
2002-11-21 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/TODO: Note change in clause 27 docs.
* include/bits/basic_ios.h, include/bits/fpos.h,
include/bits/ios_base.h, include/bits/stl_deque.h,
include/bits/stl_iterator_base_types.h, include/std/std_fstream.h,
include/std/std_iomanip.h, include/std/std_iosfwd.h,
include/std/std_iostream.h, include/std/std_istream.h,
include/std/std_ostream.h, include/std/std_sstream.h,
include/std/std_streambuf.h: Doxygenate all I/O entities.
From-SVN: r59325
2002-11-21 08:06:41 +01:00
|
|
|
/**
|
|
|
|
* @brief All setup is performed here.
|
|
|
|
*
|
|
|
|
* This is called from the public constructor. It is not virtual and
|
|
|
|
* cannot be redefined.
|
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
void
|
2000-10-05 13:27:02 +02:00
|
|
|
init(basic_streambuf<_CharT, _Traits>* __sb);
|
2001-05-31 14:14:56 +02:00
|
|
|
|
Make streams movable and swappable.
PR libstdc++/54316
PR libstdc++/53626
* config/abi/pre/gnu.ver: Add new exports.
* config/io/basic_file_stdio.h (__basic_file): Support moving and
swapping.
* include/bits/basic_ios.h (basic_ios::move, basic_ios::swap):
Likewise.
* include/bits/ios_base.h (ios_base::_M_move, ios_base::_M_swap):
Likewise.
* include/bits/fstream.tcc (basic_filebuf): Likewise.
* include/bits/move.h (__exchange): Define for C++11 mode.
* include/ext/stdio_filebuf.h (stdio_filebuf): Support moving and
swapping.
* include/ext/stdio_sync_filebuf.h (stdio_sync_filebuf): Likewise.
* include/std/fstream (basic_filebuf, basic_ifstream, basic_ofstream,
basic_fstream): Likewise.
* include/std/ios: Remove whitespace.
* include/std/istream (basic_istream, basic_iostream): Support moving
and swapping.
* include/std/ostream (basic_ostream): Likewise.
* include/std/sstream (basic_stringbuf, basic_istringstream,
basic_ostringstream, basic_stringstream): Likewise.
* include/std/streambuf (basic_streambuf): Do not default copy
constructor and assignment on first declaration.
* include/std/utility (exchange): Forward to __exchange.
* testsuite/27_io/basic_filebuf/cons/char/copy_neg.cc: New.
* src/c++11/Makefile.am: Add stream-related files.
* src/c++11/Makefile.in: Regenerate.
* src/c++11/ext11-inst.cc (stdio_filebuf, stdio_sync_filebuf):
New file for explicit instantiation definitions.
* src/c++11/ios.cc: Move from src/c++98 to here.
(ios_base::_M_move, ios_base::_M_swap): Define.
* src/c++11/ios-inst.cc: Move from src/c++98 to here.
* src/c++11/iostream-inst.cc: Likewise.
* src/c++11/istream-inst.cc: Likewise.
* src/c++11/ostream-inst.cc: Likewise.
* src/c++11/sstream-inst.cc: Likewise.
* src/c++11/streambuf-inst.cc: Likewise.
* src/c++98/Makefile.am: Remove stream-related files.
* src/c++98/Makefile.in: Regenerate.
* src/c++98/ext-inst.cc (stdio_filebuf): Remove explicit
instantiations.
* src/c++98/misc-inst.cc (stdio_sync_filebuf): Likewise.
* src/c++98/ios-inst.cc: Move to src/c++11/.
* src/c++98/ios.cc: Move to src/c++11/.
* src/c++98/iostream-inst.cc: Likewise.
* src/c++98/istream-inst.cc: Likewise.
* src/c++98/ostream-inst.cc: Likewise.
* src/c++98/sstream-inst.cc: Likewise.
* src/c++98/streambuf-inst.cc: Likewise.
* testsuite/27_io/basic_filebuf/cons/char/copy_neg.cc: New.
* testsuite/27_io/basic_fstream/cons/move.cc: New.
* testsuite/27_io/basic_fstream/assign/1.cc: New.
* testsuite/27_io/basic_ifstream/cons/move.cc: New.
* testsuite/27_io/basic_ifstream/assign/1.cc: New.
* testsuite/27_io/basic_istringstream/assign/1.cc: New.
* testsuite/27_io/basic_istringstream/cons/move.cc: New.
* testsuite/27_io/basic_ofstream/cons/move.cc: New.
* testsuite/27_io/basic_ofstream/assign/1.cc: New.
* testsuite/27_io/basic_ostringstream/assign/1.cc: New.
* testsuite/27_io/basic_ostringstream/cons/move.cc: New.
* testsuite/27_io/basic_stringstream/assign/1.cc: New.
* testsuite/27_io/basic_stringstream/cons/move.cc: New.
From-SVN: r215463
2014-09-22 15:34:09 +02:00
|
|
|
#if __cplusplus >= 201103L
|
|
|
|
basic_ios(const basic_ios&) = delete;
|
|
|
|
basic_ios& operator=(const basic_ios&) = delete;
|
|
|
|
|
|
|
|
void
|
|
|
|
move(basic_ios& __rhs)
|
|
|
|
{
|
|
|
|
ios_base::_M_move(__rhs);
|
|
|
|
_M_cache_locale(_M_ios_locale);
|
|
|
|
this->tie(__rhs.tie(nullptr));
|
|
|
|
_M_fill = __rhs._M_fill;
|
|
|
|
_M_fill_init = __rhs._M_fill_init;
|
|
|
|
_M_streambuf = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
move(basic_ios&& __rhs)
|
|
|
|
{ this->move(__rhs); }
|
|
|
|
|
|
|
|
void
|
|
|
|
swap(basic_ios& __rhs) noexcept
|
|
|
|
{
|
|
|
|
ios_base::_M_swap(__rhs);
|
|
|
|
_M_cache_locale(_M_ios_locale);
|
|
|
|
__rhs._M_cache_locale(__rhs._M_ios_locale);
|
|
|
|
std::swap(_M_tie, __rhs._M_tie);
|
|
|
|
std::swap(_M_fill, __rhs._M_fill);
|
|
|
|
std::swap(_M_fill_init, __rhs._M_fill_init);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
set_rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
|
|
|
|
{ _M_streambuf = __sb; }
|
|
|
|
#endif
|
|
|
|
|
2001-05-31 14:14:56 +02:00
|
|
|
void
|
2003-02-18 06:45:07 +01:00
|
|
|
_M_cache_locale(const locale& __loc);
|
2000-10-05 13:27:02 +02:00
|
|
|
};
|
2005-12-19 01:56:05 +01:00
|
|
|
|
PR libstdc++/36104 part four
2011-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/36104 part four
* include/bits/c++config (_GLIBCXX_STD): Remove.
(_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C.
(_GLIBCXX_P): Now _GLIBCXX_STD_A.
(_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL,
_GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove.
(_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL,
_GLIBCXX_INLINE_PROFILE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE(X)): Remove.
(_GLIBCXX_END_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove.
(_GLIBCXX_END_NESTED_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add.
(_GLIBCXX_END_NAMESPACE_ALGO): Add.
(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_END_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add.
(_GLIBCXX_END_NAMESPACE_VERSION): Add.
(_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL.
(_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL.
(_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY.
* include/*: Use new macros for namespace scope.
* config/*: Same.
* src/*: Same.
* src/Makefile.am (sources): Remove debug_list.cc, add
compatibility-debug_list-2.cc.
(parallel_sources): Remove parallel_list.cc, add
compatibility-parallel_list-2.cc.
(compatibility-parallel_list-2.[o,lo]): New rule.
* src/Makefile.in: Regenerate.
* src/debug_list.cc: Remove.
* src/parallel_list.cc: Remove.
* src/compatibility-list-2.cc: New.
* src/compatibility-debug_list-2.cc: New.
* src/compatibility-parallel_list-2.cc: New.
* doc/doxygen/user.cfg.in: Adjust macros.
* testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros.
* testsuite/20_util/declval/requirements/1_neg.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
* testsuite/20_util/forward/c_neg.cc: Same.
* testsuite/20_util/forward/f_neg.cc: Same.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/forward_list/capacity/1.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Same.
* testsuite/23_containers/list/capacity/29134.cc: Same.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Same.
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same.
* testsuite/25_algorithms/sort/35588.cc: Same.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
* testsuite/ext/profile/mutex_extensions_neg.cc: Same.
* testsuite/ext/profile/profiler_algos.cc: Same.
* testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same.
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same.
From-SVN: r169421
2011-01-30 23:39:36 +01:00
|
|
|
_GLIBCXX_END_NAMESPACE_VERSION
|
|
|
|
} // namespace
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2001-02-17 18:51:45 +01:00
|
|
|
#include <bits/basic_ios.tcc>
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2003-07-05 06:05:45 +02:00
|
|
|
#endif /* _BASIC_IOS_H */
|