Type used by fpos, char_traits<char>, and char_traits<wchar_t>.
In clauses 21.1.3.1 and 27.4.1 streamoff is described as an implementation defined type. Note: In versions of GCC up to and including GCC 3.3, streamoff was typedef long.
Integral type for I/O operation counts and buffer sizes.
Class representing stream positions.
The standard places no requirements upon the template parameter StateT. In this implementation StateT must be DefaultConstructible, CopyConstructible and Assignable. The standard only requires that fpos should contain a member of type StateT. In this implementation it also contains an offset stored as a signed integer.
- Parameters
-
StateT | Type passed to and returned from state(). |
Construct position from offset.
Convert to streamoff.
Remember the value of st.
Return the last set value of st.
Add offset to this position.
Subtract offset from this position.
Add position and offset.
Subtract offset from position.
Subtract position to return offset.
Test if equivalent to another position.
File position for char streams.
File position for wchar_t streams.
70 _GLIBCXX_BEGIN_NAMESPACE_VERSION
87 #ifdef _GLIBCXX_HAVE_INT64_T_LONG
88 typedef long streamoff;
89 #elif defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG)
90 typedef long long streamoff;
91 #elif defined(_GLIBCXX_HAVE_INT64_T)
92 typedef int64_t streamoff;
94 typedef long long streamoff;
111 template<
typename _StateT>
124 : _M_off(0), _M_state() { }
133 fpos(streamoff __off)
134 : _M_off(__off), _M_state() { }
137 operator streamoff()
const {
return _M_off; }
154 operator+=(streamoff __off)
165 operator-=(streamoff __off)
206 {
return _M_off - __other._M_off; }
214 template<
typename _StateT>
216 operator==(
const fpos<_StateT>& __lhs,
const fpos<_StateT>& __rhs)
217 {
return streamoff(__lhs) == streamoff(__rhs); }
219 template<
typename _StateT>
221 operator!=(
const fpos<_StateT>& __lhs,
const fpos<_StateT>& __rhs)
222 {
return streamoff(__lhs) != streamoff(__rhs); }
228 typedef fpos<mbstate_t> streampos;
230 typedef fpos<mbstate_t> wstreampos;
232 #if __cplusplus >= 201103L
233 typedef fpos<mbstate_t> u16streampos;
236 typedef fpos<mbstate_t> u32streampos;
239 _GLIBCXX_END_NAMESPACE_VERSION
bool operator==(const exception_ptr &, const exception_ptr &) _GLIBCXX_USE_NOEXCEPT __attribute__((__pure__))
_Safe_iterator< _Iterator, _Sequence > operator+(typename _Safe_iterator< _Iterator, _Sequence >::difference_type __n, const _Safe_iterator< _Iterator, _Sequence > &__i)
Definition: safe_iterator.h:712
_Safe_iterator< _IteratorL, _Sequence >::difference_type operator-(const _Safe_iterator< _IteratorL, _Sequence > &__lhs, const _Safe_iterator< _IteratorR, _Sequence > &__rhs)
Definition: safe_iterator.h:680
bool operator!=(const exception_ptr &, const exception_ptr &) _GLIBCXX_USE_NOEXCEPT __attribute__((__pure__))
__PTRDIFF_TYPE__ ptrdiff_t
Definition: stddef.h:147