bsl::basic_stringbuf::pbackfail

pbackfail overloads

Synopses

Declared in <bslstl_stringbuf.h>

Tries to back up the input sequence.

virtual
int_type
pbackfail(int_type __c = traits_type::eof());
» more...

Put back the specified character into the input sequence so that the next character read from the input sequence will be character. If character is either traits_type::eof() or is the same as the previously read character from the input sequence, then adjust the current input position, gptr, back one position. If character is neither traits_type::eof() nor the character previously read from the input sequence, but this string buffer was opened for writing (ios_base::out), then adjust the input sequence back one position and write character to that position. Return the character that was put back on success and traits_type::eof() if either the input position is currently at the beginning of the sequence or if the previous character in the input sequence is not character and this buffer was not opened for writing.

virtual
basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::int_type
pbackfail(int_type character = traits_type::eof());
» more...

Return Value

eof() on failure, some other value on success

Parameters

NameDescription
__cThe character to be inserted back into the sequence.

Postconditions

  • The constraints of gptr(), eback(), and pptr() are the same as for underflow().