std::basic_filebuf<CharT,Traits>::basic_filebuf
来自 cppreference.cn
< cpp | io | basic_filebuf
| basic_filebuf(); |
(1) | |
| basic_filebuf( const std::basic_filebuf& rhs ) = delete; |
(2) | (C++11 起) |
| basic_filebuf( std::basic_filebuf&& rhs ); |
(3) | (C++11 起) |
构造新的 std::basic_filebuf 对象。
1) 构造一个
std::basic_filebuf 对象,通过调用 std::basic_streambuf 的默认构造函数初始化基类。创建的 basic_filebuf 未与文件关联,且 is_open() 返回 false。3) 通过移动另一个
std::basic_filebuf 对象 rhs 的所有内容来移动构造一个 std::basic_filebuf 对象,包括缓冲区、关联的文件、区域设置、打开模式、is_open 变量以及所有其他状态。移动后,rhs 未与文件关联,且 rhs.is_open() == false。rhs 的基类 std::basic_streambuf 和 *this 的基类的成员指针保证指向不同的缓冲区(除非为空)。目录 |
[编辑] 参数
| rhs | - | 另一个 basic_filebuf |
[编辑] 注意
通常由 std::basic_fstream 的构造函数调用。
[编辑] 示例
| 本节不完整 原因:无示例 |
[编辑] 参阅
| (C++11) |
赋值一个 basic_filebuf 对象(public 成员函数) |
| [virtual] |
销毁一个 basic_filebuf 对象,如果文件已打开则关闭它(虚 public 成员函数) |