1 // Forwarding declarations -*- C++ -*-
3 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 // 2006, 2007, 2009, 2010
5 // Free Software Foundation, Inc.
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)
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.
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.
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/>.
27 /** @file include/iosfwd
28 * This is a Standard C++ Library header.
32 // ISO C++ 14882: 27.2 Forward declarations
35 #ifndef _GLIBCXX_IOSFWD
36 #define _GLIBCXX_IOSFWD 1
38 #pragma GCC system_header
40 #include <bits/c++config.h>
41 #include <bits/stringfwd.h> // For string forward declarations.
42 #include <bits/postypes.h>
44 namespace std _GLIBCXX_VISIBILITY(default)
46 _GLIBCXX_BEGIN_NAMESPACE_VERSION
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.
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:
62 * typedef basic_ifstream<char> ifstream;
65 * Because properly forward-declaring these classes can be difficult, you
66 * should not do it yourself. Instead, include the <iosfwd>
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++.
71 * For more specific declarations, see
72 * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch24.html
78 template<typename _CharT, typename _Traits = char_traits<_CharT> >
81 template<typename _CharT, typename _Traits = char_traits<_CharT> >
82 class basic_streambuf;
84 template<typename _CharT, typename _Traits = char_traits<_CharT> >
87 template<typename _CharT, typename _Traits = char_traits<_CharT> >
90 template<typename _CharT, typename _Traits = char_traits<_CharT> >
93 template<typename _CharT, typename _Traits = char_traits<_CharT>,
94 typename _Alloc = allocator<_CharT> >
95 class basic_stringbuf;
97 template<typename _CharT, typename _Traits = char_traits<_CharT>,
98 typename _Alloc = allocator<_CharT> >
99 class basic_istringstream;
101 template<typename _CharT, typename _Traits = char_traits<_CharT>,
102 typename _Alloc = allocator<_CharT> >
103 class basic_ostringstream;
105 template<typename _CharT, typename _Traits = char_traits<_CharT>,
106 typename _Alloc = allocator<_CharT> >
107 class basic_stringstream;
109 template<typename _CharT, typename _Traits = char_traits<_CharT> >
112 template<typename _CharT, typename _Traits = char_traits<_CharT> >
113 class basic_ifstream;
115 template<typename _CharT, typename _Traits = char_traits<_CharT> >
116 class basic_ofstream;
118 template<typename _CharT, typename _Traits = char_traits<_CharT> >
121 template<typename _CharT, typename _Traits = char_traits<_CharT> >
122 class istreambuf_iterator;
124 template<typename _CharT, typename _Traits = char_traits<_CharT> >
125 class ostreambuf_iterator;
128 /// Base class for @c char streams.
129 typedef basic_ios<char> ios;
131 /// Base class for @c char buffers.
132 typedef basic_streambuf<char> streambuf;
134 /// Base class for @c char input streams.
135 typedef basic_istream<char> istream;
137 /// Base class for @c char output streams.
138 typedef basic_ostream<char> ostream;
140 /// Base class for @c char mixed input and output streams.
141 typedef basic_iostream<char> iostream;
143 /// Class for @c char memory buffers.
144 typedef basic_stringbuf<char> stringbuf;
146 /// Class for @c char input memory streams.
147 typedef basic_istringstream<char> istringstream;
149 /// Class for @c char output memory streams.
150 typedef basic_ostringstream<char> ostringstream;
152 /// Class for @c char mixed input and output memory streams.
153 typedef basic_stringstream<char> stringstream;
155 /// Class for @c char file buffers.
156 typedef basic_filebuf<char> filebuf;
158 /// Class for @c char input file streams.
159 typedef basic_ifstream<char> ifstream;
161 /// Class for @c char output file streams.
162 typedef basic_ofstream<char> ofstream;
164 /// Class for @c char mixed input and output file streams.
165 typedef basic_fstream<char> fstream;
167 #ifdef _GLIBCXX_USE_WCHAR_T
168 /// Base class for @c wchar_t streams.
169 typedef basic_ios<wchar_t> wios;
171 /// Base class for @c wchar_t buffers.
172 typedef basic_streambuf<wchar_t> wstreambuf;
174 /// Base class for @c wchar_t input streams.
175 typedef basic_istream<wchar_t> wistream;
177 /// Base class for @c wchar_t output streams.
178 typedef basic_ostream<wchar_t> wostream;
180 /// Base class for @c wchar_t mixed input and output streams.
181 typedef basic_iostream<wchar_t> wiostream;
183 /// Class for @c wchar_t memory buffers.
184 typedef basic_stringbuf<wchar_t> wstringbuf;
186 /// Class for @c wchar_t input memory streams.
187 typedef basic_istringstream<wchar_t> wistringstream;
189 /// Class for @c wchar_t output memory streams.
190 typedef basic_ostringstream<wchar_t> wostringstream;
192 /// Class for @c wchar_t mixed input and output memory streams.
193 typedef basic_stringstream<wchar_t> wstringstream;
195 /// Class for @c wchar_t file buffers.
196 typedef basic_filebuf<wchar_t> wfilebuf;
198 /// Class for @c wchar_t input file streams.
199 typedef basic_ifstream<wchar_t> wifstream;
201 /// Class for @c wchar_t output file streams.
202 typedef basic_ofstream<wchar_t> wofstream;
204 /// Class for @c wchar_t mixed input and output file streams.
205 typedef basic_fstream<wchar_t> wfstream;
209 _GLIBCXX_END_NAMESPACE_VERSION
212 #endif /* _GLIBCXX_IOSFWD */