]> saetta.ns0.it Git - libgdaexgrid/commitdiff
Added functions GdaExGrid::fill_frm_sqlbuilder_with_missing_func and ::fill_from_sqlb...
authorAndrea Zagli <andrea.zagli@email.it>
Tue, 15 Dec 2015 12:43:10 +0000 (13:43 +0100)
committerAndrea Zagli <andrea.zagli@email.it>
Tue, 15 Dec 2015 12:43:10 +0000 (13:43 +0100)
src/grid.c
src/grid.h

index 69ab14b285c966d106aa4a64205627460ed65b6a..b8111b4714230d4ac9ca4294859477d2a63e61ac 100644 (file)
@@ -516,6 +516,28 @@ gdaex_grid_fill_from_datamodel_with_missing_func (GdaExGrid *grid,
        return TRUE;
 }
 
+gboolean
+gdaex_grid_fill_from_sqlbuilder_with_missing_func (GdaExGrid *grid,
+                                                   GdaEx *gdaex,
+                                                   GdaExSqlBuilder *builder,
+                                                   GdaExGridFillListStoreMissingFunc missing_func, gpointer user_data,
+                                                   GError **error)
+{
+       GdaDataModel *dm;
+
+       gboolean ret;
+
+       g_return_val_if_fail (GDAEX_IS_GRID (grid), FALSE);
+       g_return_val_if_fail (IS_GDAEX (gdaex), FALSE);
+       g_return_val_if_fail (GDAEX_IS_SQLBUILDER (builder), FALSE);
+
+       dm = gdaex_sql_builder_query (builder, gdaex, NULL);
+       ret = gdaex_grid_fill_from_datamodel_with_missing_func (grid, dm, missing_func, user_data, error);
+       g_object_unref (dm);
+
+       return ret;
+}
+
 gboolean
 gdaex_grid_fill_from_sql (GdaExGrid *grid, GdaEx *gdaex, const gchar *sql, GError **error)
 {
@@ -528,6 +550,12 @@ gdaex_grid_fill_from_datamodel (GdaExGrid *grid, GdaDataModel *dm, GError **erro
        return gdaex_grid_fill_from_datamodel_with_missing_func (grid, dm, NULL, NULL, error);
 }
 
+gboolean
+gdaex_grid_fill_from_sqlbuilder (GdaExGrid *grid, GdaEx *gdaex, GdaExSqlBuilder *builder, GError **error)
+{
+       return gdaex_grid_fill_from_sqlbuilder_with_missing_func (grid, gdaex, builder, NULL, NULL, error);
+}
+
 #ifdef SOLIPA_FOUND
 void
 gdaex_grid_set_solipa (GdaExGrid *grid, Solipa *solipa)
index cd41e42f87b23cfb3958b77c5236c31d3e94d1fb..fe8063636c165a90365368050d78f2c643600905 100644 (file)
@@ -84,9 +84,15 @@ gboolean gdaex_grid_fill_from_datamodel_with_missing_func (GdaExGrid *grid,
                                                            GdaDataModel *dm,
                                                            GdaExGridFillListStoreMissingFunc missing_func, gpointer user_data,
                                                            GError **error);
+gboolean gdaex_grid_fill_from_sqlbuilder_with_missing_func (GdaExGrid *grid,
+                                                            GdaEx *gdaex,
+                                                            GdaExSqlBuilder *sqlbuilder,
+                                                            GdaExGridFillListStoreMissingFunc missing_func, gpointer user_data,
+                                                            GError **error);
 
 gboolean gdaex_grid_fill_from_sql (GdaExGrid *grid, GdaEx *gdaex, const gchar *sql, GError **error);
 gboolean gdaex_grid_fill_from_datamodel (GdaExGrid *grid, GdaDataModel *dm, GError **error);
+gboolean gdaex_grid_fill_from_sqlbuilder (GdaExGrid *grid, GdaEx *gdaex, GdaExSqlBuilder *builder, GError **error);
 
 #ifdef SOLIPA_FOUND
 void gdaex_grid_set_solipa (GdaExGrid *grid, Solipa *solipa);