This is a virtual member function that shall be redefined in derived classes to behave as expected by setting the internal pointer specified by which to a position offset off characters relative to the direction way.
Its default behavior in streambuf is to do nothing and return the invalid position -1, but it is redefined in both standard derived classes, filebuf and stringbuf, to behave as expected specifically for each type of buffer (see filebuf::seekoff and stringbuf::seekoff).
Parameters
- off
- Offset value. This is relative to the way parameter.
It is a value of type streamoff. - way
- Object of type ios_base::seekdir. It may take any of the following constant values:
value offset is relative to... ios_base::beg beginning of the stream buffer ios_base::cur current position in the stream buffer ios_base::end end of the stream buffer - which
- Determines which of the internal position pointers shall be modified, either the get pointer (input), the put pointer (output) or both. It is an object of type ios_base::openmode, that may take any combination of the following significant constant values:
value position pointer affected ios_base::in Modify get pointer position ios_base::out Modify put pointer position
Return Value
The new position value of the modified position pointer.Errors are expected to be signaled by an invalid position value, like -1.
Basic template member declaration
( basic_streambuf<charT,traits> )| 1 2 3 |
|
See also
| streambuf::pubseekoff | Set internal position pointer to relative position (public member function) |
| streambuf::seekpos | Set internal position pointer to absolute position (virtual protected member function) |
