![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
std::basic_fstream
文章平均质量分 84
C++标准库模板(STL)-输入/输出库 -std::basic_fstream
繁星璀璨G
单身,求对象
展开
-
c++11 标准模板(STL)(std::basic_fstream)(二)
构造新的文件流。 1) 默认构造函数:构造不关联到文件的流: 2-3) 首先,进行同默认构造函数的步骤, 4-5) 同 basic_fstream(filename.c_str(), mode) 。 6) 移动构造函数:首先,从 other 移动构造基类(这不影响 rdbuf() 指针), 7) 复制构造函数被删除:此类不可复制。原创 2023-08-09 08:30:00 · 164 阅读 · 0 评论 -
c++11 标准模板(STL)(std::basic_fstream)(四)
将名为 filename 的文件打开并与文件流关联。失败时调用 setstate(failbit) 。 检查文件流是否有关联文件。等效地调用 rdbuf()->is_open() 。原创 2023-08-11 08:30:00 · 127 阅读 · 0 评论 -
c++11 标准模板(STL)(std::basic_fstream)(三)
移动赋值文件流 other 给 *this ,等效地移动赋值 std::basic_iostream 基类和关联的 std::basic_filebuf 。 交换流与 other 的状态。通过调用 basic_iostream::swap(other) 和 rdbuf()->swap(other.rdbuf()) 进行。 返回指向底层未处理文件设备对象的指针。原创 2023-08-10 03:30:00 · 167 阅读 · 0 评论 -
c++11 标准模板(STL)(std::basic_fstream)(一)
类模板 basic_fstream 实现基于文件的流上的高层输入/输出。它将 std::basic_iostream 的高层接口赋予基于文件的缓冲( std::basic_filebuf )。 std::basic_fstream 的典型实现只保有一个非导出数据成员: std::basic_filebuf 的实例。原创 2023-08-08 08:30:00 · 143 阅读 · 0 评论 -
c++11 标准模板(STL)(std::basic_fstream)(五)
关闭关联文件。等效地调用 rdbuf()->close() 。若操作期间出现错误,则调用 setstate(failbit) 。 为 std::basic_fstream 特化 std::swap 算法。交换 lhs 与 rhs 的状态。等效地调用 lhs.swap(rhs) 。原创 2023-08-12 08:30:00 · 178 阅读 · 0 评论