
std::basic_ofstream
文章平均质量分 83
C++标准库模板(STL)-输入/输出库 -std::basic_ofstream
繁星璀璨G
单身,求对象
展开
-
c++11 标准模板(STL)(std::basic_ofstream)(五)
关闭关联文件。等效地调用 rdbuf()->close() 。若操作期间出现错误,则调用 setstate(failbit) 。为 std::basic_ofstream 特化 std::swap 算法。交换 lhs 与 rhs 的状态。等效地调用 lhs.swap(rhs) 。原创 2023-08-07 08:30:00 · 156 阅读 · 0 评论 -
c++11 标准模板(STL)(std::basic_ofstream)(四)
检查文件流是否有关联文件。等效地调用 rdbuf()->is_open() 。将名为 filename 的文件打开并与文件流关联。失败时调用 setstate(failbit) 。原创 2023-08-06 08:30:00 · 213 阅读 · 0 评论 -
c++11 标准模板(STL)(std::basic_ofstream)(三)
移动赋值文件流 other 给 *this ,等效地移动赋值 std::basic_ostream 基类和关联的 std::basic_filebuf 。将 other 置为无关联文件。注意基类移动赋值交换 *this 与 other 间的所有流状态变量(除了 rdbuf )。交换流与 other 的状态。返回指向底层未处理文件设备对象的指针。原创 2023-08-05 08:30:00 · 255 阅读 · 0 评论 -
c++11 标准模板(STL)(std::basic_ofstream)(二)
构造新的文件流。1) 默认构造函数:构造不关联到文件的流:2-3) 首先,进行同默认构造函数的步骤4-5) 同 basic_ofstream(filename.c_str(), mode) 。6) 移动构造函数:首先,从 other 移动构造基类(这不影响 rdbuf() 指针),7) 复制构造函数被删除:此类不可复制。原创 2023-08-04 08:30:00 · 480 阅读 · 0 评论 -
c++11 标准模板(STL)(std::basic_ofstream)(一)
类模板 basic_ofstream 实现文件上基于流的高层输出操作。它将 std::basic_ostream 的高层接口赋予基于文件的流缓冲( std::basic_filebuf )。std::basic_ofstream 典型实现只保有一个非导出成员: std::basic_filebuf 的实例。原创 2023-08-03 08:30:00 · 220 阅读 · 0 评论