iosfwd 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. // <iosfwd> Forward declarations -*- C++ -*-
  2. // Copyright (C) 1997-2019 Free Software Foundation, Inc.
  3. //
  4. // This file is part of the GNU ISO C++ Library. This library is free
  5. // software; you can redistribute it and/or modify it under the
  6. // terms of the GNU General Public License as published by the
  7. // Free Software Foundation; either version 3, or (at your option)
  8. // any later version.
  9. // This library is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. // Under Section 7 of GPL version 3, you are granted additional
  14. // permissions described in the GCC Runtime Library Exception, version
  15. // 3.1, as published by the Free Software Foundation.
  16. // You should have received a copy of the GNU General Public License and
  17. // a copy of the GCC Runtime Library Exception along with this program;
  18. // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. // <http://www.gnu.org/licenses/>.
  20. /** @file include/iosfwd
  21. * This is a Standard C++ Library header.
  22. */
  23. //
  24. // ISO C++ 14882: 27.2 Forward declarations
  25. //
  26. #ifndef _GLIBCXX_IOSFWD
  27. #define _GLIBCXX_IOSFWD 1
  28. #pragma GCC system_header
  29. #include <bits/c++config.h>
  30. #include <bits/stringfwd.h> // For string forward declarations.
  31. #include <bits/postypes.h>
  32. namespace std _GLIBCXX_VISIBILITY(default)
  33. {
  34. _GLIBCXX_BEGIN_NAMESPACE_VERSION
  35. /**
  36. * @defgroup io I/O
  37. *
  38. * Nearly all of the I/O classes are parameterized on the type of
  39. * characters they read and write. (The major exception is ios_base at
  40. * the top of the hierarchy.) This is a change from pre-Standard
  41. * streams, which were not templates.
  42. *
  43. * For ease of use and compatibility, all of the basic_* I/O-related
  44. * classes are given typedef names for both of the builtin character
  45. * widths (wide and narrow). The typedefs are the same as the
  46. * pre-Standard names, for example:
  47. *
  48. * @code
  49. * typedef basic_ifstream<char> ifstream;
  50. * @endcode
  51. *
  52. * Because properly forward-declaring these classes can be difficult, you
  53. * should not do it yourself. Instead, include the &lt;iosfwd&gt;
  54. * header, which contains only declarations of all the I/O classes as
  55. * well as the typedefs. Trying to forward-declare the typedefs
  56. * themselves (e.g., <code>class ostream;</code>) is not valid ISO C++.
  57. *
  58. * For more specific declarations, see
  59. * https://gcc.gnu.org/onlinedocs/libstdc++/manual/io.html#std.io.objects
  60. *
  61. * @{
  62. */
  63. class ios_base;
  64. template<typename _CharT, typename _Traits = char_traits<_CharT> >
  65. class basic_ios;
  66. template<typename _CharT, typename _Traits = char_traits<_CharT> >
  67. class basic_streambuf;
  68. template<typename _CharT, typename _Traits = char_traits<_CharT> >
  69. class basic_istream;
  70. template<typename _CharT, typename _Traits = char_traits<_CharT> >
  71. class basic_ostream;
  72. template<typename _CharT, typename _Traits = char_traits<_CharT> >
  73. class basic_iostream;
  74. _GLIBCXX_BEGIN_NAMESPACE_CXX11
  75. template<typename _CharT, typename _Traits = char_traits<_CharT>,
  76. typename _Alloc = allocator<_CharT> >
  77. class basic_stringbuf;
  78. template<typename _CharT, typename _Traits = char_traits<_CharT>,
  79. typename _Alloc = allocator<_CharT> >
  80. class basic_istringstream;
  81. template<typename _CharT, typename _Traits = char_traits<_CharT>,
  82. typename _Alloc = allocator<_CharT> >
  83. class basic_ostringstream;
  84. template<typename _CharT, typename _Traits = char_traits<_CharT>,
  85. typename _Alloc = allocator<_CharT> >
  86. class basic_stringstream;
  87. _GLIBCXX_END_NAMESPACE_CXX11
  88. template<typename _CharT, typename _Traits = char_traits<_CharT> >
  89. class basic_filebuf;
  90. template<typename _CharT, typename _Traits = char_traits<_CharT> >
  91. class basic_ifstream;
  92. template<typename _CharT, typename _Traits = char_traits<_CharT> >
  93. class basic_ofstream;
  94. template<typename _CharT, typename _Traits = char_traits<_CharT> >
  95. class basic_fstream;
  96. template<typename _CharT, typename _Traits = char_traits<_CharT> >
  97. class istreambuf_iterator;
  98. template<typename _CharT, typename _Traits = char_traits<_CharT> >
  99. class ostreambuf_iterator;
  100. /// Base class for @c char streams.
  101. typedef basic_ios<char> ios;
  102. /// Base class for @c char buffers.
  103. typedef basic_streambuf<char> streambuf;
  104. /// Base class for @c char input streams.
  105. typedef basic_istream<char> istream;
  106. /// Base class for @c char output streams.
  107. typedef basic_ostream<char> ostream;
  108. /// Base class for @c char mixed input and output streams.
  109. typedef basic_iostream<char> iostream;
  110. /// Class for @c char memory buffers.
  111. typedef basic_stringbuf<char> stringbuf;
  112. /// Class for @c char input memory streams.
  113. typedef basic_istringstream<char> istringstream;
  114. /// Class for @c char output memory streams.
  115. typedef basic_ostringstream<char> ostringstream;
  116. /// Class for @c char mixed input and output memory streams.
  117. typedef basic_stringstream<char> stringstream;
  118. /// Class for @c char file buffers.
  119. typedef basic_filebuf<char> filebuf;
  120. /// Class for @c char input file streams.
  121. typedef basic_ifstream<char> ifstream;
  122. /// Class for @c char output file streams.
  123. typedef basic_ofstream<char> ofstream;
  124. /// Class for @c char mixed input and output file streams.
  125. typedef basic_fstream<char> fstream;
  126. #ifdef _GLIBCXX_USE_WCHAR_T
  127. /// Base class for @c wchar_t streams.
  128. typedef basic_ios<wchar_t> wios;
  129. /// Base class for @c wchar_t buffers.
  130. typedef basic_streambuf<wchar_t> wstreambuf;
  131. /// Base class for @c wchar_t input streams.
  132. typedef basic_istream<wchar_t> wistream;
  133. /// Base class for @c wchar_t output streams.
  134. typedef basic_ostream<wchar_t> wostream;
  135. /// Base class for @c wchar_t mixed input and output streams.
  136. typedef basic_iostream<wchar_t> wiostream;
  137. /// Class for @c wchar_t memory buffers.
  138. typedef basic_stringbuf<wchar_t> wstringbuf;
  139. /// Class for @c wchar_t input memory streams.
  140. typedef basic_istringstream<wchar_t> wistringstream;
  141. /// Class for @c wchar_t output memory streams.
  142. typedef basic_ostringstream<wchar_t> wostringstream;
  143. /// Class for @c wchar_t mixed input and output memory streams.
  144. typedef basic_stringstream<wchar_t> wstringstream;
  145. /// Class for @c wchar_t file buffers.
  146. typedef basic_filebuf<wchar_t> wfilebuf;
  147. /// Class for @c wchar_t input file streams.
  148. typedef basic_ifstream<wchar_t> wifstream;
  149. /// Class for @c wchar_t output file streams.
  150. typedef basic_ofstream<wchar_t> wofstream;
  151. /// Class for @c wchar_t mixed input and output file streams.
  152. typedef basic_fstream<wchar_t> wfstream;
  153. #endif
  154. /** @} */
  155. _GLIBCXX_END_NAMESPACE_VERSION
  156. } // namespace
  157. #endif /* _GLIBCXX_IOSFWD */