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

📄 istream_.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
📖 第 1 页 / 共 3 页
字号:
:CLFNM.istream
:CMT.========================================================================
:LIBF fmt='hdr'.istream
:HFILE.iostream.h
:DVFML.
:DVFM.ios
:eDVFML.
:DVBYL.
:DVBY.iostream
:DVBY.ifstream
:DVBY.istrstream
:eDVBYL.
:CLSS.
The &cls. supports reading characters from a class derived from
:MONO.streambuf
:CONT., and provides formatted conversion of characters into other types
(such as integers and floating-point numbers). The
:MONO.streambuf
class provides the methods for communicating with the external device
(keyboard, disk), while the &cls. provides the interpretation of the
resulting characters.
:P.
Generally, an &obj.  won't be explicitly created by a program, since
there is no mechanism at this level to open a device.  The only default
&obj.  in a program is &cin., which reads from standard input (usually
the keyboard).
:P.
The &cls. supports two basic concepts of input: formatted and unformatted.
The overloaded
:MONO.operator~b>>
member functions are called
:ITALICS.extractors
:I1.extractor
and they provide the support for formatted input. The rest of the member
functions deal with unformatted input, managing the state of the
:MONO.ios
object and providing a friendlier interface to the associated
:MONO.streambuf
object.
:HDG.Protected Member Functions
The following protected member functions are declared:
:MFNL.
:MFCD cd_idx='c'     .istream();
:MFN index='eatwhite'.eatwhite();
:eMFNL.
:HDG.Public Member Functions
The following public member functions are declared:
:MFNL.
:MFCD cd_idx='c'.istream( istream const & );
:MFCD cd_idx='c'.istream( streambuf * );
:MFCD cd_idx='d' .virtual ~~istream();
:MFN index='ipfx'         .int ipfx( int = 0 );
:MFN index='isfx'         .void isfx();
:MFN index='get'          .int get();
:MFN index='get'          .istream &amp.get(          char *, int, char = '\n' );
:MFN index='get'          .istream &amp.get(   signed char *, int, char = '\n' );
:MFN index='get'          .istream &amp.get( unsigned char *, int, char = '\n' );
:MFN index='get'          .istream &amp.get(          char & );
:MFN index='get'          .istream &amp.get(   signed char & );
:MFN index='get'          .istream &amp.get( unsigned char & );
:MFN index='get'          .istream &amp.get( streambuf &, char = '\n' );
:MFN index='getline'      .istream &amp.getline(          char *, int, char = '\n' );
:MFN index='getline'      .istream &amp.getline(   signed char *, int, char = '\n' );
:MFN index='getline'      .istream &amp.getline( unsigned char *, int, char = '\n' );
:MFN index='ignore'       .istream &amp.ignore( int = 1, int = EOF );
:MFN index='read'         .istream &amp.read(          char *, int );
:MFN index='read'         .istream &amp.read(   signed char *, int );
:MFN index='read'         .istream &amp.read( unsigned char *, int );
:MFN index='seekg'        .istream &amp.seekg( streampos );
:MFN index='seekg'        .istream &amp.seekg( streamoff, ios::seekdir );
:MFN index='putback'      .istream &amp.putback( char );
:MFN index='tellg'        .streampos tellg();
:MFN index='gcount'       .int gcount() const;
:MFN index='peek'         .int peek();
:MFN index='sync'         .int sync();
:eMFNL.
:HDG.Public Member Operators
The following public member operators are declared:
:MFNL.
:MFN index='operator =' .istream &amp.operator  =( streambuf * );
:MFN index='operator =' .istream &amp.operator  =( istream const & );
:MFN index='operator >>'.istream &amp.operator >>(          char * );
:MFN index='operator >>'.istream &amp.operator >>(   signed char * );
:MFN index='operator >>'.istream &amp.operator >>( unsigned char * );
:MFN index='operator >>'.istream &amp.operator >>(          char & );
:MFN index='operator >>'.istream &amp.operator >>(   signed char & );
:MFN index='operator >>'.istream &amp.operator >>( unsigned char & );
:MFN index='operator >>'.istream &amp.operator >>(   signed short & );
:MFN index='operator >>'.istream &amp.operator >>( unsigned short & );
:MFN index='operator >>'.istream &amp.operator >>(   signed int & );
:MFN index='operator >>'.istream &amp.operator >>( unsigned int & );
:MFN index='operator >>'.istream &amp.operator >>(   signed long & );
:MFN index='operator >>'.istream &amp.operator >>( unsigned long & );
:MFN index='operator >>'.istream &amp.operator >>(       float & );
:MFN index='operator >>'.istream &amp.operator >>(      double & );
:MFN index='operator >>'.istream &amp.operator >>( long double & );
:MFN index='operator >>'.istream &amp.operator >>( streambuf & );
:MFN index='operator >>'.istream &amp.operator >>( istream &(*)( istream & ) );
:MFN index='operator >>'.istream &amp.operator >>(     ios &(*)( ios     & ) );
:eMFNL.
:eCLSS.
:SALSO.
:SAL typ='cls'.ios
:SAL typ='cls'.iostream
:SAL typ='cls'.ostream
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='protected'.eatwhite
:SNPL.
:SNPFLF               .#include <iostream.h>
:SNPFLF               .protected:
:SNPF index='eatwhite'.void istream::eatwhite();
:eSNPL.
:SMTICS.
The &fn. extracts and discards whitespace characters from the &obj.,
until a non-whitespace character is found. The non-whitespace character
is not extracted.
:RSLTS.
The &fn. sets &eofbit. in the &errstate. if end-of-file
is encountered as the first character while extracting whitespace characters.
:SALSO.
:SAL typ='mfun'.ignore
:SAL typ='omtyp' ocls='ios'.fmtflags
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.gcount
:SNPL.
:SNPFLF             .#include <iostream.h>
:SNPFLF             .public:
:SNPF index='gcount'.int istream::gcount() const;
:eSNPL.
:SMTICS.
The &fn. determines the number of characters extracted by the last unformatted
input member function.
:RSLTS.
The &fn. returns the number of characters extracted by the last unformatted
input member function.
:SALSO.
:SAL typ='mfun'.get
:SAL typ='mfun'.getline
:SAL typ='mfun'.read
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.get
:SNPL.
:SNPFLF          .#include <iostream.h>
:SNPFLF          .public:
:SNPF index='get'.int istream::get();
:eSNPL.
:SMTICS.
This form of the &fn. performs an unformatted read of a single character from
the &obj.:PERIOD.
:RSLTS.
This form of the &fn. returns the character read from the &obj.:PERIOD.
If the &obj. is positioned at end-of-file before the read, &eof. is returned
and &eofbit. bit is set in the &errstate.:PERIOD.
&failbit. bit is not
set by this form of the &fn.:PERIOD.
:SALSO.
:SAL typ='mfun'.putback
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.get
:SNPL.
:SNPFLF          .#include <iostream.h>
:SNPFLF          .public:
:SNPF index='get'.istream &amp.istream::get(          char &amp.ch );
:SNPF index='get'.istream &amp.istream::get(   signed char &amp.ch );
:SNPF index='get'.istream &amp.istream::get( unsigned char &amp.ch );
:eSNPL.
:SMTICS.
These forms of the &fn. perform an unformatted read of a single character
from the &obj. and store the character in the
:ARG.ch
parameter.
:RSLTS.
These forms of the &fn. return a reference to the &obj.:PERIOD.
&eofbit. is set in the &errstate. if the &obj. is positioned at
end-of-file before the attempt to read the character.
&failbit. is set in the &errstate. if no character is read.
:SALSO.
:SAL typ='mfun'.read
:SAL typ='mfun'.operator~b>>
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.get
:SNPL.
:SNPFLF          .#include <iostream.h>
:SNPFLF          .public:
:SNPF index='get'.istream &amp.istream::get( char *buf, int len,
:SNPFLF          .                       char delim = '\n' );
:SNPF index='get'.istream &amp.istream::get( signed char *buf, int len,
:SNPFLF          .                       char delim = '\n' );
:SNPF index='get'.istream &amp.istream::get( unsigned char *buf, int len,
:SNPFLF          .                       char delim = '\n' );
:eSNPL.
:SMTICS.
These forms of the &fn. perform an unformatted read of at most
:ARG.len
-1 characters from the &obj. and store them starting at the memory
location specified by the
:ARG.buf
parameter. If the character specified by the
:ARG.delim
parameter is encountered in the &obj. before
:ARG.len
-1 characters have been read, the read terminates without
extracting the delimiting character.
:P.
After the read terminates, whether or not an error occurred, a null
character is stored in
:ARG.buf
following the last character read from the &obj.:PERIOD.
:P.
If the
:ARG.delim
parameter is not specified, the new-line character is assumed.
:RSLTS.
These forms of the &fn. return a reference to the &obj.:PERIOD.
If end-of-file is encountered as the first character, &eofbit. is set in
the &errstate.:PERIOD.
If no characters are stored into
:ARG.buf,
&failbit. is set in the &errstate.:PERIOD.
:SALSO.
:SAL typ='mfun'.getline
:SAL typ='mfun'.read
:SAL typ='mfun'.operator~b>>
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.get
:SNPL.
:SNPFLF          .#include <iostream.h>
:SNPFLF          .public:
:SNPF index='get'.istream &amp.istream::get( streambuf &amp.sb, char delim = '\n' );
:eSNPL.
:SMTICS.
This form of the &fn. performs an unformatted read of
characters from the &obj. and transfers them to the
:MONO.streambuf
object specified in the
:ARG.sb
parameter. The transfer stops if end-of-file is encountered, the
delimiting character specified in the
:ARG.delim
parameter is found, or if the store into the
:ARG.sb
parameter fails. If the
:ARG.delim
character is found, it is not extracted from the &obj. and is not transferred
to the
:ARG.sb
object.
:P.
If the
:ARG.delim
parameter is not specified, the new-line character is assumed.
:RSLTS.
The &fn. returns a reference to the &obj.:PERIOD.
&failbit. is set in the &errstate. if the store into the
:MONO.streambuf
object fails.
:SALSO.
:SAL typ='mfun'.getline
:SAL typ='mfun'.read
:SAL typ='mfun'.operator~b>>
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.getline
:SNPL.
:SNPFLF              .#include <iostream.h>
:SNPFLF              .public:
:SNPF index='getline'.istream &amp.istream::getline( char *buf, int len,
:SNPFLF              .                           char delim = '\n' );
:SNPF index='getline'.istream &amp.istream::getline( signed char *buf, int len,
:SNPFLF              .                           char delim = '\n' );
:SNPF index='getline'.istream &amp.istream::getline( unsigned char *buf, int len,
:SNPFLF              .                           char delim = '\n' );
:eSNPL.
:SMTICS.
The &fn. performs an unformatted read of at most
:ARG.len
-1 characters from the &obj. and stores them starting at the memory
location specified by the
:ARG.buf
parameter. If the delimiting character, specified by the
:ARG.delim
parameter, is encountered in the &obj. before
:ARG.len
-1 characters have been read, the read terminates after
extracting the
:ARG.delim
character.
:P.
If
:ARG.len
-1 characters have been read and the next character is the
:ARG.delim
character, it is not extracted.
:P.
After the read terminates, whether or not an error occurred, a null
character is stored in the buffer following the last character
read from the &obj.:PERIOD.
:P.
If the
:ARG.delim
parameter is not specified, the new-line character is assumed.
: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

⌨️ 快捷键说明

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