alternative to assert
[gtkD.git] / gtkD / srcgda / gda / ProviderInfo.d
blob5a5b27e5836d59ab1900d109e73aa94f77181f0d
1 /*
2 * This file is part of gtkD.
4 * gtkD 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 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD 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.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = libgda-gda-config.html
26 * outPack = gda
27 * outFile = ProviderInfo
28 * strct = GdaProviderInfo
29 * realStrct=
30 * ctorStrct=
31 * clss = ProviderInfo
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gda_provider_
40 * omit structs:
41 * - GdaDataSourceInfo
42 * omit prefixes:
43 * - gda_config_
44 * - gda_data_source_
45 * omit code:
46 * - GdaConfigListenerFunc
47 * imports:
48 * - glib.ListG
49 * - std.string
50 * structWrap:
51 * module aliases:
52 * local aliases:
55 module gda.ProviderInfo;
57 version(noAssert)
59 version(Tango)
61 import tango.io.Stdout; // use the tango loging?
65 private import gdac.gdatypes;
67 private import gdac.gda;
70 private import glib.ListG;
73 version(Tango) {
74 private import tango.text.Util;
75 } else {
76 private import std.string;
82 /**
83 * Description
84 * The functions in this section allow applications an easy access to the libgda
85 * configuration, thus making them able to access the list of data sources
86 * configured in the system, for instance.
88 public class ProviderInfo
91 /** the main Gtk struct */
92 protected GdaProviderInfo* gdaProviderInfo;
95 public GdaProviderInfo* getProviderInfoStruct()
97 return gdaProviderInfo;
101 /** the main Gtk struct as a void* */
102 protected void* getStruct()
104 return cast(void*)gdaProviderInfo;
108 * Sets our main struct and passes it to the parent class
110 public this (GdaProviderInfo* gdaProviderInfo)
112 version(noAssert)
114 if ( gdaProviderInfo is null )
116 int zero = 0;
117 version(Tango)
119 Stdout("struct gdaProviderInfo is null on constructor").newline;
121 else
123 printf("struct gdaProviderInfo is null on constructor");
125 zero = zero / zero;
128 else
130 assert(gdaProviderInfo !is null, "struct gdaProviderInfo is null on constructor");
132 this.gdaProviderInfo = gdaProviderInfo;
135 this (ListG glist) {
136 this.gdaProviderInfo = cast(GdaProviderInfo *) glist.data;
138 char[] id() { return std.string.toString((cast(_GdaProviderInfo*)this.gdaProviderInfo).id); }
139 char[] location() { return std.string.toString((cast(_GdaProviderInfo*)this.gdaProviderInfo).location); }
140 char[] description() { return std.string.toString((cast(_GdaProviderInfo*)this.gdaProviderInfo).description); }
141 ListG gda_params() { return new ListG((cast(_GdaProviderInfo*)this.gdaProviderInfo).gda_params); }
170 * Returns :
172 public static GType infoGetType()
174 // GType gda_provider_info_get_type (void);
175 return gda_provider_info_get_type();
179 * Creates a new GdaProviderInfo structure from an existing one.
180 * src :
181 * provider information to get a copy from.
182 * Returns :
183 * a newly allocated GdaProviderInfo with contains a copy of
184 * information in src.
186 public GdaProviderInfo* infoCopy()
188 // GdaProviderInfo* gda_provider_info_copy (GdaProviderInfo *src);
189 return gda_provider_info_copy(gdaProviderInfo);
193 * Deallocates all memory associated to the given GdaProviderInfo.
194 * provider_info :
195 * provider information to free.
197 public void infoFree()
199 // void gda_provider_info_free (GdaProviderInfo *provider_info);
200 gda_provider_info_free(gdaProviderInfo);