| 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-GConverterInputstream.html |
|---|
| 27 |
* outPack = gio |
|---|
| 28 |
* outFile = ConverterInputStream |
|---|
| 29 |
* strct = GConverterInputStream |
|---|
| 30 |
* realStrct= |
|---|
| 31 |
* ctorStrct=GInputStream |
|---|
| 32 |
* clss = ConverterInputStream |
|---|
| 33 |
* interf = |
|---|
| 34 |
* class Code: No |
|---|
| 35 |
* interface Code: No |
|---|
| 36 |
* template for: |
|---|
| 37 |
* extend = |
|---|
| 38 |
* implements: |
|---|
| 39 |
* prefixes: |
|---|
| 40 |
* - g_converter_input_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.ConverterInputStream; |
|---|
| 56 |
|
|---|
| 57 |
public import gtkc.giotypes; |
|---|
| 58 |
|
|---|
| 59 |
private import gtkc.gio; |
|---|
| 60 |
private import glib.ConstructionException; |
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
private import gio.Converter; |
|---|
| 64 |
private import gio.ConverterIF; |
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
private import gio.FilterInputStream; |
|---|
| 69 |
|
|---|
| 70 |
/** |
|---|
| 71 |
* Description |
|---|
| 72 |
* Converter input stream implements GInputStream and allows |
|---|
| 73 |
* conversion of data of various types during reading. |
|---|
| 74 |
*/ |
|---|
| 75 |
public class ConverterInputStream : FilterInputStream |
|---|
| 76 |
{ |
|---|
| 77 |
|
|---|
| 78 |
/** the main Gtk struct */ |
|---|
| 79 |
protected GConverterInputStream* gConverterInputStream; |
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
public GConverterInputStream* getConverterInputStreamStruct() |
|---|
| 83 |
{ |
|---|
| 84 |
return gConverterInputStream; |
|---|
| 85 |
} |
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
/** the main Gtk struct as a void* */ |
|---|
| 89 |
protected override void* getStruct() |
|---|
| 90 |
{ |
|---|
| 91 |
return cast(void*)gConverterInputStream; |
|---|
| 92 |
} |
|---|
| 93 |
|
|---|
| 94 |
/** |
|---|
| 95 |
* Sets our main struct and passes it to the parent class |
|---|
| 96 |
*/ |
|---|
| 97 |
public this (GConverterInputStream* gConverterInputStream) |
|---|
| 98 |
{ |
|---|
| 99 |
if(gConverterInputStream is null) |
|---|
| 100 |
{ |
|---|
| 101 |
this = null; |
|---|
| 102 |
return; |
|---|
| 103 |
} |
|---|
| 104 |
//Check if there already is a D object for this gtk struct |
|---|
| 105 |
void* ptr = getDObject(cast(GObject*)gConverterInputStream); |
|---|
| 106 |
if( ptr !is null ) |
|---|
| 107 |
{ |
|---|
| 108 |
this = cast(ConverterInputStream)ptr; |
|---|
| 109 |
return; |
|---|
| 110 |
} |
|---|
| 111 |
super(cast(GFilterInputStream*)gConverterInputStream); |
|---|
| 112 |
this.gConverterInputStream = gConverterInputStream; |
|---|
| 113 |
} |
|---|
| 114 |
|
|---|
| 115 |
protected override void setStruct(GObject* obj) |
|---|
| 116 |
{ |
|---|
| 117 |
super.setStruct(obj); |
|---|
| 118 |
gConverterInputStream = cast(GConverterInputStream*)obj; |
|---|
| 119 |
} |
|---|
| 120 |
|
|---|
| 121 |
/** |
|---|
| 122 |
*/ |
|---|
| 123 |
|
|---|
| 124 |
/** |
|---|
| 125 |
* Creates a new converter input stream for the base_stream. |
|---|
| 126 |
* Params: |
|---|
| 127 |
* baseStream = a GInputStream |
|---|
| 128 |
* converter = a GConverter |
|---|
| 129 |
* Throws: ConstructionException GTK+ fails to create the object. |
|---|
| 130 |
*/ |
|---|
| 131 |
public this (GInputStream* baseStream, ConverterIF converter) |
|---|
| 132 |
{ |
|---|
| 133 |
// GInputStream * g_converter_input_stream_new (GInputStream *base_stream, GConverter *converter); |
|---|
| 134 |
auto p = g_converter_input_stream_new(baseStream, (converter is null) ? null : converter.getConverterTStruct()); |
|---|
| 135 |
if(p is null) |
|---|
| 136 |
{ |
|---|
| 137 |
throw new ConstructionException("null returned by g_converter_input_stream_new(baseStream, (converter is null) ? null : converter.getConverterTStruct())"); |
|---|
| 138 |
} |
|---|
| 139 |
this(cast(GConverterInputStream*) p); |
|---|
| 140 |
} |
|---|
| 141 |
|
|---|
| 142 |
/** |
|---|
| 143 |
* Gets the GConverter that is used by converter_stream. |
|---|
| 144 |
* Since 2.24 |
|---|
| 145 |
* Returns: the converter of the converter input stream. [transfer none] |
|---|
| 146 |
*/ |
|---|
| 147 |
public ConverterIF getConverter() |
|---|
| 148 |
{ |
|---|
| 149 |
// GConverter * g_converter_input_stream_get_converter (GConverterInputStream *converter_stream); |
|---|
| 150 |
auto p = g_converter_input_stream_get_converter(gConverterInputStream); |
|---|
| 151 |
if(p is null) |
|---|
| 152 |
{ |
|---|
| 153 |
return null; |
|---|
| 154 |
} |
|---|
| 155 |
return new Converter(cast(GConverter*) p); |
|---|
| 156 |
} |
|---|
| 157 |
} |
|---|