📄 ostream_.gml
字号:
:ARG.sb
:MONO.streambuf
object to the &obj.:PERIOD.
Reading from the
:MONO.streambuf
object stops when the read fails. No padding with the &fillchar. takes place
on output to the &obj.:PERIOD.
:RSLTS.
This form of the &fn. returns a reference to the &obj. so that further
insertion operations may be specified in the same statement.
&failbit. is set in the &errstate. if an error occurs.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.operator <<
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='operator <<'.ostream &.ostream::operator <<( ostream &(*fn)( ostream &) );
:SNPF index='operator <<'.ostream &.ostream::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
insertions 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 ='.ostream &.ostream::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 ='.ostream &.ostream::operator =( const ostream &.ostrm );
:eSNPL.
:SMTICS.
This form of the &fn. is used to associate the &obj. with the
:MONO.streambuf
object currently associated with the
:ARG.ostrm
parameter.
The &obj. is initialized and will use the
:ARG.ostrm
:CONT.'s
:MONO.streambuf
object for subsequent operations.
The
:ARG.ostrm
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.ostrm
parameter, &badbit. is set in the &errstate.:PERIOD.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.opfx
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='opfx'.int ostream::opfx();
:eSNPL.
:SMTICS.
If &fn. is a prefix function executed before each of the formatted and
unformatted output operations. If any bits are set in &iostate.,
the &fn. immediately returns zero, indicating that the prefix function failed.
Failure in the prefix function causes the output operation to fail.
:P.
If the &obj. is tied to another &obj., the other &obj. is flushed.
:RSLTS.
The &fn. returns a non-zero value on success, otherwise zero is returned.
:SALSO.
:SAL typ='mfun'.osfx
:SAL typ='mfun'.flush
:SAL typ='ofun' ocls='ios'.tie
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.osfx
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='osfx'.void ostream::osfx();
:eSNPL.
:SMTICS.
The &fn. is a suffix function executed at the end of each
of the formatted and unformatted output operations.
:P.
If the
:MONO.ios::unitbuf
bit is set in &fmtflags., the
:MONO.flush
member function is called. If the
:MONO.ios::stdio
bit is set in &fmtflags., the C library
:MONO.fflush
function is invoked on the
:MONO.stdout
and
:MONO.stderr
file streams.
:SALSO.
:SAL typ='mfun'.osfx
:SAL typ='mfun'.flush
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='ctor' prot='protected'.ostream
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .protected:
:SNPCD cd_idx='c'.ostream::ostream();
:eSNPL.
:SMTICS.
This form of the &fn. creates an &obj. without an attached
: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'.ostream
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPCD cd_idx='c'.ostream::ostream( ostream const &.ostrm );
:eSNPL.
:SMTICS.
This form of the &fn. creates an &obj. associated with the
:MONO.streambuf
object currently associated with the
:ARG.ostrm
parameter.
The &obj. is initialized and will use the
:ARG.ostrm
:CONT.'s
:MONO.streambuf
object for subsequent operations.
The
:ARG.ostrm
object 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.ostrm
parameter, &badbit. is set in the &errstate.:PERIOD.
:SALSO.
:SAL typ='dtor'.
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='ctor' prot='public'.ostream
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPCD cd_idx='c'.ostream::ostream( 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'.~~ostream
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPCD cd_idx='d'.virtual ostream::~~ostream();
: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'.put
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='put'.ostream &.ostream::put( char ch );
:SNPF index='put'.ostream &.ostream::put( signed char ch );
:SNPF index='put'.ostream &.ostream::put( unsigned char ch );
:eSNPL.
:SMTICS.
These forms of the &fn. write the
:ARG.ch
character to the &obj.:PERIOD.
:RSLTS.
These forms of the &fn. return a reference to the &obj.:PERIOD.
If an error occurs, &failbit. is set in the &errstate.:PERIOD.
:SALSO.
:SAL typ='mfun'.operator~b<<
:SAL typ='mfun'.write
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.seekp
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='seekp'.ostream &.ostream::seekp( streampos pos );
:eSNPL.
:SMTICS.
This from of the &fn. positions the &obj. to the position specified by the
:ARG.pos
parameter so that the next output operation commences from that position.
:P.
The
:ARG.pos
value is an absolute position within the stream. It may be obtained via a
call to the
:MONO.tellp
member function.
:RSLTS.
This from of 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'.tellp
:SAL typ='ofun' ocls='istream'.tellg
:SAL typ='ofun' ocls='istream'.seekg
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.seekp
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='seekp'.ostream &.ostream::seekp( streamoff offset, ios::seekdir dir );
:eSNPL.
:SMTICS.
This from of the &fn. positions the &obj. to the specified position so that the next output
operation commences from that position.
:INCLUDE file='seekdir'.
:RSLTS.
This from of 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'.tellp
:SAL typ='ofun' ocls='istream'.tellg
:SAL typ='ofun' ocls='istream'.seekg
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.tellp
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='tellp'.streampos ostream::tellp();
:eSNPL.
:SMTICS.
The &fn. returns the position in the &obj. at which the next character
will be written.
The first character in an &obj. is at offset zero.
:RSLTS.
The &fn. returns the position in the &obj. at which the next character
will be written.
:SALSO.
:SAL typ='mfun'.seekp
:SAL typ='ofun' ocls='istream'.tellg
:SAL typ='ofun' ocls='istream'.seekg
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.write
:SNPL.
:SNPFLF .#include <iostream.h>
:SNPFLF .public:
:SNPF index='write'.ostream &.ostream::write( char const *buf, int len );
:SNPF index='write'.ostream &.ostream::write( signed char const *buf, int len );
:SNPF index='write'.ostream &.ostream::write( unsigned char const *buf, int len );
:eSNPL.
:SMTICS.
The &fn. performs an unformatted write of the characters specified by the
:ARG.buf
and
:ARG.len
parameters into the &obj.:PERIOD.
:RSLTS.
These member functions return a reference to the &obj.:PERIOD.
If an error occurs, &failbit. is set in the &errstate.:PERIOD.
:eLIBF.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -