cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : IOstream Library : filebuf : underflow
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forum
Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
IOstream Library
manipulators
classes:
· filebuf
· fstream
· ifstream
· ios
· iostream
· ios_base
· istream
· istringstream
· ofstream
· ostream
· ostringstream
· streambuf
· stringbuf
· stringstream
objects:
· cerr
· cin
· clog
· cout
types:
· fpos
· streamoff
· streampos
· streamsize
filebuf
· filebuf::filebuf
· filebuf::~filebuf
member functions:
· filebuf::close
· filebuf::is_open
· filebuf::open
virtual members:
· filebuf::imbue
· filebuf::overflow
· filebuf::pbackfail
· filebuf::seekoff
· filebuf::seekpos
· filebuf::setbuf
· filebuf::showmanyc
· filebuf::sync
· filebuf::uflow
· filebuf::underflow

-

filebuf::underflow virtual protected member function
int underflow ( );

Get character in the case of underflow

For the purpose of stream buffers, underflows happen when a new character is to be read at the get pointer gptr, but this has reached the end pointer egptr, indicating that apparently no more characters are available in the internal input array.

This function is expected to modify the eback, gptr and egptr pointers that define the internal input array in such a way that if there are more characters available in the controlled input sequence after the location represented by streambuf::egptr, at least some of them are made available through this internal input array and the new character available at the get pointer's position itself is returned. Otherwise, if there are no more characters available in the controlled input sequence after the one represented by egptr, the function returns EOF (or traits::eof() for other traits).

This member function overrides the inherited virtual member streambuf::underflow.

The behavior of this member function is similar to that of uflow except that the get pointer is not advanced.

Parameters

none

Return Value

The new character available at the get pointer position, if any. Otherwise, EOF (or traits::eof() for other traits) is returned.

Basic template member declaration

( basic_filebuf<charT,traits> )
typedef traits::int_type int_type;
int_type underflow ( );

See also.

filebuf::uflow Get character in the case of underflow and advance get pointer (virtual protected member function)
streambuf::sgetc Get current character (public member function)

© The C++ Resources Network, 2000-2007 - All rights reserved
Spotted an error? - contact us