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

📄 ios_.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
📖 第 1 页 / 共 3 页
字号:
If
:MONO.ios::dec
is set (or assumed), the integer is written in decimal (digits
:MONO.0123456789
:CONT.). No prefix is included.
:P.
If
:MONO.ios::oct
is set, the integer is written in octal (digits
:MONO.01234567
:CONT.). No sign character is written, as the number is treated as an
unsigned quantity upon conversion to octal.
:P.
If
:MONO.ios::hex
is set, the integer is written in hexadecimal (digits
:MONO.0123456789
:CONT., plus the letters
:MONO.abcdef
or
:MONO.ABCDEF
:CONT., depending on the setting of
:MONO.ios::uppercase
:CONT.).
No sign character is written, as the number is treated as an unsigned
quantity upon conversion to hexadecimal.
:P.
:MONO.ios::showbase
controls whether or not integers written to the stream in octal or
hexadecimal form have a prefix that indicates the base of the number.
If the bit is set, decimal numbers are written without a prefix,
octal numbers are written with the prefix
:MONO.0
(zero) and hexadecimal numbers are written with the prefix
:MONO.0x
or
:MONO.0X
depending on the setting of
:MONO.ios::uppercase
:PERIOD.
If the
:MONO.ios::showbase
is not set, no prefixes are written.
:P.
:MONO.ios::showpoint
is used to control whether or not the decimal point and trailing zeroes are
trimmed when floating-point numbers are written to the stream. If the bit is
set, no trimming is done, causing the number to appear with the
specified &fmtprec.:PERIOD.
If the bit is not set, any trailing zeroes after
the decimal point are trimmed, and if not followed by any digits, the
decimal point is removed as well.
:P.
:MONO.ios::uppercase
is used to force to upper-case all letters used in formatting numbers,
including the letter-digits
:MONO.abcdef
:CONT.,
the
:MONO.x
hexadecimal prefix, and the
:MONO.e
used for the exponents in floating-point numbers.
:P.
:MONO.ios::showpos
controls whether or not a
:MONO.+
is added to the front of positive integers being written to the stream. If
the bit is set, the number is positive and the number is being written in
decimal, a
:MONO.+
is written before the first digit.
:P.
:MONO.ios::scientific
and
:MONO.ios::fixed
controls the form used for writing floating-point numbers to the stream.
Floating-point numbers can be written in scientific notation (also
called exponential notation) or in fixed-point notation.
:P.
:MONO.ios::floatfield
can be used to mask the floating-format bits returned by the member functions
:MONO.setf
:CONT.,
:MONO.unsetf
and
:MONO.flags
:CONT.,
and for setting new values to ensure that no other bits are accidentally
affected.
:P.
If
:MONO.ios::scientific
is set, the floating-point number is written with a leading
:MONO.-
sign (for negative numbers), a digit, a decimal point, more digits, an
:MONO.e
(or
:MONO.E
if
:MONO.ios::uppercase
is set), a
:MONO.+
or
:MONO.-
sign, and two or three digits representing the exponent. The digit
before the decimal is not zero unless the number is zero. The total number of
digits before and after the decimal is equal to the specified &fmtprec.:PERIOD.
If
:MONO.ios::showpoint
is not set, trimming of the decimal and digits following the decimal
may occur.
:P.
If
:MONO.ios::fixed
is set, the floating-point number is written with a
:MONO.-
sign (for negative numbers), at least one digit, the decimal point,
and as many digits following the decimal as specified by the &fmtprec.:PERIOD.
If
:MONO.ios::showpoint
is not set, trimming of the decimal and digits following the decimal
may occur.
:P.
If neither
:MONO.ios::scientific
nor
:MONO.ios::fixed
is specified, the floating-point number is formatted using scientific
notation provided one or both of the following conditions are met:
:UL.
:LI.the exponent is less than -4, or,
:LI.the exponent is greater than the &fmtprec.:PERIOD.
:eUL.
:P.
Otherwise, fixed-point notation is used.
:P.
:MONO.ios::unitbuf
controls whether or not the stream is flushed after each item is written.
If the bit is set, every item that is written to the stream is followed
by a flush operation, which ensures that the I/O stream buffer associated
with the stream is kept empty, immediately transferring the data to its final
destination.
:P.
:MONO.ios::stdio
controls whether or not the stream is synchronized after each item is written.
If the bit is set, every item that is written to the stream causes the
stream to be synchronized, which means any input or output buffers are
flushed so that an I/O operation performed using C (not C++) I/O behaves in
an understandable way. If the output buffer was not flushed, writing
using C++ and then C I/O functions could cause the output from the C
functions to appear before the output from the C++ functions, since the
characters might be sitting in the C++ output buffer. Similarly, after the C
output operations are done, a call should be made to the C library
:MONO.fflush
function on the appropriate stream before resuming C++ output operations.
:SALSO.
:SAL typ='mfun'.flags
:SAL typ='mfun'.setf
:SAL typ='mfun'.unsetf
:SAL typ='mnp'.dec
:SAL typ='mnp'.hex
:SAL typ='mnp'.oct
:SAL typ='mnp'.resetiosflags
:SAL typ='mnp'.setbase
:SAL typ='mnp'.setiosflags
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.good
:SNPL.
:SNPFLF           .#include <iostream.h>
:SNPFLF           .public:
:SNPF index='good'.int ios::good() const;
:eSNPL.
:SMTICS.
The &fn. queries the state of the &obj.:PERIOD.
:RSLTS.
The &fn. returns a non-zero value if none of &iostate. is clear,
otherwise zero is returned.
:SALSO.
:SAL typ='mfun'.bad
:SAL typ='mfun'.clear
:SAL typ='mfun'.eof
:SAL typ='mfun'.fail
:SAL typ='mtyp'.iostate
:SAL typ='mfun'.rdstate
:SAL typ='mfun'.setstate
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public protected'.init
:SNPL.
:SNPFLF           .#include <iostream.h>
:SNPFLF           .protected:
:SNPF index='init'.void ios::init( streambuf *sb );
:eSNPL.
:SMTICS.
The &fn. is used by derived classes to explicitly initialize the
:MONO.ios
portion of the derived object, and to associate a
:MONO.streambuf
with the &obj.:PERIOD.
The &fn. performs the following steps:
:OL.
:LI.The default &fillchar. is set to a space.
:LI.The &fmtprec. is set to six.
:LI.The
:MONO.streambuf
pointer (returned by the
:MONO.rdbuf
member function) is set to
:ARG.sb
:PERIOD.
:LI.The remaining fields of the &obj. are initialized to zero.
:eOL.
:RSLTS.
If
:ARG.sb
is &null.
the &badbit. is set in the &errstate.:PERIOD.
:SALSO.
:SAL typ='ctor'.
:SAL typ='mfun'.rdbuf
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='ctor' prot='protected'.ios
:SNPL.
:SNPFLF                    .#include <iostream.h>
:SNPFLF                    .protected:
:SNPCD cd_idx='c'.ios::ios();
:eSNPL.
:SMTICS.
This form of the &fn. creates a default &obj. that is initialized,
but does not have an associated
:MONO.streambuf
:PERIOD.
Initialization of an &obj. is handled by the
:MONO.init
protected member function.
:RSLTS.
This &fn. creates an &obj. and sets &badbit. in the &errstate.:PERIOD.
:SALSO.
:SAL typ='dtor'.
:SAL typ='mfun'.init
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='ctor' prot='public'.ios
:SNPL.
:SNPFLF                    .#include <iostream.h>
:SNPFLF                    .public:
:SNPCD cd_idx='c'.ios::ios( streambuf *sb );
:eSNPL.
:SMTICS.
This form of the &fn. creates an &obj. that is initialized and has an associated
:MONO.streambuf
:PERIOD.
Initialization of an &obj. is handled by the
:MONO.init
protected member function.
Once the
:MONO.init
protected member function is completed, the &obj.'s
:MONO.streambuf
pointer is set to
:ARG.sb
:PERIOD.
If
:ARG.sb
is not &null., &badbit. is cleared from the &errstate.:PERIOD.
:RSLTS.
This &fn. creates an &obj. and, if
:ARG.sb
is &null.
:CONT., sets &badbit. in the &errstate.:PERIOD.
:SALSO.
:SAL typ='dtor'.
:SAL typ='mfun'.init
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='dtor' prot='public virtual'.~~ios
:SNPL.
:SNPFLF                   .#include <iostream.h>
:SNPFLF                   .public:
:SNPCD cd_idx='d'.virtual ios::~~ios();
:eSNPL.
:SMTICS.
The &fn. destroys an &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='mtyp' prot='public'.iostate
:SNPL.
:SNPFLF              .#include <iostream.h>
:SNPFLF              .public:
:SNPFLF              .enum io_state {
:SNPT index='goodbit'.  goodbit = 0x00, // no errors
:SNPT index='badbit' .  badbit  = 0x01, // operation failed, may not proceed
:SNPT index='failbit'.  failbit = 0x02, // operation failed, may proceed
:SNPT index='eofbit' .  eofbit  = 0x04  // end of file encountered
:SNPFLF              .};
:SNPT index='iostate'.typedef int iostate;
:eSNPL.
:SMTICS.
The type
:MONO.ios::io_state
is a set of bits representing the current state of the stream.
The &fn. represents the same set of bits, but uses an
:MONO.int
to represent the values, thereby avoiding problems made possible by the
compiler's ability to use smaller types for enumerations.
All uses of these bits should use the &fn.:PERIOD.
:P.
The bit values defined by the &fn. can be read and set by the
member functions
:MONO.rdstate
and
:MONO.clear
:CONT.,
and can be used to control exception handling with the member function
:MONO.exceptions
:PERIOD.
:P.
&badbit. represents the state where the stream is
no longer usable because of some error condition.
:P.
&failbit.  represents the state where the previous operation on the
stream failed, but the stream is still usable.  Subsequent operations on
the stream are possible, but the state must be cleared using the
:MONO.clear
member function.
:P.
&eofbit. represents the state where the end-of-file condition has been
encountered.
The stream may still be used, but the state must be cleared using the
:MONO.clear
member function.
:P.
Even though &goodbit. is not a bit value (because its value is zero,
which has no bits on), it is provided for completeness.
:SALSO.
:SAL typ='mtyp'.bad
:SAL typ='mtyp'.clear
:SAL typ='mtyp'.eof
:SAL typ='mtyp'.fail
:SAL typ='mtyp'.good
:SAL typ='mfun'.operator~b!
:SAL typ='mfun'.operator~bvoid~b*
:SAL typ='mfun'.rdstate
:SAL typ='mfun'.setstate
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.iword
:SNPL.
:SNPFLF            .#include <iostream.h>
:SNPFLF            .public:
:SNPF index='iword'.long &amp.ios::iword( int index );
:eSNPL.
:SMTICS.
The &fn. creates a reference to a
:MONO.long int
:CONT., which may be used to store and retrieve any suitable integer value.
The
:ARG.index
parameter specifies which
:MONO.long int
is to be referenced and must be obtained from a call to the
:MONO.xalloc
static member function.
:INCLUDE file='ipword'.
:RSLTS.
The &fn. returns a reference to a
:MONO.long int
:PERIOD.
:SALSO.
:SAL typ='mfun'.pword
:SAL typ='mfun'.xalloc
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mtyp' prot='public'.openmode
:SNPL.
:SNPFLF                .#include <iostream.h>
:SNPFLF                .public:
:SNPFLF                .enum open_mode {
:SNPT index='in'       .  in        = 0x0001, // open for input
:SNPT index='out'      .  out       = 0x0002, // open for output
:SNPT index='atend'    .  atend     = 0x0004, // seek to end after opening
:SNPT index='append'   .  append    = 0x0008, // open for output, append to the end
:SNPT index='truncate' .  truncate  = 0x0010, // discard contents after opening
:SNPT index='nocreate' .  nocreate  = 0x0020, // open only an existing file
:SNPT index='noreplace'.  noreplace = 0x0040, // open only a new file
:SNPT index='text'     .  text      = 0x0080, // open as text file
:SNPT index='binary'   .  binary    = 0x0100, // open as binary file
:BLANKLINE.
:SNPT index='app'      .  app       = append,  // synonym
:SNPT index='ate'      .  ate       = atend,   // synonym
:SNPT index='trunc'    .  trunc     = truncate // synonym
:SNPFLF                .};
:SNPT index='openmode' .typedef int openmode;
:eSNPL.
:SMTICS.
The type
:MONO.ios::open_mode
is a set of bits representing ways of opening a stream.
The &fn. represents the same set of bits, but uses an
:MONO.int
to represent the values, thereby avoiding problems made possible by the
compiler's ability to use smaller types for enumerations.
All uses of these bits should use the &fn.:PERIOD.
:P.
The bit values defined by &fn. can be specified in the constructors
for stream objects, as well as in various member functions.
:P.
:MONO.ios::in
is specified in a stream for which input operations may be performed.
:MONO.ios::out
is specified in a stream for which output operations may be performed.
A stream for which only
:MONO.ios::in
is specified is referred to as an
:ITALICS.input
stream. A stream for which only
:MONO.ios::out
is specified is referred to as an
:ITALICS.output
stream.
A stream where both
:MONO.ios::in
and
:MONO.ios::out
are specified is referred to as an
:ITALICS.input/output
stream.
:P.
:MONO.ios::atend
and
:MONO.ios::ate
are equivalent, and either one is specified for streams that are to be
positioned to the end before the first operation takes place.
:MONO.ios:ate
is provided for historical purposes and
compatibility with other implementations of I/O streams.
Note that this bit positions the stream to the end exactly once, when
the stream is opened.
:P.
:MONO.ios::append
and
:MONO.ios::app
are equivalent, and either one is specified for streams that are to be
positioned to the end before any and all output operations take place.
:MONO.ios::app
is provided for historical purposes and
compatibility with other implementations of I/O streams.
Note that this bit causes the stream to be positioned to the end before
each output operation, while
:MONO.ios::atend
causes the stream to be positioned to the end only when first opened.
:P.
:MONO.ios::truncate
and
:MONO.ios::trunc
are equivalent, and either one is specified for streams that are to be
truncated to zero length before the first operation takes place.
:MONO.ios::trunc
is provided for historical purposes and
compatibility with other implementations of I/O streams.
:P.
:MONO.ios::nocreate
is specified if the file must exist before it is opened.
If the file does not exist, an error occurs.
:P.

⌨️ 快捷键说明

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