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. The new position is determined as follows:
way == ios_base::
beg
, the new position is the beginning of the stream plus off
. way == ios_base::
cur
, the new position is the current stream position plus off
. way == ios_base::
end
, the new position is the end of the stream plus off
. Typically, if which & ios_base::in
is nonzero, the input stream is affected, and if which & ios_base::out
is
nonzero, the output stream is affected. Actual use of this parameter varies among derived stream buffers, however.
If the function succeeds in altering the stream position(s), it returns the resultant stream position (or one of them). Otherwise, it returns an invalid stream position. The default behavior is to return an invalid stream position.