Files
cppdraft_translate/cppdraft/ostream/seeks.md
2025-10-25 03:02:53 +03:00

2.1 KiB
Raw Blame History

[ostream.seeks]

31 Input/output library [input.output]

31.7 Formatting and manipulators [iostream.format]

31.7.6 Output streams [output.streams]

31.7.6.2 Class template basic_ostream [ostream]

31.7.6.2.5 Seek members [ostream.seeks]

1

#

Each seek member function begins execution by constructing an object of class sentry.

It returns by destroying the sentry object.

🔗

pos_type tellp();

2

#

Returns: Iffail() != false, returnspos_type(-1) to indicate failure.

Otherwise, returnsrdbuf()->pubseekoff(0, cur, out).

🔗

basic_ostream& seekp(pos_type pos);

3

#

Effects: Iffail() != true, executesrdbuf()->pubseekpos(pos, ios_base::out).

In case of failure, the function callssetstate(failbit) (which may throwios_base::failure).

4

#

Returns: *this.

🔗

basic_ostream& seekp(off_type off, ios_base::seekdir dir);

5

#

Effects: Iffail() != true, executesrdbuf()->pubseekoff(off, dir, ios_base::out).

In case of failure, the function calls setstate(failbit) (which may throw ios_base::failure).

6

#

Returns: *this.