![]() |
boost::filesystem::basic_ofstream — Output file stream class template.
// In header: <boost/filesystem/fstream.hpp> template<typename Char, typename Traits = std::char_traits< Char > > class basic_ofstream : public std::basic_ofstream< Char, std::char_traits< Char > > { public: // public member functions basic_ofstream() = default; explicit basic_ofstream(path const &, std::ios_base::openmode = std::ios_base::out); basic_ofstream(basic_ofstream &&); basic_ofstream & operator=(basic_ofstream &&); basic_ofstream(basic_ofstream const &) = delete; basic_ofstream const & operator=(basic_ofstream const &) = delete; void open(path const &, std::ios_base::openmode = std::ios_base::out); };
The class template is equivalent to std::basic_ofstream from <fstream> with the only difference being that the constructors and open methods accept path as the first argument.
basic_ofstream public member functionsbasic_ofstream() = default;
explicit basic_ofstream(path const & p, std::ios_base::openmode mode = std::ios_base::out);Constructs a stream and opens a file identified by
p. This method is equivalent to the std::basic_ofstream constructor taking a path string and mode as arguments, except that it accepts path as the first argument. The implementation will attempt to open the file using the native path character encoding, if possible. If std::basic_ofstream implementation does not support opening files using the native path character encoding, the implementation will perform path character code conversion by calling path methods, using the locale facet returned by path::codecvt.
Error Reporting:
C++ standard library and system errors are reported as documented by the std::basic_ofstream constructor. Additionally, an exception may be thrown by one of the path methods as part of character code conversion, if called by the implementation.
Parameters: |
|
basic_ofstream(basic_ofstream && that);
basic_ofstream & operator=(basic_ofstream && that);
basic_ofstream(basic_ofstream const &) = delete;
basic_ofstream const & operator=(basic_ofstream const &) = delete;
void open(path const & p, std::ios_base::openmode mode = std::ios_base::out);Opens a file identified by
p. This method is equivalent to std::basic_ofstream::open, except that it accepts path as the first argument. The implementation will attempt to open the file using the native path character encoding, if possible. If std::basic_ofstream implementation does not support opening files using the native path character encoding, the implementation will perform path character code conversion by calling path methods, using the locale facet returned by path::codecvt.
Error Reporting:
C++ standard library and system errors are reported as documented by std::basic_ofstream::open. Additionally, an exception may be thrown by one of the path methods as part of character code conversion, if called by the implementation.
Parameters: |
|