GdaXmlDatabase

Name

GdaXmlDatabase -- Functions for managing a XML database file

Synopsis



struct      GdaXmlDatabasePrivate;
GdaXmlDatabase* gda_xml_database_new        (void);
GdaXmlDatabase* gda_xml_database_new_from_file
                                            (const gchar *filename);
void        gda_xml_database_free           (GdaXmlDatabase *xmldb);
gboolean    gda_xml_database_save           (GdaXmlDatabase *xmldb,
                                             const gchar *filename);
void        gda_xml_database_changed        (GdaXmlDatabase *xmldb);
typedef     GdaXmlDatabaseTable;
GList*      gda_xml_database_get_tables     (GdaXmlDatabase *xmldb);
GdaXmlDatabaseTable* gda_xml_database_table_new
                                            (GdaXmlDatabase *xmldb,
                                             const gchar *name);
void        gda_xml_database_table_remove   (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table);
GdaXmlDatabaseTable* gda_xml_database_table_find
                                            (GdaXmlDatabase *xmldb,
                                             const gchar *name);
const gchar* gda_xml_database_table_get_name
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table);
void        gda_xml_database_table_set_name (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table,
                                             const gchar *name);
const gchar* gda_xml_database_table_get_owner
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table);
void        gda_xml_database_table_set_owner
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table,
                                             const gchar *owner);
typedef     GdaXmlDatabaseField;
gint        gda_xml_database_table_field_count
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table);
GdaXmlDatabaseField* gda_xml_database_table_add_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table,
                                             const gchar *fname);
void        gda_xml_database_table_remove_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table,
                                             const gchar *fname);
GdaXmlDatabaseField* gda_xml_database_table_get_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table,
                                             gint pos);
GdaXmlDatabaseField* gda_xml_database_table_find_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table,
                                             const gchar *fname);
const gchar* gda_xml_database_field_get_name
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field);
void        gda_xml_database_field_set_name (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field,
                                             const gchar *name);
const gchar* gda_xml_database_field_get_gdatype
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field);
void        gda_xml_database_field_set_gdatype
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field,
                                             const gchar *type);
gint        gda_xml_database_field_get_size (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field);
void        gda_xml_database_field_set_size (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field,
                                             gint size);
gint        gda_xml_database_field_get_scale
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field);
void        gda_xml_database_field_set_scale
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field,
                                             gint scale);

Object Hierarchy


  GtkObject
   +----GdaXmlDocument
         +----GdaXmlDatabase

Signal Prototypes


"changed"   void        user_function      (GdaXmlDatabase *gdaxmldatabase,
                                            gpointer user_data);

Description

The GdaXmlDatabase object provides a convenient way of managing the contents of a XML database file, that is, the files used by libgda for importing/exporting data between GDA data sources.

The format being used for this file is XML, which provides a powerful way of describing a whole database (tables, views, etc), so that we can easily copy data from one data source to another, unrelated, one.

Thus, this module provides the functions you need to programatically read and write this kind of files, so that you can yourself use the import/export features of libgda.

Details

struct GdaXmlDatabasePrivate

struct GdaXmlDatabasePrivate;


gda_xml_database_new ()

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 : 


gda_xml_database_new_from_file ()

GdaXmlDatabase* gda_xml_database_new_from_file
                                            (const gchar *filename);

filename : 
Returns : 


gda_xml_database_free ()

void        gda_xml_database_free           (GdaXmlDatabase *xmldb);

Destroys the given XML database

xmldb : XML database


gda_xml_database_save ()

gboolean    gda_xml_database_save           (GdaXmlDatabase *xmldb,
                                             const gchar *filename);

xmldb : 
filename : 
Returns : 


gda_xml_database_changed ()

void        gda_xml_database_changed        (GdaXmlDatabase *xmldb);

Emit the "changed" signal for the given XML database

xmldb : XML database


GdaXmlDatabaseTable

typedef xmlNode GdaXmlDatabaseTable;


gda_xml_database_get_tables ()

GList*      gda_xml_database_get_tables     (GdaXmlDatabase *xmldb);

xmldb : XML database
Returns :a list with the names of all the tables that are present in the given GdaXmlDatabase object


gda_xml_database_table_new ()

GdaXmlDatabaseTable* gda_xml_database_table_new
                                            (GdaXmlDatabase *xmldb,
                                             const gchar *name);

Add a new table description to the given XML database. If tname already exists, this function fails.

xmldb : XML database
name : 
Returns : 


gda_xml_database_table_remove ()

void        gda_xml_database_table_remove   (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table);

xmldb : XML database
table : the table to be removed


gda_xml_database_table_find ()

GdaXmlDatabaseTable* gda_xml_database_table_find
                                            (GdaXmlDatabase *xmldb,
                                             const gchar *name);

Looks for the specified table in a XML database

xmldb : XML database
name : 
Returns : 


gda_xml_database_table_get_name ()

const gchar* gda_xml_database_table_get_name
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table);

xmldb : XML database
table : table
Returns : 


gda_xml_database_table_set_name ()

void        gda_xml_database_table_set_name (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table,
                                             const gchar *name);

xmldb : XML database
table : table
name : 


gda_xml_database_table_get_owner ()

const gchar* gda_xml_database_table_get_owner
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table);

xmldb : 
table : 
Returns : 


gda_xml_database_table_set_owner ()

void        gda_xml_database_table_set_owner
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table,
                                             const gchar *owner);

xmldb : 
table : 
owner : 


GdaXmlDatabaseField

typedef xmlNode GdaXmlDatabaseField;


gda_xml_database_table_field_count ()

gint        gda_xml_database_table_field_count
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table);

xmldb : 
table : 
Returns : 


gda_xml_database_table_add_field ()

GdaXmlDatabaseField* gda_xml_database_table_add_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table,
                                             const gchar *fname);

Add a new field to the given table

xmldb : XML database
table : table
fname : field name
Returns : 


gda_xml_database_table_remove_field ()

void        gda_xml_database_table_remove_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table,
                                             const gchar *fname);

xmldb : 
table : 
fname : 


gda_xml_database_table_get_field ()

GdaXmlDatabaseField* gda_xml_database_table_get_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table,
                                             gint pos);

xmldb : 
table : 
pos : 
Returns : 


gda_xml_database_table_find_field ()

GdaXmlDatabaseField* gda_xml_database_table_find_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseTable *table,
                                             const gchar *fname);

Look for the given field in the given table

xmldb : XML database
table : table
fname : field name
Returns : 


gda_xml_database_field_get_name ()

const gchar* gda_xml_database_field_get_name
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field);

Return the name of the given field

xmldb : XML database
field : XML field node
Returns : 


gda_xml_database_field_set_name ()

void        gda_xml_database_field_set_name (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field,
                                             const gchar *name);

xmldb : 
field : 
name : 


gda_xml_database_field_get_gdatype ()

const gchar* gda_xml_database_field_get_gdatype
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field);

xmldb : 
field : 
Returns : 


gda_xml_database_field_set_gdatype ()

void        gda_xml_database_field_set_gdatype
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field,
                                             const gchar *type);

xmldb : 
field : 
type : 


gda_xml_database_field_get_size ()

gint        gda_xml_database_field_get_size (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field);

xmldb : 
field : 
Returns : 


gda_xml_database_field_set_size ()

void        gda_xml_database_field_set_size (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field,
                                             gint size);

xmldb : 
field : 
size : 


gda_xml_database_field_get_scale ()

gint        gda_xml_database_field_get_scale
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field);

xmldb : 
field : 
Returns : 


gda_xml_database_field_set_scale ()

void        gda_xml_database_field_set_scale
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlDatabaseField *field,
                                             gint scale);

xmldb : 
field : 
scale : 

Signals

The "changed" signal

void        user_function                  (GdaXmlDatabase *gdaxmldatabase,
                                            gpointer user_data);

gdaxmldatabase :the object which received the signal.
user_data :user data set when the signal handler was connected.