Name

ios_base::seekdir type — Seek direction

Synopsis

typedef  . . .  seekdir
typedef  . . .  seek_dir
static const seekdir beg
static const seekdir cur
static const seekdir end
               
image with no caption

The ios_base::seekdir type is an implementation-defined enumerated type that specifies the origin for seeking to a new file position. The seek_dir type is an integral type that represents the same information. Some functions that take a seekdir parameter have overloaded versions that accept a seek_dir parameter and have the same functionality as their seekdir counterparts. The seek_dir type and related functions are deprecated, so you should use the seekdir versions.

Table 13-17 lists the seekdir literals. Note that the order and integer values of the literals are implementation-defined.

Table 13-17. seekdir literals

Literal

Description

beg

Seeks from the beginning of the stream (e.g., offset is absolute position)

cur

Seeks from the current position; positive is toward end of stream, and negative offsets are toward the beginning of the stream

end

Seeks relative to the end of the stream; negative offsets are towards the beginning

See Also

basic_istream in <istream> , basic_ostream in <ostream> , basic_streambuf in <streambuf>

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.