summaryrefslogtreecommitdiff
path: root/src/core/document.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2007-09-30 21:10:50 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2007-09-30 21:10:50 +0000
commit613f88393960853513873756933bd23b93543a33 (patch)
treef7f4c1acff769e9a7f6cd0f1c037ba2c28a66593 /src/core/document.h
parent5eba18a08b9821fa10cc03af8dbd7d1c10653b13 (diff)
downloadlibdom-613f88393960853513873756933bd23b93543a33.tar.gz
libdom-613f88393960853513873756933bd23b93543a33.tar.bz2
DOM Strings are now capable of containing either UTF-8 or UTF-16 encoded data.
The charset used for strings within a document is specified at document creation time. Whilst it is possible to mix charsets within a document, it's not recommended. Things that need fixing: + dom_string_get_data() doesn't return the charset. Better would be to permit the client to request a charset for the data to be returned in. + Interned node name strings will break if the document is UTF-16 (dom_document_create()). In fact, these could quite happily be globals, rather than allocating a set for each document. + Other usage of dom string constructors need checking for sanity + DOM Strings need to gain more utility APIs (such as getting the character length of a string, string concatenation etc). svn path=/trunk/dom/; revision=3614
Diffstat (limited to 'src/core/document.h')
-rw-r--r--src/core/document.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/document.h b/src/core/document.h
index 367b1ec..5149f2e 100644
--- a/src/core/document.h
+++ b/src/core/document.h
@@ -12,12 +12,12 @@
#include <stddef.h>
#include <dom/core/node.h>
+#include <dom/core/string.h>
struct dom_document;
struct dom_namednodemap;
struct dom_node;
struct dom_nodelist;
-struct dom_string;
/* Destroy a document */
void dom_document_destroy(struct dom_document *doc);
@@ -25,6 +25,9 @@ void dom_document_destroy(struct dom_document *doc);
/* Get base of document buffer */
const uint8_t *dom_document_get_base(struct dom_document *doc);
+/* Get the document character set */
+dom_string_charset dom_document_get_charset(struct dom_document *doc);
+
/* (De)allocate memory */
void *dom_document_alloc(struct dom_document *doc, void *ptr, size_t size);