summaryrefslogtreecommitdiff
path: root/include/dom/core/string.h
diff options
context:
space:
mode:
authorBo Yang <struggleyb.nku@gmail.com>2009-08-11 11:17:23 +0000
committerBo Yang <struggleyb.nku@gmail.com>2009-08-11 11:17:23 +0000
commit399da01ae4eb5c5e3e9349bacc2063c946c3d4a1 (patch)
tree433c8bcde94fc7a6e6f2e5cbf23842a84db98146 /include/dom/core/string.h
parenteec057c7437e19b59ca1e698ce548cb56ce37240 (diff)
downloadlibdom-399da01ae4eb5c5e3e9349bacc2063c946c3d4a1.tar.gz
libdom-399da01ae4eb5c5e3e9349bacc2063c946c3d4a1.tar.bz2
Merge the branches/struggleyb/libdom-remain back to trunk.
svn path=/trunk/dom/; revision=9191
Diffstat (limited to 'include/dom/core/string.h')
-rw-r--r--include/dom/core/string.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/dom/core/string.h b/include/dom/core/string.h
index 37d78d6..2502623 100644
--- a/include/dom/core/string.h
+++ b/include/dom/core/string.h
@@ -10,10 +10,12 @@
#include <inttypes.h>
#include <stddef.h>
+#include <libwapcaplet/libwapcaplet.h>
#include <dom/functypes.h>
#include <dom/core/exceptions.h>
+
typedef struct dom_string dom_string;
/* Claim a reference on a DOM string */
@@ -25,6 +27,14 @@ void dom_string_unref(struct dom_string *str);
dom_exception dom_string_create(dom_alloc alloc, void *pw,
const uint8_t *ptr, size_t len, struct dom_string **str);
+/* Clone a dom_string */
+dom_exception dom_string_clone(dom_alloc alloc, void *pw,
+ struct dom_string *str, struct dom_string **ret);
+
+/* Get the internal lwc_string */
+dom_exception dom_string_get_intern(struct dom_string *str,
+ struct lwc_context_s **ctx, struct lwc_string_s **lwcstr);
+
/* Case sensitively compare two DOM strings */
int dom_string_cmp(struct dom_string *s1, struct dom_string *s2);
/* Case insensitively compare two DOM strings */
@@ -38,6 +48,12 @@ uint32_t dom_string_rindex(struct dom_string *str, uint32_t chr);
/* Get the length, in characters, of a dom string */
uint32_t dom_string_length(struct dom_string *str);
+/* Get the UCS-4 character at position index, the index should be in
+ * [0, length), and length can be get by calling dom_string_length
+ */
+dom_exception dom_string_at(struct dom_string *str, uint32_t index,
+ uint32_t *ch);
+
/* Concatenate two dom strings */
dom_exception dom_string_concat(struct dom_string *s1, struct dom_string *s2,
struct dom_string **result);