]> saetta.ns0.it Git - libgdaex/commitdiff
Added the function GdaEx::data_model_is_empty (closes #230). query-editor
authorAndrea Zagli <azagli@libero.it>
Sat, 26 Nov 2011 10:33:07 +0000 (11:33 +0100)
committerAndrea Zagli <azagli@libero.it>
Sat, 26 Nov 2011 10:33:07 +0000 (11:33 +0100)
.anjuta_sym_db.db
src/gdaex.c
src/gdaex.h

index 84813a4956c312985bff0e78edeaf4557bb24c37..6526f20c7490f069ce53845e7306f2d6a8471e07 100644 (file)
Binary files a/.anjuta_sym_db.db and b/.anjuta_sym_db.db differ
index 39bce68d2c6d766fdc6fb606b5c91df5ae4006c7..816bda523f6aafc74d758eb9c7a0aa4894951f20 100644 (file)
@@ -717,6 +717,19 @@ GdaDataModel
        return dm;
 }
 
+/**
+ * gdaex_data_model_is_empty:
+ * @data_model: a #GdaDataModel object.
+ *
+ * Returns: #TRUE if #GdaDataModel is #NULL or it doesn't have any row.
+ */
+gboolean
+gdaex_data_model_is_empty (GdaDataModel *data_model)
+{
+       return (!GDA_IS_DATA_MODEL (data_model)
+               || gda_data_model_get_n_rows (data_model) == 0);
+}
+
 /**
  * gdaex_data_model_get_field_value_stringify_at:
  * @data_model: a #GdaDataModel object.
index ce053ef9f4b288516c0fb6c9eee676ea9ec03a6c..39a8b3981a95db6f9134e44bbe99f29a16bcf1ad 100644 (file)
@@ -79,6 +79,8 @@ void gdaex_set_tables_name_prefix (GdaEx *gdaex, const gchar *tables_name_prefix
 
 GdaDataModel *gdaex_query (GdaEx *gdaex, const gchar *sql);
 
+gboolean gdaex_data_model_is_empty (GdaDataModel *data_model);
+
 gchar *gdaex_data_model_get_field_value_stringify_at (GdaDataModel *data_model,
                                                      gint row,
                                                      const gchar *field_name);