Main Page | File List | File Members

attribute.h File Reference

SCEW attribute type declaration. More...

#include "types.h"
#include <expat.h>

Go to the source code of this file.

Functions

scew_attributescew_attribute_create (XML_Char const *name, XML_Char const *value)
void scew_attribute_free (scew_attribute *attribute)
unsigned int scew_attribute_count (scew_element const *element)
scew_attributescew_attribute_next (scew_element const *element, scew_attribute const *attribute)
scew_attributescew_attribute_by_index (scew_element const *element, unsigned int idx)
scew_attributescew_attribute_by_name (scew_element const *element, XML_Char const *name)
XML_Char const * scew_attribute_name (scew_attribute const *attribute)
XML_Char const * scew_attribute_value (scew_attribute const *attribute)
XML_Char const * scew_attribute_set_name (scew_attribute *attribute, XML_Char const *name)
XML_Char const * scew_attribute_set_value (scew_attribute *attribute, XML_Char const *name)


Detailed Description

SCEW attribute type declaration.

Author:
Aleix Conchillo Flaque <aleix@member.fsf.org>
Date:
Mon Nov 25, 2002 00:39
Id
attribute.h,v 1.1 2004/01/28 00:43:21 aleix Exp

Attribute related functions. SCEW provides functions to access and manipulate the attributes of all the elements in a tree. XML element attributes are basically a name-value pair.


Function Documentation

scew_attribute* scew_attribute_create XML_Char const *  name,
XML_Char const *  value
 

Creates a new attribute with the given pair (name, value).

Returns:
the new created attribute.

void scew_attribute_free scew_attribute attribute  ) 
 

Frees an attribute memory structure. That is, its name and value. You should not call this function with an attribute coming from an element, but created with scew_attribute_create.

unsigned int scew_attribute_count scew_element const *  element  ) 
 

Returns the number of attributes of the specified element. An element can have zero or more attributes.

scew_attribute* scew_attribute_next scew_element const *  element,
scew_attribute const *  attribute
 

Returns the element's first attribute if attribute is NULL, otherwise it returns the contiguous attribute to the given one.

Call this function a first time with attribute to NULL and the first attribute will be returned. In the subsequent calls you just need to provide the attribute returned and its contiguous attribute will be returned.

Returns:
the first attribute of an element or a contiguous attribute. NULL if there are no more attributes.

scew_attribute* scew_attribute_by_index scew_element const *  element,
unsigned int  idx
 

Returns the element attribute on the specified position. Positions are zero based.

Returns:
the attribute on the specified position, NULL if there is no attribute in the position.

scew_attribute* scew_attribute_by_name scew_element const *  element,
XML_Char const *  name
 

Returns the element attribute with the specified name. Remember that XML names are case-sensitive.

Returns:
the attribute with the given name, NULL if not found.

XML_Char const* scew_attribute_name scew_attribute const *  attribute  ) 
 

Returns the attribute name or NULL if the attribute does not exist.

XML_Char const* scew_attribute_value scew_attribute const *  attribute  ) 
 

Returns the attribute value or NULL if the attribute does not exist.

XML_Char const* scew_attribute_set_name scew_attribute attribute,
XML_Char const *  name
 

Sets a new name to the given attribute and frees the old one.

Returns:
the new attribute name.

XML_Char const* scew_attribute_set_value scew_attribute attribute,
XML_Char const *  name
 

Sets a new value to the given attribute and frees the old one.

Returns:
the new attribute value.


Generated on Tue May 25 23:38:29 2004 for Simple C Expat Wrapper by doxygen 1.3.7