streambuf::seekoff

Syntax

virtual streampos seekoff( streamoff off, ios::seek_dir dir,
int
nMode = ios::in | ios::out );

Parameters

off

The new offset value; streamoff is a typedef equivalent to long.

dir

The seek direction specified by the enumerated type seek_dir, as follows:

Value Meaning

ios::beg Seek from the beginning of the stream.
ios::cur Seek from the current position in the stream.
ios::end Seek from the end of the stream.

nMode

An integer that contains a bitwise-OR (|) combination of the enumerators ios::in and ios::out.

Remarks

Changes the position for the streambuf object. Not all derived classes of streambuf need to support positioning; however, the filebuf, strstreambuf, and stdiobuf classes do support positioning.

Classes derived from streambuf often support independent input and output position values. The nMode parameter determines which value(s) is set.

Default Implementation

Returns EOF.

Return Value

The new position value. This is the byte offset from the start of the file (or string). If both ios::in and ios::out are specified, then the function returns the output position. If the derived class does not support positioning, then the function returns EOF.

See Also

streambuf::seekpos