ios.html

来自「ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片」· HTML 代码 · 共 1,354 行 · 第 1/4 页

HTML
1,354
字号
<LI><CODE><A HREF="#ios_base::flags">flags</A>()</CODE> returns<CODE><A HREF="#ios_base::skipws">skipws</A> |<A HREF="#ios_base::dec">dec</A></CODE></LI><LI><CODE><A HREF="#ios_base::width">width</A>()</CODE> returns zero</LI><LI><CODE><A HREF="#ios_base::precision">precision</A>()</CODE>returns 6</LI><LI><CODE><A HREF="#ios::fill">fill</A>()</CODE> returns thespace character</LI><LI><CODE><A HREF="#ios_base::getloc">getloc</A>()</CODE> returns<CODE><A HREF="#locale">locale</A>()</CODE>.</LI><LI><CODE><A HREF="#ios_base::iword">iword</A></CODE> returns zero and<CODE><A HREF="#ios_base::pword">pword</A></CODE> returns a nullpointer for all argument value</LI></UL><H3><A NAME="ios::int_type"><CODE>ios::int_type</CODE></A></H3><PRE>typedef int <B>int_type</B>;</PRE><P>The type is a synonym for <I>int.</I></P><H3><A NAME="ios::narrow"><CODE>ios::narrow</CODE></A></H3><PRE>char <B>narrow</B>(char_type ch, char dflt);</PRE><P>The member function returns<CODE>ch</CODE>.</P><H3><A NAME="ios::off_type"><CODE>ios::off_type</CODE></A></H3><PRE>typedef streamoff <B>off_type</B>;</PRE><P>The type is a synonym for<CODE><A HREF="#streamoff">streamoff</A></CODE>.</P><H3><A NAME="ios::operator void *"><CODE>ios::operator void *</CODE></A></H3><PRE><B>operator void *</B>() const;</PRE><P>The operator returns a null pointer only if<CODE><A HREF="#ios::fail">fail</A>()</CODE>.</P><H3><A NAME="ios::operator!"><CODE>ios::operator!</CODE></A></H3><PRE>bool <B>operator!</B>() const;</PRE><P>The operator returns<CODE><A HREF="#ios::fail">fail</A>()</CODE>.</P><H3><A NAME="ios::pos_type"><CODE>ios::pos_type</CODE></A></H3><PRE>typedef streampos <B>pos_type</B>;</PRE><P>The type is a synonym for<CODE><A HREF="#streampos">streampos</A></CODE>.</P><H3><A NAME="ios::rdbuf"><CODE>ios::rdbuf</CODE></A></H3><PRE>streambuf *<B>rdbuf</B>() const;streambuf *<B>rdbuf</B>(streambuf *strbuf);</PRE><P>The first member function returns the stored<A HREF="#stream buffer pointer">stream buffer pointer</A>.</P><P>The second member function stores <CODE>strbuf</CODE> in the stored<A HREF="#stream buffer pointer">stream buffer pointer</A>and returns the previously stored value.</P><H3><A NAME="ios::rdstate"><CODE>ios::rdstate</CODE></A></H3><PRE>iostate <B>rdstate</B>() const;</PRE><P>The member function returns the stored<A HREF="#stream state information">stream state information</A>.</P><H3><A NAME="ios::setstate"><CODE>ios::setstate</CODE></A></H3><PRE>void <B>setstate</B>(iostate state);</PRE><P>The member function effectively calls<CODE><A HREF="#ios::clear">clear</A>(state |<A HREF="#ios::rdstate">rdstate</A>())</CODE>.</P><H3><A NAME="ios::tie"><CODE>ios::tie</CODE></A></H3><PRE>ostream *<B>tie</B>() const;ostream *<B>tie</B>(ostream *newtie);</PRE><P>The first member function returns the stored<A HREF="#tie pointer">tie pointer</A>. The second member functionstores <CODE>newtie</CODE> in the tie pointer and returns its previousstored value.</P><H3><A NAME="ios::traits_type"><CODE>ios::traits_type</CODE></A></H3><PRE>typedef char_traits <B>traits_type</B>;</PRE><P>The type is a synonym for<CODE><A HREF="string2.html#char_traits">char_traits</A></CODE>.</P><H3><A NAME="ios::widen"><CODE>ios::widen</CODE></A></H3><PRE>char_type <B>widen</B>(char ch);</PRE><P>The member function returns<CODE>ch</CODE>.</P><H2><A NAME="boolalpha"><CODE>boolalpha</CODE></A></H2><PRE>ios_base&amp; <B>boolalpha</B>(ios_base&amp; iosbase);</PRE><P>The manipulator effectively calls<CODE>iosbase.<A HREF="#ios_base::setf">setf</A>(ios_base::<A HREF="#ios_base::boolalpha">boolalpha</A>)</CODE>, then returns<CODE>iosbase</CODE>.</P><H2><A NAME="dec"><CODE>dec</CODE></A></H2><PRE>ios_base&amp; <B>dec</B>(ios_base&amp; iosbase);</PRE><P>The manipulator effectively calls<CODE>iosbase.<A HREF="#ios_base::setf">setf</A>(ios_base::<A HREF="#ios_base::dec">dec</A>, ios_base::<A HREF="#ios_base::basefield">basefield</A>)</CODE>, then returns<CODE>iosbase</CODE>.</P><H2><A NAME="fixed"><CODE>fixed</CODE></A></H2><PRE>ios_base&amp; <B>fixed</B>(ios_base&amp; iosbase);</PRE><P>The manipulator effectively calls<CODE>iosbase.<A HREF="#ios_base::setf">setf</A>(ios_base::<A HREF="#ios_base::fixed">fixed</A>, ios_base::<A HREF="#ios_base::floatfield">floatfield</A>)</CODE>, then returns<CODE>iosbase</CODE>.</P><H2><A NAME="fpos"><CODE>fpos</CODE></A></H2><PRE>class <B>fpos</B> {public:    typedef mbstate_t St;    <B><A HREF="#fpos::fpos">fpos</A></B>(streamoff off);    <B><A HREF="#fpos::fpos">fpos</A></B>(St state, fpos_t filepos);    St <B><A HREF="#fpos::state">state</A></B>() const;    void <B><A HREF="#fpos::state">state</A></B>(St state);    <B><A HREF="#fpos::operator streamoff">operator streamoff</A></B>() const;    streamoff <B><A HREF="#fpos::operator-">operator-</A></B>(const fpos&amp; right) const;    fpos&amp; <B><A HREF="#fpos::operator+=">operator+=</A></B>(streamoff off);    fpos&amp; <B><A HREF="#fpos::operator-=">operator-=</A></B>(streamoff off);    fpos <B><A HREF="#fpos::operator+">operator+</A></B>(streamoff off) const;    fpos <B><A HREF="#fpos::operator-">operator-</A></B>(streamoff off) const;    bool <B><A HREF="#fpos::operator==">operator==</A></B>(const fpos&amp; right) const;    bool <B><A HREF="#fpos::operator!=">operator!=</A></B>(const fpos&amp; right) const;    };</PRE><P>The class describes an objectthat can store all the information needed to restore an arbitrary<A HREF="lib_file.html#file-position indicator">file-position indicator</A>within any stream. An object of class <CODE>fpos</CODE> effectivelystores at least two member objects:</P><UL><LI>a byte offset, of type<CODE><A HREF="#streamoff">streamoff</A></CODE></LI><LI>a conversion state, for use by an object of class <CODE>filebuf</CODE>,of type <B><CODE>St</CODE></B>, which is an unofficial synonym for<CODE><A HREF="#mbstate_t">mbstate_t</A></CODE></LI></UL><P>It can also store an arbitrary file position, for use by an object of class<CODE><A HREF="fstream.html#filebuf">filebuf</A></CODE>,of type <CODE><A HREF="stdio.html#fpos_t">fpos_t</A></CODE>.For an environment with limited file size, however,<CODE>streamoff</CODE> and <CODE>fpos_t</CODE> may sometimesbe used interchangeably. So the number ofmember objects stored may vary.</P><H3><A NAME="fpos::fpos"><CODE>fpos::fpos</CODE></A></H3><PRE><B>fpos</B>(streamoff off);<B>fpos</B>(St state, fpos_t filepos);</PRE><P>The first constructor stores the offset<CODE>off</CODE>,relative to the beginning of file.If <CODE>off</CODE> is -1,the resulting object represents an invalid stream position.</P><P>The second constructor stores the object <CODE>state</CODE>and a file position determined by <CODE>filepos</CODE>.</P><H3><A NAME="fpos::operator!="><CODE>fpos::operator!=</CODE></A></H3><PRE>bool <B>operator!=</B>(const fpos&amp; right) const;</PRE><P>The member function returns <CODE>!(*this == right)</CODE>.</P><H3><A NAME="fpos::operator+"><CODE>fpos::operator+</CODE></A></H3><PRE>fpos <B>operator+</B>(streamoff off) const;</PRE><P>The member function returns <CODE>fpos(*this) += off</CODE>.</P><H3><A NAME="fpos::operator+="><CODE>fpos::operator+=</CODE></A></H3><PRE>fpos&amp; <B>operator+=</B>(streamoff off);</PRE><P>The member function adds <CODE>off</CODE> to the stored offset member object,then returns <CODE>*this</CODE>. For positioning within a file, theresult is generally valid only for<A HREF="lib_file.html#binary stream">binary streams</A>.</P><H3><A NAME="fpos::operator-"><CODE>fpos::operator-</CODE></A></H3><PRE>streamoff <B>operator-</B>(const fpos&amp; right) const;fpos <B>operator-</B>(streamoff off) const;</PRE><P>The first member function returns <CODE>(streamoff)*this - (streamoff)right</CODE>.The second member function returns <CODE>fpos(*this) -= off</CODE>.</P><H3><A NAME="fpos::operator-="><CODE>fpos::operator-=</CODE></A></H3><PRE>fpos&amp; <B>operator-=</B>(streamoff off);</PRE><P>The member function returns <CODE>fpos(*this) -= off</CODE>.For positioning within a file, the result is generally valid only for<A HREF="lib_file.html#binary stream">binary streams</A>.</P><H3><A NAME="fpos::operator=="><CODE>fpos::operator==</CODE></A></H3><PRE>bool <B>operator==</B>(const fpos&amp; right) const;</PRE><P>The member function returns <CODE>(streamoff)*this == (streamoff)right</CODE>.</P><H3><A NAME="fpos::operator streamoff"><CODE>fpos::operator streamoff</CODE></A></H3><PRE><B>operator streamoff</B>() const;</PRE><P>The member function returns the stored offset member object,plus any additional offset stored as part of the <CODE>fpos_t</CODE> member object.</P><H3><A NAME="fpos::state"><CODE>fpos::state</CODE></A></H3><PRE>St <B><A HREF="#fpos::state">state</A></B>() const;void <B><A HREF="#fpos::state">state</A></B>(St state);</PRE><P>The first member function returns the value stored in the<CODE>St</CODE> member object. The second member functionstores <CODE>state</CODE> in the <CODE>St</CODE> member object.</P><H2><A NAME="hex"><CODE>hex</CODE></A></H2><PRE>ios_base&amp; <B>hex</B>(ios_base&amp; iosbase);</PRE><P>The manipulator effectively calls<CODE>iosbase.<A HREF="#ios_base::setf">setf</A>(ios_base::<A HREF="#ios_base::hex">hex</A>, ios_base::<A HREF="#ios_base::basefield">basefield</A>)</CODE>, then returns<CODE>iosbase</CODE>.</P><H2><A NAME="internal"><CODE>internal</CODE></A></H2><PRE>ios_base&amp; <B>internal</B>(ios_base&amp; iosbase);</PRE><P>The manipulator effectively calls<CODE>iosbase.<A HREF="#ios_base::setf">setf</A>(ios_base::<A HREF="#ios_base::internal">internal</A>, ios_base::<A HREF="#ios_base::adjustfield">adjustfield</A>)</CODE>, then returns<CODE>iosbase</CODE>.</P><H2><A NAME="ios_base"><CODE>ios_base</CODE></A></H2><HR><P><B><CODE><A HREF="#ios_base::event">event</A>&#183; <A HREF="#ios_base::event_callback">event_callback</A>&#183; <A HREF="#ios_base::failure">failure</A>&#183; <A HREF="#ios_base::flags">flags</A>&#183; <A HREF="#ios_base::fmtflags">fmtflags</A>&#183; <A HREF="#ios_base::getloc">getloc</A>&#183; <A HREF="#ios_base::imbue">imbue</A>&#183; <A HREF="#ios_base::Init">Init</A>&#183; <A HREF="#ios_base::ios_base">ios_base</A>&#183; <A HREF="#ios_base::iostate">iostate</A>&#183; <A HREF="#ios_base::iword">iword</A>&#183; <A HREF="#ios_base::openmode">openmode</A>&#183; <A HREF="#ios_base::operator=">operator=</A>&#183; <A HREF="#ios_base::precision">precision</A>&#183; <A HREF="#ios_base::pword">pword</A>&#183; <A HREF="#ios_base::register_callback">register_callback</A>&#183; <A HREF="#ios_base::seekdir">seekdir</A>&#183; <A HREF="#ios_base::setf">setf</A>&#183; <A HREF="#ios_base::streamoff">streamoff</A>&#183; <A HREF="#ios_base::streampos">streampos</A>&#183; <A HREF="#ios_base::sync_with_stdio">sync_with_stdio</A>&#183; <A HREF="#ios_base::unsetf">unsetf</A>&#183; <A HREF="#ios_base::width">width</A>&#183; <A HREF="#ios_base::xalloc">xalloc</A></CODE></B></P><HR><PRE>class <B>ios_base</B> {public:    class <B><A HREF="#ios_base::failure">failure</A></B>;    typedef T1 <B><A HREF="#ios_base::fmtflags">fmtflags</A></B>;    static const fmtflags <B>boolalpha</B>, <B>dec</B>, <B>fixed</B>, <B>hex</B>,        <B>internal</B>, <B>left</B>, <B>oct</B>, <B>right</B>, <B>scientific</B>,        <B>showbase</B>, <B>showpoint</B>, <B>showpos</B>, <B>skipws</B>, <B>unitbuf</B>,        <B>uppercase</B>, <B>adjustfield</B>, <B>basefield</B>, <B>floatfield</B>;    typedef T2 <B><A HREF="#ios_base::iostate">iostate</A></B>;    static const iostate <B>badbit</B>, <B>eofbit</B>, <B>failbit</B>,        <B>goodbit</B>;    typedef T3 <B><A HREF="#ios_base::openmode">openmode</A></B>;    static const openmode <B>app</B>, <B>ate</B>, <B>binary</B>, <B>in</B>, <B>out</B>,        <B>trunc</B>;    typedef T4 <B><A HREF="#ios_base::seekdir">seekdir</A></B>;    typedef ::streamoff <B><A HREF="#ios_base::streamoff">streamoff</A></B>;    typedef ::streampos <B><A HREF="#ios_base::streampos">streampos</A></B>;    static const seekdir <B>beg</B>, <B>cur</B>, <B>end</B>;    enum <B><A HREF="#ios_base::event">event</A></B> {        <B>copyfmt_event</B>, <B>erase_event</B>,        <B>imbue_event</B>};    static const event <B>copyfmt_event</B>, <B>erase_event</B>,        <B>copyfmt_event</B>;    class <B><A HREF="#ios_base::Init">Init</A></B>;    ios_base&amp; <B><A HREF="#ios_base::operator=">operator=</A></B>(const ios_base&amp; right);    fmtflags <B><A HREF="#ios_base::flags">flags</A></B>() const;    fmtflags <B><A HREF="#ios_base::flags">flags</A></B>(fmtflags newfmtflags);    fmtflags <B><A HREF="#ios_base::setf">setf</A></B>(fmtflags newfmtflags);    fmtflags <B><A HREF="#ios_base::setf">setf</A></B>(fmtflags newfmtflags, fmtflags mask);    void <B><A HREF="#ios_base::unsetf">unsetf</A></B>(fmtflags mask);    streamsize <B><A HREF="#ios_base::precision">precision</A></B>() const;    streamsize <B><A HREF="#ios_base::precision">precision</A></B>(streamsize newprecision);

⌨️ 快捷键说明

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