Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
Miscellaneous
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
streambuf
streambuf::streambuf
streambuf::~streambuf
public members:
streambuf::getloc
streambuf::in_avail
streambuf::pubimbue
streambuf::pubseekoff
streambuf::pubseekpos
streambuf::pubsetbuf
streambuf::pubsync
streambuf::sbumpc
streambuf::sgetc
streambuf::sgetn
streambuf::snextc
streambuf::sputbackc
streambuf::sputc
streambuf::sputn
streambuf::sungetc
protected members:
streambuf::eback
streambuf::egptr
streambuf::epptr
streambuf::gbump
streambuf::gptr
streambuf::pbase
streambuf::pbump
streambuf::pptr
streambuf::setg
streambuf::setp
virtual prot. members:
streambuf::imbue
streambuf::overflow
streambuf::pbackfail
streambuf::seekoff
streambuf::seekpos
streambuf::setbuf
streambuf::showmanyc
streambuf::sync
streambuf::uflow
streambuf::underflow
streambuf::xsgetn
streambuf::xsputn


streambuf::uflow

virtual protected member function
int uflow ( );

Get character in the case of underflow and advance get pointer

For the purpose of the streambuf class, 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 no more characters are apparently 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. In this case, the function returns the new character pointed by the get pointer and advances it one position. 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 is a virtual member function that can be overriden for a specific behavior in derived classes. Its default behavior in streambuf is to call its sibling virtual member function underflow and return its value and advance the get pointer in case of success, or return EOF (or traits::eof() for other traits) otherwise.

This protected member function is automatically called by sbumpc and snextc member functions when underflows happen.

The behavior of this member function is the same as the one of underflow except that this function also advances the get pointer by one position.

The derived class filebuf overrides this virtual member function (see filebuf::uflow).

Parameters

none

Return Value

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

Basic template member declaration

( basic_streambuf<charT,traits> )
1
2
typedef traits::int_type int_type;
int_type uflow ( );


See also.