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

📄 istream_.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
📖 第 1 页 / 共 3 页
字号:
parameter.
: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 the character read yielded end-of-file, &eofbit. is set in the
&errstate.:PERIOD.
:SALSO.
:SAL typ='mfun'.get
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.operator >>
:SNPL.
:SNPFLF                  .#include <iostream.h>
:SNPFLF                  .public:
:SNPF index='operator >>'.istream &amp.istream::operator >>(   signed   int &amp.num );
:SNPF index='operator >>'.istream &amp.istream::operator >>( unsigned   int &amp.num );
:SNPF index='operator >>'.istream &amp.istream::operator >>(   signed  long &amp.num );
:SNPF index='operator >>'.istream &amp.istream::operator >>( unsigned  long &amp.num );
:SNPF index='operator >>'.istream &amp.istream::operator >>(   signed short &amp.num );
:SNPF index='operator >>'.istream &amp.istream::operator >>( unsigned short &amp.num );
:eSNPL.
:SMTICS.
These forms the &fn. perform a formatted read of an integral value from
the &obj. and place it in the
:ARG.num
parameter.
:P.
The number may be preceded by a
:MONO.+
or
:MONO.-
sign.
:P.
If
:MONO.ios::dec
is the only bit set in the
:MONO.ios::basefield
bits of &fmtflags., the number is interpreted as a decimal (base 10)
integer, composed of the digits
:MONO.0123456789
:PERIOD.
:P.
If
:MONO.ios::oct
is the only bit set in the
:MONO.ios::basefield
bits of &fmtflags., the number is interpreted as an octal (base 8)
integer, composed of the digits
:MONO.01234567
:PERIOD.
:P.
If
:MONO.ios::hex
is the only bit set in the
:MONO.ios::basefield
bits of &fmtflags., the number is interpreted as a hexadecimal
(base 16) integer, composed of the digits
:MONO.0123456789
and the letters
:MONO.abcdef
or
:MONO.ABCDEF
:PERIOD.
:P.
If no bits are set in the
:MONO.ios::basefield
bits of &fmtflags., the operator looks for a prefix to determine the
base of the number. If the first two characters are
:MONO.0x
or
:MONO.0X
:CONT., the number is interpreted as a hexadecimal number. If the first
character is a
:MONO.0
(and the second is not an
:MONO.x
or
:MONO.X
:CONT.), the number is interpreted as an octal integer. Otherwise, no
prefix is expected and the number is interpreted as a decimal integer.
:P.
If more than one bit is set in the
:MONO.ios::basefield
bits of &fmtflags., the number is interpreted as a decimal integer.
: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 end-of-file is encountered as the first character, &eofbit. is set in
the &errstate.:PERIOD.
If an overflow occurs while converting to the required integer type, the
&failbit. is set in the &errstate.:PERIOD.
:SALSO.
:SAL typ='omtyp' ocls='ios'.fmtflags
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.operator >>
:SNPL.
:SNPFLF                  .#include <iostream.h>
:SNPFLF                  .public:
:SNPF index='operator >>'.istream &amp.istream::operator >>(       float &amp.num );
:SNPF index='operator >>'.istream &amp.istream::operator >>(      double &amp.num );
:SNPF index='operator >>'.istream &amp.istream::operator >>( long double &amp.num );
:eSNPL.
:SMTICS.
These forms of the &fn. perform a formatted read of a floating-point value
from the &obj. and place it in the
:ARG.num
parameter.
:P.
The floating-point value may be specified in any form that is acceptable to
the C++ compiler.
: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 end-of-file is encountered as the first character, &eofbit. is set in
the &errstate.:PERIOD.
If an overflow occurs while converting to the required type, the
&failbit. 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 &amp.istream::operator >>( streambuf &amp.sb );
:eSNPL.
:SMTICS.
This form of the &fn. transfers all the characters from the &obj. into the
:ARG.sb
parameter. Reading continues until end-of-file is encountered.
:RSLTS.
This form of the &fn. return a reference to the &obj. so that further
extraction operations may be specified in the same statement.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.operator >>
:SNPL.
:SNPFLF                  .#include <iostream.h>
:SNPFLF                  .public:
:SNPF index='operator >>'.istream &amp.istream::operator >>( istream &(*fn)( istream & ) );
:SNPF index='operator >>'.istream &amp.istream::operator >>(     ios &(*fn)( ios     & ) );
:eSNPL.
:SMTICS.
These forms of the &fn. are used to implement the non-parameterized
manipulators for the &cls.:PERIOD.
The function specified by the
:ARG.fn
parameter is called with the &obj. as its parameter.
:RSLTS.
These forms of the &fn. return a reference to the &obj. so that further
extraction operations may be specified in the same statement.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.peek
:SNPL.
:SNPFLF           .#include <iostream.h>
:SNPFLF           .public:
:SNPF index='peek'.int istream::peek();
:eSNPL.
:SMTICS.
The &fn. looks up the next character to be extracted from the &obj.,
without extracting the character.
:RSLTS.
The &fn. returns the next character to be extracted from the &obj.:PERIOD.
If the &obj. is positioned at end-of-file, &eof. is returned.
:SALSO.
:SAL typ='mfun'.get
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.putback
:SNPL.
:SNPFLF              .#include <iostream.h>
:SNPFLF              .public:
:SNPF index='putback'.istream &amp.istream::putback( char ch );
:eSNPL.
:SMTICS.
The &fn. attempts to put the extracted character specified by the
:ARG.ch
parameter back into the &obj.:PERIOD.
The
:ARG.ch
character must be the same as the character before the current position of
the &obj., usually the last character extracted from the stream.
If it is not the same character, the result of the next character extraction
is undefined.
:P.
The number of characters that can be put back is defined by the &obj., but
is usually at least 4. Depending on the status of the buffers used for input,
it may be possible to put back more than 4 characters.
:RSLTS.
The &fn. returns a reference to the &obj.:PERIOD.
If the &fn. is unable to put back the
:ARG.ch
parameter, &failbit. is set in the &errstate.:PERIOD.
:SALSO.
:SAL typ='mfun'.get
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.read
:SNPL.
:SNPFLF           .#include <iostream.h>
:SNPFLF           .public:
:SNPF index='read'.istream &amp.istream::read(          char *buf, int len );
:SNPF index='read'.istream &amp.istream::read(   signed char *buf, int len );
:SNPF index='read'.istream &amp.istream::read( unsigned char *buf, int len );
:eSNPL.
:SMTICS.
The &fn. performs an unformatted read of at most
:ARG.len
characters from the &obj. and stores them in the memory locations starting at
:ARG.buf
:PERIOD.
If end-of-file is encountered before
:ARG.len
characters have been transferred, the transfer stops and &failbit.
is set in the &errstate.:PERIOD.
:P.
The number of characters extracted can be determined with the
:MONO.gcount
member function.
: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.
If end-of-file is encountered before
:ARG.len
characters are transferred, &failbit. is set in the &errstate.:PERIOD.
:SALSO.
:SAL typ='mfun'.gcount
:SAL typ='mfun'.get
:SAL typ='mfun'.getline
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.seekg
:SNPL.
:SNPFLF            .#include <iostream.h>
:SNPFLF            .public:
:SNPF index='seekg'.istream &amp.istream::seekg( streampos pos );
:eSNPL.
:SMTICS.
The &fn. positions the &obj. to the position specified by the
:ARG.pos
parameter so that the next input operation commences from that position.
:RSLTS.
The &fn. returns a reference to the &obj.:PERIOD.
If the seek operation fails, &failbit. is set in the &errstate.:PERIOD.
:SALSO.
:SAL typ='mfun'.tellg
:SAL typ='ofun' ocls='ostream'.tellp
:SAL typ='ofun' ocls='ostream'.seekp
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.seekg
:SNPL.
:SNPFLF            .#include <iostream.h>
:SNPFLF            .public:
:SNPF index='seekg'.istream &amp.istream::seekg( streamoff offset, ios::seekdir dir );
:eSNPL.
:SMTICS.
The &fn. positions the &obj. to the specified position so that the next input
operation commences from that position.
:INCLUDE file='seekdir'.
:RSLTS.
The &fn. returns a reference to the &obj.:PERIOD.
If the seek operation fails, &failbit. is set in the &errstate.:PERIOD.
:SALSO.
:SAL typ='ofun' ocls='ostream'.tellp
:SAL typ='ofun' ocls='ostream'.seekp
:SAL typ='mfun'.tellg
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.sync
:SNPL.
:SNPFLF           .#include <iostream.h>
:SNPFLF           .public:
:SNPF index='sync'.int istream::sync();
:eSNPL.
:SMTICS.
The &fn. synchronizes the input buffer and the &obj. with whatever source of
characters is being used.
The &fn. uses the
:MONO.streambuf
class's
:MONO.sync
virtual member function to carry out the synchronization.
The specific behavior is dependent on what type of
:MONO.streambuf
derived object is associated with the &obj.:PERIOD.
:RSLTS.
The &fn. returns &noteof. on success, otherwise &eof. is returned.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.tellg
:SNPL.
:SNPFLF            .#include <iostream.h>
:SNPFLF            .public:
:SNPF index='tellg'.streampos istream::tellg();
:eSNPL.
:SMTICS.
The &fn. determines the position in the &obj. of the next character available
for reading.
The first character in an &obj. is at offset zero.
:RSLTS.
The &fn. returns the position of the next character available for reading.
:SALSO.
:SAL typ='ofun' ocls='ostream'.tellp
:SAL typ='ofun' ocls='ostream'.seekp
:SAL typ='mfun'.seekg
:eSALSO.
:eLIBF.

⌨️ 快捷键说明

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