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