⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 streamb_.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
📖 第 1 页 / 共 3 页
字号:
The character pointed at is actually the first character
past the end of the &putarea.:PERIOD.
:INCLUDE file='sb_rgp'.
:RSLTS.
The &fn. returns a pointer to the end of the &putarea.:PERIOD.
If the &obj.
currently does not have a &putarea., &null. is returned.
:SALSO.
:SAL typ='mfun'.pbase
:SAL typ='mfun'.pptr
:SAL typ='mfun'.setp
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='protected'.gbump
:SNPL.
:SNPFLF            .#include <streambu.h>
:SNPFLF            .protected:
:SNPF index='gbump'.void streambuf::gbump( streamoff offset );
:eSNPL.
:SMTICS.
The &fn. increments the &getptr. by the specified
:ARG.offset
:CONT., without regard for the boundaries of the &getarea.:PERIOD.
The
:ARG.offset
parameter may be positive or negative.
:RSLTS.
The &fn. returns nothing.
:SALSO.
:SAL typ='mfun'.gptr
:SAL typ='mfun'.pbump
:SAL typ='mfun'.sbumpc
:SAL typ='mfun'.sputbackc
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='protected'.gptr
:SNPL.
:SNPFLF           .#include <streambu.h>
:SNPFLF           .protected:
:SNPF index='gptr'.char *streambuf::gptr() const;
:eSNPL.
:SMTICS.
The &fn. returns a pointer to the next available character in the &getarea.
within the &rsvarea. used by the &obj.:PERIOD.
This pointer is called the &getptr.:PERIOD.
:I1.get pointer
:P.
If the &getptr. points beyond the end of the &getarea., all characters in
the &getarea. have been read by the program and a subsequent read causes the
:MONO.underflow
virtual member function to be called to fetch more characters from the source
to which the &obj. is attached.
:INCLUDE file='sb_rgp'.
:RSLTS.
The &fn. returns a pointer to the next available character in the &getarea.:PERIOD.
If the &obj. currently does not have a &getarea., &null. is returned.
:SALSO.
:SAL typ='mfun'.eback
:SAL typ='mfun'.egptr
:SAL typ='mfun'.setg
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.in_avail
:SNPL.
:SNPFLF               .#include <streambu.h>
:SNPFLF               .public:
:SNPF index='in_avail'.int streambuf::in_avail() const;
:eSNPL.
:SMTICS.
The &fn. computes the number of input characters buffered in the &getarea.
that have not yet been read by the program.
These characters can be read with a guarantee that no errors will occur.
:RSLTS.
The &fn. returns the number of buffered input characters.
:SALSO.
:SAL typ='mfun'.egptr
:SAL typ='mfun'.gptr
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.out_waiting
:SNPL.
:SNPFLF                  .#include <streambu.h>
:SNPFLF                  .public:
:SNPF index='out_waiting'.int streambuf::out_waiting() const;
:eSNPL.
:SMTICS.
The &fn. computes the number of characters that have been buffered in the
&putarea. and not yet been written to the output device.
:RSLTS.
The &fn. returns the number of buffered output characters.
:SALSO.
:SAL typ='mfun'.pbase
:SAL typ='mfun'.pptr
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public virtual'.overflow
:SNPL.
:SNPFLF               .#include <streambu.h>
:SNPFLF               .public:
:SNPF index='overflow'.virtual int streambuf::overflow( int ch = EOF ) = 0;
:eSNPL.
:SMTICS.
The &fn. is used to flush the &putarea. when it is full.
:PRTCL.
Classes derived from the &cls. should implement the &fn. so that it performs
the following:
:OL.
:LI.if no &rsvarea. is present and the &obj. is not unbuffered, allocate a
&rsvarea. using the
:MONO.allocate
member function and set up the &rsvarea. pointers using the
:MONO.setb
protected member function,
:LI.flush any other uses of the &rsvarea.,
:LI.write any characters in the &putarea. to the &obj.'s destination,
:LI.set up the &putarea. pointers to reflect the characters that were written,
:LI.return &noteof. on success, otherwise return &eof.:PERIOD.
:eOL.
:DEFIMPL.
There is no default &cls. implementation of the &fn.:PERIOD.
The &fn. must be defined for all classes derived from the &cls.:PERIOD.
:RSLTS.
The &fn. returns &noteof. on success, otherwise &eof. is returned.
:SALSO.
:SAL typ='ofun' ocls='filebuf'.overflow
:SAL typ='ofun' ocls='stdiobuf'.overflow
:SAL typ='ofun' ocls='strstreambuf'.overflow
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public virtual'.pbackfail
:SNPL.
:SNPFLF                .#include <streambu.h>
:SNPFLF                .public:
:SNPF index='pbackfail'.virtual int streambuf::pbackfail( int ch );
:eSNPL.
:SMTICS.
The &fn. is called by the
:MONO.sputbackc
member function when the &getptr. is at the beginning of the &getarea.,
and so there is no place to put the
:ARG.ch
parameter.
:PRTCL.
Classes derived from the &cls. should implement the &fn. such that it attempts
to put
:ARG.ch
back into the source of the stream.
:DEFIMPL.
The default &cls. implementation of the &fn. is to return &eof.:PERIOD.
:RSLTS.
If the &fn. succeeds, it returns
:ARG.ch
:PERIOD.
Otherwise, &eof. is returned.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='protected'.pbase
:SNPL.
:SNPFLF            .#include <streambu.h>
:SNPFLF            .protected:
:SNPF index='pbase'.char *streambuf::pbase() const;
:eSNPL.
:SMTICS.
The &fn. returns a pointer to the start of the &putarea. within the &rsvarea.
used by the &obj.:PERIOD.
:INCLUDE file='sb_rgp'.
:RSLTS.
The &fn. returns a pointer to the start of the &putarea.:PERIOD.
If the &obj.
currently does not have a &putarea., &null. is returned.
:SALSO.
:SAL typ='mfun'.epptr
:SAL typ='mfun'.pptr
:SAL typ='mfun'.setp
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='protected'.pbump
:SNPL.
:SNPFLF            .#include <streambu.h>
:SNPFLF            .protected:
:SNPF index='pbump'.void streambuf::pbump( streamoff offset );
:eSNPL.
:SMTICS.
The &fn. increments the &putptr. by the specified
:ARG.offset
:CONT., without regard for the boundaries of the &putarea.:PERIOD.
The
:ARG.offset
parameter may be positive or negative.
:RSLTS.
The &fn. returns nothing.
:SALSO.
:SAL typ='mfun'.gbump
:SAL typ='mfun'.pbase
:SAL typ='mfun'.pptr
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='protected'.pptr
:SNPL.
:SNPFLF           .#include <streambu.h>
:SNPFLF           .protected:
:SNPF index='pptr'.char *streambuf::pptr() const;
:eSNPL.
:SMTICS.
The &fn. returns a pointer to the next available space in the &putarea.
within the &rsvarea. used by the &obj.:PERIOD.
This pointer is called the &putptr.:PERIOD.
:I1.put pointer
:P.
If the &putptr. points beyond the end of the &putarea., the &putarea.
is full and a subsequent write causes the
:MONO.overflow
virtual member function to be called to empty the &putarea. to the device
to which the &obj. is attached.
:INCLUDE file='sb_rgp'.
:RSLTS.
The &fn. returns a pointer to the next available space in the &putarea.:PERIOD.
If the &obj. currently does not have a &putarea., &null. is returned.
:SALSO.
:SAL typ='mfun'.epptr
:SAL typ='mfun'.pbase
:SAL typ='mfun'.setp
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.sbumpc
:SNPL.
:SNPFLF               .#include <streambu.h>
:SNPFLF               .public:
:SNPF index='sbumpc'.int streambuf::sbumpc();
:eSNPL.
:SMTICS.
:INCLUDE file='sb_sbmpc'.
:SALSO.
:SAL typ='mfun'.gbump
:SAL typ='mfun'.sgetc
:SAL typ='mfun'.sgetchar
:SAL typ='mfun'.sgetn
:SAL typ='mfun'.snextc
:SAL typ='mfun'.sputbackc
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public virtual'.seekoff
:SNPL.
:SNPFLF              .#include <streambu.h>
:SNPFLF              .public:
:SNPF index='seekoff'.virtual streampos streambuf::seekoff( streamoff offset,
:SNPFLF              .                                      ios::seekdir dir,
:SNPFLF              .                                      ios::openmode mode );
:eSNPL.
:SMTICS.
The &fn. is used for positioning to a relative location within the &obj.,
and hence within the device that is connected to the &obj.:PERIOD.
The
:ARG.offset
and
:ARG.dir
parameters specify the relative change in position.  The
:ARG.mode
parameter controls whether the &getptr. and/or the &putptr. are repositioned.
:PRTCL.
Classes derived from the &cls. should implement the
:MONO.seekoff
virtual member function so that it uses its parameters in the following way.
:INCLUDE file='seekmode'.
:INCLUDE file='seekdir'.
:DEFIMPL.
The default implementation of the &fn. provided by the &cls. returns
&eof.:PERIOD.
:RSLTS.
The &fn. returns the new position in the stream on success, otherwise &eof.
is returned.
:SALSO.
:SAL typ='mfun'.seekpos
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public virtual'.seekpos
:SNPL.
:SNPFLF              .#include <streambu.h>
:SNPFLF              .public:
:SNPF index='seekpos'.virtual streampos streambuf::seekpos( streampos pos,
:SNPFLF              .                    ios::openmode mode = ios::in|ios::out );
:eSNPL.
:SMTICS.
The &fn. is used for positioning to an absolute location within the &obj.,
and hence within the device that is connected to the &obj.:PERIOD.
The
:ARG.pos
parameter specifies the absolute position.  The
:ARG.mode
parameter controls whether the &getptr. and/or the &putptr. are repositioned.
:PRTCL.
Classes derived from the &cls. should implement the &fn.
so that it uses its parameters in the following way.
:INCLUDE file='seekmode'.
:P.
In general the &fn. is equivalent to calling the
:MONO.seekoff
virtual member function with the offset set to
:ARG.pos
:CONT.,
the direction set to
:MONO.ios::beg
and the mode set to
:ARG.mode
:PERIOD.
:DEFIMPL.
The default implementation of the &fn. provided by the &cls. calls the
:MONO.seekoff
virtual member function with the offset set to
:ARG.pos
:CONT.,
the direction set to
:MONO.ios::beg
:CONT., and the mode set to
:ARG.mode
:PERIOD.
:RSLTS.
The &fn. returns the new position in the stream on success, otherwise &eof.
is returned.
:SALSO.
:SAL typ='mfun'.seekoff
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='protected'.setb
:SNPL.
:SNPFLF           .#include <streambu.h>
:SNPFLF           .protected:
:SNPF index='setb'.void streambuf::setb( char *base, char *ebuf, int autodel );
:eSNPL.
:SMTICS.
The &fn. is used to set the pointers to the &rsvarea. that the &obj. is using.
:P.
The
:ARG.base
parameter is a pointer to the start of the &rsvarea. and
corresponds to the value that the
:MONO.base
member function returns.
:P.
The
:ARG.ebuf
parameter is a pointer to the end of the &rsvarea. and corresponds to the
value that the
:MONO.ebuf
member function returns.
:P.
The
:ARG.autodel
parameter indicates whether or not the &obj. can free the &rsvarea. when the
&obj. is destroyed or when a new &rsvarea. is set up in a subsequent call to
the &fn.:PERIOD.
If the
:ARG.autodel
parameter is non-zero, the &obj. can delete the &rsvarea., using the
:MONO.operator~bdelete
intrinsic function. Otherwise, a zero value indicates that the buffer will be
deleted elsewhere.
:P.
If either of the
:ARG.base
or
:ARG.ebuf
parameters are &null. or if
:ARG.ebuf
<=
:ARG.base
:CONT., the &obj. does not have a buffer and input/output operations
are unbuffered, unless another buffer is set up.
:P.
Note that the &fn. is used to set the &rsvarea. pointers, while the
:MONO.setbuf
protected member function is used to offer a buffer to the &obj.:PERIOD.
:SALSO.
:SAL typ='mfun'.base
:SAL typ='mfun'.blen
:SAL typ='mfun'.ebuf
:SAL typ='mfun'.setbuf
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public virtual'.setbuf
:SNPL.
:SNPFLF             .#include <streambu.h>
:SNPFLF             .public:
:SNPF index='setbuf'.virtual streambuf *streambuf::setbuf( char *buf, int len );
:eSNPL.
:SMTICS.
The &fn. is used to offer a buffer specified by the
:ARG.buf
and
:ARG.len
parameters to the &obj. for use as its &rsvarea.:PERIOD.
Note that the &fn. is used to offer a buffer, while the
:MONO.setb
protected member function is used to set the &rsvarea. pointers once a
buffer has been accepted.
:PRTCL.
Classes derived from the &cls. may implement the &fn. if the default behavior
is not suitable.
:P.
Derived classes that provide their own implementations of the &fn.
may accept or reject the offered buffer. Often, if a buffer is already
allocated, the offered buffer is rejected, as it may be difficult to
transfer the information from the current buffer.
:DEFIMPL.
The default &fn. provided by the &cls. rejects the buffer if one is already
present.
:P.
If no buffer is present and either
:ARG.buf
is &null. or
:ARG.len
is zero, the offer is accepted and the &obj. is unbuffered.
:P.
Otherwise, no buffer is present and one is specified.
If
:ARG.len
is less than five characters the buffer is too small and it is rejected.
Otherwise, the buffer is accepted.
:RSLTS.
The &fn. returns the address of the &obj. if the offered buffer is accepted,
otherwise &null. is returned.
:SALSO.
:SAL typ='mfun'.setb
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='protected'.setg
:SNPL.
:SNPFLF           .#include <streambu.h>
:SNPFLF           .protected:
:SNPF index='setg'.void streambuf::setg( char *eback, char *gptr, char *egptr );
:eSNPL.
:SMTICS.
The &fn. is used to set the three &getarea. pointers.
:P.
The
:ARG.eback
parameter is a pointer to the start of the &getarea.
and corresponds to the value that the

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -