1// -*- C++ -*-
2//===--------------------------- iosfwd -----------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_IOSFWD
11#define _LIBCPP_IOSFWD
12
13/*
14 iosfwd synopsis
15
16namespace std
17{
18
19template<class charT> struct char_traits;
20template<> struct char_traits<char>;
21template<> struct char_traits<char8_t>; // C++20
22template<> struct char_traits<char16_t>;
23template<> struct char_traits<char32_t>;
24template<> struct char_traits<wchar_t>;
25
26template<class T> class allocator;
27
28class ios_base;
29template <class charT, class traits = char_traits<charT> > class basic_ios;
30
31template <class charT, class traits = char_traits<charT> > class basic_streambuf;
32template <class charT, class traits = char_traits<charT> > class basic_istream;
33template <class charT, class traits = char_traits<charT> > class basic_ostream;
34template <class charT, class traits = char_traits<charT> > class basic_iostream;
35
36template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
37 class basic_stringbuf;
38template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
39 class basic_istringstream;
40template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
41 class basic_ostringstream;
42template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
43 class basic_stringstream;
44
45template <class charT, class traits = char_traits<charT> > class basic_filebuf;
46template <class charT, class traits = char_traits<charT> > class basic_ifstream;
47template <class charT, class traits = char_traits<charT> > class basic_ofstream;
48template <class charT, class traits = char_traits<charT> > class basic_fstream;
49
50template <class charT, class traits = char_traits<charT> > class istreambuf_iterator;
51template <class charT, class traits = char_traits<charT> > class ostreambuf_iterator;
52
53typedef basic_ios<char> ios;
54typedef basic_ios<wchar_t> wios;
55
56typedef basic_streambuf<char> streambuf;
57typedef basic_istream<char> istream;
58typedef basic_ostream<char> ostream;
59typedef basic_iostream<char> iostream;
60
61typedef basic_stringbuf<char> stringbuf;
62typedef basic_istringstream<char> istringstream;
63typedef basic_ostringstream<char> ostringstream;
64typedef basic_stringstream<char> stringstream;
65
66typedef basic_filebuf<char> filebuf;
67typedef basic_ifstream<char> ifstream;
68typedef basic_ofstream<char> ofstream;
69typedef basic_fstream<char> fstream;
70
71typedef basic_streambuf<wchar_t> wstreambuf;
72typedef basic_istream<wchar_t> wistream;
73typedef basic_ostream<wchar_t> wostream;
74typedef basic_iostream<wchar_t> wiostream;
75
76typedef basic_stringbuf<wchar_t> wstringbuf;
77typedef basic_istringstream<wchar_t> wistringstream;
78typedef basic_ostringstream<wchar_t> wostringstream;
79typedef basic_stringstream<wchar_t> wstringstream;
80
81typedef basic_filebuf<wchar_t> wfilebuf;
82typedef basic_ifstream<wchar_t> wifstream;
83typedef basic_ofstream<wchar_t> wofstream;
84typedef basic_fstream<wchar_t> wfstream;
85
86template <class state> class fpos;
87typedef fpos<char_traits<char>::state_type> streampos;
88typedef fpos<char_traits<wchar_t>::state_type> wstreampos;
89
90} // std
91
92*/
93
94#include <__config>
95#include <wchar.h> // for mbstate_t
96
97#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
98#pragma GCC system_header
99#endif
100
101_LIBCPP_BEGIN_NAMESPACE_STD
102
103class _LIBCPP_TYPE_VIS ios_base;
104
105template<class _CharT> struct _LIBCPP_TEMPLATE_VIS char_traits;
106template<> struct char_traits<char>;
107#ifndef _LIBCPP_NO_HAS_CHAR8_T
108template<> struct char_traits<char8_t>;
109#endif
110template<> struct char_traits<char16_t>;
111template<> struct char_traits<char32_t>;
112template<> struct char_traits<wchar_t>;
113
114template<class _Tp> class _LIBCPP_TEMPLATE_VIS allocator;
115
116template <class _CharT, class _Traits = char_traits<_CharT> >
117 class _LIBCPP_TEMPLATE_VIS basic_ios;
118
119template <class _CharT, class _Traits = char_traits<_CharT> >
120 class _LIBCPP_TEMPLATE_VIS basic_streambuf;
121template <class _CharT, class _Traits = char_traits<_CharT> >
122 class _LIBCPP_TEMPLATE_VIS basic_istream;
123template <class _CharT, class _Traits = char_traits<_CharT> >
124 class _LIBCPP_TEMPLATE_VIS basic_ostream;
125template <class _CharT, class _Traits = char_traits<_CharT> >
126 class _LIBCPP_TEMPLATE_VIS basic_iostream;
127
128template <class _CharT, class _Traits = char_traits<_CharT>,
129 class _Allocator = allocator<_CharT> >
130 class _LIBCPP_TEMPLATE_VIS basic_stringbuf;
131template <class _CharT, class _Traits = char_traits<_CharT>,
132 class _Allocator = allocator<_CharT> >
133 class _LIBCPP_TEMPLATE_VIS basic_istringstream;
134template <class _CharT, class _Traits = char_traits<_CharT>,
135 class _Allocator = allocator<_CharT> >
136 class _LIBCPP_TEMPLATE_VIS basic_ostringstream;
137template <class _CharT, class _Traits = char_traits<_CharT>,
138 class _Allocator = allocator<_CharT> >
139 class _LIBCPP_TEMPLATE_VIS basic_stringstream;
140
141template <class _CharT, class _Traits = char_traits<_CharT> >
142 class _LIBCPP_TEMPLATE_VIS basic_filebuf;
143template <class _CharT, class _Traits = char_traits<_CharT> >
144 class _LIBCPP_TEMPLATE_VIS basic_ifstream;
145template <class _CharT, class _Traits = char_traits<_CharT> >
146 class _LIBCPP_TEMPLATE_VIS basic_ofstream;
147template <class _CharT, class _Traits = char_traits<_CharT> >
148 class _LIBCPP_TEMPLATE_VIS basic_fstream;
149
150template <class _CharT, class _Traits = char_traits<_CharT> >
151 class _LIBCPP_TEMPLATE_VIS istreambuf_iterator;
152template <class _CharT, class _Traits = char_traits<_CharT> >
153 class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator;
154
155typedef basic_ios<char> ios;
156typedef basic_ios<wchar_t> wios;
157
158typedef basic_streambuf<char> streambuf;
159typedef basic_istream<char> istream;
160typedef basic_ostream<char> ostream;
161typedef basic_iostream<char> iostream;
162
163typedef basic_stringbuf<char> stringbuf;
164typedef basic_istringstream<char> istringstream;
165typedef basic_ostringstream<char> ostringstream;
166typedef basic_stringstream<char> stringstream;
167
168typedef basic_filebuf<char> filebuf;
169typedef basic_ifstream<char> ifstream;
170typedef basic_ofstream<char> ofstream;
171typedef basic_fstream<char> fstream;
172
173typedef basic_streambuf<wchar_t> wstreambuf;
174typedef basic_istream<wchar_t> wistream;
175typedef basic_ostream<wchar_t> wostream;
176typedef basic_iostream<wchar_t> wiostream;
177
178typedef basic_stringbuf<wchar_t> wstringbuf;
179typedef basic_istringstream<wchar_t> wistringstream;
180typedef basic_ostringstream<wchar_t> wostringstream;
181typedef basic_stringstream<wchar_t> wstringstream;
182
183typedef basic_filebuf<wchar_t> wfilebuf;
184typedef basic_ifstream<wchar_t> wifstream;
185typedef basic_ofstream<wchar_t> wofstream;
186typedef basic_fstream<wchar_t> wfstream;
187
188template <class _State> class _LIBCPP_TEMPLATE_VIS fpos;
189typedef fpos<mbstate_t> streampos;
190typedef fpos<mbstate_t> wstreampos;
191#ifndef _LIBCPP_NO_HAS_CHAR8_T
192typedef fpos<mbstate_t> u8streampos;
193#endif
194#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
195typedef fpos<mbstate_t> u16streampos;
196typedef fpos<mbstate_t> u32streampos;
197#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
198
199#if defined(_NEWLIB_VERSION)
200// On newlib, off_t is 'long int'
201typedef long int streamoff; // for char_traits in <string>
202#else
203typedef long long streamoff; // for char_traits in <string>
204#endif
205
206template <class _CharT, // for <stdexcept>
207 class _Traits = char_traits<_CharT>,
208 class _Allocator = allocator<_CharT> >
209 class _LIBCPP_TEMPLATE_VIS basic_string;
210typedef basic_string<char, char_traits<char>, allocator<char> > string;
211typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
212
213
214// Include other forward declarations here
215template <class _Tp, class _Alloc = allocator<_Tp> >
216class _LIBCPP_TEMPLATE_VIS vector;
217
218_LIBCPP_END_NAMESPACE_STD
219
220#endif // _LIBCPP_IOSFWD
221