2 //===----------------------------------------------------------------------===//
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___IOS_FPOS_H
11 #define _LIBCPP___IOS_FPOS_H
14 #include <__fwd/ios.h>
16 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17 # pragma GCC system_header
20 _LIBCPP_BEGIN_NAMESPACE_STD
22 template <class _StateT
>
23 class _LIBCPP_TEMPLATE_VIS fpos
{
29 _LIBCPP_HIDE_FROM_ABI
fpos(streamoff __off
= streamoff()) : __st_(), __off_(__off
) {}
31 _LIBCPP_HIDE_FROM_ABI
operator streamoff() const { return __off_
; }
33 _LIBCPP_HIDE_FROM_ABI _StateT
state() const { return __st_
; }
34 _LIBCPP_HIDE_FROM_ABI
void state(_StateT __st
) { __st_
= __st
; }
36 _LIBCPP_HIDE_FROM_ABI fpos
& operator+=(streamoff __off
) {
41 _LIBCPP_HIDE_FROM_ABI fpos
operator+(streamoff __off
) const {
47 _LIBCPP_HIDE_FROM_ABI fpos
& operator-=(streamoff __off
) {
52 _LIBCPP_HIDE_FROM_ABI fpos
operator-(streamoff __off
) const {
59 template <class _StateT
>
60 inline _LIBCPP_HIDE_FROM_ABI
61 streamoff
operator-(const fpos
<_StateT
>& __x
, const fpos
<_StateT
>& __y
) {
62 return streamoff(__x
) - streamoff(__y
);
65 template <class _StateT
>
66 inline _LIBCPP_HIDE_FROM_ABI
67 bool operator==(const fpos
<_StateT
>& __x
, const fpos
<_StateT
>& __y
) {
68 return streamoff(__x
) == streamoff(__y
);
71 template <class _StateT
>
72 inline _LIBCPP_HIDE_FROM_ABI
73 bool operator!=(const fpos
<_StateT
>& __x
, const fpos
<_StateT
>& __y
) {
74 return streamoff(__x
) != streamoff(__y
);
77 _LIBCPP_END_NAMESPACE_STD
79 #endif // _LIBCPP___IOS_FPOS_H