cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : IOstream Library : filebuf : pbackfail
- -
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::pbackfail virtual protected member
int pbackfail ( int c = EOF );

Put character back on backup underflow

If the parameter c is EOF and the get pointer is not at the beginning of the character sequence, the get pointer is decreased by one.

If the parameter c is a value other than EOF and the get pointer is not at the beginning of the character sequence, c replaces the character at the putback position in the controlled input sequence. This character replacement only happens in the internal controlled input sequence and affects the values returned by at least the next input operation, but the contents of the file are not modified because of this operation.

This member function overrides the virtual member streambuf::pbackfail, which is called by other member functions of streambuf.

Parameters

c
Character to be put back, or EOF (or traits::eof() for other traits) to keep the existing character at that position.

Return Value

The function returns EOF (or traits::eof() for other traits) if it failed and therefore the get pointer was not modified.

A value different from EOF (or traits::eof() for other traits) is returned to indicate success. If c was specified, the value returned on success is c.

Basic template member declaration

( basic_filebuf<charT,traits,Allocator> )
typedef traits::int_type int_type;
int_type pbackfail ( int_type c = traits::eof() );

See also

filebuf::underflow Get character in the case of underflow (virtual protected member function)

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