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 
00039 #ifndef _CPP_BITS_FPOS_H
00040 #define _CPP_BITS_FPOS_H 1
00041 
00042 #pragma GCC system_header
00043 
00044 #include <bits/c++io.h>
00045 #include <cwchar>   
00046 
00047 namespace std
00048 {
00049   
00050 
00051   
00052   template<typename _StateT>
00053     class fpos
00054     {
00055     public:
00056       
00057       typedef _StateT __state_type;
00058 
00059     private:
00060       streamoff     _M_off;
00061       __state_type  _M_st;
00062 
00063     public:
00064       __state_type
00065       state() const  { return _M_st; }
00066 
00067       void 
00068       state(__state_type __st)  { _M_st = __st; }
00069 
00070       
00071       
00072       fpos(): _M_off(streamoff()), _M_st(__state_type()) { }
00073 
00074       fpos(streamoff __off, __state_type __st = __state_type())
00075       :  _M_off(__off), _M_st(__st) { }
00076 
00077       operator streamoff() const { return _M_off; }
00078 
00079       fpos& 
00080       operator+=(streamoff __off) { _M_off += __off; return *this; }
00081 
00082       fpos& 
00083       operator-=(streamoff __off) { _M_off -= __off; return *this; }
00084 
00085       fpos 
00086       operator+(streamoff __off) 
00087       { 
00088     fpos __t(*this); 
00089     __t += __off;
00090     return __t;
00091       }
00092 
00093       fpos      
00094       operator-(streamoff __off) 
00095       { 
00096     fpos __t(*this); 
00097     __t -= __off; 
00098     return __t;
00099       }
00100 
00101       bool  
00102       operator==(const fpos& __pos) const
00103       { return _M_off == __pos._M_off; }
00104 
00105       bool  
00106       operator!=(const fpos& __pos) const
00107       { return _M_off != __pos._M_off; }
00108       
00109       streamoff 
00110       _M_position() const { return _M_off; }
00111 
00112       void
00113       _M_position(streamoff __off)  { _M_off = __off; }
00114     };
00115 
00116   
00117   typedef fpos<mbstate_t>       streampos;
00118 #  ifdef _GLIBCPP_USE_WCHAR_T
00119   typedef fpos<mbstate_t>       wstreampos;
00120 #  endif
00121 }  
00122 
00123 #endif