alternative to assert
[gtkD.git] / gtkD / srcgda / gda / QuarkList.d
blobe8c9f584f04ee4dcb4196db202287a335c9de3dc
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-quark-list.html
26 * outPack = gda
27 * outFile = QuarkList
28 * strct = GdaQuarkList
29 * realStrct=
30 * ctorStrct=
31 * clss = QuarkList
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gda_quark_list_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * structWrap:
45 * - GList* -> ListG
46 * - GdaQuarkList* -> QuarkList
47 * module aliases:
48 * local aliases:
51 module gda.QuarkList;
53 version(noAssert)
55 version(Tango)
57 import tango.io.Stdout; // use the tango loging?
61 private import gdac.gdatypes;
63 private import gdac.gda;
70 /**
71 * Description
72 * Parameter lists are used primary in the parsing and creation
73 * of connection strings.
75 public class QuarkList
78 /** the main Gtk struct */
79 protected GdaQuarkList* gdaQuarkList;
82 public GdaQuarkList* getQuarkListStruct()
84 return gdaQuarkList;
88 /** the main Gtk struct as a void* */
89 protected void* getStruct()
91 return cast(void*)gdaQuarkList;
94 /**
95 * Sets our main struct and passes it to the parent class
97 public this (GdaQuarkList* gdaQuarkList)
99 version(noAssert)
101 if ( gdaQuarkList is null )
103 int zero = 0;
104 version(Tango)
106 Stdout("struct gdaQuarkList is null on constructor").newline;
108 else
110 printf("struct gdaQuarkList is null on constructor");
112 zero = zero / zero;
115 else
117 assert(gdaQuarkList !is null, "struct gdaQuarkList is null on constructor");
119 this.gdaQuarkList = gdaQuarkList;
128 * Returns :
130 public static GType getType()
132 // GType gda_quark_list_get_type (void);
133 return gda_quark_list_get_type();
137 * Creates a new GdaQuarkList, which is a set of key->value pairs,
138 * very similar to GLib's GHashTable, but with the only purpose to
139 * make easier the parsing and creation of data source connection
140 * strings.
141 * Returns :
142 * the newly created GdaQuarkList.
144 public this ()
146 // GdaQuarkList* gda_quark_list_new (void);
147 this(cast(GdaQuarkList*)gda_quark_list_new() );
151 * Creates a new GdaQuarkList given a connection string.
152 * string :
153 * a connection string.
154 * Returns :
155 * the newly created GdaQuarkList.
157 public this (char[] string)
159 // GdaQuarkList* gda_quark_list_new_from_string (const gchar *string);
160 this(cast(GdaQuarkList*)gda_quark_list_new_from_string(Str.toStringz(string)) );
164 * Creates a new GdaQuarkList from an existing one.
165 * qlist :
166 * quark_list to get a copy from.
167 * Returns :
168 * a newly allocated GdaQuarkList with a copy of the data in qlist.
170 public QuarkList copy()
172 // GdaQuarkList* gda_quark_list_copy (GdaQuarkList *qlist);
173 return new QuarkList( gda_quark_list_copy(gdaQuarkList) );
177 * Releases all memory occupied by the given GdaQuarkList.
178 * qlist :
179 * a GdaQuarkList.
181 public void free()
183 // void gda_quark_list_free (GdaQuarkList *qlist);
184 gda_quark_list_free(gdaQuarkList);
188 * Adds new key->value pairs from the given string. If cleanup is
189 * set to TRUE, the previous contents will be discarded before adding
190 * the new pairs.
191 * qlist :
192 * a GdaQuarkList.
193 * string :
194 * a connection string.
195 * cleanup :
196 * whether to cleanup the previous content or not.
198 public void addFromString(char[] string, int cleanup)
200 // void gda_quark_list_add_from_string (GdaQuarkList *qlist, const gchar *string, gboolean cleanup);
201 gda_quark_list_add_from_string(gdaQuarkList, Str.toStringz(string), cleanup);
205 * Searches for the value identified by name in the given GdaQuarkList.
206 * qlist :
207 * a GdaQuarkList.
208 * name :
209 * the name of the value to search for.
210 * Returns :
211 * the value associated with the given key if found, or NULL
212 * if not found.
214 public char[] find(char[] name)
216 // const gchar* gda_quark_list_find (GdaQuarkList *qlist, const gchar *name);
217 return Str.toString(gda_quark_list_find(gdaQuarkList, Str.toStringz(name)) );
221 * Removes an entry from the GdaQuarkList, given its name.
222 * qlist :
223 * a GdaQuarkList structure.
224 * name :
225 * an entry name.
227 public void remove(char[] name)
229 // void gda_quark_list_remove (GdaQuarkList *qlist, const gchar *name);
230 gda_quark_list_remove(gdaQuarkList, Str.toStringz(name));
234 * Removes all strings in the given GdaQuarkList.
235 * qlist :
236 * a GdaQuarkList.
238 public void clear()
240 // void gda_quark_list_clear (GdaQuarkList *qlist);
241 gda_quark_list_clear(gdaQuarkList);