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 = gio-GConverterOutputstream.html 27 * outPack = gio 28 * outFile = ConverterOutputStream 29 * strct = GConverterOutputStream 30 * realStrct= 31 * ctorStrct=GOutputStream 32 * clss = ConverterOutputStream 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - g_converter_output_stream_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - gio.Converter 47 * - gio.ConverterIF 48 * structWrap: 49 * - GConverter* -> ConverterIF 50 * module aliases: 51 * local aliases: 52 * overrides: 53 */ 54 55 module gio.ConverterOutputStream; 56 57 public import gtkc.giotypes; 58 59 private import gtkc.gio; 60 private import glib.ConstructionException; 61 private import gobject.ObjectG; 62 63 64 private import gio.Converter; 65 private import gio.ConverterIF; 66 67 68 69 private import gio.FilterOutputStream; 70 71 /** 72 * Converter output stream implements GOutputStream and allows 73 * conversion of data of various types during reading. 74 * 75 * As of GLib 2.34, GConverterOutputStream implements 76 * GPollableOutputStream. 77 */ 78 public class ConverterOutputStream : FilterOutputStream 79 { 80 81 /** the main Gtk struct */ 82 protected GConverterOutputStream* gConverterOutputStream; 83 84 85 public GConverterOutputStream* getConverterOutputStreamStruct() 86 { 87 return gConverterOutputStream; 88 } 89 90 91 /** the main Gtk struct as a void* */ 92 protected override void* getStruct() 93 { 94 return cast(void*)gConverterOutputStream; 95 } 96 97 /** 98 * Sets our main struct and passes it to the parent class 99 */ 100 public this (GConverterOutputStream* gConverterOutputStream) 101 { 102 super(cast(GFilterOutputStream*)gConverterOutputStream); 103 this.gConverterOutputStream = gConverterOutputStream; 104 } 105 106 protected override void setStruct(GObject* obj) 107 { 108 super.setStruct(obj); 109 gConverterOutputStream = cast(GConverterOutputStream*)obj; 110 } 111 112 /** 113 */ 114 115 /** 116 * Creates a new converter output stream for the base_stream. 117 * Params: 118 * baseStream = a GOutputStream 119 * converter = a GConverter 120 * Throws: ConstructionException GTK+ fails to create the object. 121 */ 122 public this (GOutputStream* baseStream, ConverterIF converter) 123 { 124 // GOutputStream * g_converter_output_stream_new (GOutputStream *base_stream, GConverter *converter); 125 auto p = g_converter_output_stream_new(baseStream, (converter is null) ? null : converter.getConverterTStruct()); 126 if(p is null) 127 { 128 throw new ConstructionException("null returned by g_converter_output_stream_new(baseStream, (converter is null) ? null : converter.getConverterTStruct())"); 129 } 130 this(cast(GConverterOutputStream*) p); 131 } 132 133 /** 134 * Gets the GConverter that is used by converter_stream. 135 * Since 2.24 136 * Returns: the converter of the converter output stream. [transfer none] 137 */ 138 public ConverterIF getConverter() 139 { 140 // GConverter * g_converter_output_stream_get_converter (GConverterOutputStream *converter_stream); 141 auto p = g_converter_output_stream_get_converter(gConverterOutputStream); 142 143 if(p is null) 144 { 145 return null; 146 } 147 148 return ObjectG.getDObject!(Converter, ConverterIF)(cast(GConverter*) p); 149 } 150 }