![]() |
boost::filesystem::basic_fstream — Input/output file stream class template.
// In header: <boost/filesystem/fstream.hpp> template<typename Char, typename Traits = std::char_traits< Char > > class basic_fstream : public std::basic_fstream< Char, std::char_traits< Char > > { public: // public member functions basic_fstream() = default; explicit basic_fstream(path const &, std::ios_base::openmode = std::ios_base::in|std::ios_base::out); basic_fstream(basic_fstream &&); basic_fstream & operator=(basic_fstream &&); basic_fstream(basic_fstream const &) = delete; basic_fstream const & operator=(basic_fstream const &) = delete; void open(path const &, std::ios_base::openmode = std::ios_base::in|std::ios_base::out); };
The class template is equivalent to std::basic_fstream from <fstream> with the only difference being that the constructors and open methods accept path as the first argument.
basic_fstream public member functionsbasic_fstream() = default;
explicit basic_fstream(path const & p, std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out);Constructs a stream and opens a file identified by
p. This method is equivalent to the std::basic_fstream 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_fstream 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_fstream 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_fstream(basic_fstream && that);
basic_fstream & operator=(basic_fstream && that);
basic_fstream(basic_fstream const &) = delete;
basic_fstream const & operator=(basic_fstream const &) = delete;
void open(path const & p, std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out);Opens a file identified by
p. This method is equivalent to std::basic_fstream::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_fstream 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_fstream::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: |
|