std::iostream
Input/output stream
[NOTE: 这里是 iostream 类,若想了解 iostream 库,请看 Input/Output library.]
该类内部所有成员继承自 istream类和 ostream类,因此能进行输入和输出的操作。
该类依赖于单一 streambuf 对象进行输入输出操作。
该类保存一个继承自ios_base, ios and istream的内部字段集合。
公共成员函数继承自 istream
(public member function )
提取格式化输入
获取字符串长度,统计char字符数量
从流中提取字符,作为未格式化的输入
从流中提取字符直到遇到分隔字符
提取特定字符并丢弃
提取下一个字符,并放回
提取若干个字符并存入数组
从缓冲区提取若干个字符并存入数组
Put character back (public member function )
Unget character (public member function )
返回输入流中当前字符的位置
设置要从输入流中提取的下一个字符的位置
从标准输入的字符buffer中删除任何未读的字符
公共成员函数继承自 ostream
(public member function )
插入格式化输出
将字符c插入流中
将s指向的数组的前n个字符插入到流中
获取要将下一个字符插入输出流的位置
设置要将下一个字符插入输出流的位置
刷新输出流缓冲区
公共成员函数继承自 ios
(public member function )
检查 stream 的状态是否正常
检查是否设置了eofbit,即是否正常读到文件结尾
检查是否设置了failbit或badbit,即非正常结束
检查是否设置了badbit,即非正常结束
评估流打开状态,如果返回为true即设置了failbit或badbit
operator bool (C++11)
评估流打开状态,如果返回为true即设置了goodbit
获取错误状态flags
设置错误状态flag
清除flags
复制对应格式信息
获取/设置填充字符
Get/set exceptions mask (public member function )
Imbue locale (public member function )
Get/set tied stream (public member function )
Get/set stream buffer (public member function )
Narrow character (public member function )
Widen character (public member function )
公共成员函数继承自 ios_base
(public member function )
获取/设置格式标志
设置特定格式标志
清除特定格式标志
获取/设置浮点小数精度
获取/设置字段宽度
Imbue locale (public member function )
Get current locale (public member function )
Get new index for extensible array [static] (public static member function )
Get integer element of extensible array (public member function )
Get pointer element of extensible array (public member function )
Register event callback function (public member function )
Toggle synchronization with cstdio streams [static] (public static member function )