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