38 #ifndef ELEMENT_H_0211250048
39 #define ELEMENT_H_0211250048
77 scew_element
const *);
140 extern SCEW_API scew_element*
155 extern SCEW_API scew_element*
214 scew_element
const *b,
234 extern SCEW_API XML_Char
const*
248 extern SCEW_API XML_Char
const*
264 XML_Char
const *name);
277 extern SCEW_API XML_Char
const*
320 extern SCEW_API scew_element*
349 XML_Char
const *name);
364 XML_Char
const *name,
365 XML_Char
const *contents);
383 scew_element *child);
406 XML_Char
const *name);
418 XML_Char
const *name);
458 extern SCEW_API
unsigned int
488 XML_Char
const *name);
546 XML_Char
const *name,
547 XML_Char
const *value);
582 XML_Char
const* name);
SCEW_API scew_element * scew_element_create(XML_Char const *name)
Creates a new element with the given name.
SCEW_API void scew_element_delete_attribute_by_index(scew_element *element, unsigned int index)
Deletes the attribute of the given element at the specified zero-based index.
SCEW_API unsigned int scew_element_count(scew_element const *element)
Returns the number of children of the specified element.
SCEW_API XML_Char const * scew_element_name(scew_element const *element)
Returns the given element's name.
SCEW_API scew_list * scew_element_list_by_name(scew_element const *element, XML_Char const *name)
Returns a list of children from the specified element that matches the given name.
SCEW shared library support.
SCEW_API void scew_element_free(scew_element *element)
Frees the given element recursively.
SCEW_API scew_list * scew_element_attributes(scew_element const *element)
Returns the list of all the element's attributes.
struct scew_list scew_list
This is the type delcaration for SCEW lists.
Definition: list.h:55
SCEW_API void scew_element_delete_all_by_name(scew_element *element, XML_Char const *name)
Deletes all the children of the given element that matches name.
SCEW_API XML_Char const * scew_element_set_name(scew_element *element, XML_Char const *name)
Sets a new name to the given element and frees the old one.
SCEW_API void scew_element_free_contents(scew_element *element)
Frees the current contents of the given element.
SCEW_API scew_attribute * scew_element_add_attribute(scew_element *element, scew_attribute *attribute)
Adds an existent attribute to the given element.
scew_bool(* scew_element_cmp_hook)(scew_element const *, scew_element const *)
SCEW element compare hooks might be used to define new user XML element comparisons.
Definition: element.h:76
unsigned char scew_bool
This should be defined using stdbool.h when C99 is available.
Definition: bool.h:35
SCEW_API scew_element * scew_element_parent(scew_element const *element)
Returns the parent of the given element.
SCEW_API void scew_element_delete_attribute_by_name(scew_element *element, XML_Char const *name)
Deletes the first attribute of the given element that matches name.
struct scew_attribute scew_attribute
This is the type declaration for SCEW attributes.
Definition: element.h:63
SCEW_API XML_Char const * scew_element_contents(scew_element const *element)
Returns the given element's contents.
SCEW_API XML_Char const * scew_element_set_contents(scew_element *element, XML_Char const *contents)
Sets a new contents to the given element and frees the old one.
SCEW_API scew_element * scew_element_add(scew_element *element, XML_Char const *name)
Creates and adds, as a child of element, a new element with the given name.
SCEW_API scew_element * scew_element_add_element(scew_element *element, scew_element *child)
Adds a child to the given element.
SCEW_API scew_bool scew_element_compare(scew_element const *a, scew_element const *b, scew_element_cmp_hook hook)
Performs a deep comparison of the two given elements.
SCEW_API scew_attribute * scew_element_attribute_by_name(scew_element const *element, XML_Char const *name)
Returns the first attribute from the specified element that matches the given name.
SCEW general list implementation.
SCEW_API void scew_element_delete_by_index(scew_element *element, unsigned int index)
Deletes the child of the given element at the specified zero-based index.
SCEW_API scew_list * scew_element_children(scew_element const *element)
Returns the list of all the element's children.
SCEW_API scew_element * scew_element_copy(scew_element const *element)
Makes a deep copy of the given element.
SCEW_API void scew_element_delete_attribute(scew_element *element, scew_attribute *attribute)
Deletes the given attribute from the specified element.
SCEW_API void scew_element_delete_all(scew_element *element)
Deletes all the children for the given element.
SCEW_API void scew_element_delete_attribute_all(scew_element *element)
Deletes all the attributes of the given element.
SCEW_API void scew_element_delete_by_name(scew_element *element, XML_Char const *name)
Deletes the first child of the given element that matches name.
SCEW_API void scew_element_detach(scew_element *element)
Detaches the given element from its parent, if any.
SCEW_API scew_element * scew_element_by_name(scew_element const *element, XML_Char const *name)
Returns the first child from the specified element that matches the given name.
struct scew_element scew_element
This is the type delcaration for SCEW elements.
Definition: element.h:56
SCEW_API scew_attribute * scew_element_add_attribute_pair(scew_element *element, XML_Char const *name, XML_Char const *value)
Creates and adds a new attribute to the given element.
SCEW_API scew_element * scew_element_add_pair(scew_element *element, XML_Char const *name, XML_Char const *contents)
Creates and adds, as a child of element, a new element with the given name and contents.
SCEW_API scew_element * scew_element_by_index(scew_element const *element, unsigned int index)
Returns the child of the given element at the specified zero-based index.
SCEW_API unsigned int scew_element_attribute_count(scew_element const *element)
Returns the number of attributes of the given element.
SCEW_API scew_attribute * scew_element_attribute_by_index(scew_element const *element, unsigned int index)
Returns the attribute of the given element at the specified zero-based index.