3rdParty/boost/1.78.0/libs/iostreams/doc/classes/file.html
The class templates basic_file_source, basic_file_sink and basic_file are wrappers for std::basic_filebuf which are CopyConstructible and Assignable. They are useful whenever one wants to access a file without managing the lifetime of a standard file stream or stream buffer. This is because when a stream or stream buffer is added to a filtering_streambuf or filtering_stream it is stored as a reference which must remain valid until that stream or stream buffer is removed from the chain.
The most common specializations are accessible via the typedefs file_source, file_sink, file, wfile_source, wfile_sink and wfile.
<boost/iostreams/device/file.hpp>
basic_file_sourceCopyConstructible and Assignable wrapper for a std::basic_filebuf opened in read-only mode.
namespaceboost {namespaceiostreams {template<typename[Ch](#basic_file_source_params)>class[basic\_file\_source](#basic_file_source_params){public:typedefCh char_type;typedefimplementation-definedcategory;[basic\_file\_source](#basic_file_source_constructor)(conststd::string& path,
std::ios_base::openmode mode =
std::ios_base::in );bool[is\_open](#basic_file_source_is_open)()const;...};typedefbasic_file_source<char>file\_source;typedefbasic_file_source<wchar\_t>wfile\_source;
} }// End namespace boost::iostreams
| Ch | - | The character type. | | | |
basic_file_source::basic_file_sourcebasic_file_source(conststd::string& path,
std::ios_base::openmode mode );
Constructs a basic_file_source which wraps a std::basic_filebuf buf opened as follows:
mode |= std::ios_base::in;
mode &= ~std::ios_base::out;
buf.open(path.c_str(), mode);
basic_file_source::is_openboolis_open()const;
Returns true if the underlying instance of basic_filebuf was opened successfully.
basic_file_sinkCopyConstructible and Assignable wrapper for a std::basic_filebuf opened in write-only mode.
namespaceboost {namespaceiostreams {template<typename[Ch](#basic_file_sink_params)>class[basic\_file\_sink](#basic_file_sink_params){public:typedefCh char_type;typedefimplementation-definedcategory;[basic\_file\_sink](#basic_file_sink_constructor)(conststd::string& path,
std::ios_base::openmode mode =
std::ios_base::out );bool[is\_open](#basic_file_sink_is_open)()const;...};typedefbasic_file_sink<char>file\_sink;typedefbasic_file_sink<wchar\_t>wfile\_sink;
} }// End namespace boost::iostreams
| Ch | - | The character type. | | | |
basic_file_sink::basic_file_sinkbasic_file_sink(conststd::string& path,
std::ios_base::openmode mode );
Constructs a basic_file_sink which wraps a std::basic_filebuf buf opened as follows:
mode |= std::ios_base::out;
mode &= ~std::ios_base::in;
buf.open(path.c_str(), mode);
basic_file_sink::is_openboolis_open()const;
Returns true if the underlying instance of basic_filebuf was opened successfully.
basic_fileCopyConstructible and Assignable wrapper for a std::basic_filebuf opened in read-write mode by default.
namespaceboost {namespaceiostreams {template<typename[Ch](#basic_file_params)>class[basic\_file](#basic_file_params){public:typedefCh char_type;typedefimplementation-definedcategory;[basic\_file](#basic_file_constructor)(conststd::string& path,
std::ios_base::openmode mode =
std::ios_base::in | std::ios_base::out );bool[is\_open](#basic_file_is_open)()const;...};typedefbasic_file<char>file;typedefbasic_file<wchar\_t>wfile;
} }// End namespace boost::iostreams
| Ch | - | The character type. | | | |
basic_file_::basic_filebasic_file(conststd::string& path,
std::ios_base::openmode mode );
Constructs a basic_file which wraps a std::basic_filebuf buf opened as follows:
mode |= std::ios_base::in | std::ios_base::out;
buf.open(path.c_str(), mode);
basic_file::is_openboolis_open()const;
Returns true if the underlying instance of basic_filebuf was opened successfully.
© Copyright 2008 CodeRage, LLC
© Copyright 2004-2007 Jonathan Turkanis
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)