Utility functions

Utility functions

Synopsis




GList*              gda_string_hash_to_list             (GHashTable *hash_table);
gchar*              gda_default_escape_string           (const gchar *string);
gchar*              gda_file_load                       (const gchar *filename);
gboolean            gda_file_save                       (const gchar *filename,
                                                         const gchar *buffer,
                                                         gint len);
gint                gda_server_provider_get_schema_nb_columns
                                                        (GdaConnectionSchema schema);
gboolean            gda_server_provider_init_schema_model
                                                        (GdaDataModel *model,
                                                         GdaConnectionSchema schema);

Description

Details

gda_string_hash_to_list ()

GList*              gda_string_hash_to_list             (GHashTable *hash_table);

Creates a new list of strings, which contains all keys of a given hash table. After using it, you should free this list by calling g_list_free.

hash_table : a hash table.
Returns : a new GList.

gda_default_escape_string ()

gchar*              gda_default_escape_string           (const gchar *string);

Escapes string to make it understandable by a DBMS. The escape method is very common and replaces any occurence of "'" with "\'" and "\" with "\\".

string : string to escape
Returns :

gda_file_load ()

gchar*              gda_file_load                       (const gchar *filename);

Loads a file, specified by the given uri, and returns the file contents as a string.

It is the caller's responsibility to free the returned value.

filename : path for the file to be loaded.
Returns : the file contents as a newly-allocated string, or NULL if there is an error.

gda_file_save ()

gboolean            gda_file_save                       (const gchar *filename,
                                                         const gchar *buffer,
                                                         gint len);

Saves a chunk of data into a file.

filename : path for the file to be saved.
buffer : contents of the file.
len : size of buffer.
Returns : TRUE if successful, FALSE on error.

gda_server_provider_get_schema_nb_columns ()

gint                gda_server_provider_get_schema_nb_columns
                                                        (GdaConnectionSchema schema);

schema :
Returns : the number of columns the GdaDataModel for the requested schema must have

gda_server_provider_init_schema_model ()

gboolean            gda_server_provider_init_schema_model
                                                        (GdaDataModel *model,
                                                         GdaConnectionSchema schema);

Sets the column attributes of model for the requested schema

model :
schema :
Returns : TRUE if there was no error