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-row.html
47 * - GdaDataModel* -> DataModel
49 * - GdaValue* -> Value
60 import tango
.io
.Stdout
; // use the tango loging?
64 private import gdac
.gdatypes
;
66 private import gdac
.gda
;
69 private import gda
.Value
;
70 private import gda
.DataModel
;
81 /** the main Gtk struct */
82 protected GdaRow
* gdaRow
;
85 public GdaRow
* getRowStruct()
91 /** the main Gtk struct as a void* */
92 protected void* getStruct()
94 return cast(void*)gdaRow
;
98 * Sets our main struct and passes it to the parent class
100 public this (GdaRow
* gdaRow
)
104 if ( gdaRow
is null )
109 Stdout("struct gdaRow is null on constructor").newline
;
113 printf("struct gdaRow is null on constructor");
120 assert(gdaRow
!is null, "struct gdaRow is null on constructor");
122 this.gdaRow
= gdaRow
;
134 public static GType
getType()
136 // GType gda_row_get_type (void);
137 return gda_row_get_type();
141 * Creates a GdaRow which can hold count GdaValue.
143 * the GdaDataModel this row belongs to.
145 * number of GdaValue in the new GdaRow.
147 * the newly allocated GdaRow.
149 public this (DataModel model
, int count
)
151 // GdaRow* gda_row_new (GdaDataModel *model, gint count);
152 this(cast(GdaRow
*)gda_row_new((model
is null) ?
null : model
.getDataModelStruct(), count
) );
156 * Creates a GdaRow from a list of GdaValue's. These GdaValue's are
157 * value-copied and the user are still resposible for freeing them.
161 * a list of GdaValue's.
163 * the newly created row.
165 public this (DataModel model
, GList
* values
)
167 // GdaRow* gda_row_new_from_list (GdaDataModel *model, const GList *values);
168 this(cast(GdaRow
*)gda_row_new_from_list((model
is null) ?
null : model
.getDataModelStruct(), values
) );
172 * Creates a new GdaRow from an existing one.
174 * quark_list to get a copy from.
176 * a newly allocated GdaRow with a copy of the data in row.
180 // GdaRow* gda_row_copy (GdaRow *row);
181 return new Row( gda_row_copy(gdaRow
) );
185 * Deallocates all memory associated to a GdaRow.
187 * the resource to free.
191 // void gda_row_free (GdaRow *row);
192 gda_row_free(gdaRow
);
196 * Gets the GdaDataModel the given GdaRow belongs to.
202 public DataModel
getModel()
204 // GdaDataModel* gda_row_get_model (GdaRow *row);
205 return new DataModel( gda_row_get_model(gdaRow
) );
209 * Gets the number of the given row, that is, its position in its containing
214 * the row number, or -1 if there was an error.
216 public int getNumber()
218 // gint gda_row_get_number (GdaRow *row);
219 return gda_row_get_number(gdaRow
);
223 * Sets the row number for the given row.
227 * the new row number.
229 public void setNumber(int number
)
231 // void gda_row_set_number (GdaRow *row, gint number);
232 gda_row_set_number(gdaRow
, number
);
236 * Returns the unique identifier for this row. This identifier is
237 * assigned by the different providers, to uniquely identify
238 * rows returned to clients. If there is no ID, this means that
239 * the row has not been created by a provider, or that it the
240 * provider cannot identify it (ie, modifications to it won't
241 * take place into the database).
243 * a GdaRow (which contains GdaValue).
245 * the unique identifier for this row.
247 public char[] getId()
249 // const gchar* gda_row_get_id (GdaRow *row);
250 return Str
.toString(gda_row_get_id(gdaRow
) );
254 * Assigns a new identifier to the given row. This function is
255 * usually called by providers.
257 * a GdaRow (which contains GdaValue).
259 * new identifier for the row.
261 public void setId(char[] id
)
263 // void gda_row_set_id (GdaRow *row, const gchar *id);
264 gda_row_set_id(gdaRow
, Str
.toStringz(id
));
268 * Gets a pointer to a GdaValue stored in a GdaRow.
269 * This is a pointer to the internal array of values. Don't try to free
272 * a GdaRow (which contains GdaValue).
276 * a pointer to the GdaValue in the position num of row.
278 public Value
getValue(int num
)
280 // GdaValue* gda_row_get_value (GdaRow *row, gint num);
281 return new Value( gda_row_get_value(gdaRow
, num
) );
288 * the number of columns that the row has.
290 public int getLength()
292 // gint gda_row_get_length (GdaRow *row);
293 return gda_row_get_length(gdaRow
);