<fstream>

定义若干类,这些类支持在存储于外部文件中的序列上的 iostreams 操作。

语法

#include <fstream>

Typedef

类型名称 说明
filebuf 专用于 char 模板参数的类型 basic_filebuf
fstream 专用于 char 模板参数的类型 basic_fstream
ifstream 专用于 char 模板参数的类型 basic_ifstream
ofstream 专用于 char 模板参数的类型 basic_ofstream
wfstream 专用于 wchar_t 模板参数的类型 basic_fstream
wifstream 专用于 wchar_t 模板参数的类型 basic_ifstream
wofstream 专用于 wchar_t 模板参数的类型 basic_ofstream
wfilebuf 专用于 wchar_t 模板参数的类型 basic_filebuf

说明
basic_filebuf 该类模板描述对 Elem 类型的元素(其字符特征由类 Tr 确定)与外部文件中存储的元素序列之间的来回传输进行控制的流缓冲区。
basic_fstream 类模板描述了一个对象,该对象使用类 basic_filebuf<Elem, Tr> 的流缓冲区来控制元素和编码对象的插入和提取,该流缓冲区具有 Elem 类型的元素,其字符特征由类 Tr 确定。
basic_ifstream 类模板描述了一个对象,该对象从类 basic_filebuf<Elem, Tr> 的流缓冲区控制元素和编码对象的提取,该流缓冲区具有 Elem 类型的元素,其字符特征由类 Tr 确定。
basic_ofstream 类模板描述了一个对象,该对象控制到类 basic_filebuf<Elem, Tr> 的流缓冲区的元素和编码对象的插入,该流缓冲区具有 Elem 类型的元素,其字符特征由类 Tr 确定。

另请参阅

头文件引用
C++ 标准库中的线程安全
iostream 编程
iostreams 约定