30 Input/output library [input.output]

30.9 File-based streams [file.streams]

30.9.3 Class template basic_Β­ifstream [ifstream]

30.9.3.3 Member functions [ifstream.members]

basic_filebuf<charT, traits>* rdbuf() const;

Returns: const_Β­cast<basic_Β­filebuf<charT, traits>*>(&sb).

bool is_open() const;

Returns: rdbuf()->is_Β­open().

void open(const char* s, ios_base::openmode mode = ios_base::in); void open(const filesystem::path::value_type* s, ios_base::openmode mode = ios_base::in); // wide systems only; see [fstream.syn]

Effects: Calls rdbuf()->open(s, mode | ios_Β­base​::​in). If that function does not return a null pointer calls clear(), otherwise calls setstate(failbit) (which may throw ios_Β­base​::​failure) ([iostate.flags]).

void open(const string& s, ios_base::openmode mode = ios_base::in); void open(const filesystem::path& s, ios_base::openmode mode = ios_base::in);

Effects: Calls open(s.c_Β­str(), mode).

void close();

Effects: Calls rdbuf()->close() and, if that function returns a null pointer, calls setstate(failbit) (which may throw ios_Β­base​::​failure) ([iostate.flags]).