2001-02-28 04:20:36 +01:00
|
|
|
// Wrapper of C-language FILE struct -*- C++ -*-
|
|
|
|
|
2011-01-03 21:52:22 +01:00
|
|
|
// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
|
2005-12-19 01:56:05 +01:00
|
|
|
// Free Software Foundation, Inc.
|
2001-02-28 04:20:36 +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
|
2009-04-09 17:00:19 +02:00
|
|
|
// Free Software Foundation; either version 3, or (at your option)
|
2001-02-28 04:20:36 +01: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/>.
|
2001-02-28 04:20:36 +01:00
|
|
|
|
|
|
|
//
|
|
|
|
// ISO C++ 14882: 27.8 File-based streams
|
|
|
|
//
|
|
|
|
|
2010-12-19 10:21:16 +01:00
|
|
|
/** @file bits/basic_file.h
|
2002-02-12 05:35:58 +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}
|
2002-02-12 05:35:58 +01:00
|
|
|
*/
|
2001-02-28 04:20:36 +01:00
|
|
|
|
2007-02-02 15:49:52 +01:00
|
|
|
#ifndef _GLIBCXX_BASIC_FILE_STDIO_H
|
|
|
|
#define _GLIBCXX_BASIC_FILE_STDIO_H 1
|
2001-02-28 04:20:36 +01:00
|
|
|
|
2002-02-12 05:35:58 +01:00
|
|
|
#pragma GCC system_header
|
2001-02-28 04:20:36 +01:00
|
|
|
|
2002-02-12 05:35:58 +01:00
|
|
|
#include <bits/c++config.h>
|
2007-03-11 13:03:34 +01:00
|
|
|
#include <bits/c++io.h> // for __c_lock and __c_file
|
2002-02-12 05:35:58 +01:00
|
|
|
#include <ios>
|
2001-06-13 01:09:09 +02:00
|
|
|
|
2005-12-19 01:56:05 +01:00
|
|
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
|
|
|
|
2002-02-12 05:35:58 +01:00
|
|
|
// Generic declaration.
|
2001-06-13 01:09:09 +02:00
|
|
|
template<typename _CharT>
|
2002-02-12 05:35:58 +01:00
|
|
|
class __basic_file;
|
2001-06-13 01:09:09 +02:00
|
|
|
|
2002-02-12 05:35:58 +01:00
|
|
|
// Specialization.
|
|
|
|
template<>
|
|
|
|
class __basic_file<char>
|
2001-06-13 01:09:09 +02:00
|
|
|
{
|
2002-02-12 05:35:58 +01:00
|
|
|
// Underlying data source/sink.
|
2002-04-16 02:45:36 +02:00
|
|
|
__c_file* _M_cfile;
|
[multiple changes]
2003-05-10 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/9027
PR libstdc++/9520
PR libstdc++/10096
* include/bits/fstream.tcc (basic_file::_M_underflow): Add generic
implementation, based on old wchar_t specialization, add support
for codecvt::in() return value of codecvt_base::noconv, remove
_M_file.sys_ungetc() call.
* include/std/std_fstream.h (basic_file::underflow,
basic_file::uflow, basic_file::_M_underflow): Remove
specialization declarations, call _M_underflow from generic versions
of underflow and uflow.
* src/fstream.cc (basic_file::underflow, basic_file::uflow,
basic_file::_M_underflow): Remove specializations.
* src/Makefile.am (sources): Remove fstream.cc.
* src/Makefile.in: Regenerated.
* testsuite/27_io/basic_filebuf/underflow/10096.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/char/1.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/char/9027.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc: New test.
2003-05-10 Benjamin Kosnik <bkoz@redhat.com>
* include/ext/stdio_filebuf.h (__stdio_filebuf): Remove stack
buffer.
* config/io/basic_file_stdio.h (__basic_file::xsgetn): Remove
unbuffered bits.
(__basic_file::xsputn): Same.
(__basic_file::seekoff): Same.
(__basic_file::seekpos): Same.
(__basic_file::showmanyc): Same.
* config/io/basic_file_stdio.cc: Same.
* include/std/std_fstream.h: Same.
* include/bits/fstream.tcc: Same.
* src/fstream.cc: Same.
* testsuite/27_io/basic_filebuf/sgetn/char/1.cc (test05): Tidy.
2003-05-10 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/9520
PR libstdc++/9661
PR libstdc++/9662
* include/ext/stdio_sync_filebuf.h: New file.
(basic_stdiobuf): New.
* include/Makefile.am (ext_headers): Add ext/stdio_sync_filebuf.h
* include/Makefile.in: Regenerate.
* include/bits/ios_base.h (Init::_S_create_buffers,
Init::_S_destroy_buffers): Remove declarations.
* src/globals.cc (buf_cout_sync, buf_cin_sync, buf_cerr_sync,
buf_wcout_sync, buf_wcin_sync, buf_wcerr_sync): Define.
* src/ios.cc (Init::_S_create_buffers,
Init::_S_destroy_buffers): Remove.
(Init::Init): Create and use syncronized buffers.
(ios_base::sync_with_stdio): Destroy syncronized buffers,
create and install unsyncronized buffers.
* testsuite/27_io/objects/char/10.cc: New test.
* testsuite/27_io/objects/char/9.cc: New test.
* testsuite/27_io/objects/char/9661-1.cc: New test.
* testsuite/27_io/objects/char/9661-2_xin.cc: New test.
* testsuite/27_io/objects/char/9661-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/1.cc: New test.
* testsuite/27_io/objects/wchar_t/10.cc: New test.
* testsuite/27_io/objects/wchar_t/2.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-1_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-1_xin.in: New.
* testsuite/27_io/objects/wchar_t/2523-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/3045.cc: New test.
* testsuite/27_io/objects/wchar_t/3647.cc: New test.
* testsuite/27_io/objects/wchar_t/3_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/3_xin.in: New.
* testsuite/27_io/objects/wchar_t/4_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/4_xin.in: New.
* testsuite/27_io/objects/wchar_t/5.cc: New test.
* testsuite/27_io/objects/wchar_t/5268.cc: New test.
* testsuite/27_io/objects/wchar_t/5280_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/5280_xin.in: New.
* testsuite/27_io/objects/wchar_t/6.cc: New test.
* testsuite/27_io/objects/wchar_t/6548_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6548_xin.in: New.
* testsuite/27_io/objects/wchar_t/6648-1_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6648-1_xin.in: New.
* testsuite/27_io/objects/wchar_t/6648-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6648-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/7.cc: New test.
* testsuite/27_io/objects/wchar_t/7744_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/7744_xin.in: New.
* testsuite/27_io/objects/wchar_t/8.cc: New test.
* testsuite/27_io/objects/wchar_t/9_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/9_xin.in: New.
* testsuite/27_io/objects/wchar_t/9520.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-1.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/9662.cc: New test.
* testsuite/ext/stdiobuf_char.cc: New test.
* testsuite/ext/stdiobuf_wchar_t.cc: New test.
From-SVN: r66678
2003-05-11 06:20:57 +02:00
|
|
|
|
2002-02-12 05:35:58 +01:00
|
|
|
// True iff we opened _M_cfile, and thus must close it ourselves.
|
|
|
|
bool _M_cfile_created;
|
2001-02-28 04:20:36 +01:00
|
|
|
|
2002-02-12 05:35:58 +01:00
|
|
|
public:
|
2009-05-03 18:51:50 +02:00
|
|
|
__basic_file(__c_lock* __lock = 0) throw ();
|
2004-02-05 06:24:18 +01:00
|
|
|
|
2002-02-12 05:35:58 +01:00
|
|
|
__basic_file*
|
|
|
|
open(const char* __name, ios_base::openmode __mode, int __prot = 0664);
|
2001-02-28 04:20:36 +01:00
|
|
|
|
2002-02-12 05:35:58 +01:00
|
|
|
__basic_file*
|
2002-04-30 21:04:43 +02:00
|
|
|
sys_open(__c_file* __file, ios_base::openmode);
|
|
|
|
|
|
|
|
__basic_file*
|
2009-05-03 18:51:50 +02:00
|
|
|
sys_open(int __fd, ios_base::openmode __mode) throw ();
|
2001-02-28 04:20:36 +01:00
|
|
|
|
2002-02-12 05:35:58 +01:00
|
|
|
__basic_file*
|
|
|
|
close();
|
2001-02-28 04:20:36 +01:00
|
|
|
|
2009-05-03 18:51:50 +02:00
|
|
|
_GLIBCXX_PURE bool
|
|
|
|
is_open() const throw ();
|
2001-02-28 04:20:36 +01:00
|
|
|
|
2009-05-03 18:51:50 +02:00
|
|
|
_GLIBCXX_PURE int
|
|
|
|
fd() throw ();
|
2001-02-28 04:20:36 +01:00
|
|
|
|
2009-05-03 18:51:50 +02:00
|
|
|
_GLIBCXX_PURE __c_file*
|
|
|
|
file() throw ();
|
2004-05-29 16:40:59 +02:00
|
|
|
|
2002-02-12 05:35:58 +01:00
|
|
|
~__basic_file();
|
2001-02-28 04:20:36 +01:00
|
|
|
|
2002-02-12 05:35:58 +01:00
|
|
|
streamsize
|
[multiple changes]
2003-05-10 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/9027
PR libstdc++/9520
PR libstdc++/10096
* include/bits/fstream.tcc (basic_file::_M_underflow): Add generic
implementation, based on old wchar_t specialization, add support
for codecvt::in() return value of codecvt_base::noconv, remove
_M_file.sys_ungetc() call.
* include/std/std_fstream.h (basic_file::underflow,
basic_file::uflow, basic_file::_M_underflow): Remove
specialization declarations, call _M_underflow from generic versions
of underflow and uflow.
* src/fstream.cc (basic_file::underflow, basic_file::uflow,
basic_file::_M_underflow): Remove specializations.
* src/Makefile.am (sources): Remove fstream.cc.
* src/Makefile.in: Regenerated.
* testsuite/27_io/basic_filebuf/underflow/10096.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/char/1.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/char/9027.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc: New test.
2003-05-10 Benjamin Kosnik <bkoz@redhat.com>
* include/ext/stdio_filebuf.h (__stdio_filebuf): Remove stack
buffer.
* config/io/basic_file_stdio.h (__basic_file::xsgetn): Remove
unbuffered bits.
(__basic_file::xsputn): Same.
(__basic_file::seekoff): Same.
(__basic_file::seekpos): Same.
(__basic_file::showmanyc): Same.
* config/io/basic_file_stdio.cc: Same.
* include/std/std_fstream.h: Same.
* include/bits/fstream.tcc: Same.
* src/fstream.cc: Same.
* testsuite/27_io/basic_filebuf/sgetn/char/1.cc (test05): Tidy.
2003-05-10 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/9520
PR libstdc++/9661
PR libstdc++/9662
* include/ext/stdio_sync_filebuf.h: New file.
(basic_stdiobuf): New.
* include/Makefile.am (ext_headers): Add ext/stdio_sync_filebuf.h
* include/Makefile.in: Regenerate.
* include/bits/ios_base.h (Init::_S_create_buffers,
Init::_S_destroy_buffers): Remove declarations.
* src/globals.cc (buf_cout_sync, buf_cin_sync, buf_cerr_sync,
buf_wcout_sync, buf_wcin_sync, buf_wcerr_sync): Define.
* src/ios.cc (Init::_S_create_buffers,
Init::_S_destroy_buffers): Remove.
(Init::Init): Create and use syncronized buffers.
(ios_base::sync_with_stdio): Destroy syncronized buffers,
create and install unsyncronized buffers.
* testsuite/27_io/objects/char/10.cc: New test.
* testsuite/27_io/objects/char/9.cc: New test.
* testsuite/27_io/objects/char/9661-1.cc: New test.
* testsuite/27_io/objects/char/9661-2_xin.cc: New test.
* testsuite/27_io/objects/char/9661-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/1.cc: New test.
* testsuite/27_io/objects/wchar_t/10.cc: New test.
* testsuite/27_io/objects/wchar_t/2.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-1_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-1_xin.in: New.
* testsuite/27_io/objects/wchar_t/2523-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/3045.cc: New test.
* testsuite/27_io/objects/wchar_t/3647.cc: New test.
* testsuite/27_io/objects/wchar_t/3_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/3_xin.in: New.
* testsuite/27_io/objects/wchar_t/4_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/4_xin.in: New.
* testsuite/27_io/objects/wchar_t/5.cc: New test.
* testsuite/27_io/objects/wchar_t/5268.cc: New test.
* testsuite/27_io/objects/wchar_t/5280_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/5280_xin.in: New.
* testsuite/27_io/objects/wchar_t/6.cc: New test.
* testsuite/27_io/objects/wchar_t/6548_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6548_xin.in: New.
* testsuite/27_io/objects/wchar_t/6648-1_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6648-1_xin.in: New.
* testsuite/27_io/objects/wchar_t/6648-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6648-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/7.cc: New test.
* testsuite/27_io/objects/wchar_t/7744_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/7744_xin.in: New.
* testsuite/27_io/objects/wchar_t/8.cc: New test.
* testsuite/27_io/objects/wchar_t/9_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/9_xin.in: New.
* testsuite/27_io/objects/wchar_t/9520.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-1.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/9662.cc: New test.
* testsuite/ext/stdiobuf_char.cc: New test.
* testsuite/ext/stdiobuf_wchar_t.cc: New test.
From-SVN: r66678
2003-05-11 06:20:57 +02:00
|
|
|
xsputn(const char* __s, streamsize __n);
|
2001-02-28 04:20:36 +01:00
|
|
|
|
2003-07-14 20:23:12 +02:00
|
|
|
streamsize
|
|
|
|
xsputn_2(const char* __s1, streamsize __n1,
|
|
|
|
const char* __s2, streamsize __n2);
|
|
|
|
|
2002-02-12 05:35:58 +01:00
|
|
|
streamsize
|
[multiple changes]
2003-05-10 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/9027
PR libstdc++/9520
PR libstdc++/10096
* include/bits/fstream.tcc (basic_file::_M_underflow): Add generic
implementation, based on old wchar_t specialization, add support
for codecvt::in() return value of codecvt_base::noconv, remove
_M_file.sys_ungetc() call.
* include/std/std_fstream.h (basic_file::underflow,
basic_file::uflow, basic_file::_M_underflow): Remove
specialization declarations, call _M_underflow from generic versions
of underflow and uflow.
* src/fstream.cc (basic_file::underflow, basic_file::uflow,
basic_file::_M_underflow): Remove specializations.
* src/Makefile.am (sources): Remove fstream.cc.
* src/Makefile.in: Regenerated.
* testsuite/27_io/basic_filebuf/underflow/10096.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/char/1.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/char/9027.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc: New test.
2003-05-10 Benjamin Kosnik <bkoz@redhat.com>
* include/ext/stdio_filebuf.h (__stdio_filebuf): Remove stack
buffer.
* config/io/basic_file_stdio.h (__basic_file::xsgetn): Remove
unbuffered bits.
(__basic_file::xsputn): Same.
(__basic_file::seekoff): Same.
(__basic_file::seekpos): Same.
(__basic_file::showmanyc): Same.
* config/io/basic_file_stdio.cc: Same.
* include/std/std_fstream.h: Same.
* include/bits/fstream.tcc: Same.
* src/fstream.cc: Same.
* testsuite/27_io/basic_filebuf/sgetn/char/1.cc (test05): Tidy.
2003-05-10 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/9520
PR libstdc++/9661
PR libstdc++/9662
* include/ext/stdio_sync_filebuf.h: New file.
(basic_stdiobuf): New.
* include/Makefile.am (ext_headers): Add ext/stdio_sync_filebuf.h
* include/Makefile.in: Regenerate.
* include/bits/ios_base.h (Init::_S_create_buffers,
Init::_S_destroy_buffers): Remove declarations.
* src/globals.cc (buf_cout_sync, buf_cin_sync, buf_cerr_sync,
buf_wcout_sync, buf_wcin_sync, buf_wcerr_sync): Define.
* src/ios.cc (Init::_S_create_buffers,
Init::_S_destroy_buffers): Remove.
(Init::Init): Create and use syncronized buffers.
(ios_base::sync_with_stdio): Destroy syncronized buffers,
create and install unsyncronized buffers.
* testsuite/27_io/objects/char/10.cc: New test.
* testsuite/27_io/objects/char/9.cc: New test.
* testsuite/27_io/objects/char/9661-1.cc: New test.
* testsuite/27_io/objects/char/9661-2_xin.cc: New test.
* testsuite/27_io/objects/char/9661-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/1.cc: New test.
* testsuite/27_io/objects/wchar_t/10.cc: New test.
* testsuite/27_io/objects/wchar_t/2.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-1_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-1_xin.in: New.
* testsuite/27_io/objects/wchar_t/2523-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/3045.cc: New test.
* testsuite/27_io/objects/wchar_t/3647.cc: New test.
* testsuite/27_io/objects/wchar_t/3_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/3_xin.in: New.
* testsuite/27_io/objects/wchar_t/4_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/4_xin.in: New.
* testsuite/27_io/objects/wchar_t/5.cc: New test.
* testsuite/27_io/objects/wchar_t/5268.cc: New test.
* testsuite/27_io/objects/wchar_t/5280_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/5280_xin.in: New.
* testsuite/27_io/objects/wchar_t/6.cc: New test.
* testsuite/27_io/objects/wchar_t/6548_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6548_xin.in: New.
* testsuite/27_io/objects/wchar_t/6648-1_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6648-1_xin.in: New.
* testsuite/27_io/objects/wchar_t/6648-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6648-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/7.cc: New test.
* testsuite/27_io/objects/wchar_t/7744_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/7744_xin.in: New.
* testsuite/27_io/objects/wchar_t/8.cc: New test.
* testsuite/27_io/objects/wchar_t/9_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/9_xin.in: New.
* testsuite/27_io/objects/wchar_t/9520.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-1.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/9662.cc: New test.
* testsuite/ext/stdiobuf_char.cc: New test.
* testsuite/ext/stdiobuf_wchar_t.cc: New test.
From-SVN: r66678
2003-05-11 06:20:57 +02:00
|
|
|
xsgetn(char* __s, streamsize __n);
|
2001-02-28 04:20:36 +01:00
|
|
|
|
2003-10-17 00:37:53 +02:00
|
|
|
streamoff
|
2009-05-03 18:51:50 +02:00
|
|
|
seekoff(streamoff __off, ios_base::seekdir __way) throw ();
|
2001-02-28 04:20:36 +01:00
|
|
|
|
2002-02-12 05:35:58 +01:00
|
|
|
int
|
|
|
|
sync();
|
2003-03-28 19:28:47 +01:00
|
|
|
|
|
|
|
streamsize
|
[multiple changes]
2003-05-10 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/9027
PR libstdc++/9520
PR libstdc++/10096
* include/bits/fstream.tcc (basic_file::_M_underflow): Add generic
implementation, based on old wchar_t specialization, add support
for codecvt::in() return value of codecvt_base::noconv, remove
_M_file.sys_ungetc() call.
* include/std/std_fstream.h (basic_file::underflow,
basic_file::uflow, basic_file::_M_underflow): Remove
specialization declarations, call _M_underflow from generic versions
of underflow and uflow.
* src/fstream.cc (basic_file::underflow, basic_file::uflow,
basic_file::_M_underflow): Remove specializations.
* src/Makefile.am (sources): Remove fstream.cc.
* src/Makefile.in: Regenerated.
* testsuite/27_io/basic_filebuf/underflow/10096.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/char/1.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/char/9027.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc: New test.
2003-05-10 Benjamin Kosnik <bkoz@redhat.com>
* include/ext/stdio_filebuf.h (__stdio_filebuf): Remove stack
buffer.
* config/io/basic_file_stdio.h (__basic_file::xsgetn): Remove
unbuffered bits.
(__basic_file::xsputn): Same.
(__basic_file::seekoff): Same.
(__basic_file::seekpos): Same.
(__basic_file::showmanyc): Same.
* config/io/basic_file_stdio.cc: Same.
* include/std/std_fstream.h: Same.
* include/bits/fstream.tcc: Same.
* src/fstream.cc: Same.
* testsuite/27_io/basic_filebuf/sgetn/char/1.cc (test05): Tidy.
2003-05-10 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/9520
PR libstdc++/9661
PR libstdc++/9662
* include/ext/stdio_sync_filebuf.h: New file.
(basic_stdiobuf): New.
* include/Makefile.am (ext_headers): Add ext/stdio_sync_filebuf.h
* include/Makefile.in: Regenerate.
* include/bits/ios_base.h (Init::_S_create_buffers,
Init::_S_destroy_buffers): Remove declarations.
* src/globals.cc (buf_cout_sync, buf_cin_sync, buf_cerr_sync,
buf_wcout_sync, buf_wcin_sync, buf_wcerr_sync): Define.
* src/ios.cc (Init::_S_create_buffers,
Init::_S_destroy_buffers): Remove.
(Init::Init): Create and use syncronized buffers.
(ios_base::sync_with_stdio): Destroy syncronized buffers,
create and install unsyncronized buffers.
* testsuite/27_io/objects/char/10.cc: New test.
* testsuite/27_io/objects/char/9.cc: New test.
* testsuite/27_io/objects/char/9661-1.cc: New test.
* testsuite/27_io/objects/char/9661-2_xin.cc: New test.
* testsuite/27_io/objects/char/9661-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/1.cc: New test.
* testsuite/27_io/objects/wchar_t/10.cc: New test.
* testsuite/27_io/objects/wchar_t/2.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-1_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-1_xin.in: New.
* testsuite/27_io/objects/wchar_t/2523-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/3045.cc: New test.
* testsuite/27_io/objects/wchar_t/3647.cc: New test.
* testsuite/27_io/objects/wchar_t/3_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/3_xin.in: New.
* testsuite/27_io/objects/wchar_t/4_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/4_xin.in: New.
* testsuite/27_io/objects/wchar_t/5.cc: New test.
* testsuite/27_io/objects/wchar_t/5268.cc: New test.
* testsuite/27_io/objects/wchar_t/5280_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/5280_xin.in: New.
* testsuite/27_io/objects/wchar_t/6.cc: New test.
* testsuite/27_io/objects/wchar_t/6548_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6548_xin.in: New.
* testsuite/27_io/objects/wchar_t/6648-1_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6648-1_xin.in: New.
* testsuite/27_io/objects/wchar_t/6648-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6648-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/7.cc: New test.
* testsuite/27_io/objects/wchar_t/7744_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/7744_xin.in: New.
* testsuite/27_io/objects/wchar_t/8.cc: New test.
* testsuite/27_io/objects/wchar_t/9_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/9_xin.in: New.
* testsuite/27_io/objects/wchar_t/9520.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-1.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/9662.cc: New test.
* testsuite/ext/stdiobuf_char.cc: New test.
* testsuite/ext/stdiobuf_wchar_t.cc: New test.
From-SVN: r66678
2003-05-11 06:20:57 +02:00
|
|
|
showmanyc();
|
2002-02-12 05:35:58 +01:00
|
|
|
};
|
2005-12-19 01:56:05 +01:00
|
|
|
|
|
|
|
_GLIBCXX_END_NAMESPACE
|
2002-02-12 05:35:58 +01:00
|
|
|
|
[multiple changes]
2003-05-10 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/9027
PR libstdc++/9520
PR libstdc++/10096
* include/bits/fstream.tcc (basic_file::_M_underflow): Add generic
implementation, based on old wchar_t specialization, add support
for codecvt::in() return value of codecvt_base::noconv, remove
_M_file.sys_ungetc() call.
* include/std/std_fstream.h (basic_file::underflow,
basic_file::uflow, basic_file::_M_underflow): Remove
specialization declarations, call _M_underflow from generic versions
of underflow and uflow.
* src/fstream.cc (basic_file::underflow, basic_file::uflow,
basic_file::_M_underflow): Remove specializations.
* src/Makefile.am (sources): Remove fstream.cc.
* src/Makefile.in: Regenerated.
* testsuite/27_io/basic_filebuf/underflow/10096.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/char/1.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/char/9027.cc: New test.
* testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc: New test.
2003-05-10 Benjamin Kosnik <bkoz@redhat.com>
* include/ext/stdio_filebuf.h (__stdio_filebuf): Remove stack
buffer.
* config/io/basic_file_stdio.h (__basic_file::xsgetn): Remove
unbuffered bits.
(__basic_file::xsputn): Same.
(__basic_file::seekoff): Same.
(__basic_file::seekpos): Same.
(__basic_file::showmanyc): Same.
* config/io/basic_file_stdio.cc: Same.
* include/std/std_fstream.h: Same.
* include/bits/fstream.tcc: Same.
* src/fstream.cc: Same.
* testsuite/27_io/basic_filebuf/sgetn/char/1.cc (test05): Tidy.
2003-05-10 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/9520
PR libstdc++/9661
PR libstdc++/9662
* include/ext/stdio_sync_filebuf.h: New file.
(basic_stdiobuf): New.
* include/Makefile.am (ext_headers): Add ext/stdio_sync_filebuf.h
* include/Makefile.in: Regenerate.
* include/bits/ios_base.h (Init::_S_create_buffers,
Init::_S_destroy_buffers): Remove declarations.
* src/globals.cc (buf_cout_sync, buf_cin_sync, buf_cerr_sync,
buf_wcout_sync, buf_wcin_sync, buf_wcerr_sync): Define.
* src/ios.cc (Init::_S_create_buffers,
Init::_S_destroy_buffers): Remove.
(Init::Init): Create and use syncronized buffers.
(ios_base::sync_with_stdio): Destroy syncronized buffers,
create and install unsyncronized buffers.
* testsuite/27_io/objects/char/10.cc: New test.
* testsuite/27_io/objects/char/9.cc: New test.
* testsuite/27_io/objects/char/9661-1.cc: New test.
* testsuite/27_io/objects/char/9661-2_xin.cc: New test.
* testsuite/27_io/objects/char/9661-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/1.cc: New test.
* testsuite/27_io/objects/wchar_t/10.cc: New test.
* testsuite/27_io/objects/wchar_t/2.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-1_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-1_xin.in: New.
* testsuite/27_io/objects/wchar_t/2523-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/2523-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/3045.cc: New test.
* testsuite/27_io/objects/wchar_t/3647.cc: New test.
* testsuite/27_io/objects/wchar_t/3_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/3_xin.in: New.
* testsuite/27_io/objects/wchar_t/4_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/4_xin.in: New.
* testsuite/27_io/objects/wchar_t/5.cc: New test.
* testsuite/27_io/objects/wchar_t/5268.cc: New test.
* testsuite/27_io/objects/wchar_t/5280_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/5280_xin.in: New.
* testsuite/27_io/objects/wchar_t/6.cc: New test.
* testsuite/27_io/objects/wchar_t/6548_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6548_xin.in: New.
* testsuite/27_io/objects/wchar_t/6648-1_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6648-1_xin.in: New.
* testsuite/27_io/objects/wchar_t/6648-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/6648-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/7.cc: New test.
* testsuite/27_io/objects/wchar_t/7744_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/7744_xin.in: New.
* testsuite/27_io/objects/wchar_t/8.cc: New test.
* testsuite/27_io/objects/wchar_t/9_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/9_xin.in: New.
* testsuite/27_io/objects/wchar_t/9520.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-1.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-2_xin.cc: New test.
* testsuite/27_io/objects/wchar_t/9661-2_xin.in: New.
* testsuite/27_io/objects/wchar_t/9662.cc: New test.
* testsuite/ext/stdiobuf_char.cc: New test.
* testsuite/ext/stdiobuf_wchar_t.cc: New test.
From-SVN: r66678
2003-05-11 06:20:57 +02:00
|
|
|
#endif
|