| I/O manipulators | ||||
| Print functions(C++23) | ||||
| C-style I/O | ||||
| Buffers | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++20) | ||||
| Streams | ||||
| Abstractions | ||||
| File I/O | ||||
| String I/O | ||||
| Array I/O | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
| Synchronized Output | ||||
(C++20) | ||||
| Types | ||||
| Error category interface | ||||
(C++11) | ||||
(C++11) |
| Public member functions | ||||
(C++11) | ||||
(C++11) | ||||
(C++26) | ||||
| Protected member functions | ||||
basic_filebuf::showmanyc | ||||
| Non-member functions | ||||
(C++11) |
protected: virtualstd::streamsize showmanyc() | (optional) | |
If implemented, returns the number of characters left to read from the file.
Contents |
The number of characters available for reading from the file, or-1 if the end of file was reached.
This function is optional. If not implemented, this function returns0 (since the base class versionstd::basic_streambuf::showmanyc gets called).
Whether implemented or not, this function is normally called bystd::basic_streambuf::in_avail if the get area is empty.
The name of this function stands for “stream: how manycharacters?”, so it is pronounced “S how manyC", rather than “show many C”.
An implementation test to see ifshowmanyc() is implemented forstd::filebuf.
#include <fstream>#include <iostream> struct mybuf:std::filebuf{using std::filebuf::showmanyc;}; int main(){ mybuf fin; fin.open("main.cpp",std::ios_base::in);std::cout<<"showmanyc() returns "<< fin.showmanyc()<<'\n';}
Possible output:
showmanyc() returns 254
| obtains the number of characters immediately available in the get area (public member function of std::basic_streambuf<CharT,Traits>)[edit] | |
| extracts already available blocks of characters (public member function of std::basic_istream<CharT,Traits>)[edit] |