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

📄 iostrbuf.htm

📁 这是关于VC++中的STL容器的资料,包括了STL容器各个类之间关系以及类的说明
💻 HTM
字号:
<html>
<head>
<title>ostreambuf_iterator</title>
<head>

<body bgcolor="#FFFFFF">

<a name="here"></a>

<img src="itobban.gif">
<pre>

<font size=5>Class Name</font>            ostreambuf_iterator

<font size=5>Header File</font>          &lt;iterator&gt;

<font size=5>Classification</font>      abstract data type

</pre>

<a href="iostrbuf.htm#crd">Class Relationship Diagram</a><br>
<br>
<a href="iostrbuf.htm#class-descrip">Class Description</a>

<h1>Member Classes</h1>
<a href="iostrbuf.htm#streambuf">streambuf_type</a>

<h1>Methods</h1>
<pre>
<a href="iostrbuf.htm#failed">bool failed() const throw();</a>

<a href="iostrbuf.htm#ostreambuf-iterator1">ostreambuf_iterator(ostream_type& s) throw();</a>

<a href="iostrbuf.htm#ostreambuf-iterator2">ostreambuf_iterator(streambuf_type* s) throw();</a>

</pre>
<h1>Operators</h1>
<pre>
<a href="iostrbuf.htm#operator=">ostreambuf_iterator& operator=(charT c);</a>

<a href="iostrbuf.htm#operator*">ostreambuf_iterator& operator*();</a>

<a href="iostrbuf.htm#operator++1">ostreambuf_iterator& operator++();</a>

<a href="iostrbuf.htm#operator++2">ostreambuf_iterator& operator++(int);</a>

</pre>
<hr>

<a name="class-descrip"><h3>Class Description</h3>
<p>
The ostreambuf_iterator is an <a href="defines.htm#buffer">stream buffer iterator</a>. The ostreambuf_iterator is a low level ostream_iterator.  Characters of charT are 
successively written to an output streambuf in a single direction. Only one 
pass is made over the data. Characters cannot be extracted from the output iterator.
</p>
<hr>
<a name="streambuf"><h3>streambuf_type</h3></a>
<p>
The streambuf serves as the output stream type charT values are inserted.
</p>

<hr>

<pre>
<a name="ostreambuf-iterator1">
Method             ostreambuf_iterator()</a>

Access             Public

Classification     Constructor

Syntax             ostreambuf_iterator(ostream_type& s) throw();

Parameters         <em>s</em> is a reference to ostream_type in which
                   ostream_type's streambuf serves as the output
                   stream type charT values are inserted.

Returns            None

</pre>

<h3>Description</h3>
<p>
This constructor constructs an ostreambuf_iterator object that writes a 
value of type charT into the output stream specified by <em>s</em>' 
streambuf. The constructor requires that <em>s</em> not be null. This method effects
sbuf_(s.rdbuf()).
</p>

<hr>

<pre>
<a name="ostreambuf-iterator2">
Method             ostreambuf_iterator()</a>

Access             Public

Classification     Constructor

Syntax             ostreambuf_iterator(streambuf_type* s) throw();

Parameters         <em>s</em> is a pointer to streambuf_type in which
                   streambuf_types's streambuf serves as the output
                   stream type charT values are inserted.

Returns            None

</pre>

<h3>Description</h3>
<p>
This constructor constructs an ostreambuf_iterator object that writes a 
value of type charT to the output stream specified by <em>s</em>' streambuf. 
This method effects sbuf_(s).
</p>

<hr>

<pre>
<a name="operator*">
Method             operator*()</a>

Access             Public

Classification     Accessor

Syntax             ostreambuf_iterator&lt;charT,traits&gt;& operator*();

Returns            This method returns a pointer to the current object.

</pre>

<h3>Description</h3>
<p>
The dereference operator dereferences an iterator object and returns *this.
</p>

<hr>

<pre>
<a name="operator++1">
Method             operator++()</a>

Access             Public

Classification     Accessor

Syntax             ostreambuf_iterator&lt;charT,traits&gt;& operator++();

Parameters         None

Returns            This operator returns a pointer to the current object.

</pre>

<h3>Description</h3>
<p>
The prefix incrementation operator returns *this.
</p>

<hr>

<pre>
<a name="operator++2">
Method             operator++()</a>

Access             Public

Classification     Accessor

Syntax             ostreambuf_iterator<charT, traits>& operator++(int x);

Parameters         <em>x</em> has no effect on the behavior of this method.

Returns            This operator returns a pointer to the current object.

</pre>

<h3>Description</h3>
<p>
The postfix incrementation operator returns *this.
</p>

<hr>

<pre>
<a name="failed">
Method             failed()</a>

Access             Public

Classification     Accessor

Syntax             bool failed() const throw();

Parameters         None

Returns            This method returns true if there has been any prior
                   use of the operator=().

</pre>

<h3>Description</h3>
<p>
The failed() method is called to determine if there has been a prior call to the
assignment operator or more particularly a call to sbuf_->sputc() 
returned a value of traits::eof(). If sbuf_-sputc() returned 
traits::eof() then the return value will be true. Otherwise
the return value will be false.
</p>

<hr>

<pre>
<a name="operator=">
Method             operator=()</a>

Access             Public

Classification     Modifier

Syntax             ostreambuf_iterator<charT,traits>& operator=(chartT c);

Parameters         <em>c</em> is the character of type charT written to 
                   the output stream.

Returns            This operator returns a pointer to the current 
                   object.

</pre>


<h3>Description</h3>
<p>
The assignment operator assigns a character <em>c</em> of type charT to the output
stream by calling sbuf_->sputc(c). If this method fails to write the 
character to the stream, a call to the method failed() will return false.
</p>

<hr>


<a name="crd"><h2>The Class Relationship Diagram for ostreambuf_iterator</h2></a>
<img src="itostrbf.gif">
<hr>
</body>

</html>



⌨️ 快捷键说明

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