GdaXmlDatabase

Name

GdaXmlDatabase -- Functions for managing a XML database file

Synopsis



GdaXmlDatabase* gda_xml_database_new        (void);
GdaXmlDatabase* gda_xml_database_new_from_file
                                            (const gchar *filename);
void        gda_xml_database_free           (GdaXmlDatabase *xmldb);
void        gda_xml_database_save           (GdaXmlDatabase *xmldb,
                                             const gchar *filename);
void        gda_xml_database_changed        (GdaXmlDatabase *xmldb);
#define     gda_xml_database_get_tables     (_xmldb_)
#define     gda_xml_database_get_views      (_xmldb_)
GdaXmlTable* gda_xml_database_table_new     (GdaXmlDatabase *xmldb,
                                             gchar *tname);
void        gda_xml_database_table_remove   (GdaXmlDatabase *xmldb,
                                             const gchar *tname);
GdaXmlTable* gda_xml_database_table_find    (GdaXmlDatabase *xmldb,
                                             const gchar *tname);
const gchar* gda_xml_database_table_get_name
                                            (GdaXmlDatabase *xmldb,
                                             xmlNodePtr table);
void        gda_xml_database_table_set_name (GdaXmlDatabase *xmldb,
                                             GdaXmlTable *table,
                                             const gchar *tname);
const gchar* gda_xml_database_table_get_owner
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlTable *table);
void        gda_xml_database_table_set_owner
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlTable *table,
                                             const gchar *owner);
gint        gda_xml_database_table_field_count
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlTable *table);
GdaXmlField* gda_xml_database_table_add_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlTable *table,
                                             const gchar *fname);
void        gda_xml_database_table_remove_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlTable *table,
                                             const gchar *fname);
GdaXmlField* gda_xml_database_table_get_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlTable *table,
                                             gint pos);
GdaXmlField* gda_xml_database_table_find_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlTable *table,
                                             const gchar *fname);
const gchar* gda_xml_database_field_get_name
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlField *field);
void        gda_xml_database_field_set_name (GdaXmlDatabase *xmldb,
                                             GdaXmlField *field,
                                             const gchar *name);
const gchar* gda_xml_database_field_get_gdatype
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlField *field);
void        gda_xml_database_field_set_gdatype
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlField *field,
                                             const gchar *type);
gint        gda_xml_database_field_get_size (GdaXmlDatabase *xmldb,
                                             GdaXmlField *field);
void        gda_xml_database_field_set_size (GdaXmlDatabase *xmldb,
                                             GdaXmlField *field,
                                             gint size);
gint        gda_xml_database_field_get_scale
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlField *field);
void        gda_xml_database_field_set_scale
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlField *field,
                                             gint scale);

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

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 ()

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

xmldb : 
filename : 


gda_xml_database_changed ()

void        gda_xml_database_changed        (GdaXmlDatabase *xmldb);

Emit the "changed" signal for the given XML database

xmldb : XML database


gda_xml_database_get_tables()

#define gda_xml_database_get_tables(_xmldb_) (GDA_IS_XML_DATABASE((_xmldb_)) ? (_xmldb_)->tables : NULL)

_xmldb_ : 


gda_xml_database_get_views()

#define gda_xml_database_get_views(_xmldb_)  (GDA_IS_XML_DATABASE((_xmldb_)) ? (_xmldb_)->views : NULL)

_xmldb_ : 


gda_xml_database_table_new ()

GdaXmlTable* gda_xml_database_table_new     (GdaXmlDatabase *xmldb,
                                             gchar *tname);

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

xmldb : XML database
tname : table name
Returns : 


gda_xml_database_table_remove ()

void        gda_xml_database_table_remove   (GdaXmlDatabase *xmldb,
                                             const gchar *tname);

xmldb : XML database
tname : name of the table


gda_xml_database_table_find ()

GdaXmlTable* gda_xml_database_table_find    (GdaXmlDatabase *xmldb,
                                             const gchar *tname);

Looks for the specified table in a XML database

xmldb : XML database
tname : table name
Returns : 


gda_xml_database_table_get_name ()

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

xmldb : XML database
table : table
Returns : 


gda_xml_database_table_set_name ()

void        gda_xml_database_table_set_name (GdaXmlDatabase *xmldb,
                                             GdaXmlTable *table,
                                             const gchar *tname);

xmldb : XML database
table : table
tname : new name


gda_xml_database_table_get_owner ()

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

xmldb : 
table : 
Returns : 


gda_xml_database_table_set_owner ()

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

xmldb : 
table : 
owner : 


gda_xml_database_table_field_count ()

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

xmldb : 
table : 
Returns : 


gda_xml_database_table_add_field ()

GdaXmlField* gda_xml_database_table_add_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlTable *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,
                                             GdaXmlTable *table,
                                             const gchar *fname);

xmldb : 
table : 
fname : 


gda_xml_database_table_get_field ()

GdaXmlField* gda_xml_database_table_get_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlTable *table,
                                             gint pos);

xmldb : 
table : 
pos : 
Returns : 


gda_xml_database_table_find_field ()

GdaXmlField* gda_xml_database_table_find_field
                                            (GdaXmlDatabase *xmldb,
                                             GdaXmlTable *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,
                                             GdaXmlField *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,
                                             GdaXmlField *field,
                                             const gchar *name);

xmldb : 
field : 
name : 


gda_xml_database_field_get_gdatype ()

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

xmldb : 
field : 
Returns : 


gda_xml_database_field_set_gdatype ()

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

xmldb : 
field : 
type : 


gda_xml_database_field_get_size ()

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

xmldb : 
field : 
Returns : 


gda_xml_database_field_set_size ()

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

xmldb : 
field : 
size : 


gda_xml_database_field_get_scale ()

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

xmldb : 
field : 
Returns : 


gda_xml_database_field_set_scale ()

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

xmldb : 
field : 
scale :