std::basic_filebuf::showmanyc
来自cppreference.com
< cpp | io | basic filebuf
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
protected: virtual std::streamsize showmanyc() |
||
如果付诸实施,将返回到从文件中读取的字符数.
原文:
If implemented, returns the number of characters left to read from the file.
目录 |
[编辑] 参数
(无)
[编辑] 返回值
的字符数可用于读取文件,或-1如果最终文件达成了.
原文:
The number of characters available for reading from the file, or -1 if the end of file was reached.
[编辑] 注释
此功能是可选的。如果不执行,这个函数返回0(因为被调用基类版本std::basic_streambuf::showmanyc)
原文:
This function is optional. If not implemented, this function returns 0 (since the base class version std::basic_streambuf::showmanyc gets called)
无论实施与否,此功能通常被称为std::basic_streambuf::in_avail,,如果get区是空的.
原文:
Whether implemented or not, this function is normally called by std::basic_streambuf::in_avail if the get area is empty.
[编辑] 示例
执行测试以查看是否实施filebuf showmanyc()
原文:
implementation test to see if showmanyc() is implemented for filebuf
#include <fstream> #include <iostream> struct mybuf : std::filebuf { using std::filebuf::showmanyc; }; int main() { mybuf fin; fin.open("test.in", std::ios_base::in); std::cout << "showmanyc() returns " << fin.showmanyc() << '\n'; }
输出:
showmanyc() returns 6626
[编辑] 另请参阅
立即可用的字符在get区域获得的数目 原文: obtains the number of characters immediately available in the get area (公共成员函数of std::basic_streambuf )
| |
提取已经可用块的字符 原文: extracts already available blocks of characters (公共成员函数of std::basic_istream )
|