# iosfwd

Go to the documentation of this file.

    00001 // Forwarding declarations -*- C++ -*-
    00002
    00003 // Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003
    00004 // Free Software Foundation, Inc.
    00005 //
    00006 // This file is part of the GNU ISO C++ Library.  This library is free
    00007 // software; you can redistribute it and/or modify it under the
    00008 // terms of the GNU General Public License as published by the
    00009 // Free Software Foundation; either version 2, or (at your option)
    00010 // any later version.
    00011
    00012 // This library is distributed in the hope that it will be useful,
    00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00015 // GNU General Public License for more details.
    00016
    00017 // You should have received a copy of the GNU General Public License along
    00018 // with this library; see the file COPYING.  If not, write to the Free
    00019 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
    00020 // USA.
    00021
    00022 // As a special exception, you may use this file as part of a free software
    00023 // library without restriction.  Specifically, if other files instantiate
    00024 // templates or use macros or inline functions from this file, or you compile
    00025 // this file and link it with other files to produce an executable, this
    00026 // file does not by itself cause the resulting executable to be covered by
    00027 // the GNU General Public License.  This exception does not however
    00028 // invalidate any other reasons why the executable file might be covered by
    00029 // the GNU General Public License.
    00030
    00031 //
    00032 // ISO C++ 14882: 27.2  Forward declarations
    00033 //
    00034
    00035 /** @file iosfwd
    00036  *  This is a Standard C++ Library header.
    00037  */
    00038
    00039 #ifndef _GLIBCXX_IOSFWD
    00040 #define _GLIBCXX_IOSFWD 1
    00041
    00042 #pragma GCC system_header
    00043
    00044 #include <bits/c++config.h>
    00045 #include <bits/c++locale.h>
    00046 #include <bits/c++io.h>
    00047 #include <cctype>       // For isspace, etc.
    00048 #include <bits/stringfwd.h>     // For string forward declarations.
    00049 #include <bits/postypes.h>
    00050 #include <bits/functexcept.h>
    00051
    00052 namespace std
    00053 {
    00054   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    00055     class basic_ios;
    00056
    00057   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    00058     class basic_streambuf;
    00059
    00060   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    00061     class basic_istream;
    00062
    00063   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    00064     class basic_ostream;
    00065
    00066   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    00067     class basic_iostream;
    00068
    00069   template<typename _CharT, typename _Traits = char_traits<_CharT>,
    00070         typename _Alloc = allocator<_CharT> >
    00071     class basic_stringbuf;
    00072
    00073   template<typename _CharT, typename _Traits = char_traits<_CharT>,
    00074        typename _Alloc = allocator<_CharT> >
    00075     class basic_istringstream;
    00076
    00077   template<typename _CharT, typename _Traits = char_traits<_CharT>,
    00078        typename _Alloc = allocator<_CharT> >
    00079     class basic_ostringstream;
    00080
    00081   template<typename _CharT, typename _Traits = char_traits<_CharT>,
    00082        typename _Alloc = allocator<_CharT> >
    00083     class basic_stringstream;
    00084
    00085   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    00086     class basic_filebuf;
    00087
    00088   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    00089     class basic_ifstream;
    00090
    00091   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    00092     class basic_ofstream;
    00093
    00094   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    00095     class basic_fstream;
    00096
    00097   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    00098     class istreambuf_iterator;
    00099
    00100   template<typename _CharT, typename _Traits = char_traits<_CharT> >
    00101     class ostreambuf_iterator;
    00102
    00103   // _GLIBCXX_RESOLVE_LIB_DEFECTS
    00104   // Not included.   (??? Apparently no LWG number?)
    00105   class ios_base;
    00106
    00107   /**
    00108    *  @defgroup s27_2_iosfwd I/O Forward Declarations
    00109    *
    00110    *  Nearly all of the I/O classes are parameterized on the type of
    00111    *  characters they read and write.  (The major exception is ios_base at
    00112    *  the top of the hierarchy.)  This is a change from pre-Standard
    00113    *  streams, which were not templates.
    00114    *
    00115    *  For ease of use and compatibility, all of the basic_* I/O-related
    00116    *  classes are given typedef names for both of the builtin character
    00117    *  widths (wide and narrow).  The typedefs are the same as the
    00118    *  pre-Standard names, for example:
    00119    *
    00120    *  @code
    00121    *     typedef basic_ifstream<char>  ifstream;
    00122    *  @endcode
    00123    *
    00124    *  Because properly forward-declaring these classes can be difficult, you
    00125    *  should not do it yourself.  Instead, include the &lt;iosfwd&gt;
    00126    *  header, which contains only declarations of all the I/O classes as
    00127    *  well as the typedefs.  Trying to forward-declare the typedefs
    00128    *  themselves (e.g., "class ostream;") is not valid ISO C++.
    00129    *
    00130    *  For more specific declarations, see
    00131    *  http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#10
    00132    *
    00133    *  @{
    00134   */
    00135   typedef basic_ios<char>       ios;        ///< @isiosfwd
    00136   typedef basic_streambuf<char>     streambuf;  ///< @isiosfwd
    00137   typedef basic_istream<char>       istream;    ///< @isiosfwd
    00138   typedef basic_ostream<char>       ostream;    ///< @isiosfwd
    00139   typedef basic_iostream<char>      iostream;   ///< @isiosfwd
    00140   typedef basic_stringbuf<char>     stringbuf;  ///< @isiosfwd
    00141   typedef basic_istringstream<char>     istringstream;  ///< @isiosfwd
    00142   typedef basic_ostringstream<char>     ostringstream;  ///< @isiosfwd
    00143   typedef basic_stringstream<char>  stringstream;   ///< @isiosfwd
    00144   typedef basic_filebuf<char>       filebuf;    ///< @isiosfwd
    00145   typedef basic_ifstream<char>      ifstream;   ///< @isiosfwd
    00146   typedef basic_ofstream<char>      ofstream;   ///< @isiosfwd
    00147   typedef basic_fstream<char>       fstream;    ///< @isiosfwd
    00148
    00149 #ifdef _GLIBCXX_USE_WCHAR_T
    00150   typedef basic_ios<wchar_t>        wios;       ///< @isiosfwd
    00151   typedef basic_streambuf<wchar_t>  wstreambuf; ///< @isiosfwd
    00152   typedef basic_istream<wchar_t>    wistream;   ///< @isiosfwd
    00153   typedef basic_ostream<wchar_t>    wostream;   ///< @isiosfwd
    00154   typedef basic_iostream<wchar_t>   wiostream;  ///< @isiosfwd
    00155   typedef basic_stringbuf<wchar_t>  wstringbuf; ///< @isiosfwd
    00156   typedef basic_istringstream<wchar_t>  wistringstream; ///< @isiosfwd
    00157   typedef basic_ostringstream<wchar_t>  wostringstream; ///< @isiosfwd
    00158   typedef basic_stringstream<wchar_t>   wstringstream;  ///< @isiosfwd
    00159   typedef basic_filebuf<wchar_t>    wfilebuf;   ///< @isiosfwd
    00160   typedef basic_ifstream<wchar_t>   wifstream;  ///< @isiosfwd
    00161   typedef basic_ofstream<wchar_t>   wofstream;  ///< @isiosfwd
    00162   typedef basic_fstream<wchar_t>    wfstream;   ///< @isiosfwd
    00163 #endif
    00164   /** @}  */
    00165 } // namespace std
    00166
    00167 #endif /* _GLIBCXX_IOSFWD */