Standard C++ Library Reference ISO/IEC (VERSION3)
successive calls of the form fputc(ch, fp). If any conversion or write fails, the
function does not succeed.
If the function cannot succeed, it returns traits_type::eof(). Otherwise, it returns
traits_type::not_eof(meta).
basic_filebuf::pbackfail
virtual int_type pbackfail(int_type meta =
traits_type::eof());
The protected virtual member function endeavors to put back an element into the input buffer,
then make it the current element (pointed to by the next pointer). If meta ==
traits_type::eof(), the element to push back is effectively the one already in the stream
before the current element. Otherwise, that element is replaced by ch =
traits_type::to_char_type(meta). The function can put back an element in various
ways:
If a putback position is available, and the element stored there compares equal to ch, it
can simply decrement the next pointer for the input buffer.
●
If the function can make a putback position available, it can do so, set the next pointer to
point at that position, and store ch in that position.
●
If the function can push back an element onto the input stream, it can do so, such as by
calling ungetc for an element of type char.
●
If the function cannot succeed, it returns traits_type::eof(). Otherwise, it returns
traits_type::not_eof(meta).
basic_filebuf::pos_type
typedef typename traits_type::pos_type pos_type;
The type is a synonym for traits_type::pos_type.
basic_filebuf::seekoff
virtual pos_type seekoff(off_type off,
ios_base::seekdir way,
ios_base::openmode which =
ios_base::in | ios_base::out);
The protected virtual member function endeavors to alter the current positions for the controlled
streams. For an object of class basic_filebuf<Elem, Tr>, a stream position can be
represented by an object of type fpos_t, which stores an offset and any state information
needed to parse a wide stream. Offset zero designates the first element of the stream. (An object