02e4be8ff88b7a780e937abc733d2ea28df78d45
[platform/upstream/pygobject2.git] / docs / reference / pygio-unixoutputstream.xml
1 <?xml version="1.0" standalone="no"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3     "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
4
5 <refentry id="class-giounixoutputstream">
6     <refnamediv>
7         <refname>gio.unix.OutputStream</refname>
8         <refpurpose>Streaming output operations for UNIX file descriptors.</refpurpose>
9     </refnamediv>
10
11     <refsect1>
12         <title>Synopsis</title>
13
14     <classsynopsis language="python">
15         <ooclass><classname>gio.unix.OutputStream</classname></ooclass>
16         <ooclass><classname><link linkend="class-giooutputstream">gio.OutputStream</link></classname></ooclass>
17
18     <constructorsynopsis language="python">
19         <methodname><link linkend="constructor-giounixoutputstream">gio.unix.OutputStream</link></methodname>
20         <methodparam><parameter role="keyword">fd</parameter></methodparam>
21         <methodparam><parameter role="keyword">close_fd</parameter></methodparam>
22     </constructorsynopsis>
23     
24     <methodsynopsis language="python">
25         <methodname><link linkend="method-giounixoutputstream--get-close-fd">get_close_fd</link></methodname>
26         <methodparam></methodparam>
27     </methodsynopsis>
28     <methodsynopsis language="python">
29         <methodname><link linkend="method-giounixoutputstream--get-fd">get_fd</link></methodname>
30         <methodparam></methodparam>
31     </methodsynopsis>
32     <methodsynopsis language="python">
33         <methodname><link linkend="method-giounixoutputstream--set-close-fd">set_close_fd</link></methodname>
34         <methodparam><parameter role="keyword">close_fd</parameter></methodparam>
35     </methodsynopsis>
36
37     </classsynopsis>
38
39     </refsect1>
40
41     <refsect1>
42         <title>Ancestry</title>
43
44 <synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
45   +-- <link linkend="class-giooutputstream">gio.OutputStream</link>
46     +-- <link linkend="class-giounixoutputstream">gio.unix.OutputStream</link>
47 </synopsis>
48
49     </refsect1>
50
51     <refsect1 id="properties-giounixoutputstream">
52         <title>gio.unix.OutputStream Properties</title>
53     
54         <blockquote role="properties">
55             <informaltable pgwide="1" frame="none">
56                 <tgroup cols="3">
57                     <colspec column="1" colwidth="1in"/>
58                     <colspec column="2" colwidth="1in"/>
59                     <colspec column="3" colwidth="4in"/>
60                     <tbody>
61                         <row valign="top">
62                             <entry>"close-fd"</entry>
63                             <entry>Read - Write</entry>
64                             <entry>Whether to close the file descriptor when the stream is closed.
65                             Default value: <literal>True</literal>.</entry>
66                         </row>
67                         <row valign="top">
68                             <entry>"fd"</entry>
69                             <entry>Read - Write - Construct only</entry>
70                             <entry>The file descriptor that the stream writes to. Default value: -1.</entry>
71                         </row>
72                     </tbody>
73                 </tgroup>
74             </informaltable>
75         </blockquote>
76   
77     </refsect1>
78
79     <refsect1>
80         <title>Description</title>
81
82         <para>
83             <link linkend="class-giounixoutputstream"><classname>gio.unix.OutputStream</classname></link>
84             implements <link linkend="class-giooutputstream"><classname>gio.OutputStream</classname></link>
85             for writing to a UNIX file descriptor, including asynchronous operations.
86             The file descriptor must be selectable, so it doesn't work with opened files.
87         </para>
88         <para>
89             Note that <link linkend="class-giounixoutputstream"><classname>gio.unix.OutputStream</classname></link>
90             belongs to the UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file
91             when using it.
92         </para>
93     </refsect1>
94
95     <refsect1 id="constructor-giounixoutputstream">
96         <title>Constructor</title>
97   
98         <programlisting><constructorsynopsis language="python">
99             <methodname>gio.unix.OutputStream</methodname>
100             <methodparam><parameter role="keyword">fd</parameter></methodparam>
101             <methodparam><parameter role="keyword">close_fd</parameter></methodparam>
102         </constructorsynopsis></programlisting>
103         <variablelist>
104             <varlistentry>
105                 <term><parameter>fd</parameter>&nbsp;:</term>
106                 <listitem><simpara>a UNIX file descriptor.
107                 </simpara></listitem>
108             </varlistentry>
109             <varlistentry>
110                 <term><parameter>close_fd</parameter>&nbsp;:</term>
111                 <listitem><simpara><literal>True</literal>
112                 to close the file descriptor when done 
113                 </simpara></listitem>
114             </varlistentry>
115             <varlistentry>
116                 <term><emphasis>Returns</emphasis>&nbsp;:</term>
117                 <listitem><simpara>a new
118                 <link linkend="class-giounixoutputstream"><classname>gio.unix.OutputStream</classname></link>
119                 </simpara></listitem>
120             </varlistentry>
121         </variablelist>
122     
123         <para>
124             Creates a new <link linkend="class-giounixoutputstream"><classname>gio.unix.OutputStream</classname></link>
125             from the given fd.
126         </para>
127         <para>
128             If close_fd is <literal>True</literal>, the file descriptor will be closed when the stream is closed.
129         </para>
130   
131     </refsect1>
132
133     <refsect1>
134         <title>Methods</title>
135
136         <refsect2 id="method-giounixoutputstream--get-close-fd">
137             <title>gio.unix.OutputStream.get_close_fd</title>
138
139             <programlisting><methodsynopsis language="python">
140                 <methodname>get_close_fd</methodname>
141                 <methodparam></methodparam>
142             </methodsynopsis></programlisting>
143             
144             <variablelist>
145                 <varlistentry>
146                     <term><emphasis>Returns</emphasis>&nbsp;:</term>
147                     <listitem><simpara><literal>True</literal> if the file descriptor is closed when done.
148                     </simpara></listitem>
149                 </varlistentry>
150             </variablelist>
151     
152             <para>
153                 The <methodname>get_close_fd</methodname>() method returns whether the file
154                 descriptor of stream will be closed when the stream is closed.
155             </para>
156         </refsect2>
157
158         <refsect2 id="method-giounixoutputstream--get-fd">
159             <title>gio.unix.OutputStream.get_fd</title>
160
161             <programlisting><methodsynopsis language="python">
162                 <methodname>get_fd</methodname>
163                 <methodparam></methodparam>
164             </methodsynopsis></programlisting>
165             
166             <variablelist>
167                 <varlistentry>
168                     <term><emphasis>Returns</emphasis>&nbsp;:</term>
169                     <listitem><simpara>The file descriptor of stream.
170                     </simpara></listitem>
171                 </varlistentry>
172             </variablelist>
173     
174             <para>
175                 The <methodname>get_fd</methodname>() method return the UNIX file descriptor
176                 that the stream reads from.
177             </para>
178         </refsect2>
179
180         <refsect2 id="method-giounixoutputstream--set-close-fd">
181             <title>gio.unix.OutputStream.set_close_fd</title>
182
183             <programlisting><methodsynopsis language="python">
184                 <methodname>set_close_fd</methodname>
185                 <methodparam><parameter role="keyword">close_fd</parameter></methodparam>
186             </methodsynopsis></programlisting>
187             
188             <variablelist>
189                 <varlistentry>
190                   <term><parameter role="keyword">close_fd</parameter>&nbsp;:</term>
191                   <listitem><simpara><literal>True</literal> to close the file descriptor when done .
192                   </simpara></listitem>
193                 </varlistentry>
194             </variablelist>
195     
196             <para>
197                 The <methodname>set_close_fd</methodname>() method sets whether the file descriptor
198                 of stream shall be closed when the stream is closed.
199             </para>
200         </refsect2>
201     </refsect1>
202 </refentry>