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

📄 sstream.html

📁 ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片机顶盒软件的开发平台,2.0.5版本,国内找不到的.在国外论坛上花了N天才找到!
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<P>The second member function deallocates any sequence currentlycontrolled by <CODE>*this</CODE>. It thenallocates a copy of the sequence controlledby <CODE>newstr</CODE>. If <CODE>mode &amp; ios_base::in</CODE> is nonzero,it sets the input buffer to begin readingat the beginning of the sequence.If <CODE>mode &amp; ios_base::out</CODE> is nonzero,it sets the output buffer to beginwriting at the beginning of the sequence.</P><H3><A NAME="basic_stringbuf::traits_type"><CODE>basic_stringbuf::traits_type</CODE></A></H3><PRE>typedef Tr <B>traits_type</B>;</PRE><P>The type is a synonym for the template parameter <CODE>Tr</CODE>.</P><H3><A NAME="basic_stringbuf::underflow"><CODE>basic_stringbuf::underflow</CODE></A></H3><PRE>virtual int_type <B>underflow</B>();</PRE><P>The protected virtual member function endeavors to extract the currentelement <CODE>byte</CODE> from the<A HREF="streambu.html#input buffer">input buffer</A>,then advance the current stream position, and return the element as<CODE>traits_type::<A HREF="string2.html#char_traits::to_int_type">to_int_type</A>(byte)</CODE>.It can do so in only one way:If a <A HREF="streambu.html#read position">read position</A>is available, it takes <CODE>byte</CODE> as the element storedin the read position and advances the next pointer for the input buffer.</P><P>If the function cannot succeed, it returns<CODE>traits_type::<A HREF="string2.html#char_traits::eof">eof</A>()</CODE>. Otherwise,it returns the current element in the input stream,converted as described above.</P><H2><A NAME="basic_istringstream"><CODE>basic_istringstream</CODE></A></H2><PRE>template &lt;class Elem,    class Tr = char_traits&lt;Elem&gt;,    class Alloc = allocator&lt;Elem&gt; &gt;    class <B>basic_istringstream</B>        : public basic_istream&lt;Elem, Tr&gt; {public:    typedef Alloc <B><A HREF="#basic_istringstream::allocator_type">allocator_type</A></B>;    explicit <B><A HREF="#basic_istringstream::basic_istringstream">basic_istringstream</A></B>(        ios_base::openmode mode = ios_base::in);    explicit <B><A HREF="#basic_istringstream::basic_istringstream">basic_istringstream</A></B>(        const basic_string&lt;Elem, Tr, Alloc&gt;&amp; str,        ios_base::openmode mode = ios_base::in);    basic_stringbuf&lt;Elem, Tr, Alloc&gt; *<B><A HREF="#basic_istringstream::rdbuf">rdbuf</A></B>() const;    basic_string&lt;Elem, Tr, Alloc&gt; <B><A HREF="#basic_istringstream::str">str</A></B>();    void <B><A HREF="#basic_istringstream::str">str</A></B>(const basic_string&lt;Elem, Tr, Alloc&gt;&amp; newstr);    };</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_stringbuf">basic_stringbuf</A>&lt;Elem, Tr, Alloc&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>, and whose elements are allocated byan allocator of class <CODE>Alloc</CODE>. The object stores an object of class<CODE>basic_stringbuf&lt;Elem, Tr, Alloc&gt;</CODE>.</P><H3><A NAME="basic_istringstream::allocator_type"><CODE>basic_istringstream::allocator_type</CODE></A></H3><PRE>typedef Alloc <B>allocator_type</B>;</PRE><P>The type is a synonym for the template parameter <CODE>Alloc</CODE>.</P><H3><A NAME="basic_istringstream::basic_istringstream"><CODE>basic_istringstream::basic_istringstream</CODE></A></H3><PRE>explicit <B>basic_istringstream</B>(    ios_base::openmode mode = ios_base::in);explicit <B>basic_istringstream</B>(    const basic_string&lt;Elem, Tr, Alloc&gt;&amp; str,    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_stringbuf">basic_stringbuf</A>&lt;Elem, Tr, Alloc&gt;</CODE>.It also initializes <CODE>sb</CODE> by calling<CODE><A HREF="#basic_stringbuf::basic_stringbuf">basic_stringbuf</A>&lt;Elem,Tr, Alloc&gt;(mode | ios_base::in)</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_stringbuf::basic_stringbuf">basic_stringbuf</A>&lt;Elem,Tr, Alloc&gt;(str, mode | ios_base::in)</CODE>.</P><H3><A NAME="basic_istringstream::rdbuf"><CODE>basic_istringstream::rdbuf</CODE></A></H3><PRE>basic_stringbuf&lt;Elem, Tr, Alloc&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_stringbuf">basic_stringbuf</A>&lt;Elem,Tr, Alloc&gt;</CODE>.</P><H3><A NAME="basic_istringstream::str"><CODE>basic_istringstream::str</CODE></A></H3><PRE>basic_string&lt;Elem, Tr, Alloc&gt; <B>str</B>() const;void <B>str</B>(const basic_string&lt;Elem, Tr, Alloc&gt;&amp; newstr);</PRE><P>The first member function returns<CODE><A HREF="#basic_istringstream::rdbuf">rdbuf</A>()-&gt;<A HREF="#basic_stringbuf::str">str</A>()</CODE>.The second member function calls <CODE>rdbuf()-&gt; str(newstr)</CODE>.</P><H2><A NAME="basic_ostringstream"><CODE>basic_ostringstream</CODE></A></H2><PRE>template &lt;class Elem,    class Tr = char_traits&lt;Elem&gt;,    class Alloc = allocator&lt;Elem&gt; &gt;    class <B>basic_ostringstream</B>        : public basic_ostream&lt;Elem, Tr&gt; {public:    explicit <B><A HREF="#basic_ostringstream::basic_ostringstream">basic_ostringstream</A></B>(        ios_base::openmode mode = ios_base::out);    explicit <B><A HREF="#basic_ostringstream::basic_ostringstream">basic_ostringstream</A></B>(        const basic_string&lt;Elem, Tr, Alloc&gt;&amp; str,        ios_base::openmode mode = ios_base::out);    basic_stringbuf&lt;Elem, Tr, Alloc&gt; *<B><A HREF="#basic_ostringstream::rdbuf">rdbuf</A></B>() const;    basic_string&lt;Elem, Tr, Alloc&gt; <B><A HREF="#basic_ostringstream::str">str</A></B>();    void <B><A HREF="#basic_ostringstream::str">str</A></B>(const basic_string&lt;Elem, Tr, Alloc&gt;&amp; newstr);    };</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_stringbuf">basic_stringbuf</A>&lt;Elem, Tr, Alloc&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>, and whose elements are allocated byan allocator of class <CODE>Alloc</CODE>. The object stores an object of class<CODE>basic_stringbuf&lt;Elem, Tr, Alloc&gt;</CODE>.</P><H3><A NAME="basic_ostringstream::allocator_type"><CODE>basic_ostringstream::allocator_type</CODE></A></H3><PRE>typedef Alloc <B>allocator_type</B>;</PRE><P>The type is a synonym for the template parameter <CODE>Alloc</CODE>.</P><H3><A NAME="basic_ostringstream::basic_ostringstream"><CODE>basic_ostringstream::basic_ostringstream</CODE></A></H3><PRE>explicit <B>basic_ostringstream</B>(    ios_base::openmode mode = ios_base::out);explicit <B>basic_ostringstream</B>(    const basic_string&lt;Elem, Tr, Alloc&gt;&amp; str,    ios_base::openmode mode = 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_stringbuf">basic_stringbuf</A>&lt;Elem, Tr, Alloc&gt;</CODE>.It also initializes <CODE>sb</CODE> by calling<CODE><A HREF="#basic_stringbuf::basic_stringbuf">basic_stringbuf</A>&lt;Elem,Tr, Alloc&gt;(mode | ios_base::out)</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_stringbuf::basic_stringbuf">basic_stringbuf</A>&lt;Elem,Tr, Alloc&gt;(str, mode | ios_base::out)</CODE>.</P><H3><A NAME="basic_ostringstream::rdbuf"><CODE>basic_ostringstream::rdbuf</CODE></A></H3><PRE>basic_stringbuf&lt;Elem, Tr, Alloc&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_stringbuf">basic_stringbuf</A>&lt;Elem,Tr, Alloc&gt;</CODE>.</P><H3><A NAME="basic_ostringstream::str"><CODE>basic_ostringstream::str</CODE></A></H3><PRE>basic_string&lt;Elem, Tr, Alloc&gt; <B>str</B>() const;void <B>str</B>(const basic_string&lt;Elem, Tr, Alloc&gt;&amp; newstr);</PRE><P>The first member function returns<CODE><A HREF="#basic_ostringstream::rdbuf">rdbuf</A>()-&gt;<A HREF="#basic_stringbuf::str">str</A>()</CODE>.The second member function calls <CODE>rdbuf()-&gt; str(newstr)</CODE>.</P><H2><A NAME="basic_stringstream"><CODE>basic_stringstream</CODE></A></H2><PRE>template &lt;class Elem,    class Tr = char_traits&lt;Elem&gt;,    class Alloc = allocator&lt;Elem&gt; &gt;    class <B>basic_stringstream</B>        : public basic_iostream&lt;Elem, Tr&gt; {public:    typedef Alloc <B><A HREF="#basic_stringstream::allocator_type">allocator_type</A></B>;    explicit <B><A HREF="#basic_stringstream::basic_stringstream">basic_stringstream</A></B>(        ios_base::openmode mode =            ios_base::in | ios_base::out);    explicit <B><A HREF="#basic_stringstream::basic_stringstream">basic_stringstream</A></B>(        const basic_string&lt;Elem, Tr, Alloc&gt;&amp; str,        ios_base::openmode mode =            ios_base::in | ios_base::out);    basic_stringbuf&lt;Elem, Tr, Alloc&gt; *<B><A HREF="#basic_stringstream::rdbuf">rdbuf</A></B>() const;    basic_string&lt;Elem, Tr, Alloc&gt; <B><A HREF="#basic_stringstream::str">str</A></B>();    void <B><A HREF="#basic_stringstream::str">str</A></B>(const basic_string&lt;Elem, Tr, Alloc&gt;&amp; newstr);    };</PRE><P>The template class describes an object that controlsinsertion and extraction of elements and encoded objects using a<A HREF="streambu.html#stream buffer">stream buffer</A> of class<CODE><A HREF="#basic_stringbuf">basic_stringbuf</A>&lt;Elem, Tr, Alloc&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>, and whose elements are allocated byan allocator of class <CODE>Alloc</CODE>. The object stores an object of class<CODE>basic_stringbuf&lt;Elem, Tr, Alloc&gt;</CODE>.</P><H3><A NAME="basic_stringstream::allocator_type"><CODE>basic_stringstream::allocator_type</CODE></A></H3><PRE>typedef Alloc <B>allocator_type</B>;</PRE><P>The type is a synonym for the template parameter <CODE>Alloc</CODE>.</P><H3><A NAME="basic_stringstream::basic_stringstream"><CODE>basic_stringstream::basic_stringstream</CODE></A></H3><PRE>explicit <B>basic_stringstream</B>(    ios_base::openmode mode =        ios_base::in | ios_base::out);explicit <B>basic_stringstream</B>(    const basic_string&lt;Elem, Tr, Alloc&gt;&amp; str,    ios_base::openmode mode =         ios_base::in | ios_base::out);</PRE><P>The first constructor initializes the base class by calling<CODE><A HREF="istream.html#basic_iostream">basic_iostream</A>(sb)</CODE>,where <CODE>sb</CODE> is the stored object of class<CODE><A HREF="#basic_stringbuf">basic_stringbuf</A>&lt;Elem, Tr, Alloc&gt;</CODE>.It also initializes <CODE>sb</CODE> by calling<CODE><A HREF="#basic_stringbuf::basic_stringbuf">basic_stringbuf</A>&lt;Elem,Tr, Alloc&gt;(mode)</CODE>.</P><P>The second constructor initializes the base class by calling<CODE>basic_iostream(sb)</CODE>.It also initializes <CODE>sb</CODE> by calling<CODE><A HREF="#basic_stringbuf::basic_stringbuf">basic_stringbuf</A>&lt;Elem,Tr, Alloc&gt;(str, mode)</CODE>.</P><H3><A NAME="basic_stringstream::rdbuf"><CODE>basic_stringstream::rdbuf</CODE></A></H3><PRE>basic_stringbuf&lt;Elem, Tr, Alloc&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_stringbuf">basic_stringbuf</A>&lt;Elem,Tr, Alloc&gt;</CODE>.</P><H3><A NAME="basic_stringstream::str"><CODE>basic_stringstream::str</CODE></A></H3><PRE>basic_string&lt;Elem, Tr, Alloc&gt; <B>str</B>() const;void <B>str</B>(const basic_string&lt;Elem, Tr, Alloc&gt;&amp; newstr);</PRE><P>The first member function returns<CODE><A HREF="#basic_stringstream::rdbuf">rdbuf</A>()-&gt;<A HREF="#basic_stringbuf::str">str</A>()</CODE>.The second member function calls <CODE>rdbuf()-&gt; str(newstr)</CODE>.</P><H2><A NAME="istringstream"><CODE>istringstream</CODE></A></H2><PRE>typedef basic_istringstream&lt;char&gt; <B>istringstream</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_istringstream"><CODE>basic_istringstream</CODE></A>, specializedfor elements of type <I>char.</I></P><H2><A NAME="ostringstream"><CODE>ostringstream</CODE></A></H2><PRE>typedef basic_ostringstream&lt;char&gt; <B>ostringstream</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_ostringstream"><CODE>basic_ostringstream</CODE></A>, specializedfor elements of type <I>char.</I></P><H2><A NAME="stringbuf"><CODE>stringbuf</CODE></A></H2><PRE>typedef basic_stringbuf&lt;char&gt; <B>stringbuf</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_stringbuf"><CODE>basic_stringbuf</CODE></A>, specializedfor elements of type <I>char.</I></P><H2><A NAME="stringstream"><CODE>stringstream</CODE></A></H2><PRE>typedef basic_stringstream&lt;char&gt; <B>stringstream</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_stringstream"><CODE>basic_stringstream</CODE></A>, specializedfor elements of type <I>char.</I></P><H2><A NAME="wistringstream"><CODE>wistringstream</CODE></A></H2><PRE>typedef basic_istringstream&lt;wchar_t&gt; <B>wistringstream</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_istringstream"><CODE>basic_istringstream</CODE></A>, specializedfor elements of type <CODE>wchar_t</CODE>.</P><H2><A NAME="wostringstream"><CODE>wostringstream</CODE></A></H2><PRE>typedef basic_ostringstream&lt;wchar_t&gt; <B>wostringstream</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_ostringstream"><CODE>basic_ostringstream</CODE></A>, specializedfor elements of type <CODE>wchar_t</CODE>.</P><H2><A NAME="wstringbuf"><CODE>wstringbuf</CODE></A></H2><PRE>typedef basic_stringbuf&lt;wchar_t&gt; <B>wstringbuf</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_stringbuf"><CODE>basic_stringbuf</CODE></A>, specializedfor elements of type <CODE>wchar_t</CODE>.</P><H2><A NAME="wstringstream"><CODE>wstringstream</CODE></A></H2><PRE>typedef basic_stringstream&lt;wchar_t&gt; <B>wstringstream</B>;</PRE><P>The type is a synonym for template class<A HREF="#basic_stringstream"><CODE>basic_stringstream</CODE></A>, specializedfor elements of type <CODE>wchar_t</CODE>.</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 + -