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

📄 streamb_.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
📖 第 1 页 / 共 3 页
字号:
:MONO.eback
member function returns.
:P.
The
:ARG.gptr
parameter is a pointer to the first available character in the &getarea.,
that is, the &getptr., and usually is greater than the
:MONO.eback
parameter in order to accommodate a putback area.
The
:ARG.gptr
parameter corresponds to the value that the
:MONO.gptr
member function returns.
:P.
The
:ARG.egptr
parameter is a pointer to the end of the &getarea.
and corresponds to the value that the
:MONO.egptr
member function returns.
:P.
If any of the three parameters are &null., there is no &getarea.:PERIOD.
:SALSO.
:SAL typ='mfun'.eback
:SAL typ='mfun'.egptr
:SAL typ='mfun'.gptr
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='protected'.setp
:SNPL.
:SNPFLF           .#include <streambu.h>
:SNPFLF           .protected:
:SNPF index='setp'.void streambuf::setp( char *pbase, char *epptr );
:eSNPL.
:SMTICS.
The &fn. is used to set the three &putarea. pointers.
:P.
The
:ARG.pbase
parameter is a pointer to the start of the &putarea. and corresponds to the
value that the
:MONO.pbase
member function returns.
:P.
The
:ARG.epptr
parameter is a pointer to the end of the &putarea.
and corresponds to the value that the
:MONO.epptr
member function returns.
:P.
The &putptr. is set to the
:ARG.pbase
parameter value and corresponds to the value that the
:MONO.pptr
member function returns.
:P.
If either parameter is &null., there is no &putarea.:PERIOD.
:SALSO.
:SAL typ='mfun'.epptr
:SAL typ='mfun'.pbase
:SAL typ='mfun'.pptr
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.sgetc
:SNPL.
:SNPFLF            .#include <streambu.h>
:SNPFLF            .public:
:SNPF index='sgetc'.int streambuf::sgetc();
:eSNPL.
:SMTICS.
:INCLUDE file='sb_spkc'.
:SALSO.
:SAL typ='mfun'.sbumpc
:SAL typ='mfun'.sgetchar
:SAL typ='mfun'.sgetn
:SAL typ='mfun'.snextc
:SAL typ='mfun'.speekc
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.sgetchar
:SNPL.
:SNPFLF               .#include <streambu.h>
:SNPFLF               .public:
:SNPF index='sgetchar'.int streambuf::sgetchar();
: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'.speekc
:SAL typ='mfun'.sputbackc
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.sgetn
:SNPL.
:SNPFLF            .#include <streambu.h>
:SNPFLF            .public:
:SNPF index='sgetn'.int streambuf::sgetn( char *buf, int len );
:eSNPL.
:SMTICS.
The &fn. transfers up to
:ARG.len
characters from the &getarea. into
:ARG.buf
:PERIOD.
If there are not enough characters in the &getarea., the
:MONO.do_sgetn
virtual member function is called to fetch more.
:P.
Classes derived from the &cls. should call the &fn., rather than the
:MONO.do_sgetn
virtual member function.
:RSLTS.
The &fn. returns the number of characters transferred from the &getarea. into
:ARG.buf
:PERIOD.
:SALSO.
:SAL typ='mfun'.do_sgetn
:SAL typ='mfun'.sbumpc
:SAL typ='mfun'.sgetc
:SAL typ='mfun'.sgetchar
:SAL typ='mfun'.speekc
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.snextc
:SNPL.
:SNPFLF             .#include <streambu.h>
:SNPFLF             .public:
:SNPF index='snextc'.int streambuf::snextc();
:eSNPL.
:SMTICS.
The &fn. advances the &getptr. and then returns the character following the
&getptr.:PERIOD.
The &getptr. is left pointing at the returned character.
:P.
If the &getptr. cannot be advanced, the
:MONO.underflow
virtual member function is called to fetch more characters from the source
into the &getarea.:PERIOD.
:RSLTS.
The &fn. advances the &getptr. and returns the next available character in the
&getarea.:PERIOD.
If there is no next available character, &eof. is returned.
:SALSO.
:SAL typ='mfun'.sbumpc
:SAL typ='mfun'.sgetc
:SAL typ='mfun'.sgetchar
:SAL typ='mfun'.sgetn
:SAL typ='mfun'.speekc
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.speekc
:SNPL.
:SNPFLF             .#include <streambu.h>
:SNPFLF             .public:
:SNPF index='speekc'.int streambuf::speekc();
:eSNPL.
:SMTICS.
:INCLUDE file='sb_spkc'.
:SALSO.
:SAL typ='mfun'.sbumpc
:SAL typ='mfun'.sgetc
:SAL typ='mfun'.sgetchar
:SAL typ='mfun'.sgetn
:SAL typ='mfun'.snextc
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.sputbackc
:SNPL.
:SNPFLF                .#include <streambu.h>
:SNPFLF                .public:
:SNPF index='sputbackc'.int streambuf::sputbackc( char ch );
:eSNPL.
:SMTICS.
The &fn. is used to put a character back into the &getarea.:PERIOD.
The
:ARG.ch
character specified must be the same as the character before the &getptr.,
otherwise the behavior is undefined.
The &getptr. is backed up by one position. At least four characters may be put
back without any intervening reads.
:RSLTS.
The &fn. returns
:ARG.ch
on success, otherwise &eof. is returned.
:SALSO.
:SAL typ='mfun'.gbump
:SAL typ='mfun'.sbumpc
:SAL typ='mfun'.sgetchar
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.sputc
:SNPL.
:SNPFLF            .#include <streambu.h>
:SNPFLF            .public:
:SNPF index='sputc'.int streambuf::sputc( int ch );
:eSNPL.
:SMTICS.
The &fn. adds the character
:ARG.ch
to the end of the &putarea. and advances the &putptr.:PERIOD.
If the &putarea. is full before the character is added, the
:MONO.overflow
virtual member function is called to empty the &putarea. and write the
character.
:RSLTS.
The &fn. returns
:ARG.ch
on success, otherwise &eof. is returned.
:SALSO.
:SAL typ='mfun'.sgetc
:SAL typ='mfun'.sputn
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.sputn
:SNPL.
:SNPFLF            .#include <streambu.h>
:SNPFLF            .public:
:SNPF index='sputn'.int streambuf::sputn( char const *buf, int len );
:eSNPL.
:SMTICS.
The &fn. transfers up to
:ARG.len
characters from
:ARG.buf
to the end of the &putarea. and advance the &putptr.:PERIOD.
If the &putarea. is full or becomes full and more characters are to be
written, the
:MONO.do_sputn
virtual member function is called to empty the &putarea. and finish writing
the characters.
:P.
Classes derived from the &cls. should call the &fn., rather than the
:MONO.do_sputn
virtual member function.
:RSLTS.
The &fn. returns the number of characters successfully written.
If an error occurs, this number may be less than
:ARG.len
:PERIOD.
:SALSO.
:SAL typ='mfun'.do_sputn
:SAL typ='mfun'.sputc
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.stossc
:SNPL.
:SNPFLF             .#include <streambu.h>
:SNPFLF             .public:
:SNPF index='stossc'.void streambuf::stossc();
:eSNPL.
:SMTICS.
The &fn. advances the &getptr. by one without returning a character.
If the &getarea. is empty, the
:MONO.underflow
virtual member function is called to fetch more characters and then the
&getptr. is advanced.
:SALSO.
:SAL typ='mfun'.gbump
:SAL typ='mfun'.sbumpc
:SAL typ='mfun'.sgetchar
:SAL typ='mfun'.snextc
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='ctor' prot='protected'.streambuf
:SNPL.
:SNPFLF                    .#include <streambu.h>
:SNPFLF                    .protected:
:SNPCD cd_idx='c'.streambuf::streambuf();
:eSNPL.
:SMTICS.
This form of the &fn. creates an empty &obj. with all fields initialized to
zero. No &rsvarea. is yet allocated, but the &obj. is buffered unless a
subsequent call to the
:MONO.setbuf
or
:MONO.unbuffered
member functions dictate otherwise.
:RSLTS.
This form of the &fn. creates an initialized &obj. with no
associated &rsvarea.:PERIOD.
:SALSO.
:SAL typ='dtor'.
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='ctor' prot='protected'.streambuf
:SNPL.
:SNPFLF                    .#include <streambu.h>
:SNPFLF                    .protected:
:SNPCD cd_idx='c'.streambuf::streambuf( char *buf, int len );
:eSNPL.
:SMTICS.
This form of the &fn. creates an empty &obj. with all fields initialized to zero.
The
:ARG.buf
and
:ARG.len
parameters are passed to the
:MONO.setbuf
member function, which sets up the buffer (if specified), or makes the
&obj. unbuffered (if the
:ARG.buf
parameter is &null. or the
:ARG.len
parameter is not positive).
:RSLTS.
This form of the &fn. creates an initialized &obj. with an associated &rsvarea.:PERIOD.
:SALSO.
:SAL typ='dtor'.
:SAL typ='mfun'.setbuf
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='dtor' prot='protected'.~~streambuf
:SNPL.
:SNPFLF                   .#include <streambu.h>
:SNPFLF                   .protected:
:SNPCD cd_idx='d'.virtual streambuf::~~streambuf();
:eSNPL.
:SMTICS.
The &obj. is destroyed.
If the buffer was allocated by the &obj., it is freed.
Otherwise, the buffer is not freed and must be freed by the user of the &obj.:PERIOD.
The call to the &fn. is inserted implicitly by the compiler
at the point where the &obj. goes out of scope.
:RSLTS.
The &obj. is destroyed.
:SALSO.
:SAL typ='ctor'.
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public virtual'.sync
:SNPL.
:SNPFLF           .#include <streambu.h>
:SNPFLF           .public:
:SNPF index='sync'.virtual int streambuf::sync();
:eSNPL.
:SMTICS.
The &fn. is used to synchronize the &obj.'s &getarea. and &putarea. with the
associated device.
:PRTCL.
Classes derived from the &cls. should implement the &fn. such that it attempts
to perform the following:
:OL.
:LI.flush the &putarea.,
:LI.discard the contents of the &getarea. and reposition the stream device so
that the discarded characters may be read again.
:eOL.
:DEFIMPL.
The default implementation of the &fn. provided by the &cls. takes no action.
It succeeds if the &getarea. and the &putarea. are empty, otherwise it fails.
:RSLTS.
The &fn. returns &noteof. on success, otherwise &eof. is returned.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='protected'.unbuffered
:SNPL.
:SNPFLF                 .#include <streambu.h>
:SNPFLF                 .protected:
:SNPF index='unbuffered'.int ios::unbuffered() const;
:SNPF index='unbuffered'.int ios::unbuffered( int unbuf );
:eSNPL.
:SMTICS.
The &fn. is used to query and/or set the unbuffering state of the &obj.:PERIOD.
A non-zero unbuffered state indicates that the &obj. is unbuffered.  An
unbuffered state of zero indicates that the &obj. is buffered.
:P.
The first form of the &fn. is used to query the current unbuffering state.
:P.
The second form of the &fn. is used to set the unbuffering state to
:ARG.unbuf
:PERIOD.
:P.
Note that the unbuffering state only affects the
:MONO.allocate
protected member function, which does nothing if the unbuffering state is
non-zero. Setting the unbuffering state to a non-zero value does not mean
that future I/O operations will be unbuffered.
:P.
To determine if current I/O operations are unbuffered, use the
:MONO.base
protected member function. A return value of &null. from the
:MONO.base
protected member function indicates that unbuffered I/O operations will be
used.
:RSLTS.
The &fn. returns the previous unbuffered state.
:SALSO.
:SAL typ='mfun'.allocate
:SAL typ='mfun'.pbase
:SAL typ='mfun'.setbuf
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public virtual'.underflow
:SNPL.
:SNPFLF                .#include <streambu.h>
:SNPFLF                .public:
:SNPF index='underflow'.virtual int streambuf::underflow() = 0;
:eSNPL.
:SMTICS.
The &fn. is used to fill the &getarea. when it is empty.
: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 buffered, allocate the
&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.read some characters from the &obj.'s source into the &getarea.,
:LI.set up the &getarea. pointers to reflect the characters that were read,
:LI.return the first character of the &getarea., or &eof. if no characters
could be read.
: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 the first character read into the &getarea., or &eof.
if no characters could be read.
:SALSO.
:SAL typ='ofun' ocls='filebuf'.underflow
:SAL typ='ofun' ocls='stdiobuf'.underflow
:SAL typ='ofun' ocls='strstreambuf'.underflow
:eSALSO.
:eLIBF.

⌨️ 快捷键说明

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