00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef _CPP_BITS_FPOS_H
00035 #define _CPP_BITS_FPOS_H 1
00036
00037 #pragma GCC system_header
00038
00039 #include <bits/c++io.h>
00040 #include <bits/std_cwchar.h>
00041
00042 namespace std
00043 {
00044
00045
00046
00047 template<typename _StateT>
00048 class fpos
00049 {
00050 public:
00051
00052 typedef _StateT __state_type;
00053
00054 private:
00055 __state_type _M_st;
00056 streamoff _M_off;
00057
00058 public:
00059 __state_type
00060 state() const { return _M_st; }
00061
00062 void
00063 state(__state_type __st) { _M_st = __st; }
00064
00065
00066
00067 fpos(): _M_st(__state_type()), _M_off(streamoff()) { }
00068
00069 fpos(streamoff __off, __state_type __st = __state_type())
00070 : _M_st(__st), _M_off(__off) { }
00071
00072 operator streamoff() const { return _M_off; }
00073
00074 fpos&
00075 operator+=(streamoff __off) { _M_off += __off; return *this; }
00076
00077 fpos&
00078 operator-=(streamoff __off) { _M_off -= __off; return *this; }
00079
00080 fpos&
00081 operator+(streamoff __off)
00082 {
00083 fpos t(*this);
00084 return t += __off;
00085 }
00086
00087 fpos&
00088 operator-(streamoff __off)
00089 {
00090 fpos t(*this);
00091 return t -= __off;
00092 }
00093
00094 bool
00095 operator==(const fpos& __pos) const
00096 { return _M_off == __pos._M_off; }
00097
00098 bool
00099 operator!=(const fpos& __pos) const
00100 { return _M_off != __pos._M_off; }
00101
00102 streamoff
00103 _M_position() const { return _M_off; }
00104
00105 void
00106 _M_position(streamoff __off) { _M_off = __off; }
00107 };
00108
00109
00110 typedef fpos<mbstate_t> streampos;
00111 # ifdef _GLIBCPP_USE_WCHAR_T
00112 typedef fpos<mbstate_t> wstreampos;
00113 # endif
00114 }
00115
00116 #endif
00117
00118
00119