<refentry id="gmime-GMimeStreamGIO">
<refmeta>
<refentrytitle role="top_of_page" id="gmime-GMimeStreamGIO.top_of_page">GMimeStreamGIO</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  GMIME Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GMimeStreamGIO</refname>
<refpurpose>A wrapper for GLib's GIO streams</refpurpose>
</refnamediv>

<refsynopsisdiv id="gmime-GMimeStreamGIO.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>                    <link linkend="GMimeStreamGIO">GMimeStreamGIO</link>;
<link linkend="GMimeStream"><returnvalue>GMimeStream</returnvalue></link> *       <link linkend="g-mime-stream-gio-new">g_mime_stream_gio_new</link>               (<parameter><link linkend="GFile"><type>GFile</type></link> *file</parameter>);
<link linkend="GMimeStream"><returnvalue>GMimeStream</returnvalue></link> *       <link linkend="g-mime-stream-gio-new-with-bounds">g_mime_stream_gio_new_with_bounds</link>   (<parameter><link linkend="GFile"><type>GFile</type></link> *file</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> start</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> end</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="g-mime-stream-gio-get-owner">g_mime_stream_gio_get_owner</link>         (<parameter><link linkend="GMimeStreamGIO"><type>GMimeStreamGIO</type></link> *stream</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-stream-gio-set-owner">g_mime_stream_gio_set_owner</link>         (<parameter><link linkend="GMimeStreamGIO"><type>GMimeStreamGIO</type></link> *stream</parameter>,
                                                         <parameter><link linkend="gboolean"><type>gboolean</type></link> owner</parameter>);
</synopsis>
</refsynopsisdiv>

<refsect1 id="gmime-GMimeStreamGIO.description" role="desc">
<title role="desc.title">Description</title>
<para>
A simple <link linkend="GMimeStream"><type>GMimeStream</type></link> implementation that sits on top of GLib's GIO
input and output streams.
</para>
</refsect1>
<refsect1 id="gmime-GMimeStreamGIO.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GMimeStreamGIO" role="struct">
<title>GMimeStreamGIO</title>
<indexterm zone="GMimeStreamGIO"><primary>GMimeStreamGIO</primary></indexterm>
<programlisting>typedef struct {
	GMimeStream parent_object;
	
	GOutputStream *ostream;
	GInputStream *istream;
	GFile *file;
	
	gboolean owner;
	gboolean eos;
} GMimeStreamGIO;
</programlisting>
<para>
A <link linkend="GMimeStream"><type>GMimeStream</type></link> wrapper around GLib's GIO streams.
</para><variablelist role="struct">
<varlistentry><term><link linkend="GMimeStream"><type>GMimeStream</type></link>&#160;<structfield id="GMimeStreamGIO.parent-object">parent_object</structfield>;</term>
<listitem><simpara>parent <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem>
</varlistentry>
<varlistentry><term><link linkend="GOutputStream"><type>GOutputStream</type></link>&#160;*<structfield id="GMimeStreamGIO.ostream">ostream</structfield>;</term>
<listitem><simpara>a <link linkend="GOutputStream"><type>GOutputStream</type></link>
</simpara></listitem>
</varlistentry>
<varlistentry><term><link linkend="GInputStream"><type>GInputStream</type></link>&#160;*<structfield id="GMimeStreamGIO.istream">istream</structfield>;</term>
<listitem><simpara>a <link linkend="GInputStream"><type>GInputStream</type></link>
</simpara></listitem>
</varlistentry>
<varlistentry><term><link linkend="GFile"><type>GFile</type></link>&#160;*<structfield id="GMimeStreamGIO.file">file</structfield>;</term>
<listitem><simpara>a <link linkend="GFile"><type>GFile</type></link>
</simpara></listitem>
</varlistentry>
<varlistentry><term><link linkend="gboolean"><type>gboolean</type></link>&#160;<structfield id="GMimeStreamGIO.owner">owner</structfield>;</term>
<listitem><simpara><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if this stream owns the <link linkend="GFile"><type>GFile</type></link> or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise
</simpara></listitem>
</varlistentry>
<varlistentry><term><link linkend="gboolean"><type>gboolean</type></link>&#160;<structfield id="GMimeStreamGIO.eos">eos</structfield>;</term>
<listitem><simpara><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the end of the stream has been reached or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-gio-new" role="function">
<title>g_mime_stream_gio_new ()</title>
<indexterm zone="g-mime-stream-gio-new"><primary>g_mime_stream_gio_new</primary></indexterm>
<programlisting><link linkend="GMimeStream"><returnvalue>GMimeStream</returnvalue></link> *       g_mime_stream_gio_new               (<parameter><link linkend="GFile"><type>GFile</type></link> *file</parameter>);</programlisting>
<para>
Creates a new <link linkend="GMimeStreamGIO"><type>GMimeStreamGIO</type></link> wrapper around a <link linkend="GFile"><type>GFile</type></link> object.
</para><variablelist role="params">
<varlistentry><term><parameter>file</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GFile"><type>GFile</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a stream using <parameter>file</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-gio-new-with-bounds" role="function">
<title>g_mime_stream_gio_new_with_bounds ()</title>
<indexterm zone="g-mime-stream-gio-new-with-bounds"><primary>g_mime_stream_gio_new_with_bounds</primary></indexterm>
<programlisting><link linkend="GMimeStream"><returnvalue>GMimeStream</returnvalue></link> *       g_mime_stream_gio_new_with_bounds   (<parameter><link linkend="GFile"><type>GFile</type></link> *file</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> start</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> end</parameter>);</programlisting>
<para>
Creates a new <link linkend="GMimeStreamGIO"><type>GMimeStreamGIO</type></link> stream around a <link linkend="GFile"><type>GFile</type></link> with bounds
<parameter>start</parameter> and <parameter>end</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>file</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GFile"><type>GFile</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara>start boundary
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara>end boundary
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a stream using <parameter>file</parameter> with bounds <parameter>start</parameter> and <parameter>end</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-gio-get-owner" role="function">
<title>g_mime_stream_gio_get_owner ()</title>
<indexterm zone="g-mime-stream-gio-get-owner"><primary>g_mime_stream_gio_get_owner</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            g_mime_stream_gio_get_owner         (<parameter><link linkend="GMimeStreamGIO"><type>GMimeStreamGIO</type></link> *stream</parameter>);</programlisting>
<para>
Gets whether or not <parameter>stream</parameter> owns the backend <link linkend="GFile"><type>GFile</type></link>.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStreamGIO"><type>GMimeStreamGIO</type></link> stream
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>stream</parameter> owns the backend <link linkend="GFile"><type>GFile</type></link> or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>
otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-gio-set-owner" role="function">
<title>g_mime_stream_gio_set_owner ()</title>
<indexterm zone="g-mime-stream-gio-set-owner"><primary>g_mime_stream_gio_set_owner</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_stream_gio_set_owner         (<parameter><link linkend="GMimeStreamGIO"><type>GMimeStreamGIO</type></link> *stream</parameter>,
                                                         <parameter><link linkend="gboolean"><type>gboolean</type></link> owner</parameter>);</programlisting>
<para>
Sets whether or not <parameter>stream</parameter> owns the backend GIO pointer.
</para>
<para>
Note: <parameter>owner</parameter> should be <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the stream should <link linkend="close"><function>close()</function></link> the
backend file descriptor when destroyed or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStreamGIO"><type>GMimeStreamGIO</type></link> stream
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>owner</parameter>&#160;:</term>
<listitem><simpara><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if this stream should own the <link linkend="GFile"><type>GFile</type></link> or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="gmime-GMimeStreamGIO.see-also">
<title>See Also</title>
<link linkend="GMimeStream"><type>GMimeStream</type></link>
</refsect1>

</refentry>
