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

📄 ginputstream.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 4 页
字号:
</tr><tr><td><p><span class="term"><em class="parameter"><code>count</code></em>&#160;:</span></p></td><td> the number of bytes that will be read from the stream</td></tr><tr><td><p><span class="term"><em class="parameter"><code>cancellable</code></em>&#160;:</span></p></td><td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td><td> location to store the error occuring, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> Number of bytes read, or -1 on error</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3186583"></a><h3><a name="g-input-stream-read-all"></a>g_input_stream_read_all ()</h3><a class="indexterm" name="id3186594"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            g_input_stream_read_all             (<a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a> *stream,                                                         void *buffer,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize">gsize</a> count,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize">gsize</a> *bytes_read,                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>Tries to read <em class="parameter"><code>count</code></em> bytes from the stream into the buffer starting at<em class="parameter"><code>buffer</code></em>. Will block during this read.</p><p>This function is similar to <a class="link" href="GInputStream.html#g-input-stream-read"><code class="function">g_input_stream_read()</code></a>, except it tries toread as many bytes as requested, only stopping on an error or end of stream.</p><p>On a successful read of <em class="parameter"><code>count</code></em> bytes, or if we reached the end of thestream,  <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is returned, and <em class="parameter"><code>bytes_read</code></em> is set to the number of bytesread into <em class="parameter"><code>buffer</code></em>.</p><p>If there is an error during the operation <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned and <em class="parameter"><code>error</code></em>is set to indicate the error status, <em class="parameter"><code>bytes_read</code></em> is updated to containthe number of bytes read into <em class="parameter"><code>buffer</code></em> before the error occurred.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td><td> a <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>buffer</code></em>&#160;:</span></p></td><td> a buffer to read data into (which should be at least count bytes long).</td></tr><tr><td><p><span class="term"><em class="parameter"><code>count</code></em>&#160;:</span></p></td><td> the number of bytes that will be read from the stream</td></tr><tr><td><p><span class="term"><em class="parameter"><code>bytes_read</code></em>&#160;:</span></p></td><td> location to store the number of bytes that was read from the stream</td></tr><tr><td><p><span class="term"><em class="parameter"><code>cancellable</code></em>&#160;:</span></p></td><td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td><td> location to store the error occuring, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if there was an error</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3186905"></a><h3><a name="g-input-stream-skip"></a>g_input_stream_skip ()</h3><a class="indexterm" name="id3186917"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize">gssize</a>              g_input_stream_skip                 (<a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a> *stream,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize">gsize</a> count,                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>Tries to skip <em class="parameter"><code>count</code></em> bytes from the stream. Will block during the operation.</p><p>This is identical to <a class="link" href="GInputStream.html#g-input-stream-read"><code class="function">g_input_stream_read()</code></a>, from a behaviour standpoint,but the bytes that are skipped are not returned to the user. Somestreams have an implementation that is more efficient than reading the data.</p><p>This function is optional for inherited classes, as the default implementationemulates it using read.</p><p>If <em class="parameter"><code>cancellable</code></em> is not <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, then the operation can be cancelled bytriggering the cancellable object from another thread. If the operationwas cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned. If anoperation was partially finished when the operation was cancelled thepartial result will be returned, without an error.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td><td> a <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>count</code></em>&#160;:</span></p></td><td> the number of bytes that will be skipped from the stream</td></tr><tr><td><p><span class="term"><em class="parameter"><code>cancellable</code></em>&#160;:</span></p></td><td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. </td></tr><tr><td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td><td> location to store the error occuring, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> Number of bytes skipped, or -1 on error</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3187137"></a><h3><a name="g-input-stream-close"></a>g_input_stream_close ()</h3><a class="indexterm" name="id3187148"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            g_input_stream_close                (<a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a> *stream,                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>Closes the stream, releasing resources related to it.</p><p>Once the stream is closed, all other operations will return <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>.Closing a stream multiple times will not return an error.</p><p>Streams will be automatically closed when the last referenceis dropped, but you might want to call this function to make sure resources are released as early as possible.</p><p>Some streams might keep the backing store of the stream (e.g. a file descriptor)open after the stream is closed. See the documentation for the individualstream for details.</p><p>On failure the first error that happened will be reported, but the closeoperation will finish as much as possible. A stream that failed toclose will still return <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a> for all operations. Still, itis important to check and report the error to the user.</p><p>If <em class="parameter"><code>cancellable</code></em> is not NULL, then the operation can be cancelled bytriggering the cancellable object from another thread. If the operationwas cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.Cancelling a close will still leave the stream closed, but some streamscan use a faster close that doesn't block to e.g. check errors.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></p></td><td> A <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>cancellable</code></em>&#160;:</span></p></td><td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td><td> location to store the error occuring, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on failure</td>

⌨️ 快捷键说明

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