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-GdaError.html
57 import tango
.io
.Stdout
; // use the tango loging?
61 private import gdac
.gdatypes
;
63 private import gdac
.gda
;
66 private import glib
.ListG
;
77 /** the main Gtk struct */
78 protected GdaError
* gdaError
;
81 public GdaError
* getErrorStruct()
87 /** the main Gtk struct as a void* */
88 protected void* getStruct()
90 return cast(void*)gdaError
;
94 * Sets our main struct and passes it to the parent class
96 public this (GdaError
* gdaError
)
100 if ( gdaError
is null )
105 Stdout("struct gdaError is null on constructor").newline
;
109 printf("struct gdaError is null on constructor");
116 assert(gdaError
!is null, "struct gdaError is null on constructor");
118 this.gdaError
= gdaError
;
122 this.gdaError
= cast(GdaError
*) glist
.data
;
134 // GdaError* gda_error_new (void);
135 this(cast(GdaError
*)gda_error_new() );
139 * Frees the memory allocated by the error object.
145 // void gda_error_free (GdaError *error);
146 gda_error_free(gdaError
);
150 * Creates a new list which contains the same errors as errors and
151 * adds a reference for each error in the list.
152 * You must free the list using gda_error_list_free.
154 * a GList holding error objects.
158 public static ListG
listCopy(ListG errors
)
160 // GList* gda_error_list_copy (const GList *errors);
161 return new ListG( gda_error_list_copy((errors
is null) ?
null : errors
.getListGStruct()) );
165 * Frees all error objects in the list and the list itself.
166 * After this function has been called, the errors parameter doesn't point
167 * to valid storage any more.
169 * a GList holding error objects.
171 public static void listFree(ListG errors
)
173 // void gda_error_list_free (GList *errors);
174 gda_error_list_free((errors
is null) ?
null : errors
.getListGStruct());
181 * error's description.
183 public char[] getDescription()
185 // const gchar* gda_error_get_description (GdaError *error);
186 return Str
.toString(gda_error_get_description(gdaError
) );
190 * Sets error's description.
196 public void setDescription(char[] description
)
198 // void gda_error_set_description (GdaError *error, const gchar *description);
199 gda_error_set_description(gdaError
, Str
.toStringz(description
));
208 public int getNumber()
210 // glong gda_error_get_number (GdaError *error);
211 return gda_error_get_number(gdaError
);
215 * Sets error's number.
221 public void setNumber(int number
)
223 // void gda_error_set_number (GdaError *error, glong number);
224 gda_error_set_number(gdaError
, number
);
233 public char[] getSource()
235 // const gchar* gda_error_get_source (GdaError *error);
236 return Str
.toString(gda_error_get_source(gdaError
) );
240 * Sets error's source.
246 public void setSource(char[] source
)
248 // void gda_error_set_source (GdaError *error, const gchar *source);
249 gda_error_set_source(gdaError
, Str
.toStringz(source
));
258 public char[] getSqlstate()
260 // const gchar* gda_error_get_sqlstate (GdaError *error);
261 return Str
.toString(gda_error_get_sqlstate(gdaError
) );
265 * Sets error's SQL state.
271 public void setSqlstate(char[] sqlstate
)
273 // void gda_error_set_sqlstate (GdaError *error, const gchar *sqlstate);
274 gda_error_set_sqlstate(gdaError
, Str
.toStringz(sqlstate
));