![]() | ![]() | ![]() | GNOME Data Access manual | ![]() |
---|
struct GdaXmlDatabasePrivate; GdaXmlDatabase* gda_xml_database_new (void); GdaXmlDatabase* gda_xml_database_new_from_uri (const gchar *uri); const gchar* gda_xml_database_get_name (GdaXmlDatabase *xmldb); void gda_xml_database_set_name (GdaXmlDatabase *xmldb, const gchar *name); const gchar* gda_xml_database_get_version (GdaXmlDatabase *xmldb); void gda_xml_database_set_version (GdaXmlDatabase *xmldb, const gchar *version); const gchar* gda_xml_database_get_uri (GdaXmlDatabase *xmldb); void gda_xml_database_set_uri (GdaXmlDatabase *xmldb, const gchar *uri); void gda_xml_database_changed (GdaXmlDatabase *xmldb); void gda_xml_database_reload (GdaXmlDatabase *xmldb); gboolean gda_xml_database_save (GdaXmlDatabase *xmldb, const gchar *uri); gchar* gda_xml_database_to_string (GdaXmlDatabase *xmldb); GList* gda_xml_database_get_tables (GdaXmlDatabase *xmldb); void gda_xml_database_free_table_list (GList *list); GdaTable* gda_xml_database_find_table (GdaXmlDatabase *xmldb, const gchar *name); GdaTable* gda_xml_database_new_table (GdaXmlDatabase *xmldb, const gchar *name); GdaTable* gda_xml_database_new_table_from_model (GdaXmlDatabase *xmldb, const gchar *name, const GdaDataModel *model, gboolean add_data); GdaTable* gda_xml_database_new_table_from_node (GdaXmlDatabase *xmldb, xmlNodePtr xmlnode);
The GdaXmlDatabase class allows programs to manage databases in XML format (the format used by libgda for importing/exporting databases). It contains functions to easily manage those XML files.
With this set of functions, applications can bypass the normal libgda operation mode (via GdaClient to access data sources), and have a direct access to the data in the XML file.
GdaXmlDatabase* gda_xml_database_new (void);
Creates a new GdaXmlDatabase object, which can be used to describe a database which will then be loaded by a provider to create its defined structure
Returns : |
|
GdaXmlDatabase* gda_xml_database_new_from_uri (const gchar *uri);
uri : | |
Returns : |
|
const gchar* gda_xml_database_get_name (GdaXmlDatabase *xmldb);
Return the name of the given XML database.
xmldb : | XML database. |
Returns : | the name of the database. |
void gda_xml_database_set_name (GdaXmlDatabase *xmldb, const gchar *name);
Set the name of the given XML database object.
xmldb : | XML database. |
name : | new name for the database. |
const gchar* gda_xml_database_get_version (GdaXmlDatabase *xmldb);
Get the version of the given GdaXmlDatabase object. This version is the one that was used for saving the XML file last time it was saved.
xmldb : | XML database. |
Returns : | the database version. |
void gda_xml_database_set_version (GdaXmlDatabase *xmldb, const gchar *version);
Set the version of the given XML database.
xmldb : | XML database. |
version : | Version string. |
const gchar* gda_xml_database_get_uri (GdaXmlDatabase *xmldb);
Return the URI associated with the given XML database. This URI will be used when saving the XML database (gda_xml_database_save) and no URI is given.
xmldb : | XML database. |
Returns : | the URI for the XML database. |
void gda_xml_database_set_uri (GdaXmlDatabase *xmldb, const gchar *uri);
xmldb : | XML database. |
uri : |
|
void gda_xml_database_changed (GdaXmlDatabase *xmldb);
Emit the "changed" signal for the given XML database
xmldb : | XML database |
void gda_xml_database_reload (GdaXmlDatabase *xmldb);
Reload the given XML database from its original place, discarding all changes that may have happened.
xmldb : | XML database. |
gboolean gda_xml_database_save (GdaXmlDatabase *xmldb, const gchar *uri);
Save the given XML database to disk.
xmldb : | XML database. |
uri : | URI to save the XML database to. |
Returns : |
gchar* gda_xml_database_to_string (GdaXmlDatabase *xmldb);
Get the given XML database contents as a XML string.
xmldb : | a GdaXmlDatabase object. |
Returns : | the XML string representing the structure and contents of the given GdaXmlDatabase object. The returned value must be freed when no longer needed. |
GList* gda_xml_database_get_tables (GdaXmlDatabase *xmldb);
Return a list of all table names present in the given database. You must free the returned GList when you no longer need it, by using the gda_xml_database_free_table_list function.
xmldb : | XML database. |
Returns : | a GList of strings. |
void gda_xml_database_free_table_list (GList *list);
Free a GList of strings returned by gda_xml_database_get_tables.
list : | list of tables, as returned by gda_xml_database_get_tables. |
GdaTable* gda_xml_database_find_table (GdaXmlDatabase *xmldb, const gchar *name);
Searches the given XML database for a table named name, and returns a pointer to it.
xmldb : | XML database. |
name : | Name for the table to look for. |
Returns : | a pointer to the table, or NULL if not found. |
GdaTable* gda_xml_database_new_table (GdaXmlDatabase *xmldb, const gchar *name);
Create a new empty table in the given XML database.
xmldb : | XML database. |
name : | Name for the new table. |
Returns : | a pointer to the newly created in-memory table. |
GdaTable* gda_xml_database_new_table_from_model (GdaXmlDatabase *xmldb, const gchar *name, const GdaDataModel *model, gboolean add_data);
Create a new table in the given XML database from the given GdaDataModel.
xmldb : | XML database. |
name : | Name for the new table. |
model : | Model to create the table from. |
add_data : | Whether to add model's data or not. |
Returns : | a pointer to the newly created in-memory table. |
GdaTable* gda_xml_database_new_table_from_node (GdaXmlDatabase *xmldb, xmlNodePtr xmlnode);
Add a table to the given XML database by parsong the given XML node pointer, which usually is obtained from an already loaded xmlDocPtr.
xmldb : | XML Database. |
xmlnode : | |
Returns : | a pointer to the newly created in-memory table. |
<<< GdaXmlConnection | GdaXmlDocument >>> |