fpos Class

The template class describes an object that can store all the information needed to restore an arbitrary file-position indicator within any stream. An object of class fpos<St> effectively stores at least two member objects:

  • A byte offset, of type streamoff.

  • A conversion state, for use by an object of class basic_filebuf, of type St, typically mbstate_t.

It can also store an arbitrary file position, for use by an object of class basic_filebuf, of type fpos_t. For an environment with limited file size, however, streamoff and fpos_t may sometimes be used interchangeably. For an environment with no streams that have a state-dependent encoding, mbstate_t may actually be unused. Therefore, the number of member objects stored may vary.

template <class Statetype> 
   class fpos

Parameters

  • Statetype
    State information.

Constructors

fpos

Create an object that contains information about a position (offset) in a stream.

Member Functions

seekpos

Used internally by the Standard C++ Library only. Do not call this method from your code.

state

Sets or returns the conversion state.

Operators

operator!=

Tests file-position indicators for inequality.

operator+

Increments a file-position indicator.

operator+=

Increments a file-position indicator.

operator-

Decrements a file-position indicator.

operator-=

Decrements a file-position indicator.

operator==

Tests file-position indicators for equality.

operator streamoff

Casts object of type fpos to object of type streamoff.

Requirements

Header: <ios>

Namespace: std

See Also

Reference

Thread Safety in the C++ Standard Library

iostream Programming

iostreams Conventions