iosfwd 5.9 KB

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