fstream
标准库标头<fstream>
此标头是输入/输出图书馆。
班
*。
基本[医]filebuf实现原始文件设备%28类模板%29
基本[医]如果流实现高级文件流输入操作%28类模板%29
基本[医]实现高级文件流输出操作%28类模板%29
基本[医]fstream实现高级文件流输入/输出%28类模板%29。
台培
filebuf基[医]菲尔布夫<char>
Wfilebuf基[医]filebuf<wchar[医]T>
IFFREABASIC[医]如果流<char>
Wifstream Basic[医]ifstream<wchar[医]T>
流基[医]流<char>
Wofstream Basic[医]流<wchar[医]T>
fstream Basic[医]fstream<char>
Wfstream Basic[医]fstream<wchar[医]T>
功能
STD::交换%28 std::basic[医]filebuf%29%28C++11%29专门开发std::交换算法%28函数模板%29
STD::交换%28 std::basic[医]如果流%29%28C++11%29专门使用std::交换算法%28函数模板%29
STD::交换%28 std::basic[医]Flow%29%28C++11%29专门开发std::交换算法%28函数模板%29
STD::交换%28 std::basic[医]fstream%29%28C++11%29专门开发std::交换算法%28函数模板%29
简介
二次
namespace std {
template <class charT, class traits = char_traits<charT> >
class basic_filebuf;
typedef basic_filebuf<char> filebuf;
typedef basic_filebuf<wchar_t> wfilebuf;
template <class charT, class traits>
void swap(basic_filebuf<charT, traits>& x,
basic_filebuf<charT, traits>& y
template <class charT, class traits = char_traits<charT> >
class basic_ifstream;
typedef basic_ifstream<char> ifstream;
typedef basic_ifstream<wchar_t> wifstream;
template <class charT, class traits>
void swap(basic_ifstream<charT, traits>& x,
basic_ifstream<charT, traits>& y
template <class charT, class traits = char_traits<charT> >
class basic_ofstream;
typedef basic_ofstream<char> ofstream;
typedef basic_ofstream<wchar_t> wofstream;
template <class charT, class traits>
void swap(basic_ofstream<charT, traits>& x,
basic_ofstream<charT, traits>& y
template <class charT, class traits = char_traits<charT> >
class basic_fstream;
typedef basic_fstream<char> fstream;
typedef basic_fstream<wchar_t> wfstream;
template <class charT, class traits>
void swap(basic_fstream<charT, traits>& x,
basic_fstream<charT, traits>& y
}
二次
类std::basic_filebuf
二次
template <class charT, class traits = char_traits<charT> >
class basic_filebuf : public basic_streambuf<charT,traits> {
public:
typedef charT char_type;
typedef typename traits::int_type int_type;
typedef typename traits::pos_type pos_type;
typedef typename traits::off_type off_type;
typedef traits traits_type;
// Constructors/destructor:
basic_filebuf(
basic_filebuf(const basic_filebuf& rhs) = delete;
basic_filebuf(basic_filebuf&& rhs
virtual ~basic_filebuf(
// Assign/swap:
basic_filebuf& operator=(const basic_filebuf& rhs) = delete;
basic_filebuf& operator=(basic_filebuf&& rhs
void swap(basic_filebuf& rhs
// Members:
bool is_open() const;
basic_filebuf<charT,traits>* open(const char* s, ios_base::openmode mode
basic_filebuf<charT,traits>* open(const string& s, ios_base::openmode mode
basic_filebuf<charT,traits>* close(
protected:
// Overridden virtual functions:
virtual streamsize showmanyc(
virtual int_type underflow(
virtual int_type uflow(
virtual int_type pbackfail(int_type c = traits::eof()
virtual int_type overflow (int_type c = traits::eof()
virtual basic_streambuf<charT,traits>* setbuf(char_type* s, streamsize n
virtual pos_type seekoff(off_type off, ios_base::seekdir way,
ios_base::openmode which = ios_base::in|ios_base::out
virtual pos_type seekpos(pos_type sp,
ios_base::openmode which = ios_base::in|ios_base::out
virtual int sync(
virtual void imbue(const locale& loc
};
二次
类std::basic_ifstream
二次
template <class charT, class traits = char_traits<charT> >
class basic_ifstream : public basic_istream<charT,traits> {
public:
typedef charT char_type;
typedef typename traits::int_type int_type;
typedef typename traits::pos_type pos_type;
typedef typename traits::off_type off_type;
typedef traits traits_type;
// Constructors:
basic_ifstream(
explicit basic_ifstream(const char* s, ios_base::openmode mode = ios_base::in
explicit basic_ifstream(const string& s, ios_base::openmode mode = ios_base::in
basic_ifstream(const basic_ifstream& rhs) = delete;
basic_ifstream(basic_ifstream&& rhs
// Assign/swap:
basic_ifstream& operator=(const basic_ifstream& rhs) = delete;
basic_ifstream& operator=(basic_ifstream&& rhs
void swap(basic_ifstream& rhs
// Members:
basic_filebuf<charT,traits>* rdbuf() const;
bool is_open() const;
void open(const char* s, ios_base::openmode mode = ios_base::in
void open(const string& s, ios_base::openmode mode = ios_base::in
void close(
private:
basic_filebuf<charT,traits> sb; // exposition only
};
二次
类std::basic_ofstream
二次
template <class charT, class traits = char_traits<charT> >
class basic_ofstream : public basic_ostream<charT,traits> {
public:
typedef charT char_type;
typedef typename traits::int_type int_type;
typedef typename traits::pos_type pos_type;
typedef typename traits::off_type off_type;
typedef traits traits_type;
// Constructors:
basic_ofstream(
explicit basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out
explicit basic_ofstream(const string& s, ios_base::openmode mode = ios_base::out
basic_ofstream(const basic_ofstream& rhs) = delete;
basic_ofstream(basic_ofstream&& rhs
// Assign/swap:
basic_ofstream& operator=(const basic_ofstream& rhs) = delete;
basic_ofstream& operator=(basic_ofstream&& rhs
void swap(basic_ofstream& rhs
// Members:
basic_filebuf<charT,traits>* rdbuf() const;
bool is_open() const;
void open(const char* s, ios_base::openmode mode = ios_base::out
void open(const string& s, ios_base::openmode mode = ios_base::out
void close(
private:
basic_filebuf<charT,traits> sb; // exposition only
};
二次
类std::basic_fstream
二次
template <class charT, class traits=char_traits<charT> >
class basic_fstream : public basic_iostream<charT,traits> {
public:
typedef charT char_type;
typedef typename traits::int_type int_type;
typedef typename traits::pos_type pos_type;
typedef typename traits::off_type off_type;
typedef traits traits_type;
// constructors/destructor
basic_fstream(
explicit basic_fstream(const char* s,
ios_base::openmode mode = ios_base::in|ios_base::out
explicit basic_fstream(const string& s,
ios_base::openmode mode = ios_base::in|ios_base::out
basic_fstream(const basic_fstream& rhs) = delete;
basic_fstream(basic_fstream&& rhs
// Assign/swap:
basic_fstream& operator=(const basic_fstream& rhs) = delete;
basic_fstream& operator=(basic_fstream&& rhs
void swap(basic_fstream& rhs
// Members:
basic_filebuf<charT,traits>* rdbuf() const;
bool is_open() const;
void open(const char* s,
ios_base::openmode mode = ios_base::in|ios_base::out
void open(const string& s,
ios_base::openmode mode = ios_base::in|ios_base::out
void close(
private:
basic_filebuf<charT,traits> sb; // exposition only
};
二次
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。