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 = GZlibDecompressor.html 27 * outPack = gio 28 * outFile = ZlibDecompressor 29 * strct = GZlibDecompressor 30 * realStrct= 31 * ctorStrct= 32 * clss = ZlibDecompressor 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * - ConverterIF 40 * prefixes: 41 * - g_zlib_decompressor_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * omit signals: 46 * imports: 47 * - gio.FileInfo 48 * - gio.ConverterT 49 * - gio.ConverterIF 50 * structWrap: 51 * - GFileInfo* -> FileInfo 52 * module aliases: 53 * local aliases: 54 * overrides: 55 */ 56 57 module gio.ZlibDecompressor; 58 59 public import gtkc.giotypes; 60 61 private import gtkc.gio; 62 private import glib.ConstructionException; 63 private import gobject.ObjectG; 64 65 66 private import gio.FileInfo; 67 private import gio.ConverterT; 68 private import gio.ConverterIF; 69 70 71 72 private import gobject.ObjectG; 73 74 /** 75 * Description 76 * GZlibDecompressor is an implementation of GConverter that 77 * decompresses data compressed with zlib. 78 */ 79 public class ZlibDecompressor : ObjectG, ConverterIF 80 { 81 82 /** the main Gtk struct */ 83 protected GZlibDecompressor* gZlibDecompressor; 84 85 86 public GZlibDecompressor* getZlibDecompressorStruct() 87 { 88 return gZlibDecompressor; 89 } 90 91 92 /** the main Gtk struct as a void* */ 93 protected override void* getStruct() 94 { 95 return cast(void*)gZlibDecompressor; 96 } 97 98 /** 99 * Sets our main struct and passes it to the parent class 100 */ 101 public this (GZlibDecompressor* gZlibDecompressor) 102 { 103 super(cast(GObject*)gZlibDecompressor); 104 this.gZlibDecompressor = gZlibDecompressor; 105 } 106 107 protected override void setStruct(GObject* obj) 108 { 109 super.setStruct(obj); 110 gZlibDecompressor = cast(GZlibDecompressor*)obj; 111 } 112 113 // add the Converter capabilities 114 mixin ConverterT!(GZlibDecompressor); 115 116 /** 117 */ 118 119 /** 120 * Creates a new GZlibDecompressor. 121 * Since 2.24 122 * Params: 123 * format = The format to use for the compressed data 124 * Throws: ConstructionException GTK+ fails to create the object. 125 */ 126 public this (GZlibCompressorFormat format) 127 { 128 // GZlibDecompressor * g_zlib_decompressor_new (GZlibCompressorFormat format); 129 auto p = g_zlib_decompressor_new(format); 130 if(p is null) 131 { 132 throw new ConstructionException("null returned by g_zlib_decompressor_new(format)"); 133 } 134 this(cast(GZlibDecompressor*) p); 135 } 136 137 /** 138 * Retrieves the GFileInfo constructed from the GZIP header data 139 * of compressed data processed by compressor, or NULL if decompressor's 140 * "format" property is not G_ZLIB_COMPRESSOR_FORMAT_GZIP, 141 * or the header data was not fully processed yet, or it not present in the 142 * data stream at all. 143 * Since 2.26 144 * Returns: a GFileInfo, or NULL. [transfer none] 145 */ 146 public FileInfo getFileInfo() 147 { 148 // GFileInfo * g_zlib_decompressor_get_file_info (GZlibDecompressor *decompressor); 149 auto p = g_zlib_decompressor_get_file_info(gZlibDecompressor); 150 151 if(p is null) 152 { 153 return null; 154 } 155 156 return ObjectG.getDObject!(FileInfo)(cast(GFileInfo*) p); 157 } 158 }