public member function
<fstream>
Get number of characters available
Returns an estimate on the number of characters available in the associated file.
This function is expected to return zero (providing no information), but library implementations may instead provide information on the possible behavior of future calls to the protected member functions underflow and uflow:
return value | description | expected behavior for underflow and uflow |
>0 | characters known to be available | Successive calls will succeed in retrieving characters until at least as many characters as the value returned have been extracted. |
0 | no information | Further calls may either retrieve more characters or return traits_type::eof() . |
-1 | sequence unavailable | Further calls will fail (either throwing or returning "immediately"). |
This virtual member function overrides the inherited member basic_streambuf::showmanyc, called by member in_avail when there are no read positions available at the get pointer (gptr).
Return Value
Returns zero (if no information is provided).
Library implementations may return a different value to provide additional information.
streamsize is a signed integral type.
Exception safety
Basic guarantee: if an exception is thrown, the file stream buffer is in a valid state.