Top |
Functions
GHashTable * | e_xml_to_hash () |
xmlDoc * | e_xml_from_hash () |
void | e_xml_destroy_hash () |
void | (*EXmlHashFunc) () |
gboolean | (*EXmlHashRemoveFunc) () |
EXmlHash * | e_xmlhash_new () |
void | e_xmlhash_add () |
void | e_xmlhash_remove () |
EXmlHashStatus | e_xmlhash_compare () |
void | e_xmlhash_foreach_key () |
void | e_xmlhash_foreach_key_remove () |
void | e_xmlhash_write () |
void | e_xmlhash_destroy () |
Functions
e_xml_to_hash ()
GHashTable * e_xml_to_hash (xmlDoc *doc
,EXmlHashType type
);
Creates a GHashTable representation of the xmlDoc doc
.
If type
is * E_XML_HASH_TYPE_PROPERTY
, all XML nodes will be
indexed in the GHashTable by name. If type
is
E_XML_HASH_TYPE_OBJECT_UID
, then XML objects will be indexed in
the hash by their UID (other nodes will still be indexed by name).
Parameters
doc |
The xmlDoc to store in a hash table. |
|
type |
The value type to use as a key in the hash table. |
Returns
The newly-created GHashTable representation
of doc
.
[transfer full][element-type utf8 utf8]
e_xml_from_hash ()
xmlDoc * e_xml_from_hash (GHashTable *hash
,EXmlHashType type
,const gchar *root_name
);
Uses the key/value pair representation of an XML structure in hash
to build an equivalent xmlDoc. This is the reverse of e_xml_to_hash()
.
Parameters
hash |
The GHashTable to extract the XML from. |
[element-type utf8 utf8] |
type |
The EXmlHashType used to store the XML |
|
root_name |
The name to call the new xmlDoc |
e_xml_destroy_hash ()
void
e_xml_destroy_hash (GHashTable *hash
);
Frees the memory used by hash
and its contents.
EXmlHashRemoveFunc ()
gboolean (*EXmlHashRemoveFunc) (const gchar *key
,const gchar *value
,gpointer user_data
);
e_xmlhash_new ()
EXmlHash *
e_xmlhash_new (const gchar *filename
);
Creates a new EXmlHash from the file filename
. If filename
does
not already exist, an empty EXmlHash will be created.
e_xmlhash_add ()
void e_xmlhash_add (EXmlHash *hash
,const gchar *key
,const gchar *data
);
Adds a new key/value pair to the EXmlHash hash
.
Parameters
hash |
the EXmlHash to add an entry to |
|
key |
the key to use for the entry |
|
data |
the value of the new entry |
e_xmlhash_remove ()
void e_xmlhash_remove (EXmlHash *hash
,const gchar *key
);
Remove the entry in hash
with key equal to key
, if it exists.
e_xmlhash_compare ()
EXmlHashStatus e_xmlhash_compare (EXmlHash *hash
,const gchar *key
,const gchar *compare_data
);
Compares the value with key equal to key
in hash
against
compare_data
.
Parameters
hash |
the EXmlHash to compare against |
|
key |
the key of the hash entry to compare with |
|
compare_data |
the data to compare against the hash entry |
e_xmlhash_foreach_key ()
void e_xmlhash_foreach_key (EXmlHash *hash
,EXmlHashFunc func
,gpointer user_data
);
Executes func
against each key/value pair in hash
.
Parameters
hash |
an EXmlHash |
|
func |
the EXmlHashFunc to execute on the data in |
[scope async] |
user_data |
the data to pass to |
e_xmlhash_foreach_key_remove ()
void e_xmlhash_foreach_key_remove (EXmlHash *hash
,EXmlHashRemoveFunc func
,gpointer user_data
);
Calls g_hash_table_foreach_remove()
on hash
's internal hash
table. See g_hash_table_foreach_remove()
for details.
Parameters
hash |
an EXmlHash |
|
func |
the EXmlHashFunc to execute on the data in |
[scope async] |
user_data |
the data to pass to |
e_xmlhash_write ()
void
e_xmlhash_write (EXmlHash *hash
);
Writes the XML represented by hash
to the file originally passed
to e_xmlhash_new()
.