mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-16 07:48:44 +01:00
777b182edd
This allowed me to standardize the sourcetar and sf/* scripts: the base directory (containing ./git) is now empty, except for maintenance scripts, while the source files and build scripts of the annotations are stored in a subdirectory of their own.
37 lines
1.6 KiB
Text
37 lines
1.6 KiB
Text
Although not every tt(istream) object supports i(repositioning), some do. This
|
|
means that it is possible to read the same section of a stream
|
|
repeatedly. Repositioning is frequently used in emi(database applications)
|
|
where it must be possible to access the information in the database randomly.
|
|
|
|
The current position can be obtained and modified using the following members:
|
|
itemization(
|
|
ithtq(tellg)(ios::pos_type tellg())
|
|
(hi(pos_type)the stream's current (absolute) position where the
|
|
stream's next read-operation will take place is returned.)
|
|
ithtq(seekg)
|
|
(istream &seekg(ios::off_type step, ios::seekdir org))
|
|
(modifies a stream's actual position. The function expects an
|
|
ti(off_type) tt(step) representing the number of bytes the current stream
|
|
position is moved with respect to tt(org). The tt(step) value may be negative,
|
|
zero or positive.
|
|
|
|
The origin of the step, tt(org) is a value in the
|
|
hi(seekdir)tt(ios::seekdir) enumeration. Its values are:
|
|
itemization(
|
|
ithtq(beg)(ios::beg)
|
|
(the stepsize is computed relative to the beginning of the
|
|
stream. This value is used by default.
|
|
)
|
|
ithtq(cur)(ios::cur)
|
|
(the stepsize is computed relative to the current position of the
|
|
stream (as returned by tt(tellp)).
|
|
)
|
|
ithtq(end)(ios::end)
|
|
(the stepsize is interpreted relative to the current end position
|
|
of the the stream.)
|
|
)
|
|
It is OK to hi(seek beyond file boundaries) seek beyond the last file
|
|
position. Seeking before tt(ios::beg) raises the hi(failbit)tt(ios::failbit)
|
|
flag.
|
|
)
|
|
)
|