BloombergLP::bdls::FdStreamBuf::pbackfail

If the optionally specified c is not given, move the current input position back one character and return the character at that position. Otherwise specify a value for c other than traits_type::eof. If c is equal to the previous character in the read buffer, the behavior is the same as if eof() was passed. If c is not eof and is not equal to the previous character in the putback buffer push the character c is back into the input buffer, if possible. Return the backed up character on success and traits_type::eof() otherwise. If the input buffer is readonly, or gptr() is already at the beginning of the input buffer, this object enters INPUT_PUTBACK_MODE and c is stuffed back into the putback buffer. Note that only PBACK_BUF_SIZE characters can be backed up into the putback buffer, if this limit is exceeded, traits_type::eof() will be returned. Also note that this method is called by public methods sputbackc or sungetc in the base class, and only when simply decrementing the current position in the input buffer won't satisfy the request, either because c doesn't match the previously input character, or because the input position is already at the beginning of the input buffer.

Synopsis

Declared in <bdls_fdstreambuf.h>

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