Commit eafa1afa by Benjamin Kosnik Committed by Benjamin Kosnik

strstream: Remove namespace std.


2002-07-01  Benjamin Kosnik  <bkoz@redhat.com>

	* include/backward/strstream: Remove namespace std. Transfer to...
	* include/backward/strstream.h: ...here. Qualify std names.
	* src/strstream.cc: Remove namespace std.
	* include/Makefile.am (backward_headers): Remove strstream.h.
	* include/Makefile.in: Regenerate.
	* config/linker-map.gnu: Export strstream bits.

	* src/fstream-inst.cc: Tweak.
	* src/io-inst.cc: Same.
	* src/istream-inst.cc: Same.
	* src/misc-inst.cc: Same.
	* src/ostream-inst.cc: Same.
	* src/sstream-inst.cc: Same.
	* src/valarray-inst.cc: Same.
	* src/misc-inst.cc: Remove unused instantiations.

From-SVN: r55148
parent c1b92d09
2002-07-01 Benjamin Kosnik <bkoz@redhat.com>
* include/backward/strstream: Remove namespace std. Transfer to...
* include/backward/strstream.h: ...here. Qualify std names.
* src/strstream.cc: Remove namespace std.
* include/Makefile.am (backward_headers): Remove strstream.h.
* include/Makefile.in: Regenerate.
* config/linker-map.gnu: Export strstream bits.
* src/fstream-inst.cc: Tweak.
* src/io-inst.cc: Same.
* src/istream-inst.cc: Same.
* src/misc-inst.cc: Same.
* src/ostream-inst.cc: Same.
* src/sstream-inst.cc: Same.
* src/valarray-inst.cc: Same.
* src/misc-inst.cc: Remove unused instantiations.
2002-07-01 Benjamin Kosnik <bkoz@redhat.com>
* configure.in (libtool_VERSION): Bump to 5:0:0.
* configure: Regenerate.
......
......@@ -38,7 +38,11 @@ GLIBCPP_3.1 {
std::_S_bit_count;
std::_S_first_one;
std::__default_alloc_template*;
std::__malloc_alloc_template*
std::__malloc_alloc_template*;
strstreambuf::*;
istrstream::*;
ostrstream::*;
strstream::*
};
# Names not in an 'extern' block are mangled names.
......
......@@ -139,7 +139,6 @@ backward_headers = \
${backward_srcdir}/vector.h \
${backward_srcdir}/fstream.h \
${backward_srcdir}/strstream.h \
${backward_srcdir}/strstream \
${backward_srcdir}/backward_warning.h
ext_srcdir = ${glibcpp_srcdir}/include/ext
......
......@@ -246,7 +246,6 @@ backward_headers = \
${backward_srcdir}/vector.h \
${backward_srcdir}/fstream.h \
${backward_srcdir}/strstream.h \
${backward_srcdir}/strstream \
${backward_srcdir}/backward_warning.h
......
// Backward-compat support -*- C++ -*-
// Copyright (C) 2001, 2002 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.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 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.
/*
* 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
#include "backward_warning.h"
#include <iosfwd>
#include <ios>
#include <istream>
#include <ostream>
#include <string>
namespace std
{
// 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:
void freeze(bool = true);
char* str();
int pcount() const;
protected:
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:
// 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;
};
} // namespace std
#endif
// -*- C++ -*- forwarding header.
// Copyright (C) 2000 Free Software Foundation
// Backward-compat support -*- C++ -*-
// This file is part of GNU CC.
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// 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)
// 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.
//
// GNU CC is distributed in the hope that it will be useful,
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with GNU CC; 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 this library; 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
......@@ -27,15 +27,148 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/*
* 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 _CPP_BACKWARD_STRSTREAM_H
#define _CPP_BACKWARD_STRSTREAM_H 1
#include "strstream"
#include "backward_warning.h"
#include <iosfwd>
#include <ios>
#include <istream>
#include <ostream>
#include <string>
using std::strstreambuf;
using std::istrstream;
using std::ostrstream;
using std::strstream;
// Class strstreambuf, a streambuf class that manages an array of char.
// Note that this class is not a template.
class strstreambuf : public std::basic_streambuf<char>
{
public:
// Types.
typedef std::char_traits<char> _Traits;
typedef std::basic_streambuf<char, _Traits> _Base;
#endif
public:
// Constructor, destructor
explicit strstreambuf(std::streamsize __initial_capacity = 0);
strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*));
strstreambuf(char* __get, std::streamsize __n, char* __put = 0);
strstreambuf(signed char* __get, std::streamsize __n,
signed char* __put = 0);
strstreambuf(unsigned char* __get, std::streamsize __n,
unsigned char* __put=0);
strstreambuf(const char* __get, std::streamsize __n);
strstreambuf(const signed char* __get, std::streamsize __n);
strstreambuf(const unsigned char* __get, std::streamsize __n);
virtual ~strstreambuf();
public:
void freeze(bool = true);
char* str();
int pcount() const;
protected:
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, std::streamsize __n);
virtual pos_type seekoff(off_type __off, std::ios_base::seekdir __dir,
std::ios_base::openmode __mode
= std::ios_base::in | std::ios_base::out);
virtual pos_type seekpos(pos_type __pos, std::ios_base::openmode __mode
= std::ios_base::in | std::ios_base::out);
private:
// 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, std::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 std::basic_istream<char>
{
public:
explicit istrstream(char*);
explicit istrstream(const char*);
istrstream(char* , std::streamsize);
istrstream(const char*, std::streamsize);
virtual ~istrstream();
strstreambuf* rdbuf() const;
char* str();
private:
strstreambuf _M_buf;
};
// Class ostrstream
class ostrstream : public std::basic_ostream<char>
{
public:
ostrstream();
ostrstream(char*, int, std::ios_base::openmode = std::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 std::basic_iostream<char>
{
public:
typedef char char_type;
typedef std::char_traits<char>::int_type int_type;
typedef std::char_traits<char>::pos_type pos_type;
typedef std::char_traits<char>::off_type off_type;
strstream();
strstream(char*, int,
std::ios_base::openmode = std::ios_base::in | std::ios_base::out);
virtual ~strstream();
strstreambuf* rdbuf() const;
void freeze(bool = true);
int pcount() const;
char* str();
private:
strstreambuf _M_buf;
};
#endif
......@@ -59,4 +59,4 @@ namespace std
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_fstream<wchar_t>;
#endif
} //std
} // namespace std
......@@ -57,4 +57,4 @@ namespace std
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_iostream<wchar_t>;
#endif
} //std
} // namespace std
......@@ -67,4 +67,4 @@ namespace std
template wistream& operator>>(wistream&, _Setprecision);
template wistream& operator>>(wistream&, _Setw);
#endif
} //std
} // namespace std
......@@ -67,36 +67,4 @@ namespace std
basic_istream<wchar_t>&
getline(basic_istream<wchar_t>&, wstring&);
#endif
#if 1
// XXX
// 2002-05-24 These are no longer needed and should be deleted.
// algorithm
typedef _Char_traits_match<char, char_traits<char> > char_match;
template
const char*
find_if<const char *, char_match>
(const char *, const char *, char_match, random_access_iterator_tag);
#ifdef _GLIBCPP_USE_WCHAR_T
typedef _Char_traits_match<wchar_t, char_traits<wchar_t> > wchar_match;
template const wchar_t*
find_if<const wchar_t*, wchar_match>
(const wchar_t*, const wchar_t*, wchar_match, random_access_iterator_tag);
#endif
template
string*
__uninitialized_fill_n_aux<string*, size_t, string>
(string*, size_t, string const &, __false_type);
template
string*
__uninitialized_copy_aux<vector<string>::const_iterator, string *>
(vector<string>::const_iterator, vector<string>::const_iterator,
string*, __false_type);
#endif
} //std
} // namespace std
......@@ -73,4 +73,4 @@ namespace std
template wostream& operator<<(wostream&, _Setprecision);
template wostream& operator<<(wostream&, _Setw);
#endif
} //std
} // namespace std
......@@ -59,4 +59,4 @@ namespace std
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_stringstream<wchar_t>;
#endif
} //std
} // namespace std
......@@ -35,7 +35,7 @@
namespace std
{
// Some explicit instanciations.
// Some explicit instantiations.
template void
__valarray_fill(size_t* __restrict__, size_t, const size_t&);
......@@ -112,7 +112,5 @@ namespace std
const valarray<size_t>& __s)
: _M_count(1), _M_start(__o), _M_size(__l), _M_stride(__s),
_M_index(__l.size() == 0 ? 0 : __valarray_product(__l))
{ __gslice_to_index(__o, __l, __s, _M_index); }
{ __gslice_to_index(__o, __l, __s, _M_index); }
} // namespace std
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment