Home | History | Annotate | Download | only in include
      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 
     17 namespace std
     18 {
     19 
     20 template<class charT> struct char_traits;
     21 template<>            struct char_traits<char>;
     22 template<>            struct char_traits<char8_t>;  // C++20
     23 template<>            struct char_traits<char16_t>;
     24 template<>            struct char_traits<char32_t>;
     25 template<>            struct char_traits<wchar_t>;
     26 
     27 template<class T>     class allocator;
     28 
     29 class ios_base;
     30 template <class charT, class traits = char_traits<charT> > class basic_ios;
     31 
     32 template <class charT, class traits = char_traits<charT> > class basic_streambuf;
     33 template <class charT, class traits = char_traits<charT> > class basic_istream;
     34 template <class charT, class traits = char_traits<charT> > class basic_ostream;
     35 template <class charT, class traits = char_traits<charT> > class basic_iostream;
     36 
     37 template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
     38     class basic_stringbuf;
     39 template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
     40     class basic_istringstream;
     41 template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
     42     class basic_ostringstream;
     43 template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
     44     class basic_stringstream;
     45 
     46 template <class charT, class traits = char_traits<charT> > class basic_filebuf;
     47 template <class charT, class traits = char_traits<charT> > class basic_ifstream;
     48 template <class charT, class traits = char_traits<charT> > class basic_ofstream;
     49 template <class charT, class traits = char_traits<charT> > class basic_fstream;
     50 
     51 template <class charT, class traits = char_traits<charT> > class istreambuf_iterator;
     52 template <class charT, class traits = char_traits<charT> > class ostreambuf_iterator;
     53 
     54 typedef basic_ios<char>              ios;
     55 typedef basic_ios<wchar_t>           wios;
     56 
     57 typedef basic_streambuf<char>        streambuf;
     58 typedef basic_istream<char>          istream;
     59 typedef basic_ostream<char>          ostream;
     60 typedef basic_iostream<char>         iostream;
     61 
     62 typedef basic_stringbuf<char>        stringbuf;
     63 typedef basic_istringstream<char>    istringstream;
     64 typedef basic_ostringstream<char>    ostringstream;
     65 typedef basic_stringstream<char>     stringstream;
     66 
     67 typedef basic_filebuf<char>          filebuf;
     68 typedef basic_ifstream<char>         ifstream;
     69 typedef basic_ofstream<char>         ofstream;
     70 typedef basic_fstream<char>          fstream;
     71 
     72 typedef basic_streambuf<wchar_t>     wstreambuf;
     73 typedef basic_istream<wchar_t>       wistream;
     74 typedef basic_ostream<wchar_t>       wostream;
     75 typedef basic_iostream<wchar_t>      wiostream;
     76 
     77 typedef basic_stringbuf<wchar_t>     wstringbuf;
     78 typedef basic_istringstream<wchar_t> wistringstream;
     79 typedef basic_ostringstream<wchar_t> wostringstream;
     80 typedef basic_stringstream<wchar_t>  wstringstream;
     81 
     82 typedef basic_filebuf<wchar_t>       wfilebuf;
     83 typedef basic_ifstream<wchar_t>      wifstream;
     84 typedef basic_ofstream<wchar_t>      wofstream;
     85 typedef basic_fstream<wchar_t>       wfstream;
     86 
     87 template <class state> class fpos;
     88 typedef fpos<char_traits<char>::state_type>    streampos;
     89 typedef 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 
    104 class _LIBCPP_TYPE_VIS ios_base;
    105 
    106 template<class _CharT>  struct _LIBCPP_TEMPLATE_VIS char_traits;
    107 template<> struct char_traits<char>;
    108 #ifndef _LIBCPP_NO_HAS_CHAR8_T
    109 template<> struct char_traits<char8_t>;
    110 #endif
    111 template<> struct char_traits<char16_t>;
    112 template<> struct char_traits<char32_t>;
    113 template<> struct char_traits<wchar_t>;
    114 
    115 template<class _Tp>     class _LIBCPP_TEMPLATE_VIS allocator;
    116 
    117 template <class _CharT, class _Traits = char_traits<_CharT> >
    118     class _LIBCPP_TEMPLATE_VIS basic_ios;
    119 
    120 template <class _CharT, class _Traits = char_traits<_CharT> >
    121     class _LIBCPP_TEMPLATE_VIS basic_streambuf;
    122 template <class _CharT, class _Traits = char_traits<_CharT> >
    123     class _LIBCPP_TEMPLATE_VIS basic_istream;
    124 template <class _CharT, class _Traits = char_traits<_CharT> >
    125     class _LIBCPP_TEMPLATE_VIS basic_ostream;
    126 template <class _CharT, class _Traits = char_traits<_CharT> >
    127     class _LIBCPP_TEMPLATE_VIS basic_iostream;
    128 
    129 template <class _CharT, class _Traits = char_traits<_CharT>,
    130           class _Allocator = allocator<_CharT> >
    131     class _LIBCPP_TEMPLATE_VIS basic_stringbuf;
    132 template <class _CharT, class _Traits = char_traits<_CharT>,
    133           class _Allocator = allocator<_CharT> >
    134     class _LIBCPP_TEMPLATE_VIS basic_istringstream;
    135 template <class _CharT, class _Traits = char_traits<_CharT>,
    136           class _Allocator = allocator<_CharT> >
    137     class _LIBCPP_TEMPLATE_VIS basic_ostringstream;
    138 template <class _CharT, class _Traits = char_traits<_CharT>,
    139           class _Allocator = allocator<_CharT> >
    140     class _LIBCPP_TEMPLATE_VIS basic_stringstream;
    141 
    142 template <class _CharT, class _Traits = char_traits<_CharT> >
    143     class _LIBCPP_TEMPLATE_VIS basic_filebuf;
    144 template <class _CharT, class _Traits = char_traits<_CharT> >
    145     class _LIBCPP_TEMPLATE_VIS basic_ifstream;
    146 template <class _CharT, class _Traits = char_traits<_CharT> >
    147     class _LIBCPP_TEMPLATE_VIS basic_ofstream;
    148 template <class _CharT, class _Traits = char_traits<_CharT> >
    149     class _LIBCPP_TEMPLATE_VIS basic_fstream;
    150 
    151 template <class _CharT, class _Traits = char_traits<_CharT> >
    152     class _LIBCPP_TEMPLATE_VIS istreambuf_iterator;
    153 template <class _CharT, class _Traits = char_traits<_CharT> >
    154     class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator;
    155 
    156 typedef basic_ios<char>              ios;
    157 typedef basic_ios<wchar_t>           wios;
    158 
    159 typedef basic_streambuf<char>        streambuf;
    160 typedef basic_istream<char>          istream;
    161 typedef basic_ostream<char>          ostream;
    162 typedef basic_iostream<char>         iostream;
    163 
    164 typedef basic_stringbuf<char>        stringbuf;
    165 typedef basic_istringstream<char>    istringstream;
    166 typedef basic_ostringstream<char>    ostringstream;
    167 typedef basic_stringstream<char>     stringstream;
    168 
    169 typedef basic_filebuf<char>          filebuf;
    170 typedef basic_ifstream<char>         ifstream;
    171 typedef basic_ofstream<char>         ofstream;
    172 typedef basic_fstream<char>          fstream;
    173 
    174 typedef basic_streambuf<wchar_t>     wstreambuf;
    175 typedef basic_istream<wchar_t>       wistream;
    176 typedef basic_ostream<wchar_t>       wostream;
    177 typedef basic_iostream<wchar_t>      wiostream;
    178 
    179 typedef basic_stringbuf<wchar_t>     wstringbuf;
    180 typedef basic_istringstream<wchar_t> wistringstream;
    181 typedef basic_ostringstream<wchar_t> wostringstream;
    182 typedef basic_stringstream<wchar_t>  wstringstream;
    183 
    184 typedef basic_filebuf<wchar_t>       wfilebuf;
    185 typedef basic_ifstream<wchar_t>      wifstream;
    186 typedef basic_ofstream<wchar_t>      wofstream;
    187 typedef basic_fstream<wchar_t>       wfstream;
    188 
    189 template <class _State>             class _LIBCPP_TEMPLATE_VIS fpos;
    190 typedef fpos<mbstate_t>    streampos;
    191 typedef fpos<mbstate_t>    wstreampos;
    192 #ifndef _LIBCPP_NO_HAS_CHAR8_T
    193 typedef fpos<mbstate_t>    u8streampos;
    194 #endif
    195 #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
    196 typedef fpos<mbstate_t>    u16streampos;
    197 typedef 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'
    202 typedef long int streamoff;         // for char_traits in <string>
    203 #else
    204 typedef long long streamoff;        // for char_traits in <string>
    205 #endif
    206 
    207 template <class _CharT,             // for <stdexcept>
    208           class _Traits = char_traits<_CharT>,
    209           class _Allocator = allocator<_CharT> >
    210     class _LIBCPP_TEMPLATE_VIS basic_string;
    211 typedef basic_string<char, char_traits<char>, allocator<char> > string;
    212 typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
    213 
    214 
    215 // Include other forward declarations here
    216 template <class _Tp, class _Alloc = allocator<_Tp> >
    217 class _LIBCPP_TEMPLATE_VIS vector;
    218 
    219 _LIBCPP_END_NAMESPACE_STD
    220 
    221 #endif  // _LIBCPP_IOSFWD
    222