GdaXmlStorage

## GdaXmlStorage GdaXmlStorage — Interface which provides saving and loading using XML structures |

## Synopsis

                GdaXmlStorage;
    gchar*      gda_xml_storage_get_xml_id      (GdaXmlStorage *iface);
    xmlNodePtr  gda_xml_storage_save_to_xml     (GdaXmlStorage *iface,
                                                 GError **error);
    gboolean    gda_xml_storage_load_from_xml   (GdaXmlStorage *iface,
                                                 xmlNodePtr node,
                                                 GError **error);

## Object Hierarchy

      GInterface
       +----GdaXmlStorage

## Prerequisites

GdaXmlStorage requires GdaObject.

## Known Implementations

GdaXmlStorage is implemented by GdaQueryFieldValue, GdaQueryCondition, GdaQueryFieldFunc, GdaQueryFieldAll, GdaQueryTarget, GdaQueryJoin, GdaDictType, GdaDictDatabase, GdaDictTable, GdaQueryFieldAgg, GdaDictConstraint, GdaDictAggregate, GdaDictField, GdaDictFunction, GdaQuery and GdaQueryFieldField.

## Description

Any object which implements this interface can be streamed and restored to and from an XML file.

## Details

### GdaXmlStorage

    typedef struct _GdaXmlStorage GdaXmlStorage;

### gda_xml_storage_get_xml_id ()

    gchar*      gda_xml_storage_get_xml_id      (GdaXmlStorage *iface);

Fetch the xml id string of the object, it's up to the caller to free the string.

`iface` : | an object which implements the GdaXmlStorage interface
Returns : | the xml id.

### gda_xml_storage_save_to_xml ()

    xmlNodePtr  gda_xml_storage_save_to_xml     (GdaXmlStorage *iface,
                                                 GError **error);

Creates a new xmlNodePtr structure and fills it with data representing the object given as argument.

`iface` : | an object which implements the GdaXmlStorage interface
`error` : | location to store error, or `NULL`
Returns : | the new XML node, or NULL if an error occurred.

### gda_xml_storage_load_from_xml ()

    gboolean    gda_xml_storage_load_from_xml   (GdaXmlStorage *iface,
                                                 xmlNodePtr node,
                                                 GError **error);

Updates the object with data stored in the XML node. The object MUST already exist and be of the correct type before calling this function. This is a virtual function.

`iface` : | an object which implements the GdaXmlStorage interface
`node` : | an XML node from an XML structure
`error` : | location to store error, or `NULL`
Returns : | TRUE if no error occurred.