libdom
|
#include <assert.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <dom/core/attr.h>
#include <dom/core/document.h>
#include <dom/core/node.h>
#include <dom/core/string.h>
#include "core/attr.h"
#include "core/document.h"
#include "core/entity_ref.h"
#include "core/node.h"
#include "core/element.h"
#include "utils/utils.h"
Classes | |
struct | dom_attr |
void __dom_attr_destroy | ( | dom_node_internal * | node | ) |
dom_exception _dom_attr_clone_node | ( | dom_node_internal * | node, |
bool | deep, | ||
dom_node_internal ** | result ) |
dom_exception _dom_attr_copy | ( | dom_node_internal * | n, |
dom_node_internal ** | copy ) |
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
doc | The owning document |
name | The (local) name of the node to create |
namespace | The namespace URI of the attribute, or NULL |
prefix | The namespace prefix of the attribute, or NULL |
specified | Whether this attribute is specified |
result | Pointer to location to receive created attribute |
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.
void _dom_attr_destroy | ( | struct dom_attr * | attr | ) |
Destroy an attribute node
attr | The attribute to destroy |
The contents of attr
will be destroyed and attr
will be freed
void _dom_attr_finalise | ( | dom_attr * | attr | ) |
dom_exception _dom_attr_get_name | ( | struct dom_attr * | attr, |
dom_string ** | result ) |
Retrieve an attribute's name
attr | Attribute to retrieve name from |
result | Pointer to location to receive result |
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_exception _dom_attr_get_node_value | ( | dom_node_internal * | node, |
dom_string ** | result ) |
dom_exception _dom_attr_get_owner | ( | struct dom_attr * | attr, |
struct dom_element ** | result ) |
Retrieve the owning element of an attribute
attr | The attribute to extract owning element from |
result | Pointer to location to receive result |
The returned node will have its reference count increased. The caller should unref it once it has finished with it.
dom_exception _dom_attr_get_schema_type_info | ( | struct dom_attr * | attr, |
struct dom_type_info ** | result ) |
Retrieve an attribute's type information
attr | The attribute to extract type information from |
result | Pointer to location to receive result |
The returned type info will have its reference count increased. The caller should unref it once it has finished with it.
dom_exception _dom_attr_get_specified | ( | struct dom_attr * | attr, |
bool * | result ) |
Determine if attribute was specified or default
attr | Attribute to inspect |
result | Pointer to location to receive result |
dom_exception _dom_attr_get_value | ( | struct dom_attr * | attr, |
dom_string ** | result ) |
Retrieve an attribute's value
attr | Attribute to retrieve value from |
result | Pointer to location to receive result |
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_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 ) |
dom_exception _dom_attr_is_default_namespace | ( | dom_node_internal * | node, |
dom_string * | namespace, | ||
bool * | result ) |
dom_exception _dom_attr_is_id | ( | struct dom_attr * | attr, |
bool * | result ) |
Determine if an attribute if of type ID
attr | The attribute to inspect |
result | Pointer to location to receive result |
dom_exception _dom_attr_lookup_namespace | ( | dom_node_internal * | node, |
dom_string * | prefix, | ||
dom_string ** | result ) |
dom_exception _dom_attr_lookup_prefix | ( | dom_node_internal * | node, |
dom_string * | namespace, | ||
dom_string ** | result ) |
bool _dom_attr_readonly | ( | const dom_attr * | a | ) |
Whether this attribute node is readonly
a | The node |
void _dom_attr_set_isid | ( | struct dom_attr * | attr, |
bool | is_id ) |
Set/Unset whether this attribute is a ID attribute
attr | The attribute |
is_id | Whether it is a ID attribute |
dom_exception _dom_attr_set_prefix | ( | dom_node_internal * | node, |
dom_string * | prefix ) |
void _dom_attr_set_specified | ( | struct dom_attr * | attr, |
bool | specified ) |
Set/Unset whether the attribute is a specified one.
attr | The attribute node |
specified | Whether this attribute is a specified one |
dom_exception _dom_attr_set_value | ( | struct dom_attr * | attr, |
dom_string * | value ) |
Set an attribute's value
attr | Attribute to retrieve value from |
value | New value for attribute |
dom_exception dom_attr_get_bool | ( | dom_attr * | a, |
bool * | value ) |
Get the bool value of this attribute
a | The attribute object |
value | The returned value |
dom_exception dom_attr_get_integer | ( | dom_attr * | a, |
uint32_t * | value ) |
Get the integer value of this attribute
a | The attribute object |
value | The returned value |
dom_exception dom_attr_get_short | ( | dom_attr * | a, |
unsigned short * | value ) |
Get the short value of this attribute
a | The attribute object |
value | The returned value |
dom_attr_type dom_attr_get_type | ( | dom_attr * | a | ) |
Get the Attr Node type
a | The attribute node |
void dom_attr_mark_readonly | ( | dom_attr * | a | ) |
Set the node as a readonly attribute
a | The attribute |
dom_exception dom_attr_set_bool | ( | dom_attr * | a, |
bool | value ) |
Set the bool value of this attribute
a | The attribute object |
value | The new value |
dom_exception dom_attr_set_integer | ( | dom_attr * | a, |
uint32_t | value ) |
Set the integer value of this attribute
a | The attribute object |
value | The new value |
dom_exception dom_attr_set_short | ( | dom_attr * | a, |
unsigned short | value ) |
Set the short value of this attribute
a | The attribute object |
value | The new value |