📄 istream_.gml
字号:
:ARG.len
characters are transferred or the
:ARG.delim
character is reached, &failbit. is set in the &errstate.:PERIOD.
:SALSO.
:SAL typ='mfun'.get
:SAL typ='mfun'.read
:SAL typ='mfun'.operator~b>>
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.ignore
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='ignore'.istream &.istream::ignore( int num = 1, int delim = EOF );
:eSNPL.
:SMTICS.
The &fn. extracts and discards up to
:ARG.num
characters from the &obj.:PERIOD.
If the
:ARG.num
parameter is not specified, the &fn. extracts and discards one character.
If the
:ARG.delim
parameter
is not &eof. and it is encountered before
:ARG.num
characters have been extracted, the extraction ceases after discarding
the delimiting character.
The extraction stops if end-of-file is encountered.
:P.
If the
:ARG.num
parameter is specified as a negative number, no limit is imposed
on the number of characters extracted and discarded.
The operation continues until the delimiting character is found and
discarded, or until end-of-file. This behavior is a WATCOM extension.
:RSLTS.
The &fn. returns a reference to the &obj.:PERIOD.
If end-of-file is encountered as the first character, &eofbit. is
set in the &errstate.:PERIOD.
:SALSO.
:SAL typ='mfun'.eatwhite
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.ipfx
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='ipfx'.int istream::ipfx( int noskipws = 0 );
:eSNPL.
:SMTICS.
The &fn. is a prefix function executed before each of the formatted and
unformatted read operations. If any bits are set in &iostate.,
the &fn. immediately returns 0, indicating that the prefix function failed.
Failure in the prefix function causes the input operation to fail.
:P.
If the
:ARG.noskipws
parameter is 0 or unspecified and the
:MONO.ios::skipws
bit is on in &fmtflags., whitespace characters are discarded and
the &obj. is positioned so that the next character read is the first character
after the discarded whitespace. Otherwise, no whitespace skipping takes
place.
:P.
The formatted input functions that read specific types of objects (such as
integers and floating-point numbers) call the &fn. with the
:ARG.noskipws
parameter set to zero, allowing leading whitespaces to be discarded if the
:MONO.ios::skipws
bit is on in &fmtflags.:PERIOD.
The unformatted input functions that read
characters without interpretation call the &fn. with a the
:ARG.noskipws
parameter set to 1 so that no whitespace characters are discarded.
:P.
If the &obj. is tied to an output stream, the output stream is flushed.
:RSLTS.
If the &obj. is not in an &errstate. when the above processing is
completed, the &fn. returns a non-zero value to indicate success.
Otherwise, zero is returned to indicate failure.
:SALSO.
:SAL typ='mfun'.isfx
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.isfx
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='isfx'.void istream::isfx();
:eSNPL.
:SMTICS.
The &fn. is a suffix function executed just before the end of each
of the formatted and unformatted read operations.
:P.
As currently implemented, the &fn. does not do anything.
:SALSO.
:SAL typ='mfun'.ipfx
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='ctor' prot='protected'.istream
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .protected:
:SNPCD cd_idx='c'.istream::istream();
:eSNPL.
:SMTICS.
This form of the &fn. creates an &obj. without an associated
:MONO.streambuf
object.
:P.
This form of the &fn. is only used implicitly by the compiler
when it generates a constructor for a derived class.
:RSLTS.
This form of the &fn. creates an initialized &obj.:PERIOD.
&badbit. is set in the &errstate.:PERIOD.
:SALSO.
:SAL typ='dtor'.
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='ctor' prot='public'.istream
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPCD cd_idx='c'.istream::istream( istream const &.istrm );
:eSNPL.
:SMTICS.
This form of the &fn. creates an &obj. associated with the
:MONO.streambuf
object currently associated with the
:ARG.istrm
parameter.
The &obj. is initialized and will use the
:ARG.istrm
:MONO.streambuf
object for subsequent operations.
:ARG.istrm
will continue to use the
:MONO.streambuf
object.
:RSLTS.
This form of the &fn. creates an initialized &obj.:PERIOD.
If there is no
:MONO.streambuf
object currently associated with the
:ARG.istrm
parameter, &badbit. is set in the &errstate.:PERIOD.
:SALSO.
:SAL typ='dtor'.
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='ctor' prot='public'.istream
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPCD cd_idx='c'.istream::istream( streambuf *sb );
:eSNPL.
:SMTICS.
This form of the &fn. creates an &obj. with an associated
:MONO.streambuf
object specified by the
:ARG.sb
parameter.
:P.
This function is likely to be used for the creation of an &obj. that is
associated with the same
:MONO.streambuf
object as another &obj.:PERIOD.
:RSLTS.
This form of the &fn. creates an initialized &obj.:PERIOD.
If the
:ARG.sb
parameter is &null., &badbit. is set in the &errstate.:PERIOD.
:SALSO.
:SAL typ='dtor'.
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='dtor' prot='public virtual'.~~istream
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPCD cd_idx='d'.virtual istream::~~istream();
:eSNPL.
:SMTICS.
The &fn. does not do anything explicit. The
:MONO.ios
destructor is called for that portion 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'.operator =
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='operator ='.istream &.istream::operator =( streambuf *sb );
:eSNPL.
:SMTICS.
This form of the &fn. is used to associate a
:MONO.streambuf
object, specified by the
:ARG.sb
parameter, with an existing &obj.:PERIOD.
The &obj. is initialized and will use the specified
:MONO.streambuf
object for subsequent operations.
:RSLTS.
This form of the &fn. returns a reference to the &obj. that is the target of
the assignment.
If the
:ARG.sb
parameter is &null., &badbit. is set in the &errstate.:PERIOD.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.operator =
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='operator ='.istream &.istream::operator =( istream const &.istrm );
:eSNPL.
:SMTICS.
This form of the &fn. is used to associate the &obj. with the
:MONO.streambuf
object currently associated with the
:ARG.istrm
parameter.
The &obj. is initialized and will use the
:ARG.istrm
:CONT.'s
:MONO.streambuf
object for subsequent operations.
The
:ARG.istrm
object will continue to use the
:MONO.streambuf
object.
:RSLTS.
This form of the &fn. returns a reference to the &obj. that is the target of
the assignment. If there is no
:MONO.streambuf
object currently associated with the
:ARG.istrm
parameter, &badbit. is set in the &errstate.:PERIOD.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.operator >>
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='operator >>'.istream &.istream::operator >>( char *buf );
:SNPF index='operator >>'.istream &.istream::operator >>( signed char *buf );
:SNPF index='operator >>'.istream &.istream::operator >>( unsigned char *buf );
:eSNPL.
:SMTICS.
These forms of the &fn. perform a formatted read of characters from the &obj.
and place them in the buffer specified by the
:ARG.buf
parameter. Characters are read until a whitespace character is found or
the maximum size has been read. If a whitespace character is found, it
is not transferred to the buffer and remains in the &obj.:PERIOD.
:P.
If a non-zero &fmtwidth. has been specified, it is interpreted as the
maximum number of characters that may be placed in
:ARG.buf
:PERIOD.
No more than &fmtwidth.-1 characters are read
from the &obj. and transferred to
:ARG.buf
:PERIOD.
If &fmtwidth. is zero, characters are transferred until a whitespace
character is found.
:P.
Since these forms of the &fn. use &fmtwidth., it is reset to zero after each
use. It must be set before each input operation that requires a
non-zero &fmtwidth.:PERIOD.
:P.
A null character is added following the last transferred character,
even if the transfer fails because of an error.
:RSLTS.
These forms of the &fn. return a reference to the &obj. so that further
extraction operations may be specified in the same statement.
If no characters are transferred to
:ARG.buf
:CONT., &failbit. is set in the &errstate.:PERIOD.
If the first character read yielded end-of-file, &eofbit. is set in the
&errstate.:PERIOD.
:SALSO.
:SAL typ='mfun'.get
:SAL typ='mfun'.getline
:SAL typ='mfun'.read
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.operator >>
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='operator >>'.istream &.istream::operator >>( char &.ch );
:SNPF index='operator >>'.istream &.istream::operator >>( signed char &.ch );
:SNPF index='operator >>'.istream &.istream::operator >>( unsigned char &.ch );
:eSNPL.
:SMTICS.
These forms of the &fn. perform a formatted read of a single character from
the &obj. and place it in the
:ARG.ch
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -