libstdc++: iosfwd.h Source File

libstdc++

iosfwd.h
1// <iosfwd> Forward declarations -*- C++ -*-
2
3// Copyright (C) 1997-2026 Free Software Foundation, Inc.
4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 3, or (at your option)
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23// <http://www.gnu.org/licenses/>.
24
25/** @file include/iosfwd
26 * This is an internal header file, included by other library headers.
27 * Do not attempt to use it directly. @headername{iosfwd}
28 */
29
30#ifndef _GLIBCXX_IOSFWD_H
31#define _GLIBCXX_IOSFWD_H 1
32
33#ifdef _GLIBCXX_SYSHDR
34#pragma GCC system_header
35#endif
36
37#include <bits/requires_hosted.h> // iostreams
38
39#include <bits/c++config.h>
40#include <bits/char_traits.h> // For char_traits, streamoff, streamsize, fpos
41
42namespace std _GLIBCXX_VISIBILITY(default)
43{
44_GLIBCXX_BEGIN_NAMESPACE_VERSION
45
46 /**
47 * @addtogroup io
48 * @{
49 */
50 class ios_base;
51
52 template<typename _CharT, typename _Traits = char_traits<_CharT> >
53 class basic_ios;
54
55 template<typename _CharT, typename _Traits = char_traits<_CharT> >
56 class basic_streambuf;
57
58 template<typename _CharT, typename _Traits = char_traits<_CharT> >
59 class basic_istream;
60
61 template<typename _CharT, typename _Traits = char_traits<_CharT> >
62 class basic_ostream;
63
64 template<typename _CharT, typename _Traits = char_traits<_CharT> >
65 class basic_iostream;
66
67 template<typename _CharT, typename _Traits = char_traits<_CharT> >
68 class istreambuf_iterator;
69
70 template<typename _CharT, typename _Traits = char_traits<_CharT> >
71 class ostreambuf_iterator;
72
73
74 /// Base class for @c char streams.
75 typedef basic_ios<char> ios;
76
77 /// Base class for @c char buffers.
78 typedef basic_streambuf<char> streambuf;
79
80 /// Base class for @c char input streams.
81 typedef basic_istream<char> istream;
82
83 /// Base class for @c char output streams.
84 typedef basic_ostream<char> ostream;
85
86 /// Base class for @c char mixed input and output streams.
87 typedef basic_iostream<char> iostream;
88
89
90#ifdef _GLIBCXX_USE_WCHAR_T
91 /// Base class for @c wchar_t streams.
92 typedef basic_ios<wchar_t> wios;
93
94 /// Base class for @c wchar_t buffers.
95 typedef basic_streambuf<wchar_t> wstreambuf;
96
97 /// Base class for @c wchar_t input streams.
98 typedef basic_istream<wchar_t> wistream;
99
100 /// Base class for @c wchar_t output streams.
101 typedef basic_ostream<wchar_t> wostream;
102
103 /// Base class for @c wchar_t mixed input and output streams.
104 typedef basic_iostream<wchar_t> wiostream;
105#endif
106
107 /** @} */
108
109_GLIBCXX_END_NAMESPACE_VERSION
110} // namespace
111
112#endif /* _GLIBCXX_IOSFWD_H */
char_traits.h
requires_hosted.h
c++config.h
std::wiostream
basic_iostream< wchar_t > wiostream
Base class for wchar_t mixed input and output streams.
Definition iosfwd.h:104
std::streambuf
basic_streambuf< char > streambuf
Base class for char buffers.
Definition iosfwd.h:78
std::ostream
basic_ostream< char > ostream
Base class for char output streams.
Definition iosfwd.h:84
std::iostream
basic_iostream< char > iostream
Base class for char mixed input and output streams.
Definition iosfwd.h:87
std::wios
basic_ios< wchar_t > wios
Base class for wchar_t streams.
Definition iosfwd.h:92
std::wstreambuf
basic_streambuf< wchar_t > wstreambuf
Base class for wchar_t buffers.
Definition iosfwd.h:95
std::istream
basic_istream< char > istream
Base class for char input streams.
Definition iosfwd.h:81
std::wostream
basic_ostream< wchar_t > wostream
Base class for wchar_t output streams.
Definition iosfwd.h:101
std::wistream
basic_istream< wchar_t > wistream
Base class for wchar_t input streams.
Definition iosfwd.h:98
std::ios
basic_ios< char > ios
Base class for char streams.
Definition iosfwd.h:75
std
ISO C++ entities toplevel namespace is std.
std::basic_istream
Template class basic_istream.
Definition istream:73
std::basic_iostream
Template class basic_iostream.
Definition istream:1005
std::basic_streambuf
The actual work of input and output (interface).
Definition streambuf:127
std::basic_ios
Template class basic_ios, virtual base class for all stream classes.
Definition basic_ios.h:71
std::ios_base
The base of the I/O class hierarchy.
Definition ios_base.h:266
std::basic_ostream
Template class basic_ostream.
Definition ostream.h:72
std::istreambuf_iterator
Provides input iterator semantics for streambufs.
Definition streambuf_iterator.h:59
std::ostreambuf_iterator
Provides output iterator semantics for streambufs.
Definition streambuf_iterator.h:249