Path: blob/main/contrib/llvm-project/libcxx/include/__ios/fpos.h
35235 views
// -*- C++ -*-1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//89#ifndef _LIBCPP___IOS_FPOS_H10#define _LIBCPP___IOS_FPOS_H1112#include <__config>13#include <__fwd/ios.h>1415#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)16# pragma GCC system_header17#endif1819_LIBCPP_BEGIN_NAMESPACE_STD2021template <class _StateT>22class _LIBCPP_TEMPLATE_VIS fpos {23private:24_StateT __st_;25streamoff __off_;2627public:28_LIBCPP_HIDE_FROM_ABI fpos(streamoff __off = streamoff()) : __st_(), __off_(__off) {}2930_LIBCPP_HIDE_FROM_ABI operator streamoff() const { return __off_; }3132_LIBCPP_HIDE_FROM_ABI _StateT state() const { return __st_; }33_LIBCPP_HIDE_FROM_ABI void state(_StateT __st) { __st_ = __st; }3435_LIBCPP_HIDE_FROM_ABI fpos& operator+=(streamoff __off) {36__off_ += __off;37return *this;38}3940_LIBCPP_HIDE_FROM_ABI fpos operator+(streamoff __off) const {41fpos __t(*this);42__t += __off;43return __t;44}4546_LIBCPP_HIDE_FROM_ABI fpos& operator-=(streamoff __off) {47__off_ -= __off;48return *this;49}5051_LIBCPP_HIDE_FROM_ABI fpos operator-(streamoff __off) const {52fpos __t(*this);53__t -= __off;54return __t;55}56};5758template <class _StateT>59inline _LIBCPP_HIDE_FROM_ABI streamoff operator-(const fpos<_StateT>& __x, const fpos<_StateT>& __y) {60return streamoff(__x) - streamoff(__y);61}6263template <class _StateT>64inline _LIBCPP_HIDE_FROM_ABI bool operator==(const fpos<_StateT>& __x, const fpos<_StateT>& __y) {65return streamoff(__x) == streamoff(__y);66}6768template <class _StateT>69inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const fpos<_StateT>& __x, const fpos<_StateT>& __y) {70return streamoff(__x) != streamoff(__y);71}7273_LIBCPP_END_NAMESPACE_STD7475#endif // _LIBCPP___IOS_FPOS_H767778