1*404b540aSrobert // Forwarding declarations -*- C++ -*- 2*404b540aSrobert 3*404b540aSrobert // Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2005 4*404b540aSrobert // Free Software Foundation, Inc. 5*404b540aSrobert // 6*404b540aSrobert // This file is part of the GNU ISO C++ Library. This library is free 7*404b540aSrobert // software; you can redistribute it and/or modify it under the 8*404b540aSrobert // terms of the GNU General Public License as published by the 9*404b540aSrobert // Free Software Foundation; either version 2, or (at your option) 10*404b540aSrobert // any later version. 11*404b540aSrobert 12*404b540aSrobert // This library is distributed in the hope that it will be useful, 13*404b540aSrobert // but WITHOUT ANY WARRANTY; without even the implied warranty of 14*404b540aSrobert // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15*404b540aSrobert // GNU General Public License for more details. 16*404b540aSrobert 17*404b540aSrobert // You should have received a copy of the GNU General Public License along 18*404b540aSrobert // with this library; see the file COPYING. If not, write to the Free 19*404b540aSrobert // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 20*404b540aSrobert // USA. 21*404b540aSrobert 22*404b540aSrobert // As a special exception, you may use this file as part of a free software 23*404b540aSrobert // library without restriction. Specifically, if other files instantiate 24*404b540aSrobert // templates or use macros or inline functions from this file, or you compile 25*404b540aSrobert // this file and link it with other files to produce an executable, this 26*404b540aSrobert // file does not by itself cause the resulting executable to be covered by 27*404b540aSrobert // the GNU General Public License. This exception does not however 28*404b540aSrobert // invalidate any other reasons why the executable file might be covered by 29*404b540aSrobert // the GNU General Public License. 30*404b540aSrobert 31*404b540aSrobert /** @file iosfwd 32*404b540aSrobert * This is a Standard C++ Library header. 33*404b540aSrobert */ 34*404b540aSrobert 35*404b540aSrobert // 36*404b540aSrobert // ISO C++ 14882: 27.2 Forward declarations 37*404b540aSrobert // 38*404b540aSrobert 39*404b540aSrobert #ifndef _GLIBCXX_IOSFWD 40*404b540aSrobert #define _GLIBCXX_IOSFWD 1 41*404b540aSrobert 42*404b540aSrobert #pragma GCC system_header 43*404b540aSrobert 44*404b540aSrobert #include <bits/c++config.h> 45*404b540aSrobert #include <bits/c++locale.h> 46*404b540aSrobert #include <bits/c++io.h> 47*404b540aSrobert #include <cctype> // For isspace, etc. 48*404b540aSrobert #include <bits/stringfwd.h> // For string forward declarations. 49*404b540aSrobert #include <bits/postypes.h> 50*404b540aSrobert #include <bits/functexcept.h> 51*404b540aSrobert 52*404b540aSrobert _GLIBCXX_BEGIN_NAMESPACE(std) 53*404b540aSrobert 54*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT> > 55*404b540aSrobert class basic_ios; 56*404b540aSrobert 57*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT> > 58*404b540aSrobert class basic_streambuf; 59*404b540aSrobert 60*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT> > 61*404b540aSrobert class basic_istream; 62*404b540aSrobert 63*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT> > 64*404b540aSrobert class basic_ostream; 65*404b540aSrobert 66*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT> > 67*404b540aSrobert class basic_iostream; 68*404b540aSrobert 69*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT>, 70*404b540aSrobert typename _Alloc = allocator<_CharT> > 71*404b540aSrobert class basic_stringbuf; 72*404b540aSrobert 73*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT>, 74*404b540aSrobert typename _Alloc = allocator<_CharT> > 75*404b540aSrobert class basic_istringstream; 76*404b540aSrobert 77*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT>, 78*404b540aSrobert typename _Alloc = allocator<_CharT> > 79*404b540aSrobert class basic_ostringstream; 80*404b540aSrobert 81*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT>, 82*404b540aSrobert typename _Alloc = allocator<_CharT> > 83*404b540aSrobert class basic_stringstream; 84*404b540aSrobert 85*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT> > 86*404b540aSrobert class basic_filebuf; 87*404b540aSrobert 88*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT> > 89*404b540aSrobert class basic_ifstream; 90*404b540aSrobert 91*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT> > 92*404b540aSrobert class basic_ofstream; 93*404b540aSrobert 94*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT> > 95*404b540aSrobert class basic_fstream; 96*404b540aSrobert 97*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT> > 98*404b540aSrobert class istreambuf_iterator; 99*404b540aSrobert 100*404b540aSrobert template<typename _CharT, typename _Traits = char_traits<_CharT> > 101*404b540aSrobert class ostreambuf_iterator; 102*404b540aSrobert 103*404b540aSrobert // _GLIBCXX_RESOLVE_LIB_DEFECTS 104*404b540aSrobert // Not included. (??? Apparently no LWG number?) 105*404b540aSrobert class ios_base; 106*404b540aSrobert 107*404b540aSrobert /** 108*404b540aSrobert * @defgroup s27_2_iosfwd I/O Forward Declarations 109*404b540aSrobert * 110*404b540aSrobert * Nearly all of the I/O classes are parameterized on the type of 111*404b540aSrobert * characters they read and write. (The major exception is ios_base at 112*404b540aSrobert * the top of the hierarchy.) This is a change from pre-Standard 113*404b540aSrobert * streams, which were not templates. 114*404b540aSrobert * 115*404b540aSrobert * For ease of use and compatibility, all of the basic_* I/O-related 116*404b540aSrobert * classes are given typedef names for both of the builtin character 117*404b540aSrobert * widths (wide and narrow). The typedefs are the same as the 118*404b540aSrobert * pre-Standard names, for example: 119*404b540aSrobert * 120*404b540aSrobert * @code 121*404b540aSrobert * typedef basic_ifstream<char> ifstream; 122*404b540aSrobert * @endcode 123*404b540aSrobert * 124*404b540aSrobert * Because properly forward-declaring these classes can be difficult, you 125*404b540aSrobert * should not do it yourself. Instead, include the <iosfwd> 126*404b540aSrobert * header, which contains only declarations of all the I/O classes as 127*404b540aSrobert * well as the typedefs. Trying to forward-declare the typedefs 128*404b540aSrobert * themselves (e.g., "class ostream;") is not valid ISO C++. 129*404b540aSrobert * 130*404b540aSrobert * For more specific declarations, see 131*404b540aSrobert * http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#10 132*404b540aSrobert * 133*404b540aSrobert * @{ 134*404b540aSrobert */ 135*404b540aSrobert typedef basic_ios<char> ios; ///< @isiosfwd 136*404b540aSrobert typedef basic_streambuf<char> streambuf; ///< @isiosfwd 137*404b540aSrobert typedef basic_istream<char> istream; ///< @isiosfwd 138*404b540aSrobert typedef basic_ostream<char> ostream; ///< @isiosfwd 139*404b540aSrobert typedef basic_iostream<char> iostream; ///< @isiosfwd 140*404b540aSrobert typedef basic_stringbuf<char> stringbuf; ///< @isiosfwd 141*404b540aSrobert typedef basic_istringstream<char> istringstream; ///< @isiosfwd 142*404b540aSrobert typedef basic_ostringstream<char> ostringstream; ///< @isiosfwd 143*404b540aSrobert typedef basic_stringstream<char> stringstream; ///< @isiosfwd 144*404b540aSrobert typedef basic_filebuf<char> filebuf; ///< @isiosfwd 145*404b540aSrobert typedef basic_ifstream<char> ifstream; ///< @isiosfwd 146*404b540aSrobert typedef basic_ofstream<char> ofstream; ///< @isiosfwd 147*404b540aSrobert typedef basic_fstream<char> fstream; ///< @isiosfwd 148*404b540aSrobert 149*404b540aSrobert #ifdef _GLIBCXX_USE_WCHAR_T 150*404b540aSrobert typedef basic_ios<wchar_t> wios; ///< @isiosfwd 151*404b540aSrobert typedef basic_streambuf<wchar_t> wstreambuf; ///< @isiosfwd 152*404b540aSrobert typedef basic_istream<wchar_t> wistream; ///< @isiosfwd 153*404b540aSrobert typedef basic_ostream<wchar_t> wostream; ///< @isiosfwd 154*404b540aSrobert typedef basic_iostream<wchar_t> wiostream; ///< @isiosfwd 155*404b540aSrobert typedef basic_stringbuf<wchar_t> wstringbuf; ///< @isiosfwd 156*404b540aSrobert typedef basic_istringstream<wchar_t> wistringstream; ///< @isiosfwd 157*404b540aSrobert typedef basic_ostringstream<wchar_t> wostringstream; ///< @isiosfwd 158*404b540aSrobert typedef basic_stringstream<wchar_t> wstringstream; ///< @isiosfwd 159*404b540aSrobert typedef basic_filebuf<wchar_t> wfilebuf; ///< @isiosfwd 160*404b540aSrobert typedef basic_ifstream<wchar_t> wifstream; ///< @isiosfwd 161*404b540aSrobert typedef basic_ofstream<wchar_t> wofstream; ///< @isiosfwd 162*404b540aSrobert typedef basic_fstream<wchar_t> wfstream; ///< @isiosfwd 163*404b540aSrobert #endif 164*404b540aSrobert /** @} */ 165*404b540aSrobert 166*404b540aSrobert _GLIBCXX_END_NAMESPACE 167*404b540aSrobert 168*404b540aSrobert #endif /* _GLIBCXX_IOSFWD */ 169