Previous fileTop of DocumentContentsIndex pageNext file
Apache C++ Standard Library Reference Guide


Library:  Input/output

Does not inherit

Local Index



Class that maintains position information for the iostream classes


#include <rw/iotraits>

namespace std {
  template<class stateT>
  class fpos;


The class template fpos is used by the iostream classes to maintain position information. It maintains the absolute position within the external sequence, and the conversion state at that position. Streams instantiated on narrow characters use streampos as their positioning type, whereas streams instantiated on wide characters use wstreampos.


Member Types



fpos(streamoff off = 0, state_type st = state_type()); 

Public Member Functions

state() const; 
state(state_type st); 
operator streamoff() const;
fpos& operator+=(streamoff off);
fpos& operator-=(streamoff off);
fpos& operator+(streamoff off) const;
fpos& operator-(streamoff off) const;
bool operator==(const fpos&) const;
bool operator!=(const fpos&) const;

Valid Operations

In the following,

Valid operations:

P p( i );

Constructs from int

P p = i;

Assigns from int

P( o )

Converts from offset

O( p )

Converts to offset

p == q

Tests for equality

p != q

Tests for inequality

q = p + o

Adds offset

p += o

Adds offset

q = p -o

Subtracts offset

q -= o

Subtracts offset

o = p - q

Returns offset

See Also

<iosfwd>, char_traits

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems --Programming Language C++, Section 27.4.3. See also ISO/IEC 9899/AMD1:1995, Amendment 1 to ISO/IEC 9899:1990 C Integrity.

Previous fileTop of DocumentContentsIndex pageNext file