 |
OpendTect
6.6
|
Go to the documentation of this file. 1 #ifndef fixedstreambuf_h
2 #define fixedstreambuf_h
53 setg( buf_, buf_, buf_ + sz_ );
54 setp( buf_, buf_ + sz_ );
59 virtual pos_type
seekoff( off_type offs, ios_base::seekdir sd,
60 ios_base::openmode which )
63 if ( sd == ios_base::cur )
64 newpos_ += which == ios_base::in ? gptr() - buf_ : pptr() - buf_;
66 newpos_ = sz_ + newpos_;
68 return seekpos( newpos_, which );
71 virtual pos_type
seekpos( pos_type newpos, ios_base::openmode which )
73 if ( newpos_ < 0 || newpos_ >= sz_ )
75 else if ( which == ios_base::in )
76 setg( buf_, buf_+newpos_, buf_ + sz_ );
78 setp( buf_+newpos_, buf_ + sz_ );
83 virtual streamsize
xsgetn( char_type* s, streamsize n )
86 const od_int64 memsz = epptr() - pptr();
87 if ( toget > memsz && memsz >= 0 )
90 OD::memCopy( s, gptr(), (
size_t)toget );
96 virtual streamsize
xsputn(
const char_type* s, streamsize n )
99 const od_int64 memsz = epptr() - pptr();
100 if ( toput > memsz && memsz >= 0 )
103 OD::memCopy( pptr(), s, (
size_t)toput );
off_type newpos_
Definition: fixedstreambuf.h:112
bool mine_
Definition: fixedstreambuf.h:111
~fixedstreambuf()
Definition: fixedstreambuf.h:44
fixedostream(fixedstreambuf *sb)
Definition: fixedstreambuf.h:132
#define od_int64
Definition: plftypes.h:35
Definition: fixedstreambuf.h:116
off_type sz_
Definition: fixedstreambuf.h:110
virtual pos_type seekpos(pos_type newpos, ios_base::openmode which)
Definition: fixedstreambuf.h:71
char_type * buf_
Definition: fixedstreambuf.h:109
#define mClass(module)
Definition: commondefs.h:181
fixedstreambuf(char_type *b, off_type sz, bool manbuf=false)
Definition: fixedstreambuf.h:37
fixedistream(fixedstreambuf *sb)
Definition: fixedstreambuf.h:119
JsonIterator end(JsonValue)
Definition: gason.h:117
virtual pos_type seekoff(off_type offs, ios_base::seekdir sd, ios_base::openmode which)
Definition: fixedstreambuf.h:59
virtual fixedstreambuf * setbuf(char_type *b, streamsize n)
Definition: fixedstreambuf.h:50
~fixedostream()
Definition: fixedstreambuf.h:136
Definition: fixedstreambuf.h:20
virtual streamsize xsgetn(char_type *s, streamsize n)
Definition: fixedstreambuf.h:83
Adapter to use a fixed buffer as a stream.
Definition: fixedstreambuf.h:34
virtual streamsize xsputn(const char_type *s, streamsize n)
Definition: fixedstreambuf.h:96
~fixedistream()
Definition: fixedstreambuf.h:123
Definition: fixedstreambuf.h:129
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021