return ret;
}
+GValue
+*gdaex_data_model_iter_get_field_value_at (GdaDataModelIter *iter,
+ const gchar *field_name)
+{
+ GdaDataModel *data_model;
+ gint col;
+
+ GValue *ret;
+
+ g_object_get (G_OBJECT (iter), "data-model", &data_model, NULL);
+
+ col = gda_data_model_get_column_index (data_model, field_name);
+
+ if (col >= 0)
+ {
+ ret = gdaex_data_model_iter_get_value_at (iter, col);
+ }
+ else
+ {
+ g_warning (_("No column found with name «%s»."), field_name);
+ ret = gda_value_new_null ();
+ }
+
+ return ret;
+}
+
/**
* gdaex_data_model_iter_get_field_value_stringify_at:
* @iter: a #GdaDataModelIter object.
return value;
}
+GValue
+*gdaex_data_model_iter_get_value_at (GdaDataModelIter *iter, gint col)
+{
+ const GValue *v;
+ GValue *ret;
+
+ v = gda_data_model_iter_get_value_at (iter, col);
+ if (v == NULL)
+ {
+ GdaDataModel *data_model;
+
+ g_object_get (G_OBJECT (iter), "data-model", &data_model, NULL);
+
+ g_warning (_("Error on retrieving field's value: «%s»."),
+ gda_data_model_get_column_name (data_model, col));
+
+ ret = gda_value_new_null ();
+ }
+ else
+ {
+ ret = g_new0 (GValue, 1);
+ ret = g_value_init (ret, G_VALUE_TYPE (v));
+ g_value_copy (v, ret);
+ }
+
+ return ret;
+}
+
/**
* gdaex_data_model_iter_get_value_stringify_at:
* @iter: a #GdaDataModelIter object.
gint row,
gint col);
+GValue *gdaex_data_model_iter_get_field_value_at (GdaDataModelIter *iter,
+ const gchar *field_name);
gchar *gdaex_data_model_iter_get_field_value_stringify_at (GdaDataModelIter *iter,
const gchar *field_name);
gchar *gdaex_data_model_iter_get_field_value_stringify_escaped_at (GdaDataModelIter *iter,
struct tm *gdaex_data_model_iter_get_field_value_tm_at (GdaDataModelIter *iter,
const gchar *field_name);
+GValue *gdaex_data_model_iter_get_value_at (GdaDataModelIter *iter,
+ gint col);
gchar *gdaex_data_model_iter_get_value_stringify_at (GdaDataModelIter *iter,
gint col);
gchar *gdaex_data_model_iter_get_value_stringify_escaped_at (GdaDataModelIter *iter,