Standard C++ Library Reference ISO/IEC (VERSION3)
public:
basic_filebuf<Elem, Tr> *rdbuf() const;
basic_ofstream();
explicit basic_ofstream(const char *filename,
ios_base::openmode mode = ios_base::out);
bool is_open() const;
void open(const char *filename,
ios_base::openmode mode = ios_base::out);
void close();
};
The template class describes an object that controls insertion of elements and encoded objects
into a stream buffer of class basic_filebuf<Elem, Tr>, with elements of type Ele,
whose character traits are determined by the class Tr. The object stores an object of class
basic_filebuf<Elem, Tr>.
basic_ofstream::basic_ofstream
basic_ofstream();
explicit basic_ofstream(const char *filename,
ios_base::openmode which = ios_base::out);
The first constructor initializes the base class by calling basic_ostream(sb), where sb is
the stored object of class basic_filebuf<Elem, Tr>. It also initializes sb by calling
basic_filebuf<Elem, Tr>().
The second constructor initializes the base class by calling basic_ostream(sb). It also
initializes sb by calling basic_filebuf<Elem, Tr>(), then sb.open(filename,
mode | ios_base::out). If the latter function returns a null pointer, the constructor calls
setstate(failbit).
basic_ofstream::close
void close();
The member function calls rdbuf()-> close().
basic_ofstream::is_open
bool is_open();
The member function returns rdbuf()-> is_open().