13 #define private protected 17 # define fpos_t od_int64 41 isok_ = open( fnm, om );
44 bool isOK()
const {
return isok_; }
48 #define defom (ios_base::openmode)(ios_base::in | ios_base::out) 50 virtual pos_type
seekoff( off_type _Off, ios_base::seekdir _Way,
51 ios_base::openmode =
defom )
55 if ( _Mysb::gptr() == &_Mychar && _Way == ios_base::cur && _Pcvt == 0 )
56 _Off -= (off_type)
sizeof (
char);
58 if ( _Myfile==0 || !_Endwrite() || (_Off!=0 || _Way!=ios_base::cur) &&
59 _fseeki64(_Myfile,_Off,_Way) != 0 ||
60 fgetpos(_Myfile,&_Fileposition) != 0 )
61 return (pos_type(_BADOFF));
63 if ( _Mysb::gptr() == &_Mychar )
64 _Mysb::setg( &_Mychar, &_Mychar+1, &_Mychar+1 );
67 return (_POS_TYPE_FROM_STATE(pos_type,_State,_Fileposition));
71 virtual pos_type
seekpos( pos_type _Pos, ios_base::openmode =
defom )
74 fpos_t _Fileposition = _POS_TYPE_TO_FPOS_T(_Pos);
75 off_type _Off = (off_type)_Pos - _FPOSOFF(_Fileposition);
77 if ( _Myfile == 0 || !_Endwrite()
78 || fsetpos(_Myfile, &_Fileposition) != 0
79 || _Off != 0 && _fseeki64(_Myfile, _Off, SEEK_CUR) != 0
80 || fgetpos(_Myfile, &_Fileposition) != 0)
81 return (pos_type(_BADOFF));
83 _State = _POS_TYPE_TO_STATE(_Pos);
85 if ( _Mysb::gptr() == &_Mychar)
86 _Mysb::setg( &_Mychar, &_Mychar+1, &_Mychar+1 );
89 return (_POS_TYPE_FROM_STATE(pos_type,_State,_Fileposition));
114 setstate( ios_base::failbit );
120 setstate( ios_base::failbit );
124 {
return fb_->is_open(); }
147 setstate( ios_base::failbit );
153 setstate( ios_base::failbit );
157 {
return fb_->is_open(); }
#define od_int64
Definition: plftypes.h:34
Adapter for output streams on win64.
Definition: winstreambuf.h:134
~winofstream()
Definition: winstreambuf.h:150
Definition: fixedstreambuf.h:18
virtual pos_type seekoff(off_type _Off, ios_base::seekdir _Way, ios_base::openmode=(ios_base::openmode)(ios_base::in|ios_base::out))
Definition: winstreambuf.h:50
#define defom
Definition: winstreambuf.h:48
winifstream(const char *fnm, ios_base::openmode om)
Definition: winstreambuf.h:105
winfilebuf * fb_
Definition: winstreambuf.h:126
Adapter for input streams on win64.
Definition: winstreambuf.h:101
od_int64 realpos_
Definition: winstreambuf.h:93
bool isok_
Definition: winstreambuf.h:92
Adapter to seek in filebuffers on win64.
Definition: winstreambuf.h:35
od_int64 getRealPos() const
Definition: winstreambuf.h:45
bool is_open()
Definition: winstreambuf.h:156
winofstream(const char *fnm, ios_base::openmode om)
Definition: winstreambuf.h:138
winfilebuf * fb_
Definition: winstreambuf.h:159
bool is_open()
Definition: winstreambuf.h:123
winfilebuf(const char *fnm, ios_base::openmode om)
Definition: winstreambuf.h:38
virtual pos_type seekpos(pos_type _Pos, ios_base::openmode=(ios_base::openmode)(ios_base::in|ios_base::out))
Definition: winstreambuf.h:71
#define mClass(module)
Definition: commondefs.h:161
bool isOK() const
Definition: winstreambuf.h:44
~winifstream()
Definition: winstreambuf.h:117