xref: /freebsd/contrib/llvm-project/libcxx/include/iosfwd (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
10b57cec5SDimitry Andric// -*- C++ -*-
2349cc55cSDimitry Andric//===----------------------------------------------------------------------===//
30b57cec5SDimitry Andric//
40b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
50b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
60b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
70b57cec5SDimitry Andric//
80b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
90b57cec5SDimitry Andric
100b57cec5SDimitry Andric#ifndef _LIBCPP_IOSFWD
110b57cec5SDimitry Andric#define _LIBCPP_IOSFWD
120b57cec5SDimitry Andric
130b57cec5SDimitry Andric/*
140b57cec5SDimitry Andric    iosfwd synopsis
150b57cec5SDimitry Andric
160b57cec5SDimitry Andricnamespace std
170b57cec5SDimitry Andric{
180b57cec5SDimitry Andric
190b57cec5SDimitry Andrictemplate<class charT> struct char_traits;
200b57cec5SDimitry Andrictemplate<>            struct char_traits<char>;
210b57cec5SDimitry Andrictemplate<>            struct char_traits<char8_t>;  // C++20
220b57cec5SDimitry Andrictemplate<>            struct char_traits<char16_t>;
230b57cec5SDimitry Andrictemplate<>            struct char_traits<char32_t>;
240b57cec5SDimitry Andrictemplate<>            struct char_traits<wchar_t>;
250b57cec5SDimitry Andric
260b57cec5SDimitry Andrictemplate<class T>     class allocator;
270b57cec5SDimitry Andric
280b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT> > class basic_ios;
290b57cec5SDimitry Andric
300b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT> > class basic_streambuf;
310b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT> > class basic_istream;
320b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT> > class basic_ostream;
330b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT> > class basic_iostream;
340b57cec5SDimitry Andric
350b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
360b57cec5SDimitry Andric    class basic_stringbuf;
370b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
380b57cec5SDimitry Andric    class basic_istringstream;
390b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
400b57cec5SDimitry Andric    class basic_ostringstream;
410b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
420b57cec5SDimitry Andric    class basic_stringstream;
430b57cec5SDimitry Andric
440b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT> > class basic_filebuf;
450b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT> > class basic_ifstream;
460b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT> > class basic_ofstream;
470b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT> > class basic_fstream;
480b57cec5SDimitry Andric
490b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT> > class istreambuf_iterator;
500b57cec5SDimitry Andrictemplate <class charT, class traits = char_traits<charT> > class ostreambuf_iterator;
510b57cec5SDimitry Andric
520b57cec5SDimitry Andrictypedef basic_ios<char>              ios;
530b57cec5SDimitry Andrictypedef basic_ios<wchar_t>           wios;
540b57cec5SDimitry Andric
550b57cec5SDimitry Andrictypedef basic_streambuf<char>        streambuf;
560b57cec5SDimitry Andrictypedef basic_istream<char>          istream;
570b57cec5SDimitry Andrictypedef basic_ostream<char>          ostream;
580b57cec5SDimitry Andrictypedef basic_iostream<char>         iostream;
590b57cec5SDimitry Andric
600b57cec5SDimitry Andrictypedef basic_stringbuf<char>        stringbuf;
610b57cec5SDimitry Andrictypedef basic_istringstream<char>    istringstream;
620b57cec5SDimitry Andrictypedef basic_ostringstream<char>    ostringstream;
630b57cec5SDimitry Andrictypedef basic_stringstream<char>     stringstream;
640b57cec5SDimitry Andric
650b57cec5SDimitry Andrictypedef basic_filebuf<char>          filebuf;
660b57cec5SDimitry Andrictypedef basic_ifstream<char>         ifstream;
670b57cec5SDimitry Andrictypedef basic_ofstream<char>         ofstream;
680b57cec5SDimitry Andrictypedef basic_fstream<char>          fstream;
690b57cec5SDimitry Andric
700b57cec5SDimitry Andrictypedef basic_streambuf<wchar_t>     wstreambuf;
710b57cec5SDimitry Andrictypedef basic_istream<wchar_t>       wistream;
720b57cec5SDimitry Andrictypedef basic_ostream<wchar_t>       wostream;
730b57cec5SDimitry Andrictypedef basic_iostream<wchar_t>      wiostream;
740b57cec5SDimitry Andric
750b57cec5SDimitry Andrictypedef basic_stringbuf<wchar_t>     wstringbuf;
760b57cec5SDimitry Andrictypedef basic_istringstream<wchar_t> wistringstream;
770b57cec5SDimitry Andrictypedef basic_ostringstream<wchar_t> wostringstream;
780b57cec5SDimitry Andrictypedef basic_stringstream<wchar_t>  wstringstream;
790b57cec5SDimitry Andric
800b57cec5SDimitry Andrictypedef basic_filebuf<wchar_t>       wfilebuf;
810b57cec5SDimitry Andrictypedef basic_ifstream<wchar_t>      wifstream;
820b57cec5SDimitry Andrictypedef basic_ofstream<wchar_t>      wofstream;
830b57cec5SDimitry Andrictypedef basic_fstream<wchar_t>       wfstream;
840b57cec5SDimitry Andric
850b57cec5SDimitry Andrictemplate <class state> class fpos;
86fe6060f1SDimitry Andricusing streampos  = fpos<char_traits<char>::state_type>;
87fe6060f1SDimitry Andricusing wstreampos = fpos<char_traits<wchar_t>::state_type>;
88fe6060f1SDimitry Andricusing u8streampos = fpos<char_traits<char8_t>::state_type>; // C++20
89fe6060f1SDimitry Andricusing u16streampos = fpos<char_traits<char16_t>::state_type>;
90fe6060f1SDimitry Andricusing u32streampos = fpos<char_traits<char32_t>::state_type>;
910b57cec5SDimitry Andric
925f757f3fSDimitry Andrictemplate <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>>
935f757f3fSDimitry Andric    class basic_syncbuf;                          // C++20
945f757f3fSDimitry Andric
955f757f3fSDimitry Andricusing syncbuf = basic_syncbuf<char>;              // C++20
965f757f3fSDimitry Andricusing wsyncbuf = basic_syncbuf<wchar_t>;          // C++20
975f757f3fSDimitry Andric
985f757f3fSDimitry Andrictemplate <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>>
995f757f3fSDimitry Andric    class basic_osyncstream;                      // C++20
1005f757f3fSDimitry Andric
1015f757f3fSDimitry Andricusing osyncstream = basic_osyncstream<char>;      // C++20
1025f757f3fSDimitry Andricusing wosyncstream = basic_osyncstream<wchar_t>;  // C++20
1035f757f3fSDimitry Andric
1040b57cec5SDimitry Andric}  // std
1050b57cec5SDimitry Andric
1060b57cec5SDimitry Andric*/
1070b57cec5SDimitry Andric
1080b57cec5SDimitry Andric#include <__config>
10906c3fb27SDimitry Andric#include <__fwd/fstream.h>
11006c3fb27SDimitry Andric#include <__fwd/ios.h>
11106c3fb27SDimitry Andric#include <__fwd/istream.h>
112*0fca6ea1SDimitry Andric#include <__fwd/memory.h>
11306c3fb27SDimitry Andric#include <__fwd/ostream.h>
11406c3fb27SDimitry Andric#include <__fwd/sstream.h>
11506c3fb27SDimitry Andric#include <__fwd/streambuf.h>
116bdd1243dSDimitry Andric#include <__fwd/string.h>
11706c3fb27SDimitry Andric#include <__std_mbstate_t.h>
11804eeddc0SDimitry Andric#include <version>
1190b57cec5SDimitry Andric
1200b57cec5SDimitry Andric#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1210b57cec5SDimitry Andric#  pragma GCC system_header
1220b57cec5SDimitry Andric#endif
1230b57cec5SDimitry Andric
1240b57cec5SDimitry Andric_LIBCPP_BEGIN_NAMESPACE_STD
1250b57cec5SDimitry Andric
1260b57cec5SDimitry Andrictemplate <class _CharT, class _Traits = char_traits<_CharT> >
1270b57cec5SDimitry Andricclass _LIBCPP_TEMPLATE_VIS istreambuf_iterator;
1280b57cec5SDimitry Andrictemplate <class _CharT, class _Traits = char_traits<_CharT> >
1290b57cec5SDimitry Andricclass _LIBCPP_TEMPLATE_VIS ostreambuf_iterator;
1300b57cec5SDimitry Andric
131cb14a3feSDimitry Andrictemplate <class _State>
132cb14a3feSDimitry Andricclass _LIBCPP_TEMPLATE_VIS fpos;
1330b57cec5SDimitry Andrictypedef fpos<mbstate_t> streampos;
1345f757f3fSDimitry Andric#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
1350b57cec5SDimitry Andrictypedef fpos<mbstate_t> wstreampos;
1365f757f3fSDimitry Andric#endif
137fe6060f1SDimitry Andric#ifndef _LIBCPP_HAS_NO_CHAR8_T
1380b57cec5SDimitry Andrictypedef fpos<mbstate_t> u8streampos;
1390b57cec5SDimitry Andric#endif
1400b57cec5SDimitry Andrictypedef fpos<mbstate_t> u16streampos;
1410b57cec5SDimitry Andrictypedef fpos<mbstate_t> u32streampos;
1420b57cec5SDimitry Andric
143*0fca6ea1SDimitry Andric#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM)
1445f757f3fSDimitry Andric
1455f757f3fSDimitry Andrictemplate <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT>>
1465f757f3fSDimitry Andricclass basic_syncbuf;
1475f757f3fSDimitry Andric
1485f757f3fSDimitry Andricusing syncbuf = basic_syncbuf<char>;
1495f757f3fSDimitry Andric#  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
1505f757f3fSDimitry Andricusing wsyncbuf = basic_syncbuf<wchar_t>;
1515f757f3fSDimitry Andric#  endif
1525f757f3fSDimitry Andric
1535f757f3fSDimitry Andrictemplate <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT>>
1545f757f3fSDimitry Andricclass basic_osyncstream;
1555f757f3fSDimitry Andric
1565f757f3fSDimitry Andricusing osyncstream = basic_osyncstream<char>;
1575f757f3fSDimitry Andric#  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
1585f757f3fSDimitry Andricusing wosyncstream = basic_osyncstream<wchar_t>;
1595f757f3fSDimitry Andric#  endif
1605f757f3fSDimitry Andric
161*0fca6ea1SDimitry Andric#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM)
1620b57cec5SDimitry Andric
163e8d8bef9SDimitry Andrictemplate <class _CharT, class _Traits>
164cb14a3feSDimitry Andricclass __save_flags {
165e8d8bef9SDimitry Andric  typedef basic_ios<_CharT, _Traits> __stream_type;
166e8d8bef9SDimitry Andric  typedef typename __stream_type::fmtflags fmtflags;
167e8d8bef9SDimitry Andric
168e8d8bef9SDimitry Andric  __stream_type& __stream_;
169e8d8bef9SDimitry Andric  fmtflags __fmtflags_;
170e8d8bef9SDimitry Andric  _CharT __fill_;
171e8d8bef9SDimitry Andric
172e8d8bef9SDimitry Andricpublic:
173*0fca6ea1SDimitry Andric    __save_flags(const __save_flags&) = delete;
174*0fca6ea1SDimitry Andric    __save_flags& operator=(const __save_flags&) = delete;
175*0fca6ea1SDimitry Andric
176cb14a3feSDimitry Andric  _LIBCPP_HIDE_FROM_ABI explicit __save_flags(__stream_type& __stream)
177cb14a3feSDimitry Andric      : __stream_(__stream), __fmtflags_(__stream.flags()), __fill_(__stream.fill()) {}
178cb14a3feSDimitry Andric  _LIBCPP_HIDE_FROM_ABI ~__save_flags() {
179e8d8bef9SDimitry Andric    __stream_.flags(__fmtflags_);
180e8d8bef9SDimitry Andric    __stream_.fill(__fill_);
181e8d8bef9SDimitry Andric  }
182e8d8bef9SDimitry Andric};
183e8d8bef9SDimitry Andric
1840b57cec5SDimitry Andric_LIBCPP_END_NAMESPACE_STD
1850b57cec5SDimitry Andric
1860b57cec5SDimitry Andric#endif // _LIBCPP_IOSFWD
187