|
libdom
|
#include <assert.h>#include <stdlib.h>#include <dom/core/characterdata.h>#include <dom/core/string.h>#include <dom/events/events.h>#include "core/characterdata.h"#include "core/document.h"#include "core/node.h"#include "utils/utils.h"#include "events/mutation_event.h"Variables | |
| const struct dom_characterdata_vtable | characterdata_vtable |
| dom_exception _dom_characterdata_append_data | ( | struct dom_characterdata * | cdata, |
| dom_string * | data | ||
| ) |
Append data to the end of a character data node's content
| cdata | The node to append data to |
| data | The data to append |
cdata is readonly. | dom_exception _dom_characterdata_copy | ( | dom_node_internal * | old, |
| dom_node_internal ** | copy | ||
| ) |
| dom_exception _dom_characterdata_copy_internal | ( | dom_characterdata * | old, |
| dom_characterdata * | new | ||
| ) |
| dom_characterdata * _dom_characterdata_create | ( | void | ) |
| dom_exception _dom_characterdata_delete_data | ( | struct dom_characterdata * | cdata, |
| uint32_t | offset, | ||
| uint32_t | count | ||
| ) |
Delete data from a character data node's content
| cdata | The node to delete from |
| offset | The character offset to start deletion from |
| count | The number of characters to delete |
offset is negative or greater than the number of characters in cdata or count is negative, DOM_NO_MODIFICATION_ALLOWED_ERR if cdata is readonly. | void _dom_characterdata_destroy | ( | struct dom_node_internal * | node | ) |
| void _dom_characterdata_finalise | ( | struct dom_characterdata * | cdata | ) |
Finalise a character data node
| cdata | The node to finalise |
The contents of cdata will be cleaned up. cdata will not be freed.
| dom_exception _dom_characterdata_get_data | ( | struct dom_characterdata * | cdata, |
| dom_string ** | data | ||
| ) |
Retrieve data from a character data node
| cdata | Character data node to retrieve data from |
| data | Pointer to location to receive data |
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.
DOM3Core states that this can raise DOMSTRING_SIZE_ERR. It will not in this implementation; dom_strings are unbounded.
| dom_exception _dom_characterdata_get_length | ( | struct dom_characterdata * | cdata, |
| uint32_t * | length | ||
| ) |
Get the length (in characters) of a character data node's content
| cdata | Node to read content length of |
| length | Pointer to location to receive character length of content |
| dom_exception _dom_characterdata_get_text_content | ( | dom_node_internal * | node, |
| dom_string ** | result | ||
| ) |
| dom_exception _dom_characterdata_initialise | ( | struct dom_characterdata * | cdata, |
| struct dom_document * | doc, | ||
| dom_node_type | type, | ||
| dom_string * | name, | ||
| dom_string * | value | ||
| ) |
Initialise a character data node
| cdata | The character data node to initialise |
| doc | The document which owns the node |
| type | The node type required |
| name | The node name, or NULL |
| value | The node value, or NULL |
doc, name and value will have their reference counts increased.
| dom_exception _dom_characterdata_insert_data | ( | struct dom_characterdata * | cdata, |
| uint32_t | offset, | ||
| dom_string * | data | ||
| ) |
Insert data into a character data node's content
| cdata | The node to insert into |
| offset | The character offset to insert at |
| data | The data to insert |
offset is negative or greater than the number of characters in cdata, DOM_NO_MODIFICATION_ALLOWED_ERR if cdata is readonly. | dom_exception _dom_characterdata_replace_data | ( | struct dom_characterdata * | cdata, |
| uint32_t | offset, | ||
| uint32_t | count, | ||
| dom_string * | data | ||
| ) |
Replace a section of a character data node's content
| cdata | The node to modify |
| offset | The character offset of the sequence to replace |
| count | The number of characters to replace |
| data | The replacement data |
offset is negative or greater than the number of characters in cdata or count is negative, DOM_NO_MODIFICATION_ALLOWED_ERR if cdata is readonly. | dom_exception _dom_characterdata_set_data | ( | struct dom_characterdata * | cdata, |
| dom_string * | data | ||
| ) |
Set the content of a character data node
| cdata | Node to set the content of |
| data | New value for node |
cdata is readonly.The new content will have its reference count increased, so the caller should unref it after the call (as the caller should have already claimed a reference on the string). The node's existing content will be unrefed.
| dom_exception _dom_characterdata_set_text_content | ( | dom_node_internal * | node, |
| dom_string * | content | ||
| ) |
| dom_exception _dom_characterdata_substring_data | ( | struct dom_characterdata * | cdata, |
| uint32_t | offset, | ||
| uint32_t | count, | ||
| dom_string ** | data | ||
| ) |
Extract a range of data from a character data node
| cdata | The node to extract data from |
| offset | The character offset of substring to extract |
| count | The number of characters to extract |
| data | Pointer to location to receive substring |
offset is negative or greater than the number of characters in cdata or count is negative.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.
DOM3Core states that this can raise DOMSTRING_SIZE_ERR. It will not in this implementation; dom_strings are unbounded.
| const struct dom_characterdata_vtable characterdata_vtable |