BloombergLP::bdlde::Utf8CheckingInStreamBufWrapper::pbackfail

Put back one byte of input, optionally substituting a character.

Synopsis

Declared in <bdlde_utf8checkinginstreambufwrapper.h>

virtual
int_type
pbackfail(int_type c = traits_type::eof()) override;

Description

Back up input one byte. Return the byte at the new position, or eof with the state of this object unchanged on failure. If the optionally specified c is not eof, substitute c for the previous byte and return that value. If c is eof, do not substitute it for the previous byte and return the byte was there, or if the previous byte is unknown, fail. If values of c that are not eof are specified, this function will succeed for at least 8 successive calls, possibly many more times. The behavior is undefined unless c is either eof or a value representable as a char_type. Note that this is forwarded to with a char_type passed to c by the public method sputbackc in the base class, and called with eof passed to c by the public method sungetc in the base class.

Return Value

the byte at the new position, or eof on failure

Parameters

NameDescription
ccharacter to substitute for the previous byte, or eof to leave the previous byte unchanged