|
typedef basic_filebuf< char_type, traits_type > | __filebuf_type |
|
typedef basic_ios< char_type, traits_type > | __ios_type |
|
typedef basic_iostream< char_type, traits_type > | __iostream_type |
|
typedef basic_istream< _CharT, _Traits > | __istream_type |
|
typedef basic_ostream< _CharT, _Traits > | __ostream_type |
|
typedef _CharT | char_type |
|
typedef traits_type::int_type | int_type |
|
typedef traits_type::off_type | off_type |
|
typedef traits_type::pos_type | pos_type |
|
typedef _Traits | traits_type |
|
template<typename _CharT, typename _Traits>
class std::basic_fstream< _CharT, _Traits >
Controlling input and output for files.
- Template Parameters
-
_CharT | Type of character stream. |
_Traits | Traits for character type, defaults to char_traits<_CharT>. |
This class supports reading from and writing to named files, using the inherited functions from std::basic_iostream. To control the associated sequence, an instance of std::basic_filebuf is used, which this page refers to as sb
.
Definition at line 862 of file fstream.
template<typename _CharT , typename _Traits >
Opens an external file.
- Parameters
-
__s | The name of the file. |
__mode | The open mode flags. |
Calls std::basic_filebuf::open(__s,__mode)
. If that function fails, failbit
is set in the stream's error state.
Tip: When using std::string to hold the filename, you must use .c_str() before passing it to this constructor.
Definition at line 1001 of file fstream.