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