root/trunk/src/gio/UnixOutputStream.d

Revision 938, 4.9 kB (checked in by Mike Wey, 3 months ago)

Update Gio to 2.28.

Line 
1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23
24 /*
25  * Conversion parameters:
26  * inFile  = GUnixOutputStream.html
27  * outPack = gio
28  * outFile = UnixOutputStream
29  * strct   = GUnixOutputStream
30  * realStrct=
31  * ctorStrct=GOutputStream
32  * clss    = UnixOutputStream
33  * interf  =
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  =
38  * implements:
39  *  - PollableOutputStreamIF
40  * prefixes:
41  *  - g_unix_output_stream_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  *  - gio.PollableOutputStreamT
48  *  - gio.PollableOutputStreamIF
49  * structWrap:
50  * module aliases:
51  * local aliases:
52  * overrides:
53  */
54
55 module gio.UnixOutputStream;
56
57 public  import gtkc.giotypes;
58
59 private import gtkc.gio;
60 private import glib.ConstructionException;
61
62
63 private import gio.PollableOutputStreamT;
64 private import gio.PollableOutputStreamIF;
65
66
67
68 private import gio.OutputStream;
69
70 /**
71  * Description
72  * GUnixOutputStream implements GOutputStream for writing to a
73  * UNIX file descriptor, including asynchronous operations. The file
74  * descriptor must be selectable, so it doesn't work with opened files.
75  * Note that <gio/gunixoutputstream.h> belongs
76  * to the UNIX-specific GIO interfaces, thus you have to use the
77  * gio-unix-2.0.pc pkg-config file when using it.
78  */
79 public class UnixOutputStream : OutputStream, PollableOutputStreamIF
80 {
81    
82     /** the main Gtk struct */
83     protected GUnixOutputStream* gUnixOutputStream;
84    
85    
86     public GUnixOutputStream* getUnixOutputStreamStruct()
87     {
88         return gUnixOutputStream;
89     }
90    
91    
92     /** the main Gtk struct as a void* */
93     protected override void* getStruct()
94     {
95         return cast(void*)gUnixOutputStream;
96     }
97    
98     /**
99      * Sets our main struct and passes it to the parent class
100      */
101     public this (GUnixOutputStream* gUnixOutputStream)
102     {
103         if(gUnixOutputStream is null)
104         {
105             this = null;
106             return;
107         }
108         //Check if there already is a D object for this gtk struct
109         void* ptr = getDObject(cast(GObject*)gUnixOutputStream);
110         if( ptr !is null )
111         {
112             this = cast(UnixOutputStream)ptr;
113             return;
114         }
115         super(cast(GOutputStream*)gUnixOutputStream);
116         this.gUnixOutputStream = gUnixOutputStream;
117     }
118    
119     protected override void setStruct(GObject* obj)
120     {
121         super.setStruct(obj);
122         gUnixOutputStream = cast(GUnixOutputStream*)obj;
123     }
124    
125     // add the PollableOutputStream capabilities
126     mixin PollableOutputStreamT!(GUnixOutputStream);
127    
128     /**
129      */
130    
131     /**
132      * Creates a new GUnixOutputStream for the given fd.
133      * If close_fd, is TRUE, the file descriptor will be closed when
134      * the output stream is destroyed.
135      * Params:
136      * fd = a UNIX file descriptor
137      * closeFd = TRUE to close the file descriptor when done
138      * Throws: ConstructionException GTK+ fails to create the object.
139      */
140     public this (int fd, int closeFd)
141     {
142         // GOutputStream * g_unix_output_stream_new (gint fd,  gboolean close_fd);
143         auto p = g_unix_output_stream_new(fd, closeFd);
144         if(p is null)
145         {
146             throw new ConstructionException("null returned by g_unix_output_stream_new(fd, closeFd)");
147         }
148         this(cast(GUnixOutputStream*) p);
149     }
150    
151     /**
152      * Sets whether the file descriptor of stream shall be closed
153      * when the stream is closed.
154      * Since 2.20
155      * Params:
156      * closeFd = TRUE to close the file descriptor when done
157      */
158     public void setCloseFd(int closeFd)
159     {
160         // void g_unix_output_stream_set_close_fd (GUnixOutputStream *stream,  gboolean close_fd);
161         g_unix_output_stream_set_close_fd(gUnixOutputStream, closeFd);
162     }
163    
164     /**
165      * Returns whether the file descriptor of stream will be
166      * closed when the stream is closed.
167      * Since 2.20
168      * Returns: TRUE if the file descriptor is closed when done
169      */
170     public int getCloseFd()
171     {
172         // gboolean g_unix_output_stream_get_close_fd (GUnixOutputStream *stream);
173         return g_unix_output_stream_get_close_fd(gUnixOutputStream);
174     }
175    
176     /**
177      * Return the UNIX file descriptor that the stream writes to.
178      * Since 2.20
179      * Returns: The file descriptor of stream
180      */
181     public int getFd()
182     {
183         // gint g_unix_output_stream_get_fd (GUnixOutputStream *stream);
184         return g_unix_output_stream_get_fd(gUnixOutputStream);
185     }
186 }
Note: See TracBrowser for help on using the browser.