source: appstream-generator/build/girepo/gio/SimpleIOStream.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 2 years ago

Initial release

File size: 3.0 KB
Line 
1/*
2 * Licensed under the GNU Lesser General Public License Version 3
3 *
4 * This library is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the license, or
7 * (at your option) any later version.
8 *
9 * This software is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18// generated automatically - do not change
19
20
21module gio.SimpleIOStream;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.IOStream;
26private import gio.InputStream;
27private import gio.OutputStream;
28private import glib.ConstructionException;
29private import gobject.ObjectG;
30
31
32/**
33 * GSimpleIOStream creates a #GIOStream from an arbitrary #GInputStream and
34 * #GOutputStream. This allows any pair of input and output streams to be used
35 * with #GIOStream methods.
36 *
37 * This is useful when you obtained a #GInputStream and a #GOutputStream
38 * by other means, for instance creating them with platform specific methods as
39 * g_unix_input_stream_new() or g_win32_input_stream_new(), and you want
40 * to take advantage of the methods provided by #GIOStream.
41 *
42 * Since: 2.44
43 */
44public class SimpleIOStream : IOStream
45{
46        /** the main Gtk struct */
47        protected GSimpleIOStream* gSimpleIOStream;
48
49        /** Get the main Gtk struct */
50        public GSimpleIOStream* getSimpleIOStreamStruct()
51        {
52                return gSimpleIOStream;
53        }
54
55        /** the main Gtk struct as a void* */
56        protected override void* getStruct()
57        {
58                return cast(void*)gSimpleIOStream;
59        }
60
61        protected override void setStruct(GObject* obj)
62        {
63                gSimpleIOStream = cast(GSimpleIOStream*)obj;
64                super.setStruct(obj);
65        }
66
67        /**
68         * Sets our main struct and passes it to the parent class.
69         */
70        public this (GSimpleIOStream* gSimpleIOStream, bool ownedRef = false)
71        {
72                this.gSimpleIOStream = gSimpleIOStream;
73                super(cast(GIOStream*)gSimpleIOStream, ownedRef);
74        }
75
76
77        /** */
78        public static GType getType()
79        {
80                return g_simple_io_stream_get_type();
81        }
82
83        /**
84         * Creates a new #GSimpleIOStream wrapping @input_stream and @output_stream.
85         * See also #GIOStream.
86         *
87         * Params:
88         *     inputStream = a #GInputStream.
89         *     outputStream = a #GOutputStream.
90         *
91         * Returns: a new #GSimpleIOStream instance.
92         *
93         * Since: 2.44
94         *
95         * Throws: ConstructionException GTK+ fails to create the object.
96         */
97        public this(InputStream inputStream, OutputStream outputStream)
98        {
99                auto p = g_simple_io_stream_new((inputStream is null) ? null : inputStream.getInputStreamStruct(), (outputStream is null) ? null : outputStream.getOutputStreamStruct());
100               
101                if(p is null)
102                {
103                        throw new ConstructionException("null returned by new");
104                }
105               
106                this(cast(GSimpleIOStream*) p, true);
107        }
108}
Note: See TracBrowser for help on using the repository browser.