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

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

Initial release

File size: 3.4 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.ConverterOutputStream;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.Converter;
26private import gio.ConverterIF;
27private import gio.FilterOutputStream;
28private import gio.OutputStream;
29private import gio.PollableOutputStreamIF;
30private import gio.PollableOutputStreamT;
31private import glib.ConstructionException;
32private import gobject.ObjectG;
33
34
35/**
36 * Converter output stream implements #GOutputStream and allows
37 * conversion of data of various types during reading.
38 *
39 * As of GLib 2.34, #GConverterOutputStream implements
40 * #GPollableOutputStream.
41 */
42public class ConverterOutputStream : FilterOutputStream, PollableOutputStreamIF
43{
44        /** the main Gtk struct */
45        protected GConverterOutputStream* gConverterOutputStream;
46
47        /** Get the main Gtk struct */
48        public GConverterOutputStream* getConverterOutputStreamStruct()
49        {
50                return gConverterOutputStream;
51        }
52
53        /** the main Gtk struct as a void* */
54        protected override void* getStruct()
55        {
56                return cast(void*)gConverterOutputStream;
57        }
58
59        protected override void setStruct(GObject* obj)
60        {
61                gConverterOutputStream = cast(GConverterOutputStream*)obj;
62                super.setStruct(obj);
63        }
64
65        /**
66         * Sets our main struct and passes it to the parent class.
67         */
68        public this (GConverterOutputStream* gConverterOutputStream, bool ownedRef = false)
69        {
70                this.gConverterOutputStream = gConverterOutputStream;
71                super(cast(GFilterOutputStream*)gConverterOutputStream, ownedRef);
72        }
73
74        // add the PollableOutputStream capabilities
75        mixin PollableOutputStreamT!(GConverterOutputStream);
76
77
78        /** */
79        public static GType getType()
80        {
81                return g_converter_output_stream_get_type();
82        }
83
84        /**
85         * Creates a new converter output stream for the @base_stream.
86         *
87         * Params:
88         *     baseStream = a #GOutputStream
89         *     converter = a #GConverter
90         *
91         * Returns: a new #GOutputStream.
92         *
93         * Throws: ConstructionException GTK+ fails to create the object.
94         */
95        public this(OutputStream baseStream, ConverterIF converter)
96        {
97                auto p = g_converter_output_stream_new((baseStream is null) ? null : baseStream.getOutputStreamStruct(), (converter is null) ? null : converter.getConverterStruct());
98               
99                if(p is null)
100                {
101                        throw new ConstructionException("null returned by new");
102                }
103               
104                this(cast(GConverterOutputStream*) p, true);
105        }
106
107        /**
108         * Gets the #GConverter that is used by @converter_stream.
109         *
110         * Returns: the converter of the converter output stream
111         *
112         * Since: 2.24
113         */
114        public ConverterIF getConverter()
115        {
116                auto p = g_converter_output_stream_get_converter(gConverterOutputStream);
117               
118                if(p is null)
119                {
120                        return null;
121                }
122               
123                return ObjectG.getDObject!(Converter, ConverterIF)(cast(GConverter*) p);
124        }
125}
Note: See TracBrowser for help on using the repository browser.