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

📄 fstream.html

📁 ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片机顶盒软件的开发平台,2.0.5版本,国内找不到的.在国外论坛上花了N天才找到!
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<H3><A NAME="basic_fstream::open"><CODE>basic_fstream::open</CODE></A></H3><PRE>void <B>open</B>(const char *filename,    ios_base::openmode mode =        ios_base::in | ios_base::out);</PRE><P>The member function calls<CODE><A HREF="#basic_fstream::rdbuf">rdbuf</A>()-&gt;<A HREF="#basic_filebuf::open">open</A>(filename, mode)</CODE>.If that function returns a null pointer, the function calls<CODE><A HREF="ios.html#basic_ios::setstate">setstate</A>(failbit)</CODE>.</P><H3><A NAME="basic_fstream::rdbuf"><CODE>basic_fstream::rdbuf</CODE></A></H3><PRE>basic_filebuf&lt;Elem, Tr&gt; *<B>rdbuf</B>() const</PRE><P>The member function returns the address of the storedstream buffer, of type pointer to<CODE><A HREF="#basic_filebuf">basic_filebuf</A>&lt;Elem, Tr&gt;</CODE>.</P><H2><A NAME="basic_ifstream"><CODE>basic_ifstream</CODE></A></H2><PRE>template &lt;class Elem, class Tr = char_traits&lt;Elem&gt; &gt;    class <B>basic_ifstream</B> : public basic_istream&lt;Elem, Tr&gt; {public:    basic_filebuf&lt;Elem, Tr&gt; *<B><A HREF="#basic_ifstream::rdbuf">rdbuf</A></B>() const;    <B><A HREF="#basic_ifstream::basic_ifstream">basic_ifstream</A></B>();    explicit <B><A HREF="#basic_ifstream::basic_ifstream">basic_ifstream</A></B>(const char *filename,        ios_base::openmode mode = ios_base::in);    bool <B><A HREF="#basic_ifstream::is_open">is_open</A></B>() const;    void <B><A HREF="#basic_ifstream::open">open</A></B>(const char *filename,        ios_base::openmode mode = ios_base::in);    void <B><A HREF="#basic_ifstream::close">close</A></B>();    };</PRE><P>The template class describes an object that controlsextraction of elements and encoded objects from a<A HREF="streambu.html#stream buffer">stream buffer</A> of class<CODE><A HREF="#basic_filebuf">basic_filebuf</A>&lt;Elem, Tr&gt;</CODE>,with elements of type <CODE>Elem</CODE>, whose<A HREF="string2.html#character traits">character traits</A> are determinedby the class <CODE>Tr</CODE>. The object stores an object of class<CODE>basic_filebuf&lt;Elem, Tr&gt;</CODE>.</P><H3><A NAME="basic_ifstream::basic_ifstream"><CODE>basic_ifstream::basic_ifstream</CODE></A></H3><PRE><B>basic_ifstream</B>();explicit <B>basic_ifstream</B>(const char *filename,    ios_base::openmode mode = ios_base::in);</PRE><P>The first constructor initializes the base class by calling<CODE><A HREF="istream.html#basic_istream::basic_istream">basic_istream</A>(sb)</CODE>,where <CODE>sb</CODE> is the stored object of class<CODE><A HREF="#basic_filebuf">basic_filebuf</A>&lt;Elem, Tr&gt;</CODE>.It also initializes <CODE>sb</CODE> by calling<CODE><A HREF="#basic_filebuf::basic_filebuf">basic_filebuf</A>&lt;Elem,Tr&gt;()</CODE>.</P><P>The second constructor initializes the base class by calling<CODE>basic_istream(sb)</CODE>.It also initializes <CODE>sb</CODE> by calling<CODE><A HREF="#basic_filebuf::basic_filebuf">basic_filebuf</A>&lt;Elem, Tr&gt;()</CODE>,then <CODE>sb.<A HREF="#basic_filebuf::open">open</A>(filename, mode| ios_base::in)</CODE>. If the latter function returns a nullpointer, the constructor calls<CODE><A HREF="ios.html#basic_ios::setstate">setstate</A>(failbit)</CODE>.</P><H3><A NAME="basic_ifstream::close"><CODE>basic_ifstream::close</CODE></A></H3><PRE>void <B>close</B>();</PRE><P>The member function calls<CODE><A HREF="#basic_ifstream::rdbuf">rdbuf</A>()-&gt;<A HREF="#basic_filebuf::close">close</A>()</CODE>.</P><H3><A NAME="basic_ifstream::is_open"><CODE>basic_ifstream::is_open</CODE></A></H3><PRE>bool <B>is_open</B>();</PRE><P>The member function returns<CODE><A HREF="#basic_ifstream::rdbuf">rdbuf</A>()-&gt;<A HREF="#basic_filebuf::is_open">is_open</A>()</CODE>.</P><H3><A NAME="basic_ifstream::open"><CODE>basic_ifstream::open</CODE></A></H3><PRE>void <B>open</B>(const char *filename,    ios_base::openmode mode = ios_base::in);</PRE><P>The member function calls<CODE><A HREF="#basic_ifstream::rdbuf">rdbuf</A>()-&gt;<A HREF="#basic_filebuf::open">open</A>(filename, mode | ios_base::in)</CODE>.If that function returns a null pointer, the function calls<CODE><A HREF="ios.html#basic_ios::setstate">setstate</A>(failbit)</CODE>.</P><H3><A NAME="basic_ifstream::rdbuf"><CODE>basic_ifstream::rdbuf</CODE></A></H3><PRE>basic_filebuf&lt;Elem, Tr&gt; *<B>rdbuf</B>() const</PRE><P>The member function returns the address of the stored stream buffer.</P><H2><A NAME="basic_ofstream"><CODE>basic_ofstream</CODE></A></H2><PRE>template &lt;class Elem, class Tr = char_traits&lt;Elem&gt; &gt;    class <B>basic_ofstream</B> : public basic_ostream&lt;Elem, Tr&gt; {public:    basic_filebuf&lt;Elem, Tr&gt; *<B><A HREF="#basic_ofstream::rdbuf">rdbuf</A></B>() const;    <B><A HREF="#basic_ofstream::basic_ofstream">basic_ofstream</A></B>();    explicit <B><A HREF="#basic_ofstream::basic_ofstream">basic_ofstream</A></B>(const char *filename,        ios_base::openmode mode = ios_base::out);    bool <B><A HREF="#basic_ofstream::is_open">is_open</A></B>() const;    void <B><A HREF="#basic_ofstream::open">open</A></B>(const char *filename,        ios_base::openmode mode = ios_base::out);    void <B><A HREF="#basic_ofstream::close">close</A></B>();    };</PRE><P>The template class describes an object that controlsinsertion of elements and encoded objects into a<A HREF="streambu.html#stream buffer">stream buffer</A> of class<CODE><A HREF="#basic_filebuf">basic_filebuf</A>&lt;Elem, Tr&gt;</CODE>,with elements of type <CODE>Ele</CODE>, whose<A HREF="string2.html#character traits">character traits</A> are determinedby the class <CODE>Tr</CODE>. The object stores an object of class<CODE>basic_filebuf&lt;Elem, Tr&gt;</CODE>.</P><H3><A NAME="basic_ofstream::basic_ofstream"><CODE>basic_ofstream::basic_ofstream</CODE></A></H3><PRE><B>basic_ofstream</B>();explicit <B>basic_ofstream</B>(const char *filename,    ios_base::openmode which = ios_base::out);</PRE><P>The first constructor initializes the base class by calling<CODE><A HREF="ostream.html#basic_ostream::basic_ostream">basic_ostream</A>(sb)</CODE>,where <CODE>sb</CODE> is the stored object of class<CODE><A HREF="#basic_filebuf">basic_filebuf</A>&lt;Elem, Tr&gt;</CODE>.It also initializes <CODE>sb</CODE> by calling<CODE><A HREF="#basic_filebuf::basic_filebuf">basic_filebuf</A>&lt;Elem, Tr&gt;()</CODE>.</P><P>The second constructor initializes the base class by calling<CODE>basic_ostream(sb)</CODE>.It also initializes <CODE>sb</CODE> by calling<CODE><A HREF="#basic_filebuf::basic_filebuf">basic_filebuf</A>&lt;Elem, Tr&gt;()</CODE>,then <CODE>sb.<A HREF="#basic_filebuf::open">open</A>(filename, mode| ios_base::out)</CODE>. If the latter function returns a nullpointer, the constructor calls<CODE><A HREF="ios.html#basic_ios::setstate">setstate</A>(failbit)</CODE>.</P><H3><A NAME="basic_ofstream::close"><CODE>basic_ofstream::close</CODE></A></H3><PRE>void <B>close</B>();</PRE><P>The member function calls<CODE><A HREF="#basic_ofstream::rdbuf">rdbuf</A>()-&gt;<A HREF="#basic_filebuf::close">close</A>()</CODE>.</P><H3><A NAME="basic_ofstream::is_open"><CODE>basic_ofstream::is_open</CODE></A></H3><PRE>bool <B>is_open</B>();</PRE><P>The member function returns<CODE><A HREF="#basic_ofstream::rdbuf">rdbuf</A>()-&gt;<A HREF="#basic_filebuf::is_open">is_open</A>()</CODE>.</P><H3><A NAME="basic_ofstream::open"><CODE>basic_ofstream::open</CODE></A></H3><PRE>void <B>open</B>(const char *filename,    ios_base::openmode mode = ios_base::out);</PRE><P>The member function calls<CODE><A HREF="#basic_ofstream::rdbuf">rdbuf</A>()-&gt;<A HREF="#basic_filebuf::open">open</A>(filename, mode | ios_base::out)</CODE>.If that function returns a null pointer, the function calls<CODE><A HREF="ios.html#basic_ios::setstate">setstate</A>(failbit)</CODE>.</P><H3><A NAME="basic_ofstream::rdbuf"><CODE>basic_ofstream::rdbuf</CODE></A></H3><PRE>basic_filebuf&lt;Elem, Tr&gt; *<B>rdbuf</B>() const</PRE><P>The member function returns the address of the storedstream buffer.</P><H2><A NAME="filebuf"><CODE>filebuf</CODE></A></H2><PRE>typedef basic_filebuf&lt;char, char_traits&lt;char&gt; &gt; <B>filebuf</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_filebuf"><CODE>basic_filebuf</CODE></A>, specializedfor elements of type <I>char</I> with default<A HREF="string2.html#character traits">character traits</A>.</P><H2><A NAME="fstream"><CODE>fstream</CODE></A></H2><PRE>typedef basic_fstream&lt;char, char_traits&lt;char&gt; &gt; <B>fstream</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_fstream"><CODE>basic_fstream</CODE></A>, specializedfor elements of type <I>char</I> with default<A HREF="string2.html#character traits">character traits</A>.</P><H2><A NAME="ifstream"><CODE>ifstream</CODE></A></H2><PRE>typedef basic_ifstream&lt;char, char_traits&lt;char&gt; &gt; <B>ifstream</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_ifstream"><CODE>basic_ifstream</CODE></A>, specializedfor elements of type <I>char</I> with default<A HREF="string2.html#character traits">character traits</A>.</P><H2><A NAME="ofstream"><CODE>ofstream</CODE></A></H2><PRE>typedef basic_ofstream&lt;char, char_traits&lt;char&gt; &gt;    <B>ofstream</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_ofstream"><CODE>basic_ofstream</CODE></A>, specializedfor elements of type <I>char</I> with default<A HREF="string2.html#character traits">character traits</A>.</P><H2><A NAME="wfstream"><CODE>wfstream</CODE></A></H2><PRE>typedef basic_fstream&lt;wchar_t, char_traits&lt;wchar_t&gt; &gt;    <B>wfstream</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_fstream"><CODE>basic_fstream</CODE></A>, specializedfor elements of type <CODE>wchar_t</CODE> with default<A HREF="string2.html#character traits">character traits</A>.</P><H2><A NAME="wifstream"><CODE>wifstream</CODE></A></H2><PRE>typedef basic_ifstream&lt;wchar_t, char_traits&lt;wchar_t&gt; &gt;    <B>wifstream</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_ifstream"><CODE>basic_ifstream</CODE></A>, specializedfor elements of type <CODE>wchar_t</CODE> with default<A HREF="string2.html#character traits">character traits</A>.</P><H2><A NAME="wofstream"><CODE>wofstream</CODE></A></H2><PRE>typedef basic_ofstream&lt;wchar_t, char_traits&lt;wchar_t&gt; &gt;    <B>wofstream</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_ofstream"><CODE>basic_ofstream</CODE></A>, specializedfor elements of type <CODE>wchar_t</CODE> with default<A HREF="string2.html#character traits">character traits</A>.</P><H2><A NAME="wfilebuf"><CODE>wfilebuf</CODE></A></H2><PRE>typedef basic_filebuf&lt;wchar_t, char_traits&lt;wchar_t&gt; &gt;    <B>wfilebuf</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_filebuf"><CODE>basic_filebuf</CODE></A>, specializedfor elements of type <CODE>wchar_t</CODE> with default<A HREF="string2.html#character traits">character traits</A>.</P><HR><P>See also the<B><A HREF="index.html#Table of Contents">Table of Contents</A></B> and the<B><A HREF="_index.html">Index</A></B>.</P><P><I><A HREF="crit_pjp.html">Copyright</A> &#169; 1992-2002by P.J. Plauger. All rights reserved.</I></P><!--V4.01:1125--></BODY></HTML>

⌨️ 快捷键说明

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