libdom
Loading...
Searching...
No Matches
Macros | Functions
attr.h File Reference
#include <dom/core/attr.h>

Go to the source code of this file.

Macros

#define DOM_ATTR_VTABLE
 
#define DOM_NODE_VTABLE_ATTR
 
#define DOM_ATTR_PROTECT_VTABLE
 

Functions

dom_exception _dom_attr_create (struct dom_document *doc, dom_string *name, dom_string *namespace, dom_string *prefix, bool specified, struct dom_attr **result)
 
void _dom_attr_destroy (struct dom_attr *attr)
 
dom_exception _dom_attr_initialise (struct dom_attr *a, struct dom_document *doc, dom_string *name, dom_string *namespace, dom_string *prefix, bool specified, struct dom_attr **result)
 
void _dom_attr_finalise (struct dom_attr *attr)
 
dom_exception _dom_attr_get_name (struct dom_attr *attr, dom_string **result)
 
dom_exception _dom_attr_get_specified (struct dom_attr *attr, bool *result)
 
dom_exception _dom_attr_get_value (struct dom_attr *attr, dom_string **result)
 
dom_exception _dom_attr_set_value (struct dom_attr *attr, dom_string *value)
 
dom_exception _dom_attr_get_owner (struct dom_attr *attr, struct dom_element **result)
 
dom_exception _dom_attr_get_schema_type_info (struct dom_attr *attr, struct dom_type_info **result)
 
dom_exception _dom_attr_is_id (struct dom_attr *attr, bool *result)
 
dom_exception _dom_attr_get_node_value (dom_node_internal *node, dom_string **result)
 
dom_exception _dom_attr_clone_node (dom_node_internal *node, bool deep, dom_node_internal **result)
 
dom_exception _dom_attr_set_prefix (dom_node_internal *node, dom_string *prefix)
 
dom_exception _dom_attr_normalize (dom_node_internal *node)
 
dom_exception _dom_attr_lookup_prefix (dom_node_internal *node, dom_string *namespace, dom_string **result)
 
dom_exception _dom_attr_is_default_namespace (dom_node_internal *node, dom_string *namespace, bool *result)
 
dom_exception _dom_attr_lookup_namespace (dom_node_internal *node, dom_string *prefix, dom_string **result)
 
void __dom_attr_destroy (dom_node_internal *node)
 
dom_exception _dom_attr_copy (dom_node_internal *old, dom_node_internal **copy)
 
void _dom_attr_set_isid (struct dom_attr *attr, bool is_id)
 
void _dom_attr_set_specified (struct dom_attr *attr, bool specified)
 
bool _dom_attr_readonly (const dom_attr *a)
 

Macro Definition Documentation

◆ DOM_ATTR_PROTECT_VTABLE

#define DOM_ATTR_PROTECT_VTABLE
Value:
dom_exception _dom_attr_copy(dom_node_internal *old, dom_node_internal **copy)
Definition attr.c:788
void __dom_attr_destroy(dom_node_internal *node)
Definition attr.c:782

◆ DOM_ATTR_VTABLE

#define DOM_ATTR_VTABLE
Value:
dom_exception _dom_attr_get_schema_type_info(struct dom_attr *attr, struct dom_type_info **result)
Definition attr.c:647
dom_exception _dom_attr_get_value(struct dom_attr *attr, dom_string **result)
Definition attr.c:456
dom_exception _dom_attr_get_name(struct dom_attr *attr, dom_string **result)
Definition attr.c:424
dom_exception _dom_attr_get_specified(struct dom_attr *attr, bool *result)
Definition attr.c:438
dom_exception _dom_attr_set_value(struct dom_attr *attr, dom_string *value)
Definition attr.c:549
dom_exception _dom_attr_is_id(struct dom_attr *attr, bool *result)
Definition attr.c:663
dom_exception _dom_attr_get_owner(struct dom_attr *attr, struct dom_element **result)
Definition attr.c:623

◆ DOM_NODE_VTABLE_ATTR

#define DOM_NODE_VTABLE_ATTR

Function Documentation

◆ __dom_attr_destroy()

void __dom_attr_destroy ( dom_node_internal node)

◆ _dom_attr_clone_node()

dom_exception _dom_attr_clone_node ( dom_node_internal node,
bool  deep,
dom_node_internal **  result 
)

◆ _dom_attr_copy()

dom_exception _dom_attr_copy ( dom_node_internal old,
dom_node_internal **  copy 
)

◆ _dom_attr_create()

dom_exception _dom_attr_create ( struct dom_document doc,
dom_string name,
dom_string namespace,
dom_string prefix,
bool  specified,
struct dom_attr **  result 
)

Create an attribute node

Parameters
docThe owning document
nameThe (local) name of the node to create
namespaceThe namespace URI of the attribute, or NULL
prefixThe namespace prefix of the attribute, or NULL
specifiedWhether this attribute is specified
resultPointer to location to receive created attribute
Returns
DOM_NO_ERR on success, DOM_NO_MEM_ERR on memory exhaustion.

doc and name will have their reference counts increased. The caller should make sure that name is a valid NCName here.

The returned attribute will already be referenced.

◆ _dom_attr_destroy()

void _dom_attr_destroy ( struct dom_attr attr)

Destroy an attribute node

Parameters
attrThe attribute to destroy

The contents of attr will be destroyed and attr will be freed

◆ _dom_attr_finalise()

void _dom_attr_finalise ( dom_attr attr)

The destructor of dom_attr

Parameters
attrThe attribute
Todo:
destroy schema type info

◆ _dom_attr_get_name()

dom_exception _dom_attr_get_name ( struct dom_attr attr,
dom_string **  result 
)

Retrieve an attribute's name

Parameters
attrAttribute to retrieve name from
resultPointer to location to receive result
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure

The returned string will have its reference count increased. It is the responsibility of the caller to unref the string once it has finished with it.

◆ _dom_attr_get_node_value()

dom_exception _dom_attr_get_node_value ( dom_node_internal node,
dom_string **  result 
)

◆ _dom_attr_get_owner()

dom_exception _dom_attr_get_owner ( struct dom_attr attr,
struct dom_element **  result 
)

Retrieve the owning element of an attribute

Parameters
attrThe attribute to extract owning element from
resultPointer to location to receive result
Returns
DOM_NO_ERR.

The returned node will have its reference count increased. The caller should unref it once it has finished with it.

◆ _dom_attr_get_schema_type_info()

dom_exception _dom_attr_get_schema_type_info ( struct dom_attr attr,
struct dom_type_info **  result 
)

Retrieve an attribute's type information

Parameters
attrThe attribute to extract type information from
resultPointer to location to receive result
Returns
DOM_NOT_SUPPORTED_ERR, we don't support this API now.

The returned type info will have its reference count increased. The caller should unref it once it has finished with it.

◆ _dom_attr_get_specified()

dom_exception _dom_attr_get_specified ( struct dom_attr attr,
bool *  result 
)

Determine if attribute was specified or default

Parameters
attrAttribute to inspect
resultPointer to location to receive result
Returns
DOM_NO_ERR.

◆ _dom_attr_get_value()

dom_exception _dom_attr_get_value ( struct dom_attr attr,
dom_string **  result 
)

Retrieve an attribute's value

Parameters
attrAttribute to retrieve value from
resultPointer to location to receive result
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure

The returned string will have its reference count increased. It is the responsibility of the caller to unref the string once it has finished with it.

◆ _dom_attr_initialise()

dom_exception _dom_attr_initialise ( dom_attr a,
struct dom_document doc,
dom_string name,
dom_string namespace,
dom_string prefix,
bool  specified,
struct dom_attr **  result 
)

Initialise a dom_attr

Parameters
aThe dom_attr
docThe document
nameThe name of this attribute node
namespaceThe namespace of this attribute
prefixThe prefix
specifiedWhether this node is a specified one
resultThe returned node
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ _dom_attr_is_default_namespace()

dom_exception _dom_attr_is_default_namespace ( dom_node_internal node,
dom_string namespace,
bool *  result 
)

◆ _dom_attr_is_id()

dom_exception _dom_attr_is_id ( struct dom_attr attr,
bool *  result 
)

Determine if an attribute if of type ID

Parameters
attrThe attribute to inspect
resultPointer to location to receive result
Returns
DOM_NO_ERR.

◆ _dom_attr_lookup_namespace()

dom_exception _dom_attr_lookup_namespace ( dom_node_internal node,
dom_string prefix,
dom_string **  result 
)

◆ _dom_attr_lookup_prefix()

dom_exception _dom_attr_lookup_prefix ( dom_node_internal node,
dom_string namespace,
dom_string **  result 
)

◆ _dom_attr_normalize()

dom_exception _dom_attr_normalize ( dom_node_internal node)

◆ _dom_attr_readonly()

bool _dom_attr_readonly ( const dom_attr a)

Whether this attribute node is readonly

Parameters
aThe node
Returns
true if this Attr is readonly, false otherwise

◆ _dom_attr_set_isid()

void _dom_attr_set_isid ( struct dom_attr attr,
bool  is_id 
)

Set/Unset whether this attribute is a ID attribute

Parameters
attrThe attribute
is_idWhether it is a ID attribute

◆ _dom_attr_set_prefix()

dom_exception _dom_attr_set_prefix ( dom_node_internal node,
dom_string prefix 
)

◆ _dom_attr_set_specified()

void _dom_attr_set_specified ( struct dom_attr attr,
bool  specified 
)

Set/Unset whether the attribute is a specified one.

Parameters
attrThe attribute node
specifiedWhether this attribute is a specified one

◆ _dom_attr_set_value()

dom_exception _dom_attr_set_value ( struct dom_attr attr,
dom_string value 
)

Set an attribute's value

Parameters
attrAttribute to retrieve value from
valueNew value for attribute
Returns
DOM_NO_ERR on success, DOM_NO_MODIFICATION_ALLOWED_ERR if attribute is readonly.