Inheritance diagram for std::basic_fstream< _CharT, _Traits >:
Public Types | |
typedef _CharT | char_type |
typedef _Traits | traits_type |
typedef traits_type::int_type | int_type |
typedef traits_type::pos_type | pos_type |
typedef traits_type::off_type | off_type |
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 |
Public Member Functions | |
basic_fstream () | |
Default constructor. | |
basic_fstream (const char *__s, ios_base::openmode __mode=ios_base::in|ios_base::out) | |
Create an input/output file stream. | |
~basic_fstream () | |
The destructor does nothing. | |
__filebuf_type * | rdbuf () const |
Accessing the underlying buffer. | |
bool | is_open () |
Wrapper to test for an open file. | |
void | open (const char *__s, ios_base::openmode __mode=ios_base::in|ios_base::out) |
Opens an external file. | |
void | close () |
Close the file. | |
Private Attributes | |
__filebuf_type | _M_filebuf |
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 725 of file fstream.
|
|
|
Reimplemented from std::basic_istream< _CharT, _Traits >. |
|
Definition at line 738 of file fstream. Referenced by std::basic_fstream< _CharT, _Traits >::basic_fstream(). |
|
These are standard types. They permit a standardized way of referring to names of (or names dependant on) the template parameters, which are specific to the implementation. Reimplemented from std::basic_iostream< _CharT, _Traits >. |
|
Reimplemented from std::basic_iostream< _CharT, _Traits >. |
|
Reimplemented from std::basic_iostream< _CharT, _Traits >. |
|
Reimplemented from std::basic_iostream< _CharT, _Traits >. |
|
Reimplemented from std::basic_iostream< _CharT, _Traits >. |
|
Default constructor.
Initializes Definition at line 757 of file fstream. References std::basic_fstream< _CharT, _Traits >::__iostream_type, and std::basic_ios< _CharT, _Traits >::init(). |
|
Create an input/output file stream.
Definition at line 770 of file fstream. References std::basic_fstream< _CharT, _Traits >::__iostream_type, std::basic_ios< _CharT, _Traits >::init(), std::basic_fstream< _CharT, _Traits >::open(), and std::ios_base::openmode. |
|
The destructor does nothing. The file is closed by the filebuf object, not the formatting stream. |
|
Close the file.
Calls Definition at line 831 of file fstream. References std::basic_ios< _CharT, _Traits >::setstate(). |
|
Wrapper to test for an open file.
|
|
Opens an external file.
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 817 of file fstream. References std::ios_base::openmode, and std::basic_ios< _CharT, _Traits >::setstate(). Referenced by std::basic_fstream< _CharT, _Traits >::basic_fstream(). |
|
Accessing the underlying buffer.
Reimplemented from std::basic_ios< _CharT, _Traits >. |
|
|