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

📄 ginputstream.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 4 页
字号:
</tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3187373"></a><h3><a name="g-input-stream-read-async"></a>g_input_stream_read_async ()</h3><a class="indexterm" name="id3187384"></a><pre class="programlisting">void                g_input_stream_read_async           (<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,                                                         int io_priority,                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,                                                         <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre><p>Request an asynchronous read of <em class="parameter"><code>count</code></em> bytes from the stream into the bufferstarting at <em class="parameter"><code>buffer</code></em>. When the operation is finished <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GInputStream.html#g-input-stream-read-finish"><code class="function">g_input_stream_read_finish()</code></a> to get the result of the operation.</p><p>During an async request no other sync and async calls are allowed, and willresult in <a class="link" href="gio-GIOError.html#G-IO-ERROR-PENDING:CAPS"><code class="literal">G_IO_ERROR_PENDING</code></a> errors. </p><p>A value of <em class="parameter"><code>count</code></em> larger than <ahref="/usr/share/gtk-doc/html/glib/glib-Limits-of-Basic-Types.html#G-MAXSSIZE:CAPS"><code class="literal">G_MAXSSIZE</code></a> will cause a <a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-ARGUMENT:CAPS"><code class="literal">G_IO_ERROR_INVALID_ARGUMENT</code></a> error.</p><p>On success, the number of bytes read into the buffer will be passed to thecallback. It is not an error if this is not the same as the requested size, as itcan happen e.g. near the end of a file, but generally we try to readas many bytes as requested. Zero is returned on end of file(or if <em class="parameter"><code>count</code></em> is zero),  but never otherwise.</p><p>Any outstanding i/o request with higher priority (lower numerical value) willbe executed before an outstanding request with lower priority. Defaultpriority is <ahref="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#G-PRIORITY-DEFAULT:CAPS"><code class="literal">G_PRIORITY_DEFAULT</code></a>.</p><p>The asyncronous methods have a default fallback that uses threads to implementasynchronicity, so they are optional for inheriting classes. However, if youoverride one you must override all.</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>io_priority</code></em>&#160;:</span></p></td><td> the <a class="link" href="gio-GIOScheduler.html#io-priority">I/O priority</a> of the request. </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>callback</code></em>&#160;:</span></p></td><td> callback to call when the request is satisfied</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td><td> the data to pass to callback function</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3187704"></a><h3><a name="g-input-stream-read-finish"></a>g_input_stream_read_finish ()</h3><a class="indexterm" name="id3187715"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize">gssize</a>              g_input_stream_read_finish          (<a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a> *stream,                                                         <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>Finishes an asynchronous stream read operation.</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>result</code></em>&#160;:</span></p></td><td> a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> 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 in, or -1 on error.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3187851"></a><h3><a name="g-input-stream-skip-async"></a>g_input_stream_skip_async ()</h3><a class="indexterm" name="id3187863"></a><pre class="programlisting">void                g_input_stream_skip_async           (<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,                                                         int io_priority,                                                         <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,                                                         <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre><p>Request an asynchronous skip of <em class="parameter"><code>count</code></em> bytes from the stream into the bufferstarting at <em class="parameter"><code>buffer</code></em>. When the operation is finished <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GInputStream.html#g-input-stream-skip-finish"><code class="function">g_input_stream_skip_finish()</code></a> to get the result of the operation.</p><p>During an async request no other sync and async calls are allowed, and willresult in <a class="link" href="gio-GIOError.html#G-IO-ERROR-PENDING:CAPS"><code class="literal">G_IO_ERROR_PENDING</code></a> errors. </p><p>A value of <em class="parameter"><code>count</code></em> larger than <ahref="/usr/share/gtk-doc/html/glib/glib-Limits-of-Basic-Types.html#G-MAXSSIZE:CAPS"><code class="literal">G_MAXSSIZE</code></a> will cause a <a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-ARGUMENT:CAPS"><code class="literal">G_IO_ERROR_INVALID_ARGUMENT</code></a> error.</p><p>On success, the number of bytes skipped will be passed to thecallback. It is not an error if this is not the same as the requested size, as itcan happen e.g. near the end of a file, but generally we try to skipas many bytes as requested. Zero is returned on end of file(or if <em class="parameter"><code>count</code></em> is zero), but never otherwise.</p><p>Any outstanding i/o request with higher priority (lower numerical value) willbe executed before an outstanding request with lower priority. Defaultpriority is <ahref="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#G-PRIORITY-DEFAULT:CAPS"><code class="literal">G_PRIORITY_DEFAULT</code></a>.</p><p>The asyncronous methods have a default fallback that uses threads to implementasynchronicity, so they are optional for inheriting classes. However, if youoverride one you must override all.</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>io_priority</code></em>&#160;:</span></p></td><td> the <a class="link" href="gio-GIOScheduler.html#io-priority">I/O priority</a> of the request. </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>callback</code></em>&#160;:</span></p></td><td> callback to call when the request is satisfied</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td><td> the data to pass to callback function</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3188163"></a><h3><a name="g-input-stream-skip-finish"></a>g_input_stream_skip_finish ()</h3><a class="indexterm" name="id3188174"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize">gssize</a>              g_input_stream_skip_finish          (<a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a> *stream,                                                         <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);</pre><p>Finishes a stream skip operation.</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>result</code></em>&#160;:</span></p></td><td> a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</td></tr>

⌨️ 快捷键说明

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