Set the file pointer associated with the file descriptor according to the specified offset and whence:

Synopsis

Declared in <bdls_fdstreambuf.h>

virtual
pos_type
seekoff(
    off_type offset,
    std::ios_base::seekdir whence,
    std::ios_base::openmode mode = bsl::ios_base::in | bsl::ios_base::out) override;

Description

* If 'whence' is 'bsl::ios_base::beg', set the pointer to 'offset' bytes from the beginning of the file. * If 'whence' is 'bsl::ios_base::cur', advance the pointer by 'offset' bytes * If 'whence' is 'bsl::ios_base::end', set the pointer to 'offset' bytes beyond the end of the file.

Optionally specify mode, which is ignored. Return the new location of the file position, in bytes from the beginning of the file, on success, and ‐1 otherwise. The behavior is undefined unless the file descriptor is on a device capable of seeking. Note that seeking does not change the size of the file if the pointer advances beyond the end of the file; instead, the next write at the pointer will increase the file size. Also note that seeks are always in terms of bytes on the device, meaning that in Windows text mode, seeking past a ` ` perceived by the caller will count as 2 bytes since it has to seek over a `\r ` sequence on the device.

Created with MrDocs