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