diff options
Diffstat (limited to 'docs/reference/pygio-fileinputstream.xml')
-rw-r--r-- | docs/reference/pygio-fileinputstream.xml | 214 |
1 files changed, 214 insertions, 0 deletions
diff --git a/docs/reference/pygio-fileinputstream.xml b/docs/reference/pygio-fileinputstream.xml new file mode 100644 index 0000000..723dc64 --- /dev/null +++ b/docs/reference/pygio-fileinputstream.xml @@ -0,0 +1,214 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" + "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> + +<refentry id="class-giofileinputstream"> + <refnamediv> + <refname>gio.FileInputStream</refname> + <refpurpose>Base class for implementing streaming input</refpurpose> + </refnamediv> + + <refsect1> + <title>Synopsis</title> + + <classsynopsis language="python"> + <ooclass><classname>gio.FileInputStream</classname></ooclass> + <ooclass><classname><link linkend="class-gioinputstream">gio.InputStream</link></classname></ooclass> + + <methodsynopsis language="python"> + <methodname><link linkend="method-giofileinputstream--query-info">query_info</link></methodname> + <methodparam><parameter role="keyword">attributes</parameter></methodparam> + <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam> + </methodsynopsis> + <methodsynopsis language="python"> + <methodname><link linkend="method-giofileinputstream--query-info-async">query_info_async</link></methodname> + <methodparam><parameter role="keyword">attributes</parameter></methodparam> + <methodparam><parameter role="keyword">callback</parameter></methodparam> + <methodparam><parameter role="keyword">io_priority</parameter><initializer>glib.PRIORITY_DEFAULT</initializer></methodparam> + <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam> + <methodparam><parameter role="keyword">user_data</parameter><initializer>None</initializer></methodparam> + </methodsynopsis> + <methodsynopsis language="python"> + <methodname><link linkend="method-giofileinputstream--query-info-finish">query_info_finish</link></methodname> + <methodparam><parameter role="keyword">result</parameter></methodparam> + </methodsynopsis> + + </classsynopsis> + + </refsect1> + + <refsect1> + <title>Ancestry</title> + +<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link> + +-- <link linkend="class-gioinputstream">gio.InputStream</link> + +-- <link linkend="class-giofileinputstream">gio.FileInputStream</link> +</synopsis> + + </refsect1> + + <refsect1> + <title>Implemented Interfaces</title> + <para> + <link linkend="class-giofileinputstream"><classname>gio.FileInputStream</classname></link> + implements + <link linkend="class-gioseekable"><classname>gio.Seekable</classname></link> + </para> + </refsect1> + + <refsect1> + <title>Description</title> + + <para> + <link linkend="class-giofileinputstream"><classname>gio.FileInputStream</classname></link> + provides input streams that take their content from a file. + </para> + <para> + <link linkend="class-giofileinputstream"><classname>gio.FileInputStream</classname></link> + implements <link linkend="class-gioseekable"><classname>gio.Seekable</classname></link>, + which allows the input stream to jump to arbitrary positions in the file, provided the filesystem + of the file allows it. In addition to the generic g_seekable_ API, + <link linkend="class-giofileinputstream"><classname>gio.FileInputStream</classname></link> + has its own API for seeking and positioning. To find the position of a file input stream, use + <methodname><link linkend="method-gioseekable--tell">gio.Seekable.tell</link></methodname>(). + To find out if a file input stream supports seeking, use + <methodname><link linkend="method-gioseekable--can_seek">gio.Seekable.can_seek</link></methodname>(). + To position a file input stream, use + <methodname><link linkend="method-gioseekable--seek">gio.Seekable.seek</link></methodname>(). + </para> + </refsect1> + + <refsect1> + <title>Methods</title> + + <refsect2 id="method-giofileinputstream--query-info"> + <title>gio.FileInputStream.query_info</title> + + <programlisting><methodsynopsis language="python"> + <methodname>query_info</methodname> + <methodparam><parameter role="keyword">attributes</parameter></methodparam> + <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam> + </methodsynopsis></programlisting> + + <variablelist> + <varlistentry> + <term><parameter role="keyword">attributes</parameter> :</term> + <listitem><simpara>a file attribute query string. + </simpara></listitem> + </varlistentry> + <varlistentry> + <term><parameter role="keyword">cancellable</parameter> :</term> + <listitem><simpara>optional + <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link> + object, <literal>None</literal> to ignore. + </simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>a <link linkend="class-giofileinfo"><classname>gio.FileInfo</classname></link>, + or <literal>None</literal> on error. + </simpara></listitem> + </varlistentry> + </variablelist> + + <para> + The <methodname>query_info</methodname>() method queries a file input stream + the given attributes. This function blocks while querying the stream. + For the asynchronous (non-blocking) version of this function, see + <methodname><link linkend="method-giofileinputstream--query-info-async">gio.FileInputStream.query_info_async</link></methodname>(). + While the stream is blocked, the stream will set the pending flag internally, + and any other operations on the stream will fail with gio.ERROR_PENDING. + </para> + </refsect2> + + <refsect2 id="method-giofileinputstream--query-info-async"> + <title>gio.FileInputStream.query_info_async</title> + + <programlisting><methodsynopsis language="python"> + <methodname>query_info_async</methodname> + <methodparam><parameter role="keyword">attributes</parameter></methodparam> + <methodparam><parameter role="keyword">callback</parameter></methodparam> + <methodparam><parameter role="keyword">io_priority</parameter><initializer>glib.PRIORITY_DEFAULT</initializer></methodparam> + <methodparam><parameter role="keyword">cancellable</parameter><initializer>None</initializer></methodparam> + <methodparam><parameter role="keyword">user_data</parameter><initializer>None</initializer></methodparam> + </methodsynopsis></programlisting> + + <variablelist> + <varlistentry> + <term><parameter role="keyword">attributes</parameter> :</term> + <listitem><simpara>a file attribute query string. + </simpara></listitem> + </varlistentry> + <varlistentry> + <term><parameter>callback</parameter> :</term> + <listitem><simpara>a GAsyncReadyCallback to call when the request is satisfied. + </simpara></listitem> + </varlistentry> + <varlistentry> + <term><parameter>io_priority</parameter> :</term> + <listitem><simpara>the + <xref linkend="glib-priority-constants" endterm="glib-priority-constants-title"></xref> + of the request. + </simpara></listitem> + </varlistentry> + <varlistentry> + <term><parameter>cancellable</parameter> :</term> + <listitem><simpara>optional + <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link> + object, <literal>None</literal> to ignore.</simpara></listitem> + </varlistentry> + <varlistentry> + <term><parameter>user_data</parameter> :</term> + <listitem><simpara>the data to pass to callback function. + </simpara></listitem> + </varlistentry> + </variablelist> + + <para> + The <methodname>query_info_async</methodname>() method queries the stream + information asynchronously. When the operation is finished callback will be + called. You can then call + <methodname><link linkend="method-giofileinputstream--query-info-finish">gio.FileInputStream.query_info_finish</link></methodname>() + to get the result of the operation. + </para> + <para> + For the synchronous version of this function, see + <methodname><link linkend="method-giofileinputstream--query-info">gio.FileInputStream.query_info</link></methodname>(). + </para> + <para> + If cancellable is not <literal>None</literal>, then the operation can be cancelled + by triggering the cancellable object from another thread. If the operation was + cancelled, the error gio.ERROR_CANCELLED will be set + </para> + </refsect2> + + <refsect2 id="method-giofileinputstream--query-info-finish"> + <title>gio.FileInputStream.query_info_finish</title> + + <programlisting><methodsynopsis language="python"> + <methodname>query_info_finish</methodname> + <methodparam><parameter role="keyword">result</parameter></methodparam> + </methodsynopsis></programlisting> + + <variablelist> + <varlistentry> + <term><parameter role="keyword">result</parameter> :</term> + <listitem><simpara>a <link linkend="class-gioasyncresult"><classname>gio.AsyncResult</classname></link>. + </simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>a <link linkend="class-giofileinfo"><classname>gio.FileInfo</classname></link>, + or <literal>None</literal> on error. + </simpara></listitem> + </varlistentry> + </variablelist> + + <para> + The <methodname>query_info_finish</methodname>() method finishes an asynchronous + file append operation started with + <methodname><link linkend="method-giofileinputstream--query-info-async">gio.FileInputStream.query_info_async</link></methodname>(). + </para> + </refsect2> + </refsect1> +</refentry> |