strstream.h: Replace with...

2000-11-21  Benjamin Kosnik  <bkoz@purist.soma.redhat.com>

	* include/backward/strstream.h: Replace with...
	* include/bits/std_strstream.h: ...this. Move.
	* include/backward/complex.h: Remove SGIisms.
	* include/backward/streambuf.h: Same.
	* include/backward/stream.h: Same.
	* include/backward/ostream.h: Same.
	* include/backward/istream.h: Same.
	* include/backward/iostream.h: Same.
	* include/backward/iomanip.h: Same.
	* include/backward/fstream.h: Same.
	* libsupc++/new.h: Add using declarations for bad_alloc,
	nothrow_t, and nothrow, move to ...
	* include/backward/new.h: ...here.

From-SVN: r37631
This commit is contained in:
Benjamin Kosnik 2000-11-21 23:44:50 +00:00 committed by Benjamin Kosnik
parent f45d23308a
commit 63e749a813
13 changed files with 233 additions and 318 deletions

View File

@ -1,3 +1,19 @@
2000-11-21 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
* include/backward/strstream.h: Replace with...
* include/bits/std_strstream.h: ...this. Move.
* include/backward/complex.h: Remove SGIisms.
* include/backward/streambuf.h: Same.
* include/backward/stream.h: Same.
* include/backward/ostream.h: Same.
* include/backward/istream.h: Same.
* include/backward/iostream.h: Same.
* include/backward/iomanip.h: Same.
* include/backward/fstream.h: Same.
* libsupc++/new.h: Add using declarations for bad_alloc,
nothrow_t, and nothrow, move to ...
* include/backward/new.h: ...here.
2000-11-21 Mark Mitchell <mark@codesourcery.com>
* porting.texi: New file.
@ -12,10 +28,6 @@
2000-11-21 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
* libsupc++/new.h: Add using declarations for bad_alloc,
nothrow_t, and nothrow.
* include/backward/new.h: Remove duplicate file, as libsupc++ has it.
* acinclude.m4 (AC_LC_MESSAGES): Check for locale.h.
* aclocal.m4: Regenerate.
* configure: Renerate.

View File

@ -1,4 +1,3 @@
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -29,18 +28,14 @@
#ifndef _CPP_BACKWARD_COMPLEX_H
#define _CPP_BACKWARD_COMPLEX_H 1
#include <bits/stl_config.h>
#include <bits/std_complex.h>
#ifdef __STL_USE_NAMESPACES
using __STD::complex;
#endif /* __STL_USE_NAMESPACES */
using std::complex;
typedef complex<float> float_complex;
typedef complex<double> double_complex;
typedef complex<long double> long_double_complex;
typedef complex<float> float_complex;
typedef complex<double> double_complex;
typedef complex<long double> long_double_complex;
#endif /* _CPP_BACKWARD_COMPLEX_H */
#endif
// Local Variables:
// mode:C++

View File

@ -30,20 +30,17 @@
#include <bits/std_fstream.h>
#ifdef __STL_USE_NAMESPACES
using __STD::ifstream;
using __STD::ofstream;
using __STD::fstream;
using std::ifstream;
using std::ofstream;
using std::fstream;
#ifdef _GLIBCPP_USE_WCHAR_T
using __STD::wifstream;
using __STD::wofstream;
using __STD::wfstream;
using std::wifstream;
using std::wofstream;
using std::wfstream;
#endif
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_FSTREAM_H */
#endif
// Local Variables:
// mode:C++

View File

@ -1,4 +1,3 @@
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -32,16 +31,14 @@
#include <backward/iostream.h>
#include <bits/std_iomanip.h>
#ifdef __STL_USE_NAMESPACES
using __STD::resetiosflags;
using __STD::setiosflags;
using __STD::setbase;
using __STD::setfill;
using __STD::setprecision;
using __STD::setw;
#endif /* __STL_USE_NAMESPACES */
using std::resetiosflags;
using std::setiosflags;
using std::setbase;
using std::setfill;
using std::setprecision;
using std::setw;
#endif /* _CPP_BACKWARD_IOMANIP_H */
#endif
// Local Variables:
// mode:C++

View File

@ -1,4 +1,3 @@
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -31,29 +30,27 @@
#include <bits/std_iostream.h>
#ifdef __STL_USE_NAMESPACES
using __STD::iostream;
using __STD::ostream;
using __STD::istream;
using __STD::ios;
using __STD::streambuf;
using std::iostream;
using std::ostream;
using std::istream;
using std::ios;
using std::streambuf;
using __STD::cout;
using __STD::cin;
using __STD::cerr;
using __STD::clog;
using std::cout;
using std::cin;
using std::cerr;
using std::clog;
#ifdef _GLIBCPP_USE_WCHAR_T
using __STD::wcout;
using __STD::wcin;
using __STD::wcerr;
using __STD::wclog;
using std::wcout;
using std::wcin;
using std::wcerr;
using std::wclog;
#endif
using __STD::endl;
using __STD::ends;
#endif /* __STL_USE_NAMESPACES */
using std::endl;
using std::ends;
#endif /* _CPP_BACKWARD_IOSTREAM_H */
#endif
// Local Variables:
// mode:C++

View File

@ -30,8 +30,13 @@
#include <backward/iostream.h>
#endif /* _CPP_BACKWARD_ISTREAM_H */
#endif
// Local Variables:
// mode:C++
// End:

View File

@ -1,21 +1,22 @@
// -*- C++ -*- forwarding header.
// Copyright (C) 2000 Free Software Foundation
// Copyright (C) 1997-1999 Free Software Foundation, Inc.
// This file is part of GNU CC.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// GNU CC is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
//
// GNU CC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
//
// You should have received a copy of the GNU General Public License
// along with GNU CC; see the file COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
@ -26,21 +27,15 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _CPP_BACKWARD_NEW_H
#define _CPP_BACKWARD_NEW_H 1
#ifndef __NEW_H__
#define __NEW_H__
#include <bits/std_new.h>
#include <new>
#ifdef __STL_USE_NAMESPACES
using __STD::bad_alloc;
using __STD::nothrow_t;
using __STD::nothrow;
using __STD::new_handler;
using __STD::set_new_handler;
#endif /* __STL_USE_NAMESPACES */
using std::bad_alloc;
using std::nothrow_t;
using std::nothrow;
using std::new_handler;
using std::set_new_handler;
#endif /* _CPP_BACKWARD_NEW_H */
// Local Variables:
// mode:C++
// End:
#endif // __NEW_H__

View File

@ -30,7 +30,7 @@
#include <backward/iostream.h>
#endif /* _CPP_BACKWARD_OSTREAM_H */
#endif
// Local Variables:
// mode:C++

View File

@ -30,7 +30,7 @@
#include <backward/iostream.h>
#endif /* _CPP_BACKWARD_STREAM_H */
#endif
// Local Variables:
// mode:C++

View File

@ -1,4 +1,3 @@
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -31,11 +30,9 @@
#include <bits/std_streambuf.h>
#ifdef __STL_USE_NAMESPACES
using __STD::streambuf;
#endif /* __STL_USE_NAMESPACES */
using std::streambuf;
#endif /* _CPP_BACKWARD_STREAMBUF_H */
#endif
// Local Variables:
// mode:C++

View File

@ -1,44 +1,161 @@
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
/*
* Copyright (c) 1998
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
// 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.
// WARNING: The classes defined in this header are DEPRECATED. This
// header is defined in section D.7.1 of the C++ standard, and it
// MAY BE REMOVED in a future standard revision. You should use the
// header <sstream> instead.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
#ifndef __SGI_STL_STRSTREAM
#define __SGI_STL_STRSTREAM
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#if defined(__sgi) && !defined(__GNUC__) && !defined(_STANDARD_C_PLUS_PLUS)
#error This header file requires the -LANG:std option
#endif
#ifndef _CPP_BACKWARD_STRSTREAM_H
#define _CPP_BACKWARD_STRSTREAM_H 1
#include <bits/std_iosfwd.h>
#include <bits/std_ios.h>
#include <bits/std_istream.h>
#include <bits/std_ostream.h>
#include <bits/std_string.h>
#include <bits/std_strstream.h>
__STL_BEGIN_NAMESPACE
#ifdef __STL_USE_NAMESPACES
using __STD::strstreambuf;
using __STD::istrstream;
using __STD::ostrstream;
using __STD::strstream;
#endif /* __STL_USE_NAMESPACES */
//----------------------------------------------------------------------
// Class strstreambuf, a streambuf class that manages an array of char.
// Note that this class is not a template.
#endif /* _CPP_BACKWARD_STRSTREAM_H */
class strstreambuf : public basic_streambuf<char, char_traits<char> >
{
public: // Types.
typedef char_traits<char> _Traits;
typedef basic_streambuf<char, _Traits> _Base;
public: // Constructor, destructor
explicit strstreambuf(streamsize __initial_capacity = 0);
strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*));
strstreambuf(char* __get, streamsize __n, char* __put = 0);
strstreambuf(signed char* __get, streamsize __n, signed char* __put = 0);
strstreambuf(unsigned char* __get, streamsize __n, unsigned char* __put=0);
strstreambuf(const char* __get, streamsize __n);
strstreambuf(const signed char* __get, streamsize __n);
strstreambuf(const unsigned char* __get, streamsize __n);
virtual ~strstreambuf();
public: // strstreambuf operations.
void freeze(bool = true);
char* str();
int pcount() const;
protected: // Overridden virtual member functions.
virtual int_type overflow(int_type __c = _Traits::eof());
virtual int_type pbackfail(int_type __c = _Traits::eof());
virtual int_type underflow();
virtual _Base* setbuf(char* __buf, streamsize __n);
virtual pos_type seekoff(off_type __off, ios_base::seekdir __dir,
ios_base::openmode __mode
= ios_base::in | ios_base::out);
virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode
= ios_base::in | ios_base::out);
private: // Helper functions.
// Dynamic allocation, possibly using _M_alloc_fun and _M_free_fun.
char* _M_alloc(size_t);
void _M_free(char*);
// Helper function used in constructors.
void _M_setup(char* __get, char* __put, streamsize __n);
private: // Data members.
void* (*_M_alloc_fun)(size_t);
void (*_M_free_fun)(void*);
bool _M_dynamic : 1;
bool _M_frozen : 1;
bool _M_constant : 1;
};
//----------------------------------------------------------------------
// Class istrstream, an istream that manages a strstreambuf.
class istrstream : public basic_istream<char>
{
public:
explicit istrstream(char*);
explicit istrstream(const char*);
istrstream(char* , streamsize);
istrstream(const char*, streamsize);
virtual ~istrstream();
strstreambuf* rdbuf() const;
char* str();
private:
strstreambuf _M_buf;
};
//----------------------------------------------------------------------
// Class ostrstream
class ostrstream : public basic_ostream<char>
{
public:
ostrstream();
ostrstream(char*, int, ios_base::openmode = ios_base::out);
virtual ~ostrstream();
strstreambuf* rdbuf() const;
void freeze(bool = true);
char* str();
int pcount() const;
private:
strstreambuf _M_buf;
};
//----------------------------------------------------------------------
// Class strstream
class strstream : public basic_iostream<char>
{
public:
typedef char char_type;
typedef char_traits<char>::int_type int_type;
typedef char_traits<char>::pos_type pos_type;
typedef char_traits<char>::off_type off_type;
strstream();
strstream(char*, int, ios_base::openmode = ios_base::in | ios_base::out);
virtual ~strstream();
strstreambuf* rdbuf() const;
void freeze(bool = true);
int pcount() const;
char* str();
private:
strstreambuf _M_buf;
};
__STL_END_NAMESPACE
#endif /* __SGI_STL_STRSTREAM */
// Local Variables:
// mode:C++
// End:

View File

@ -1,159 +0,0 @@
/*
* Copyright (c) 1998
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
// WARNING: The classes defined in this header are DEPRECATED. This
// header is defined in section D.7.1 of the C++ standard, and it
// MAY BE REMOVED in a future standard revision. You should use the
// header <sstream> instead.
#ifndef __SGI_STL_STRSTREAM
#define __SGI_STL_STRSTREAM
#if defined(__sgi) && !defined(__GNUC__) && !defined(_STANDARD_C_PLUS_PLUS)
#error This header file requires the -LANG:std option
#endif
#include <bits/std_iosfwd.h>
#include <bits/std_ios.h>
#include <bits/std_istream.h>
#include <bits/std_ostream.h>
#include <bits/std_string.h>
__STL_BEGIN_NAMESPACE
//----------------------------------------------------------------------
// Class strstreambuf, a streambuf class that manages an array of char.
// Note that this class is not a template.
class strstreambuf : public basic_streambuf<char, char_traits<char> >
{
public: // Types.
typedef char_traits<char> _Traits;
typedef basic_streambuf<char, _Traits> _Base;
public: // Constructor, destructor
explicit strstreambuf(streamsize __initial_capacity = 0);
strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*));
strstreambuf(char* __get, streamsize __n, char* __put = 0);
strstreambuf(signed char* __get, streamsize __n, signed char* __put = 0);
strstreambuf(unsigned char* __get, streamsize __n, unsigned char* __put=0);
strstreambuf(const char* __get, streamsize __n);
strstreambuf(const signed char* __get, streamsize __n);
strstreambuf(const unsigned char* __get, streamsize __n);
virtual ~strstreambuf();
public: // strstreambuf operations.
void freeze(bool = true);
char* str();
int pcount() const;
protected: // Overridden virtual member functions.
virtual int_type overflow(int_type __c = _Traits::eof());
virtual int_type pbackfail(int_type __c = _Traits::eof());
virtual int_type underflow();
virtual _Base* setbuf(char* __buf, streamsize __n);
virtual pos_type seekoff(off_type __off, ios_base::seekdir __dir,
ios_base::openmode __mode
= ios_base::in | ios_base::out);
virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode
= ios_base::in | ios_base::out);
private: // Helper functions.
// Dynamic allocation, possibly using _M_alloc_fun and _M_free_fun.
char* _M_alloc(size_t);
void _M_free(char*);
// Helper function used in constructors.
void _M_setup(char* __get, char* __put, streamsize __n);
private: // Data members.
void* (*_M_alloc_fun)(size_t);
void (*_M_free_fun)(void*);
bool _M_dynamic : 1;
bool _M_frozen : 1;
bool _M_constant : 1;
};
//----------------------------------------------------------------------
// Class istrstream, an istream that manages a strstreambuf.
class istrstream : public basic_istream<char>
{
public:
explicit istrstream(char*);
explicit istrstream(const char*);
istrstream(char* , streamsize);
istrstream(const char*, streamsize);
virtual ~istrstream();
strstreambuf* rdbuf() const;
char* str();
private:
strstreambuf _M_buf;
};
//----------------------------------------------------------------------
// Class ostrstream
class ostrstream : public basic_ostream<char>
{
public:
ostrstream();
ostrstream(char*, int, ios_base::openmode = ios_base::out);
virtual ~ostrstream();
strstreambuf* rdbuf() const;
void freeze(bool = true);
char* str();
int pcount() const;
private:
strstreambuf _M_buf;
};
//----------------------------------------------------------------------
// Class strstream
class strstream : public basic_iostream<char>
{
public:
typedef char char_type;
typedef char_traits<char>::int_type int_type;
typedef char_traits<char>::pos_type pos_type;
typedef char_traits<char>::off_type off_type;
strstream();
strstream(char*, int, ios_base::openmode = ios_base::in | ios_base::out);
virtual ~strstream();
strstreambuf* rdbuf() const;
void freeze(bool = true);
int pcount() const;
char* str();
private:
strstreambuf _M_buf;
};
__STL_END_NAMESPACE
#endif /* __SGI_STL_STRSTREAM */
// Local Variables:
// mode:C++
// End:

View File

@ -1,38 +0,0 @@
// -*- C++ -*- forwarding header.
// Copyright (C) 2000 Free Software Foundation
// This file is part of GNU CC.
//
// GNU CC is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// GNU CC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with GNU CC; see the file COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef __NEW_H__
#define __NEW_H__
#include <new>
using std::new_handler;
using std::set_new_handler;
#endif // __NEW_H__