xref: /netbsd-src/external/apache2/llvm/dist/libcxx/include/iosfwd (revision 4d6fc14bc9b0c5bf3e30be318c143ee82cadd108)
1*4d6fc14bSjoerg// -*- C++ -*-
2*4d6fc14bSjoerg//===--------------------------- iosfwd -----------------------------------===//
3*4d6fc14bSjoerg//
4*4d6fc14bSjoerg// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5*4d6fc14bSjoerg// See https://llvm.org/LICENSE.txt for license information.
6*4d6fc14bSjoerg// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7*4d6fc14bSjoerg//
8*4d6fc14bSjoerg//===----------------------------------------------------------------------===//
9*4d6fc14bSjoerg
10*4d6fc14bSjoerg#ifndef _LIBCPP_IOSFWD
11*4d6fc14bSjoerg#define _LIBCPP_IOSFWD
12*4d6fc14bSjoerg
13*4d6fc14bSjoerg/*
14*4d6fc14bSjoerg    iosfwd synopsis
15*4d6fc14bSjoerg
16*4d6fc14bSjoergnamespace std
17*4d6fc14bSjoerg{
18*4d6fc14bSjoerg
19*4d6fc14bSjoergtemplate<class charT> struct char_traits;
20*4d6fc14bSjoergtemplate<>            struct char_traits<char>;
21*4d6fc14bSjoergtemplate<>            struct char_traits<char8_t>;  // C++20
22*4d6fc14bSjoergtemplate<>            struct char_traits<char16_t>;
23*4d6fc14bSjoergtemplate<>            struct char_traits<char32_t>;
24*4d6fc14bSjoergtemplate<>            struct char_traits<wchar_t>;
25*4d6fc14bSjoerg
26*4d6fc14bSjoergtemplate<class T>     class allocator;
27*4d6fc14bSjoerg
28*4d6fc14bSjoergclass ios_base;
29*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT> > class basic_ios;
30*4d6fc14bSjoerg
31*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT> > class basic_streambuf;
32*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT> > class basic_istream;
33*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT> > class basic_ostream;
34*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT> > class basic_iostream;
35*4d6fc14bSjoerg
36*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
37*4d6fc14bSjoerg    class basic_stringbuf;
38*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
39*4d6fc14bSjoerg    class basic_istringstream;
40*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
41*4d6fc14bSjoerg    class basic_ostringstream;
42*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
43*4d6fc14bSjoerg    class basic_stringstream;
44*4d6fc14bSjoerg
45*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT> > class basic_filebuf;
46*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT> > class basic_ifstream;
47*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT> > class basic_ofstream;
48*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT> > class basic_fstream;
49*4d6fc14bSjoerg
50*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT> > class istreambuf_iterator;
51*4d6fc14bSjoergtemplate <class charT, class traits = char_traits<charT> > class ostreambuf_iterator;
52*4d6fc14bSjoerg
53*4d6fc14bSjoergtypedef basic_ios<char>              ios;
54*4d6fc14bSjoergtypedef basic_ios<wchar_t>           wios;
55*4d6fc14bSjoerg
56*4d6fc14bSjoergtypedef basic_streambuf<char>        streambuf;
57*4d6fc14bSjoergtypedef basic_istream<char>          istream;
58*4d6fc14bSjoergtypedef basic_ostream<char>          ostream;
59*4d6fc14bSjoergtypedef basic_iostream<char>         iostream;
60*4d6fc14bSjoerg
61*4d6fc14bSjoergtypedef basic_stringbuf<char>        stringbuf;
62*4d6fc14bSjoergtypedef basic_istringstream<char>    istringstream;
63*4d6fc14bSjoergtypedef basic_ostringstream<char>    ostringstream;
64*4d6fc14bSjoergtypedef basic_stringstream<char>     stringstream;
65*4d6fc14bSjoerg
66*4d6fc14bSjoergtypedef basic_filebuf<char>          filebuf;
67*4d6fc14bSjoergtypedef basic_ifstream<char>         ifstream;
68*4d6fc14bSjoergtypedef basic_ofstream<char>         ofstream;
69*4d6fc14bSjoergtypedef basic_fstream<char>          fstream;
70*4d6fc14bSjoerg
71*4d6fc14bSjoergtypedef basic_streambuf<wchar_t>     wstreambuf;
72*4d6fc14bSjoergtypedef basic_istream<wchar_t>       wistream;
73*4d6fc14bSjoergtypedef basic_ostream<wchar_t>       wostream;
74*4d6fc14bSjoergtypedef basic_iostream<wchar_t>      wiostream;
75*4d6fc14bSjoerg
76*4d6fc14bSjoergtypedef basic_stringbuf<wchar_t>     wstringbuf;
77*4d6fc14bSjoergtypedef basic_istringstream<wchar_t> wistringstream;
78*4d6fc14bSjoergtypedef basic_ostringstream<wchar_t> wostringstream;
79*4d6fc14bSjoergtypedef basic_stringstream<wchar_t>  wstringstream;
80*4d6fc14bSjoerg
81*4d6fc14bSjoergtypedef basic_filebuf<wchar_t>       wfilebuf;
82*4d6fc14bSjoergtypedef basic_ifstream<wchar_t>      wifstream;
83*4d6fc14bSjoergtypedef basic_ofstream<wchar_t>      wofstream;
84*4d6fc14bSjoergtypedef basic_fstream<wchar_t>       wfstream;
85*4d6fc14bSjoerg
86*4d6fc14bSjoergtemplate <class state> class fpos;
87*4d6fc14bSjoergusing streampos  = fpos<char_traits<char>::state_type>;
88*4d6fc14bSjoergusing wstreampos = fpos<char_traits<wchar_t>::state_type>;
89*4d6fc14bSjoergusing u8streampos = fpos<char_traits<char8_t>::state_type>; // C++20
90*4d6fc14bSjoergusing u16streampos = fpos<char_traits<char16_t>::state_type>;
91*4d6fc14bSjoergusing u32streampos = fpos<char_traits<char32_t>::state_type>;
92*4d6fc14bSjoerg
93*4d6fc14bSjoerg}  // std
94*4d6fc14bSjoerg
95*4d6fc14bSjoerg*/
96*4d6fc14bSjoerg
97*4d6fc14bSjoerg#include <__config>
98*4d6fc14bSjoerg#include <wchar.h>  // for mbstate_t
99*4d6fc14bSjoerg
100*4d6fc14bSjoerg#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
101*4d6fc14bSjoerg#pragma GCC system_header
102*4d6fc14bSjoerg#endif
103*4d6fc14bSjoerg
104*4d6fc14bSjoerg_LIBCPP_BEGIN_NAMESPACE_STD
105*4d6fc14bSjoerg
106*4d6fc14bSjoergclass _LIBCPP_TYPE_VIS ios_base;
107*4d6fc14bSjoerg
108*4d6fc14bSjoergtemplate<class _CharT>  struct _LIBCPP_TEMPLATE_VIS char_traits;
109*4d6fc14bSjoergtemplate<> struct char_traits<char>;
110*4d6fc14bSjoerg#ifndef _LIBCPP_HAS_NO_CHAR8_T
111*4d6fc14bSjoergtemplate<> struct char_traits<char8_t>;
112*4d6fc14bSjoerg#endif
113*4d6fc14bSjoergtemplate<> struct char_traits<char16_t>;
114*4d6fc14bSjoergtemplate<> struct char_traits<char32_t>;
115*4d6fc14bSjoergtemplate<> struct char_traits<wchar_t>;
116*4d6fc14bSjoerg
117*4d6fc14bSjoergtemplate<class _Tp>     class _LIBCPP_TEMPLATE_VIS allocator;
118*4d6fc14bSjoerg
119*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT> >
120*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS basic_ios;
121*4d6fc14bSjoerg
122*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT> >
123*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS basic_streambuf;
124*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT> >
125*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS basic_istream;
126*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT> >
127*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS basic_ostream;
128*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT> >
129*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS basic_iostream;
130*4d6fc14bSjoerg
131*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT>,
132*4d6fc14bSjoerg          class _Allocator = allocator<_CharT> >
133*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS basic_stringbuf;
134*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT>,
135*4d6fc14bSjoerg          class _Allocator = allocator<_CharT> >
136*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS basic_istringstream;
137*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT>,
138*4d6fc14bSjoerg          class _Allocator = allocator<_CharT> >
139*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS basic_ostringstream;
140*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT>,
141*4d6fc14bSjoerg          class _Allocator = allocator<_CharT> >
142*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS basic_stringstream;
143*4d6fc14bSjoerg
144*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT> >
145*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS basic_filebuf;
146*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT> >
147*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS basic_ifstream;
148*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT> >
149*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS basic_ofstream;
150*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT> >
151*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS basic_fstream;
152*4d6fc14bSjoerg
153*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT> >
154*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS istreambuf_iterator;
155*4d6fc14bSjoergtemplate <class _CharT, class _Traits = char_traits<_CharT> >
156*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator;
157*4d6fc14bSjoerg
158*4d6fc14bSjoergtypedef basic_ios<char>              ios;
159*4d6fc14bSjoergtypedef basic_ios<wchar_t>           wios;
160*4d6fc14bSjoerg
161*4d6fc14bSjoergtypedef basic_streambuf<char>        streambuf;
162*4d6fc14bSjoergtypedef basic_istream<char>          istream;
163*4d6fc14bSjoergtypedef basic_ostream<char>          ostream;
164*4d6fc14bSjoergtypedef basic_iostream<char>         iostream;
165*4d6fc14bSjoerg
166*4d6fc14bSjoergtypedef basic_stringbuf<char>        stringbuf;
167*4d6fc14bSjoergtypedef basic_istringstream<char>    istringstream;
168*4d6fc14bSjoergtypedef basic_ostringstream<char>    ostringstream;
169*4d6fc14bSjoergtypedef basic_stringstream<char>     stringstream;
170*4d6fc14bSjoerg
171*4d6fc14bSjoergtypedef basic_filebuf<char>          filebuf;
172*4d6fc14bSjoergtypedef basic_ifstream<char>         ifstream;
173*4d6fc14bSjoergtypedef basic_ofstream<char>         ofstream;
174*4d6fc14bSjoergtypedef basic_fstream<char>          fstream;
175*4d6fc14bSjoerg
176*4d6fc14bSjoergtypedef basic_streambuf<wchar_t>     wstreambuf;
177*4d6fc14bSjoergtypedef basic_istream<wchar_t>       wistream;
178*4d6fc14bSjoergtypedef basic_ostream<wchar_t>       wostream;
179*4d6fc14bSjoergtypedef basic_iostream<wchar_t>      wiostream;
180*4d6fc14bSjoerg
181*4d6fc14bSjoergtypedef basic_stringbuf<wchar_t>     wstringbuf;
182*4d6fc14bSjoergtypedef basic_istringstream<wchar_t> wistringstream;
183*4d6fc14bSjoergtypedef basic_ostringstream<wchar_t> wostringstream;
184*4d6fc14bSjoergtypedef basic_stringstream<wchar_t>  wstringstream;
185*4d6fc14bSjoerg
186*4d6fc14bSjoergtypedef basic_filebuf<wchar_t>       wfilebuf;
187*4d6fc14bSjoergtypedef basic_ifstream<wchar_t>      wifstream;
188*4d6fc14bSjoergtypedef basic_ofstream<wchar_t>      wofstream;
189*4d6fc14bSjoergtypedef basic_fstream<wchar_t>       wfstream;
190*4d6fc14bSjoerg
191*4d6fc14bSjoergtemplate <class _CharT, class _Traits>
192*4d6fc14bSjoerg    class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_PREFERRED_NAME(wios) basic_ios;
193*4d6fc14bSjoerg
194*4d6fc14bSjoergtemplate <class _CharT, class _Traits>
195*4d6fc14bSjoerg    class _LIBCPP_PREFERRED_NAME(streambuf) _LIBCPP_PREFERRED_NAME(wstreambuf) basic_streambuf;
196*4d6fc14bSjoergtemplate <class _CharT, class _Traits>
197*4d6fc14bSjoerg    class _LIBCPP_PREFERRED_NAME(istream) _LIBCPP_PREFERRED_NAME(wistream) basic_istream;
198*4d6fc14bSjoergtemplate <class _CharT, class _Traits>
199*4d6fc14bSjoerg    class _LIBCPP_PREFERRED_NAME(ostream) _LIBCPP_PREFERRED_NAME(wostream) basic_ostream;
200*4d6fc14bSjoergtemplate <class _CharT, class _Traits>
201*4d6fc14bSjoerg    class _LIBCPP_PREFERRED_NAME(iostream) _LIBCPP_PREFERRED_NAME(wiostream) basic_iostream;
202*4d6fc14bSjoerg
203*4d6fc14bSjoergtemplate <class _CharT, class _Traits, class _Allocator>
204*4d6fc14bSjoerg    class _LIBCPP_PREFERRED_NAME(stringbuf) _LIBCPP_PREFERRED_NAME(wstringbuf) basic_stringbuf;
205*4d6fc14bSjoergtemplate <class _CharT, class _Traits, class _Allocator>
206*4d6fc14bSjoerg    class _LIBCPP_PREFERRED_NAME(istringstream) _LIBCPP_PREFERRED_NAME(wistringstream) basic_istringstream;
207*4d6fc14bSjoergtemplate <class _CharT, class _Traits, class _Allocator>
208*4d6fc14bSjoerg    class _LIBCPP_PREFERRED_NAME(ostringstream) _LIBCPP_PREFERRED_NAME(wostringstream) basic_ostringstream;
209*4d6fc14bSjoergtemplate <class _CharT, class _Traits, class _Allocator>
210*4d6fc14bSjoerg    class _LIBCPP_PREFERRED_NAME(stringstream) _LIBCPP_PREFERRED_NAME(wstringstream) basic_stringstream;
211*4d6fc14bSjoerg
212*4d6fc14bSjoergtemplate <class _CharT, class _Traits>
213*4d6fc14bSjoerg    class _LIBCPP_PREFERRED_NAME(filebuf) _LIBCPP_PREFERRED_NAME(wfilebuf) basic_filebuf;
214*4d6fc14bSjoergtemplate <class _CharT, class _Traits>
215*4d6fc14bSjoerg    class _LIBCPP_PREFERRED_NAME(ifstream) _LIBCPP_PREFERRED_NAME(wifstream) basic_ifstream;
216*4d6fc14bSjoergtemplate <class _CharT, class _Traits>
217*4d6fc14bSjoerg    class _LIBCPP_PREFERRED_NAME(ofstream) _LIBCPP_PREFERRED_NAME(wofstream) basic_ofstream;
218*4d6fc14bSjoergtemplate <class _CharT, class _Traits>
219*4d6fc14bSjoerg    class _LIBCPP_PREFERRED_NAME(fstream) _LIBCPP_PREFERRED_NAME(wfstream) basic_fstream;
220*4d6fc14bSjoerg
221*4d6fc14bSjoergtemplate <class _State>             class _LIBCPP_TEMPLATE_VIS fpos;
222*4d6fc14bSjoergtypedef fpos<mbstate_t>    streampos;
223*4d6fc14bSjoergtypedef fpos<mbstate_t>    wstreampos;
224*4d6fc14bSjoerg#ifndef _LIBCPP_HAS_NO_CHAR8_T
225*4d6fc14bSjoergtypedef fpos<mbstate_t>    u8streampos;
226*4d6fc14bSjoerg#endif
227*4d6fc14bSjoerg#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
228*4d6fc14bSjoergtypedef fpos<mbstate_t>    u16streampos;
229*4d6fc14bSjoergtypedef fpos<mbstate_t>    u32streampos;
230*4d6fc14bSjoerg#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
231*4d6fc14bSjoerg
232*4d6fc14bSjoerg#if defined(_NEWLIB_VERSION)
233*4d6fc14bSjoerg// On newlib, off_t is 'long int'
234*4d6fc14bSjoergtypedef long int streamoff;         // for char_traits in <string>
235*4d6fc14bSjoerg#else
236*4d6fc14bSjoergtypedef long long streamoff;        // for char_traits in <string>
237*4d6fc14bSjoerg#endif
238*4d6fc14bSjoerg
239*4d6fc14bSjoergtemplate <class _CharT,             // for <stdexcept>
240*4d6fc14bSjoerg          class _Traits = char_traits<_CharT>,
241*4d6fc14bSjoerg          class _Allocator = allocator<_CharT> >
242*4d6fc14bSjoerg    class _LIBCPP_TEMPLATE_VIS basic_string;
243*4d6fc14bSjoergtypedef basic_string<char, char_traits<char>, allocator<char> > string;
244*4d6fc14bSjoergtypedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
245*4d6fc14bSjoerg
246*4d6fc14bSjoergtemplate <class _CharT, class _Traits, class _Allocator>
247*4d6fc14bSjoerg    class _LIBCPP_PREFERRED_NAME(string) _LIBCPP_PREFERRED_NAME(wstring) basic_string;
248*4d6fc14bSjoerg
249*4d6fc14bSjoerg// Include other forward declarations here
250*4d6fc14bSjoergtemplate <class _Tp, class _Alloc = allocator<_Tp> >
251*4d6fc14bSjoergclass _LIBCPP_TEMPLATE_VIS vector;
252*4d6fc14bSjoerg
253*4d6fc14bSjoergtemplate <class _CharT, class _Traits>
254*4d6fc14bSjoergclass __save_flags
255*4d6fc14bSjoerg{
256*4d6fc14bSjoerg    typedef basic_ios<_CharT, _Traits> __stream_type;
257*4d6fc14bSjoerg    typedef typename __stream_type::fmtflags fmtflags;
258*4d6fc14bSjoerg
259*4d6fc14bSjoerg    __stream_type& __stream_;
260*4d6fc14bSjoerg    fmtflags       __fmtflags_;
261*4d6fc14bSjoerg    _CharT         __fill_;
262*4d6fc14bSjoerg
263*4d6fc14bSjoerg    __save_flags(const __save_flags&);
264*4d6fc14bSjoerg    __save_flags& operator=(const __save_flags&);
265*4d6fc14bSjoergpublic:
266*4d6fc14bSjoerg    _LIBCPP_INLINE_VISIBILITY
267*4d6fc14bSjoerg    explicit __save_flags(__stream_type& __stream)
268*4d6fc14bSjoerg        : __stream_(__stream),
269*4d6fc14bSjoerg          __fmtflags_(__stream.flags()),
270*4d6fc14bSjoerg          __fill_(__stream.fill())
271*4d6fc14bSjoerg        {}
272*4d6fc14bSjoerg    _LIBCPP_INLINE_VISIBILITY
273*4d6fc14bSjoerg    ~__save_flags()
274*4d6fc14bSjoerg    {
275*4d6fc14bSjoerg        __stream_.flags(__fmtflags_);
276*4d6fc14bSjoerg        __stream_.fill(__fill_);
277*4d6fc14bSjoerg    }
278*4d6fc14bSjoerg};
279*4d6fc14bSjoerg
280*4d6fc14bSjoerg_LIBCPP_END_NAMESPACE_STD
281*4d6fc14bSjoerg
282*4d6fc14bSjoerg#endif // _LIBCPP_IOSFWD
283