Home | History | Annotate | Download | only in include
      1 // Forwarding declarations -*- C++ -*-
      2 
      3 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
      4 // 2006, 2007, 2009, 2010
      5 // Free Software Foundation, Inc.
      6 //
      7 // This file is part of the GNU ISO C++ Library.  This library is free
      8 // software; you can redistribute it and/or modify it under the
      9 // terms of the GNU General Public License as published by the
     10 // Free Software Foundation; either version 3, or (at your option)
     11 // any later version.
     12 
     13 // This library is distributed in the hope that it will be useful,
     14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
     15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16 // GNU General Public License for more details.
     17 
     18 // Under Section 7 of GPL version 3, you are granted additional
     19 // permissions described in the GCC Runtime Library Exception, version
     20 // 3.1, as published by the Free Software Foundation.
     21 
     22 // You should have received a copy of the GNU General Public License and
     23 // a copy of the GCC Runtime Library Exception along with this program;
     24 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
     25 // <http://www.gnu.org/licenses/>.
     26 
     27 /** @file include/iosfwd
     28  *  This is a Standard C++ Library header.
     29  */
     30 
     31 //
     32 // ISO C++ 14882: 27.2  Forward declarations
     33 //
     34 
     35 #ifndef _GLIBCXX_IOSFWD
     36 #define _GLIBCXX_IOSFWD 1
     37 
     38 #pragma GCC system_header
     39 
     40 #include <bits/c++config.h>
     41 #include <bits/stringfwd.h> 	// For string forward declarations.
     42 #include <bits/postypes.h>
     43 
     44 namespace std _GLIBCXX_VISIBILITY(default)
     45 {
     46 _GLIBCXX_BEGIN_NAMESPACE_VERSION
     47 
     48   /**
     49    *  @defgroup io I/O
     50    *
     51    *  Nearly all of the I/O classes are parameterized on the type of
     52    *  characters they read and write.  (The major exception is ios_base at
     53    *  the top of the hierarchy.)  This is a change from pre-Standard
     54    *  streams, which were not templates.
     55    *
     56    *  For ease of use and compatibility, all of the basic_* I/O-related
     57    *  classes are given typedef names for both of the builtin character
     58    *  widths (wide and narrow).  The typedefs are the same as the
     59    *  pre-Standard names, for example:
     60    *
     61    *  @code
     62    *     typedef basic_ifstream<char>  ifstream;
     63    *  @endcode
     64    *
     65    *  Because properly forward-declaring these classes can be difficult, you
     66    *  should not do it yourself.  Instead, include the &lt;iosfwd&gt;
     67    *  header, which contains only declarations of all the I/O classes as
     68    *  well as the typedefs.  Trying to forward-declare the typedefs
     69    *  themselves (e.g., <code>class ostream;</code>) is not valid ISO C++.
     70    *
     71    *  For more specific declarations, see
     72    *  http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch24.html
     73    *
     74    *  @{
     75   */
     76   class ios_base;
     77 
     78   template<typename _CharT, typename _Traits = char_traits<_CharT> >
     79     class basic_ios;
     80 
     81   template<typename _CharT, typename _Traits = char_traits<_CharT> >
     82     class basic_streambuf;
     83 
     84   template<typename _CharT, typename _Traits = char_traits<_CharT> >
     85     class basic_istream;
     86 
     87   template<typename _CharT, typename _Traits = char_traits<_CharT> >
     88     class basic_ostream;
     89 
     90   template<typename _CharT, typename _Traits = char_traits<_CharT> >
     91     class basic_iostream;
     92 
     93   template<typename _CharT, typename _Traits = char_traits<_CharT>,
     94 	    typename _Alloc = allocator<_CharT> >
     95     class basic_stringbuf;
     96 
     97   template<typename _CharT, typename _Traits = char_traits<_CharT>,
     98 	   typename _Alloc = allocator<_CharT> >
     99     class basic_istringstream;
    100 
    101   template<typename _CharT, typename _Traits = char_traits<_CharT>,
    102 	   typename _Alloc = allocator<_CharT> >
    103     class basic_ostringstream;
    104 
    105   template<typename _CharT, typename _Traits = char_traits<_CharT>,
    106 	   typename _Alloc = allocator<_CharT> >
    107     class basic_stringstream;
    108 
    109   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    110     class basic_filebuf;
    111 
    112   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    113     class basic_ifstream;
    114 
    115   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    116     class basic_ofstream;
    117 
    118   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    119     class basic_fstream;
    120 
    121   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    122     class istreambuf_iterator;
    123 
    124   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    125     class ostreambuf_iterator;
    126 
    127 
    128   /// Base class for @c char streams.
    129   typedef basic_ios<char> 		ios; 
    130 
    131   /// Base class for @c char buffers.
    132   typedef basic_streambuf<char> 	streambuf;
    133 
    134   /// Base class for @c char input streams.
    135   typedef basic_istream<char> 		istream;
    136 
    137   /// Base class for @c char output streams.
    138   typedef basic_ostream<char> 		ostream;
    139 
    140   /// Base class for @c char mixed input and output streams.
    141   typedef basic_iostream<char> 		iostream;
    142 
    143   /// Class for @c char memory buffers.
    144   typedef basic_stringbuf<char> 	stringbuf;
    145 
    146   /// Class for @c char input memory streams.
    147   typedef basic_istringstream<char> 	istringstream;
    148 
    149   /// Class for @c char output memory streams.
    150   typedef basic_ostringstream<char> 	ostringstream;
    151 
    152   /// Class for @c char mixed input and output memory streams.
    153   typedef basic_stringstream<char> 	stringstream;
    154 
    155   /// Class for @c char file buffers.
    156   typedef basic_filebuf<char> 		filebuf;
    157 
    158   /// Class for @c char input file streams.
    159   typedef basic_ifstream<char> 		ifstream;
    160 
    161   /// Class for @c char output file streams.
    162   typedef basic_ofstream<char> 		ofstream;
    163 
    164   /// Class for @c char mixed input and output file streams.
    165   typedef basic_fstream<char> 		fstream;
    166 
    167 #ifdef _GLIBCXX_USE_WCHAR_T
    168   /// Base class for @c wchar_t streams.
    169   typedef basic_ios<wchar_t> 		wios;
    170 
    171   /// Base class for @c wchar_t buffers.
    172   typedef basic_streambuf<wchar_t> 	wstreambuf;
    173 
    174   /// Base class for @c wchar_t input streams.
    175   typedef basic_istream<wchar_t> 	wistream;
    176 
    177   /// Base class for @c wchar_t output streams.
    178   typedef basic_ostream<wchar_t> 	wostream;
    179 
    180   /// Base class for @c wchar_t mixed input and output streams.
    181   typedef basic_iostream<wchar_t> 	wiostream;
    182 
    183   /// Class for @c wchar_t memory buffers.
    184   typedef basic_stringbuf<wchar_t> 	wstringbuf;
    185 
    186   /// Class for @c wchar_t input memory streams.
    187   typedef basic_istringstream<wchar_t> 	wistringstream;
    188 
    189   /// Class for @c wchar_t output memory streams.
    190   typedef basic_ostringstream<wchar_t> 	wostringstream;
    191 
    192   /// Class for @c wchar_t mixed input and output memory streams.
    193   typedef basic_stringstream<wchar_t> 	wstringstream;
    194 
    195   /// Class for @c wchar_t file buffers.
    196   typedef basic_filebuf<wchar_t> 	wfilebuf;
    197 
    198   /// Class for @c wchar_t input file streams.
    199   typedef basic_ifstream<wchar_t> 	wifstream;
    200 
    201   /// Class for @c wchar_t output file streams.
    202   typedef basic_ofstream<wchar_t> 	wofstream;
    203 
    204   /// Class for @c wchar_t mixed input and output file streams.
    205   typedef basic_fstream<wchar_t> 	wfstream;
    206 #endif
    207   /** @}  */
    208 
    209 _GLIBCXX_END_NAMESPACE_VERSION
    210 } // namespace
    211 
    212 #endif /* _GLIBCXX_IOSFWD */
    213