Simple C Expat Wrapper (SCEW)  1.1.7
Files | Functions
Accessors

Access elements' data, such as name and contents. More...

Files

file  element.h
 SCEW element's handling routines.
 

Functions

SCEW_API XML_Char const * scew_element_name (scew_element const *element)
 Returns the given element's name. More...
 
SCEW_API XML_Char const * scew_element_contents (scew_element const *element)
 Returns the given element's contents. More...
 
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. More...
 
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. More...
 
SCEW_API void scew_element_free_contents (scew_element *element)
 Frees the current contents of the given element. More...
 

Detailed Description

Access elements' data, such as name and contents.

Function Documentation

SCEW_API XML_Char const* scew_element_name ( scew_element const *  element)

Returns the given element's name.

Precondition
element != NULL
Returns
the element's name. It is not possible to get a NULL value, as element names are mandatory.
SCEW_API XML_Char const* scew_element_contents ( scew_element const *  element)

Returns the given element's contents.

That is, the text between the start and end element tags.

Precondition
element != NULL
Returns
the element's contents, or NULL if the element has no contents.
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.

If the new name can not be set, the old one is not freed.

Precondition
element != NULL
name != NULL
Returns
the new element's name, or NULL if the name can not be set.
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.

If the new contents can not be set, the old one is not freed.

Precondition
element != NULL
Returns
the new element's contents, or NULL if the contents can not be set.
SCEW_API void scew_element_free_contents ( scew_element element)

Frees the current contents of the given element.

If the element has no contents, this functions does not have any effect.

Precondition
element != NULL