summaryrefslogtreecommitdiff
path: root/src/core/string.h
blob: 46704d8a67f0b205f0f42bee20a07171c77adf99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * This file is part of libdom.
 * Licensed under the MIT License,
 *                http://www.opensource.org/licenses/mit-license.php
 * Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
 */

#ifndef dom_internal_core_string_h_
#define dom_internal_core_string_h_

#include <dom/core/string.h>

/* Create a DOM string from a lwc_string
 * This function call mainly used for create a string from lwc_string */
dom_exception _dom_string_create_from_lwcstring(dom_alloc alloc, void *pw,
		struct lwc_context_s *ctx, struct lwc_string_s *str, 
		struct dom_string **ret);

/* Make the dom_string be interned in the lwc_context */
dom_exception _dom_string_intern(struct dom_string *str, 
		struct lwc_context_s *ctx, struct lwc_string_s **lwcstr);

/* Compare the raw data of two lwc_strings for equality when the two strings
 * belong to different lwc_context */
int _dom_lwc_string_compare_raw(struct lwc_string_s *s1,
		struct lwc_string_s *s2);

/* Map the lwc_error to dom_exception */
dom_exception _dom_exception_from_lwc_error(lwc_error err);

/**
 * Get the raw character data of the dom_string.
 * @note: This function is just provided for the convenience of accessing the 
 * raw C string character, no change on the result string is allowed.
 */
char *_dom_string_data(struct dom_string *str);

/* Get the string length of this dom_string */
size_t _dom_string_length(struct dom_string *str);

#endif