I/O
Collaboration diagram for I/O:

## Classes

class | std::basic_filebuf< _CharT, _Traits >
class | std::basic_fstream< _CharT, _Traits >
class | std::basic_ifstream< _CharT, _Traits >
class | std::basic_ios< _CharT, _Traits >
class | std::basic_iostream< _CharT, _Traits >
class | std::basic_istream< _CharT, _Traits >
class | std::basic_istringstream< _CharT, _Traits, _Alloc >
class | std::basic_ofstream< _CharT, _Traits >
class | std::basic_ostream< _CharT, _Traits >
class | std::basic_ostringstream< _CharT, _Traits, _Alloc >
class | std::basic_streambuf< _CharT, _Traits >
class | std::basic_stringbuf< _CharT, _Traits, _Alloc >
class | std::basic_stringstream< _CharT, _Traits, _Alloc >
class | std::ios_base
class | std::istreambuf_iterator< _CharT, _Traits >
class | std::ostreambuf_iterator< _CharT, _Traits >
class | __gnu_cxx::stdio_filebuf< _CharT, _Traits >
class | __gnu_cxx::stdio_sync_filebuf< _CharT, _Traits >

## Typedefs

typedef basic_filebuf< char > | std::filebuf
typedef basic_fstream< char > | std::fstream
typedef basic_ifstream< char > | std::ifstream
typedef basic_ios< char > | std::ios
typedef basic_iostream< char > | std::iostream
using | std::ispanstream
typedef basic_istream< char > | std::istream
typedef basic_istringstream< char > | std::istringstream
typedef basic_ofstream< char > | std::ofstream
using | std::ospanstream
typedef basic_ostream< char > | std::ostream
typedef basic_ostringstream< char > | std::ostringstream
using | std::osyncstream
using | std::spanbuf
using | std::spanstream
typedef basic_streambuf< char > | std::streambuf
typedef basic_stringbuf< char > | std::stringbuf
typedef basic_stringstream< char > | std::stringstream
using | std::syncbuf
typedef basic_filebuf< wchar_t > | std::wfilebuf
typedef basic_fstream< wchar_t > | std::wfstream
typedef basic_ifstream< wchar_t > | std::wifstream
typedef basic_ios< wchar_t > | std::wios
typedef basic_iostream< wchar_t > | std::wiostream
using | std::wispanstream
typedef basic_istream< wchar_t > | std::wistream
typedef basic_istringstream< wchar_t > | std::wistringstream
typedef basic_ofstream< wchar_t > | std::wofstream
using | std::wospanstream
typedef basic_ostream< wchar_t > | std::wostream
typedef basic_ostringstream< wchar_t > | std::wostringstream
using | std::wosyncstream
using | std::wspanbuf
using | std::wspanstream
typedef basic_streambuf< wchar_t > | std::wstreambuf
typedef basic_stringbuf< wchar_t > | std::wstringbuf
typedef basic_stringstream< wchar_t > | std::wstringstream
using | std::wsyncbuf

## Detailed Description

Nearly all of the I/O classes are parameterized on the type of characters they read and write. (The major exception is ios_base at the top of the hierarchy.) This is a change from pre-Standard streams, which were not templates.

For ease of use and compatibility, all of the basic_* I/O-related classes are given typedef names for both of the builtin character widths (wide and narrow). The typedefs are the same as the pre-Standard names, for example:

typedef basic_ifstream<char> ifstream;
std::ifstream
basic_ifstream< char > ifstream
Class for char input file streams.
Definition iosfwd:166

Because properly forward-declaring these classes can be difficult, you should not do it yourself. Instead, include the <iosfwd> header, which contains only declarations of all the I/O classes as well as the typedefs. Trying to forward-declare the typedefs themselves (e.g., `class ostream;`) is not valid ISO C++.

For more specific declarations, see https://gcc.gnu.org/onlinedocs/libstdc++/manual/io.html#std.io.objects

## Typedef Documentation

## filebuf

typedef basic_filebuf<char> std::filebuf

Class for `char` file buffers.

Definition at line 163 of file iosfwd.

## fstream

typedef basic_fstream<char> std::fstream

Class for `char` mixed input and output file streams.

Definition at line 172 of file iosfwd.

## ifstream

typedef basic_ifstream<char> std::ifstream

Class for `char` input file streams.

Definition at line 166 of file iosfwd.

## ios

typedef basic_ios<char> std::ios

Base class for `char` streams.

Definition at line 136 of file iosfwd.

## iostream

typedef basic_iostream<char> std::iostream

Base class for `char` mixed input and output streams.

Definition at line 148 of file iosfwd.

## ispanstream

using std::ispanstream

Definition at line 243 of file iosfwd.

## istream

typedef basic_istream<char> std::istream

Base class for `char` input streams.

Definition at line 142 of file iosfwd.

## istringstream

typedef basic_istringstream<char> std::istringstream

Class for `char` input memory streams.

Definition at line 154 of file iosfwd.

## ofstream

typedef basic_ofstream<char> std::ofstream

Class for `char` output file streams.

Definition at line 169 of file iosfwd.

## ospanstream

using std::ospanstream

Definition at line 244 of file iosfwd.

## ostream

typedef basic_ostream<char> std::ostream

Base class for `char` output streams.

Definition at line 145 of file iosfwd.

## ostringstream

typedef basic_ostringstream<char> std::ostringstream

Class for `char` output memory streams.

Definition at line 157 of file iosfwd.

## osyncstream

using std::osyncstream

Definition at line 224 of file iosfwd.

## spanbuf

using std::spanbuf

Definition at line 242 of file iosfwd.

## spanstream

using std::spanstream

Definition at line 245 of file iosfwd.

## streambuf

typedef basic_streambuf<char> std::streambuf

Base class for `char` buffers.

Definition at line 139 of file iosfwd.

## stringbuf

typedef basic_stringbuf<char> std::stringbuf

Class for `char` memory buffers.

Definition at line 151 of file iosfwd.

## stringstream

typedef basic_stringstream<char> std::stringstream

Class for `char` mixed input and output memory streams.

Definition at line 160 of file iosfwd.

## syncbuf

using std::syncbuf

Definition at line 223 of file iosfwd.

## wfilebuf

typedef basic_filebuf<wchar_t> std::wfilebuf

Class for `wchar_t` file buffers.

Definition at line 203 of file iosfwd.

## wfstream

typedef basic_fstream<wchar_t> std::wfstream

Class for `wchar_t` mixed input and output file streams.

Definition at line 212 of file iosfwd.

## wifstream

typedef basic_ifstream<wchar_t> std::wifstream

Class for `wchar_t` input file streams.

Definition at line 206 of file iosfwd.

## wios

typedef basic_ios<wchar_t> std::wios

Base class for `wchar_t` streams.

Definition at line 176 of file iosfwd.

## wiostream

typedef basic_iostream<wchar_t> std::wiostream

Base class for `wchar_t` mixed input and output streams.

Definition at line 188 of file iosfwd.

## wispanstream

using std::wispanstream

Definition at line 249 of file iosfwd.

## wistream

typedef basic_istream<wchar_t> std::wistream

Base class for `wchar_t` input streams.

Definition at line 182 of file iosfwd.

## wistringstream

typedef basic_istringstream<wchar_t> std::wistringstream

Class for `wchar_t` input memory streams.

Definition at line 194 of file iosfwd.

## wofstream

typedef basic_ofstream<wchar_t> std::wofstream

Class for `wchar_t` output file streams.

Definition at line 209 of file iosfwd.

## wospanstream

using std::wospanstream

Definition at line 250 of file iosfwd.

## wostream

typedef basic_ostream<wchar_t> std::wostream

Base class for `wchar_t` output streams.

Definition at line 185 of file iosfwd.

## wostringstream

typedef basic_ostringstream<wchar_t> std::wostringstream

Class for `wchar_t` output memory streams.

Definition at line 197 of file iosfwd.

## wosyncstream

using std::wosyncstream

Definition at line 228 of file iosfwd.

## wspanbuf

using std::wspanbuf

Definition at line 248 of file iosfwd.

## wspanstream

using std::wspanstream

Definition at line 251 of file iosfwd.

## wstreambuf

typedef basic_streambuf<wchar_t> std::wstreambuf

Base class for `wchar_t` buffers.

Definition at line 179 of file iosfwd.

## wstringbuf

typedef basic_stringbuf<wchar_t> std::wstringbuf

Class for `wchar_t` memory buffers.

Definition at line 191 of file iosfwd.

## wstringstream

typedef basic_stringstream<wchar_t> std::wstringstream

Class for `wchar_t` mixed input and output memory streams.

Definition at line 200 of file iosfwd.

## wsyncbuf

using std::wsyncbuf

Definition at line 227 of file iosfwd.