Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
Louis Dionne | 9bd9388 | 2021-11-17 16:25:01 -0500 | [diff] [blame] | 2 | //===----------------------------------------------------------------------===// |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 3 | // |
Chandler Carruth | d201210 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 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 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef _LIBCPP_IOSFWD |
| 11 | #define _LIBCPP_IOSFWD |
| 12 | |
| 13 | /* |
| 14 | iosfwd synopsis |
| 15 | |
| 16 | namespace std |
| 17 | { |
| 18 | |
| 19 | template<class charT> struct char_traits; |
Marshall Clow | 8732fed | 2018-12-11 04:35:44 +0000 | [diff] [blame] | 20 | template<> struct char_traits<char>; |
| 21 | template<> struct char_traits<char8_t>; // C++20 |
| 22 | template<> struct char_traits<char16_t>; |
| 23 | template<> struct char_traits<char32_t>; |
| 24 | template<> struct char_traits<wchar_t>; |
| 25 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 26 | template<class T> class allocator; |
| 27 | |
Howard Hinnant | c8827ba | 2011-05-13 21:52:40 +0000 | [diff] [blame] | 28 | class ios_base; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 29 | template <class charT, class traits = char_traits<charT> > class basic_ios; |
| 30 | |
| 31 | template <class charT, class traits = char_traits<charT> > class basic_streambuf; |
| 32 | template <class charT, class traits = char_traits<charT> > class basic_istream; |
| 33 | template <class charT, class traits = char_traits<charT> > class basic_ostream; |
| 34 | template <class charT, class traits = char_traits<charT> > class basic_iostream; |
| 35 | |
| 36 | template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> > |
| 37 | class basic_stringbuf; |
| 38 | template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> > |
| 39 | class basic_istringstream; |
| 40 | template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> > |
| 41 | class basic_ostringstream; |
| 42 | template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> > |
| 43 | class basic_stringstream; |
| 44 | |
| 45 | template <class charT, class traits = char_traits<charT> > class basic_filebuf; |
| 46 | template <class charT, class traits = char_traits<charT> > class basic_ifstream; |
| 47 | template <class charT, class traits = char_traits<charT> > class basic_ofstream; |
| 48 | template <class charT, class traits = char_traits<charT> > class basic_fstream; |
| 49 | |
| 50 | template <class charT, class traits = char_traits<charT> > class istreambuf_iterator; |
| 51 | template <class charT, class traits = char_traits<charT> > class ostreambuf_iterator; |
| 52 | |
| 53 | typedef basic_ios<char> ios; |
| 54 | typedef basic_ios<wchar_t> wios; |
| 55 | |
| 56 | typedef basic_streambuf<char> streambuf; |
| 57 | typedef basic_istream<char> istream; |
| 58 | typedef basic_ostream<char> ostream; |
| 59 | typedef basic_iostream<char> iostream; |
| 60 | |
| 61 | typedef basic_stringbuf<char> stringbuf; |
| 62 | typedef basic_istringstream<char> istringstream; |
| 63 | typedef basic_ostringstream<char> ostringstream; |
| 64 | typedef basic_stringstream<char> stringstream; |
| 65 | |
| 66 | typedef basic_filebuf<char> filebuf; |
| 67 | typedef basic_ifstream<char> ifstream; |
| 68 | typedef basic_ofstream<char> ofstream; |
| 69 | typedef basic_fstream<char> fstream; |
| 70 | |
| 71 | typedef basic_streambuf<wchar_t> wstreambuf; |
| 72 | typedef basic_istream<wchar_t> wistream; |
| 73 | typedef basic_ostream<wchar_t> wostream; |
| 74 | typedef basic_iostream<wchar_t> wiostream; |
| 75 | |
| 76 | typedef basic_stringbuf<wchar_t> wstringbuf; |
| 77 | typedef basic_istringstream<wchar_t> wistringstream; |
| 78 | typedef basic_ostringstream<wchar_t> wostringstream; |
| 79 | typedef basic_stringstream<wchar_t> wstringstream; |
| 80 | |
| 81 | typedef basic_filebuf<wchar_t> wfilebuf; |
| 82 | typedef basic_ifstream<wchar_t> wifstream; |
| 83 | typedef basic_ofstream<wchar_t> wofstream; |
| 84 | typedef basic_fstream<wchar_t> wfstream; |
| 85 | |
| 86 | template <class state> class fpos; |
Marek Kurdej | e3ac4e2 | 2021-03-23 17:15:07 +0100 | [diff] [blame] | 87 | using streampos = fpos<char_traits<char>::state_type>; |
| 88 | using wstreampos = fpos<char_traits<wchar_t>::state_type>; |
| 89 | using u8streampos = fpos<char_traits<char8_t>::state_type>; // C++20 |
| 90 | using u16streampos = fpos<char_traits<char16_t>::state_type>; |
| 91 | using u32streampos = fpos<char_traits<char32_t>::state_type>; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 92 | |
| 93 | } // std |
| 94 | |
| 95 | */ |
| 96 | |
| 97 | #include <__config> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 98 | #include <__mbstate_t.h> |
Mark de Wever | ce8f12c | 2021-12-22 18:14:14 +0100 | [diff] [blame] | 99 | #include <version> |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 100 | |
Howard Hinnant | aaaa52b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 101 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
Arthur O'Dwyer | 6eeaa00 | 2022-02-01 20:16:40 -0500 | [diff] [blame] | 102 | # pragma GCC system_header |
Howard Hinnant | aaaa52b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 103 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 104 | |
| 105 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 106 | |
Howard Hinnant | 8331b76 | 2013-03-06 23:30:19 +0000 | [diff] [blame] | 107 | class _LIBCPP_TYPE_VIS ios_base; |
Howard Hinnant | d433527 | 2011-01-08 20:00:48 +0000 | [diff] [blame] | 108 | |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 109 | template<class _CharT> struct _LIBCPP_TEMPLATE_VIS char_traits; |
Marshall Clow | 8732fed | 2018-12-11 04:35:44 +0000 | [diff] [blame] | 110 | template<> struct char_traits<char>; |
Arthur O'Dwyer | afa5d5f | 2021-04-18 21:47:08 -0400 | [diff] [blame] | 111 | #ifndef _LIBCPP_HAS_NO_CHAR8_T |
Marshall Clow | 8732fed | 2018-12-11 04:35:44 +0000 | [diff] [blame] | 112 | template<> struct char_traits<char8_t>; |
| 113 | #endif |
| 114 | template<> struct char_traits<char16_t>; |
| 115 | template<> struct char_traits<char32_t>; |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 116 | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
Marshall Clow | 8732fed | 2018-12-11 04:35:44 +0000 | [diff] [blame] | 117 | template<> struct char_traits<wchar_t>; |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 118 | #endif |
Marshall Clow | 8732fed | 2018-12-11 04:35:44 +0000 | [diff] [blame] | 119 | |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 120 | template<class _Tp> class _LIBCPP_TEMPLATE_VIS allocator; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 121 | |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 122 | template <class _CharT, class _Traits = char_traits<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 123 | class _LIBCPP_TEMPLATE_VIS basic_ios; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 124 | |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 125 | template <class _CharT, class _Traits = char_traits<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 126 | class _LIBCPP_TEMPLATE_VIS basic_streambuf; |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 127 | template <class _CharT, class _Traits = char_traits<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 128 | class _LIBCPP_TEMPLATE_VIS basic_istream; |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 129 | template <class _CharT, class _Traits = char_traits<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 130 | class _LIBCPP_TEMPLATE_VIS basic_ostream; |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 131 | template <class _CharT, class _Traits = char_traits<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 132 | class _LIBCPP_TEMPLATE_VIS basic_iostream; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 133 | |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 134 | template <class _CharT, class _Traits = char_traits<_CharT>, |
| 135 | class _Allocator = allocator<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 136 | class _LIBCPP_TEMPLATE_VIS basic_stringbuf; |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 137 | template <class _CharT, class _Traits = char_traits<_CharT>, |
| 138 | class _Allocator = allocator<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 139 | class _LIBCPP_TEMPLATE_VIS basic_istringstream; |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 140 | template <class _CharT, class _Traits = char_traits<_CharT>, |
| 141 | class _Allocator = allocator<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 142 | class _LIBCPP_TEMPLATE_VIS basic_ostringstream; |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 143 | template <class _CharT, class _Traits = char_traits<_CharT>, |
| 144 | class _Allocator = allocator<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 145 | class _LIBCPP_TEMPLATE_VIS basic_stringstream; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 146 | |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 147 | template <class _CharT, class _Traits = char_traits<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 148 | class _LIBCPP_TEMPLATE_VIS basic_filebuf; |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 149 | template <class _CharT, class _Traits = char_traits<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 150 | class _LIBCPP_TEMPLATE_VIS basic_ifstream; |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 151 | template <class _CharT, class _Traits = char_traits<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 152 | class _LIBCPP_TEMPLATE_VIS basic_ofstream; |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 153 | template <class _CharT, class _Traits = char_traits<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 154 | class _LIBCPP_TEMPLATE_VIS basic_fstream; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 155 | |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 156 | template <class _CharT, class _Traits = char_traits<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 157 | class _LIBCPP_TEMPLATE_VIS istreambuf_iterator; |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 158 | template <class _CharT, class _Traits = char_traits<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 159 | class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 160 | |
| 161 | typedef basic_ios<char> ios; |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 162 | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 163 | typedef basic_ios<wchar_t> wios; |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 164 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 165 | |
| 166 | typedef basic_streambuf<char> streambuf; |
| 167 | typedef basic_istream<char> istream; |
| 168 | typedef basic_ostream<char> ostream; |
| 169 | typedef basic_iostream<char> iostream; |
| 170 | |
| 171 | typedef basic_stringbuf<char> stringbuf; |
| 172 | typedef basic_istringstream<char> istringstream; |
| 173 | typedef basic_ostringstream<char> ostringstream; |
| 174 | typedef basic_stringstream<char> stringstream; |
| 175 | |
| 176 | typedef basic_filebuf<char> filebuf; |
| 177 | typedef basic_ifstream<char> ifstream; |
| 178 | typedef basic_ofstream<char> ofstream; |
| 179 | typedef basic_fstream<char> fstream; |
| 180 | |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 181 | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 182 | typedef basic_streambuf<wchar_t> wstreambuf; |
| 183 | typedef basic_istream<wchar_t> wistream; |
| 184 | typedef basic_ostream<wchar_t> wostream; |
| 185 | typedef basic_iostream<wchar_t> wiostream; |
| 186 | |
| 187 | typedef basic_stringbuf<wchar_t> wstringbuf; |
| 188 | typedef basic_istringstream<wchar_t> wistringstream; |
| 189 | typedef basic_ostringstream<wchar_t> wostringstream; |
| 190 | typedef basic_stringstream<wchar_t> wstringstream; |
| 191 | |
| 192 | typedef basic_filebuf<wchar_t> wfilebuf; |
| 193 | typedef basic_ifstream<wchar_t> wifstream; |
| 194 | typedef basic_ofstream<wchar_t> wofstream; |
| 195 | typedef basic_fstream<wchar_t> wfstream; |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 196 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 197 | |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 198 | template <class _CharT, class _Traits> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 199 | class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wios)) basic_ios; |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 200 | |
| 201 | template <class _CharT, class _Traits> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 202 | class _LIBCPP_PREFERRED_NAME(streambuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstreambuf)) basic_streambuf; |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 203 | template <class _CharT, class _Traits> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 204 | class _LIBCPP_PREFERRED_NAME(istream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wistream)) basic_istream; |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 205 | template <class _CharT, class _Traits> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 206 | class _LIBCPP_PREFERRED_NAME(ostream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wostream)) basic_ostream; |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 207 | template <class _CharT, class _Traits> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 208 | class _LIBCPP_PREFERRED_NAME(iostream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wiostream)) basic_iostream; |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 209 | |
| 210 | template <class _CharT, class _Traits, class _Allocator> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 211 | class _LIBCPP_PREFERRED_NAME(stringbuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstringbuf)) basic_stringbuf; |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 212 | template <class _CharT, class _Traits, class _Allocator> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 213 | class _LIBCPP_PREFERRED_NAME(istringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wistringstream)) basic_istringstream; |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 214 | template <class _CharT, class _Traits, class _Allocator> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 215 | class _LIBCPP_PREFERRED_NAME(ostringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wostringstream)) basic_ostringstream; |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 216 | template <class _CharT, class _Traits, class _Allocator> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 217 | class _LIBCPP_PREFERRED_NAME(stringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstringstream)) basic_stringstream; |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 218 | |
| 219 | template <class _CharT, class _Traits> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 220 | class _LIBCPP_PREFERRED_NAME(filebuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wfilebuf)) basic_filebuf; |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 221 | template <class _CharT, class _Traits> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 222 | class _LIBCPP_PREFERRED_NAME(ifstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wifstream)) basic_ifstream; |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 223 | template <class _CharT, class _Traits> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 224 | class _LIBCPP_PREFERRED_NAME(ofstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wofstream)) basic_ofstream; |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 225 | template <class _CharT, class _Traits> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 226 | class _LIBCPP_PREFERRED_NAME(fstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wfstream)) basic_fstream; |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 227 | |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 228 | template <class _State> class _LIBCPP_TEMPLATE_VIS fpos; |
Howard Hinnant | 155c2af | 2010-05-24 17:49:41 +0000 | [diff] [blame] | 229 | typedef fpos<mbstate_t> streampos; |
| 230 | typedef fpos<mbstate_t> wstreampos; |
Arthur O'Dwyer | afa5d5f | 2021-04-18 21:47:08 -0400 | [diff] [blame] | 231 | #ifndef _LIBCPP_HAS_NO_CHAR8_T |
Marshall Clow | 8732fed | 2018-12-11 04:35:44 +0000 | [diff] [blame] | 232 | typedef fpos<mbstate_t> u8streampos; |
| 233 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 234 | #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS |
Howard Hinnant | 155c2af | 2010-05-24 17:49:41 +0000 | [diff] [blame] | 235 | typedef fpos<mbstate_t> u16streampos; |
| 236 | typedef fpos<mbstate_t> u32streampos; |
Louis Dionne | 96fc5f5 | 2021-09-09 11:25:10 -0400 | [diff] [blame] | 237 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 238 | |
Jonathan Roelofs | d3c81f4 | 2015-02-03 15:34:17 +0000 | [diff] [blame] | 239 | #if defined(_NEWLIB_VERSION) |
| 240 | // On newlib, off_t is 'long int' |
| 241 | typedef long int streamoff; // for char_traits in <string> |
| 242 | #else |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 243 | typedef long long streamoff; // for char_traits in <string> |
Jonathan Roelofs | d3c81f4 | 2015-02-03 15:34:17 +0000 | [diff] [blame] | 244 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 245 | |
| 246 | template <class _CharT, // for <stdexcept> |
| 247 | class _Traits = char_traits<_CharT>, |
Howard Hinnant | 5e9669f | 2010-09-21 16:04:28 +0000 | [diff] [blame] | 248 | class _Allocator = allocator<_CharT> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 249 | class _LIBCPP_TEMPLATE_VIS basic_string; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 250 | typedef basic_string<char, char_traits<char>, allocator<char> > string; |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 251 | #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 252 | typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring; |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 253 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 254 | |
Richard Smith | 256954d | 2020-11-11 17:12:18 -0800 | [diff] [blame] | 255 | template <class _CharT, class _Traits, class _Allocator> |
Louis Dionne | 8925814 | 2021-08-23 15:32:36 -0400 | [diff] [blame] | 256 | class _LIBCPP_PREFERRED_NAME(string) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstring)) basic_string; |
Eric Fiselier | 876c686 | 2016-02-20 00:19:45 +0000 | [diff] [blame] | 257 | |
| 258 | // Include other forward declarations here |
| 259 | template <class _Tp, class _Alloc = allocator<_Tp> > |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame] | 260 | class _LIBCPP_TEMPLATE_VIS vector; |
Eric Fiselier | 876c686 | 2016-02-20 00:19:45 +0000 | [diff] [blame] | 261 | |
Louis Dionne | 3df65ce | 2020-10-15 13:27:27 -0400 | [diff] [blame] | 262 | template <class _CharT, class _Traits> |
| 263 | class __save_flags |
| 264 | { |
| 265 | typedef basic_ios<_CharT, _Traits> __stream_type; |
| 266 | typedef typename __stream_type::fmtflags fmtflags; |
| 267 | |
| 268 | __stream_type& __stream_; |
| 269 | fmtflags __fmtflags_; |
| 270 | _CharT __fill_; |
| 271 | |
| 272 | __save_flags(const __save_flags&); |
| 273 | __save_flags& operator=(const __save_flags&); |
| 274 | public: |
| 275 | _LIBCPP_INLINE_VISIBILITY |
| 276 | explicit __save_flags(__stream_type& __stream) |
| 277 | : __stream_(__stream), |
| 278 | __fmtflags_(__stream.flags()), |
| 279 | __fill_(__stream.fill()) |
| 280 | {} |
| 281 | _LIBCPP_INLINE_VISIBILITY |
| 282 | ~__save_flags() |
| 283 | { |
| 284 | __stream_.flags(__fmtflags_); |
| 285 | __stream_.fill(__fill_); |
| 286 | } |
| 287 | }; |
| 288 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 289 | _LIBCPP_END_NAMESPACE_STD |
| 290 | |
Louis Dionne | 2b1ceaa | 2021-04-20 12:03:32 -0400 | [diff] [blame] | 291 | #endif // _LIBCPP_IOSFWD |